diff --git a/.copyright-overrides.yml b/.copyright-overrides.yml index 46d30394c173d..8b2abfaad8be4 100644 --- a/.copyright-overrides.yml +++ b/.copyright-overrides.yml @@ -378,3 +378,15 @@ github.com/GoogleCloudPlatform/grpc-gcp-go/grpcgcp/multiendpoint: Copyright 2024 github.com/NVIDIA/go-nvml/*: Copyright 2023 NVIDIA CORPORATION github.com/jonboulle/clockwork: Copyright 2014 Nell Boulle + +github.com/nozzle/throttler: Copyright 2018 Derek Perkins +github.com/openvex/discovery/*: Copyright 2023 The OpenVEX Authors +github.com/sassoftware/relic/*: Copyright (c) SAS Institute Inc. +github.com/transparency-dev/merkle: Copyright 2017 Google LLC. All Rights Reserved. +github.com/transparency-dev/merkle/compact: Copyright 2019 Google LLC. All Rights Reserved. +github.com/transparency-dev/merkle/proof: +- Copyright 2017 Google LLC. All Rights Reserved. +- Copyright 2022 Google LLC. All Rights Reserved. +github.com/transparency-dev/merkle/rfc6962: Copyright 2016 Google LLC. All Rights Reserved. + +gopkg.in/go-jose/go-jose.v2: Copyright 2014 Square Inc. \ No newline at end of file diff --git a/.ddqa/config.toml b/.ddqa/config.toml index eac6d757e5282..bcb6804917e41 100644 --- a/.ddqa/config.toml +++ b/.ddqa/config.toml @@ -48,7 +48,7 @@ jira_issue_type = "Task" jira_statuses = ["To Do", "In Progress", "Done"] github_team = "agent-delivery" github_labels = ["team/agent-delivery"] -exclude_members = ["hithwen"] +exclude_members = ["KSerrania"] [teams."Universal Service Monitoring"] jira_project = "USMON" @@ -176,12 +176,12 @@ jira_statuses = ["To Do", "In Progress", "Done"] github_team = "agent-cspm" github_labels = ["team/agent-cspm"] -[teams."Processes"] -jira_project = "PROCS" +[teams."Container Intake"] +jira_project = "CTK" jira_issue_type = "Task" jira_statuses = ["TRIAGE", "In Progress", "Done"] -github_team = "processes" -github_labels = ["team/processes"] +github_team = "container-intake" +github_labels = ["team/container-intake"] [teams."Windows Agent"] jira_project = "WINA" diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index cd6fe7ade112c..24c15c4a3b6cd 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -50,19 +50,21 @@ /.circleci/ @DataDog/agent-devx-infra -/.github/CODEOWNERS # do not notify anyone -/.github/*_TEMPLATE.md @DataDog/agent-devx-loops -/.github/dependabot.yaml @DataDog/agent-devx-infra -/.github/workflows/serverless-benchmarks.yml @DataDog/serverless @Datadog/serverless-aws -/.github/workflows/serverless-binary-size.yml @DataDog/serverless @Datadog/serverless-aws -/.github/workflows/serverless-integration.yml @DataDog/serverless @Datadog/serverless-aws -/.github/workflows/cws-btfhub-sync.yml @DataDog/agent-security -/.github/workflows/gohai.yml @DataDog/agent-shared-components -/.github/workflows/go-update-commenter.yml @DataDog/agent-shared-components -/.github/workflows/buildimages-update.yml @DataDog/agent-delivery @DataDog/agent-shared-components - -/.run @DataDog/agent-devx-loops -/.run/docker/ @DataDog/container-integrations @DataDog/container-platform +/.github/CODEOWNERS # do not notify anyone +/.github/*_TEMPLATE.md @DataDog/agent-devx-loops +/.github/dependabot.yaml @DataDog/agent-devx-infra +/.github/workflows/serverless-benchmarks.yml @DataDog/serverless @Datadog/serverless-aws +/.github/workflows/serverless-binary-size.yml @DataDog/serverless @Datadog/serverless-aws +/.github/workflows/serverless-integration.yml @DataDog/serverless @Datadog/serverless-aws +/.github/workflows/cws-btfhub-sync.yml @DataDog/agent-security +/.github/workflows/gohai.yml @DataDog/agent-shared-components +/.github/workflows/go-update-commenter.yml @DataDog/agent-shared-components +/.github/workflows/update_dependencies.yml @DataDog/agent-shared-components +/.github/workflows/buildimages-update.yml @DataDog/agent-delivery @DataDog/agent-shared-components +/.github/workflows/collector-generate-and-update.yml @DataDog/opentelemetry + +/.run @DataDog/agent-devx-loops +/.run/docker/ @DataDog/container-integrations @DataDog/container-platform # Gitlab files # Files containing job contents are owned by teams in charge of the jobs + agent-devx-infra or agent-delivery @@ -118,12 +120,13 @@ /.gitlab/binary_build/system_probe.yml @DataDog/ebpf-platform @DataDog/agent-delivery /.gitlab/binary_build/windows.yml @DataDog/agent-delivery @DataDog/windows-agent -/.gitlab/benchmarks/ @DataDog/agent-devx-infra @DataDog/apm-reliability-and-performance @DataDog/agent-apm +/.gitlab/benchmarks/ @DataDog/agent-devx-infra @DataDog/apm-ecosystems-performance @DataDog/agent-apm /.gitlab/deploy_containers/ @DataDog/container-integrations @DataDog/agent-delivery /.gitlab/deploy_dca/ @DataDog/container-integrations @DataDog/agent-delivery /.gitlab/deploy_packages/ @DataDog/agent-delivery +/.gitlab/deploy_packages/oci.yml @DataDog/agent-delivery @DataDog/fleet /.gitlab/deploy_packages/windows.yml @DataDog/agent-delivery @DataDog/windows-agent /.gitlab/deploy_packages/winget.yml @DataDog/agent-delivery @DataDog/windows-agent /.gitlab/deploy_packages/cluster_agent_cloudfoundry.yml @DataDog/platform-integrations @DataDog/agent-devx-infra @@ -146,7 +149,6 @@ /.gitlab/powershell_script_deploy @DataDog/agent-delivery @DataDog/windows-agent /.gitlab/choco_build/choco_build.yml @DataDog/agent-delivery @DataDog/windows-agent -/.gitlab/choco_deploy/choco_deploy.yml @DataDog/agent-delivery @DataDog/windows-agent /.gitlab/integration_test/windows.yml @DataDog/agent-devx-infra @DataDog/windows-agent @@ -174,6 +176,7 @@ /.gitlab/package_build/ @DataDog/agent-delivery /.gitlab/package_build/windows.yml @DataDog/agent-delivery @DataDog/windows-agent +/.gitlab/package_build/installer.yml @DataDog/agent-delivery @DataDog/fleet /.gitlab/packaging/ @DataDog/agent-delivery /.gitlab/benchmarks/benchmarks.yml @DataDog/agent-apm @@ -192,6 +195,7 @@ /cmd/agent/subcommands/remoteconfig @Datadog/remote-config /cmd/agent/subcommands/snmp @DataDog/ndm-core /cmd/agent/subcommands/streamlogs @DataDog/agent-metrics-logs +/cmd/agent/subcommands/analyzelogs @DataDog/agent-metrics-logs /cmd/agent/subcommands/streamep @DataDog/container-integrations /cmd/agent/subcommands/taggerlist @DataDog/container-platform /cmd/agent/subcommands/workloadlist @DataDog/container-platform @@ -216,7 +220,7 @@ /cmd/cws-instrumentation/ @DataDog/agent-security /cmd/dogstatsd/ @DataDog/agent-metrics-logs /cmd/otel-agent/ @DataDog/opentelemetry -/cmd/process-agent/ @DataDog/processes +/cmd/process-agent/ @DataDog/container-intake /cmd/serverless/ @DataDog/serverless @Datadog/serverless-aws /cmd/serverless-init/ @DataDog/serverless /cmd/system-probe/ @DataDog/ebpf-platform @@ -225,12 +229,12 @@ /cmd/system-probe/config/adjust_security.go @DataDog/ebpf-platform @DataDog/agent-security /cmd/system-probe/modules/network_tracer* @DataDog/Networks /cmd/system-probe/modules/oom_kill_probe* @DataDog/container-integrations -/cmd/system-probe/modules/process* @DataDog/processes +/cmd/system-probe/modules/process* @DataDog/container-intake /cmd/system-probe/modules/eventmonitor* @DataDog/agent-security /cmd/system-probe/modules/tcp_queue_tracer* @DataDog/container-integrations /cmd/system-probe/modules/traceroute* @DataDog/network-device-monitoring @Datadog/Networks /cmd/system-probe/modules/ping* @DataDog/ndm-core -/cmd/system-probe/modules/language_detection* @DataDog/processes @DataDog/universal-service-monitoring +/cmd/system-probe/modules/language_detection* @DataDog/container-intake @DataDog/universal-service-monitoring /cmd/system-probe/modules/dynamic_instrumentation* @DataDog/debugger /cmd/system-probe/windows_resources/ @DataDog/windows-kernel-integrations /cmd/system-probe/main_windows*.go @DataDog/windows-kernel-integrations @@ -268,6 +272,7 @@ /go.mod # do not notify anyone /go.sum # do not notify anyone + /Makefile.trace @DataDog/agent-apm /omnibus/ @DataDog/agent-delivery @@ -297,7 +302,7 @@ /comp/netflow @DataDog/ndm-integrations /comp/networkpath @DataDog/Networks @DataDog/network-device-monitoring /comp/otelcol @DataDog/opentelemetry -/comp/process @DataDog/processes +/comp/process @DataDog/container-intake /comp/remote-config @DataDog/remote-config /comp/snmptraps @DataDog/ndm-core /comp/systray @DataDog/windows-agent @@ -389,7 +394,7 @@ /pkg/collector/corechecks/ebpf/c/runtime/ebpf* @DataDog/ebpf-platform /pkg/collector/corechecks/embed/ @Datadog/agent-delivery /pkg/collector/corechecks/embed/apm/ @DataDog/agent-apm -/pkg/collector/corechecks/embed/process/ @DataDog/processes +/pkg/collector/corechecks/embed/process/ @DataDog/container-intake /pkg/collector/corechecks/gpu/ @DataDog/ebpf-platform /pkg/collector/corechecks/network-devices/ @DataDog/ndm-integrations /pkg/collector/corechecks/orchestrator/ @DataDog/container-app @@ -411,7 +416,7 @@ /pkg/config/autodiscovery/ @DataDog/container-integrations @DataDog/container-platform /pkg/config/env @DataDog/container-integrations @DataDog/container-platform /pkg/config/setup @DataDog/agent-shared-components -/pkg/config/setup/process*.go @DataDog/processes +/pkg/config/setup/process*.go @DataDog/container-intake /pkg/config/setup/system_probe.go @DataDog/ebpf-platform /pkg/config/setup/system_probe_cws.go @DataDog/agent-security /pkg/config/setup/system_probe_cws_notwin.go @DataDog/agent-security @@ -431,11 +436,12 @@ /pkg/flare/*_windows.go @Datadog/windows-agent /pkg/flare/*_windows_test.go @Datadog/windows-agent /pkg/fleet/ @DataDog/fleet @DataDog/windows-agent +/pkg/fleet/installer/setup/djm/ @DataDog/fleet @DataDog/data-jobs-monitoring /pkg/pidfile/ @DataDog/agent-shared-components /pkg/persistentcache/ @DataDog/agent-metrics-logs /pkg/proto/ @DataDog/agent-shared-components -/pkg/proto/datadog/languagedetection @DataDog/processes -/pkg/proto/datadog/process @DataDog/processes +/pkg/proto/datadog/languagedetection @DataDog/container-intake +/pkg/proto/datadog/process @DataDog/container-intake /pkg/proto/datadog/trace @DataDog/agent-apm /pkg/proto/datadog/workloadmeta @DataDog/container-platform /pkg/remoteconfig/ @DataDog/remote-config @@ -470,7 +476,7 @@ /pkg/util/testutil/patternscanner.go @DataDog/universal-service-monitoring @DataDog/ebpf-platform /pkg/util/testutil/docker @DataDog/universal-service-monitoring @DataDog/ebpf-platform /pkg/util/trie @DataDog/container-integrations -/pkg/languagedetection @DataDog/processes @DataDog/universal-service-monitoring +/pkg/languagedetection @DataDog/container-intake @DataDog/universal-service-monitoring /pkg/linters/ @DataDog/agent-devx-loops /pkg/linters/components/ @DataDog/agent-shared-components /pkg/logs/ @DataDog/agent-metrics-logs @@ -484,19 +490,18 @@ /pkg/logs/processor @DataDog/agent-processing-and-routing /pkg/logs/sds @DataDog/agent-processing-and-routing /pkg/logs/sender @DataDog/agent-processing-and-routing -/pkg/process/ @DataDog/processes +/pkg/process/ @DataDog/container-intake /pkg/process/util/address*.go @DataDog/Networks /pkg/process/checks/net*.go @DataDog/Networks -/pkg/process/metadata/parser/ @DataDog/universal-service-monitoring @DataDog/processes @DataDog/Networks -/pkg/process/metadata/parser/*windows* @DataDog/universal-service-monitoring @DataDog/processes @DataDog/Networks @DataDog/windows-kernel-integrations +/pkg/process/metadata/parser/ @DataDog/universal-service-monitoring @DataDog/container-intake @DataDog/Networks +/pkg/process/metadata/parser/*windows* @DataDog/universal-service-monitoring @DataDog/container-intake @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 /pkg/proto/pbgo/languagedetection @DataDog/agent-apm -/pkg/proto/pbgo/process @DataDog/processes +/pkg/proto/pbgo/process @DataDog/container-intake /pkg/proto/pbgo/core @DataDog/agent-shared-components /pkg/proto/pbgo/core/remoteconfig.pb.go @DataDog/remote-config /pkg/proto/pbgo/core/remoteconfig_gen.go @DataDog/remote-config @@ -557,7 +562,7 @@ /tasks/unit_tests/update_go_tests.py @DataDog/agent-shared-components /tasks/cluster_agent_cloudfoundry.py @DataDog/platform-integrations /tasks/new_e2e_tests.py @DataDog/agent-e2e-testing @DataDog/agent-devx-loops -/tasks/process_agent.py @DataDog/processes +/tasks/process_agent.py @DataDog/container-intake /tasks/system_probe.py @DataDog/ebpf-platform /tasks/ebpf.py @DataDog/ebpf-platform /tasks/kmt.py @DataDog/ebpf-platform @@ -571,6 +576,7 @@ /tasks/winbuildscripts/ @DataDog/windows-agent /tasks/winbuild.py @DataDog/windows-agent /tasks/windows_resources.py @DataDog/windows-agent +/tasks/collector.py @DataDog/opentelemetry /tasks/components.py @DataDog/agent-shared-components /tasks/components_templates @DataDog/agent-shared-components /tasks/libs/ciproviders/ @DataDog/agent-devx-infra @@ -603,14 +609,15 @@ /test/new-e2e/tests/containers @DataDog/container-integrations @DataDog/container-platform /test/new-e2e/tests/discovery @DataDog/universal-service-monitoring /test/new-e2e/tests/ha-agent @DataDog/ndm-core -/test/new-e2e/tests/language-detection @DataDog/processes +/test/new-e2e/tests/language-detection @DataDog/container-intake /test/new-e2e/tests/ndm @DataDog/ndm-core /test/new-e2e/tests/ndm/netflow @DataDog/ndm-integrations +/test/new-e2e/tests/netpath @DataDog/Networks @DataDog/network-device-monitoring /test/new-e2e/tests/npm @DataDog/Networks /test/new-e2e/tests/npm/ec2_1host_wkit_test.go @DataDog/Networks @DataDog/windows-kernel-integrations /test/new-e2e/tests/orchestrator @DataDog/container-app /test/new-e2e/tests/otel @DataDog/opentelemetry -/test/new-e2e/tests/process @DataDog/processes +/test/new-e2e/tests/process @DataDog/container-intake /test/new-e2e/tests/sysprobe-functional @DataDog/windows-kernel-integrations /test/new-e2e/tests/security-agent-functional @DataDog/windows-kernel-integrations @DataDog/agent-security /test/new-e2e/tests/cws @DataDog/agent-security @@ -619,6 +626,7 @@ /test/new-e2e/tests/apm @DataDog/agent-apm /test/new-e2e/tests/remote-config @DataDog/remote-config /test/new-e2e/tests/installer @DataDog/fleet @DataDog/windows-agent +/test/new-e2e/tests/installer/script @DataDog/fleet @DataDog/data-jobs-monitoring /test/new-e2e/tests/gpu @Datadog/ebpf-platform /test/otel/ @DataDog/opentelemetry /test/system/ @DataDog/agent-shared-components @@ -641,3 +649,16 @@ /internal/third_party/client-go @DataDog/container-platform /internal/third_party/kubernetes @DataDog/container-integrations /internal/third_party/golang/ @DataDog/container-integrations + +# With the introduction of go.work, dependencies bump modify go.mod and go.sum in a lot of file. +# Which bring a lot of team in the review each time. To make it smoother we no longer consider go.mod and go.sum owned by teams. +# Each team can individually decide to update CODEOWNERS to be requested for a review on each modification of their go.mod/sum +/**/go.mod # do not notify anyone +/**/go.sum # do not notify anyone + +# Add here modules that need explicit review from the team owning them +/internal/tools/**/go.mod @DataDog/agent-devx-loops +/internal/tools/**/go.sum @DataDog/agent-devx-loops + +/pkg/util/scrubber/go.mod @DataDog/agent-shared-components +/pkg/util/scrubber/go.sum @DataDog/agent-shared-components diff --git a/.github/dependabot.yaml b/.github/dependabot.yaml index fbbec5da82991..1af1fdc9fdcc5 100644 --- a/.github/dependabot.yaml +++ b/.github/dependabot.yaml @@ -27,6 +27,11 @@ updates: - dependency-name: github.com/ugorji/go # Ignore internal modules - dependency-name: github.com/DataDog/datadog-agent/* + # Ignore golang.org/x/... deps to avoid noise, they are updated together, pretty regularly + - dependency-name: golang.org/x/* + # OpenTelemetry collector packages need to be updated with inv rather than dependabot + - dependency-name: go.opentelemetry.io/collector/* + - dependency-name: github.com/open-telemetry/opentelemetry-collector-contrib/* schedule: interval: weekly open-pull-requests-limit: 100 @@ -52,6 +57,11 @@ updates: - dependency-name: github.com/DataDog/datadog-agent/* # See https://github.com/DataDog/datadog-agent/pull/10112 - dependency-name: github.com/mailru/easyjson + # Ignore golang.org/x/... deps to avoid noise, they are updated together, pretty regularly + - dependency-name: golang.org/x/* + # OpenTelemetry collector packages need to be updated with inv rather than dependabot + - dependency-name: go.opentelemetry.io/collector/* + - dependency-name: github.com/open-telemetry/opentelemetry-collector-contrib/* schedule: interval: weekly open-pull-requests-limit: 100 @@ -67,6 +77,8 @@ updates: - dependency-name: github.com/DataDog/datadog-agent/* # See https://github.com/DataDog/datadog-agent/pull/10112 - dependency-name: github.com/mailru/easyjson + # Ignore golang.org/x/... deps to avoid noise, they are updated together, pretty regularly + - dependency-name: golang.org/x/* schedule: interval: weekly open-pull-requests-limit: 100 @@ -82,6 +94,8 @@ updates: - dependency-name: github.com/DataDog/datadog-agent/* # See https://github.com/DataDog/datadog-agent/pull/10112 - dependency-name: github.com/mailru/easyjson + # Ignore golang.org/x/... deps to avoid noise, they are updated together, pretty regularly + - dependency-name: golang.org/x/* schedule: interval: weekly open-pull-requests-limit: 100 @@ -95,6 +109,8 @@ updates: ignore: # Ignore internal modules - dependency-name: github.com/DataDog/datadog-agent/* + # Ignore golang.org/x/... deps to avoid noise, they are updated together, pretty regularly + - dependency-name: golang.org/x/* schedule: interval: weekly open-pull-requests-limit: 100 @@ -113,6 +129,9 @@ updates: - qa/no-code-change schedule: interval: monthly + ignore: + # Ignore golang.org/x/... deps to avoid noise, they are updated together, pretty regularly + - dependency-name: golang.org/x/* open-pull-requests-limit: 100 - package-ecosystem: gomod directory: /pkg/networkdevice/profile @@ -124,6 +143,8 @@ updates: ignore: # Ignore internal modules - dependency-name: github.com/DataDog/datadog-agent/* + # Ignore golang.org/x/... deps to avoid noise, they are updated together, pretty regularly + - dependency-name: golang.org/x/* schedule: interval: weekly open-pull-requests-limit: 100 @@ -144,6 +165,8 @@ updates: # Do not bump dependencies that come from test-infra-definitions, they will be bumped when we'll bump the version # https://datadoghq.atlassian.net/browse/ADXT-375 - dependency-name: github.com/pulumi* + # Ignore golang.org/x/... deps to avoid noise, they are updated together, pretty regularly + - dependency-name: golang.org/x/* schedule: interval: weekly @@ -160,6 +183,9 @@ updates: schedule: interval: weekly open-pull-requests-limit: 100 + ignore: + # Ignore golang.org/x/... deps to avoid noise, they are updated together, pretty regularly + - dependency-name: golang.org/x/* - package-ecosystem: docker directory: /test/fakeintake labels: diff --git a/.github/workflows/add_milestone.yml b/.github/workflows/add_milestone.yml index 33885369f0e0c..6bcd28e967c2e 100644 --- a/.github/workflows/add_milestone.yml +++ b/.github/workflows/add_milestone.yml @@ -22,7 +22,7 @@ jobs: GH_REPO: ${{ github.repository }} steps: - name: Checkout datadog-agent repository - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: persist-credentials: false diff --git a/.github/workflows/assign_issue.yml b/.github/workflows/assign_issue.yml index f752788cf64c8..0230f9d7c4d6f 100644 --- a/.github/workflows/assign_issue.yml +++ b/.github/workflows/assign_issue.yml @@ -26,5 +26,6 @@ jobs: - name: Assign issue env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SLACK_API_TOKEN : ${{ secrets.SLACK_DATADOG_AGENT_BOT_TOKEN }} run: | inv -e issue.assign-owner -i ${{ github.event.issue.number }} diff --git a/.github/workflows/buildimages-update.yml b/.github/workflows/buildimages-update.yml index 1138e8557d011..77e03aaea03e1 100644 --- a/.github/workflows/buildimages-update.yml +++ b/.github/workflows/buildimages-update.yml @@ -35,7 +35,7 @@ jobs: steps: - name: Checkout branch - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: # credentials are needed to create the PR at the end of the workflow persist-credentials: true @@ -53,7 +53,7 @@ jobs: fi - name: Checkout branch - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 if: ${{ steps.branch_fetch.outputs.RESULT == 'true' }} with: ref: ${{ inputs.branch }} @@ -66,7 +66,7 @@ jobs: python-version: 3.11 cache: "pip" - - uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 + - uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0 with: # use the go version from the input, not from the .go-version file # in case it's a Go update PR diff --git a/.github/workflows/chase_release_managers.yml b/.github/workflows/chase_release_managers.yml index 436217659ae48..475068736efea 100644 --- a/.github/workflows/chase_release_managers.yml +++ b/.github/workflows/chase_release_managers.yml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: ref: ${{ github.head_ref }} persist-credentials: false diff --git a/.github/workflows/code_review_complexity.yml b/.github/workflows/code_review_complexity.yml index 8c26254f6c626..3f36b387e0f34 100644 --- a/.github/workflows/code_review_complexity.yml +++ b/.github/workflows/code_review_complexity.yml @@ -21,7 +21,7 @@ jobs: pull-requests: write steps: - name: Checkout repository - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: persist-credentials: false - name: Setup python diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 884c65f390ee8..958e4cbbb1a5c 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -23,7 +23,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: fetch-depth: 0 persist-credentials: false @@ -40,12 +40,12 @@ jobs: echo "CGO_LDFLAGS= -L${GITHUB_WORKSPACE}/rtloader/build/rtloader -ldl " >> $GITHUB_ENV echo "CGO_CFLAGS= -I${GITHUB_WORKSPACE}/rtloader/include -I${GITHUB_WORKSPACE}/rtloader/common " >> $GITHUB_ENV - - uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 + - uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0 with: go-version-file: ".go-version" - name: Initialize CodeQL - uses: github/codeql-action/init@f09c1c0a94de965c15400f5634aa42fac8fb8f88 # v3.27.5 + uses: github/codeql-action/init@df409f7d9260372bd5f19e5b04e83cb3c43714ae # v3.27.9 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@f09c1c0a94de965c15400f5634aa42fac8fb8f88 # v3.27.5 + uses: github/codeql-action/analyze@df409f7d9260372bd5f19e5b04e83cb3c43714ae # v3.27.9 diff --git a/.github/workflows/collector-generate-and-update.yml b/.github/workflows/collector-generate-and-update.yml index b0d3326cc44b2..0fae5d04dbd15 100644 --- a/.github/workflows/collector-generate-and-update.yml +++ b/.github/workflows/collector-generate-and-update.yml @@ -11,62 +11,37 @@ jobs: permissions: pull-requests: write steps: - - name: Set date - id: date - run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT - - 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.6' + python-version: ${{ env.PYTHON_VERSION }} + cache: 'pip' - - name: Install dependencies + - name: Set up Go + uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0 + with: + go-version: ${{ env.GO_VERSION }} + + - name: Install Dependencies run: | - python -m pip install --upgrade pip + python3 -m pip install --upgrade pip pip install -r requirements.txt - - name: Run update task - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: inv -e collector.update - - - name: Run generate task + - name: Run Collector Update Script env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: inv -e collector.generate - - - name: Check for changes - id: check_changes - run: | - git config --global user.name "github-actions[bot]" - git config --global user.email "github-actions[bot]@users.noreply.github.com" - git add . - if git diff-index --quiet HEAD; then - echo "No changes detected" - echo "changes_detected=false" >> $GITHUB_OUTPUT - else - echo "Changes detected" - echo "changes_detected=true" >> $GITHUB_OUTPUT - fi - - - name: Commit changes - if: steps.check_changes.outputs.changes_detected == 'true' - run: | - git switch -c update-otel-collector-dependencies-${{ steps.date.outputs.date }} - git commit -m "Update OTel Collector dependencies and generate OTel Agent" - git push -u origin update-otel-collector-dependencies-${{ steps.date.outputs.date }} - - - name: Install GitHub CLI - if: steps.check_changes.outputs.changes_detected == 'true' - run: | - sudo apt-get update - sudo apt-get install gh - - - name: Create draft pull request - if: steps.check_changes.outputs.changes_detected == 'true' run: | - gh auth login --with-token <<< ${{ secrets.GITHUB_TOKEN }} - gh pr create --title "Update OTel collector dependencies" --body "This PR updates the OTel Collector dependencies to the latest version. Please ensure that all tests pass before marking ready for review." --base main --head update-otel-collector-dependencies-${{ steps.date.outputs.date }} --draft + inv -e install-tools + inv -e collector.update + inv -e collector.generate + inv -e generate-licenses + inv -e collector.pull-request diff --git a/.github/workflows/create_rc_pr.yml b/.github/workflows/create_rc_pr.yml index 5539dc44532b1..66fbf9462a168 100644 --- a/.github/workflows/create_rc_pr.yml +++ b/.github/workflows/create_rc_pr.yml @@ -5,10 +5,12 @@ on: schedule: - cron: '0 14 * * 1,3,5' # Run on Monday, Wednesday, and Friday at 14:00 UTC - cron: '0 8 * * 1,3,5' # Same as above but at 08:00 UTC, to warn agent-integrations team about releasing + - cron: '0 9 * * 1' # Run Agent 6 workflow on Monday at 09:00 UTC env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - + AGENT6_RELEASE_BRANCH: '6.53.x' + IS_AGENT6_RELEASE: ${{ github.event.schedule == '0 9 * * 1' }} permissions: {} jobs: @@ -19,18 +21,21 @@ jobs: warning: ${{ steps.warning.outputs.value }} steps: - name: Checkout repository + uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 with: sparse-checkout: 'tasks' persist-credentials: false - name: Install python + if: ${{ env.IS_AGENT6_RELEASE == 'false' }} uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0 with: python-version: 3.11 cache: "pip" - name: Install Python dependencies + if: ${{ env.IS_AGENT6_RELEASE == 'false' }} run: | python -m pip install --upgrade pip pip install -r requirements.txt @@ -40,7 +45,11 @@ jobs: - name: Determine the release active branches id: branches run: | - echo "value=$(inv release.get-unreleased-release-branches)" >> $GITHUB_OUTPUT + if ${{ env.IS_AGENT6_RELEASE == 'true' }}; then + echo "value=[\"$AGENT6_RELEASE_BRANCH\"]" >> $GITHUB_OUTPUT + else + echo "value=$(inv release.get-unreleased-release-branches)" >> $GITHUB_OUTPUT + fi - name: Set the warning option id: warning @@ -59,8 +68,8 @@ jobs: value: ${{fromJSON(needs.find_release_branches.outputs.branches)}} fail-fast: false steps: - - name: Checkout release branch - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + - name: Checkout the main branch + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: persist-credentials: true @@ -93,11 +102,12 @@ jobs: fi - name: Create RC PR - if: ${{ steps.check_for_changes.outputs.CHANGES == 'true'}} + if: ${{ steps.check_for_changes.outputs.CHANGES == 'true' || env.IS_AGENT6_RELEASE == 'true' }} env: MATRIX: ${{ matrix.value }} run: | - git config user.name "github-actions[bot]" - git config user.email "41898282+github-actions[bot]@users.noreply.github.com" - git fetch - inv -e release.create-rc "$MATRIX" --slack-webhook=${{ secrets.AGENT_RELEASE_SYNC_SLACK_WEBHOOK }} + if ${{ env.IS_AGENT6_RELEASE == 'true' }}; then + inv -e release.create-rc -r "$MATRIX" --slack-webhook=${{ secrets.AGENT_RELEASE_SYNC_SLACK_WEBHOOK }} --patch-version + else + inv -e release.create-rc -r "$MATRIX" --slack-webhook=${{ secrets.AGENT_RELEASE_SYNC_SLACK_WEBHOOK }} + fi diff --git a/.github/workflows/create_release_schedule.yml b/.github/workflows/create_release_schedule.yml index f8dc006160e3c..4b749ba3bdc97 100644 --- a/.github/workflows/create_release_schedule.yml +++ b/.github/workflows/create_release_schedule.yml @@ -20,7 +20,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: ref: ${{ github.head_ref }} persist-credentials: false diff --git a/.github/workflows/cws-btfhub-sync.yml b/.github/workflows/cws-btfhub-sync.yml index 08d0ad720c1da..1737720006753 100644 --- a/.github/workflows/cws-btfhub-sync.yml +++ b/.github/workflows/cws-btfhub-sync.yml @@ -20,7 +20,7 @@ permissions: {} jobs: generate: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 strategy: fail-fast: false matrix: @@ -52,13 +52,13 @@ jobs: df -h - name: Checkout datadog-agent repository - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: ref: ${{ inputs.base_branch || 'main' }} persist-credentials: false - name: Checkout btfhub-archive repository - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: repository: DataDog/btfhub-archive path: dev/dist/archive @@ -73,7 +73,7 @@ jobs: - run: pip install -r requirements.txt - name: Install go - uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 + uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0 with: go-version-file: '.go-version' @@ -97,20 +97,20 @@ jobs: inv -e security-agent.generate-btfhub-constants --archive-path=./dev/dist/archive --output-path=./"$ARTIFACT_NAME".json --force-refresh - name: Upload artifact - uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: ${{ steps.artifact-name.outputs.ARTIFACT_NAME }} path: ./${{ steps.artifact-name.outputs.ARTIFACT_NAME }}.json combine: needs: generate - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 permissions: contents: write pull-requests: write steps: - name: Checkout datadog-agent repository - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: ref: ${{ inputs.base_branch || 'main' }} @@ -122,12 +122,12 @@ jobs: - run: pip install -r requirements.txt - name: Install go - uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 + uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0 with: go-version-file: '.go-version' - name: Download All Artifacts - uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7 + uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 with: path: ./dev/dist/constants pattern: constants-* diff --git a/.github/workflows/datadog-static-analysis.yml b/.github/workflows/datadog-static-analysis.yml index 3063c7c0db456..a77f4ba632c1d 100644 --- a/.github/workflows/datadog-static-analysis.yml +++ b/.github/workflows/datadog-static-analysis.yml @@ -11,7 +11,7 @@ jobs: name: Datadog Static Analyzer steps: - name: Checkout - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: persist-credentials: false - name: Check code meets quality and security standards diff --git a/.github/workflows/docs-dev.yml b/.github/workflows/docs-dev.yml index 09d4dd1bbb98e..59e803598f6cd 100644 --- a/.github/workflows/docs-dev.yml +++ b/.github/workflows/docs-dev.yml @@ -25,7 +25,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: persist-credentials: false # Fetch all history for applying timestamps to every page @@ -50,7 +50,7 @@ jobs: - name: Build documentation run: invoke docs.build - - uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6 + - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: documentation path: site @@ -65,7 +65,7 @@ jobs: - build steps: - - uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7 + - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 with: name: documentation path: site diff --git a/.github/workflows/external-contributor.yml b/.github/workflows/external-contributor.yml index f0beb805c2a50..03cf46fd03511 100644 --- a/.github/workflows/external-contributor.yml +++ b/.github/workflows/external-contributor.yml @@ -17,7 +17,7 @@ jobs: if: github.event.pull_request.head.repo.full_name != github.repository steps: - name: Checkout repository - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: ref: main fetch-depth: 0 diff --git a/.github/workflows/go-update-commenter.yml b/.github/workflows/go-update-commenter.yml index 1028110bc4fda..c74a404a09c4c 100644 --- a/.github/workflows/go-update-commenter.yml +++ b/.github/workflows/go-update-commenter.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest steps: # get the Go version of the target branch - - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: ref: ${{ github.base_ref }} persist-credentials: false @@ -26,7 +26,7 @@ jobs: echo version="$(cat .go-version)" >> $GITHUB_OUTPUT # get the Go version of the PR branch - - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: persist-credentials: false - name: Get current Go version diff --git a/.github/workflows/go_mod_tidy.yml b/.github/workflows/go_mod_tidy.yml index e48d806c9dce9..daa8b9779b741 100644 --- a/.github/workflows/go_mod_tidy.yml +++ b/.github/workflows/go_mod_tidy.yml @@ -17,7 +17,7 @@ jobs: permissions: contents: write steps: - - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: ref: ${{ github.head_ref }} - name: Checkout PR @@ -28,7 +28,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} PR_NUMBER: ${{ github.event.inputs.pr_number }} - name: Install go - uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 + uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0 with: go-version-file: ".go-version" - name: Install python diff --git a/.github/workflows/gohai.yml b/.github/workflows/gohai.yml index 851c2f9d0ccd1..5199b4049559d 100644 --- a/.github/workflows/gohai.yml +++ b/.github/workflows/gohai.yml @@ -34,10 +34,10 @@ jobs: go-file: [.go-version, pkg/gohai/go.mod] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: persist-credentials: false - - uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 + - uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0 with: go-version-file: ${{ matrix.go-file }} - name: Test diff --git a/.github/workflows/label-analysis.yml b/.github/workflows/label-analysis.yml index ec53d5a695fed..a7ace970705cf 100644 --- a/.github/workflows/label-analysis.yml +++ b/.github/workflows/label-analysis.yml @@ -23,7 +23,7 @@ jobs: pull-requests: write steps: - name: Checkout repository - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: persist-credentials: false - name: Setup python @@ -43,7 +43,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: fetch-depth: 0 persist-credentials: false @@ -125,7 +125,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: ref: ${{ github.head_ref }} - name: Setup python @@ -138,3 +138,24 @@ jobs: run: pip install -r requirements.txt -r tasks/requirements.txt - name: Check agent telemetry metric list run: inv -e github.agenttelemetry-list-change-ack-check --pr-id=${{ github.event.pull_request.number }} + + ask-reviews: + if: github.triggering_actor != 'dd-devflow[bot]' && github.event.action != 'synchronize' + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + persist-credentials: false + - name: Setup python + uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0 + with: + python-version-file: .python-version + cache: 'pip' + cache-dependency-path: '**/requirements*.txt' + - name: Install dependencies + run: pip install -r requirements.txt -r tasks/requirements.txt --break-system-packages + - name: Ask for code reviews + env: + SLACK_API_TOKEN : ${{ secrets.SLACK_DATADOG_AGENT_BOT_TOKEN }} + run: inv -e issue.ask-reviews -p ${{ github.event.pull_request.number }} diff --git a/.github/workflows/markdown-lint-check.yml b/.github/workflows/markdown-lint-check.yml index 5f440614390ae..b5fe87f21f0f8 100644 --- a/.github/workflows/markdown-lint-check.yml +++ b/.github/workflows/markdown-lint-check.yml @@ -9,7 +9,7 @@ jobs: markdown-link-check: runs-on: ubuntu-latest steps: - - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: persist-credentials: false - uses: gaurav-nelson/github-action-markdown-link-check@d53a906aa6b22b8979d33bc86170567e619495ec # v1.0.15 diff --git a/.github/workflows/report-merged-pr.yml b/.github/workflows/report-merged-pr.yml index de4cfe0cb01b9..879b5b7e13330 100644 --- a/.github/workflows/report-merged-pr.yml +++ b/.github/workflows/report-merged-pr.yml @@ -4,6 +4,8 @@ name: Report Merged PR on: pull_request: + branches: + - main types: [closed] permissions: {} @@ -18,7 +20,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: persist-credentials: false diff --git a/.github/workflows/serverless-benchmarks.yml b/.github/workflows/serverless-benchmarks.yml index e618764a0ca3b..6f446cb417005 100644 --- a/.github/workflows/serverless-benchmarks.yml +++ b/.github/workflows/serverless-benchmarks.yml @@ -24,13 +24,13 @@ jobs: sha: ${{ steps.prepare.outputs.sha }} steps: - name: Checkout ${{ github.base_ref }} - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: ref: ${{ github.base_ref }} persist-credentials: false - name: Install Go - uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 + uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0 with: go-version: stable @@ -48,7 +48,7 @@ jobs: ./pkg/serverless/... | tee "$TEMP_RUNNER"/benchmark.log - name: Upload result artifact - uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: baseline.log path: ${{runner.temp}}/benchmark.log @@ -63,13 +63,13 @@ jobs: steps: - name: Checkout ${{ github.ref }} - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: ref: ${{ github.sha }} persist-credentials: false - name: Install Go - uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 + uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0 with: go-version: stable @@ -87,7 +87,7 @@ jobs: ./pkg/serverless/... | tee "$TEMP_RUNNER"/benchmark.log - name: Upload result artifact - uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: current.log path: ${{runner.temp}}/benchmark.log @@ -102,7 +102,7 @@ jobs: steps: - name: Install Go - uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 + uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0 with: go-version: stable cache: false @@ -112,12 +112,12 @@ jobs: go install golang.org/x/perf/cmd/benchstat@latest - name: Download baseline artifact - uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7 + uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 with: name: baseline.log path: baseline - name: Download current artifact - uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7 + uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 with: name: current.log path: current diff --git a/.github/workflows/serverless-binary-size.yml b/.github/workflows/serverless-binary-size.yml index fe8e17d17d990..fda6772398b9e 100644 --- a/.github/workflows/serverless-binary-size.yml +++ b/.github/workflows/serverless-binary-size.yml @@ -19,7 +19,7 @@ jobs: pull-requests: write # Add comment to PR steps: - name: Checkout datadog-agent repository - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: path: go/src/github.com/DataDog/datadog-agent persist-credentials: false @@ -36,14 +36,14 @@ jobs: fi - name: Checkout the datadog-lambda-extension repository - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: repository: DataDog/datadog-lambda-extension path: go/src/github.com/DataDog/datadog-lambda-extension persist-credentials: false - name: Set up Docker Buildx - uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3.6.1 + uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3.7.1 - name: Previous binary size and dependencies id: previous @@ -152,7 +152,7 @@ jobs: done - name: Archive dependency graphs - uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 if: steps.should.outputs.should_run == 'true' with: name: dependency-graphs diff --git a/.github/workflows/serverless-integration.yml b/.github/workflows/serverless-integration.yml index 288d3ef5042e4..f11209b420ef0 100644 --- a/.github/workflows/serverless-integration.yml +++ b/.github/workflows/serverless-integration.yml @@ -26,13 +26,13 @@ jobs: name: ${{ matrix.suite }} on ${{ matrix.architecture }} steps: - name: Checkout datadog-agent repository - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: path: go/src/github.com/DataDog/datadog-agent persist-credentials: false - name: Set up Node 20 - uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3 + uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 with: node-version: 20 @@ -40,7 +40,7 @@ jobs: run: sudo yarn global add serverless@^3.36.0 --prefix /usr/local - name: Checkout the datadog-lambda-extension repository - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: repository: DataDog/datadog-lambda-extension path: go/src/github.com/DataDog/datadog-lambda-extension @@ -54,7 +54,7 @@ jobs: platforms: amd64,arm64 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3.6.1 + uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3.7.1 - name: Create raw logs directory id: rawlogs @@ -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 }}" @@ -80,7 +80,7 @@ jobs: - name: Archive raw logs if: always() - uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: rawlogs-${{ matrix.suite }}-${{ matrix.architecture }} path: ${{ steps.rawlogs.outputs.dir }} diff --git a/.github/workflows/update_dependencies.yml b/.github/workflows/update_dependencies.yml new file mode 100644 index 0000000000000..f9094fffbe61d --- /dev/null +++ b/.github/workflows/update_dependencies.yml @@ -0,0 +1,82 @@ +name: Update golang.org/x/... dependencies +on: + schedule: + # Run every 10th of the month, as it seems golang.org/x/... packages are usually + # released at the beginning of the month. + # Run at 6AM UTC so that it's ready at the beginning of the day CET. + - cron: "0 6 10 * *" + + # allow triggering the workflow manually + workflow_dispatch: + +permissions: {} + +jobs: + backport: + name: Update golang.org/x/... dependencies + runs-on: ubuntu-latest + permissions: {} # the workflow uses the GitHub App token to create the PR so no specific permissions needed here + steps: + - uses: actions/create-github-app-token@5d869da34e18e7287c1daad50e0b8ea0f506ce69 # v1.11.0 + id: app-token + with: + app-id: ${{ vars.DD_GITHUB_TOKEN_GENERATOR_APP_ID }} + private-key: ${{ secrets.DD_GITHUB_TOKEN_GENERATOR_PRIVATE_KEY }} + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 + with: + # credentials are needed to create the PR at the end of the workflow + persist-credentials: true + token: ${{ steps.app-token.outputs.token }} + - uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0 + with: + go-version-file: ".go-version" + - uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0 + with: + cache: "pip" + - name: Install dependencies + run: pip install -r requirements.txt -r tasks/requirements.txt + - name: Update every golang.org/x/... package + run: | + go get -u golang.org/x/arch golang.org/x/crypto \ + golang.org/x/lint golang.org/x/mod \ + golang.org/x/net golang.org/x/sync \ + golang.org/x/sys golang.org/x/term \ + golang.org/x/text golang.org/x/time \ + golang.org/x/xerrors golang.org/x/tools \ + golang.org/x/exp + # run tidy twice because the first one doesn't always clean everything + # depending on module order + inv -e tidy tidy + - uses: stefanzweifel/git-auto-commit-action@8621497c8c39c72f3e2a999a26b4ca1b5058a842 # v5.0.1 + id: autocommit + with: + commit_message: "chore(deps): update all golang.org/x/... dependencies" + branch: update-golang-org-x-${{ github.run_id }}-${{ github.run_attempt }} + create_branch: true + skip_fetch: true + - name: Create PR + env: + TMP_PR_BODY_PATH: /tmp/pr_body + GH_TOKEN: ${{ steps.app-token.outputs.token }} + PR_TITLE: "[automated] Update golang.org/x/... dependencies" + PR_LABELS: "team/agent-shared-components,qa/done,changelog/no-changelog" + GITHUB_REF: ${{ github.ref }} + run: | + # Generate the PR description + cat > $TMP_PR_BODY_PATH <<- EOM + ### What does this PR do? + Update all \`golang.org/x/...\` dependencies. + + ### Motivation + Keep dependencies up-to-date, benefit from bug fixes and new features. + + ### Describe how you validated your changes + CI is considered enough to validate changes. + EOM + + # Create the PR + gh pr create \ + --base "$GITHUB_REF" \ + --title "$PR_TITLE" \ + --body-file "$TMP_PR_BODY_PATH" \ + --label "$PR_LABELS" diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ef09047f42cce..82599a4b84956 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,7 +6,6 @@ include: - .gitlab/check_deploy/check_deploy.yml - .gitlab/check_merge/do_not_merge.yml - .gitlab/choco_build/choco_build.yml - - .gitlab/choco_deploy/choco_deploy.yml - .gitlab/powershell_script_signing/powershell_script_signing.yml - .gitlab/powershell_script_deploy/powershell_script_deploy.yml - .gitlab/common/shared.yml @@ -86,7 +85,7 @@ stages: - deploy_dca - choco_and_install_script_build - trigger_release - - choco_and_install_script_deploy + - install_script_deploy - internal_image_deploy - e2e_deploy - install_script_testing @@ -134,6 +133,7 @@ variables: BUCKET_BRANCH: dev # path inside the staging s3 buckets to release to: 'dev', 'nightly', 'oldnightly', 'beta' or 'stable' DEB_TESTING_S3_BUCKET: apttesting.datad0g.com RPM_TESTING_S3_BUCKET: yumtesting.datad0g.com + INSTALLER_TESTING_S3_BUCKET: installtesting.datad0g.com WINDOWS_TESTING_S3_BUCKET_A6: pipelines/A6/$CI_PIPELINE_ID WINDOWS_TESTING_S3_BUCKET_A7: pipelines/A7/$CI_PIPELINE_ID WINDOWS_BUILDS_S3_BUCKET: $WIN_S3_BUCKET/builds @@ -150,6 +150,7 @@ variables: ## comment out both lines below (S3_OMNIBUS_CACHE_BUCKET and USE_S3_CACHING) to allow ## build to succeed with S3 caching disabled. S3_OMNIBUS_CACHE_BUCKET: dd-ci-datadog-agent-omnibus-cache-build-stable + S3_OMNIBUS_GIT_CACHE_BUCKET: dd-ci-datadog-agent-omnibus-git-cache-build-stable USE_S3_CACHING: --omnibus-s3-cache # This value is not used on windows, a specific value is provided to # our build containers in the windows build jobs @@ -274,6 +275,7 @@ variables: # Feature flags FF_SCRIPT_SECTIONS: 1 # Prevent multiline scripts log collapsing, see https://gitlab.com/gitlab-org/gitlab-runner/-/issues/3392 FF_KUBERNETES_HONOR_ENTRYPOINT: true # Honor the entrypoint in the Docker image when running Kubernetes jobs + FF_TIMESTAMPS: true # # Condition mixins for simplification of rules @@ -281,6 +283,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$/ @@ -579,8 +584,10 @@ workflow: when: always .on_deploy_stable_or_beta_repo_branch: + - !reference [.except_mergequeue] - <<: *if_not_stable_or_beta_repo_branch - when: never + when: manual + allow_failure: true - <<: *if_deploy .on_deploy_stable_or_beta_repo_branch_manual: @@ -609,23 +616,16 @@ workflow: .except_no_tests_no_deploy: - if: $DEPLOY_AGENT == "false" && $DDR_WORKFLOW_ID == null && $RUN_E2E_TESTS == "off" - when: never + when: manual + allow_failure: true .on_main_or_release_branch: - <<: *if_main_branch - <<: *if_release_branch -.on_main_or_release_branch_or_all_builds_or_pkg_installer_changes: - - <<: *if_main_branch - - <<: *if_release_branch - - <<: *if_run_all_builds - - <<: *if_run_all_unit_tests - - changes: - paths: - - pkg/fleet/**/* - compare_to: main - variables: - FAST_TESTS: "true" +.only_main: + - <<: *if_not_main_branch + when: never .except_main_or_release_branch: - <<: *if_main_branch @@ -829,7 +829,9 @@ workflow: - !reference [.on_e2e_main_release_or_rc] - changes: paths: - # TODO: Add paths that should trigger tests for ASC + - cmd/**/* + - pkg/**/* + - comp/**/* - test/new-e2e/tests/agent-shared-components/**/* compare_to: main # TODO: use a variable, when this is supported https://gitlab.com/gitlab-org/gitlab/-/issues/369916 @@ -980,6 +982,16 @@ workflow: compare_to: main # TODO: use a variable, when this is supported https://gitlab.com/gitlab-org/gitlab/-/issues/369916 when: on_success +.on_netpath_or_e2e_changes: + - !reference [.on_e2e_main_release_or_rc] + - changes: + paths: + - pkg/collector/corechecks/networkpath/**/* + - test/new-e2e/tests/netpath/**/* + - test/new-e2e/go.mod + compare_to: main # TODO: use a variable, when this is supported https://gitlab.com/gitlab-org/gitlab/-/issues/369916 + when: on_success + .on_otel_or_e2e_changes: - !reference [.on_e2e_main_release_or_rc] - changes: diff --git a/.gitlab/.ci-linters.yml b/.gitlab/.ci-linters.yml index af5acfa72b74a..2283d1833f5d7 100644 --- a/.gitlab/.ci-linters.yml +++ b/.gitlab/.ci-linters.yml @@ -37,10 +37,12 @@ needs-rules: - setup_agent_version - tests_ebpf_arm64 - tests_ebpf_x64 + - tests_macos_gitlab_amd64 - tests_windows_secagent_x64 - tests_windows_sysprobe_x64 - trigger_auto_staging_release - trigger_manual_prod_release + - generate_windows_gitlab_runner_bump_pr # Lists jobs that are allowed to not be within JOBOWNERS job-owners: @@ -56,8 +58,6 @@ job-owners: - build_otel_agent_binary_arm64 - build_otel_agent_binary_x64 - cancel-prev-pipelines - - check_pkg_size-amd64-a7 - - check_pkg_size-arm64-a7 - close_failing_tests_stale_issues - compute_gitlab_ci_config - deploy_cluster_agent_cloudfoundry @@ -83,7 +83,6 @@ job-owners: - new-e2e-unit-tests - ot_agent_deb-arm64-a7 - ot_agent_deb-x64-a7 - - publish_choco_7_x64 - publish_fakeintake - publish_fakeintake_latest - rc_kubernetes_deploy diff --git a/.gitlab/JOBOWNERS b/.gitlab/JOBOWNERS index 9cb87462dca48..b8c045048e928 100644 --- a/.gitlab/JOBOWNERS +++ b/.gitlab/JOBOWNERS @@ -67,7 +67,7 @@ iot_agent_suse* @DataDog/agent-delivery dogstatsd_suse* @DataDog/agent-delivery agent_oci* @DataDog/agent-delivery installer_oci* @DataDog/agent-delivery -new_check_pkg_size @DataDog/agent-delivery +check_pkg_size @DataDog/agent-delivery # Testing package deploy deploy_deb_testing* @DataDog/agent-delivery @@ -114,8 +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 # Deploy containers deploy_containers* @Datadog/agent-delivery @@ -126,6 +127,7 @@ deploy_containers-cws-instrumentation* @DataDog/agent-security # Trigger release trigger_manual_prod_release @DataDog/agent-delivery trigger_auto_staging_release @DataDog/agent-delivery +generate_windows_gitlab_runner_bump_pr @DataDog/agent-delivery # Integration test integration_tests_windows* @DataDog/windows-agent diff --git a/.gitlab/choco_build/choco_build.yml b/.gitlab/choco_build/choco_build.yml index 97ef76cd478f0..06ff3c6bb5d0d 100644 --- a/.gitlab/choco_build/choco_build.yml +++ b/.gitlab/choco_build/choco_build.yml @@ -2,54 +2,28 @@ # choco_build stage # Contains jobs which build the chocolatey Agent package. -# Not currently used in the pipeline. -windows_choco_offline_7_x64: - rules: - !reference [.manual] - stage: choco_and_install_script_build - tags: ["runner:windows-docker", "windowsversion:1809"] - needs: ["windows_msi_and_bosh_zip_x64-a7"] - variables: - ARCH: "x64" - script: - - $ErrorActionPreference = "Stop" - - Get-ChildItem omnibus\pkg - - copy omnibus\pkg\*.msi .\chocolatey\tools-offline\ - - docker run --rm -v "$(Get-Location):c:\mnt" registry.ddbuild.io/ci/datadog-agent-buildimages/windows_1809_${ARCH}${Env:DATADOG_AGENT_WINBUILDIMAGES_SUFFIX}:${Env:DATADOG_AGENT_WINBUILDIMAGES} c:\mnt\tasks\winbuildscripts\chocopack.bat offline - - If ($lastExitCode -ne "0") { throw "Previous command returned $lastExitCode" } - - copy build-out\*.nupkg omnibus\pkg - artifacts: - expire_in: 2 weeks - paths: - - omnibus/pkg - -# The online version of the choco job gets the msi package through the gitlab artifacts -windows_choco_online_7_x64: +# The choco job gets the msi package through the gitlab artifacts +.windows_choco_7_x64: rules: !reference [.on_deploy_stable_or_beta_repo_branch] stage: choco_and_install_script_build tags: ["runner:windows-docker", "windowsversion:1809"] - needs: ["deploy_packages_windows-x64-7"] variables: ARCH: "x64" script: - '$_instance_id = (iwr -UseBasicParsing http://169.254.169.254/latest/meta-data/instance-id).content ; Write-Host "Running on instance $($_instance_id)"' - $ErrorActionPreference = "Stop" - - mkdir temp\ - - copy omnibus\pkg\*.msi temp\ - - if (Test-Path omnibus) { remove-item -recurse -force omnibus } - if (Test-Path build-out) { remove-item -recurse -force build-out } - - mkdir omnibus\pkg - > docker run --rm -v "$(Get-Location):c:\mnt" + -e CI_PROJECT_NAME=${CI_PROJECT_NAME} -e CI_PIPELINE_ID=${CI_PIPELINE_ID} -e BUCKET_BRANCH="$BUCKET_BRANCH" + -e AWS_NETWORKING=true registry.ddbuild.io/ci/datadog-agent-buildimages/windows_1809_${ARCH}${Env:DATADOG_AGENT_WINBUILDIMAGES_SUFFIX}:${Env:DATADOG_AGENT_WINBUILDIMAGES} - c:\mnt\tasks\winbuildscripts\chocopack.bat online c:\mnt\temp + powershell.exe -C "C:\mnt\tasks\winbuildscripts\Generate-Chocolatey-Package.ps1 -MSIDirectory c:\mnt\omnibus\pkg -Flavor $FLAVOR -InstallDeps 1" - If ($lastExitCode -ne "0") { throw "Previous command returned $lastExitCode" } - - Remove-Item -Path "temp\" -Recurse -Force - - copy build-out\*.nupkg omnibus\pkg - $CopyNupkgToS3 = "$S3_CP_CMD --recursive --exclude '*' --include '*.nupkg' build-out $S3_RELEASE_ARTIFACTS_URI/choco/nupkg" - Invoke-Expression $CopyNupkgToS3 artifacts: @@ -58,3 +32,23 @@ windows_choco_online_7_x64: - omnibus/pkg # Sometimes Chocolatey is flakey retry: 2 + +windows_choco_7_x64: + extends: .windows_choco_7_x64 + # On dev/PR branches: + # - if the job is run manually it will create a package, but before the + # package can be installed, the deploy_windows_testing-a7 job must + # be run to push the MSI to the dd-agent-mstesting bucket. + needs: ["windows_msi_and_bosh_zip_x64-a7"] + variables: + FLAVOR: "datadog-agent" + +windows_choco_7_x64-fips: + extends: .windows_choco_7_x64 + # On dev/PR branches: + # - if the job is run manually it will create a package, but before the + # package can be installed, the deploy_windows_testing-a7-fips job must + # be run to push the MSI to the dd-agent-mstesting bucket. + needs: ["windows_msi_and_bosh_zip_x64-a7-fips"] + variables: + FLAVOR: "datadog-fips-agent" diff --git a/.gitlab/choco_deploy/choco_deploy.yml b/.gitlab/choco_deploy/choco_deploy.yml deleted file mode 100644 index 05b0f0d83eba6..0000000000000 --- a/.gitlab/choco_deploy/choco_deploy.yml +++ /dev/null @@ -1,32 +0,0 @@ ---- -# choco_build stage -# Contains a job which deploys the chocolatey Agent package. - -publish_choco_7_x64: - rules: !reference [.on_deploy_stable_or_beta_repo_branch_manual] - stage: choco_and_install_script_deploy - tags: ["runner:windows-docker", "windowsversion:1809"] - needs: ["windows_choco_online_7_x64"] - variables: - ARCH: "x64" - before_script: - - $tmpfile = [System.IO.Path]::GetTempFileName() - - (& "$CI_PROJECT_DIR\tools\ci\fetch_secret.ps1" -parameterName "$Env:CHOCOLATEY_API_KEY" -tempFile "$tmpfile") - - If ($lastExitCode -ne "0") { exit "$lastExitCode" } - - $chocolateyApiKey=$(cat "$tmpfile") - - Remove-Item "$tmpfile" - script: - - '$_instance_id = (iwr -UseBasicParsing http://169.254.169.254/latest/meta-data/instance-id).content ; Write-Host "Running on instance $($_instance_id)"' - - $ErrorActionPreference = "Stop" - - Get-ChildItem omnibus\pkg - - if (Test-Path nupkg) { remove-item -recurse -force nupkg } - - mkdir nupkg - - copy omnibus\pkg\*.nupkg nupkg\ - - Get-ChildItem nupkg - - > - docker run --rm - -v "$(Get-Location):c:\mnt" - -e CHOCOLATEY_API_KEY=${chocolateyApiKey} - registry.ddbuild.io/ci/datadog-agent-buildimages/windows_1809_${ARCH}${Env:DATADOG_AGENT_WINBUILDIMAGES_SUFFIX}:${Env:DATADOG_AGENT_WINBUILDIMAGES} - c:\mnt\tasks\winbuildscripts\chocopush.bat - - If ($lastExitCode -ne "0") { throw "Previous command returned $lastExitCode" } diff --git a/.gitlab/common/test_infra_version.yml b/.gitlab/common/test_infra_version.yml index 7844ff82e9ee3..d82441a06f222 100644 --- a/.gitlab/common/test_infra_version.yml +++ b/.gitlab/common/test_infra_version.yml @@ -1,7 +1,9 @@ +# File generated by inv buildimages.update-test-infra-definitions +# Please do not edit this file manually +# To update the test-infra-definitions version, run `inv buildimages.update-test-infra-definitions --commit-sha ` [--is-dev-image] + + --- variables: - # To use images from test-infra-definitions dev branches, set the SUFFIX variable to -dev - # 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: 36860d3c29b4 + TEST_INFRA_DEFINITIONS_BUILDIMAGES_SUFFIX: '' diff --git a/.gitlab/deploy_packages/e2e.yml b/.gitlab/deploy_packages/e2e.yml index 30de15bfbc2c5..78bb3286f1292 100644 --- a/.gitlab/deploy_packages/e2e.yml +++ b/.gitlab/deploy_packages/e2e.yml @@ -1,27 +1,15 @@ # Jobs that deploy agent packages on QA environment, to be used by e2e tests -qa_agent_oci: - extends: .docker_publish_job_definition +qa_installer_script: + image: registry.ddbuild.io/ci/datadog-agent-buildimages/gitlab_agent_deploy$DATADOG_AGENT_BUILDIMAGES_SUFFIX:$DATADOG_AGENT_BUILDIMAGES stage: deploy_packages + tags: ["arch:amd64"] rules: - !reference [.on_installer_or_e2e_changes] - !reference [.manual] needs: - - deploy_agent_oci - variables: - IMG_REGISTRIES: agent-qa - IMG_SOURCES: registry.ddbuild.io/ci/remote-updates/datadog-agent:pipeline-${CI_PIPELINE_ID} - IMG_DESTINATIONS: agent-package:pipeline-${CI_PIPELINE_ID} - -qa_installer_oci: - extends: .docker_publish_job_definition - stage: deploy_packages - rules: - - !reference [.on_installer_or_e2e_changes] - - !reference [.manual] - needs: - - deploy_installer_oci - variables: - IMG_REGISTRIES: agent-qa - IMG_SOURCES: registry.ddbuild.io/ci/remote-updates/datadog-installer:pipeline-${CI_PIPELINE_ID} - IMG_DESTINATIONS: installer-package:pipeline-${CI_PIPELINE_ID} + - 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}/${CI_COMMIT_SHA}/scripts/" diff --git a/.gitlab/deploy_packages/oci.yml b/.gitlab/deploy_packages/oci.yml index 5f362a55cc728..4d8ecadebfdff 100644 --- a/.gitlab/deploy_packages/oci.yml +++ b/.gitlab/deploy_packages/oci.yml @@ -24,6 +24,14 @@ include: - datadog-package push registry.ddbuild.io/ci/remote-updates/${OCI_PRODUCT}:${VERSION} ${OMNIBUS_PACKAGE_DIR}/${OCI_PRODUCT}-${VERSION}.oci.tar # This is used for E2E tests. Doesn't cost more than an additional tag to the registry. - datadog-package push registry.ddbuild.io/ci/remote-updates/${OCI_PRODUCT}:pipeline-${CI_PIPELINE_ID} ${OMNIBUS_PACKAGE_DIR}/${OCI_PRODUCT}-${VERSION}.oci.tar + # Used for e2e tests + - datadog-package replicate-s3 registry.ddbuild.io/ci/remote-updates/${OCI_PRODUCT}:pipeline-${CI_PIPELINE_ID} us-east-1 ${INSTALLER_TESTING_S3_BUCKET} ${S3_PACKAGE} ${VERSION} + - datadog-package replicate-s3 registry.ddbuild.io/ci/remote-updates/${OCI_PRODUCT}:pipeline-${CI_PIPELINE_ID} us-east-1 ${INSTALLER_TESTING_S3_BUCKET} ${S3_PACKAGE} ${CI_COMMIT_SHA} + - datadog-package replicate-s3 registry.ddbuild.io/ci/remote-updates/${OCI_PRODUCT}:pipeline-${CI_PIPELINE_ID} us-east-1 ${INSTALLER_TESTING_S3_BUCKET} ${S3_PACKAGE} pipeline-${CI_PIPELINE_ID} + # necessary for ddstaging until we deprecate `-dev` packaging + - datadog-package replicate-s3 registry.ddbuild.io/ci/remote-updates/${OCI_PRODUCT}:pipeline-${CI_PIPELINE_ID} us-east-1 ${INSTALLER_TESTING_S3_BUCKET} ${S3_STAGING_PACKAGE} ${VERSION} + - datadog-package replicate-s3 registry.ddbuild.io/ci/remote-updates/${OCI_PRODUCT}:pipeline-${CI_PIPELINE_ID} us-east-1 ${INSTALLER_TESTING_S3_BUCKET} ${S3_STAGING_PACKAGE} ${CI_COMMIT_SHA} + - datadog-package replicate-s3 registry.ddbuild.io/ci/remote-updates/${OCI_PRODUCT}:pipeline-${CI_PIPELINE_ID} us-east-1 ${INSTALLER_TESTING_S3_BUCKET} ${S3_STAGING_PACKAGE} pipeline-${CI_PIPELINE_ID} variables: MAJOR_VERSION: 7 @@ -32,9 +40,13 @@ deploy_agent_oci: needs: [ "agent_oci", "go_tools_deps"] variables: OCI_PRODUCT: "datadog-agent" + S3_PACKAGE: "agent-package" + S3_STAGING_PACKAGE: "agent-package-dev" deploy_installer_oci: extends: ".deploy_packages_oci" needs: [ "installer_oci", "go_tools_deps" ] variables: OCI_PRODUCT: "datadog-installer" + S3_PACKAGE: "installer-package" + S3_STAGING_PACKAGE: "installer-package-dev" diff --git a/.gitlab/deploy_packages/windows.yml b/.gitlab/deploy_packages/windows.yml index 6ef503bc234be..dd794d832b56c 100644 --- a/.gitlab/deploy_packages/windows.yml +++ b/.gitlab/deploy_packages/windows.yml @@ -69,3 +69,23 @@ deploy_installer_packages_windows-x64: --include "datadog-installer-*-1-x86_64.zip" --include "datadog-installer-*-1-x86_64.exe" $OMNIBUS_PACKAGE_DIR $S3_RELEASE_INSTALLER_ARTIFACTS_URI/msi/x86_64/ + +deploy_packages_windows-x64-7-fips: + rules: + !reference [.on_deploy] + stage: deploy_packages + image: registry.ddbuild.io/ci/datadog-agent-buildimages/gitlab_agent_deploy$DATADOG_AGENT_BUILDIMAGES_SUFFIX:$DATADOG_AGENT_BUILDIMAGES + tags: ["arch:amd64"] + needs: ["windows_msi_and_bosh_zip_x64-a7-fips"] + before_script: + - ls $OMNIBUS_PACKAGE_DIR + script: + - $S3_CP_CMD + --recursive + --exclude "*" + --include "datadog-fips-agent-7*.msi" + --include "datadog-fips-agent-7*.debug.zip" + $OMNIBUS_PACKAGE_DIR $S3_RELEASE_ARTIFACTS_URI/msi/x86_64/ + artifacts: + paths: + - $OMNIBUS_PACKAGE_DIR diff --git a/.gitlab/dev_container_deploy/docker_linux.yml b/.gitlab/dev_container_deploy/docker_linux.yml index 5b61ffc403a2b..8994a6cbb9bce 100644 --- a/.gitlab/dev_container_deploy/docker_linux.yml +++ b/.gitlab/dev_container_deploy/docker_linux.yml @@ -80,6 +80,24 @@ dev_master-a7: - IMG_SOURCES: ${SRC_AGENT}:v${CI_PIPELINE_ID}-${CI_COMMIT_SHORT_SHA}-7-jmx-amd64,${SRC_AGENT}:v${CI_PIPELINE_ID}-${CI_COMMIT_SHORT_SHA}-7-jmx-arm64 IMG_DESTINATIONS: agent-dev:master-py3-jmx +dev_master-fips: + extends: .docker_publish_job_definition + stage: dev_container_deploy + rules: !reference [.on_main] + needs: + - docker_build_fips_agent7 + - docker_build_fips_agent7_arm64 + - docker_build_fips_agent7_jmx + - docker_build_fips_agent7_arm64_jmx + variables: + IMG_REGISTRIES: dev + parallel: + matrix: + - IMG_SOURCES: ${SRC_AGENT}:v${CI_PIPELINE_ID}-${CI_COMMIT_SHORT_SHA}-7-fips-amd64,${SRC_AGENT}:v${CI_PIPELINE_ID}-${CI_COMMIT_SHORT_SHA}-7-fips-arm64 + IMG_DESTINATIONS: agent-dev:master-fips + - IMG_SOURCES: ${SRC_AGENT}:v${CI_PIPELINE_ID}-${CI_COMMIT_SHORT_SHA}-7-fips-jmx-amd64,${SRC_AGENT}:v${CI_PIPELINE_ID}-${CI_COMMIT_SHORT_SHA}-7-fips-jmx-arm64 + IMG_DESTINATIONS: agent-dev:master-fips-jmx + dev_master-dogstatsd: extends: .docker_publish_job_definition stage: dev_container_deploy diff --git a/.gitlab/dev_container_deploy/e2e.yml b/.gitlab/dev_container_deploy/e2e.yml index f8c45e3fba8c2..d0d721559059c 100644 --- a/.gitlab/dev_container_deploy/e2e.yml +++ b/.gitlab/dev_container_deploy/e2e.yml @@ -34,6 +34,22 @@ qa_agent_jmx: IMG_SOURCES: ${SRC_AGENT}:v${CI_PIPELINE_ID}-${CI_COMMIT_SHORT_SHA}-7-jmx-amd64,${SRC_AGENT}:v${CI_PIPELINE_ID}-${CI_COMMIT_SHORT_SHA}-7-jmx-arm64,${SRC_AGENT}:v${CI_PIPELINE_ID}-${CI_COMMIT_SHORT_SHA}-7-jmx-win1809-amd64,${SRC_AGENT}:v${CI_PIPELINE_ID}-${CI_COMMIT_SHORT_SHA}-7-jmx-winltsc2022-amd64 IMG_DESTINATIONS: agent:${CI_PIPELINE_ID}-${CI_COMMIT_SHORT_SHA}-jmx +qa_agent_fips_jmx: + extends: .docker_publish_job_definition + stage: dev_container_deploy + rules: + - !reference [.except_mergequeue] + - !reference [.except_disable_e2e_tests] + - when: on_success + needs: + - docker_build_fips_agent7_jmx + - docker_build_fips_agent7_arm64_jmx + - docker_build_fips_agent7_windows2022_core_jmx + variables: + IMG_REGISTRIES: agent-qa + IMG_SOURCES: ${SRC_AGENT}:v${CI_PIPELINE_ID}-${CI_COMMIT_SHORT_SHA}-7-fips-jmx-amd64,${SRC_AGENT}:v${CI_PIPELINE_ID}-${CI_COMMIT_SHORT_SHA}-7-fips-jmx-arm64,${SRC_AGENT}:v${CI_PIPELINE_ID}-${CI_COMMIT_SHORT_SHA}-7-fips-jmx-winltsc2022-servercore-amd64 + IMG_DESTINATIONS: agent:${CI_PIPELINE_ID}-${CI_COMMIT_SHORT_SHA}-fips-jmx + qa_agent_ot: extends: .docker_publish_job_definition stage: dev_container_deploy diff --git a/.gitlab/e2e/e2e.yml b/.gitlab/e2e/e2e.yml index 092ef165d6231..f944f407fa2dd 100644 --- a/.gitlab/e2e/e2e.yml +++ b/.gitlab/e2e/e2e.yml @@ -14,8 +14,16 @@ - $CI_PROJECT_DIR/tools/ci/fetch_secret.sh $AGENT_QA_E2E profile >> ~/.aws/config || exit $? - export AWS_PROFILE=agent-qa-ci # Now all `aws` commands target the agent-qa profile - - $CI_PROJECT_DIR/tools/ci/fetch_secret.sh $AGENT_QA_E2E ssh_public_key_rsa > $E2E_PUBLIC_KEY_PATH || exit $? - - touch $E2E_PRIVATE_KEY_PATH && chmod 600 $E2E_PRIVATE_KEY_PATH && $CI_PROJECT_DIR/tools/ci/fetch_secret.sh $AGENT_QA_E2E ssh_key_rsa > $E2E_PRIVATE_KEY_PATH || exit $? + # TODO: ADXT-768: Create new secret with different ssh key for the different cloud providers + # SSH Key retrieval for AWS + - $CI_PROJECT_DIR/tools/ci/fetch_secret.sh $AGENT_QA_E2E ssh_public_key_rsa > $E2E_AWS_PUBLIC_KEY_PATH || exit $? + - touch $E2E_AWS_PRIVATE_KEY_PATH && chmod 600 $E2E_AWS_PRIVATE_KEY_PATH && $CI_PROJECT_DIR/tools/ci/fetch_secret.sh $AGENT_QA_E2E ssh_key_rsa > $E2E_AWS_PRIVATE_KEY_PATH || exit $? + # SSH Key retrieval for Azure + - $CI_PROJECT_DIR/tools/ci/fetch_secret.sh $AGENT_QA_E2E ssh_public_key_rsa > $E2E_AZURE_PUBLIC_KEY_PATH || exit $? + - touch $E2E_AZURE_PRIVATE_KEY_PATH && chmod 600 $E2E_AZURE_PRIVATE_KEY_PATH && $CI_PROJECT_DIR/tools/ci/fetch_secret.sh $AGENT_QA_E2E ssh_key_rsa > $E2E_AZURE_PRIVATE_KEY_PATH || exit $? + # SSH Key retrieval for GCP + - $CI_PROJECT_DIR/tools/ci/fetch_secret.sh $AGENT_QA_E2E ssh_public_key_rsa > $E2E_GCP_PUBLIC_KEY_PATH || exit $? + - touch $E2E_GCP_PRIVATE_KEY_PATH && chmod 600 $E2E_GCP_PRIVATE_KEY_PATH && $CI_PROJECT_DIR/tools/ci/fetch_secret.sh $AGENT_QA_E2E ssh_key_rsa > $E2E_GCP_PRIVATE_KEY_PATH || exit $? # Use S3 backend - pulumi login "s3://dd-pulumi-state?region=us-east-1&awssdk=v2&profile=$AWS_PROFILE" # Setup Azure credentials. https://www.pulumi.com/registry/packages/azure-native/installation-configuration/#set-configuration-using-pulumi-config @@ -35,15 +43,23 @@ KUBERNETES_MEMORY_REQUEST: 12Gi KUBERNETES_MEMORY_LIMIT: 16Gi KUBERNETES_CPU_REQUEST: 6 - E2E_PUBLIC_KEY_PATH: /tmp/agent-qa-ssh-key.pub - E2E_PRIVATE_KEY_PATH: /tmp/agent-qa-ssh-key + # AWS SSH Key configuration + E2E_AWS_PUBLIC_KEY_PATH: /tmp/agent-qa-aws-ssh-key.pub + E2E_AWS_PRIVATE_KEY_PATH: /tmp/agent-qa-aws-ssh-key E2E_KEY_PAIR_NAME: datadog-agent-ci-rsa + # Azure SSH Key configuration + E2E_AZURE_PUBLIC_KEY_PATH: /tmp/agent-qa-azure-ssh-key.pub + E2E_AZURE_PRIVATE_KEY_PATH: /tmp/agent-qa-azure-ssh-key + # GCP SSH Key configuration + E2E_GCP_PUBLIC_KEY_PATH: /tmp/agent-qa-gcp-ssh-key.pub + E2E_GCP_PRIVATE_KEY_PATH: /tmp/agent-qa-gcp-ssh-key E2E_PIPELINE_ID: $CI_PIPELINE_ID E2E_COMMIT_SHA: $CI_COMMIT_SHORT_SHA E2E_OUTPUT_DIR: $CI_PROJECT_DIR/e2e-output EXTERNAL_LINKS_PATH: external_links_$CI_JOB_ID.json + E2E_LOGS_PROCESSING_TEST_DEPTH: 1 script: - - inv -e new-e2e-tests.run --targets $TARGETS -c ddagent:imagePullRegistry=669783387624.dkr.ecr.us-east-1.amazonaws.com -c ddagent:imagePullUsername=AWS -c ddagent:imagePullPassword=$(aws ecr get-login-password) --junit-tar junit-${CI_JOB_ID}.tgz ${EXTRA_PARAMS} --test-washer + - inv -e new-e2e-tests.run --targets $TARGETS -c ddagent:imagePullRegistry=669783387624.dkr.ecr.us-east-1.amazonaws.com -c ddagent:imagePullUsername=AWS -c ddagent:imagePullPassword=$(aws ecr get-login-password) --junit-tar junit-${CI_JOB_ID}.tgz ${EXTRA_PARAMS} --test-washer --logs-folder=$E2E_OUTPUT_DIR/logs --logs-post-processing --logs-post-processing-test-depth=$E2E_LOGS_PROCESSING_TEST_DEPTH after_script: - $CI_PROJECT_DIR/tools/ci/junit_upload.sh artifacts: @@ -369,6 +385,20 @@ new-e2e-apm: - EXTRA_PARAMS: --run TestVMFakeintakeSuiteUDS - EXTRA_PARAMS: --run TestVMFakeintakeSuiteTCP +new-e2e-installer-script: + extends: .new_e2e_template + rules: + - !reference [.on_installer_or_e2e_changes] + - !reference [.manual] + needs: + - !reference [.needs_new_e2e_template] + - deploy_installer_oci + - qa_installer_script + variables: + TARGETS: ./tests/installer/script + TEAM: fleet + FLEET_INSTALL_METHOD: "install_script" + new-e2e-installer: extends: .new_e2e_template rules: @@ -382,12 +412,13 @@ new-e2e-installer: - deploy_rpm_testing-a7_x64 - deploy_suse_rpm_testing_arm64-a7 - deploy_suse_rpm_testing_x64-a7 - - qa_installer_oci - - qa_agent_oci + - deploy_installer_oci + - deploy_agent_oci variables: TARGETS: ./tests/installer/unix TEAM: fleet FLEET_INSTALL_METHOD: "install_script" + E2E_LOGS_PROCESSING_TEST_DEPTH: 2 new-e2e-installer-windows: extends: .new_e2e_template @@ -397,8 +428,8 @@ new-e2e-installer-windows: needs: - !reference [.needs_new_e2e_template] - deploy_windows_testing-a7 - - qa_installer_oci - - qa_agent_oci + - deploy_installer_oci + - deploy_agent_oci before_script: # CURRENT_AGENT_VERSION is used to verify the installed agent version # Must run before new_e2e_template changes the aws profile @@ -440,8 +471,8 @@ new-e2e-installer-ansible: - deploy_rpm_testing-a7_x64 - deploy_suse_rpm_testing_arm64-a7 - deploy_suse_rpm_testing_x64-a7 - - qa_installer_oci - - qa_agent_oci + - deploy_installer_oci + - deploy_agent_oci variables: TARGETS: ./tests/installer/unix TEAM: fleet @@ -480,6 +511,15 @@ new-e2e-ha-agent: TARGETS: ./tests/ha-agent TEAM: ndm-core +new-e2e-netpath: + extends: .new_e2e_template_needs_deb_windows_x64 + rules: + - !reference [.on_netpath_or_e2e_changes] + - !reference [.manual] + variables: + TARGETS: ./tests/netpath + TEAM: network-performance-monitoring + new-e2e-windows-systemprobe: extends: .new_e2e_template rules: @@ -623,8 +663,8 @@ generate-flakes-finder-pipeline: - deploy_suse_rpm_testing_arm64-a7 - deploy_suse_rpm_testing_x64-a7 - deploy_windows_testing-a7 - - qa_installer_oci - - qa_agent_oci + - deploy_installer_oci + - deploy_agent_oci - qa_cws_instrumentation - qa_dca - qa_dogstatsd diff --git a/.gitlab/e2e_install_packages/common.yml b/.gitlab/e2e_install_packages/common.yml index 8985150b3ff14..965f5c67ce6f8 100644 --- a/.gitlab/e2e_install_packages/common.yml +++ b/.gitlab/e2e_install_packages/common.yml @@ -9,6 +9,7 @@ TARGETS: ./tests/agent-platform/install-script TEAM: agent-delivery EXTRA_PARAMS: --osversion $E2E_OSVERS --platform $E2E_PLATFORM --cws-supported-osversion $E2E_CWS_SUPPORTED_OSVERS --arch $E2E_ARCH --flavor $FLAVOR --no-verbose + E2E_LOGS_PROCESSING_TEST_DEPTH: 2 # We use a single test suite and run all the platforms test as subtest .new-e2e_step_by_step: stage: e2e_install_packages @@ -16,6 +17,7 @@ TARGETS: ./tests/agent-platform/step-by-step TEAM: agent-delivery EXTRA_PARAMS: --osversion $E2E_OSVERS --platform $E2E_PLATFORM --cws-supported-osversion $E2E_CWS_SUPPORTED_OSVERS --arch $E2E_ARCH --flavor $FLAVOR + E2E_LOGS_PROCESSING_TEST_DEPTH: 2 # We use a single test suite and run all the platforms test as subtest .new-e2e_script_upgrade7: stage: e2e_install_packages @@ -23,6 +25,7 @@ TARGETS: ./tests/agent-platform/upgrade TEAM: agent-delivery EXTRA_PARAMS: --osversion $E2E_OSVERS --platform $E2E_PLATFORM --arch $E2E_ARCH --flavor $FLAVOR + E2E_LOGS_PROCESSING_TEST_DEPTH: 2 # We use a single test suite and run all the platforms test as subtest parallel: matrix: - START_MAJOR_VERSION: [5, 6, 7] @@ -37,6 +40,7 @@ TARGETS: ./tests/agent-platform/persisting-integrations TEAM: agent-delivery EXTRA_PARAMS: --osversion $E2E_OSVERS --platform $E2E_PLATFORM --arch $E2E_ARCH --flavor $FLAVOR + E2E_LOGS_PROCESSING_TEST_DEPTH: 2 # We use a single test suite and run all the platforms test as subtest script: - DATADOG_AGENT_API_KEY=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $INSTALL_SCRIPT_API_KEY_ORG2 token) || exit $?; export DATADOG_AGENT_API_KEY - inv -e new-e2e-tests.run --targets $TARGETS --junit-tar "junit-${CI_JOB_ID}.tgz" ${EXTRA_PARAMS} --src-agent-version 7 --test-washer @@ -47,6 +51,7 @@ TARGETS: ./tests/agent-platform/rpm TEAM: agent-delivery EXTRA_PARAMS: --osversion $E2E_OSVERS --platform $E2E_PLATFORM --arch $E2E_ARCH + E2E_LOGS_PROCESSING_TEST_DEPTH: 2 # We use a single test suite and run all the platforms test as subtest script: - DATADOG_AGENT_API_KEY=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $INSTALL_SCRIPT_API_KEY_ORG2 token) || exit $?; export DATADOG_AGENT_API_KEY - inv -e new-e2e-tests.run --targets $TARGETS --junit-tar "junit-${CI_JOB_ID}.tgz" ${EXTRA_PARAMS} --test-washer 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/.gitlab/kernel_matrix_testing/security_agent.yml b/.gitlab/kernel_matrix_testing/security_agent.yml index 26e9293844e9e..769ebe10138b8 100644 --- a/.gitlab/kernel_matrix_testing/security_agent.yml +++ b/.gitlab/kernel_matrix_testing/security_agent.yml @@ -147,6 +147,7 @@ kmt_run_secagent_tests_x64: - "oracle_9.3" - "rocky_8.5" - "rocky_9.3" + - "rocky_9.4" - "opensuse_15.3" - "opensuse_15.5" - "suse_12.5" @@ -215,26 +216,6 @@ kmt_run_secagent_tests_x64_ebpfless: - !reference [.collect_outcomes_kmt] - !reference [.upload_junit_kmt] -kmt_run_secagent_tests_x64_fentry: - extends: - - .kmt_run_secagent_tests - image: registry.ddbuild.io/ci/datadog-agent-buildimages/system-probe_x64$DATADOG_AGENT_SYSPROBE_BUILDIMAGES_SUFFIX:$DATADOG_AGENT_SYSPROBE_BUILDIMAGES - tags: ["arch:amd64"] - needs: - - kmt_setup_env_secagent_x64 - - upload_dependencies_secagent_x64 - - upload_secagent_tests_x64 - variables: - ARCH: "x86_64" - parallel: - matrix: - - TAG: - - "amazon_2023" - TEST_SET: [cws_fentry] - after_script: - - !reference [.collect_outcomes_kmt] - - !reference [.upload_junit_kmt] - kmt_run_secagent_tests_x64_docker: extends: - .kmt_run_secagent_tests @@ -268,6 +249,7 @@ kmt_run_secagent_tests_x64_docker: - "oracle_9.3" - "rocky_8.5" - "rocky_9.3" + - "rocky_9.4" TEST_SET: [cws_docker] after_script: - !reference [.collect_outcomes_kmt] @@ -301,6 +283,7 @@ kmt_run_secagent_tests_arm64: - "oracle_9.3" - "rocky_8.5" - "rocky_9.3" + - "rocky_9.4" - "opensuse_15.5" TEST_SET: [cws_host] after_script: @@ -347,26 +330,6 @@ kmt_run_secagent_tests_arm64_ebpfless: - !reference [.collect_outcomes_kmt] - !reference [.upload_junit_kmt] -kmt_run_secagent_tests_arm64_fentry: - extends: - - .kmt_run_secagent_tests - image: registry.ddbuild.io/ci/datadog-agent-buildimages/system-probe_arm64$DATADOG_AGENT_SYSPROBE_BUILDIMAGES_SUFFIX:$DATADOG_AGENT_SYSPROBE_BUILDIMAGES - tags: ["arch:arm64"] - needs: - - kmt_setup_env_secagent_arm64 - - upload_dependencies_secagent_arm64 - - upload_secagent_tests_arm64 - variables: - ARCH: "arm64" - parallel: - matrix: - - TAG: - - "ubuntu_24.04" - TEST_SET: [cws_fentry] - after_script: - - !reference [.collect_outcomes_kmt] - - !reference [.upload_junit_kmt] - kmt_run_secagent_tests_arm64_docker: extends: - .kmt_run_secagent_tests @@ -395,6 +358,7 @@ kmt_run_secagent_tests_arm64_docker: - "oracle_9.3" - "rocky_8.5" - "rocky_9.3" + - "rocky_9.4" TEST_SET: ["cws_docker"] after_script: - !reference [.collect_outcomes_kmt] @@ -407,35 +371,52 @@ kmt_run_secagent_tests_arm64_docker: variables: TEST_COMPONENT: security-agent -kmt_secagent_cleanup_arm64: - when: always +.kmt_secagent_tests_join: + stage: kernel_matrix_testing_cleanup + rules: !reference [.on_security_agent_changes_or_manual] + image: registry.ddbuild.io/ci/datadog-agent-buildimages/system-probe_arm64$DATADOG_AGENT_SYSPROBE_BUILDIMAGES_SUFFIX:$DATADOG_AGENT_SYSPROBE_BUILDIMAGES + tags: ["arch:arm64"] + script: + - echo "nothing to do here" + +kmt_secagent_tests_join_arm64: extends: - - .kmt_secagent_cleanup + - .kmt_secagent_tests_join needs: - - kmt_setup_env_secagent_arm64 - kmt_run_secagent_tests_arm64 - kmt_run_secagent_tests_arm64_ad - kmt_run_secagent_tests_arm64_ebpfless - - kmt_run_secagent_tests_arm64_fentry - kmt_run_secagent_tests_arm64_docker - - upload_dependencies_secagent_arm64 + +kmt_secagent_cleanup_arm64: + when: always + extends: + - .kmt_secagent_cleanup + needs: + - kmt_setup_env_secagent_arm64 + - kmt_secagent_tests_join_arm64 - upload_secagent_tests_arm64 variables: ARCH: arm64 INSTANCE_TYPE: "m6gd.metal" -kmt_secagent_cleanup_x64: - when: always +kmt_secagent_tests_join_x64: extends: - - .kmt_secagent_cleanup + - .kmt_secagent_tests_join needs: - - kmt_setup_env_secagent_x64 - kmt_run_secagent_tests_x64 - kmt_run_secagent_tests_x64_required - kmt_run_secagent_tests_x64_ad - kmt_run_secagent_tests_x64_ebpfless - - kmt_run_secagent_tests_x64_fentry - kmt_run_secagent_tests_x64_docker + +kmt_secagent_cleanup_x64: + when: always + extends: + - .kmt_secagent_cleanup + needs: + - kmt_setup_env_secagent_x64 + - kmt_secagent_tests_join_x64 - upload_dependencies_secagent_x64 - upload_secagent_tests_x64 variables: diff --git a/.gitlab/notify/notify.yml b/.gitlab/notify/notify.yml index f40187465a50f..13131a7fecb4a 100644 --- a/.gitlab/notify/notify.yml +++ b/.gitlab/notify/notify.yml @@ -80,8 +80,8 @@ notify_github: script: - !reference [.setup_agent_github_app] # Python 3.12 changes default behavior how packages are installed. - # In particular, --break-system-packages command line option is - # required to use the old behavior or use a virtual env. https://github.com/actions/runner-images/issues/8615 + # In particular, --break-system-packages command line option is + # required to use the old behavior or use a virtual env. https://github.com/actions/runner-images/issues/8615 - python3 -m pip install -r tasks/libs/requirements-github.txt --break-system-packages - messagefile="$(mktemp)" - echo "Use this command from [test-infra-definitions](https://github.com/DataDog/test-infra-definitions) to manually test this PR changes on a VM:" >> "$messagefile" @@ -98,6 +98,7 @@ notify_gitlab_ci_changes: needs: [compute_gitlab_ci_config] tags: ["arch:amd64"] rules: + - !reference [.except_mergequeue] - changes: paths: - .gitlab-ci.yml @@ -105,8 +106,8 @@ notify_gitlab_ci_changes: compare_to: main # TODO: use a variable, when this is supported https://gitlab.com/gitlab-org/gitlab/-/issues/369916 script: # Python 3.12 changes default behavior how packages are installed. - # In particular, --break-system-packages command line option is - # required to use the old behavior or use a virtual env. https://github.com/actions/runner-images/issues/8615 + # In particular, --break-system-packages command line option is + # required to use the old behavior or use a virtual env. https://github.com/actions/runner-images/issues/8615 - python3 -m pip install -r tasks/libs/requirements-github.txt --break-system-packages - !reference [.setup_agent_github_app] - inv -e notify.gitlab-ci-diff --from-diff artifacts/diff.gitlab-ci.yml --pr-comment diff --git a/.gitlab/package_build/installer.yml b/.gitlab/package_build/installer.yml index 154392b246469..9073336a735ff 100644 --- a/.gitlab/package_build/installer.yml +++ b/.gitlab/package_build/installer.yml @@ -104,6 +104,7 @@ installer-install-scripts: - echo "About to build for $RELEASE_VERSION" - mkdir -p $OMNIBUS_PACKAGE_DIR - inv -e installer.build-linux-script "databricks" "$RELEASE_VERSION" + - inv -e installer.build-linux-script "emr" "$RELEASE_VERSION" - mv ./bin/installer/install-*.sh $OMNIBUS_PACKAGE_DIR/ - ls -la $OMNIBUS_PACKAGE_DIR artifacts: diff --git a/.gitlab/package_build/windows.yml b/.gitlab/package_build/windows.yml index cb57ebafa617f..ea458c9db77a7 100644 --- a/.gitlab/package_build/windows.yml +++ b/.gitlab/package_build/windows.yml @@ -30,6 +30,7 @@ -e DEBUG_CUSTOMACTION="$DEBUG_CUSTOMACTION" -e BUCKET_BRANCH="$BUCKET_BRANCH" -e S3_OMNIBUS_CACHE_BUCKET="$S3_OMNIBUS_CACHE_BUCKET" + -e S3_OMNIBUS_GIT_CACHE_BUCKET="$S3_OMNIBUS_GIT_CACHE_BUCKET" -e USE_S3_CACHING="$USE_S3_CACHING" -e INTEGRATION_WHEELS_CACHE_BUCKET="$INTEGRATION_WHEELS_CACHE_BUCKET" -e BUNDLE_MIRROR__RUBYGEMS__ORG=${BUNDLE_MIRROR__RUBYGEMS__ORG} diff --git a/.gitlab/pkg_metrics/pkg_metrics.yml b/.gitlab/pkg_metrics/pkg_metrics.yml index ceed774b62f41..ed09fa8ed1ee2 100644 --- a/.gitlab/pkg_metrics/pkg_metrics.yml +++ b/.gitlab/pkg_metrics/pkg_metrics.yml @@ -76,118 +76,14 @@ send_pkg_size: - inv package.send-size --flavor "agent" --package-os "suse" --package-path $OMNIBUS_PACKAGE_DIR_SUSE/datadog-agent-7.*.aarch64.rpm --major-version "7" --git-ref "${CI_COMMIT_REF_SLUG}" --bucket-branch "${BUCKET_BRANCH}" --arch arm64 -.check_pkg_size: - stage: pkg_metrics - image: registry.ddbuild.io/ci/datadog-agent-buildimages/deb_x64$DATADOG_AGENT_BUILDIMAGES_SUFFIX:$DATADOG_AGENT_BUILDIMAGES - tags: ["arch:amd64"] - script: - - ls -l $OMNIBUS_PACKAGE_DIR - - if [[ "${ARCH}" == "amd64" ]]; then ls -l $OMNIBUS_PACKAGE_DIR_SUSE; fi - - - export failures=0 - - export last_stable=$(inv release.get-release-json-value "last_stable::${MAJOR_VERSION}" --no-worktree) - # Get stable packages from S3 buckets, send new package sizes & compare stable and new package sizes - # The loop assumes that all flavors start with "da", which is currently the case - # We want to run all package size comparisons before failing, so we set +e while doing the comparisons - # to get the error codes without exiting the shell. - - | - if [[ "${ARCH}" == "amd64" ]]; then ARCH_RPM_EXT="x86_64"; else ARCH_RPM_EXT="aarch64"; fi - for flavor in ${FLAVORS}; do - - if [[ "${ARCH}" == "amd64" && "$flavor" != "datadog-heroku-agent" ]]; then - mkdir -p "/tmp/stable/${flavor}/suse" - curl -sSL "https://s3.amazonaws.com/yum.datadoghq.com/suse/stable/${MAJOR_VERSION}/${ARCH_RPM_EXT}/${flavor}-${last_stable}-1.${ARCH_RPM_EXT}.rpm" -o "/tmp/stable/${flavor}/suse/${flavor}-${last_stable}-1.${ARCH_RPM_EXT}.rpm" - set +e - inv package.compare-size --package-type "${flavor} suse rpm" --last-stable "${last_stable}" --threshold "${max_sizes[${flavor}]}" --new-package "$OMNIBUS_PACKAGE_DIR_SUSE/${flavor}-${MAJOR_VERSION}.*.${ARCH_RPM_EXT}.rpm" --stable-package "/tmp/stable/${flavor}/suse/${flavor}-${last_stable}-1.${ARCH_RPM_EXT}.rpm" - failures=$((${failures}+$?)) - set -e - fi - - mkdir -p "/tmp/stable/${flavor}" - - curl -sSL "https://s3.amazonaws.com/apt.datadoghq.com/pool/d/da/${flavor}_${last_stable}-1_${ARCH}.deb" -o "/tmp/stable/${flavor}/${flavor}_${last_stable}-1_${ARCH}.deb" - - set +e - inv package.compare-size --package-type "${flavor} deb" --last-stable "${last_stable}" --threshold "${max_sizes[${flavor}]}" --new-package "$OMNIBUS_PACKAGE_DIR/${flavor}_${MAJOR_VERSION}*_${ARCH}.deb" --stable-package "/tmp/stable/${flavor}/${flavor}_${last_stable}-1_${ARCH}.deb" - failures=$((${failures}+$?)) - set -e - - if [[ "$flavor" != "datadog-heroku-agent" && ( "${ARCH}" == "amd64" || "$flavor" != "datadog-dogstatsd") ]]; then - # We don't build RPM packages for the heroku flavor - curl -sSL "https://s3.amazonaws.com/yum.datadoghq.com/stable/${MAJOR_VERSION}/${ARCH_RPM_EXT}/${flavor}-${last_stable}-1.${ARCH_RPM_EXT}.rpm" -o "/tmp/stable/${flavor}/${flavor}-${last_stable}-1.${ARCH_RPM_EXT}.rpm" - set +e - inv package.compare-size --package-type "${flavor} rpm" --last-stable "${last_stable}" --threshold "${max_sizes[${flavor}]}" --new-package "$OMNIBUS_PACKAGE_DIR/${flavor}-${MAJOR_VERSION}.*.${ARCH_RPM_EXT}.rpm" --stable-package "/tmp/stable/${flavor}/${flavor}-${last_stable}-1.${ARCH_RPM_EXT}.rpm" - failures=$((${failures}+$?)) - set -e - fi - done - - # Make the job fail if at least one package is above threshold - - if [ "${failures}" -ne "0" ]; then false; fi - -check_pkg_size-amd64-a7: - extends: .check_pkg_size - rules: - - !reference [.except_mergequeue] - - when: on_success - needs: - - agent_deb-x64-a7 - - iot_agent_deb-x64 - - dogstatsd_deb-x64 - - agent_heroku_deb-x64-a7 - - agent_rpm-x64-a7 - - iot_agent_rpm-x64 - - dogstatsd_rpm-x64 - - agent_suse-x64-a7 - - dogstatsd_suse-x64 - - iot_agent_suse-x64 - variables: - MAJOR_VERSION: 7 - FLAVORS: "datadog-agent datadog-iot-agent datadog-dogstatsd datadog-heroku-agent" - ARCH: "amd64" - before_script: - # FIXME: ["datadog-agent"]="140000000" and ["datadog-heroku-agent"]="140000000" should - # be replaced by "50000000" - # "70000000" is needed as of now because of multiple large additions in 7.45 - - | - declare -Ar max_sizes=( - ["datadog-agent"]="140000000" - ["datadog-iot-agent"]="10000000" - ["datadog-dogstatsd"]="10000000" - ["datadog-heroku-agent"]="70000000" - ) - -check_pkg_size-arm64-a7: - extends: .check_pkg_size - rules: !reference [.on_all_builds] - needs: - - agent_deb-arm64-a7 - - iot_agent_deb-arm64 - - dogstatsd_deb-arm64 - - agent_rpm-arm64-a7 - - iot_agent_rpm-arm64 - variables: - MAJOR_VERSION: 7 - FLAVORS: "datadog-agent datadog-iot-agent datadog-dogstatsd" - ARCH: "arm64" - before_script: - # FIXME: ["datadog-agent"]="140000000" should be replaced by "70000000" - # "140000000" is needed as of now because of multiple large additions in 7.45 - - | - declare -Ar max_sizes=( - ["datadog-agent"]="140000000" - ["datadog-iot-agent"]="10000000" - ["datadog-dogstatsd"]="10000000" - ) -new_check_pkg_size: +check_pkg_size: stage: pkg_metrics image: registry.ddbuild.io/ci/datadog-agent-buildimages/deb_x64$DATADOG_AGENT_BUILDIMAGES_SUFFIX:$DATADOG_AGENT_BUILDIMAGES tags: ["arch:amd64"] rules: - !reference [.except_mergequeue] - when: on_success - allow_failure: true needs: - agent_deb-x64-a7 - iot_agent_deb-x64 diff --git a/.gitlab/powershell_script_deploy/powershell_script_deploy.yml b/.gitlab/powershell_script_deploy/powershell_script_deploy.yml index 4760dfdf18030..5269045adde05 100644 --- a/.gitlab/powershell_script_deploy/powershell_script_deploy.yml +++ b/.gitlab/powershell_script_deploy/powershell_script_deploy.yml @@ -5,7 +5,7 @@ powershell_script_deploy: image: registry.ddbuild.io/ci/datadog-agent-buildimages/gitlab_agent_deploy$DATADOG_AGENT_BUILDIMAGES_SUFFIX:$DATADOG_AGENT_BUILDIMAGES tags: ["arch:amd64"] - stage: choco_and_install_script_deploy + stage: install_script_deploy rules: !reference [.manual] needs: ["powershell_script_signing"] @@ -19,7 +19,7 @@ powershell_script_deploy: windows_bootstrapper_deploy: image: registry.ddbuild.io/ci/datadog-agent-buildimages/gitlab_agent_deploy$DATADOG_AGENT_BUILDIMAGES_SUFFIX:$DATADOG_AGENT_BUILDIMAGES tags: ["arch:amd64"] - stage: choco_and_install_script_deploy + stage: install_script_deploy rules: !reference [.manual] needs: ["windows-installer-amd64"] diff --git a/.gitlab/source_test/macos.yml b/.gitlab/source_test/macos.yml index da5ed4d68c8cf..1a92a354d47b8 100644 --- a/.gitlab/source_test/macos.yml +++ b/.gitlab/source_test/macos.yml @@ -2,44 +2,8 @@ include: - .gitlab/common/macos.yml -tests_macos: - stage: source_test - # HACK: Run macOS unit tests only on full pipelines, to limit the use of macOS GitHub runners. - rules: - - !reference [.on_main_or_release_branch_or_all_builds_or_pkg_installer_changes] - - when: manual - allow_failure: true - image: registry.ddbuild.io/ci/datadog-agent-buildimages/deb_x64$DATADOG_AGENT_BUILDIMAGES_SUFFIX:$DATADOG_AGENT_BUILDIMAGES - tags: ["arch:amd64"] - needs: ["setup_agent_version"] - script: - - !reference [.setup_macos_github_app] - - $S3_CP_CMD $S3_ARTIFACTS_URI/agent-version.cache . - - export VERSION_CACHE_CONTENT=$(cat agent-version.cache | base64 -) - # Python 3.12 changes default behavior how packages are installed. - # In particular, --break-system-packages command line option is - # required to use the old behavior or use a virtual env. https://github.com/actions/runner-images/issues/8615 - - python3 -m pip install -r tasks/libs/requirements-github.txt --break-system-packages - - FAST_TESTS_FLAG="" - - if [[ "$FAST_TESTS" = "true" ]]; then FAST_TESTS_FLAG="--fast-tests true"; fi - - inv -e github.trigger-macos --workflow-type "test" --datadog-agent-ref "$CI_COMMIT_SHA" --version-cache "$VERSION_CACHE_CONTENT" $FAST_TESTS_FLAG --test-washer - timeout: 6h - after_script: - - $CI_PROJECT_DIR/tools/ci/junit_upload.sh "junit-*-repacked.tgz" - artifacts: - expire_in: 2 weeks - when: always - paths: - - test_output.json - - junit-*-repacked.tgz - reports: - junit: "**/junit-out-*.xml" - .tests_macos_gitlab: stage: source_test - rules: - - !reference [.except_mergequeue] - - when: on_success extends: .macos_gitlab needs: ["go_deps", "go_tools_deps"] variables: diff --git a/.gitlab/trigger_release/trigger_release.yml b/.gitlab/trigger_release/trigger_release.yml index 0ecd5e0b02606..fa6d2c7402b60 100644 --- a/.gitlab/trigger_release/trigger_release.yml +++ b/.gitlab/trigger_release/trigger_release.yml @@ -55,3 +55,33 @@ trigger_manual_prod_release: - if: $CI_COMMIT_TAG =~ /^[0-9]+\.[0-9]+\.[0-9]+-v[0-9]+\.[0-9]+\.[0-9]+(-rc\.[0-9]+){0,1}$/ when: never - !reference [.on_deploy_stable_or_beta_manual_auto_on_stable] + +include: + - https://gitlab-templates.ddbuild.io/slack-notifier/v3-sdm/template.yml + +.setup_github_app_agent_platform_auto_pr: + # GitHub App rate-limits are per-app. Since we are rarely calling the job, we are only using the instance 2 + - | + GITHUB_KEY_B64=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $MACOS_GITHUB_APP_2 key_b64) || exit $?; export GITHUB_KEY_B64 + GITHUB_APP_ID=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $MACOS_GITHUB_APP_2 app_id) || exit $?; export GITHUB_APP_ID + GITHUB_INSTALLATION_ID=$($CI_PROJECT_DIR/tools/ci/fetch_secret.sh $MACOS_GITHUB_APP_2 installation_id) || exit $?; export GITHUB_INSTALLATION_ID + echo "Using GitHub App instance 2" + +generate_windows_gitlab_runner_bump_pr: + stage: trigger_release + extends: .slack-notifier-base + needs: ["trigger_auto_staging_release"] + tags: ["arch:amd64"] + rules: + - if: $DDR == "true" + when: never + - if: $CI_COMMIT_TAG =~ /^[0-9]+\.[0-9]+\.[0-9]+-v[0-9]+\.[0-9]+\.[0-9]+(-rc\.[0-9]+){0,1}$/ + when: never + - if: $CI_COMMIT_TAG =~ /^[0-9]+\.[0-9]+\.[0-9]+(-rc\.[0-9]+)?$/ + + script: + # We are using the agent platform auto PR github app to access the buildenv repository (already used for macOS builds) + - !reference [.setup_github_app_agent_platform_auto_pr] + - python3 -m pip install -r requirements.txt -r tasks/libs/requirements-notifications.txt + - $S3_CP_CMD $S3_ARTIFACTS_URI/agent-version.cache . + - inv -e github.update-windows-runner-version diff --git a/.golangci.yml b/.golangci.yml index 0358a505b0118..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 @@ -607,6 +605,12 @@ linters-settings: desc: "Not really forbidden to use, but it is usually imported by mistake instead of github.com/stretchr/testify/assert, and confusing since it actually has the behavior of github.com/stretchr/testify/require" - pkg: "debug/elf" desc: "prefer pkg/util/safeelf to prevent panics during parsing" + logger: + files: + - "!**/pkg/util/log/**" + deny: + - pkg: "github.com/cihub/seelog" + desc: "seelog should not be used directly. Use `pkg/util/log` instead." errcheck: exclude-functions: diff --git a/CHANGELOG-DCA.rst b/CHANGELOG-DCA.rst index 5ed8fdc3430f3..7b5abd00a3bc2 100644 --- a/CHANGELOG-DCA.rst +++ b/CHANGELOG-DCA.rst @@ -2,6 +2,46 @@ Release Notes ============= +.. _Release Notes_7.60.1: + +7.60.1 +====== + +.. _Release Notes_7.60.1_Prelude: + +Prelude +------- + +Released on: 2024-12-19 +Pinned to datadog-agent v7.60.1: `CHANGELOG `_. + +.. _Release Notes_7.60.0: + +7.60.0 +====== + +.. _Release Notes_7.60.0_Prelude: + +Prelude +------- + +Released on: 2024-12-16 +Pinned to datadog-agent v7.60.0: `CHANGELOG `_. + + +.. _Release Notes_7.60.0_Bug Fixes: + +Bug Fixes +--------- + +- Fixes bug where incorrect timestamp would be used for unbundled Kubernetes events. + +- Fixed an issue in the KSM check when it's configured with the option + ``pod_collection_mode`` set to ``node_kubelet``. Previously, the check could + fail to start if there was a timeout while contacting the API server. This + issue has now been resolved. + + .. _Release Notes_7.59.1: 7.59.1 diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 9dcb70ac5e1e1..1def73a37b2e1 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -2,6 +2,159 @@ Release Notes ============= +.. _Release Notes_7.60.1: + +7.60.1 +====== + +.. _Release Notes_7.60.1_Prelude: + +Prelude +------- + +Release on: 2024-12-19 + + +.. _Release Notes_7.60.1_Security Notes: + +Security Notes +-------------- + +- Update ``golang.org/x/crypto`` to fix CVE-2024-45337. + + +.. _Release Notes_7.60.0: + +7.60.0 +====== + +.. _Release Notes_7.60.0_Prelude: + +Prelude +------- + +Release on: 2024-12-16 + +- Please refer to the `7.60.0 tag on integrations-core `_ for the list of changes on the Core Checks + + +.. _Release Notes_7.60.0_Upgrade Notes: + +Upgrade Notes +------------- + +- * Parameter ``peer_tags_aggregation`` (a.k.a. environment variable ``DD_APM_PEER_TAGS_AGGREGATION``) is now enabled by default. This means that aggregation of peer related tags (e.g., `peer.service`, `db.instance`, etc.) now happens in the Agent, which enables statistics for Inferred Entities. If you want to disable this feature, set `peer_tags_aggregation` to `false` in your Agent configuration. + + * Parameter ``compute_stats_by_span_kind`` (a.k.a. environment variable ``DD_APM_COMPUTE_STATS_BY_SPAN_KIND``) is now enabled by default. This means spans with an eligible `span.kind` will have stats computed. If disabled, only top-level and measured spans will have stats computed. If you want to disable this feature, set `compute_stats_by_span_kind` to `false` in your Agent configuration. + + Note: When using ``peer_tags_aggregation`` and ``compute_stats_by_span_kind``, a high cardinality of peer tags or APM resources can contribute to higher CPU and memory consumption. If enabling both causes the Agent to consume too many resources, try disabling `compute_stats_by_span_kind` first. + + It is recommended that you update your tracing libraries according to the instructions `here `_ and set ``DD_TRACE_REMOVE_INTEGRATION_SERVICE_NAMES_ENABLED`` (or ``dd.trace.remove.integration-service-names.enabled``) to ``true``. + +- Upgraded JMXFetch to `0.49.5 `_ which adds support for ``UnloadedClassCount`` metric + and IBM J9 gc metrics. See `0.49.5 `_ for more details. + + +.. _Release Notes_7.60.0_New Features: + +New Features +------------ + +- `Inferred Service dependencies `_ are now Generally Available (exiting Beta) and enabled by default. Inferred Services of all kinds now have trace metrics and are available in dependency maps. `apm_config.peer_tags_aggregation` and `apm_config.compute_stats_by_span_kind` both now default to `true` unless explicitly set to `false`. + +- Add `check_tag_cardinality` parameter config check. + + By default `check_tag_cardinality` is not set which doesn't change the behavior of the checks. + Once it is set in pod annotaions, it overrides the cardinality value provided in the base agent configuration. + Example of usage: + ```yaml + ad.datadoghq.com/redis.checks: | + { + "redisdb": { + "check_tag_cardinality": "high", + "instances": [ + { + "host": "%%host%%", + "port": "6379" + } + ] + } + } + ``` + +- Added a new feature flag `enable_receive_resource_spans_v2` in DD_APM_FEATURES that gates a refactored implementation of ReceiveResourceSpans for OTLP. + + +.. _Release Notes_7.60.0_Enhancement Notes: + +Enhancement Notes +----------------- + +- Added information about where the Agent sourced BTF data for eBPF to the Agent flare. When applicable, this will appear in ``system-probe/ebpf_btf_loader.log``. + +- The Agent flare now returns NAT debug information from conntrack in the ``system-probe`` directory. + +- The ``flare`` subcommand includes a ``--provider-timeout`` option to set a timeout for each file collection (default is 10s), useful for unblocking slow flare creation. + +- This change reduces the number of DNS queries made by Network Traffic + based paths in Network Path. + A cache of reverse DNS lookups is used to reduce the number of DNS + queries. Additionally, reverse DNS lookups are now performed only + for private IPs and not for public IPs. + +- Agent flare now includes system-probe telemetry data via ``system-probe/system_probe_telemetry.log``. + +- The MSI installer uses 7zr.exe to decompress the embedded Python. + +- On Windows, the endpoint /windows_crash_detection/check has been modified to report crashes in + an asynchronous manner, to allow processing of large crash dumps without blocking or timing out. + The first check will return a busy status and continue to do so until the processing is completed. + + +.. _Release Notes_7.60.0_Deprecation Notes: + +Deprecation Notes +----------------- + +- Prebuilt eBPF for the network tracer system-probe module has been + deprecated in favor of CO-RE and runtime compilation variants on Linux + kernel versions 6+ and RHEL kernel versions 5.14+. To continue to use + the prebuilt eBPF network tracer, set + `system_probe_config.allow_prebuilt_fallback` in the + system-probe config file, or set the environment variable + `DD_ALLOW_PREBUILT_FALLBACK`, to `true` on these platforms. + +- The feature flag `service_monitoring_config.enable_http_stats_by_status_code` was deprecated and removed. + No impact on USM's behavior. + + +.. _Release Notes_7.60.0_Bug Fixes: + +Bug Fixes +--------- + +- Fixes an issue added in 7.50 that causes the Windows event log tailer to drop + events if it cannot open their publisher metadata. + +- Fix a bug in the config parser that broke ignored_ip_addresses from working in NDM Autodiscovery. + +- Fixes host tags with a configurable duration so the metric's context hash doesn't change, preventing the aggregator from mistaking it as a new metric. + +- Fix `could not parse voltage fields` error in Nvidia Jetson integration when tegrastats output contains mW units. + +- Fix building of Python extension containing native code. + +- [oracle] Fix broken activity sampling with an external Oracle client. + +- Fix nil pointer error on Oracle DBM query when the check's connection is lost before SELECT statement executes. + +- Fix a regression that caused the Agent to not be able to run if its + capabilities had been modified with the `setcap` command. + +- Fix bug wherein single line truncated logs ended with whitespace characters were not being tagged as truncated. + Fix issue with the truncation message occasionally causing subsequent logs to think they were truncated when they were not (single line logs only). + + .. _Release Notes_7.59.1: 7.59.1 diff --git a/Dockerfiles/agent-ot/Dockerfile.agent-otel b/Dockerfiles/agent-ot/Dockerfile.agent-otel index 78534598a581c..49ea309af7019 100644 --- a/Dockerfiles/agent-ot/Dockerfile.agent-otel +++ b/Dockerfiles/agent-ot/Dockerfile.agent-otel @@ -1,5 +1,5 @@ -ARG AGENT_VERSION=7.57.0-v1.0-ot-beta-jmx -ARG AGENT_BRANCH=7.57.x-otel-beta-v1 +ARG AGENT_VERSION=7.59.0-v1.1.0-ot-beta-jmx +ARG AGENT_BRANCH=7.59.x # Use the Ubuntu Slim AMD64 base image FROM ubuntu:24.04 AS builder 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/LICENSE-3rdparty.csv b/LICENSE-3rdparty.csv index 6f885b06c7a9f..f9147b036f8fd 100644 --- a/LICENSE-3rdparty.csv +++ b/LICENSE-3rdparty.csv @@ -343,10 +343,10 @@ core,github.com/aquasecurity/trivy-db/pkg/utils/strings,Apache-2.0,Copyright 201 core,github.com/aquasecurity/trivy-db/pkg/vulnsrc/alma,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy-db/pkg/vulnsrc/alpine,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy-db/pkg/vulnsrc/amazon,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd +core,github.com/aquasecurity/trivy-db/pkg/vulnsrc/azure,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd +core,github.com/aquasecurity/trivy-db/pkg/vulnsrc/azure/oval,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy-db/pkg/vulnsrc/chainguard,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy-db/pkg/vulnsrc/debian,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd -core,github.com/aquasecurity/trivy-db/pkg/vulnsrc/mariner,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd -core,github.com/aquasecurity/trivy-db/pkg/vulnsrc/mariner/oval,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy-db/pkg/vulnsrc/oracle-oval,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy-db/pkg/vulnsrc/photon,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy-db/pkg/vulnsrc/redhat-oval,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd @@ -359,14 +359,22 @@ core,github.com/aquasecurity/trivy-java-db/pkg/db,Apache-2.0,Copyright 2019-2020 core,github.com/aquasecurity/trivy-java-db/pkg/types,Apache-2.0,Copyright 2019-2020 Aqua Security core,github.com/aquasecurity/trivy/pkg/attestation,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy/pkg/attestation/sbom,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd +core,github.com/aquasecurity/trivy/pkg/cache,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy/pkg/clock,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy/pkg/compliance/report,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy/pkg/compliance/spec,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd +core,github.com/aquasecurity/trivy/pkg/db,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy/pkg/dependency,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy/pkg/dependency/parser/c/conan,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd +core,github.com/aquasecurity/trivy/pkg/dependency/parser/conda/environment,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy/pkg/dependency/parser/conda/meta,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy/pkg/dependency/parser/dart/pub,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy/pkg/dependency/parser/dotnet/core_deps,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd +core,github.com/aquasecurity/trivy/pkg/dependency/parser/executable,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd +core,github.com/aquasecurity/trivy/pkg/dependency/parser/executable/java,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd +core,github.com/aquasecurity/trivy/pkg/dependency/parser/executable/nodejs,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd +core,github.com/aquasecurity/trivy/pkg/dependency/parser/executable/php,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd +core,github.com/aquasecurity/trivy/pkg/dependency/parser/executable/python,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy/pkg/dependency/parser/golang/binary,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy/pkg/dependency/parser/golang/mod,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy/pkg/dependency/parser/golang/sum,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd @@ -374,6 +382,7 @@ core,github.com/aquasecurity/trivy/pkg/dependency/parser/gradle/lockfile,Apache- core,github.com/aquasecurity/trivy/pkg/dependency/parser/hex/mix,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy/pkg/dependency/parser/java/jar,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy/pkg/dependency/parser/java/pom,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd +core,github.com/aquasecurity/trivy/pkg/dependency/parser/julia/manifest,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy/pkg/dependency/parser/nodejs/npm,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy/pkg/dependency/parser/nodejs/packagejson,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy/pkg/dependency/parser/nodejs/pnpm,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd @@ -391,10 +400,10 @@ core,github.com/aquasecurity/trivy/pkg/dependency/parser/ruby/bundler,Apache-2.0 core,github.com/aquasecurity/trivy/pkg/dependency/parser/ruby/gemspec,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy/pkg/dependency/parser/rust/binary,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy/pkg/dependency/parser/rust/cargo,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd +core,github.com/aquasecurity/trivy/pkg/dependency/parser/sbt/lockfile,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy/pkg/dependency/parser/swift/cocoapods,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy/pkg/dependency/parser/swift/swift,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy/pkg/dependency/parser/utils,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd -core,github.com/aquasecurity/trivy/pkg/dependency/types,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy/pkg/detector/library,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy/pkg/detector/library/compare,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy/pkg/detector/library/compare/bitnami,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd @@ -406,9 +415,9 @@ core,github.com/aquasecurity/trivy/pkg/detector/ospkg,Apache-2.0,Copyright 2019- core,github.com/aquasecurity/trivy/pkg/detector/ospkg/alma,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy/pkg/detector/ospkg/alpine,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy/pkg/detector/ospkg/amazon,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd +core,github.com/aquasecurity/trivy/pkg/detector/ospkg/azure,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy/pkg/detector/ospkg/chainguard,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy/pkg/detector/ospkg/debian,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd -core,github.com/aquasecurity/trivy/pkg/detector/ospkg/mariner,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy/pkg/detector/ospkg/oracle,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy/pkg/detector/ospkg/photon,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy/pkg/detector/ospkg/redhat,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd @@ -425,6 +434,7 @@ core,github.com/aquasecurity/trivy/pkg/fanal/analyzer/buildinfo,Apache-2.0,Copyr core,github.com/aquasecurity/trivy/pkg/fanal/analyzer/executable,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy/pkg/fanal/analyzer/language,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy/pkg/fanal/analyzer/language/c/conan,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd +core,github.com/aquasecurity/trivy/pkg/fanal/analyzer/language/conda/environment,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy/pkg/fanal/analyzer/language/conda/meta,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy/pkg/fanal/analyzer/language/dart/pub,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy/pkg/fanal/analyzer/language/dotnet/deps,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd @@ -436,6 +446,8 @@ core,github.com/aquasecurity/trivy/pkg/fanal/analyzer/language/golang/mod,Apache core,github.com/aquasecurity/trivy/pkg/fanal/analyzer/language/java/gradle,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy/pkg/fanal/analyzer/language/java/jar,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy/pkg/fanal/analyzer/language/java/pom,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd +core,github.com/aquasecurity/trivy/pkg/fanal/analyzer/language/java/sbt,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd +core,github.com/aquasecurity/trivy/pkg/fanal/analyzer/language/julia/pkg,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy/pkg/fanal/analyzer/language/nodejs/license,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy/pkg/fanal/analyzer/language/nodejs/npm,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy/pkg/fanal/analyzer/language/nodejs/pkg,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd @@ -457,7 +469,6 @@ core,github.com/aquasecurity/trivy/pkg/fanal/analyzer/os,Apache-2.0,Copyright 20 core,github.com/aquasecurity/trivy/pkg/fanal/analyzer/os/alpine,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy/pkg/fanal/analyzer/os/amazonlinux,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy/pkg/fanal/analyzer/os/debian,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd -core,github.com/aquasecurity/trivy/pkg/fanal/analyzer/os/mariner,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy/pkg/fanal/analyzer/os/redhatbase,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy/pkg/fanal/analyzer/os/release,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy/pkg/fanal/analyzer/os/ubuntu,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd @@ -468,12 +479,12 @@ core,github.com/aquasecurity/trivy/pkg/fanal/analyzer/repo/apk,Apache-2.0,Copyri core,github.com/aquasecurity/trivy/pkg/fanal/analyzer/sbom,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy/pkg/fanal/applier,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy/pkg/fanal/artifact,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd +core,github.com/aquasecurity/trivy/pkg/fanal/artifact/container,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy/pkg/fanal/artifact/image,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy/pkg/fanal/artifact/local,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy/pkg/fanal/artifact/repo,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy/pkg/fanal/artifact/sbom,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy/pkg/fanal/artifact/vm,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd -core,github.com/aquasecurity/trivy/pkg/fanal/cache,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy/pkg/fanal/handler,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy/pkg/fanal/handler/all,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy/pkg/fanal/handler/sysfile,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd @@ -481,7 +492,7 @@ core,github.com/aquasecurity/trivy/pkg/fanal/handler/unpackaged,Apache-2.0,Copyr core,github.com/aquasecurity/trivy/pkg/fanal/image,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy/pkg/fanal/image/daemon,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy/pkg/fanal/image/registry,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd -core,github.com/aquasecurity/trivy/pkg/fanal/log,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd +core,github.com/aquasecurity/trivy/pkg/fanal/image/registry/intf,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy/pkg/fanal/types,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy/pkg/fanal/utils,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy/pkg/fanal/vm,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd @@ -490,6 +501,7 @@ core,github.com/aquasecurity/trivy/pkg/fanal/vm/filesystem,Apache-2.0,Copyright core,github.com/aquasecurity/trivy/pkg/fanal/walker,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy/pkg/flag,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy/pkg/iac/detection,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd +core,github.com/aquasecurity/trivy/pkg/iac/rego,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy/pkg/iac/types,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy/pkg/javadb,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy/pkg/licensing,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd @@ -531,11 +543,14 @@ core,github.com/aquasecurity/trivy/pkg/semaphore,Apache-2.0,Copyright 2019-2020 core,github.com/aquasecurity/trivy/pkg/types,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy/pkg/utils/fsutils,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy/pkg/uuid,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd -core,github.com/aquasecurity/trivy/pkg/version,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd +core,github.com/aquasecurity/trivy/pkg/version/app,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd +core,github.com/aquasecurity/trivy/pkg/version/doc,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy/pkg/vex,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd +core,github.com/aquasecurity/trivy/pkg/vex/repo,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy/pkg/vulnerability,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy/pkg/x/io,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy/pkg/x/path,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd +core,github.com/aquasecurity/trivy/pkg/x/slices,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy/pkg/x/strings,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy/pkg/x/sync,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd core,github.com/aquasecurity/trivy/rpc/cache,Apache-2.0,Copyright 2019-2020 Aqua Security Software Ltd @@ -596,12 +611,6 @@ core,github.com/aws/aws-sdk-go-v2/service/ebs/types,Apache-2.0,"Copyright 2014-2 core,github.com/aws/aws-sdk-go-v2/service/ec2,Apache-2.0,"Copyright 2014-2015 Stripe, Inc. | Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved." core,github.com/aws/aws-sdk-go-v2/service/ec2/internal/endpoints,Apache-2.0,"Copyright 2014-2015 Stripe, Inc. | Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved." core,github.com/aws/aws-sdk-go-v2/service/ec2/types,Apache-2.0,"Copyright 2014-2015 Stripe, Inc. | Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved." -core,github.com/aws/aws-sdk-go-v2/service/ecr,Apache-2.0,"Copyright 2014-2015 Stripe, Inc. | Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved." -core,github.com/aws/aws-sdk-go-v2/service/ecr/internal/endpoints,Apache-2.0,"Copyright 2014-2015 Stripe, Inc. | Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved." -core,github.com/aws/aws-sdk-go-v2/service/ecr/types,Apache-2.0,"Copyright 2014-2015 Stripe, Inc. | Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved." -core,github.com/aws/aws-sdk-go-v2/service/ecrpublic,Apache-2.0,"Copyright 2014-2015 Stripe, Inc. | Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved." -core,github.com/aws/aws-sdk-go-v2/service/ecrpublic/internal/endpoints,Apache-2.0,"Copyright 2014-2015 Stripe, Inc. | Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved." -core,github.com/aws/aws-sdk-go-v2/service/ecrpublic/types,Apache-2.0,"Copyright 2014-2015 Stripe, Inc. | Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved." core,github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding,Apache-2.0,"Copyright 2014-2015 Stripe, Inc. | Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved." core,github.com/aws/aws-sdk-go-v2/service/internal/presigned-url,Apache-2.0,"Copyright 2014-2015 Stripe, Inc. | Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved." core,github.com/aws/aws-sdk-go-v2/service/kms,Apache-2.0,"Copyright 2014-2015 Stripe, Inc. | Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved." @@ -692,11 +701,6 @@ core,github.com/aws/smithy-go/tracing,Apache-2.0,"Copyright Amazon.com, Inc. or core,github.com/aws/smithy-go/transport/http,Apache-2.0,"Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved" core,github.com/aws/smithy-go/transport/http/internal/io,Apache-2.0,"Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved" core,github.com/aws/smithy-go/waiter,Apache-2.0,"Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved" -core,github.com/awslabs/amazon-ecr-credential-helper/ecr-login,Apache-2.0,"Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved." -core,github.com/awslabs/amazon-ecr-credential-helper/ecr-login/api,Apache-2.0,"Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved." -core,github.com/awslabs/amazon-ecr-credential-helper/ecr-login/cache,Apache-2.0,"Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved." -core,github.com/awslabs/amazon-ecr-credential-helper/ecr-login/config,Apache-2.0,"Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved." -core,github.com/awslabs/amazon-ecr-credential-helper/ecr-login/version,Apache-2.0,"Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved." core,github.com/bahlo/generic-list-go,BSD-3-Clause,Copyright (c) 2009 The Go Authors. All rights reserved core,github.com/beevik/ntp,BSD-2-Clause,Al Cutter (AlCutter) | Andrey Smirnov (smira) | Anton Tolchanov (knyar) | Ask Bjørn Hansen (abh) | Brett Vickers (beevik) | Christopher Batey (chbatey) | Copyright © 2015-2023 Brett Vickers. All rights reserved | Leonid Evdokimov (darkk) | Meng Zhuo (mengzhuo) | Mikhail Salosin (AlphaB) | Silves-Xiang (silves-xiang) core,github.com/benbjohnson/clock,MIT,Copyright (c) 2014 Ben Johnson @@ -704,6 +708,7 @@ core,github.com/beorn7/perks/quantile,MIT,Copyright (C) 2013 Blake Mizerany core,github.com/bhmj/jsonslice,MIT,Copyright (c) 2018 bhmj core,github.com/bitnami/go-version/pkg/version,Apache-2.0,Copyright (c) 2023-2024 Carlos Rodríguez Hernández core,github.com/blabber/go-freebsd-sysctl/sysctl,0BSD,Copyright (c) 2014-2020 by Tobias Rehbein +core,github.com/blang/semver,MIT,Copyright (c) 2014 Benedikt Lang core,github.com/blang/semver/v4,MIT,Copyright (c) 2014 Benedikt Lang core,github.com/bmatcuk/doublestar/v4,MIT,Copyright (c) 2014 Bob Matcuk core,github.com/bmizerany/pat,MIT,"Copyright (C) 2012 by Keith Rarick, Blake Mizerany" @@ -838,6 +843,7 @@ core,github.com/containerd/containerd/snapshots,Apache-2.0,"Copyright 2012-2015 core,github.com/containerd/containerd/snapshots/proxy,Apache-2.0,"Copyright 2012-2015 Docker, Inc." core,github.com/containerd/containerd/tracing,Apache-2.0,"Copyright 2012-2015 Docker, Inc." core,github.com/containerd/containerd/version,Apache-2.0,"Copyright 2012-2015 Docker, Inc." +core,github.com/containerd/continuity/devices,Apache-2.0,"Copyright 2012-2015 Docker, Inc." core,github.com/containerd/continuity/fs,Apache-2.0,"Copyright 2012-2015 Docker, Inc." core,github.com/containerd/continuity/sysx,Apache-2.0,"Copyright 2012-2015 Docker, Inc." core,github.com/containerd/errdefs,Apache-2.0,"Copyright 2012-2015 Docker, Inc." @@ -871,6 +877,7 @@ core,github.com/coreos/pkg/dlopen,Apache-2.0,"Copyright 2017 CoreOS, Inc" core,github.com/cri-o/ocicni/pkg/ocicni,Apache-2.0,"Copyright 2016 Red Hat, Inc" core,github.com/csaf-poc/csaf_distribution/v3/csaf,MIT,Copyright 2021-2023 German Federal Office for Information Security (BSI) core,github.com/csaf-poc/csaf_distribution/v3/util,MIT,Copyright 2021-2023 German Federal Office for Information Security (BSI) +core,github.com/cyberphone/json-canonicalization/go/src/webpki.org/jsoncanonicalizer,Apache-2.0,Copyright 2018 Anders Rundgren core,github.com/cyphar/filepath-securejoin,BSD-3-Clause,Copyright (C) 2014-2015 Docker Inc & Go Authors. All rights reserved | Copyright (C) 2017-2024 SUSE LLC. All rights reserved core,github.com/davecgh/go-spew/spew,ISC,Copyright (c) 2012-2016 Dave Collins core,github.com/dennwc/varint,MIT,Copyright (c) 2019 Denys Smirnov @@ -878,6 +885,8 @@ core,github.com/dgryski/go-jump,MIT,Copyright (c) 2014 Damian Gryski core,github.com/digitalocean/godo,MIT,Copyright (c) 2013 The go-github AUTHORS. All rights reserved | Copyright (c) 2014-2016 The godo AUTHORS. All rights reserved core,github.com/digitalocean/godo/metrics,MIT,Copyright (c) 2013 The go-github AUTHORS. All rights reserved | Copyright (c) 2014-2016 The godo AUTHORS. All rights reserved +core,github.com/digitorus/pkcs7,MIT,Copyright (c) 2015 Andrew Smith +core,github.com/digitorus/timestamp,BSD-2-Clause,"Copyright (c) 2017, Digitorus B.V" core,github.com/distribution/reference,Apache-2.0,Copyright 2014 The CNCF Distribution Project Authors core,github.com/docker/cli/cli/config,Apache-2.0,"Copyright 2012-2017 Docker, Inc." core,github.com/docker/cli/cli/config/configfile,Apache-2.0,"Copyright 2012-2017 Docker, Inc." @@ -907,6 +916,7 @@ core,github.com/docker/docker/api/types/volume,Apache-2.0,"Copyright 2012-2017 D core,github.com/docker/docker/client,Apache-2.0,"Copyright 2012-2017 Docker, Inc." core,github.com/docker/docker/errdefs,Apache-2.0,"Copyright 2012-2017 Docker, Inc." core,github.com/docker/docker/internal/multierror,Apache-2.0,"Copyright 2012-2017 Docker, Inc." +core,github.com/docker/docker/pkg/system,Apache-2.0,"Copyright 2012-2017 Docker, Inc." core,github.com/docker/go-connections/nat,Apache-2.0,"Copyright 2012-2017 Docker, Inc." core,github.com/docker/go-connections/sockets,Apache-2.0,"Copyright 2012-2017 Docker, Inc." core,github.com/docker/go-connections/tlsconfig,Apache-2.0,"Copyright 2012-2017 Docker, Inc." @@ -976,6 +986,8 @@ core,github.com/fsnotify/fsnotify/internal,BSD-3-Clause,Copyright (c) 2012 The G core,github.com/fxamacker/cbor/v2,MIT,Copyright (c) 2019-present Faye Amacker | Copyright © 2019-2024 [Faye Amacker](https://github.com/fxamacker) core,github.com/ghodss/yaml,MIT,Copyright (c) 2012 The Go Authors. All rights reserved | Copyright (c) 2014 Sam Ghods core,github.com/glaslos/ssdeep,MIT,"Copyright (c) 2015, Arbo von Monkiewitsch All rights reserved | Copyright (c) 2017 Lukas Rist" +core,github.com/go-chi/chi,MIT,"Copyright (c) 2015-present Peter Kieltyka (https://github.com/pkieltyka), Google Inc | Copyright (c) 2015-present [Peter Kieltyka](https://github.com/pkieltyka)" +core,github.com/go-chi/chi/middleware,MIT,"Copyright (c) 2015-present Peter Kieltyka (https://github.com/pkieltyka), Google Inc | Copyright (c) 2015-present [Peter Kieltyka](https://github.com/pkieltyka)" core,github.com/go-delve/delve/pkg/dwarf,MIT,Copyright (c) 2014 Derek Parker core,github.com/go-delve/delve/pkg/dwarf/godwarf,MIT,Copyright (c) 2014 Derek Parker core,github.com/go-delve/delve/pkg/dwarf/leb128,MIT,Copyright (c) 2014 Derek Parker @@ -1144,7 +1156,6 @@ core,github.com/golang/protobuf/proto,BSD-3-Clause,Copyright (c) 2009 The Go Aut core,github.com/golang/protobuf/protoc-gen-go,BSD-3-Clause,Copyright (c) 2009 The Go Authors. All rights reserved. core,github.com/golang/protobuf/protoc-gen-go/descriptor,BSD-3-Clause,Copyright (c) 2009 The Go Authors. All rights reserved. core,github.com/golang/protobuf/protoc-gen-go/plugin,BSD-3-Clause,Copyright (c) 2009 The Go Authors. All rights reserved. -core,github.com/golang/protobuf/ptypes,BSD-3-Clause,Copyright (c) 2009 The Go Authors. All rights reserved. core,github.com/golang/protobuf/ptypes/any,BSD-3-Clause,Copyright (c) 2009 The Go Authors. All rights reserved. core,github.com/golang/protobuf/ptypes/duration,BSD-3-Clause,Copyright (c) 2009 The Go Authors. All rights reserved. core,github.com/golang/protobuf/ptypes/empty,BSD-3-Clause,Copyright (c) 2009 The Go Authors. All rights reserved. @@ -1174,6 +1185,13 @@ core,github.com/google/cel-go/interpreter,Apache-2.0,Copyright (c) 2018 The Go A core,github.com/google/cel-go/interpreter/functions,Apache-2.0,Copyright (c) 2018 The Go Authors. All rights reserved core,github.com/google/cel-go/parser,Apache-2.0,Copyright (c) 2018 The Go Authors. All rights reserved core,github.com/google/cel-go/parser/gen,Apache-2.0,Copyright (c) 2018 The Go Authors. All rights reserved +core,github.com/google/certificate-transparency-go,Apache-2.0,"Adam Eijdenberg | Al Cutter | Alex Cohn | Ben Laurie | Chris Kennelly | Comodo CA Limited | David Drysdale | Deyan Bektchiev | Ed Maste | Emilia Kasper | Eran Messeri | Fiaz Hossain | Gary Belvin | Google LLC | Internet Security Research Group | Jeff Trawick | Joe Tsai | Kat Joyce | Katriel Cohn-Gordon | Kiril Nikolov | Konrad Kraszewski | Laël Cellier | Linus Nordberg | Mark Schloesser | NORDUnet A/S | Nicholas Galbreath | Oliver Weidner | Pascal Leroy | Paul Hadfield | Paul Lietar | Pavel Kalinnikov | Pierre Phaneuf | PrimeKey Solutions AB | Rob Percival | Rob Stradling | Roger Ng | Roland Shoemaker | Ruslan Kovalov | Samuel Lidén Borell | Tatiana Merkulova | Venafi, Inc. | Vladimir Rutsky | Ximin Luo " +core,github.com/google/certificate-transparency-go/asn1,Apache-2.0,"Adam Eijdenberg | Al Cutter | Alex Cohn | Ben Laurie | Chris Kennelly | Comodo CA Limited | David Drysdale | Deyan Bektchiev | Ed Maste | Emilia Kasper | Eran Messeri | Fiaz Hossain | Gary Belvin | Google LLC | Internet Security Research Group | Jeff Trawick | Joe Tsai | Kat Joyce | Katriel Cohn-Gordon | Kiril Nikolov | Konrad Kraszewski | Laël Cellier | Linus Nordberg | Mark Schloesser | NORDUnet A/S | Nicholas Galbreath | Oliver Weidner | Pascal Leroy | Paul Hadfield | Paul Lietar | Pavel Kalinnikov | Pierre Phaneuf | PrimeKey Solutions AB | Rob Percival | Rob Stradling | Roger Ng | Roland Shoemaker | Ruslan Kovalov | Samuel Lidén Borell | Tatiana Merkulova | Venafi, Inc. | Vladimir Rutsky | Ximin Luo " +core,github.com/google/certificate-transparency-go/gossip/minimal/x509ext,Apache-2.0,"Adam Eijdenberg | Al Cutter | Alex Cohn | Ben Laurie | Chris Kennelly | Comodo CA Limited | David Drysdale | Deyan Bektchiev | Ed Maste | Emilia Kasper | Eran Messeri | Fiaz Hossain | Gary Belvin | Google LLC | Internet Security Research Group | Jeff Trawick | Joe Tsai | Kat Joyce | Katriel Cohn-Gordon | Kiril Nikolov | Konrad Kraszewski | Laël Cellier | Linus Nordberg | Mark Schloesser | NORDUnet A/S | Nicholas Galbreath | Oliver Weidner | Pascal Leroy | Paul Hadfield | Paul Lietar | Pavel Kalinnikov | Pierre Phaneuf | PrimeKey Solutions AB | Rob Percival | Rob Stradling | Roger Ng | Roland Shoemaker | Ruslan Kovalov | Samuel Lidén Borell | Tatiana Merkulova | Venafi, Inc. | Vladimir Rutsky | Ximin Luo " +core,github.com/google/certificate-transparency-go/tls,Apache-2.0,"Adam Eijdenberg | Al Cutter | Alex Cohn | Ben Laurie | Chris Kennelly | Comodo CA Limited | David Drysdale | Deyan Bektchiev | Ed Maste | Emilia Kasper | Eran Messeri | Fiaz Hossain | Gary Belvin | Google LLC | Internet Security Research Group | Jeff Trawick | Joe Tsai | Kat Joyce | Katriel Cohn-Gordon | Kiril Nikolov | Konrad Kraszewski | Laël Cellier | Linus Nordberg | Mark Schloesser | NORDUnet A/S | Nicholas Galbreath | Oliver Weidner | Pascal Leroy | Paul Hadfield | Paul Lietar | Pavel Kalinnikov | Pierre Phaneuf | PrimeKey Solutions AB | Rob Percival | Rob Stradling | Roger Ng | Roland Shoemaker | Ruslan Kovalov | Samuel Lidén Borell | Tatiana Merkulova | Venafi, Inc. | Vladimir Rutsky | Ximin Luo " +core,github.com/google/certificate-transparency-go/x509,Apache-2.0,"Adam Eijdenberg | Al Cutter | Alex Cohn | Ben Laurie | Chris Kennelly | Comodo CA Limited | David Drysdale | Deyan Bektchiev | Ed Maste | Emilia Kasper | Eran Messeri | Fiaz Hossain | Gary Belvin | Google LLC | Internet Security Research Group | Jeff Trawick | Joe Tsai | Kat Joyce | Katriel Cohn-Gordon | Kiril Nikolov | Konrad Kraszewski | Laël Cellier | Linus Nordberg | Mark Schloesser | NORDUnet A/S | Nicholas Galbreath | Oliver Weidner | Pascal Leroy | Paul Hadfield | Paul Lietar | Pavel Kalinnikov | Pierre Phaneuf | PrimeKey Solutions AB | Rob Percival | Rob Stradling | Roger Ng | Roland Shoemaker | Ruslan Kovalov | Samuel Lidén Borell | Tatiana Merkulova | Venafi, Inc. | Vladimir Rutsky | Ximin Luo " +core,github.com/google/certificate-transparency-go/x509/pkix,Apache-2.0,"Adam Eijdenberg | Al Cutter | Alex Cohn | Ben Laurie | Chris Kennelly | Comodo CA Limited | David Drysdale | Deyan Bektchiev | Ed Maste | Emilia Kasper | Eran Messeri | Fiaz Hossain | Gary Belvin | Google LLC | Internet Security Research Group | Jeff Trawick | Joe Tsai | Kat Joyce | Katriel Cohn-Gordon | Kiril Nikolov | Konrad Kraszewski | Laël Cellier | Linus Nordberg | Mark Schloesser | NORDUnet A/S | Nicholas Galbreath | Oliver Weidner | Pascal Leroy | Paul Hadfield | Paul Lietar | Pavel Kalinnikov | Pierre Phaneuf | PrimeKey Solutions AB | Rob Percival | Rob Stradling | Roger Ng | Roland Shoemaker | Ruslan Kovalov | Samuel Lidén Borell | Tatiana Merkulova | Venafi, Inc. | Vladimir Rutsky | Ximin Luo " +core,github.com/google/certificate-transparency-go/x509util,Apache-2.0,"Adam Eijdenberg | Al Cutter | Alex Cohn | Ben Laurie | Chris Kennelly | Comodo CA Limited | David Drysdale | Deyan Bektchiev | Ed Maste | Emilia Kasper | Eran Messeri | Fiaz Hossain | Gary Belvin | Google LLC | Internet Security Research Group | Jeff Trawick | Joe Tsai | Kat Joyce | Katriel Cohn-Gordon | Kiril Nikolov | Konrad Kraszewski | Laël Cellier | Linus Nordberg | Mark Schloesser | NORDUnet A/S | Nicholas Galbreath | Oliver Weidner | Pascal Leroy | Paul Hadfield | Paul Lietar | Pavel Kalinnikov | Pierre Phaneuf | PrimeKey Solutions AB | Rob Percival | Rob Stradling | Roger Ng | Roland Shoemaker | Ruslan Kovalov | Samuel Lidén Borell | Tatiana Merkulova | Venafi, Inc. | Vladimir Rutsky | Ximin Luo " core,github.com/google/gnostic-models/compiler,Apache-2.0,"Copyright 2017-2022, Google LLC." core,github.com/google/gnostic-models/extensions,Apache-2.0,"Copyright 2017-2022, Google LLC" core,github.com/google/gnostic-models/jsonschema,Apache-2.0,"Copyright 2017-2022, Google LLC" @@ -1194,9 +1212,13 @@ core,github.com/google/go-containerregistry/internal/redact,Apache-2.0,Copyright core,github.com/google/go-containerregistry/internal/retry,Apache-2.0,Copyright 2018 Google LLC All Rights Reserved. | Copyright 2019 Google LLC All Rights Reserved. | Copyright 2020 Google LLC All Rights Reserved. | Copyright 2021 Google LLC All Rights Reserved. | Copyright 2022 Google LLC All Rights Reserved. core,github.com/google/go-containerregistry/internal/retry/wait,Apache-2.0,Copyright 2018 Google LLC All Rights Reserved. | Copyright 2019 Google LLC All Rights Reserved. | Copyright 2020 Google LLC All Rights Reserved. | Copyright 2021 Google LLC All Rights Reserved. | Copyright 2022 Google LLC All Rights Reserved. core,github.com/google/go-containerregistry/internal/verify,Apache-2.0,Copyright 2018 Google LLC All Rights Reserved. | Copyright 2019 Google LLC All Rights Reserved. | Copyright 2020 Google LLC All Rights Reserved. | Copyright 2021 Google LLC All Rights Reserved. | Copyright 2022 Google LLC All Rights Reserved. +core,github.com/google/go-containerregistry/internal/windows,Apache-2.0,Copyright 2018 Google LLC All Rights Reserved. | Copyright 2019 Google LLC All Rights Reserved. | Copyright 2020 Google LLC All Rights Reserved. | Copyright 2021 Google LLC All Rights Reserved. | Copyright 2022 Google LLC All Rights Reserved. core,github.com/google/go-containerregistry/internal/zstd,Apache-2.0,Copyright 2018 Google LLC All Rights Reserved. | Copyright 2019 Google LLC All Rights Reserved. | Copyright 2020 Google LLC All Rights Reserved. | Copyright 2021 Google LLC All Rights Reserved. | Copyright 2022 Google LLC All Rights Reserved. core,github.com/google/go-containerregistry/pkg/authn,Apache-2.0,Copyright 2018 Google LLC All Rights Reserved. | Copyright 2019 Google LLC All Rights Reserved. | Copyright 2020 Google LLC All Rights Reserved. | Copyright 2021 Google LLC All Rights Reserved. | Copyright 2022 Google LLC All Rights Reserved. core,github.com/google/go-containerregistry/pkg/compression,Apache-2.0,Copyright 2018 Google LLC All Rights Reserved. | Copyright 2019 Google LLC All Rights Reserved. | Copyright 2020 Google LLC All Rights Reserved. | Copyright 2021 Google LLC All Rights Reserved. | Copyright 2022 Google LLC All Rights Reserved. +core,github.com/google/go-containerregistry/pkg/crane,Apache-2.0,Copyright 2018 Google LLC All Rights Reserved. | Copyright 2019 Google LLC All Rights Reserved. | Copyright 2020 Google LLC All Rights Reserved. | Copyright 2021 Google LLC All Rights Reserved. | Copyright 2022 Google LLC All Rights Reserved. +core,github.com/google/go-containerregistry/pkg/legacy,Apache-2.0,Copyright 2018 Google LLC All Rights Reserved. | Copyright 2019 Google LLC All Rights Reserved. | Copyright 2020 Google LLC All Rights Reserved. | Copyright 2021 Google LLC All Rights Reserved. | Copyright 2022 Google LLC All Rights Reserved. +core,github.com/google/go-containerregistry/pkg/legacy/tarball,Apache-2.0,Copyright 2018 Google LLC All Rights Reserved. | Copyright 2019 Google LLC All Rights Reserved. | Copyright 2020 Google LLC All Rights Reserved. | Copyright 2021 Google LLC All Rights Reserved. | Copyright 2022 Google LLC All Rights Reserved. core,github.com/google/go-containerregistry/pkg/logs,Apache-2.0,Copyright 2018 Google LLC All Rights Reserved. | Copyright 2019 Google LLC All Rights Reserved. | Copyright 2020 Google LLC All Rights Reserved. | Copyright 2021 Google LLC All Rights Reserved. | Copyright 2022 Google LLC All Rights Reserved. core,github.com/google/go-containerregistry/pkg/name,Apache-2.0,Copyright 2018 Google LLC All Rights Reserved. | Copyright 2019 Google LLC All Rights Reserved. | Copyright 2020 Google LLC All Rights Reserved. | Copyright 2021 Google LLC All Rights Reserved. | Copyright 2022 Google LLC All Rights Reserved. core,github.com/google/go-containerregistry/pkg/registry,Apache-2.0,Copyright 2018 Google LLC All Rights Reserved. | Copyright 2019 Google LLC All Rights Reserved. | Copyright 2020 Google LLC All Rights Reserved. | Copyright 2021 Google LLC All Rights Reserved. | Copyright 2022 Google LLC All Rights Reserved. @@ -1209,9 +1231,11 @@ core,github.com/google/go-containerregistry/pkg/v1/mutate,Apache-2.0,Copyright 2 core,github.com/google/go-containerregistry/pkg/v1/partial,Apache-2.0,Copyright 2018 Google LLC All Rights Reserved. | Copyright 2019 Google LLC All Rights Reserved. | Copyright 2020 Google LLC All Rights Reserved. | Copyright 2021 Google LLC All Rights Reserved. | Copyright 2022 Google LLC All Rights Reserved. core,github.com/google/go-containerregistry/pkg/v1/remote,Apache-2.0,Copyright 2018 Google LLC All Rights Reserved. | Copyright 2019 Google LLC All Rights Reserved. | Copyright 2020 Google LLC All Rights Reserved. | Copyright 2021 Google LLC All Rights Reserved. | Copyright 2022 Google LLC All Rights Reserved. core,github.com/google/go-containerregistry/pkg/v1/remote/transport,Apache-2.0,Copyright 2018 Google LLC All Rights Reserved. | Copyright 2019 Google LLC All Rights Reserved. | Copyright 2020 Google LLC All Rights Reserved. | Copyright 2021 Google LLC All Rights Reserved. | Copyright 2022 Google LLC All Rights Reserved. +core,github.com/google/go-containerregistry/pkg/v1/static,Apache-2.0,Copyright 2018 Google LLC All Rights Reserved. | Copyright 2019 Google LLC All Rights Reserved. | Copyright 2020 Google LLC All Rights Reserved. | Copyright 2021 Google LLC All Rights Reserved. | Copyright 2022 Google LLC All Rights Reserved. core,github.com/google/go-containerregistry/pkg/v1/stream,Apache-2.0,Copyright 2018 Google LLC All Rights Reserved. | Copyright 2019 Google LLC All Rights Reserved. | Copyright 2020 Google LLC All Rights Reserved. | Copyright 2021 Google LLC All Rights Reserved. | Copyright 2022 Google LLC All Rights Reserved. core,github.com/google/go-containerregistry/pkg/v1/tarball,Apache-2.0,Copyright 2018 Google LLC All Rights Reserved. | Copyright 2019 Google LLC All Rights Reserved. | Copyright 2020 Google LLC All Rights Reserved. | Copyright 2021 Google LLC All Rights Reserved. | Copyright 2022 Google LLC All Rights Reserved. core,github.com/google/go-containerregistry/pkg/v1/types,Apache-2.0,Copyright 2018 Google LLC All Rights Reserved. | Copyright 2019 Google LLC All Rights Reserved. | Copyright 2020 Google LLC All Rights Reserved. | Copyright 2021 Google LLC All Rights Reserved. | Copyright 2022 Google LLC All Rights Reserved. +core,github.com/google/go-github/v62/github,BSD-3-Clause,"178inaba | 2BFL | 413x | 6543 <6543@obermui.de> | Abed Kibbe | Abhinav Gupta | Abhishek Veeramalla | Adam Kohring | Ahmad Nurus S | Ahmed Hagy | Aidan | Aidan Steele | Ainsley Chong | Akeda Bagus | Akhil Mohan | Alec Thomas | Aleks Clark | Alex Bramley | Alex Ellis | Alex Orr | Alex Su | Alex Unger | Alexander Harkness | Alexis Gauthiez | Ali Farooq | Allan Guwatudde | Allen Sun | Amey Sakhadeo | Anders Janmyr | Andreas Garnæs | Andrew Ryabchun | Andrew Svoboda | Andy Grunwald | Andy Hume | Andy Lindeman | Anshuman Bhartiya | Antoine | Antoine Pelisse | Anton Nguyen | Anubha Kushwaha | Aravind | Arda Kuyumcu | Arıl Bozoluk | Asier Marruedo | Austin Burdine | Austin Dizzy | Azuka Okuleye | Ben Batha | Benjamen Keroack | Berkay Tacyildiz | Beshr Kayali | Beyang Liu | Billy Keyes | Billy Lynch | Bingtan Lu | Bjorn Neergaard | Björn Häuser | Bo Huang | Bracken | Brad Harris | Brad Moylan | Bradley Falzon | Bradley McAllister | Brandon Butler | Brandon Cook | Brandon Stubbs | Brett Kuhlman | Brett Logan | Brian Egizi | Bryan Boreham | Bryan Peterson | CI Monk | Cami Diez | Carl Johnson | Carlos Alexandro Becker | Carlos Tadeu Panato Junior | ChandanChainani | Charles Fenwick Elliott | Charlie Yan | Chmouel Boudjnah | Chris King | Chris Mc | Chris Raborg | Chris Roche | Chris Schaefer | Christian Bargmann | Christian Muehlhaeuser | Christoph Jerolimov | Christoph Sassenberg | Colin Misare | Copyright (c) 2013 The go-github AUTHORS. All rights reserved | Craig Gumbley | Craig Peterson | Cristian Maglie | Cyb3r Jak3 | Daehyeok Mun | Dalton Hubble | Daniel Lanner | Daniel Leavitt | Daniel Nilsson | Daoq | Dave Du Cros | Dave Henderson | Dave Perrett | Dave Protasowski | David Deng | David Gamba | David J. M. Karlsen | David Jannotta | David Ji | David Lopez Reyes | Davide Zipeto | Dennis Webb | Derek Jobst | DeviousLab | Dhi Aurrahman | Diego Lapiduz | Diogo Vilela | Dmitri Shuralyov | Don Petersen | Doug Turner | Drew Fradette | Dustin Deus | Dustin Lish | Eivind | Eli Uriegas | Elliott Beach | Emerson Wood | Emil V | Eng Zer Jun | Erick Fejta | Erik Nobel | Evan Anderson | Evan Elias | Fabian Holler | Fabrice | Fatema-Moaiyadi | Federico Di Pierro | Felix Geisendörfer | Filippo Valsorda | Florian Forster | Florian Wagner | Francesc Gil | Francis | Francisco Guimarães | François de Metz | Fredrik Jönsson | Gabriel | Gal Ofri | Garrett Squire | George Kontridze | Georgy Buranov | Glen Mailer | Gnahz | Google Inc. | Grachev Mikhail | Guillaume Jacquet | Guz Alexander | Guðmundur Bjarni Ólafsson | Hanno Hecker | Hari haran | Harikesh00 | Hiroki Ito | Hubot Jr | Huy Tr | Iain Steers | Ikko Ashimine | Ilia Choly | Ioannis Georgoulas | Isao Jonas | JP Phillips | Jacob Valdemar | Jake Krammer | Jake White | Jameel Haffejee | James Bowes | James Cockbain | James Loh | James Maguire | James Turley | Jamie West | Jan Kosecki | Jan Švábík | Jason Field | Javier Campanini | Jef LeCompte | Jeff Wenzbauer | Jens Rantil | Jeremy Morris | Jesse Haka | Jesse Newland | Jihoon Chung | Jille Timmermans | Jimmi Dyson | Joan Saum | Joe Tsai | John Barton | John Engelman | John Jones | John Liu | Jordan Brockopp | Jordan Burandt | Jordan Sussman | Jorge Gómez Reus | Joshua Bezaleel Abednego | João Cerqueira | Juan | Juan Basso | Julien Garcia Gonzalez | Julien Rostand | Junya Kono | Justin Abrahms | Justin Toh | Jusung Lee | Karthik Sundari | Katrina Owen | Kautilya Tripathi | Keita Urashima | Kevin Burke | Kevin Wang | Kevin Zhao | Kirill | Konrad Malawski | Kookheon Kwon | Krishna Indani | Krzysztof Kowalczyk | Kshitij Saraogi | Kumar Saurabh | Kyle Kurz | Lars Lehtonen | Laurent Verdoïa | Liam Galvin | Lluis Campos | Lovro Mažgon | Loïs Postula | Luca Campese | Lucas Alcantara | Lucas Martin-King | Luis Davim | Luke Evers | Luke Hinds | Luke Kysow | Luke Roberts | Luke Young | Magnus Kulke | Maksim Zhylinski | Marc Binder | Marcelo Carlos | Mark Tareshawty | Martin Holman | Martin-Louis Bright | Martins Sipenko | Marwan Sulaiman | Masayuki Izumi | Mat Geist | Matija Horvat | Matin Rahmanian | Matt | Matt Brender | Matt Dainty | Matt Gaunt | Matt Landis | Matt Moore | Matt Simons | Matthew Reidy | Maxime Bury | Michael Meng | Michael Spiegel | Michael Tiller | Michał Glapa | Michelangelo Morrillo | Miguel Elias dos Santos | Mike Chen | Mohammed AlDujaili | Mukundan Senthil | Munia Balayil | Mustafa Abban | Nadav Kaner | Naoki Kanatani | Nathan VanBenschoten | Navaneeth Suresh | Neal Caffery | Neil O'Toole | Nick Miyake | Nick Platt | Nick Spragg | Nicolas Chapurlat | Nikhita Raghunath | Nilesh Singh | Noah Hanjun Lee | Noah Zoschke | Ole Orhagen | Oleg Kovalov | Ondřej Kupka | Ori Talmor | Osama Faqhruldin | Pablo Pérez Schröder | Palash Nigam | Panagiotis Moustafellos | Parham Alvani | Parker Moore | Pat Alwell | Patrick DeVivo | Patrick Marabeas | Patrik Nordlén | Pavel Dvoinos | Pavel Shtanko | Pete Wagner | Petr Shevtsov | Pierce McEntagart | Pierre Carrier | Piotr Zurek | Piyush Chugh | Pratik Mallya | Qais Patankar | Quang Le Hong | Quentin Leffray | Quinn Slack | Rackspace US, Inc. | Radek Simko | Radliński Ignacy | Rafael Aramizu Gomes | Rajat Jindal | Rajendra arora | Rajkumar | Ranbir Singh | Ravi Shekhar Jethani | RaviTeja Pothana | Red Hat, Inc. | Reetuparna Mukherjee | Reinier Timmer | Renjith R | Ricco Førgaard | Richard de Vries | Rob Figueiredo | Rohit Upadhyay | Rojan Dinc | Ronak Jain | Ronan Pelliard | Ross Gustafson | Ruben Vereecken | Russell Boley | Ryan Leung | Ryan Lower | Ryo Nakao | Saaarah | Safwan Olaimat | Sahil Dua | Sai Ravi Teja Chintakrindi | Sam Minnée | Sandeep Sukhani | Sander Knape | Sander van Harmelen | Sanket Payghan | Sarah Funkhouser | Sarasa Kisaragi | Sasha Melentyev | Sean Wang | Sebastian Mandrean | Sebastian Mæland Pedersen | Sergei Popinevskii | Sergey Romanov | Sergio Garcia | Seth Vargo | Sevki | Shagun Khemka | Shawn Catanzarite | Shawn Smith | Shibasis Patel | Sho Okada | Shrikrishna Singh | Simon Davis | SoundCloud, Ltd. | SriVignessh Pss | Sridhar Mocherla | Stefan Sedich | Steve Teuber | Stian Eikeland | Suhaib Mujahid | Szymon Kodrebski | Søren Hansen | T.J. Corrigan | Takashi Yoneuchi | Takayuki Watanabe | Taketoshi Fujiwara | Taketoshi Fujiwara | Takuma Kajikawa | Tasya Aditya Rukmana | Theo Henson | Theofilos Petsios | Thomas Aidan Curran | Thomas Bruyelle | Tim Rogers | Timothy O'Brien | Timothée Peignier | Tingluo Huang | Tobias Gesellchen | Tom Payne | Trey Tacon | Vaibhav Singh | Varadarajan Aravamudhan | Victor Castell | Victor Vrantchan | Victory Osikwemhe | Vivek | Vlad Ungureanu | Wasim Thabraze | Weslei Juan Moser Pereira | Wheeler Law | Will Maier | Will Norris | Willem D'Haeseleer | William Bailey | William Cooke | Xabi | Yann Malet | Yannick Utard | Yarden Shoham | Yicheng Qin | Yosuke Akatsuka | Yumikiyo Osanai | Yurii Soldak | Yusef Mohamadi | Yusuke Kuoka | Zach Latta | aboy | adrienzieba | afdesk | ajz01 | angie pinilla | anjanashenoy | appilon | aprp | apurwaj2 | boljen | chandresh-pancholi | chrisforrette | dmnlk | eperm | erwinvaneyk | griffin_stewie | guangwu | haya14busa | haya14busa | huydx | i2bskn | ishan upadhyay | isqua | jpbelanger-mtl | jzhoucliqr | k0ral | k1rnt | kadern0 | kgalli | kyokomi | leopoldwang | lynn [they] | mohammad ali <2018cs92@student.uet.edu.pk> | ns-cweber | nxya | oslowalk | pari-27 | parkhyukjun89 | rc1140 | reeves122 | saisi | shakeelrao | sona-tar | soniachikh | sushmita wable | tkhandel | tsbkw | ttacon | vikkyomkar | xibz | zhouhaibing089 | 六开箱 | 缘生 | 蒋航 " core,github.com/google/go-querystring/query,BSD-3-Clause,Copyright (c) 2013 Google. All rights reserved core,github.com/google/gofuzz,Apache-2.0,Copyright 2014 Google Inc. All rights reserved. core,github.com/google/gofuzz/bytesource,Apache-2.0,Copyright 2014 Google Inc. All rights reserved. @@ -1220,8 +1244,6 @@ core,github.com/google/gopacket/afpacket,BSD-3-Clause,"Copyright (c) 2009-2011 A core,github.com/google/gopacket/layers,BSD-3-Clause,"Copyright (c) 2009-2011 Andreas Krennmair. All rights reserved. | Copyright (c) 2012 Google, Inc. All rights reserved." core,github.com/google/gopacket/pcap,BSD-3-Clause,"Copyright (c) 2009-2011 Andreas Krennmair. All rights reserved. | Copyright (c) 2012 Google, Inc. All rights reserved." core,github.com/google/gopacket/pcapgo,BSD-3-Clause,"Copyright (c) 2009-2011 Andreas Krennmair. All rights reserved. | Copyright (c) 2012 Google, Inc. All rights reserved." -core,github.com/google/licenseclassifier/v2,Apache-2.0,Copyright 2017 Google LLC All Rights Reserved. | Copyright 2020 Google LLC All Rights Reserved. -core,github.com/google/licenseclassifier/v2/assets,Apache-2.0,Copyright 2017 Google LLC All Rights Reserved. | Copyright 2020 Google LLC All Rights Reserved. core,github.com/google/pprof/profile,Apache-2.0,Andrew Hunter | Google Inc. | Hyoun Kyu Cho | Martin Spier | Raul Silvera | Taco de Wolff | Tipp Moseley core,github.com/google/s2a-go,Apache-2.0,Copyright (c) 2020 Google core,github.com/google/s2a-go/fallback,Apache-2.0,Copyright (c) 2020 Google @@ -1387,6 +1409,7 @@ core,github.com/jaegertracing/jaeger/thrift-gen/jaeger,Apache-2.0,Copyright 2015 core,github.com/jaegertracing/jaeger/thrift-gen/sampling,Apache-2.0,Copyright 2015-2019 The Jaeger Project Authors core,github.com/jaegertracing/jaeger/thrift-gen/zipkincore,Apache-2.0,Copyright 2015-2019 The Jaeger Project Authors core,github.com/jbenet/go-context/io,MIT,Copyright (c) 2014 Juan Batiz-Benet +core,github.com/jedisct1/go-minisign,MIT,Copyright (c) 2018-2023 Frank Denis core,github.com/jellydator/ttlcache/v3,MIT,Copyright (c) 2022 Jellydator core,github.com/jinzhu/inflection,MIT,Copyright (c) 2015 - Jinzhu core,github.com/jlaffaye/ftp,ISC,"Copyright (c) 2011-2013, Julien Laffaye " @@ -1444,6 +1467,12 @@ core,github.com/leodido/go-syslog/v4/rfc3164,MIT,"Copyright (c) 2018, Leonardo D core,github.com/leodido/go-syslog/v4/rfc5424,MIT,"Copyright (c) 2018, Leonardo Di Donato" core,github.com/leodido/ragel-machinery,MIT,Copyright (c) 2018 Leonardo Di Donato core,github.com/leodido/ragel-machinery/parser,MIT,Copyright (c) 2018 Leonardo Di Donato +core,github.com/letsencrypt/boulder/core,MPL-2.0,"Copyright 2016 ISRG. All rights reserved | copyright doctrines of fair use, fair dealing, or other" +core,github.com/letsencrypt/boulder/goodkey,MPL-2.0,"Copyright 2016 ISRG. All rights reserved | copyright doctrines of fair use, fair dealing, or other" +core,github.com/letsencrypt/boulder/identifier,MPL-2.0,"Copyright 2016 ISRG. All rights reserved | copyright doctrines of fair use, fair dealing, or other" +core,github.com/letsencrypt/boulder/probs,MPL-2.0,"Copyright 2016 ISRG. All rights reserved | copyright doctrines of fair use, fair dealing, or other" +core,github.com/letsencrypt/boulder/revocation,MPL-2.0,"Copyright 2016 ISRG. All rights reserved | copyright doctrines of fair use, fair dealing, or other" +core,github.com/letsencrypt/boulder/strictyaml,MPL-2.0,"Copyright 2016 ISRG. All rights reserved | copyright doctrines of fair use, fair dealing, or other" core,github.com/liamg/jfather,MIT,Copyright (c) 2022 Liam Galvin core,github.com/libp2p/go-reuseport,ISC,Copyright (c) 2013 Conformal Systems LLC core,github.com/lightstep/go-expohisto/mapping,Apache-2.0,Copyright The OpenTelemetry Authors @@ -1471,6 +1500,7 @@ core,github.com/mailru/easyjson/jlexer,MIT,Copyright (c) 2016 Mail.Ru Group core,github.com/mailru/easyjson/jwriter,MIT,Copyright (c) 2016 Mail.Ru Group core,github.com/mailru/easyjson/parser,MIT,Copyright (c) 2016 Mail.Ru Group core,github.com/masahiro331/go-disk,MIT,Copyright (c) 2022 Masahiro331 +core,github.com/masahiro331/go-disk/fs,MIT,Copyright (c) 2022 Masahiro331 core,github.com/masahiro331/go-disk/gpt,MIT,Copyright (c) 2022 Masahiro331 core,github.com/masahiro331/go-disk/mbr,MIT,Copyright (c) 2022 Masahiro331 core,github.com/masahiro331/go-disk/types,MIT,Copyright (c) 2022 Masahiro331 @@ -1497,12 +1527,13 @@ core,github.com/mitchellh/hashstructure/v2,MIT,Copyright (c) 2016 Mitchell Hashi core,github.com/mitchellh/mapstructure,MIT,Copyright (c) 2013 Mitchell Hashimoto core,github.com/mitchellh/reflectwalk,MIT,Copyright (c) 2013 Mitchell Hashimoto core,github.com/mkrautz/goar,BSD-3-Clause,Copyright (c) 2011 Mikkel Krautz -core,github.com/moby/buildkit/frontend/dockerfile/command,Apache-2.0,"Aaron L. Xu | Aaron Lehmann | Aaron Lehmann | Abdur Rehman | Addam Hardy | Adrian Plata | Aidan Hobson Sayers | Akihiro Suda | Alan Fregtman <941331+darkvertex@users.noreply.github.com> | Alex Couture-Beil | Alex Mayer | Alex Suraci | Alexander Morozov | Alexis Murzeau | Alice Frosi | Allen Sun | Amen Belayneh | Anca Iordache | Anda Xu | Anders F Björklund | Andrea Bolognani | Andrea Luzzardi | Andrew Chang | Andrey Smirnov | Andy Alt | Andy Caldwell | Ankush Agarwal | Anthony Sottile | Anurag Goel | Anusha Ragunathan | Arnaud Bailly | Avi Deitcher | Bastiaan Bakker | Ben Longo | Bertrand Paquet | Bin Liu | Brandon Mitchell | Brian Goff | Ce Gao | Chaerim Yeo | Changwei Ge | Chanhun Jeong | ChaosGramer | Charles Chan | Charles Korn | Charles Law | Chenbin | Chris Goller | Chris McKinnel | Christian Höltje | Christian Weichel | Ciro S. Costa | Claudiu Belu | Colin Chartier | Corey Larson | Cory Bennett | Cory Snider | CrazyMax | Csaba Apagyi | Dan Duvall | Daniel Cassidy | Daniel Nephin | Darren Shepherd | Dave Chen | Dave Henderson | Dave Tucker | David Calavera | David Dooling | David Gageot | David Karlsson | Davis Schirmer | Dennis Chen | Derek McGowan | Dharmit Shah | Ding Fei | Doug Davis | Edgar Lee | Eli Uriegas | Elias Faxö | Eng Zer Jun | Eric Engestrom | Erik Sipsma | Fernando Miguel | Fiona Klute | Foysal Iqbal | Fred Cox | Frieder Bluemle | Gabriel | Gabriel Adrian Samfira | Gaetan de Villele | Gahl Saraf | George | Govind Rai | Grant Reaber | Guilhem C | Hans van den Bogert | Hao Hu | Hector S | Helen Xie | Himanshu Pandey | Hiromu Nakamura | HowJMay | Hugo Santos | Ian Campbell | Ilya Dmitrichenko | Iskander (Alex) Sharipov | Jacob Gillespie | Jacob MacElroy | Jean-Pierre Huynh | Jeffrey Huang | Jesse Rittner | Jessica Frazelle | Jitender Kumar | John Howard | John Maguire | John Mulhausen | John Tims | Jon Zeolla | Jonathan Azoff | Jonathan Giannuzzi | Jonathan Stoppani | Jonny Stoten | JordanGoasdoue | Julian Goede | Justas Brazauskas | Justin Chadwell | Justin Cormack | Justin Garrison | Jörg Franke <359489+NewJorg@users.noreply.github.com> | Kang, Matthew | Kees Cook | Kevin Burke | Kir Kolyshkin | Kohei Tokunaga | Koichi Shiraishi | Kris-Mikael Krister | Kunal Kushwaha | Kyle | Lajos Papp | Levi Harrison | Lu Jingxiao | Luca Visentin | Maciej Kalisz | Madhav Puri | Manu Gupta | Marcus Comstedt | Mark Gordon | Marko Kohtala | Mary Anthony | Matias Insaurralde | Matt Kang | Matt Rickard | Maxime Lagresle | Michael Crosby | Michael Friis | Michael Irwin | Miguel Ángel Jimeno | Mihai Borobocea | Mike Brown | Mikhail Vasin | Misty Stanley-Jones | Miyachi Katsuya | Morgan Bauer | Morlay | Nao YONASHIRO | Natasha Jarus | Nathan Sullivan | Nick Miyake | Nick Santos | Nikhil Pandeti | Noel Georgi <18496730+frezbo@users.noreply.github.com> | Oliver Bristow | Omer Duchovne <79370724+od-cyera@users.noreply.github.com> | Omer Mizrahi | Ondrej Fabry | Otto Kekäläinen | Pablo Chico de Guzman | Patrick Hemmer | Patrick Lang | Patrick Van Stee | Paul ""TBBle"" Hampson | Paweł Gronowski | Peter Dave Hello | Petr Fedchenkov | Phil Estes | Pierre Fenoll | Pranav Pandit | Pratik Raj | Prayag Verma | Qiang Huang | Remy Suen | Ri Xu | Rob Taylor | Robert Estelle | Rubens Figueiredo | Sam Whited | Sascha Schwarze | Sean P. Kane | Sebastiaan van Stijn | Seiya Miyata | Serhat Gülçiçek | Sertac Ozercan | Shev Yan | Shijiang Wei | Shingo Omura | Shiwei Zhang | Siebe Schaap | Silvin Lubecki <31478878+silvin-lubecki@users.noreply.github.com> | Simon Ferquel | Slava Semushin | Solomon Hykes | Stefan Scherer | Stefan Weil | StefanSchoof | Stepan Blyshchak | Steve Lohr | Sven Dowideit | Takuya Noguchi | Thomas Leonard | Thomas Riccardi | Thomas Shaw | Tianon Gravi | Tibor Vass | Tiffany Jernigan | Tim Waugh | Tim Wraight | Tino Rusch | Tobias Klauser | Tomas Tomecek | Tomasz Kopczynski | Tomohiro Kusumoto | Troels Liebe Bentsen | Tõnis Tiigi | Valentin Lorentz | Vasek - Tom C | Victor Vieux | Victoria Bialas | Vincent Demeester | Vlad A. Ionescu | Vladislav Ivanov | Wang Yumu <37442693@qq.com> | Wei Fu | Wei Zhang | Xiaofan Zhang | Ximo Guanter | Yamazaki Masashi | Yan Song | Yong Tang | Yuichiro Kaneko | Yurii Rashkovskii | Zach Badgett | Ziv Tsarfati | a-palchikov | coryb | dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> | dito | eyherabh | f0 | genglu.gl | ggjulio | jgeiger | jlecordier | joey | jroenf | kevinmeredith | l00397676 | lalyos | liwenqi | lixiaobing10051267 | lomot | masibw | mikelinjie <294893458@qq.com> | msg | pieterdd | squeegels <1674195+squeegels@users.noreply.github.com> | sunchunming | wingkwong | zhangwenlong | 岁丰 | 沈陵 | 郑泽宇 " -core,github.com/moby/buildkit/frontend/dockerfile/instructions,Apache-2.0,"Aaron L. Xu | Aaron Lehmann | Aaron Lehmann | Abdur Rehman | Addam Hardy | Adrian Plata | Aidan Hobson Sayers | Akihiro Suda | Alan Fregtman <941331+darkvertex@users.noreply.github.com> | Alex Couture-Beil | Alex Mayer | Alex Suraci | Alexander Morozov | Alexis Murzeau | Alice Frosi | Allen Sun | Amen Belayneh | Anca Iordache | Anda Xu | Anders F Björklund | Andrea Bolognani | Andrea Luzzardi | Andrew Chang | Andrey Smirnov | Andy Alt | Andy Caldwell | Ankush Agarwal | Anthony Sottile | Anurag Goel | Anusha Ragunathan | Arnaud Bailly | Avi Deitcher | Bastiaan Bakker | Ben Longo | Bertrand Paquet | Bin Liu | Brandon Mitchell | Brian Goff | Ce Gao | Chaerim Yeo | Changwei Ge | Chanhun Jeong | ChaosGramer | Charles Chan | Charles Korn | Charles Law | Chenbin | Chris Goller | Chris McKinnel | Christian Höltje | Christian Weichel | Ciro S. Costa | Claudiu Belu | Colin Chartier | Corey Larson | Cory Bennett | Cory Snider | CrazyMax | Csaba Apagyi | Dan Duvall | Daniel Cassidy | Daniel Nephin | Darren Shepherd | Dave Chen | Dave Henderson | Dave Tucker | David Calavera | David Dooling | David Gageot | David Karlsson | Davis Schirmer | Dennis Chen | Derek McGowan | Dharmit Shah | Ding Fei | Doug Davis | Edgar Lee | Eli Uriegas | Elias Faxö | Eng Zer Jun | Eric Engestrom | Erik Sipsma | Fernando Miguel | Fiona Klute | Foysal Iqbal | Fred Cox | Frieder Bluemle | Gabriel | Gabriel Adrian Samfira | Gaetan de Villele | Gahl Saraf | George | Govind Rai | Grant Reaber | Guilhem C | Hans van den Bogert | Hao Hu | Hector S | Helen Xie | Himanshu Pandey | Hiromu Nakamura | HowJMay | Hugo Santos | Ian Campbell | Ilya Dmitrichenko | Iskander (Alex) Sharipov | Jacob Gillespie | Jacob MacElroy | Jean-Pierre Huynh | Jeffrey Huang | Jesse Rittner | Jessica Frazelle | Jitender Kumar | John Howard | John Maguire | John Mulhausen | John Tims | Jon Zeolla | Jonathan Azoff | Jonathan Giannuzzi | Jonathan Stoppani | Jonny Stoten | JordanGoasdoue | Julian Goede | Justas Brazauskas | Justin Chadwell | Justin Cormack | Justin Garrison | Jörg Franke <359489+NewJorg@users.noreply.github.com> | Kang, Matthew | Kees Cook | Kevin Burke | Kir Kolyshkin | Kohei Tokunaga | Koichi Shiraishi | Kris-Mikael Krister | Kunal Kushwaha | Kyle | Lajos Papp | Levi Harrison | Lu Jingxiao | Luca Visentin | Maciej Kalisz | Madhav Puri | Manu Gupta | Marcus Comstedt | Mark Gordon | Marko Kohtala | Mary Anthony | Matias Insaurralde | Matt Kang | Matt Rickard | Maxime Lagresle | Michael Crosby | Michael Friis | Michael Irwin | Miguel Ángel Jimeno | Mihai Borobocea | Mike Brown | Mikhail Vasin | Misty Stanley-Jones | Miyachi Katsuya | Morgan Bauer | Morlay | Nao YONASHIRO | Natasha Jarus | Nathan Sullivan | Nick Miyake | Nick Santos | Nikhil Pandeti | Noel Georgi <18496730+frezbo@users.noreply.github.com> | Oliver Bristow | Omer Duchovne <79370724+od-cyera@users.noreply.github.com> | Omer Mizrahi | Ondrej Fabry | Otto Kekäläinen | Pablo Chico de Guzman | Patrick Hemmer | Patrick Lang | Patrick Van Stee | Paul ""TBBle"" Hampson | Paweł Gronowski | Peter Dave Hello | Petr Fedchenkov | Phil Estes | Pierre Fenoll | Pranav Pandit | Pratik Raj | Prayag Verma | Qiang Huang | Remy Suen | Ri Xu | Rob Taylor | Robert Estelle | Rubens Figueiredo | Sam Whited | Sascha Schwarze | Sean P. Kane | Sebastiaan van Stijn | Seiya Miyata | Serhat Gülçiçek | Sertac Ozercan | Shev Yan | Shijiang Wei | Shingo Omura | Shiwei Zhang | Siebe Schaap | Silvin Lubecki <31478878+silvin-lubecki@users.noreply.github.com> | Simon Ferquel | Slava Semushin | Solomon Hykes | Stefan Scherer | Stefan Weil | StefanSchoof | Stepan Blyshchak | Steve Lohr | Sven Dowideit | Takuya Noguchi | Thomas Leonard | Thomas Riccardi | Thomas Shaw | Tianon Gravi | Tibor Vass | Tiffany Jernigan | Tim Waugh | Tim Wraight | Tino Rusch | Tobias Klauser | Tomas Tomecek | Tomasz Kopczynski | Tomohiro Kusumoto | Troels Liebe Bentsen | Tõnis Tiigi | Valentin Lorentz | Vasek - Tom C | Victor Vieux | Victoria Bialas | Vincent Demeester | Vlad A. Ionescu | Vladislav Ivanov | Wang Yumu <37442693@qq.com> | Wei Fu | Wei Zhang | Xiaofan Zhang | Ximo Guanter | Yamazaki Masashi | Yan Song | Yong Tang | Yuichiro Kaneko | Yurii Rashkovskii | Zach Badgett | Ziv Tsarfati | a-palchikov | coryb | dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> | dito | eyherabh | f0 | genglu.gl | ggjulio | jgeiger | jlecordier | joey | jroenf | kevinmeredith | l00397676 | lalyos | liwenqi | lixiaobing10051267 | lomot | masibw | mikelinjie <294893458@qq.com> | msg | pieterdd | squeegels <1674195+squeegels@users.noreply.github.com> | sunchunming | wingkwong | zhangwenlong | 岁丰 | 沈陵 | 郑泽宇 " -core,github.com/moby/buildkit/frontend/dockerfile/parser,Apache-2.0,"Aaron L. Xu | Aaron Lehmann | Aaron Lehmann | Abdur Rehman | Addam Hardy | Adrian Plata | Aidan Hobson Sayers | Akihiro Suda | Alan Fregtman <941331+darkvertex@users.noreply.github.com> | Alex Couture-Beil | Alex Mayer | Alex Suraci | Alexander Morozov | Alexis Murzeau | Alice Frosi | Allen Sun | Amen Belayneh | Anca Iordache | Anda Xu | Anders F Björklund | Andrea Bolognani | Andrea Luzzardi | Andrew Chang | Andrey Smirnov | Andy Alt | Andy Caldwell | Ankush Agarwal | Anthony Sottile | Anurag Goel | Anusha Ragunathan | Arnaud Bailly | Avi Deitcher | Bastiaan Bakker | Ben Longo | Bertrand Paquet | Bin Liu | Brandon Mitchell | Brian Goff | Ce Gao | Chaerim Yeo | Changwei Ge | Chanhun Jeong | ChaosGramer | Charles Chan | Charles Korn | Charles Law | Chenbin | Chris Goller | Chris McKinnel | Christian Höltje | Christian Weichel | Ciro S. Costa | Claudiu Belu | Colin Chartier | Corey Larson | Cory Bennett | Cory Snider | CrazyMax | Csaba Apagyi | Dan Duvall | Daniel Cassidy | Daniel Nephin | Darren Shepherd | Dave Chen | Dave Henderson | Dave Tucker | David Calavera | David Dooling | David Gageot | David Karlsson | Davis Schirmer | Dennis Chen | Derek McGowan | Dharmit Shah | Ding Fei | Doug Davis | Edgar Lee | Eli Uriegas | Elias Faxö | Eng Zer Jun | Eric Engestrom | Erik Sipsma | Fernando Miguel | Fiona Klute | Foysal Iqbal | Fred Cox | Frieder Bluemle | Gabriel | Gabriel Adrian Samfira | Gaetan de Villele | Gahl Saraf | George | Govind Rai | Grant Reaber | Guilhem C | Hans van den Bogert | Hao Hu | Hector S | Helen Xie | Himanshu Pandey | Hiromu Nakamura | HowJMay | Hugo Santos | Ian Campbell | Ilya Dmitrichenko | Iskander (Alex) Sharipov | Jacob Gillespie | Jacob MacElroy | Jean-Pierre Huynh | Jeffrey Huang | Jesse Rittner | Jessica Frazelle | Jitender Kumar | John Howard | John Maguire | John Mulhausen | John Tims | Jon Zeolla | Jonathan Azoff | Jonathan Giannuzzi | Jonathan Stoppani | Jonny Stoten | JordanGoasdoue | Julian Goede | Justas Brazauskas | Justin Chadwell | Justin Cormack | Justin Garrison | Jörg Franke <359489+NewJorg@users.noreply.github.com> | Kang, Matthew | Kees Cook | Kevin Burke | Kir Kolyshkin | Kohei Tokunaga | Koichi Shiraishi | Kris-Mikael Krister | Kunal Kushwaha | Kyle | Lajos Papp | Levi Harrison | Lu Jingxiao | Luca Visentin | Maciej Kalisz | Madhav Puri | Manu Gupta | Marcus Comstedt | Mark Gordon | Marko Kohtala | Mary Anthony | Matias Insaurralde | Matt Kang | Matt Rickard | Maxime Lagresle | Michael Crosby | Michael Friis | Michael Irwin | Miguel Ángel Jimeno | Mihai Borobocea | Mike Brown | Mikhail Vasin | Misty Stanley-Jones | Miyachi Katsuya | Morgan Bauer | Morlay | Nao YONASHIRO | Natasha Jarus | Nathan Sullivan | Nick Miyake | Nick Santos | Nikhil Pandeti | Noel Georgi <18496730+frezbo@users.noreply.github.com> | Oliver Bristow | Omer Duchovne <79370724+od-cyera@users.noreply.github.com> | Omer Mizrahi | Ondrej Fabry | Otto Kekäläinen | Pablo Chico de Guzman | Patrick Hemmer | Patrick Lang | Patrick Van Stee | Paul ""TBBle"" Hampson | Paweł Gronowski | Peter Dave Hello | Petr Fedchenkov | Phil Estes | Pierre Fenoll | Pranav Pandit | Pratik Raj | Prayag Verma | Qiang Huang | Remy Suen | Ri Xu | Rob Taylor | Robert Estelle | Rubens Figueiredo | Sam Whited | Sascha Schwarze | Sean P. Kane | Sebastiaan van Stijn | Seiya Miyata | Serhat Gülçiçek | Sertac Ozercan | Shev Yan | Shijiang Wei | Shingo Omura | Shiwei Zhang | Siebe Schaap | Silvin Lubecki <31478878+silvin-lubecki@users.noreply.github.com> | Simon Ferquel | Slava Semushin | Solomon Hykes | Stefan Scherer | Stefan Weil | StefanSchoof | Stepan Blyshchak | Steve Lohr | Sven Dowideit | Takuya Noguchi | Thomas Leonard | Thomas Riccardi | Thomas Shaw | Tianon Gravi | Tibor Vass | Tiffany Jernigan | Tim Waugh | Tim Wraight | Tino Rusch | Tobias Klauser | Tomas Tomecek | Tomasz Kopczynski | Tomohiro Kusumoto | Troels Liebe Bentsen | Tõnis Tiigi | Valentin Lorentz | Vasek - Tom C | Victor Vieux | Victoria Bialas | Vincent Demeester | Vlad A. Ionescu | Vladislav Ivanov | Wang Yumu <37442693@qq.com> | Wei Fu | Wei Zhang | Xiaofan Zhang | Ximo Guanter | Yamazaki Masashi | Yan Song | Yong Tang | Yuichiro Kaneko | Yurii Rashkovskii | Zach Badgett | Ziv Tsarfati | a-palchikov | coryb | dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> | dito | eyherabh | f0 | genglu.gl | ggjulio | jgeiger | jlecordier | joey | jroenf | kevinmeredith | l00397676 | lalyos | liwenqi | lixiaobing10051267 | lomot | masibw | mikelinjie <294893458@qq.com> | msg | pieterdd | squeegels <1674195+squeegels@users.noreply.github.com> | sunchunming | wingkwong | zhangwenlong | 岁丰 | 沈陵 | 郑泽宇 " -core,github.com/moby/buildkit/frontend/dockerfile/shell,Apache-2.0,"Aaron L. Xu | Aaron Lehmann | Aaron Lehmann | Abdur Rehman | Addam Hardy | Adrian Plata | Aidan Hobson Sayers | Akihiro Suda | Alan Fregtman <941331+darkvertex@users.noreply.github.com> | Alex Couture-Beil | Alex Mayer | Alex Suraci | Alexander Morozov | Alexis Murzeau | Alice Frosi | Allen Sun | Amen Belayneh | Anca Iordache | Anda Xu | Anders F Björklund | Andrea Bolognani | Andrea Luzzardi | Andrew Chang | Andrey Smirnov | Andy Alt | Andy Caldwell | Ankush Agarwal | Anthony Sottile | Anurag Goel | Anusha Ragunathan | Arnaud Bailly | Avi Deitcher | Bastiaan Bakker | Ben Longo | Bertrand Paquet | Bin Liu | Brandon Mitchell | Brian Goff | Ce Gao | Chaerim Yeo | Changwei Ge | Chanhun Jeong | ChaosGramer | Charles Chan | Charles Korn | Charles Law | Chenbin | Chris Goller | Chris McKinnel | Christian Höltje | Christian Weichel | Ciro S. Costa | Claudiu Belu | Colin Chartier | Corey Larson | Cory Bennett | Cory Snider | CrazyMax | Csaba Apagyi | Dan Duvall | Daniel Cassidy | Daniel Nephin | Darren Shepherd | Dave Chen | Dave Henderson | Dave Tucker | David Calavera | David Dooling | David Gageot | David Karlsson | Davis Schirmer | Dennis Chen | Derek McGowan | Dharmit Shah | Ding Fei | Doug Davis | Edgar Lee | Eli Uriegas | Elias Faxö | Eng Zer Jun | Eric Engestrom | Erik Sipsma | Fernando Miguel | Fiona Klute | Foysal Iqbal | Fred Cox | Frieder Bluemle | Gabriel | Gabriel Adrian Samfira | Gaetan de Villele | Gahl Saraf | George | Govind Rai | Grant Reaber | Guilhem C | Hans van den Bogert | Hao Hu | Hector S | Helen Xie | Himanshu Pandey | Hiromu Nakamura | HowJMay | Hugo Santos | Ian Campbell | Ilya Dmitrichenko | Iskander (Alex) Sharipov | Jacob Gillespie | Jacob MacElroy | Jean-Pierre Huynh | Jeffrey Huang | Jesse Rittner | Jessica Frazelle | Jitender Kumar | John Howard | John Maguire | John Mulhausen | John Tims | Jon Zeolla | Jonathan Azoff | Jonathan Giannuzzi | Jonathan Stoppani | Jonny Stoten | JordanGoasdoue | Julian Goede | Justas Brazauskas | Justin Chadwell | Justin Cormack | Justin Garrison | Jörg Franke <359489+NewJorg@users.noreply.github.com> | Kang, Matthew | Kees Cook | Kevin Burke | Kir Kolyshkin | Kohei Tokunaga | Koichi Shiraishi | Kris-Mikael Krister | Kunal Kushwaha | Kyle | Lajos Papp | Levi Harrison | Lu Jingxiao | Luca Visentin | Maciej Kalisz | Madhav Puri | Manu Gupta | Marcus Comstedt | Mark Gordon | Marko Kohtala | Mary Anthony | Matias Insaurralde | Matt Kang | Matt Rickard | Maxime Lagresle | Michael Crosby | Michael Friis | Michael Irwin | Miguel Ángel Jimeno | Mihai Borobocea | Mike Brown | Mikhail Vasin | Misty Stanley-Jones | Miyachi Katsuya | Morgan Bauer | Morlay | Nao YONASHIRO | Natasha Jarus | Nathan Sullivan | Nick Miyake | Nick Santos | Nikhil Pandeti | Noel Georgi <18496730+frezbo@users.noreply.github.com> | Oliver Bristow | Omer Duchovne <79370724+od-cyera@users.noreply.github.com> | Omer Mizrahi | Ondrej Fabry | Otto Kekäläinen | Pablo Chico de Guzman | Patrick Hemmer | Patrick Lang | Patrick Van Stee | Paul ""TBBle"" Hampson | Paweł Gronowski | Peter Dave Hello | Petr Fedchenkov | Phil Estes | Pierre Fenoll | Pranav Pandit | Pratik Raj | Prayag Verma | Qiang Huang | Remy Suen | Ri Xu | Rob Taylor | Robert Estelle | Rubens Figueiredo | Sam Whited | Sascha Schwarze | Sean P. Kane | Sebastiaan van Stijn | Seiya Miyata | Serhat Gülçiçek | Sertac Ozercan | Shev Yan | Shijiang Wei | Shingo Omura | Shiwei Zhang | Siebe Schaap | Silvin Lubecki <31478878+silvin-lubecki@users.noreply.github.com> | Simon Ferquel | Slava Semushin | Solomon Hykes | Stefan Scherer | Stefan Weil | StefanSchoof | Stepan Blyshchak | Steve Lohr | Sven Dowideit | Takuya Noguchi | Thomas Leonard | Thomas Riccardi | Thomas Shaw | Tianon Gravi | Tibor Vass | Tiffany Jernigan | Tim Waugh | Tim Wraight | Tino Rusch | Tobias Klauser | Tomas Tomecek | Tomasz Kopczynski | Tomohiro Kusumoto | Troels Liebe Bentsen | Tõnis Tiigi | Valentin Lorentz | Vasek - Tom C | Victor Vieux | Victoria Bialas | Vincent Demeester | Vlad A. Ionescu | Vladislav Ivanov | Wang Yumu <37442693@qq.com> | Wei Fu | Wei Zhang | Xiaofan Zhang | Ximo Guanter | Yamazaki Masashi | Yan Song | Yong Tang | Yuichiro Kaneko | Yurii Rashkovskii | Zach Badgett | Ziv Tsarfati | a-palchikov | coryb | dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> | dito | eyherabh | f0 | genglu.gl | ggjulio | jgeiger | jlecordier | joey | jroenf | kevinmeredith | l00397676 | lalyos | liwenqi | lixiaobing10051267 | lomot | masibw | mikelinjie <294893458@qq.com> | msg | pieterdd | squeegels <1674195+squeegels@users.noreply.github.com> | sunchunming | wingkwong | zhangwenlong | 岁丰 | 沈陵 | 郑泽宇 " -core,github.com/moby/buildkit/util/stack,Apache-2.0,"Aaron L. Xu | Aaron Lehmann | Aaron Lehmann | Abdur Rehman | Addam Hardy | Adrian Plata | Aidan Hobson Sayers | Akihiro Suda | Alan Fregtman <941331+darkvertex@users.noreply.github.com> | Alex Couture-Beil | Alex Mayer | Alex Suraci | Alexander Morozov | Alexis Murzeau | Alice Frosi | Allen Sun | Amen Belayneh | Anca Iordache | Anda Xu | Anders F Björklund | Andrea Bolognani | Andrea Luzzardi | Andrew Chang | Andrey Smirnov | Andy Alt | Andy Caldwell | Ankush Agarwal | Anthony Sottile | Anurag Goel | Anusha Ragunathan | Arnaud Bailly | Avi Deitcher | Bastiaan Bakker | Ben Longo | Bertrand Paquet | Bin Liu | Brandon Mitchell | Brian Goff | Ce Gao | Chaerim Yeo | Changwei Ge | Chanhun Jeong | ChaosGramer | Charles Chan | Charles Korn | Charles Law | Chenbin | Chris Goller | Chris McKinnel | Christian Höltje | Christian Weichel | Ciro S. Costa | Claudiu Belu | Colin Chartier | Corey Larson | Cory Bennett | Cory Snider | CrazyMax | Csaba Apagyi | Dan Duvall | Daniel Cassidy | Daniel Nephin | Darren Shepherd | Dave Chen | Dave Henderson | Dave Tucker | David Calavera | David Dooling | David Gageot | David Karlsson | Davis Schirmer | Dennis Chen | Derek McGowan | Dharmit Shah | Ding Fei | Doug Davis | Edgar Lee | Eli Uriegas | Elias Faxö | Eng Zer Jun | Eric Engestrom | Erik Sipsma | Fernando Miguel | Fiona Klute | Foysal Iqbal | Fred Cox | Frieder Bluemle | Gabriel | Gabriel Adrian Samfira | Gaetan de Villele | Gahl Saraf | George | Govind Rai | Grant Reaber | Guilhem C | Hans van den Bogert | Hao Hu | Hector S | Helen Xie | Himanshu Pandey | Hiromu Nakamura | HowJMay | Hugo Santos | Ian Campbell | Ilya Dmitrichenko | Iskander (Alex) Sharipov | Jacob Gillespie | Jacob MacElroy | Jean-Pierre Huynh | Jeffrey Huang | Jesse Rittner | Jessica Frazelle | Jitender Kumar | John Howard | John Maguire | John Mulhausen | John Tims | Jon Zeolla | Jonathan Azoff | Jonathan Giannuzzi | Jonathan Stoppani | Jonny Stoten | JordanGoasdoue | Julian Goede | Justas Brazauskas | Justin Chadwell | Justin Cormack | Justin Garrison | Jörg Franke <359489+NewJorg@users.noreply.github.com> | Kang, Matthew | Kees Cook | Kevin Burke | Kir Kolyshkin | Kohei Tokunaga | Koichi Shiraishi | Kris-Mikael Krister | Kunal Kushwaha | Kyle | Lajos Papp | Levi Harrison | Lu Jingxiao | Luca Visentin | Maciej Kalisz | Madhav Puri | Manu Gupta | Marcus Comstedt | Mark Gordon | Marko Kohtala | Mary Anthony | Matias Insaurralde | Matt Kang | Matt Rickard | Maxime Lagresle | Michael Crosby | Michael Friis | Michael Irwin | Miguel Ángel Jimeno | Mihai Borobocea | Mike Brown | Mikhail Vasin | Misty Stanley-Jones | Miyachi Katsuya | Morgan Bauer | Morlay | Nao YONASHIRO | Natasha Jarus | Nathan Sullivan | Nick Miyake | Nick Santos | Nikhil Pandeti | Noel Georgi <18496730+frezbo@users.noreply.github.com> | Oliver Bristow | Omer Duchovne <79370724+od-cyera@users.noreply.github.com> | Omer Mizrahi | Ondrej Fabry | Otto Kekäläinen | Pablo Chico de Guzman | Patrick Hemmer | Patrick Lang | Patrick Van Stee | Paul ""TBBle"" Hampson | Paweł Gronowski | Peter Dave Hello | Petr Fedchenkov | Phil Estes | Pierre Fenoll | Pranav Pandit | Pratik Raj | Prayag Verma | Qiang Huang | Remy Suen | Ri Xu | Rob Taylor | Robert Estelle | Rubens Figueiredo | Sam Whited | Sascha Schwarze | Sean P. Kane | Sebastiaan van Stijn | Seiya Miyata | Serhat Gülçiçek | Sertac Ozercan | Shev Yan | Shijiang Wei | Shingo Omura | Shiwei Zhang | Siebe Schaap | Silvin Lubecki <31478878+silvin-lubecki@users.noreply.github.com> | Simon Ferquel | Slava Semushin | Solomon Hykes | Stefan Scherer | Stefan Weil | StefanSchoof | Stepan Blyshchak | Steve Lohr | Sven Dowideit | Takuya Noguchi | Thomas Leonard | Thomas Riccardi | Thomas Shaw | Tianon Gravi | Tibor Vass | Tiffany Jernigan | Tim Waugh | Tim Wraight | Tino Rusch | Tobias Klauser | Tomas Tomecek | Tomasz Kopczynski | Tomohiro Kusumoto | Troels Liebe Bentsen | Tõnis Tiigi | Valentin Lorentz | Vasek - Tom C | Victor Vieux | Victoria Bialas | Vincent Demeester | Vlad A. Ionescu | Vladislav Ivanov | Wang Yumu <37442693@qq.com> | Wei Fu | Wei Zhang | Xiaofan Zhang | Ximo Guanter | Yamazaki Masashi | Yan Song | Yong Tang | Yuichiro Kaneko | Yurii Rashkovskii | Zach Badgett | Ziv Tsarfati | a-palchikov | coryb | dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> | dito | eyherabh | f0 | genglu.gl | ggjulio | jgeiger | jlecordier | joey | jroenf | kevinmeredith | l00397676 | lalyos | liwenqi | lixiaobing10051267 | lomot | masibw | mikelinjie <294893458@qq.com> | msg | pieterdd | squeegels <1674195+squeegels@users.noreply.github.com> | sunchunming | wingkwong | zhangwenlong | 岁丰 | 沈陵 | 郑泽宇 " -core,github.com/moby/buildkit/util/suggest,Apache-2.0,"Aaron L. Xu | Aaron Lehmann | Aaron Lehmann | Abdur Rehman | Addam Hardy | Adrian Plata | Aidan Hobson Sayers | Akihiro Suda | Alan Fregtman <941331+darkvertex@users.noreply.github.com> | Alex Couture-Beil | Alex Mayer | Alex Suraci | Alexander Morozov | Alexis Murzeau | Alice Frosi | Allen Sun | Amen Belayneh | Anca Iordache | Anda Xu | Anders F Björklund | Andrea Bolognani | Andrea Luzzardi | Andrew Chang | Andrey Smirnov | Andy Alt | Andy Caldwell | Ankush Agarwal | Anthony Sottile | Anurag Goel | Anusha Ragunathan | Arnaud Bailly | Avi Deitcher | Bastiaan Bakker | Ben Longo | Bertrand Paquet | Bin Liu | Brandon Mitchell | Brian Goff | Ce Gao | Chaerim Yeo | Changwei Ge | Chanhun Jeong | ChaosGramer | Charles Chan | Charles Korn | Charles Law | Chenbin | Chris Goller | Chris McKinnel | Christian Höltje | Christian Weichel | Ciro S. Costa | Claudiu Belu | Colin Chartier | Corey Larson | Cory Bennett | Cory Snider | CrazyMax | Csaba Apagyi | Dan Duvall | Daniel Cassidy | Daniel Nephin | Darren Shepherd | Dave Chen | Dave Henderson | Dave Tucker | David Calavera | David Dooling | David Gageot | David Karlsson | Davis Schirmer | Dennis Chen | Derek McGowan | Dharmit Shah | Ding Fei | Doug Davis | Edgar Lee | Eli Uriegas | Elias Faxö | Eng Zer Jun | Eric Engestrom | Erik Sipsma | Fernando Miguel | Fiona Klute | Foysal Iqbal | Fred Cox | Frieder Bluemle | Gabriel | Gabriel Adrian Samfira | Gaetan de Villele | Gahl Saraf | George | Govind Rai | Grant Reaber | Guilhem C | Hans van den Bogert | Hao Hu | Hector S | Helen Xie | Himanshu Pandey | Hiromu Nakamura | HowJMay | Hugo Santos | Ian Campbell | Ilya Dmitrichenko | Iskander (Alex) Sharipov | Jacob Gillespie | Jacob MacElroy | Jean-Pierre Huynh | Jeffrey Huang | Jesse Rittner | Jessica Frazelle | Jitender Kumar | John Howard | John Maguire | John Mulhausen | John Tims | Jon Zeolla | Jonathan Azoff | Jonathan Giannuzzi | Jonathan Stoppani | Jonny Stoten | JordanGoasdoue | Julian Goede | Justas Brazauskas | Justin Chadwell | Justin Cormack | Justin Garrison | Jörg Franke <359489+NewJorg@users.noreply.github.com> | Kang, Matthew | Kees Cook | Kevin Burke | Kir Kolyshkin | Kohei Tokunaga | Koichi Shiraishi | Kris-Mikael Krister | Kunal Kushwaha | Kyle | Lajos Papp | Levi Harrison | Lu Jingxiao | Luca Visentin | Maciej Kalisz | Madhav Puri | Manu Gupta | Marcus Comstedt | Mark Gordon | Marko Kohtala | Mary Anthony | Matias Insaurralde | Matt Kang | Matt Rickard | Maxime Lagresle | Michael Crosby | Michael Friis | Michael Irwin | Miguel Ángel Jimeno | Mihai Borobocea | Mike Brown | Mikhail Vasin | Misty Stanley-Jones | Miyachi Katsuya | Morgan Bauer | Morlay | Nao YONASHIRO | Natasha Jarus | Nathan Sullivan | Nick Miyake | Nick Santos | Nikhil Pandeti | Noel Georgi <18496730+frezbo@users.noreply.github.com> | Oliver Bristow | Omer Duchovne <79370724+od-cyera@users.noreply.github.com> | Omer Mizrahi | Ondrej Fabry | Otto Kekäläinen | Pablo Chico de Guzman | Patrick Hemmer | Patrick Lang | Patrick Van Stee | Paul ""TBBle"" Hampson | Paweł Gronowski | Peter Dave Hello | Petr Fedchenkov | Phil Estes | Pierre Fenoll | Pranav Pandit | Pratik Raj | Prayag Verma | Qiang Huang | Remy Suen | Ri Xu | Rob Taylor | Robert Estelle | Rubens Figueiredo | Sam Whited | Sascha Schwarze | Sean P. Kane | Sebastiaan van Stijn | Seiya Miyata | Serhat Gülçiçek | Sertac Ozercan | Shev Yan | Shijiang Wei | Shingo Omura | Shiwei Zhang | Siebe Schaap | Silvin Lubecki <31478878+silvin-lubecki@users.noreply.github.com> | Simon Ferquel | Slava Semushin | Solomon Hykes | Stefan Scherer | Stefan Weil | StefanSchoof | Stepan Blyshchak | Steve Lohr | Sven Dowideit | Takuya Noguchi | Thomas Leonard | Thomas Riccardi | Thomas Shaw | Tianon Gravi | Tibor Vass | Tiffany Jernigan | Tim Waugh | Tim Wraight | Tino Rusch | Tobias Klauser | Tomas Tomecek | Tomasz Kopczynski | Tomohiro Kusumoto | Troels Liebe Bentsen | Tõnis Tiigi | Valentin Lorentz | Vasek - Tom C | Victor Vieux | Victoria Bialas | Vincent Demeester | Vlad A. Ionescu | Vladislav Ivanov | Wang Yumu <37442693@qq.com> | Wei Fu | Wei Zhang | Xiaofan Zhang | Ximo Guanter | Yamazaki Masashi | Yan Song | Yong Tang | Yuichiro Kaneko | Yurii Rashkovskii | Zach Badgett | Ziv Tsarfati | a-palchikov | coryb | dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> | dito | eyherabh | f0 | genglu.gl | ggjulio | jgeiger | jlecordier | joey | jroenf | kevinmeredith | l00397676 | lalyos | liwenqi | lixiaobing10051267 | lomot | masibw | mikelinjie <294893458@qq.com> | msg | pieterdd | squeegels <1674195+squeegels@users.noreply.github.com> | sunchunming | wingkwong | zhangwenlong | 岁丰 | 沈陵 | 郑泽宇 " +core,github.com/moby/buildkit/frontend/dockerfile/command,Apache-2.0,"Aaron L. Xu | Aaron Lehmann | Aaron Lehmann | Abdur Rehman | Addam Hardy | Adrian Plata | Adrien Delorme | Ahmon Dancy | Aidan Hobson Sayers | Akihiro Suda | Alan Fregtman <941331+darkvertex@users.noreply.github.com> | Alano Terblanche <18033717+Benehiko@users.noreply.github.com> | Aleksa Sarai | Alex Couture-Beil | Alex Mayer | Alex Suraci | Alexander Morozov | Alexis Murzeau | Alice Frosi | Allen Sun | Amen Belayneh | Anca Iordache | Anda Xu | Anders F Björklund | Andrea Bolognani | Andrea Luzzardi | Andrew Chang | Andrey Smirnov | Andy Alt | Andy Caldwell | Ankush Agarwal | Anthony Nandaa | Anthony Sottile | Anurag Goel | Anusha Ragunathan | Arkadiusz Drabczyk | Arnaldo Garcia Rincon | Arnaud Bailly | Artem Khramov | Austin Vazquez | Avi Deitcher | Bastiaan Bakker | Ben Longo | Bertrand Paquet | Billy Owire | Bin Liu | Bjorn Neergaard | Brandon Mitchell | Brennan Kinney <5098581+polarathene@users.noreply.github.com> | Brian Goff | Bunyamin Dokmetas <19335284+ztzxt@users.noreply.github.com> | Burt Holzman | Ce Gao | Chaerim Yeo | Changwei Ge | Chanhun Jeong | ChaosGramer | Charles Chan | Charles Korn | Charles Law | Chenbin | Chris Goller | Chris McKinnel | Christian Höltje | Christian Weichel | Ciro S. Costa | Claudiu Belu | Colin Chartier | Corey Larson | Cory Bennett | Cory Snider | Craig Andrews | CrazyMax | Csaba Apagyi | Dan Duvall | Daniel Cassidy | Daniel Nephin | Darren Shepherd | Dave Chen | Dave Henderson | Dave Tucker | David Calavera | David Dooling | David Gageot | David Karlsson | Davis Schirmer | Debosmit Ray | Dennis Chen | Dennis Haney | Derek McGowan | Dharmit Shah | Ding Fei | Doug Davis | Edgar Lee | Eli Uriegas | Elias Faxö | Eng Zer Jun | Eric Engestrom | Erik McKelvey | Erik Sipsma | Felix Fontein | Fernando Miguel | Fiona Klute | Foysal Iqbal | Frank Villaro-Dixon | Fred Cox | Frieder Bluemle | Félix Mattrat | Gabriel-Adrian Samfira | Gaetan de Villele | Gahl Saraf | George | Govind Rai | Grant Reaber | Grégoire Payen de La Garanderie | Guilhem Charles | Hans van den Bogert | Hao Hu | Hector S | Helen Xie | Himanshu Pandey | Hiromu Nakamura | HowJMay | Hugo Santos | Höhl, Lukas | Ian Campbell | Ian King'ori | Ignas Mikalajūnas | Ilya Dmitrichenko | Iskander (Alex) Sharipov | Jacob Gillespie | Jacob MacElroy | Jakub Ciolek | James Carnegie | Jean-Pierre Huynh | Jeffrey Huang | Jesper Noordsij | Jesse Rittner | Jessica Frazelle | Jitender Kumar | John Howard | John Maguire | John Mulhausen | John Tims | Jon Zeolla | Jonathan A. Sternberg | Jonathan Azoff | Jonathan Giannuzzi | Jonathan Stoppani | Jonny Stoten | JordanGoasdoue | Julian Goede | Justas Brazauskas | Justin Chadwell | Justin Cormack | Justin Garrison | Jörg Franke <359489+NewJorg@users.noreply.github.com> | Kai Takac | Kang, Matthew | Kazuyoshi Kato | Kees Cook | Kevin Burke | Kir Kolyshkin | Kirill A. Korinsky | Kohei Tokunaga | Koichi Shiraishi | Kris-Mikael Krister | Kunal Kushwaha | Kyle | Lajos Papp | Leandro Santiago | Levi Harrison | Lu Jingxiao | Luca Visentin | Maciej Kalisz | Madhav Puri | Manu Gupta | Marat Radchenko | Marcus Comstedt | Mark Gordon | Mark Yen | Marko Kohtala | Mary Anthony | Matias Insaurralde | Matt Kang | Matt Rickard | Maxime Lagresle | Michael Crosby | Michael Friis | Michael Irwin | Miguel Ángel Jimeno | Mihai Borobocea | Mike Brown | Mikhail Vasin | Milas Bowman | Misty Stanley-Jones | Mitsuru Kariya | Miyachi Katsuya | Morgan Bauer | Moritz ""WanzenBug"" Wanzenböck | Morlay | Nao YONASHIRO | Natasha Jarus | Nathan Sullivan | Nguyễn Đức Chiến | Nick Miyake | Nick Santos | Nikhil Pandeti | Nobi | Noel Georgi <18496730+frezbo@users.noreply.github.com> | Oliver Bristow | Omer Duchovne <79370724+od-cyera@users.noreply.github.com> | Omer Mizrahi | Ondrej Fabry | Otto Kekäläinen | Pablo Chico de Guzman | Patrick Hemmer | Patrick Lang | Patrick Van Stee | Paul ""TBBle"" Hampson | Paweł Gronowski | Peter Dave Hello | Petr Fedchenkov | Petteri Räty | Phil Estes | Pierre Fenoll | Pranav Pandit | Pratik Raj | Prayag Verma | Qiang Huang | Remy Suen | Reshen | Ri Xu | Rob Taylor | Robert Estelle | Rubens Figueiredo | Salim B | Sam Whited | Sascha Hemleb | Sascha Schwarze | Sean P. Kane | Sebastiaan van Stijn | Seiya Miyata | Serhat Gülçiçek | Sertac Ozercan | Shaun Thompson | Shev Yan | Shijiang Wei | Shingo Omura | Shiwei Zhang | Siebe Schaap | Silvin Lubecki <31478878+silvin-lubecki@users.noreply.github.com> | Simon Ferquel | Slava Semushin | Solomon Hykes | Stefan Scherer | Stefan Weil | StefanSchoof | Stepan Blyshchak | Stephen Day | Steve Lohr | Sven Dowideit | Swagat Bora | Takuya Noguchi | Talon Bowler | Thomas Leonard | Thomas Riccardi | Thomas Shaw | Tianon Gravi | Tibor Vass | Tiffany Jernigan | Tim Waugh | Tim Wraight | Tino Rusch | Tobias Klauser | Tomas Tomecek | Tomasz Kopczynski | Tomohiro Kusumoto | Tristan Stenner | Troels Liebe Bentsen | Tõnis Tiigi | Valentin Lorentz | Vasek - Tom C | Victor Vieux | Victoria Bialas | Vincent Demeester | Vlad A. Ionescu | Vladislav Ivanov | Wang Yumu <37442693@qq.com> | Wei Fu | Wei Zhang | Xiaofan Zhang | Ximo Guanter | Yamazaki Masashi | Yan Song | Yong Tang | Yuichiro Kaneko | Yurii Rashkovskii | Zach Badgett | Zhizhen He | Ziv Tsarfati | a-palchikov | adamperlin | coryb | cuiyourong | dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> | dito | eyherabh | f0 | fanjiyun.fjy | frankyang | genglu.gl | ggjulio | guangwu | guoguangwu | jgeiger | jlecordier | joey | jroenf | kevinmeredith | l00397676 | lalyos | liulanzheng | liwenqi | lixiaobing10051267 | lomot | masibw | mikelinjie <294893458@qq.com> | msg | njucjc | omahs <73983677+omahs@users.noreply.github.com> | pieterdd | racequite | retornam | squeegels <1674195+squeegels@users.noreply.github.com> | sunchunming | wingkwong | x893675 | yumemio <59369226+yumemio@users.noreply.github.com> | yzewei | zhangwenlong | 岁丰 | 沈陵 | 蝦米 | 郑泽宇 " +core,github.com/moby/buildkit/frontend/dockerfile/instructions,Apache-2.0,"Aaron L. Xu | Aaron Lehmann | Aaron Lehmann | Abdur Rehman | Addam Hardy | Adrian Plata | Adrien Delorme | Ahmon Dancy | Aidan Hobson Sayers | Akihiro Suda | Alan Fregtman <941331+darkvertex@users.noreply.github.com> | Alano Terblanche <18033717+Benehiko@users.noreply.github.com> | Aleksa Sarai | Alex Couture-Beil | Alex Mayer | Alex Suraci | Alexander Morozov | Alexis Murzeau | Alice Frosi | Allen Sun | Amen Belayneh | Anca Iordache | Anda Xu | Anders F Björklund | Andrea Bolognani | Andrea Luzzardi | Andrew Chang | Andrey Smirnov | Andy Alt | Andy Caldwell | Ankush Agarwal | Anthony Nandaa | Anthony Sottile | Anurag Goel | Anusha Ragunathan | Arkadiusz Drabczyk | Arnaldo Garcia Rincon | Arnaud Bailly | Artem Khramov | Austin Vazquez | Avi Deitcher | Bastiaan Bakker | Ben Longo | Bertrand Paquet | Billy Owire | Bin Liu | Bjorn Neergaard | Brandon Mitchell | Brennan Kinney <5098581+polarathene@users.noreply.github.com> | Brian Goff | Bunyamin Dokmetas <19335284+ztzxt@users.noreply.github.com> | Burt Holzman | Ce Gao | Chaerim Yeo | Changwei Ge | Chanhun Jeong | ChaosGramer | Charles Chan | Charles Korn | Charles Law | Chenbin | Chris Goller | Chris McKinnel | Christian Höltje | Christian Weichel | Ciro S. Costa | Claudiu Belu | Colin Chartier | Corey Larson | Cory Bennett | Cory Snider | Craig Andrews | CrazyMax | Csaba Apagyi | Dan Duvall | Daniel Cassidy | Daniel Nephin | Darren Shepherd | Dave Chen | Dave Henderson | Dave Tucker | David Calavera | David Dooling | David Gageot | David Karlsson | Davis Schirmer | Debosmit Ray | Dennis Chen | Dennis Haney | Derek McGowan | Dharmit Shah | Ding Fei | Doug Davis | Edgar Lee | Eli Uriegas | Elias Faxö | Eng Zer Jun | Eric Engestrom | Erik McKelvey | Erik Sipsma | Felix Fontein | Fernando Miguel | Fiona Klute | Foysal Iqbal | Frank Villaro-Dixon | Fred Cox | Frieder Bluemle | Félix Mattrat | Gabriel-Adrian Samfira | Gaetan de Villele | Gahl Saraf | George | Govind Rai | Grant Reaber | Grégoire Payen de La Garanderie | Guilhem Charles | Hans van den Bogert | Hao Hu | Hector S | Helen Xie | Himanshu Pandey | Hiromu Nakamura | HowJMay | Hugo Santos | Höhl, Lukas | Ian Campbell | Ian King'ori | Ignas Mikalajūnas | Ilya Dmitrichenko | Iskander (Alex) Sharipov | Jacob Gillespie | Jacob MacElroy | Jakub Ciolek | James Carnegie | Jean-Pierre Huynh | Jeffrey Huang | Jesper Noordsij | Jesse Rittner | Jessica Frazelle | Jitender Kumar | John Howard | John Maguire | John Mulhausen | John Tims | Jon Zeolla | Jonathan A. Sternberg | Jonathan Azoff | Jonathan Giannuzzi | Jonathan Stoppani | Jonny Stoten | JordanGoasdoue | Julian Goede | Justas Brazauskas | Justin Chadwell | Justin Cormack | Justin Garrison | Jörg Franke <359489+NewJorg@users.noreply.github.com> | Kai Takac | Kang, Matthew | Kazuyoshi Kato | Kees Cook | Kevin Burke | Kir Kolyshkin | Kirill A. Korinsky | Kohei Tokunaga | Koichi Shiraishi | Kris-Mikael Krister | Kunal Kushwaha | Kyle | Lajos Papp | Leandro Santiago | Levi Harrison | Lu Jingxiao | Luca Visentin | Maciej Kalisz | Madhav Puri | Manu Gupta | Marat Radchenko | Marcus Comstedt | Mark Gordon | Mark Yen | Marko Kohtala | Mary Anthony | Matias Insaurralde | Matt Kang | Matt Rickard | Maxime Lagresle | Michael Crosby | Michael Friis | Michael Irwin | Miguel Ángel Jimeno | Mihai Borobocea | Mike Brown | Mikhail Vasin | Milas Bowman | Misty Stanley-Jones | Mitsuru Kariya | Miyachi Katsuya | Morgan Bauer | Moritz ""WanzenBug"" Wanzenböck | Morlay | Nao YONASHIRO | Natasha Jarus | Nathan Sullivan | Nguyễn Đức Chiến | Nick Miyake | Nick Santos | Nikhil Pandeti | Nobi | Noel Georgi <18496730+frezbo@users.noreply.github.com> | Oliver Bristow | Omer Duchovne <79370724+od-cyera@users.noreply.github.com> | Omer Mizrahi | Ondrej Fabry | Otto Kekäläinen | Pablo Chico de Guzman | Patrick Hemmer | Patrick Lang | Patrick Van Stee | Paul ""TBBle"" Hampson | Paweł Gronowski | Peter Dave Hello | Petr Fedchenkov | Petteri Räty | Phil Estes | Pierre Fenoll | Pranav Pandit | Pratik Raj | Prayag Verma | Qiang Huang | Remy Suen | Reshen | Ri Xu | Rob Taylor | Robert Estelle | Rubens Figueiredo | Salim B | Sam Whited | Sascha Hemleb | Sascha Schwarze | Sean P. Kane | Sebastiaan van Stijn | Seiya Miyata | Serhat Gülçiçek | Sertac Ozercan | Shaun Thompson | Shev Yan | Shijiang Wei | Shingo Omura | Shiwei Zhang | Siebe Schaap | Silvin Lubecki <31478878+silvin-lubecki@users.noreply.github.com> | Simon Ferquel | Slava Semushin | Solomon Hykes | Stefan Scherer | Stefan Weil | StefanSchoof | Stepan Blyshchak | Stephen Day | Steve Lohr | Sven Dowideit | Swagat Bora | Takuya Noguchi | Talon Bowler | Thomas Leonard | Thomas Riccardi | Thomas Shaw | Tianon Gravi | Tibor Vass | Tiffany Jernigan | Tim Waugh | Tim Wraight | Tino Rusch | Tobias Klauser | Tomas Tomecek | Tomasz Kopczynski | Tomohiro Kusumoto | Tristan Stenner | Troels Liebe Bentsen | Tõnis Tiigi | Valentin Lorentz | Vasek - Tom C | Victor Vieux | Victoria Bialas | Vincent Demeester | Vlad A. Ionescu | Vladislav Ivanov | Wang Yumu <37442693@qq.com> | Wei Fu | Wei Zhang | Xiaofan Zhang | Ximo Guanter | Yamazaki Masashi | Yan Song | Yong Tang | Yuichiro Kaneko | Yurii Rashkovskii | Zach Badgett | Zhizhen He | Ziv Tsarfati | a-palchikov | adamperlin | coryb | cuiyourong | dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> | dito | eyherabh | f0 | fanjiyun.fjy | frankyang | genglu.gl | ggjulio | guangwu | guoguangwu | jgeiger | jlecordier | joey | jroenf | kevinmeredith | l00397676 | lalyos | liulanzheng | liwenqi | lixiaobing10051267 | lomot | masibw | mikelinjie <294893458@qq.com> | msg | njucjc | omahs <73983677+omahs@users.noreply.github.com> | pieterdd | racequite | retornam | squeegels <1674195+squeegels@users.noreply.github.com> | sunchunming | wingkwong | x893675 | yumemio <59369226+yumemio@users.noreply.github.com> | yzewei | zhangwenlong | 岁丰 | 沈陵 | 蝦米 | 郑泽宇 " +core,github.com/moby/buildkit/frontend/dockerfile/linter,Apache-2.0,"Aaron L. Xu | Aaron Lehmann | Aaron Lehmann | Abdur Rehman | Addam Hardy | Adrian Plata | Adrien Delorme | Ahmon Dancy | Aidan Hobson Sayers | Akihiro Suda | Alan Fregtman <941331+darkvertex@users.noreply.github.com> | Alano Terblanche <18033717+Benehiko@users.noreply.github.com> | Aleksa Sarai | Alex Couture-Beil | Alex Mayer | Alex Suraci | Alexander Morozov | Alexis Murzeau | Alice Frosi | Allen Sun | Amen Belayneh | Anca Iordache | Anda Xu | Anders F Björklund | Andrea Bolognani | Andrea Luzzardi | Andrew Chang | Andrey Smirnov | Andy Alt | Andy Caldwell | Ankush Agarwal | Anthony Nandaa | Anthony Sottile | Anurag Goel | Anusha Ragunathan | Arkadiusz Drabczyk | Arnaldo Garcia Rincon | Arnaud Bailly | Artem Khramov | Austin Vazquez | Avi Deitcher | Bastiaan Bakker | Ben Longo | Bertrand Paquet | Billy Owire | Bin Liu | Bjorn Neergaard | Brandon Mitchell | Brennan Kinney <5098581+polarathene@users.noreply.github.com> | Brian Goff | Bunyamin Dokmetas <19335284+ztzxt@users.noreply.github.com> | Burt Holzman | Ce Gao | Chaerim Yeo | Changwei Ge | Chanhun Jeong | ChaosGramer | Charles Chan | Charles Korn | Charles Law | Chenbin | Chris Goller | Chris McKinnel | Christian Höltje | Christian Weichel | Ciro S. Costa | Claudiu Belu | Colin Chartier | Corey Larson | Cory Bennett | Cory Snider | Craig Andrews | CrazyMax | Csaba Apagyi | Dan Duvall | Daniel Cassidy | Daniel Nephin | Darren Shepherd | Dave Chen | Dave Henderson | Dave Tucker | David Calavera | David Dooling | David Gageot | David Karlsson | Davis Schirmer | Debosmit Ray | Dennis Chen | Dennis Haney | Derek McGowan | Dharmit Shah | Ding Fei | Doug Davis | Edgar Lee | Eli Uriegas | Elias Faxö | Eng Zer Jun | Eric Engestrom | Erik McKelvey | Erik Sipsma | Felix Fontein | Fernando Miguel | Fiona Klute | Foysal Iqbal | Frank Villaro-Dixon | Fred Cox | Frieder Bluemle | Félix Mattrat | Gabriel-Adrian Samfira | Gaetan de Villele | Gahl Saraf | George | Govind Rai | Grant Reaber | Grégoire Payen de La Garanderie | Guilhem Charles | Hans van den Bogert | Hao Hu | Hector S | Helen Xie | Himanshu Pandey | Hiromu Nakamura | HowJMay | Hugo Santos | Höhl, Lukas | Ian Campbell | Ian King'ori | Ignas Mikalajūnas | Ilya Dmitrichenko | Iskander (Alex) Sharipov | Jacob Gillespie | Jacob MacElroy | Jakub Ciolek | James Carnegie | Jean-Pierre Huynh | Jeffrey Huang | Jesper Noordsij | Jesse Rittner | Jessica Frazelle | Jitender Kumar | John Howard | John Maguire | John Mulhausen | John Tims | Jon Zeolla | Jonathan A. Sternberg | Jonathan Azoff | Jonathan Giannuzzi | Jonathan Stoppani | Jonny Stoten | JordanGoasdoue | Julian Goede | Justas Brazauskas | Justin Chadwell | Justin Cormack | Justin Garrison | Jörg Franke <359489+NewJorg@users.noreply.github.com> | Kai Takac | Kang, Matthew | Kazuyoshi Kato | Kees Cook | Kevin Burke | Kir Kolyshkin | Kirill A. Korinsky | Kohei Tokunaga | Koichi Shiraishi | Kris-Mikael Krister | Kunal Kushwaha | Kyle | Lajos Papp | Leandro Santiago | Levi Harrison | Lu Jingxiao | Luca Visentin | Maciej Kalisz | Madhav Puri | Manu Gupta | Marat Radchenko | Marcus Comstedt | Mark Gordon | Mark Yen | Marko Kohtala | Mary Anthony | Matias Insaurralde | Matt Kang | Matt Rickard | Maxime Lagresle | Michael Crosby | Michael Friis | Michael Irwin | Miguel Ángel Jimeno | Mihai Borobocea | Mike Brown | Mikhail Vasin | Milas Bowman | Misty Stanley-Jones | Mitsuru Kariya | Miyachi Katsuya | Morgan Bauer | Moritz ""WanzenBug"" Wanzenböck | Morlay | Nao YONASHIRO | Natasha Jarus | Nathan Sullivan | Nguyễn Đức Chiến | Nick Miyake | Nick Santos | Nikhil Pandeti | Nobi | Noel Georgi <18496730+frezbo@users.noreply.github.com> | Oliver Bristow | Omer Duchovne <79370724+od-cyera@users.noreply.github.com> | Omer Mizrahi | Ondrej Fabry | Otto Kekäläinen | Pablo Chico de Guzman | Patrick Hemmer | Patrick Lang | Patrick Van Stee | Paul ""TBBle"" Hampson | Paweł Gronowski | Peter Dave Hello | Petr Fedchenkov | Petteri Räty | Phil Estes | Pierre Fenoll | Pranav Pandit | Pratik Raj | Prayag Verma | Qiang Huang | Remy Suen | Reshen | Ri Xu | Rob Taylor | Robert Estelle | Rubens Figueiredo | Salim B | Sam Whited | Sascha Hemleb | Sascha Schwarze | Sean P. Kane | Sebastiaan van Stijn | Seiya Miyata | Serhat Gülçiçek | Sertac Ozercan | Shaun Thompson | Shev Yan | Shijiang Wei | Shingo Omura | Shiwei Zhang | Siebe Schaap | Silvin Lubecki <31478878+silvin-lubecki@users.noreply.github.com> | Simon Ferquel | Slava Semushin | Solomon Hykes | Stefan Scherer | Stefan Weil | StefanSchoof | Stepan Blyshchak | Stephen Day | Steve Lohr | Sven Dowideit | Swagat Bora | Takuya Noguchi | Talon Bowler | Thomas Leonard | Thomas Riccardi | Thomas Shaw | Tianon Gravi | Tibor Vass | Tiffany Jernigan | Tim Waugh | Tim Wraight | Tino Rusch | Tobias Klauser | Tomas Tomecek | Tomasz Kopczynski | Tomohiro Kusumoto | Tristan Stenner | Troels Liebe Bentsen | Tõnis Tiigi | Valentin Lorentz | Vasek - Tom C | Victor Vieux | Victoria Bialas | Vincent Demeester | Vlad A. Ionescu | Vladislav Ivanov | Wang Yumu <37442693@qq.com> | Wei Fu | Wei Zhang | Xiaofan Zhang | Ximo Guanter | Yamazaki Masashi | Yan Song | Yong Tang | Yuichiro Kaneko | Yurii Rashkovskii | Zach Badgett | Zhizhen He | Ziv Tsarfati | a-palchikov | adamperlin | coryb | cuiyourong | dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> | dito | eyherabh | f0 | fanjiyun.fjy | frankyang | genglu.gl | ggjulio | guangwu | guoguangwu | jgeiger | jlecordier | joey | jroenf | kevinmeredith | l00397676 | lalyos | liulanzheng | liwenqi | lixiaobing10051267 | lomot | masibw | mikelinjie <294893458@qq.com> | msg | njucjc | omahs <73983677+omahs@users.noreply.github.com> | pieterdd | racequite | retornam | squeegels <1674195+squeegels@users.noreply.github.com> | sunchunming | wingkwong | x893675 | yumemio <59369226+yumemio@users.noreply.github.com> | yzewei | zhangwenlong | 岁丰 | 沈陵 | 蝦米 | 郑泽宇 " +core,github.com/moby/buildkit/frontend/dockerfile/parser,Apache-2.0,"Aaron L. Xu | Aaron Lehmann | Aaron Lehmann | Abdur Rehman | Addam Hardy | Adrian Plata | Adrien Delorme | Ahmon Dancy | Aidan Hobson Sayers | Akihiro Suda | Alan Fregtman <941331+darkvertex@users.noreply.github.com> | Alano Terblanche <18033717+Benehiko@users.noreply.github.com> | Aleksa Sarai | Alex Couture-Beil | Alex Mayer | Alex Suraci | Alexander Morozov | Alexis Murzeau | Alice Frosi | Allen Sun | Amen Belayneh | Anca Iordache | Anda Xu | Anders F Björklund | Andrea Bolognani | Andrea Luzzardi | Andrew Chang | Andrey Smirnov | Andy Alt | Andy Caldwell | Ankush Agarwal | Anthony Nandaa | Anthony Sottile | Anurag Goel | Anusha Ragunathan | Arkadiusz Drabczyk | Arnaldo Garcia Rincon | Arnaud Bailly | Artem Khramov | Austin Vazquez | Avi Deitcher | Bastiaan Bakker | Ben Longo | Bertrand Paquet | Billy Owire | Bin Liu | Bjorn Neergaard | Brandon Mitchell | Brennan Kinney <5098581+polarathene@users.noreply.github.com> | Brian Goff | Bunyamin Dokmetas <19335284+ztzxt@users.noreply.github.com> | Burt Holzman | Ce Gao | Chaerim Yeo | Changwei Ge | Chanhun Jeong | ChaosGramer | Charles Chan | Charles Korn | Charles Law | Chenbin | Chris Goller | Chris McKinnel | Christian Höltje | Christian Weichel | Ciro S. Costa | Claudiu Belu | Colin Chartier | Corey Larson | Cory Bennett | Cory Snider | Craig Andrews | CrazyMax | Csaba Apagyi | Dan Duvall | Daniel Cassidy | Daniel Nephin | Darren Shepherd | Dave Chen | Dave Henderson | Dave Tucker | David Calavera | David Dooling | David Gageot | David Karlsson | Davis Schirmer | Debosmit Ray | Dennis Chen | Dennis Haney | Derek McGowan | Dharmit Shah | Ding Fei | Doug Davis | Edgar Lee | Eli Uriegas | Elias Faxö | Eng Zer Jun | Eric Engestrom | Erik McKelvey | Erik Sipsma | Felix Fontein | Fernando Miguel | Fiona Klute | Foysal Iqbal | Frank Villaro-Dixon | Fred Cox | Frieder Bluemle | Félix Mattrat | Gabriel-Adrian Samfira | Gaetan de Villele | Gahl Saraf | George | Govind Rai | Grant Reaber | Grégoire Payen de La Garanderie | Guilhem Charles | Hans van den Bogert | Hao Hu | Hector S | Helen Xie | Himanshu Pandey | Hiromu Nakamura | HowJMay | Hugo Santos | Höhl, Lukas | Ian Campbell | Ian King'ori | Ignas Mikalajūnas | Ilya Dmitrichenko | Iskander (Alex) Sharipov | Jacob Gillespie | Jacob MacElroy | Jakub Ciolek | James Carnegie | Jean-Pierre Huynh | Jeffrey Huang | Jesper Noordsij | Jesse Rittner | Jessica Frazelle | Jitender Kumar | John Howard | John Maguire | John Mulhausen | John Tims | Jon Zeolla | Jonathan A. Sternberg | Jonathan Azoff | Jonathan Giannuzzi | Jonathan Stoppani | Jonny Stoten | JordanGoasdoue | Julian Goede | Justas Brazauskas | Justin Chadwell | Justin Cormack | Justin Garrison | Jörg Franke <359489+NewJorg@users.noreply.github.com> | Kai Takac | Kang, Matthew | Kazuyoshi Kato | Kees Cook | Kevin Burke | Kir Kolyshkin | Kirill A. Korinsky | Kohei Tokunaga | Koichi Shiraishi | Kris-Mikael Krister | Kunal Kushwaha | Kyle | Lajos Papp | Leandro Santiago | Levi Harrison | Lu Jingxiao | Luca Visentin | Maciej Kalisz | Madhav Puri | Manu Gupta | Marat Radchenko | Marcus Comstedt | Mark Gordon | Mark Yen | Marko Kohtala | Mary Anthony | Matias Insaurralde | Matt Kang | Matt Rickard | Maxime Lagresle | Michael Crosby | Michael Friis | Michael Irwin | Miguel Ángel Jimeno | Mihai Borobocea | Mike Brown | Mikhail Vasin | Milas Bowman | Misty Stanley-Jones | Mitsuru Kariya | Miyachi Katsuya | Morgan Bauer | Moritz ""WanzenBug"" Wanzenböck | Morlay | Nao YONASHIRO | Natasha Jarus | Nathan Sullivan | Nguyễn Đức Chiến | Nick Miyake | Nick Santos | Nikhil Pandeti | Nobi | Noel Georgi <18496730+frezbo@users.noreply.github.com> | Oliver Bristow | Omer Duchovne <79370724+od-cyera@users.noreply.github.com> | Omer Mizrahi | Ondrej Fabry | Otto Kekäläinen | Pablo Chico de Guzman | Patrick Hemmer | Patrick Lang | Patrick Van Stee | Paul ""TBBle"" Hampson | Paweł Gronowski | Peter Dave Hello | Petr Fedchenkov | Petteri Räty | Phil Estes | Pierre Fenoll | Pranav Pandit | Pratik Raj | Prayag Verma | Qiang Huang | Remy Suen | Reshen | Ri Xu | Rob Taylor | Robert Estelle | Rubens Figueiredo | Salim B | Sam Whited | Sascha Hemleb | Sascha Schwarze | Sean P. Kane | Sebastiaan van Stijn | Seiya Miyata | Serhat Gülçiçek | Sertac Ozercan | Shaun Thompson | Shev Yan | Shijiang Wei | Shingo Omura | Shiwei Zhang | Siebe Schaap | Silvin Lubecki <31478878+silvin-lubecki@users.noreply.github.com> | Simon Ferquel | Slava Semushin | Solomon Hykes | Stefan Scherer | Stefan Weil | StefanSchoof | Stepan Blyshchak | Stephen Day | Steve Lohr | Sven Dowideit | Swagat Bora | Takuya Noguchi | Talon Bowler | Thomas Leonard | Thomas Riccardi | Thomas Shaw | Tianon Gravi | Tibor Vass | Tiffany Jernigan | Tim Waugh | Tim Wraight | Tino Rusch | Tobias Klauser | Tomas Tomecek | Tomasz Kopczynski | Tomohiro Kusumoto | Tristan Stenner | Troels Liebe Bentsen | Tõnis Tiigi | Valentin Lorentz | Vasek - Tom C | Victor Vieux | Victoria Bialas | Vincent Demeester | Vlad A. Ionescu | Vladislav Ivanov | Wang Yumu <37442693@qq.com> | Wei Fu | Wei Zhang | Xiaofan Zhang | Ximo Guanter | Yamazaki Masashi | Yan Song | Yong Tang | Yuichiro Kaneko | Yurii Rashkovskii | Zach Badgett | Zhizhen He | Ziv Tsarfati | a-palchikov | adamperlin | coryb | cuiyourong | dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> | dito | eyherabh | f0 | fanjiyun.fjy | frankyang | genglu.gl | ggjulio | guangwu | guoguangwu | jgeiger | jlecordier | joey | jroenf | kevinmeredith | l00397676 | lalyos | liulanzheng | liwenqi | lixiaobing10051267 | lomot | masibw | mikelinjie <294893458@qq.com> | msg | njucjc | omahs <73983677+omahs@users.noreply.github.com> | pieterdd | racequite | retornam | squeegels <1674195+squeegels@users.noreply.github.com> | sunchunming | wingkwong | x893675 | yumemio <59369226+yumemio@users.noreply.github.com> | yzewei | zhangwenlong | 岁丰 | 沈陵 | 蝦米 | 郑泽宇 " +core,github.com/moby/buildkit/frontend/dockerfile/shell,Apache-2.0,"Aaron L. Xu | Aaron Lehmann | Aaron Lehmann | Abdur Rehman | Addam Hardy | Adrian Plata | Adrien Delorme | Ahmon Dancy | Aidan Hobson Sayers | Akihiro Suda | Alan Fregtman <941331+darkvertex@users.noreply.github.com> | Alano Terblanche <18033717+Benehiko@users.noreply.github.com> | Aleksa Sarai | Alex Couture-Beil | Alex Mayer | Alex Suraci | Alexander Morozov | Alexis Murzeau | Alice Frosi | Allen Sun | Amen Belayneh | Anca Iordache | Anda Xu | Anders F Björklund | Andrea Bolognani | Andrea Luzzardi | Andrew Chang | Andrey Smirnov | Andy Alt | Andy Caldwell | Ankush Agarwal | Anthony Nandaa | Anthony Sottile | Anurag Goel | Anusha Ragunathan | Arkadiusz Drabczyk | Arnaldo Garcia Rincon | Arnaud Bailly | Artem Khramov | Austin Vazquez | Avi Deitcher | Bastiaan Bakker | Ben Longo | Bertrand Paquet | Billy Owire | Bin Liu | Bjorn Neergaard | Brandon Mitchell | Brennan Kinney <5098581+polarathene@users.noreply.github.com> | Brian Goff | Bunyamin Dokmetas <19335284+ztzxt@users.noreply.github.com> | Burt Holzman | Ce Gao | Chaerim Yeo | Changwei Ge | Chanhun Jeong | ChaosGramer | Charles Chan | Charles Korn | Charles Law | Chenbin | Chris Goller | Chris McKinnel | Christian Höltje | Christian Weichel | Ciro S. Costa | Claudiu Belu | Colin Chartier | Corey Larson | Cory Bennett | Cory Snider | Craig Andrews | CrazyMax | Csaba Apagyi | Dan Duvall | Daniel Cassidy | Daniel Nephin | Darren Shepherd | Dave Chen | Dave Henderson | Dave Tucker | David Calavera | David Dooling | David Gageot | David Karlsson | Davis Schirmer | Debosmit Ray | Dennis Chen | Dennis Haney | Derek McGowan | Dharmit Shah | Ding Fei | Doug Davis | Edgar Lee | Eli Uriegas | Elias Faxö | Eng Zer Jun | Eric Engestrom | Erik McKelvey | Erik Sipsma | Felix Fontein | Fernando Miguel | Fiona Klute | Foysal Iqbal | Frank Villaro-Dixon | Fred Cox | Frieder Bluemle | Félix Mattrat | Gabriel-Adrian Samfira | Gaetan de Villele | Gahl Saraf | George | Govind Rai | Grant Reaber | Grégoire Payen de La Garanderie | Guilhem Charles | Hans van den Bogert | Hao Hu | Hector S | Helen Xie | Himanshu Pandey | Hiromu Nakamura | HowJMay | Hugo Santos | Höhl, Lukas | Ian Campbell | Ian King'ori | Ignas Mikalajūnas | Ilya Dmitrichenko | Iskander (Alex) Sharipov | Jacob Gillespie | Jacob MacElroy | Jakub Ciolek | James Carnegie | Jean-Pierre Huynh | Jeffrey Huang | Jesper Noordsij | Jesse Rittner | Jessica Frazelle | Jitender Kumar | John Howard | John Maguire | John Mulhausen | John Tims | Jon Zeolla | Jonathan A. Sternberg | Jonathan Azoff | Jonathan Giannuzzi | Jonathan Stoppani | Jonny Stoten | JordanGoasdoue | Julian Goede | Justas Brazauskas | Justin Chadwell | Justin Cormack | Justin Garrison | Jörg Franke <359489+NewJorg@users.noreply.github.com> | Kai Takac | Kang, Matthew | Kazuyoshi Kato | Kees Cook | Kevin Burke | Kir Kolyshkin | Kirill A. Korinsky | Kohei Tokunaga | Koichi Shiraishi | Kris-Mikael Krister | Kunal Kushwaha | Kyle | Lajos Papp | Leandro Santiago | Levi Harrison | Lu Jingxiao | Luca Visentin | Maciej Kalisz | Madhav Puri | Manu Gupta | Marat Radchenko | Marcus Comstedt | Mark Gordon | Mark Yen | Marko Kohtala | Mary Anthony | Matias Insaurralde | Matt Kang | Matt Rickard | Maxime Lagresle | Michael Crosby | Michael Friis | Michael Irwin | Miguel Ángel Jimeno | Mihai Borobocea | Mike Brown | Mikhail Vasin | Milas Bowman | Misty Stanley-Jones | Mitsuru Kariya | Miyachi Katsuya | Morgan Bauer | Moritz ""WanzenBug"" Wanzenböck | Morlay | Nao YONASHIRO | Natasha Jarus | Nathan Sullivan | Nguyễn Đức Chiến | Nick Miyake | Nick Santos | Nikhil Pandeti | Nobi | Noel Georgi <18496730+frezbo@users.noreply.github.com> | Oliver Bristow | Omer Duchovne <79370724+od-cyera@users.noreply.github.com> | Omer Mizrahi | Ondrej Fabry | Otto Kekäläinen | Pablo Chico de Guzman | Patrick Hemmer | Patrick Lang | Patrick Van Stee | Paul ""TBBle"" Hampson | Paweł Gronowski | Peter Dave Hello | Petr Fedchenkov | Petteri Räty | Phil Estes | Pierre Fenoll | Pranav Pandit | Pratik Raj | Prayag Verma | Qiang Huang | Remy Suen | Reshen | Ri Xu | Rob Taylor | Robert Estelle | Rubens Figueiredo | Salim B | Sam Whited | Sascha Hemleb | Sascha Schwarze | Sean P. Kane | Sebastiaan van Stijn | Seiya Miyata | Serhat Gülçiçek | Sertac Ozercan | Shaun Thompson | Shev Yan | Shijiang Wei | Shingo Omura | Shiwei Zhang | Siebe Schaap | Silvin Lubecki <31478878+silvin-lubecki@users.noreply.github.com> | Simon Ferquel | Slava Semushin | Solomon Hykes | Stefan Scherer | Stefan Weil | StefanSchoof | Stepan Blyshchak | Stephen Day | Steve Lohr | Sven Dowideit | Swagat Bora | Takuya Noguchi | Talon Bowler | Thomas Leonard | Thomas Riccardi | Thomas Shaw | Tianon Gravi | Tibor Vass | Tiffany Jernigan | Tim Waugh | Tim Wraight | Tino Rusch | Tobias Klauser | Tomas Tomecek | Tomasz Kopczynski | Tomohiro Kusumoto | Tristan Stenner | Troels Liebe Bentsen | Tõnis Tiigi | Valentin Lorentz | Vasek - Tom C | Victor Vieux | Victoria Bialas | Vincent Demeester | Vlad A. Ionescu | Vladislav Ivanov | Wang Yumu <37442693@qq.com> | Wei Fu | Wei Zhang | Xiaofan Zhang | Ximo Guanter | Yamazaki Masashi | Yan Song | Yong Tang | Yuichiro Kaneko | Yurii Rashkovskii | Zach Badgett | Zhizhen He | Ziv Tsarfati | a-palchikov | adamperlin | coryb | cuiyourong | dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> | dito | eyherabh | f0 | fanjiyun.fjy | frankyang | genglu.gl | ggjulio | guangwu | guoguangwu | jgeiger | jlecordier | joey | jroenf | kevinmeredith | l00397676 | lalyos | liulanzheng | liwenqi | lixiaobing10051267 | lomot | masibw | mikelinjie <294893458@qq.com> | msg | njucjc | omahs <73983677+omahs@users.noreply.github.com> | pieterdd | racequite | retornam | squeegels <1674195+squeegels@users.noreply.github.com> | sunchunming | wingkwong | x893675 | yumemio <59369226+yumemio@users.noreply.github.com> | yzewei | zhangwenlong | 岁丰 | 沈陵 | 蝦米 | 郑泽宇 " +core,github.com/moby/buildkit/util/stack,Apache-2.0,"Aaron L. Xu | Aaron Lehmann | Aaron Lehmann | Abdur Rehman | Addam Hardy | Adrian Plata | Adrien Delorme | Ahmon Dancy | Aidan Hobson Sayers | Akihiro Suda | Alan Fregtman <941331+darkvertex@users.noreply.github.com> | Alano Terblanche <18033717+Benehiko@users.noreply.github.com> | Aleksa Sarai | Alex Couture-Beil | Alex Mayer | Alex Suraci | Alexander Morozov | Alexis Murzeau | Alice Frosi | Allen Sun | Amen Belayneh | Anca Iordache | Anda Xu | Anders F Björklund | Andrea Bolognani | Andrea Luzzardi | Andrew Chang | Andrey Smirnov | Andy Alt | Andy Caldwell | Ankush Agarwal | Anthony Nandaa | Anthony Sottile | Anurag Goel | Anusha Ragunathan | Arkadiusz Drabczyk | Arnaldo Garcia Rincon | Arnaud Bailly | Artem Khramov | Austin Vazquez | Avi Deitcher | Bastiaan Bakker | Ben Longo | Bertrand Paquet | Billy Owire | Bin Liu | Bjorn Neergaard | Brandon Mitchell | Brennan Kinney <5098581+polarathene@users.noreply.github.com> | Brian Goff | Bunyamin Dokmetas <19335284+ztzxt@users.noreply.github.com> | Burt Holzman | Ce Gao | Chaerim Yeo | Changwei Ge | Chanhun Jeong | ChaosGramer | Charles Chan | Charles Korn | Charles Law | Chenbin | Chris Goller | Chris McKinnel | Christian Höltje | Christian Weichel | Ciro S. Costa | Claudiu Belu | Colin Chartier | Corey Larson | Cory Bennett | Cory Snider | Craig Andrews | CrazyMax | Csaba Apagyi | Dan Duvall | Daniel Cassidy | Daniel Nephin | Darren Shepherd | Dave Chen | Dave Henderson | Dave Tucker | David Calavera | David Dooling | David Gageot | David Karlsson | Davis Schirmer | Debosmit Ray | Dennis Chen | Dennis Haney | Derek McGowan | Dharmit Shah | Ding Fei | Doug Davis | Edgar Lee | Eli Uriegas | Elias Faxö | Eng Zer Jun | Eric Engestrom | Erik McKelvey | Erik Sipsma | Felix Fontein | Fernando Miguel | Fiona Klute | Foysal Iqbal | Frank Villaro-Dixon | Fred Cox | Frieder Bluemle | Félix Mattrat | Gabriel-Adrian Samfira | Gaetan de Villele | Gahl Saraf | George | Govind Rai | Grant Reaber | Grégoire Payen de La Garanderie | Guilhem Charles | Hans van den Bogert | Hao Hu | Hector S | Helen Xie | Himanshu Pandey | Hiromu Nakamura | HowJMay | Hugo Santos | Höhl, Lukas | Ian Campbell | Ian King'ori | Ignas Mikalajūnas | Ilya Dmitrichenko | Iskander (Alex) Sharipov | Jacob Gillespie | Jacob MacElroy | Jakub Ciolek | James Carnegie | Jean-Pierre Huynh | Jeffrey Huang | Jesper Noordsij | Jesse Rittner | Jessica Frazelle | Jitender Kumar | John Howard | John Maguire | John Mulhausen | John Tims | Jon Zeolla | Jonathan A. Sternberg | Jonathan Azoff | Jonathan Giannuzzi | Jonathan Stoppani | Jonny Stoten | JordanGoasdoue | Julian Goede | Justas Brazauskas | Justin Chadwell | Justin Cormack | Justin Garrison | Jörg Franke <359489+NewJorg@users.noreply.github.com> | Kai Takac | Kang, Matthew | Kazuyoshi Kato | Kees Cook | Kevin Burke | Kir Kolyshkin | Kirill A. Korinsky | Kohei Tokunaga | Koichi Shiraishi | Kris-Mikael Krister | Kunal Kushwaha | Kyle | Lajos Papp | Leandro Santiago | Levi Harrison | Lu Jingxiao | Luca Visentin | Maciej Kalisz | Madhav Puri | Manu Gupta | Marat Radchenko | Marcus Comstedt | Mark Gordon | Mark Yen | Marko Kohtala | Mary Anthony | Matias Insaurralde | Matt Kang | Matt Rickard | Maxime Lagresle | Michael Crosby | Michael Friis | Michael Irwin | Miguel Ángel Jimeno | Mihai Borobocea | Mike Brown | Mikhail Vasin | Milas Bowman | Misty Stanley-Jones | Mitsuru Kariya | Miyachi Katsuya | Morgan Bauer | Moritz ""WanzenBug"" Wanzenböck | Morlay | Nao YONASHIRO | Natasha Jarus | Nathan Sullivan | Nguyễn Đức Chiến | Nick Miyake | Nick Santos | Nikhil Pandeti | Nobi | Noel Georgi <18496730+frezbo@users.noreply.github.com> | Oliver Bristow | Omer Duchovne <79370724+od-cyera@users.noreply.github.com> | Omer Mizrahi | Ondrej Fabry | Otto Kekäläinen | Pablo Chico de Guzman | Patrick Hemmer | Patrick Lang | Patrick Van Stee | Paul ""TBBle"" Hampson | Paweł Gronowski | Peter Dave Hello | Petr Fedchenkov | Petteri Räty | Phil Estes | Pierre Fenoll | Pranav Pandit | Pratik Raj | Prayag Verma | Qiang Huang | Remy Suen | Reshen | Ri Xu | Rob Taylor | Robert Estelle | Rubens Figueiredo | Salim B | Sam Whited | Sascha Hemleb | Sascha Schwarze | Sean P. Kane | Sebastiaan van Stijn | Seiya Miyata | Serhat Gülçiçek | Sertac Ozercan | Shaun Thompson | Shev Yan | Shijiang Wei | Shingo Omura | Shiwei Zhang | Siebe Schaap | Silvin Lubecki <31478878+silvin-lubecki@users.noreply.github.com> | Simon Ferquel | Slava Semushin | Solomon Hykes | Stefan Scherer | Stefan Weil | StefanSchoof | Stepan Blyshchak | Stephen Day | Steve Lohr | Sven Dowideit | Swagat Bora | Takuya Noguchi | Talon Bowler | Thomas Leonard | Thomas Riccardi | Thomas Shaw | Tianon Gravi | Tibor Vass | Tiffany Jernigan | Tim Waugh | Tim Wraight | Tino Rusch | Tobias Klauser | Tomas Tomecek | Tomasz Kopczynski | Tomohiro Kusumoto | Tristan Stenner | Troels Liebe Bentsen | Tõnis Tiigi | Valentin Lorentz | Vasek - Tom C | Victor Vieux | Victoria Bialas | Vincent Demeester | Vlad A. Ionescu | Vladislav Ivanov | Wang Yumu <37442693@qq.com> | Wei Fu | Wei Zhang | Xiaofan Zhang | Ximo Guanter | Yamazaki Masashi | Yan Song | Yong Tang | Yuichiro Kaneko | Yurii Rashkovskii | Zach Badgett | Zhizhen He | Ziv Tsarfati | a-palchikov | adamperlin | coryb | cuiyourong | dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> | dito | eyherabh | f0 | fanjiyun.fjy | frankyang | genglu.gl | ggjulio | guangwu | guoguangwu | jgeiger | jlecordier | joey | jroenf | kevinmeredith | l00397676 | lalyos | liulanzheng | liwenqi | lixiaobing10051267 | lomot | masibw | mikelinjie <294893458@qq.com> | msg | njucjc | omahs <73983677+omahs@users.noreply.github.com> | pieterdd | racequite | retornam | squeegels <1674195+squeegels@users.noreply.github.com> | sunchunming | wingkwong | x893675 | yumemio <59369226+yumemio@users.noreply.github.com> | yzewei | zhangwenlong | 岁丰 | 沈陵 | 蝦米 | 郑泽宇 " +core,github.com/moby/buildkit/util/suggest,Apache-2.0,"Aaron L. Xu | Aaron Lehmann | Aaron Lehmann | Abdur Rehman | Addam Hardy | Adrian Plata | Adrien Delorme | Ahmon Dancy | Aidan Hobson Sayers | Akihiro Suda | Alan Fregtman <941331+darkvertex@users.noreply.github.com> | Alano Terblanche <18033717+Benehiko@users.noreply.github.com> | Aleksa Sarai | Alex Couture-Beil | Alex Mayer | Alex Suraci | Alexander Morozov | Alexis Murzeau | Alice Frosi | Allen Sun | Amen Belayneh | Anca Iordache | Anda Xu | Anders F Björklund | Andrea Bolognani | Andrea Luzzardi | Andrew Chang | Andrey Smirnov | Andy Alt | Andy Caldwell | Ankush Agarwal | Anthony Nandaa | Anthony Sottile | Anurag Goel | Anusha Ragunathan | Arkadiusz Drabczyk | Arnaldo Garcia Rincon | Arnaud Bailly | Artem Khramov | Austin Vazquez | Avi Deitcher | Bastiaan Bakker | Ben Longo | Bertrand Paquet | Billy Owire | Bin Liu | Bjorn Neergaard | Brandon Mitchell | Brennan Kinney <5098581+polarathene@users.noreply.github.com> | Brian Goff | Bunyamin Dokmetas <19335284+ztzxt@users.noreply.github.com> | Burt Holzman | Ce Gao | Chaerim Yeo | Changwei Ge | Chanhun Jeong | ChaosGramer | Charles Chan | Charles Korn | Charles Law | Chenbin | Chris Goller | Chris McKinnel | Christian Höltje | Christian Weichel | Ciro S. Costa | Claudiu Belu | Colin Chartier | Corey Larson | Cory Bennett | Cory Snider | Craig Andrews | CrazyMax | Csaba Apagyi | Dan Duvall | Daniel Cassidy | Daniel Nephin | Darren Shepherd | Dave Chen | Dave Henderson | Dave Tucker | David Calavera | David Dooling | David Gageot | David Karlsson | Davis Schirmer | Debosmit Ray | Dennis Chen | Dennis Haney | Derek McGowan | Dharmit Shah | Ding Fei | Doug Davis | Edgar Lee | Eli Uriegas | Elias Faxö | Eng Zer Jun | Eric Engestrom | Erik McKelvey | Erik Sipsma | Felix Fontein | Fernando Miguel | Fiona Klute | Foysal Iqbal | Frank Villaro-Dixon | Fred Cox | Frieder Bluemle | Félix Mattrat | Gabriel-Adrian Samfira | Gaetan de Villele | Gahl Saraf | George | Govind Rai | Grant Reaber | Grégoire Payen de La Garanderie | Guilhem Charles | Hans van den Bogert | Hao Hu | Hector S | Helen Xie | Himanshu Pandey | Hiromu Nakamura | HowJMay | Hugo Santos | Höhl, Lukas | Ian Campbell | Ian King'ori | Ignas Mikalajūnas | Ilya Dmitrichenko | Iskander (Alex) Sharipov | Jacob Gillespie | Jacob MacElroy | Jakub Ciolek | James Carnegie | Jean-Pierre Huynh | Jeffrey Huang | Jesper Noordsij | Jesse Rittner | Jessica Frazelle | Jitender Kumar | John Howard | John Maguire | John Mulhausen | John Tims | Jon Zeolla | Jonathan A. Sternberg | Jonathan Azoff | Jonathan Giannuzzi | Jonathan Stoppani | Jonny Stoten | JordanGoasdoue | Julian Goede | Justas Brazauskas | Justin Chadwell | Justin Cormack | Justin Garrison | Jörg Franke <359489+NewJorg@users.noreply.github.com> | Kai Takac | Kang, Matthew | Kazuyoshi Kato | Kees Cook | Kevin Burke | Kir Kolyshkin | Kirill A. Korinsky | Kohei Tokunaga | Koichi Shiraishi | Kris-Mikael Krister | Kunal Kushwaha | Kyle | Lajos Papp | Leandro Santiago | Levi Harrison | Lu Jingxiao | Luca Visentin | Maciej Kalisz | Madhav Puri | Manu Gupta | Marat Radchenko | Marcus Comstedt | Mark Gordon | Mark Yen | Marko Kohtala | Mary Anthony | Matias Insaurralde | Matt Kang | Matt Rickard | Maxime Lagresle | Michael Crosby | Michael Friis | Michael Irwin | Miguel Ángel Jimeno | Mihai Borobocea | Mike Brown | Mikhail Vasin | Milas Bowman | Misty Stanley-Jones | Mitsuru Kariya | Miyachi Katsuya | Morgan Bauer | Moritz ""WanzenBug"" Wanzenböck | Morlay | Nao YONASHIRO | Natasha Jarus | Nathan Sullivan | Nguyễn Đức Chiến | Nick Miyake | Nick Santos | Nikhil Pandeti | Nobi | Noel Georgi <18496730+frezbo@users.noreply.github.com> | Oliver Bristow | Omer Duchovne <79370724+od-cyera@users.noreply.github.com> | Omer Mizrahi | Ondrej Fabry | Otto Kekäläinen | Pablo Chico de Guzman | Patrick Hemmer | Patrick Lang | Patrick Van Stee | Paul ""TBBle"" Hampson | Paweł Gronowski | Peter Dave Hello | Petr Fedchenkov | Petteri Räty | Phil Estes | Pierre Fenoll | Pranav Pandit | Pratik Raj | Prayag Verma | Qiang Huang | Remy Suen | Reshen | Ri Xu | Rob Taylor | Robert Estelle | Rubens Figueiredo | Salim B | Sam Whited | Sascha Hemleb | Sascha Schwarze | Sean P. Kane | Sebastiaan van Stijn | Seiya Miyata | Serhat Gülçiçek | Sertac Ozercan | Shaun Thompson | Shev Yan | Shijiang Wei | Shingo Omura | Shiwei Zhang | Siebe Schaap | Silvin Lubecki <31478878+silvin-lubecki@users.noreply.github.com> | Simon Ferquel | Slava Semushin | Solomon Hykes | Stefan Scherer | Stefan Weil | StefanSchoof | Stepan Blyshchak | Stephen Day | Steve Lohr | Sven Dowideit | Swagat Bora | Takuya Noguchi | Talon Bowler | Thomas Leonard | Thomas Riccardi | Thomas Shaw | Tianon Gravi | Tibor Vass | Tiffany Jernigan | Tim Waugh | Tim Wraight | Tino Rusch | Tobias Klauser | Tomas Tomecek | Tomasz Kopczynski | Tomohiro Kusumoto | Tristan Stenner | Troels Liebe Bentsen | Tõnis Tiigi | Valentin Lorentz | Vasek - Tom C | Victor Vieux | Victoria Bialas | Vincent Demeester | Vlad A. Ionescu | Vladislav Ivanov | Wang Yumu <37442693@qq.com> | Wei Fu | Wei Zhang | Xiaofan Zhang | Ximo Guanter | Yamazaki Masashi | Yan Song | Yong Tang | Yuichiro Kaneko | Yurii Rashkovskii | Zach Badgett | Zhizhen He | Ziv Tsarfati | a-palchikov | adamperlin | coryb | cuiyourong | dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> | dito | eyherabh | f0 | fanjiyun.fjy | frankyang | genglu.gl | ggjulio | guangwu | guoguangwu | jgeiger | jlecordier | joey | jroenf | kevinmeredith | l00397676 | lalyos | liulanzheng | liwenqi | lixiaobing10051267 | lomot | masibw | mikelinjie <294893458@qq.com> | msg | njucjc | omahs <73983677+omahs@users.noreply.github.com> | pieterdd | racequite | retornam | squeegels <1674195+squeegels@users.noreply.github.com> | sunchunming | wingkwong | x893675 | yumemio <59369226+yumemio@users.noreply.github.com> | yzewei | zhangwenlong | 岁丰 | 沈陵 | 蝦米 | 郑泽宇 " core,github.com/moby/docker-image-spec/specs-go/v1,Apache-2.0,"Copyright 2012-2017 Docker, Inc." core,github.com/moby/locker,Apache-2.0,"Copyright 2013-2018 Docker, Inc" core,github.com/moby/spdystream,Apache-2.0,"Copyright 2013-2021 Docker, inc. Released under the [Apache 2.0 license](LICENSE) | Copyright 2014-2021 Docker Inc" @@ -1536,6 +1567,7 @@ core,github.com/netsampler/goflow2/pb,BSD-3-Clause,"Copyright (c) 2021, NetSampl core,github.com/netsampler/goflow2/producer,BSD-3-Clause,"Copyright (c) 2021, NetSampler" core,github.com/netsampler/goflow2/transport,BSD-3-Clause,"Copyright (c) 2021, NetSampler" core,github.com/netsampler/goflow2/utils,BSD-3-Clause,"Copyright (c) 2021, NetSampler" +core,github.com/nozzle/throttler,Apache-2.0,Copyright 2018 Derek Perkins core,github.com/oklog/ulid,Apache-2.0,- Peter Bourgon (@peterbourgon) | - Tomás Senart (@tsenart) core,github.com/olekukonko/tablewriter,MIT,Copyright (C) 2014 by Oleku Konko core,github.com/oliveagle/jsonpath,MIT,Copyright (c) 2015 oliver @@ -1887,6 +1919,11 @@ core,github.com/openshift/client-go/quota/clientset/versioned/typed/quota/v1,Apa core,github.com/opentracing/opentracing-go,Apache-2.0,Copyright 2016 The OpenTracing Authors core,github.com/opentracing/opentracing-go/ext,Apache-2.0,Copyright 2016 The OpenTracing Authors core,github.com/opentracing/opentracing-go/log,Apache-2.0,Copyright 2016 The OpenTracing Authors +core,github.com/openvex/discovery/pkg/discovery,Apache-2.0,Copyright 2023 The OpenVEX Authors +core,github.com/openvex/discovery/pkg/discovery/options,Apache-2.0,Copyright 2023 The OpenVEX Authors +core,github.com/openvex/discovery/pkg/oci,Apache-2.0,Copyright 2023 The OpenVEX Authors +core,github.com/openvex/discovery/pkg/probers/oci,Apache-2.0,Copyright 2023 The OpenVEX Authors +core,github.com/openvex/go-vex/pkg/attestation,Apache-2.0,Copyright 2023 The OpenVEX Authors core,github.com/openvex/go-vex/pkg/csaf,Apache-2.0,Copyright 2023 The OpenVEX Authors core,github.com/openvex/go-vex/pkg/vex,Apache-2.0,Copyright 2023 The OpenVEX Authors core,github.com/openzipkin/zipkin-go/model,Apache-2.0,Copyright 2017 The OpenZipkin Authors @@ -2031,10 +2068,11 @@ core,github.com/samber/lo/internal/constraints,MIT,Copyright (c) 2022 Samuel Ber core,github.com/samber/lo/internal/rand,MIT,Copyright (c) 2022 Samuel Berthe | Copyright © 2022 [Samuel Berthe](https://github.com/samber) core,github.com/samuel/go-zookeeper/zk,BSD-3-Clause,"Copyright (c) 2013, Samuel Stauffer " core,github.com/santhosh-tekuri/jsonschema/v5,Apache-2.0,Copyright (c) 2017-2024 Santhosh Kumar Tekuri -core,github.com/saracen/walker,MIT,Copyright (c) 2019 Arran Walker core,github.com/sassoftware/go-rpmutils,Apache-2.0,Copyright (c) SAS Institute Inc. core,github.com/sassoftware/go-rpmutils/cpio,Apache-2.0,Copyright (c) SAS Institute Inc. core,github.com/sassoftware/go-rpmutils/fileutil,Apache-2.0,Copyright (c) SAS Institute Inc. +core,github.com/sassoftware/relic/lib/pkcs7,Apache-2.0,Copyright (c) SAS Institute Inc. +core,github.com/sassoftware/relic/lib/x509tools,Apache-2.0,Copyright (c) SAS Institute Inc. core,github.com/scaleway/scaleway-sdk-go/api/baremetal/v1,Apache-2.0,Copyright 2019 Scaleway core,github.com/scaleway/scaleway-sdk-go/api/block/v1alpha1,Apache-2.0,Copyright 2019 Scaleway core,github.com/scaleway/scaleway-sdk-go/api/instance/v1,Apache-2.0,Copyright 2019 Scaleway @@ -2051,18 +2089,10 @@ core,github.com/scaleway/scaleway-sdk-go/scw,Apache-2.0,Copyright 2019 Scaleway core,github.com/scaleway/scaleway-sdk-go/validation,Apache-2.0,Copyright 2019 Scaleway core,github.com/secure-systems-lab/go-securesystemslib/cjson,MIT,Copyright (c) 2021 NYU Secure Systems Lab core,github.com/secure-systems-lab/go-securesystemslib/dsse,MIT,Copyright (c) 2021 NYU Secure Systems Lab +core,github.com/secure-systems-lab/go-securesystemslib/encrypted,MIT,Copyright (c) 2021 NYU Secure Systems Lab core,github.com/secure-systems-lab/go-securesystemslib/signerverifier,MIT,Copyright (c) 2021 NYU Secure Systems Lab core,github.com/sergi/go-diff/diffmatchpatch,MIT,Copyright (c) 2012-2016 The go-diff Authors. All rights reserved | Danny Yoo | James Kolb | Jonathan Amsterdam | Markus Zimmermann | Matt Kovars | Osman Masood | Robert Carlsen | Rory Flynn | Sergi Mansilla | Shatrugna Sadhu | Shawn Smith | Stas Maksimov | Tor Arvid Lund | Zac Bergquist | Örjan Persson core,github.com/shibumi/go-pathspec,Apache-2.0,Copyright (c) 2012 The Go Authors. All rights reserved. -core,github.com/shirou/gopsutil/v3/common,BSD-3-Clause,"Copyright (c) 2009 The Go Authors. All rights reserved | Copyright (c) 2014, WAKAYAMA Shirou" -core,github.com/shirou/gopsutil/v3/cpu,BSD-3-Clause,"Copyright (c) 2009 The Go Authors. All rights reserved | Copyright (c) 2014, WAKAYAMA Shirou" -core,github.com/shirou/gopsutil/v3/disk,BSD-3-Clause,"Copyright (c) 2009 The Go Authors. All rights reserved | Copyright (c) 2014, WAKAYAMA Shirou" -core,github.com/shirou/gopsutil/v3/host,BSD-3-Clause,"Copyright (c) 2009 The Go Authors. All rights reserved | Copyright (c) 2014, WAKAYAMA Shirou" -core,github.com/shirou/gopsutil/v3/internal/common,BSD-3-Clause,"Copyright (c) 2009 The Go Authors. All rights reserved | Copyright (c) 2014, WAKAYAMA Shirou" -core,github.com/shirou/gopsutil/v3/load,BSD-3-Clause,"Copyright (c) 2009 The Go Authors. All rights reserved | Copyright (c) 2014, WAKAYAMA Shirou" -core,github.com/shirou/gopsutil/v3/mem,BSD-3-Clause,"Copyright (c) 2009 The Go Authors. All rights reserved | Copyright (c) 2014, WAKAYAMA Shirou" -core,github.com/shirou/gopsutil/v3/net,BSD-3-Clause,"Copyright (c) 2009 The Go Authors. All rights reserved | Copyright (c) 2014, WAKAYAMA Shirou" -core,github.com/shirou/gopsutil/v3/process,BSD-3-Clause,"Copyright (c) 2009 The Go Authors. All rights reserved | Copyright (c) 2014, WAKAYAMA Shirou" core,github.com/shirou/gopsutil/v4/common,BSD-3-Clause,"Copyright (c) 2009 The Go Authors. All rights reserved | Copyright (c) 2014, WAKAYAMA Shirou" core,github.com/shirou/gopsutil/v4/cpu,BSD-3-Clause,"Copyright (c) 2009 The Go Authors. All rights reserved | Copyright (c) 2014, WAKAYAMA Shirou" core,github.com/shirou/gopsutil/v4/disk,BSD-3-Clause,"Copyright (c) 2009 The Go Authors. All rights reserved | Copyright (c) 2014, WAKAYAMA Shirou" @@ -2073,16 +2103,61 @@ core,github.com/shirou/gopsutil/v4/mem,BSD-3-Clause,"Copyright (c) 2009 The Go A core,github.com/shirou/gopsutil/v4/net,BSD-3-Clause,"Copyright (c) 2009 The Go Authors. All rights reserved | Copyright (c) 2014, WAKAYAMA Shirou" core,github.com/shirou/gopsutil/v4/process,BSD-3-Clause,"Copyright (c) 2009 The Go Authors. All rights reserved | Copyright (c) 2014, WAKAYAMA Shirou" core,github.com/shirou/w32,BSD-3-Clause,Copyright (c) 2010-2012 The w32 Authors. All rights reserved. -core,github.com/shoenig/go-m1cpu,MPL-2.0,"copyright doctrines of fair use, fair dealing, or other" core,github.com/shopspring/decimal,MIT,"Copyright (c) 2013 Oguz Bilgic | Copyright (c) 2015 Spring, Inc" core,github.com/signalfx/sapm-proto/client,Apache-2.0,"Copyright 2019 Splunk, Inc." core,github.com/signalfx/sapm-proto/gen,Apache-2.0,"Copyright 2019 Splunk, Inc." +core,github.com/sigstore/cosign/v2/internal/pkg/cosign,Apache-2.0,Copyright 2021 The Sigstore Authors +core,github.com/sigstore/cosign/v2/internal/pkg/cosign/payload/size,Apache-2.0,Copyright 2021 The Sigstore Authors +core,github.com/sigstore/cosign/v2/internal/pkg/now,Apache-2.0,Copyright 2021 The Sigstore Authors +core,github.com/sigstore/cosign/v2/internal/pkg/oci/remote,Apache-2.0,Copyright 2021 The Sigstore Authors +core,github.com/sigstore/cosign/v2/internal/ui,Apache-2.0,Copyright 2021 The Sigstore Authors +core,github.com/sigstore/cosign/v2/pkg/blob,Apache-2.0,Copyright 2021 The Sigstore Authors +core,github.com/sigstore/cosign/v2/pkg/cosign,Apache-2.0,Copyright 2021 The Sigstore Authors +core,github.com/sigstore/cosign/v2/pkg/cosign/bundle,Apache-2.0,Copyright 2021 The Sigstore Authors +core,github.com/sigstore/cosign/v2/pkg/cosign/env,Apache-2.0,Copyright 2021 The Sigstore Authors +core,github.com/sigstore/cosign/v2/pkg/cosign/fulcioverifier/ctutil,Apache-2.0,Copyright 2021 The Sigstore Authors +core,github.com/sigstore/cosign/v2/pkg/oci,Apache-2.0,Copyright 2021 The Sigstore Authors +core,github.com/sigstore/cosign/v2/pkg/oci/empty,Apache-2.0,Copyright 2021 The Sigstore Authors +core,github.com/sigstore/cosign/v2/pkg/oci/internal/signature,Apache-2.0,Copyright 2021 The Sigstore Authors +core,github.com/sigstore/cosign/v2/pkg/oci/layout,Apache-2.0,Copyright 2021 The Sigstore Authors +core,github.com/sigstore/cosign/v2/pkg/oci/remote,Apache-2.0,Copyright 2021 The Sigstore Authors +core,github.com/sigstore/cosign/v2/pkg/oci/signed,Apache-2.0,Copyright 2021 The Sigstore Authors +core,github.com/sigstore/cosign/v2/pkg/oci/static,Apache-2.0,Copyright 2021 The Sigstore Authors +core,github.com/sigstore/cosign/v2/pkg/types,Apache-2.0,Copyright 2021 The Sigstore Authors +core,github.com/sigstore/rekor/pkg/client,Apache-2.0,Copyright 2021 The Sigstore Authors core,github.com/sigstore/rekor/pkg/generated/client,Apache-2.0,Copyright 2021 The Sigstore Authors core,github.com/sigstore/rekor/pkg/generated/client/entries,Apache-2.0,Copyright 2021 The Sigstore Authors core,github.com/sigstore/rekor/pkg/generated/client/index,Apache-2.0,Copyright 2021 The Sigstore Authors core,github.com/sigstore/rekor/pkg/generated/client/pubkey,Apache-2.0,Copyright 2021 The Sigstore Authors core,github.com/sigstore/rekor/pkg/generated/client/tlog,Apache-2.0,Copyright 2021 The Sigstore Authors core,github.com/sigstore/rekor/pkg/generated/models,Apache-2.0,Copyright 2021 The Sigstore Authors +core,github.com/sigstore/rekor/pkg/log,Apache-2.0,Copyright 2021 The Sigstore Authors +core,github.com/sigstore/rekor/pkg/pki,Apache-2.0,Copyright 2021 The Sigstore Authors +core,github.com/sigstore/rekor/pkg/pki/identity,Apache-2.0,Copyright 2021 The Sigstore Authors +core,github.com/sigstore/rekor/pkg/pki/minisign,Apache-2.0,Copyright 2021 The Sigstore Authors +core,github.com/sigstore/rekor/pkg/pki/pgp,Apache-2.0,Copyright 2021 The Sigstore Authors +core,github.com/sigstore/rekor/pkg/pki/pkcs7,Apache-2.0,Copyright 2021 The Sigstore Authors +core,github.com/sigstore/rekor/pkg/pki/ssh,Apache-2.0,Copyright 2021 The Sigstore Authors +core,github.com/sigstore/rekor/pkg/pki/tuf,Apache-2.0,Copyright 2021 The Sigstore Authors +core,github.com/sigstore/rekor/pkg/pki/x509,Apache-2.0,Copyright 2021 The Sigstore Authors +core,github.com/sigstore/rekor/pkg/types,Apache-2.0,Copyright 2021 The Sigstore Authors +core,github.com/sigstore/rekor/pkg/types/dsse,Apache-2.0,Copyright 2021 The Sigstore Authors +core,github.com/sigstore/rekor/pkg/types/dsse/v0.0.1,Apache-2.0,Copyright 2021 The Sigstore Authors +core,github.com/sigstore/rekor/pkg/types/hashedrekord,Apache-2.0,Copyright 2021 The Sigstore Authors +core,github.com/sigstore/rekor/pkg/types/hashedrekord/v0.0.1,Apache-2.0,Copyright 2021 The Sigstore Authors +core,github.com/sigstore/rekor/pkg/types/intoto,Apache-2.0,Copyright 2021 The Sigstore Authors +core,github.com/sigstore/rekor/pkg/types/intoto/v0.0.1,Apache-2.0,Copyright 2021 The Sigstore Authors +core,github.com/sigstore/rekor/pkg/types/intoto/v0.0.2,Apache-2.0,Copyright 2021 The Sigstore Authors +core,github.com/sigstore/rekor/pkg/types/rekord,Apache-2.0,Copyright 2021 The Sigstore Authors +core,github.com/sigstore/rekor/pkg/types/rekord/v0.0.1,Apache-2.0,Copyright 2021 The Sigstore Authors +core,github.com/sigstore/rekor/pkg/util,Apache-2.0,Copyright 2021 The Sigstore Authors +core,github.com/sigstore/sigstore/pkg/cryptoutils,Apache-2.0,Copyright 2021 The Sigstore Authors +core,github.com/sigstore/sigstore/pkg/signature,Apache-2.0,Copyright 2021 The Sigstore Authors +core,github.com/sigstore/sigstore/pkg/signature/dsse,Apache-2.0,Copyright 2021 The Sigstore Authors +core,github.com/sigstore/sigstore/pkg/signature/options,Apache-2.0,Copyright 2021 The Sigstore Authors +core,github.com/sigstore/sigstore/pkg/signature/payload,Apache-2.0,Copyright 2021 The Sigstore Authors +core,github.com/sigstore/sigstore/pkg/tuf,Apache-2.0,Copyright 2021 The Sigstore Authors +core,github.com/sigstore/timestamp-authority/pkg/verification,Apache-2.0,Copyright 2022 The Sigstore Authors core,github.com/sijms/go-ora/v2,MIT,Copyright (c) 2020 Samy Sultan core,github.com/sijms/go-ora/v2/advanced_nego,MIT,Copyright (c) 2020 Samy Sultan core,github.com/sijms/go-ora/v2/advanced_nego/ntlmssp,MIT,Copyright (c) 2020 Samy Sultan @@ -2170,7 +2245,6 @@ core,github.com/tetratelabs/wazero/api,Apache-2.0,Copyright 2020-2023 wazero aut core,github.com/tetratelabs/wazero/experimental,Apache-2.0,Copyright 2020-2023 wazero authors core,github.com/tetratelabs/wazero/experimental/sys,Apache-2.0,Copyright 2020-2023 wazero authors core,github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1,Apache-2.0,Copyright 2020-2023 wazero authors -core,github.com/tetratelabs/wazero/internal/close,Apache-2.0,Copyright 2020-2023 wazero authors core,github.com/tetratelabs/wazero/internal/descriptor,Apache-2.0,Copyright 2020-2023 wazero authors core,github.com/tetratelabs/wazero/internal/engine/interpreter,Apache-2.0,Copyright 2020-2023 wazero authors core,github.com/tetratelabs/wazero/internal/engine/wazevo,Apache-2.0,Copyright 2020-2023 wazero authors @@ -2181,6 +2255,7 @@ core,github.com/tetratelabs/wazero/internal/engine/wazevo/backend/regalloc,Apach core,github.com/tetratelabs/wazero/internal/engine/wazevo/frontend,Apache-2.0,Copyright 2020-2023 wazero authors core,github.com/tetratelabs/wazero/internal/engine/wazevo/ssa,Apache-2.0,Copyright 2020-2023 wazero authors core,github.com/tetratelabs/wazero/internal/engine/wazevo/wazevoapi,Apache-2.0,Copyright 2020-2023 wazero authors +core,github.com/tetratelabs/wazero/internal/expctxkeys,Apache-2.0,Copyright 2020-2023 wazero authors core,github.com/tetratelabs/wazero/internal/filecache,Apache-2.0,Copyright 2020-2023 wazero authors core,github.com/tetratelabs/wazero/internal/fsapi,Apache-2.0,Copyright 2020-2023 wazero authors core,github.com/tetratelabs/wazero/internal/ieee754,Apache-2.0,Copyright 2020-2023 wazero authors @@ -2199,8 +2274,20 @@ core,github.com/tetratelabs/wazero/internal/wasm,Apache-2.0,Copyright 2020-2023 core,github.com/tetratelabs/wazero/internal/wasm/binary,Apache-2.0,Copyright 2020-2023 wazero authors core,github.com/tetratelabs/wazero/internal/wasmdebug,Apache-2.0,Copyright 2020-2023 wazero authors core,github.com/tetratelabs/wazero/internal/wasmruntime,Apache-2.0,Copyright 2020-2023 wazero authors -core,github.com/tetratelabs/wazero/internal/wazeroir,Apache-2.0,Copyright 2020-2023 wazero authors core,github.com/tetratelabs/wazero/sys,Apache-2.0,Copyright 2020-2023 wazero authors +core,github.com/theupdateframework/go-tuf,BSD-3-Clause,"Copyright (c) 2014-2020 Prime Directive, Inc. All rights reserved" +core,github.com/theupdateframework/go-tuf/client,BSD-3-Clause,"Copyright (c) 2014-2020 Prime Directive, Inc. All rights reserved" +core,github.com/theupdateframework/go-tuf/client/leveldbstore,BSD-3-Clause,"Copyright (c) 2014-2020 Prime Directive, Inc. All rights reserved" +core,github.com/theupdateframework/go-tuf/data,BSD-3-Clause,"Copyright (c) 2014-2020 Prime Directive, Inc. All rights reserved" +core,github.com/theupdateframework/go-tuf/internal/fsutil,BSD-3-Clause,"Copyright (c) 2014-2020 Prime Directive, Inc. All rights reserved" +core,github.com/theupdateframework/go-tuf/internal/roles,BSD-3-Clause,"Copyright (c) 2014-2020 Prime Directive, Inc. All rights reserved" +core,github.com/theupdateframework/go-tuf/internal/sets,BSD-3-Clause,"Copyright (c) 2014-2020 Prime Directive, Inc. All rights reserved" +core,github.com/theupdateframework/go-tuf/internal/signer,BSD-3-Clause,"Copyright (c) 2014-2020 Prime Directive, Inc. All rights reserved" +core,github.com/theupdateframework/go-tuf/pkg/keys,BSD-3-Clause,"Copyright (c) 2014-2020 Prime Directive, Inc. All rights reserved" +core,github.com/theupdateframework/go-tuf/pkg/targets,BSD-3-Clause,"Copyright (c) 2014-2020 Prime Directive, Inc. All rights reserved" +core,github.com/theupdateframework/go-tuf/sign,BSD-3-Clause,"Copyright (c) 2014-2020 Prime Directive, Inc. All rights reserved" +core,github.com/theupdateframework/go-tuf/util,BSD-3-Clause,"Copyright (c) 2014-2020 Prime Directive, Inc. All rights reserved" +core,github.com/theupdateframework/go-tuf/verify,BSD-3-Clause,"Copyright (c) 2014-2020 Prime Directive, Inc. All rights reserved" core,github.com/tidwall/gjson,MIT,Copyright (c) 2016 Josh Baker core,github.com/tidwall/match,MIT,Copyright (c) 2016 Josh Baker core,github.com/tidwall/pretty,MIT,Copyright (c) 2017 Josh Baker @@ -2210,9 +2297,15 @@ core,github.com/tinylib/msgp/gen,MIT,Copyright (c) 2009 The Go Authors (license core,github.com/tinylib/msgp/msgp,MIT,Copyright (c) 2009 The Go Authors (license at http://golang.org) where indicated | Copyright (c) 2014 Philip Hofer core,github.com/tinylib/msgp/parse,MIT,Copyright (c) 2009 The Go Authors (license at http://golang.org) where indicated | Copyright (c) 2014 Philip Hofer core,github.com/tinylib/msgp/printer,MIT,Copyright (c) 2009 The Go Authors (license at http://golang.org) where indicated | Copyright (c) 2014 Philip Hofer +core,github.com/titanous/rocacheck,MIT,"Copyright (c) 2017, CRoCS, EnigmaBridge Ltd | Copyright (c) 2017, Jonathan Rudenberg" core,github.com/tklauser/go-sysconf,BSD-3-Clause,"Copyright (c) 2018-2022, Tobias Klauser" core,github.com/tklauser/numcpus,Apache-2.0,Copyright 2018 Tobias Klauser core,github.com/tmthrgd/go-hex,BSD-3-Clause,"Copyright (c) 2005-2016, Wojciech Muła | Copyright (c) 2012 The Go Authors. All rights reserved | Copyright (c) 2016, Tom Thorogood" +core,github.com/tonistiigi/go-csvvalue,MIT,Copyright 2024 Tõnis Tiigi +core,github.com/transparency-dev/merkle,Apache-2.0,Copyright 2017 Google LLC. All Rights Reserved. +core,github.com/transparency-dev/merkle/compact,Apache-2.0,Copyright 2019 Google LLC. All Rights Reserved. +core,github.com/transparency-dev/merkle/proof,Apache-2.0,Copyright 2017 Google LLC. All Rights Reserved. | Copyright 2022 Google LLC. All Rights Reserved. +core,github.com/transparency-dev/merkle/rfc6962,Apache-2.0,Copyright 2016 Google LLC. All Rights Reserved. core,github.com/twitchtv/twirp,Apache-2.0,"Copyright 2018 Twitch Interactive, Inc. All Rights Reserved" core,github.com/twitchtv/twirp/ctxsetters,Apache-2.0,"Copyright 2018 Twitch Interactive, Inc. All Rights Reserved" core,github.com/twitchtv/twirp/internal/contextkeys,Apache-2.0,"Copyright 2018 Twitch Interactive, Inc. All Rights Reserved" @@ -2436,12 +2529,12 @@ core,go.opentelemetry.io/collector/pdata/internal,Apache-2.0,Copyright The OpenT core,go.opentelemetry.io/collector/pdata/internal/data,Apache-2.0,Copyright The OpenTelemetry Authors core,go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/logs/v1,Apache-2.0,Copyright The OpenTelemetry Authors core,go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/metrics/v1,Apache-2.0,Copyright The OpenTelemetry Authors -core,go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/profiles/v1experimental,Apache-2.0,Copyright The OpenTelemetry Authors +core,go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/profiles/v1development,Apache-2.0,Copyright The OpenTelemetry Authors core,go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/trace/v1,Apache-2.0,Copyright The OpenTelemetry Authors core,go.opentelemetry.io/collector/pdata/internal/data/protogen/common/v1,Apache-2.0,Copyright The OpenTelemetry Authors core,go.opentelemetry.io/collector/pdata/internal/data/protogen/logs/v1,Apache-2.0,Copyright The OpenTelemetry Authors core,go.opentelemetry.io/collector/pdata/internal/data/protogen/metrics/v1,Apache-2.0,Copyright The OpenTelemetry Authors -core,go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1experimental,Apache-2.0,Copyright The OpenTelemetry Authors +core,go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1development,Apache-2.0,Copyright The OpenTelemetry Authors core,go.opentelemetry.io/collector/pdata/internal/data/protogen/resource/v1,Apache-2.0,Copyright The OpenTelemetry Authors core,go.opentelemetry.io/collector/pdata/internal/data/protogen/trace/v1,Apache-2.0,Copyright The OpenTelemetry Authors core,go.opentelemetry.io/collector/pdata/internal/json,Apache-2.0,Copyright The OpenTelemetry Authors @@ -2488,6 +2581,8 @@ core,go.opentelemetry.io/collector/receiver/receivertest,Apache-2.0,Copyright Th core,go.opentelemetry.io/collector/receiver/scrapererror,Apache-2.0,Copyright The OpenTelemetry Authors core,go.opentelemetry.io/collector/receiver/scraperhelper,Apache-2.0,Copyright The OpenTelemetry Authors core,go.opentelemetry.io/collector/receiver/scraperhelper/internal/metadata,Apache-2.0,Copyright The OpenTelemetry Authors +core,go.opentelemetry.io/collector/scraper,Apache-2.0,Copyright The OpenTelemetry Authors +core,go.opentelemetry.io/collector/scraper/scrapererror,Apache-2.0,Copyright The OpenTelemetry Authors core,go.opentelemetry.io/collector/semconv/v1.16.0,Apache-2.0,Copyright The OpenTelemetry Authors core,go.opentelemetry.io/collector/semconv/v1.17.0,Apache-2.0,Copyright The OpenTelemetry Authors core,go.opentelemetry.io/collector/semconv/v1.18.0,Apache-2.0,Copyright The OpenTelemetry Authors @@ -2651,6 +2746,7 @@ core,golang.org/x/crypto/chacha20poly1305,BSD-3-Clause,Copyright (c) 2009 The Go core,golang.org/x/crypto/cryptobyte,BSD-3-Clause,Copyright 2009 The Go Authors core,golang.org/x/crypto/cryptobyte/asn1,BSD-3-Clause,Copyright 2009 The Go Authors core,golang.org/x/crypto/curve25519,BSD-3-Clause,Copyright 2009 The Go Authors +core,golang.org/x/crypto/ed25519,BSD-3-Clause,Copyright 2009 The Go Authors core,golang.org/x/crypto/hkdf,BSD-3-Clause,Copyright 2009 The Go Authors core,golang.org/x/crypto/internal/alias,BSD-3-Clause,Copyright 2009 The Go Authors core,golang.org/x/crypto/internal/poly1305,BSD-3-Clause,Copyright 2009 The Go Authors @@ -2672,6 +2768,7 @@ core,golang.org/x/crypto/ssh,BSD-3-Clause,Copyright 2009 The Go Authors core,golang.org/x/crypto/ssh/agent,BSD-3-Clause,Copyright 2009 The Go Authors core,golang.org/x/crypto/ssh/internal/bcrypt_pbkdf,BSD-3-Clause,Copyright 2009 The Go Authors core,golang.org/x/crypto/ssh/knownhosts,BSD-3-Clause,Copyright 2009 The Go Authors +core,golang.org/x/crypto/ssh/terminal,BSD-3-Clause,Copyright 2009 The Go Authors core,golang.org/x/exp/constraints,BSD-3-Clause,Copyright 2009 The Go Authors core,golang.org/x/exp/maps,BSD-3-Clause,Copyright 2009 The Go Authors core,golang.org/x/exp/mmap,BSD-3-Clause,Copyright 2009 The Go Authors @@ -2927,9 +3024,6 @@ core,google.golang.org/protobuf/types/known/timestamppb,BSD-3-Clause,Copyright ( core,google.golang.org/protobuf/types/known/wrapperspb,BSD-3-Clause,Copyright (c) 2018 The Go Authors. All rights reserved core,google.golang.org/protobuf/types/pluginpb,BSD-3-Clause,Copyright (c) 2018 The Go Authors. All rights reserved core,gopkg.in/DataDog/dd-trace-go.v1/appsec/events,Apache-2.0,"Copyright 2016-Present Datadog, Inc." -core,gopkg.in/DataDog/dd-trace-go.v1/contrib/internal/httptrace,Apache-2.0,"Copyright 2016-Present Datadog, Inc." -core,gopkg.in/DataDog/dd-trace-go.v1/contrib/internal/options,Apache-2.0,"Copyright 2016-Present Datadog, Inc." -core,gopkg.in/DataDog/dd-trace-go.v1/contrib/net/http,Apache-2.0,"Copyright 2016-Present Datadog, Inc." core,gopkg.in/DataDog/dd-trace-go.v1/datastreams/options,Apache-2.0,"Copyright 2016-Present Datadog, Inc." core,gopkg.in/DataDog/dd-trace-go.v1/ddtrace,Apache-2.0,"Copyright 2016-Present Datadog, Inc." core,gopkg.in/DataDog/dd-trace-go.v1/ddtrace/ext,Apache-2.0,"Copyright 2016-Present Datadog, Inc." @@ -2989,6 +3083,9 @@ core,gopkg.in/DataDog/dd-trace-go.v1/profiler/internal/pprofutils,Apache-2.0,"Co core,gopkg.in/Knetic/govaluate.v3,MIT,"Copyright (c) 2014-2016 George Lester | abrander (panic-finding testing tool) | benpaxton (fix for missing type checks during literal elide process) | bgaifullin (lifting restriction on complex/struct types) | dpaolella (exposure of variables used in an expression) | iasci (ternary operator) | oxtoacart (parameter structures, deferred parameter retrieval) | prashantv (optimization of bools) | vjeantet (regex support) | wmiller848 (bitwise operators) | xfennec (fix for dates being parsed in the current Location)" core,gopkg.in/cheggaaa/pb.v1,BSD-3-Clause,"Copyright (c) 2012-2015, Sergey Cherepanov" core,gopkg.in/evanphx/json-patch.v4,BSD-3-Clause,"Copyright (c) 2014, Evan Phoenix" +core,gopkg.in/go-jose/go-jose.v2,Apache-2.0,Copyright 2014 Square Inc. +core,gopkg.in/go-jose/go-jose.v2/cipher,Apache-2.0,Copyright 2014 Square Inc. +core,gopkg.in/go-jose/go-jose.v2/json,BSD-3-Clause,Copyright (c) 2012 The Go Authors. All rights reserved | Copyright 2014 Square Inc. core,gopkg.in/inf.v0,BSD-3-Clause,Copyright (c) 2012 Péter Surányi. Portions Copyright (c) 2009 The Go Authors. All rights reserved. core,gopkg.in/ini.v1,Apache-2.0,Copyright 2014 Unknwon core,gopkg.in/natefinch/lumberjack.v2,MIT,Copyright (c) 2014 Nate Finch @@ -3990,6 +4087,8 @@ core,modernc.org/sqlite,BSD-3-Clause,Alexander Menzhinsky | Alexey Palazhchenko | Angus Dippenaar | Artyom Pervukhin | Copyright (c) 2017 The Sqlite Authors. All rights reserved | Dan Kortschak | Dan Peterson | David Skinner | David Walton | Davsk Ltd Co | Elle Mouton | FerretDB Inc. | FlyingOnion <731677080@qq.com> | Gleb Sakhnov | Jaap Aarts | Jan Mercl <0xjnml@gmail.com> | Josh Bleecher Snyder | Josh Klein | Kim | Logan Snow | Mario Salgado | Mark Summerfield | Matthew Gabeler-Lee | Michael Hoffmann | Michael Rykov | Morgan Bazalgette | Prathyush PV | Romain Le Disez | Ross Light | Saed SayedAhmed | Sean McGivern | Steffen Butzer | Toni Spets | W. Michael Petullo | Yaacov Akiba Slama core,modernc.org/strutil,BSD-3-Clause,CZ.NIC z.s.p.o. | Copyright (c) 2014 The strutil Authors. All rights reserved | Jan Mercl <0xjnml@gmail.com> core,modernc.org/token,BSD-3-Clause,Copyright (c) 2009 The Go Authors. All rights reserved +core,rsc.io/binaryregexp,BSD-3-Clause,Copyright (c) 2009 The Go Authors. All rights reserved +core,rsc.io/binaryregexp/syntax,BSD-3-Clause,Copyright (c) 2009 The Go Authors. All rights reserved core,sigs.k8s.io/apiserver-network-proxy/konnectivity-client/pkg/client,Apache-2.0,Copyright 2017 The Kubernetes Authors. core,sigs.k8s.io/apiserver-network-proxy/konnectivity-client/pkg/client/metrics,Apache-2.0,Copyright 2017 The Kubernetes Authors. core,sigs.k8s.io/apiserver-network-proxy/konnectivity-client/pkg/common/metrics,Apache-2.0,Copyright 2017 The Kubernetes Authors. diff --git a/chocolatey/datadog-agent-online.nuspec b/chocolatey/datadog-agent/datadog-agent.nuspec similarity index 94% rename from chocolatey/datadog-agent-online.nuspec rename to chocolatey/datadog-agent/datadog-agent.nuspec index d3cf3133a1a98..f3d9ec86ca694 100644 --- a/chocolatey/datadog-agent-online.nuspec +++ b/chocolatey/datadog-agent/datadog-agent.nuspec @@ -1,4 +1,4 @@ - + datadog-agent @@ -26,6 +26,6 @@ For example, to set the API key you may run: $release_notes$ - + diff --git a/chocolatey/tools-offline/VERIFICATION.txt b/chocolatey/datadog-agent/tools/VERIFICATION.txt similarity index 100% rename from chocolatey/tools-offline/VERIFICATION.txt rename to chocolatey/datadog-agent/tools/VERIFICATION.txt diff --git a/chocolatey/tools-online/chocolateyinstall.ps1 b/chocolatey/datadog-agent/tools/chocolateyinstall.ps1 similarity index 100% rename from chocolatey/tools-online/chocolateyinstall.ps1 rename to chocolatey/datadog-agent/tools/chocolateyinstall.ps1 diff --git a/chocolatey/datadog-agent-offline.nuspec b/chocolatey/datadog-fips-agent/datadog-fips-agent.nuspec similarity index 70% rename from chocolatey/datadog-agent-offline.nuspec rename to chocolatey/datadog-fips-agent/datadog-fips-agent.nuspec index d049625a0ef3b..90b6de924c628 100644 --- a/chocolatey/datadog-agent-offline.nuspec +++ b/chocolatey/datadog-fips-agent/datadog-fips-agent.nuspec @@ -1,11 +1,11 @@  - datadog-agent-offline - $package_version$ + datadog-fips-agent + $version$ https://github.com/DataDog/datadog-agent/tree/main/chocolatey Datadog - Datadog Agent Offline Install + Datadog FIPS Agent Datadog https://github.com/DataDog/datadog-agent https://datadog-prod.imgix.net/img/dd_logo_70x75.png @@ -14,18 +14,18 @@ true https://docs.datadoghq.com datadog agent monitoring admin - The Datadog Agent for Microsoft Windows - The Datadog Agent faithfully collects events and metrics and brings them to Datadog on your behalf so that you can do something useful with your monitoring and performance data. + The Datadog FIPS Agent for Microsoft Windows + The Datadog FIPS Agent faithfully collects events and metrics and brings them to Datadog on your behalf so that you can do something useful with your monitoring and performance data. ## Package settings You may set [custom settings](https://docs.datadoghq.com/agent/basic_agent_usage/windows/?tab=commandline#installation) to the Agent when installing by using the [`--installer-arguments` option of `choco install`](https://chocolatey.org/docs/getting-started#overriding-default-install-directory-or-other-advanced-install-concepts). For example, to set the API key you may run: -`choco install -ia="APIKEY=""YOUR_DATADOG_API_KEY""" datadog-agent-offline` +`choco install -ia="APIKEY=""YOUR_DATADOG_API_KEY""" datadog-fips-agent` $release_notes$ - + diff --git a/chocolatey/tools-online/VERIFICATION.txt b/chocolatey/datadog-fips-agent/tools/VERIFICATION.txt similarity index 94% rename from chocolatey/tools-online/VERIFICATION.txt rename to chocolatey/datadog-fips-agent/tools/VERIFICATION.txt index 5ef7f466e2cd6..b13ab096f9a76 100644 --- a/chocolatey/tools-online/VERIFICATION.txt +++ b/chocolatey/datadog-fips-agent/tools/VERIFICATION.txt @@ -2,4 +2,4 @@ VERIFICATION Verification is intended to assist the Chocolatey moderators and community in verifying that this package's contents are trustworthy. This package is published by Datadog itself. -The binaries are identical to other package types for the Datadog Agent. +The binaries are identical to other package types for the Datadog FIPS Agent. diff --git a/chocolatey/tools-offline/chocolateyinstall.ps1 b/chocolatey/datadog-fips-agent/tools/chocolateyinstall.ps1 similarity index 62% rename from chocolatey/tools-offline/chocolateyinstall.ps1 rename to chocolatey/datadog-fips-agent/tools/chocolateyinstall.ps1 index 98d39c92654e0..d928fdf7bff78 100644 --- a/chocolatey/tools-offline/chocolateyinstall.ps1 +++ b/chocolatey/datadog-fips-agent/tools/chocolateyinstall.ps1 @@ -1,28 +1,26 @@ -$ErrorActionPreference = 'Stop'; +$ErrorActionPreference = 'Stop'; $toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)" -$nupkgs = Get-ChildItem $toolsDir\datadog-agent*.msi -if (($nupkgs | Measure-Object).Count -gt 1) { - Write-Host "More than 1 MSI installer exists - aborting" - exit -2 -} $packageArgs = @{ packageName = $env:ChocolateyPackageName unzipLocation = $toolsDir fileType = 'msi' - file = $nupkgs[0].FullName - softwareName = 'Datadog Agent' + # Note: Url is replaced at build time with the full URL to the MSI + url64bit = $__url_from_ci__ + checksum64 = $__checksum_from_ci__ + checksumType = 'sha256' + softwareName = "Datadog FIPS Agent" silentArgs = "/qn /norestart /l*v `"$($env:TEMP)\$($packageName).$($env:chocolateyPackageVersion).MsiInstall.log`"" validExitCodes= @(0, 3010, 1641) } -Install-ChocolateyInstallPackage @packageArgs +Install-ChocolateyPackage @packageArgs $installInfo = @" --- install_method: tool: chocolatey tool_version: chocolatey-$($env:CHOCOLATEY_VERSION) - installer_version: chocolatey_package-offline + installer_version: chocolatey_package-online "@ $appDataDir = (Get-ItemProperty -Path "HKLM:\SOFTWARE\Datadog\Datadog Agent").ConfigRoot diff --git a/cmd/agent/common/autodiscovery.go b/cmd/agent/common/autodiscovery.go index 8ff855aeca19f..67a220b706750 100644 --- a/cmd/agent/common/autodiscovery.go +++ b/cmd/agent/common/autodiscovery.go @@ -9,6 +9,7 @@ import ( "context" "errors" "fmt" + "path/filepath" "time" "go.uber.org/atomic" @@ -41,6 +42,10 @@ var ( ) func setupAutoDiscovery(confSearchPaths []string, wmeta workloadmeta.Component, ac autodiscovery.Component) { + if pkgconfigsetup.Datadog().GetString("fleet_policies_dir") != "" { + confSearchPaths = append(confSearchPaths, filepath.Join(pkgconfigsetup.Datadog().GetString("fleet_policies_dir"), "conf.d")) + } + providers.InitConfigFilesReader(confSearchPaths) acTelemetryStore := ac.GetTelemetryStore() diff --git a/cmd/agent/common/common_windows.go b/cmd/agent/common/common_windows.go index 852d4d77d5ccd..b3c84d6c66035 100644 --- a/cmd/agent/common/common_windows.go +++ b/cmd/agent/common/common_windows.go @@ -14,8 +14,6 @@ import ( "github.com/DataDog/datadog-agent/pkg/util/log" "github.com/DataDog/datadog-agent/pkg/util/winutil" "github.com/DataDog/datadog-agent/pkg/util/winutil/messagestrings" - - "github.com/cihub/seelog" ) // ServiceName is the name of the Windows Service the agent runs as @@ -28,18 +26,6 @@ func init() { } } -// EnableLoggingToFile -- set up logging to file -func EnableLoggingToFile() { - seeConfig := ` - - - - -` - logger, _ := seelog.LoggerFromConfigAsBytes([]byte(seeConfig)) - log.ReplaceLogger(logger) -} - // CheckAndUpgradeConfig checks to see if there's an old datadog.conf, and if // datadog.yaml is either missing or incomplete (no API key). If so, upgrade it func CheckAndUpgradeConfig() error { diff --git a/cmd/agent/dist/conf.d/cpu.d/conf.yaml.default b/cmd/agent/dist/conf.d/cpu.d/conf.yaml.default index 00d9a2dbba2c8..c338654dc4e71 100644 --- a/cmd/agent/dist/conf.d/cpu.d/conf.yaml.default +++ b/cmd/agent/dist/conf.d/cpu.d/conf.yaml.default @@ -1,2 +1,15 @@ +## This file is overwritten upon Agent upgrade. +## To make modifications to the check configuration, copy this file +## to `cpu.yaml` and make your changes on that file. + +init_config: + +## The Cpu check only supports one configured instance. + instances: - - {} + - + + ## @param report_total_percpu - boolean - required + ## Set to true to report cpu total metrics for each cpu. + # + # report_total_percpu: false diff --git a/cmd/agent/launcher/launcher.c b/cmd/agent/launcher/launcher.c new file mode 100644 index 0000000000000..0be5b6ca184e3 --- /dev/null +++ b/cmd/agent/launcher/launcher.c @@ -0,0 +1,32 @@ +#include +#include +#include +#include + +#ifndef DD_AGENT_PATH +#error DD_AGENT_PATH must be defined +#endif + +#ifndef DD_AGENT +#define DD_AGENT "agent" +#endif + +int main(int argc, char **argv) { + if (argc > 1) { + argv[0] = DD_AGENT; + } else { + argv = malloc(sizeof(char *) * 2); + argv[0] = DD_AGENT; + argv[1] = NULL; + } + + if (strlen(DD_AGENT_PATH) == 0) { + fprintf(stderr, "Cannot determine agent location\n"); + exit(1); + } + + setenv("DD_BUNDLED_AGENT", DD_AGENT, 0); + + execvp(DD_AGENT_PATH, argv); + return 1; +} diff --git a/cmd/agent/main.go b/cmd/agent/main.go index f2b5343e787ba..5a8c90176bee5 100644 --- a/cmd/agent/main.go +++ b/cmd/agent/main.go @@ -9,13 +9,62 @@ package main import ( + "fmt" "os" + "path" + "strings" "github.com/DataDog/datadog-agent/cmd/agent/command" "github.com/DataDog/datadog-agent/cmd/agent/subcommands" "github.com/DataDog/datadog-agent/cmd/internal/runcmd" + "github.com/spf13/cobra" ) +var agents = map[string]func() *cobra.Command{} + +func registerAgent(names []string, getCommand func() *cobra.Command) { + for _, name := range names { + agents[name] = getCommand + } +} + +func coreAgentMain() *cobra.Command { + return command.MakeCommand(subcommands.AgentSubcommands()) +} + +func init() { + registerAgent([]string{"agent", "datadog-agent", "dd-agent"}, coreAgentMain) +} + func main() { - os.Exit(runcmd.Run(command.MakeCommand(subcommands.AgentSubcommands()))) + process := strings.TrimSpace(os.Getenv("DD_BUNDLED_AGENT")) + + if process == "" { + if len(os.Args) > 0 { + process = strings.TrimSpace(path.Base(os.Args[0])) + } + + if process == "" { + executable, err := os.Executable() + if err != nil { + fmt.Fprintf(os.Stderr, "Failed to determine the Agent process name: %s\n", err.Error()) + os.Exit(1) + } + process = executable + } + + process = strings.TrimSuffix(process, path.Ext(process)) + } + + agentCmdBuilder := agents[process] + if agentCmdBuilder == nil { + fmt.Fprintf(os.Stderr, "Invoked as '%s', acting as main Agent.\n", process) + agentCmdBuilder = coreAgentMain + } + + rootCmd := agentCmdBuilder() + if err := setProcessName(process); err != nil { + fmt.Fprintf(os.Stderr, "Failed to set process name as '%s': %s\n", process, err) + } + os.Exit(runcmd.Run(rootCmd)) } diff --git a/pkg/util/cloudproviders/gce/gce_no_tags.go b/cmd/agent/main_common.go similarity index 58% rename from pkg/util/cloudproviders/gce/gce_no_tags.go rename to cmd/agent/main_common.go index 270cf77ce59ce..2159c28f80cbf 100644 --- a/pkg/util/cloudproviders/gce/gce_no_tags.go +++ b/cmd/agent/main_common.go @@ -3,15 +3,11 @@ // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2016-present Datadog, Inc. -//go:build !gce +//go:build !linux -package gce +package main -import "context" - -// GetTags gets the tags from the GCE api -func GetTags(_ context.Context) ([]string, error) { - tags := []string{} - - return tags, nil +// nolint: deadcode, unused +func setProcessName(_ string) error { + return nil } diff --git a/cmd/agent/main_linux_cgo.go b/cmd/agent/main_linux_cgo.go new file mode 100644 index 0000000000000..421565bf6d0c1 --- /dev/null +++ b/cmd/agent/main_linux_cgo.go @@ -0,0 +1,42 @@ +// 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 && cgo + +package main + +/* +#include +#include +#include + +int prctl_err = 0; + +int set_process_name () __attribute__((constructor)); + +int set_process_name() +{ + const char *name = getenv("DD_BUNDLED_AGENT"); + if (name != NULL) { + int ret = prctl(PR_SET_NAME, name, 0, 0); + if (!ret) { + prctl_err = errno; + } + return ret; + } + return 0; +} +*/ +import ( + "C" +) +import "syscall" + +func setProcessName(_ string) error { + if C.prctl_err == 0 { + return nil + } + return syscall.Errno(C.prctl_err) +} diff --git a/cmd/agent/main_linux_no_cgo.go b/cmd/agent/main_linux_no_cgo.go new file mode 100644 index 0000000000000..5259fc616d3d0 --- /dev/null +++ b/cmd/agent/main_linux_no_cgo.go @@ -0,0 +1,22 @@ +// 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 && !cgo + +package main + +import ( + "syscall" + "unsafe" + + "golang.org/x/sys/unix" +) + +func setProcessName(process string) error { + processName := make([]byte, len(process)+1) + copy(processName, process) + _, _, err := syscall.AllThreadsSyscall(unix.SYS_PRCTL, unix.PR_SET_NAME, uintptr(unsafe.Pointer(&processName[0])), 0) + return err +} diff --git a/cmd/agent/main_windows.go b/cmd/agent/main_windows.go index bf4fc6e032a3f..389d880cf50da 100644 --- a/cmd/agent/main_windows.go +++ b/cmd/agent/main_windows.go @@ -11,7 +11,6 @@ import ( "os" "github.com/DataDog/datadog-agent/cmd/agent/command" - "github.com/DataDog/datadog-agent/cmd/agent/common" "github.com/DataDog/datadog-agent/cmd/agent/subcommands" "github.com/DataDog/datadog-agent/cmd/agent/windows/service" "github.com/DataDog/datadog-agent/cmd/internal/runcmd" @@ -20,7 +19,6 @@ import ( ) func main() { - common.EnableLoggingToFile() // if command line arguments are supplied, even in a non interactive session, // then just execute that. Used when the service is executing the executable, // for instance to trigger a restart. diff --git a/cmd/agent/process_agent.go b/cmd/agent/process_agent.go new file mode 100644 index 0000000000000..e9cf9867eeacb --- /dev/null +++ b/cmd/agent/process_agent.go @@ -0,0 +1,26 @@ +// 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 && bundle_process_agent + +// Main package for the agent binary +package main + +import ( + "os" + + processcommand "github.com/DataDog/datadog-agent/cmd/process-agent/command" + processsubcommands "github.com/DataDog/datadog-agent/cmd/process-agent/subcommands" + "github.com/DataDog/datadog-agent/pkg/util/flavor" + "github.com/spf13/cobra" +) + +func init() { + registerAgent([]string{"process-agent"}, func() *cobra.Command { + flavor.SetFlavor(flavor.ProcessAgent) + os.Args = processcommand.FixDeprecatedFlags(os.Args, os.Stdout) + return processcommand.MakeCommand(processsubcommands.ProcessAgentSubcommands(), processcommand.UseWinParams, processcommand.RootCmdRun) + }) +} diff --git a/cmd/agent/security_agent.go b/cmd/agent/security_agent.go new file mode 100644 index 0000000000000..134f04647b3d5 --- /dev/null +++ b/cmd/agent/security_agent.go @@ -0,0 +1,23 @@ +// 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 && bundle_security_agent + +// Main package for the agent binary +package main + +import ( + seccommand "github.com/DataDog/datadog-agent/cmd/security-agent/command" + secsubcommands "github.com/DataDog/datadog-agent/cmd/security-agent/subcommands" + "github.com/DataDog/datadog-agent/pkg/util/flavor" + "github.com/spf13/cobra" +) + +func init() { + registerAgent([]string{"security-agent"}, func() *cobra.Command { + flavor.SetFlavor(flavor.SecurityAgent) + return seccommand.MakeCommand(secsubcommands.SecurityAgentSubcommands()) + }) +} diff --git a/cmd/agent/subcommands/analyzelogs/command.go b/cmd/agent/subcommands/analyzelogs/command.go new file mode 100644 index 0000000000000..e8a63dc87e080 --- /dev/null +++ b/cmd/agent/subcommands/analyzelogs/command.go @@ -0,0 +1,141 @@ +// 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 analyzelogs implements 'agent analyze-logs'. +package analyzelogs + +import ( + "encoding/json" + "fmt" + "os" + "time" + + "go.uber.org/fx" + + "github.com/spf13/cobra" + + "github.com/DataDog/datadog-agent/cmd/agent/command" + "github.com/DataDog/datadog-agent/comp/core" + "github.com/DataDog/datadog-agent/comp/core/autodiscovery/integration" + "github.com/DataDog/datadog-agent/comp/core/autodiscovery/providers/names" + "github.com/DataDog/datadog-agent/comp/core/config" + "github.com/DataDog/datadog-agent/comp/logs/agent/agentimpl" + "github.com/DataDog/datadog-agent/pkg/logs/launchers" + "github.com/DataDog/datadog-agent/pkg/logs/message" + "github.com/DataDog/datadog-agent/pkg/logs/pipeline" + "github.com/DataDog/datadog-agent/pkg/logs/processor" + "github.com/DataDog/datadog-agent/pkg/logs/schedulers/ad" + "github.com/DataDog/datadog-agent/pkg/logs/sources" + "github.com/DataDog/datadog-agent/pkg/util/fxutil" +) + +const defaultCoreConfigPath = "bin/agent/dist/datadog.yaml" + +// CliParams holds the command-line argument and dependencies for the analyze-logs subcommand. +type CliParams struct { + *command.GlobalParams + + // LogConfigPath represents the path to the logs configuration file. + LogConfigPath string + + // CoreConfigPath represents the path to the core configuration file. + CoreConfigPath string +} + +// Commands returns a slice of subcommands for the 'agent' command. +func Commands(globalParams *command.GlobalParams) []*cobra.Command { + cliParams := &CliParams{ + GlobalParams: globalParams, + CoreConfigPath: defaultCoreConfigPath, // Set default path + } + + cmd := &cobra.Command{ + Use: "analyze-logs", + Short: "Analyze logs configuration in isolation", + Long: `Run a Datadog agent logs configuration and print the results to stdout`, + RunE: func(_ *cobra.Command, args []string) error { + if len(args) < 1 { + return fmt.Errorf("log config file path is required") + } + cliParams.LogConfigPath = args[0] + return fxutil.OneShot(runAnalyzeLogs, + core.Bundle(), + fx.Supply(cliParams), + fx.Supply(command.GetDefaultCoreBundleParams(cliParams.GlobalParams)), + ) + }, + } + + // Add flag for core config (optional) + cmd.Flags().StringVarP(&cliParams.CoreConfigPath, "core-config", "C", defaultCoreConfigPath, "Path to the core configuration file (optional)") + + return []*cobra.Command{cmd} +} + +// runAnalyzeLogs initializes the launcher and sends the log config file path to the source provider. +func runAnalyzeLogs(cliParams *CliParams, config config.Component) error { + outputChan, launchers, pipelineProvider := runAnalyzeLogsHelper(cliParams, config) + // Set up an inactivity timeout + inactivityTimeout := 1 * time.Second + idleTimer := time.NewTimer(inactivityTimeout) + + for { + select { + case msg := <-outputChan: + parsedMessage := processor.JSONPayload + err := json.Unmarshal(msg.GetContent(), &parsedMessage) + if err != nil { + fmt.Printf("Failed to parse message: %v\n", err) + continue + } + + fmt.Println(parsedMessage.Message) + + // Reset the inactivity timer every time a message is processed + if !idleTimer.Stop() { + <-idleTimer.C + } + idleTimer.Reset(inactivityTimeout) + case <-idleTimer.C: + // Timeout reached, signal quit + pipelineProvider.Stop() + launchers.Stop() + return nil + } + } +} + +// Used to make testing easier +func runAnalyzeLogsHelper(cliParams *CliParams, config config.Component) (chan *message.Message, *launchers.Launchers, pipeline.Provider) { + configSource := sources.NewConfigSources() + wd, err := os.Getwd() + if err != nil { + fmt.Println("Cannot get working directory") + return nil, nil, nil + } + absolutePath := wd + "/" + cliParams.LogConfigPath + data, err := os.ReadFile(absolutePath) + if err != nil { + fmt.Println("Cannot read file path of logs config") + return nil, nil, nil + } + sources, err := ad.CreateSources(integration.Config{ + Provider: names.File, + LogsConfig: data, + }) + + if err != nil { + fmt.Println("Cannot create source") + return nil, nil, nil + } + + for _, source := range sources { + if source.Config.TailingMode == "" { + source.Config.TailingMode = "beginning" + } + configSource.AddSource(source) + } + return agentimpl.SetUpLaunchers(config, configSource) +} diff --git a/cmd/agent/subcommands/analyzelogs/command_test.go b/cmd/agent/subcommands/analyzelogs/command_test.go new file mode 100644 index 0000000000000..0f326ee8bbf4f --- /dev/null +++ b/cmd/agent/subcommands/analyzelogs/command_test.go @@ -0,0 +1,143 @@ +// 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 analyzelogs + +import ( + "encoding/json" + "fmt" + "os" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/DataDog/datadog-agent/cmd/agent/command" + "github.com/DataDog/datadog-agent/comp/core" + "github.com/DataDog/datadog-agent/comp/core/config" + "github.com/DataDog/datadog-agent/pkg/logs/processor" + "github.com/DataDog/datadog-agent/pkg/util/fxutil" +) + +func TestCommand(t *testing.T) { + fxutil.TestOneShotSubcommand(t, + Commands(&command.GlobalParams{}), + []string{"analyze-logs", "path/to/log/config.yaml"}, + runAnalyzeLogs, + func(_ core.BundleParams, cliParams *CliParams) { + require.Equal(t, "path/to/log/config.yaml", cliParams.LogConfigPath) + require.Equal(t, defaultCoreConfigPath, cliParams.CoreConfigPath) + }) +} + +func CreateTestFile(tempDir string, fileName string, fileContent string) *os.File { + if _, err := os.Stat(tempDir); os.IsNotExist(err) { + err = os.MkdirAll(tempDir, 0755) + if err != nil { + return nil + } + } + + filePath := fmt.Sprintf("%s/%s", tempDir, fileName) + + tempFile, err := os.Create(filePath) + if err != nil { + return nil + } + + _, err = tempFile.Write([]byte(fileContent)) + if err != nil { + tempFile.Close() // Close file before returning + return nil + } + + tempFile.Close() + + file, err := os.Open(filePath) + if err != nil { + return nil + } + return file +} + +func TestRunAnalyzeLogs(t *testing.T) { + tempDir := "tmp" + defer os.RemoveAll(tempDir) + + // Write config content to the temp file + logConfig := `=== apm check === +Configuration provider: file +Configuration source: file:/opt/datadog-agent/etc/conf.d/apm.yaml.default +Config for instance ID: apm:1234567890abcdef +{} + +=== container_image check === +Configuration provider: file +Configuration source: file:/opt/datadog-agent/etc/conf.d/container_image.d/conf.yaml.default +Config for instance ID: container_image:abcdef1234567890 +{} +~ +Auto-discovery IDs: +* _container_image +=== +` + // Create a temporary config file + tempLogFile := CreateTestFile(tempDir, "wack.log", logConfig) + assert.NotNil(t, tempLogFile) + defer os.Remove(tempLogFile.Name()) // Cleanup the temp file after the test + + yamlContent := fmt.Sprintf(`logs: + - type: file + path: %s + log_processing_rules: + - type: exclude_at_match + name: exclude_random + pattern: "datadog-agent" + +`, tempLogFile.Name()) + tempConfigFile := CreateTestFile(tempDir, "config.yaml", yamlContent) + assert.NotNil(t, tempConfigFile) + + defer os.Remove(tempConfigFile.Name()) + // Write config content to the temp file + + // Create a mock config + config := config.NewMock(t) + + // Set CLI params + cliParams := &CliParams{ + LogConfigPath: tempConfigFile.Name(), + CoreConfigPath: tempConfigFile.Name(), + } + + outputChan, launcher, pipelineProvider := runAnalyzeLogsHelper(cliParams, config) + + expectedOutput := []string{ + "=== apm check ===", + "Configuration provider: file", + "Config for instance ID: apm:1234567890abcdef", + "{}", + "=== container_image check ===", + "Configuration provider: file", + "Config for instance ID: container_image:abcdef1234567890", + "{}", + "~", + "Auto-discovery IDs:", + "* _container_image", + "===", + } + + for i := 0; i < len(expectedOutput); i++ { + msg := <-outputChan + parsedMessage := processor.JSONPayload + err := json.Unmarshal(msg.GetContent(), &parsedMessage) + assert.NoError(t, err) + + assert.Equal(t, parsedMessage.Message, expectedOutput[i]) + } + + launcher.Stop() + pipelineProvider.Stop() +} diff --git a/cmd/agent/subcommands/flare/command.go b/cmd/agent/subcommands/flare/command.go index 1b4fb2d3bc1e3..a6da5391ae5d5 100644 --- a/cmd/agent/subcommands/flare/command.go +++ b/cmd/agent/subcommands/flare/command.go @@ -175,10 +175,18 @@ func readProfileData(seconds int) (flare.ProfileData, error) { type pprofGetter func(path string) ([]byte, error) - tcpGet := func(portConfig string) pprofGetter { - pprofURL := fmt.Sprintf("http://127.0.0.1:%d/debug/pprof", pkgconfigsetup.Datadog().GetInt(portConfig)) + tcpGet := func(portConfig string, onHTTPS bool) pprofGetter { + endpoint := url.URL{ + Scheme: "http", + Host: net.JoinHostPort("127.0.0.1", strconv.Itoa(pkgconfigsetup.Datadog().GetInt(portConfig))), + Path: "/debug/pprof", + } + if onHTTPS { + endpoint.Scheme = "https" + } + return func(path string) ([]byte, error) { - return util.DoGet(c, pprofURL+path, util.LeaveConnectionOpen) + return util.DoGet(c, endpoint.String()+path, util.LeaveConnectionOpen) } } @@ -228,15 +236,15 @@ func readProfileData(seconds int) (flare.ProfileData, error) { } agentCollectors := map[string]agentProfileCollector{ - "core": serviceProfileCollector(tcpGet("expvar_port"), seconds), - "security-agent": serviceProfileCollector(tcpGet("security_agent.expvar_port"), seconds), + "core": serviceProfileCollector(tcpGet("expvar_port", false), seconds), + "security-agent": serviceProfileCollector(tcpGet("security_agent.expvar_port", false), seconds), } if pkgconfigsetup.Datadog().GetBool("process_config.enabled") || pkgconfigsetup.Datadog().GetBool("process_config.container_collection.enabled") || pkgconfigsetup.Datadog().GetBool("process_config.process_collection.enabled") { - agentCollectors["process"] = serviceProfileCollector(tcpGet("process_config.expvar_port"), seconds) + agentCollectors["process"] = serviceProfileCollector(tcpGet("process_config.expvar_port", false), seconds) } if pkgconfigsetup.Datadog().GetBool("apm_config.enabled") { @@ -249,7 +257,7 @@ func readProfileData(seconds int) (flare.ProfileData, error) { traceCpusec = 4 } - agentCollectors["trace"] = serviceProfileCollector(tcpGet("apm_config.debug.port"), traceCpusec) + agentCollectors["trace"] = serviceProfileCollector(tcpGet("apm_config.debug.port", true), traceCpusec) } if pkgconfigsetup.SystemProbe().GetBool("system_probe_config.enabled") { diff --git a/cmd/agent/subcommands/flare/command_test.go b/cmd/agent/subcommands/flare/command_test.go index a27304e95b133..4c96cae079aa9 100644 --- a/cmd/agent/subcommands/flare/command_test.go +++ b/cmd/agent/subcommands/flare/command_test.go @@ -29,6 +29,7 @@ type commandTestSuite struct { suite.Suite sysprobeSocketPath string tcpServer *httptest.Server + tcpTLSServer *httptest.Server unixServer *httptest.Server systemProbeServer *httptest.Server } @@ -42,13 +43,17 @@ func (c *commandTestSuite) SetupSuite() { // This should be called by each test that requires them. func (c *commandTestSuite) startTestServers() { t := c.T() - c.tcpServer, c.unixServer, c.systemProbeServer = c.getPprofTestServer() + c.tcpServer, c.tcpTLSServer, c.unixServer, c.systemProbeServer = c.getPprofTestServer() t.Cleanup(func() { if c.tcpServer != nil { c.tcpServer.Close() c.tcpServer = nil } + if c.tcpTLSServer != nil { + c.tcpTLSServer.Close() + c.tcpTLSServer = nil + } if c.unixServer != nil { c.unixServer.Close() c.unixServer = nil @@ -82,12 +87,13 @@ func newMockHandler() http.HandlerFunc { }) } -func (c *commandTestSuite) getPprofTestServer() (tcpServer *httptest.Server, unixServer *httptest.Server, sysProbeServer *httptest.Server) { +func (c *commandTestSuite) getPprofTestServer() (tcpServer *httptest.Server, tcpTLSServer *httptest.Server, unixServer *httptest.Server, sysProbeServer *httptest.Server) { var err error t := c.T() handler := newMockHandler() tcpServer = httptest.NewServer(handler) + tcpTLSServer = httptest.NewTLSServer(handler) if runtime.GOOS == "linux" { unixServer = httptest.NewUnstartedServer(handler) unixServer.Listener, err = net.Listen("unix", c.sysprobeSocketPath) @@ -101,7 +107,7 @@ func (c *commandTestSuite) getPprofTestServer() (tcpServer *httptest.Server, uni sysProbeServer.Start() } - return tcpServer, unixServer, sysProbeServer + return tcpServer, tcpTLSServer, unixServer, sysProbeServer } func TestCommandTestSuite(t *testing.T) { @@ -116,10 +122,14 @@ func (c *commandTestSuite) TestReadProfileData() { require.NoError(t, err) port := u.Port() + u, err = url.Parse(c.tcpTLSServer.URL) + require.NoError(t, err) + httpsPort := u.Port() + mockConfig := configmock.New(t) mockConfig.SetWithoutSource("expvar_port", port) mockConfig.SetWithoutSource("apm_config.enabled", true) - mockConfig.SetWithoutSource("apm_config.debug.port", port) + mockConfig.SetWithoutSource("apm_config.debug.port", httpsPort) mockConfig.SetWithoutSource("apm_config.receiver_timeout", "10") mockConfig.SetWithoutSource("process_config.expvar_port", port) mockConfig.SetWithoutSource("security_agent.expvar_port", port) diff --git a/cmd/agent/subcommands/run/command.go b/cmd/agent/subcommands/run/command.go index 9c126f014aab2..76775693251e4 100644 --- a/cmd/agent/subcommands/run/command.go +++ b/cmd/agent/subcommands/run/command.go @@ -146,8 +146,8 @@ import ( jmxStatus "github.com/DataDog/datadog-agent/pkg/status/jmx" systemprobeStatus "github.com/DataDog/datadog-agent/pkg/status/systemprobe" pkgTelemetry "github.com/DataDog/datadog-agent/pkg/telemetry" - "github.com/DataDog/datadog-agent/pkg/util" pkgcommon "github.com/DataDog/datadog-agent/pkg/util/common" + "github.com/DataDog/datadog-agent/pkg/util/coredump" "github.com/DataDog/datadog-agent/pkg/util/defaultpaths" "github.com/DataDog/datadog-agent/pkg/util/flavor" "github.com/DataDog/datadog-agent/pkg/util/fxutil" @@ -512,7 +512,7 @@ func startAgent( log.Infof("Starting Datadog Agent v%v", version.AgentVersion) } - if err := util.SetupCoreDump(pkgconfigsetup.Datadog()); err != nil { + if err := coredump.Setup(pkgconfigsetup.Datadog()); err != nil { log.Warnf("Can't setup core dumps: %v, core dumps might not be available after a crash", err) } diff --git a/cmd/agent/subcommands/run/command_windows.go b/cmd/agent/subcommands/run/command_windows.go index f3a4ce2414e1a..8504227a81433 100644 --- a/cmd/agent/subcommands/run/command_windows.go +++ b/cmd/agent/subcommands/run/command_windows.go @@ -76,6 +76,7 @@ import ( "github.com/DataDog/datadog-agent/pkg/util/defaultpaths" "github.com/DataDog/datadog-agent/pkg/util/fxutil" "github.com/DataDog/datadog-agent/pkg/util/optional" + "github.com/DataDog/datadog-agent/pkg/util/winutil" // runtime init routines ) @@ -206,6 +207,28 @@ func StartAgentWithDefaults(ctxChan <-chan context.Context) (<-chan error, error return errChan, nil } +// Re-register the ctrl handler because Go uses SetConsoleCtrlHandler and Python uses posix signal calls. +// This is only needed when using the embedded Python module. +// When Python imports the signal module, it overrides the ctrl handler set by Go and installs the Windows posix signal handler. +// Linux uses the POSIX signal handler for both Go and Python, so this is not an issue on Linux. +// As Python checks if the signal handler is not the default handler before overwritting it. +// If CPython adds a way to avoid overriding the ctrl handler, we can remove this workaround. +// If Go adds support to use the posix signal handler on Windows, we can remove this workaround. +// All calls to signal.Notify will no longer work after the Python module is started. +func reRegisterCtrlHandler(log log.Component, _ collector.Component) { + log.Info("Re-registering Ctrl+C handler") + err := winutil.SetConsoleCtrlHandler(func(ctrlType uint32) bool { + switch ctrlType { + case winutil.CtrlCEvent, winutil.CtrlBreakEvent: + signals.Stopper <- true + } + return true + }, true) + if err != nil { + log.Error(err) + } +} + func getPlatformModules() fx.Option { return fx.Options( agentcrashdetectimpl.Module(), @@ -222,5 +245,6 @@ func getPlatformModules() fx.Option { fx.Invoke(func(_ etwtracer.Component) {}), fx.Invoke(func(_ windowseventlog.Component) {}), fx.Invoke(func(_ winregistry.Component) {}), + fx.Invoke(reRegisterCtrlHandler), ) } diff --git a/cmd/agent/subcommands/run/internal/clcrunnerapi/clc_runner_server.go b/cmd/agent/subcommands/run/internal/clcrunnerapi/clc_runner_server.go index 9b763d3a8b1df..7554f755a2d1b 100644 --- a/cmd/agent/subcommands/run/internal/clcrunnerapi/clc_runner_server.go +++ b/cmd/agent/subcommands/run/internal/clcrunnerapi/clc_runner_server.go @@ -19,7 +19,6 @@ import ( "net/http" "time" - "github.com/cihub/seelog" "github.com/gorilla/mux" v1 "github.com/DataDog/datadog-agent/cmd/agent/subcommands/run/internal/clcrunnerapi/v1" @@ -27,6 +26,7 @@ import ( "github.com/DataDog/datadog-agent/pkg/api/security" "github.com/DataDog/datadog-agent/pkg/api/util" pkgconfigsetup "github.com/DataDog/datadog-agent/pkg/config/setup" + "github.com/DataDog/datadog-agent/pkg/util/log" pkglogsetup "github.com/DataDog/datadog-agent/pkg/util/log/setup" ) @@ -85,7 +85,7 @@ func StartCLCRunnerServer(extraHandlers map[string]http.Handler, ac autodiscover } // Use a stack depth of 4 on top of the default one to get a relevant filename in the stdlib - logWriter, _ := pkglogsetup.NewLogWriter(4, seelog.WarnLvl) + logWriter, _ := pkglogsetup.NewLogWriter(4, log.WarnLvl) srv := &http.Server{ Handler: r, diff --git a/cmd/agent/subcommands/secret/command.go b/cmd/agent/subcommands/secret/command.go index e24f95ca6d693..d8b2a7048114f 100644 --- a/cmd/agent/subcommands/secret/command.go +++ b/cmd/agent/subcommands/secret/command.go @@ -101,7 +101,7 @@ func traceAgentSecretRefresh(conf config.Component) ([]byte, error) { c := apiutil.GetClient(false) c.Timeout = conf.GetDuration("server_timeout") * time.Second - url := fmt.Sprintf("http://127.0.0.1:%d/secret/refresh", port) + url := fmt.Sprintf("https://127.0.0.1:%d/secret/refresh", port) res, err := apiutil.DoGet(c, url, apiutil.CloseConnection) if err != nil { return nil, fmt.Errorf("could not contact trace-agent: %s", err) diff --git a/cmd/agent/subcommands/subcommands.go b/cmd/agent/subcommands/subcommands.go index d9238caf6c0e3..939bdd2880f26 100644 --- a/cmd/agent/subcommands/subcommands.go +++ b/cmd/agent/subcommands/subcommands.go @@ -8,6 +8,7 @@ package subcommands import ( "github.com/DataDog/datadog-agent/cmd/agent/command" + cmdanalyzelogs "github.com/DataDog/datadog-agent/cmd/agent/subcommands/analyzelogs" cmdcheck "github.com/DataDog/datadog-agent/cmd/agent/subcommands/check" cmdconfig "github.com/DataDog/datadog-agent/cmd/agent/subcommands/config" cmdconfigcheck "github.com/DataDog/datadog-agent/cmd/agent/subcommands/configcheck" @@ -56,6 +57,7 @@ func AgentSubcommands() []command.SubcommandFactory { cmdhostname.Commands, cmdimport.Commands, cmdlaunchgui.Commands, + cmdanalyzelogs.Commands, cmdremoteconfig.Commands, cmdrun.Commands, cmdsecret.Commands, diff --git a/cmd/agent/system_probe.go b/cmd/agent/system_probe.go new file mode 100644 index 0000000000000..4248bf5a7286c --- /dev/null +++ b/cmd/agent/system_probe.go @@ -0,0 +1,23 @@ +// 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 && bundle_system_probe + +// Main package for the agent binary +package main + +import ( + sysprobecommand "github.com/DataDog/datadog-agent/cmd/system-probe/command" + sysprobesubcommands "github.com/DataDog/datadog-agent/cmd/system-probe/subcommands" + "github.com/spf13/cobra" +) + +func init() { + registerAgent([]string{"system-probe"}, func() *cobra.Command { + rootCmd := sysprobecommand.MakeCommand(sysprobesubcommands.SysprobeSubcommands()) + sysprobecommand.SetDefaultCommandIfNonePresent(rootCmd) + return rootCmd + }) +} diff --git a/cmd/agent/trace_agent.go b/cmd/agent/trace_agent.go new file mode 100644 index 0000000000000..2ac852e6e2b5f --- /dev/null +++ b/cmd/agent/trace_agent.go @@ -0,0 +1,23 @@ +// 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 && bundle_trace_agent + +// Main package for the agent binary +package main + +import ( + "os" + + tracecommand "github.com/DataDog/datadog-agent/cmd/trace-agent/command" + "github.com/spf13/cobra" +) + +func init() { + registerAgent([]string{"trace-agent"}, func() *cobra.Command { + os.Args = tracecommand.FixDeprecatedFlags(os.Args, os.Stdout) + return tracecommand.MakeRootCommand() + }) +} diff --git a/cmd/cluster-agent/admission/server.go b/cmd/cluster-agent/admission/server.go index ea53230e19a35..86b237001037b 100644 --- a/cmd/cluster-agent/admission/server.go +++ b/cmd/cluster-agent/admission/server.go @@ -18,7 +18,6 @@ import ( "net/http" "time" - "github.com/cihub/seelog" admiv1 "k8s.io/api/admission/v1" admiv1beta1 "k8s.io/api/admission/v1beta1" admissionregistrationv1 "k8s.io/api/admissionregistration/v1" @@ -117,7 +116,7 @@ func (s *Server) Run(mainCtx context.Context, client kubernetes.Interface) error tlsMinVersion = tls.VersionTLS10 } - logWriter, _ := pkglogsetup.NewTLSHandshakeErrorWriter(4, seelog.WarnLvl) + logWriter, _ := pkglogsetup.NewTLSHandshakeErrorWriter(4, log.WarnLvl) server := &http.Server{ Addr: fmt.Sprintf(":%d", pkgconfigsetup.Datadog().GetInt("admission_controller.port")), Handler: s.mux, diff --git a/cmd/cluster-agent/api/server.go b/cmd/cluster-agent/api/server.go index 7b2c26fb1d8d5..c4f5c0534633a 100644 --- a/cmd/cluster-agent/api/server.go +++ b/cmd/cluster-agent/api/server.go @@ -12,6 +12,7 @@ package api import ( "context" + "crypto/subtle" "crypto/tls" "crypto/x509" "encoding/pem" @@ -25,7 +26,6 @@ import ( languagedetection "github.com/DataDog/datadog-agent/cmd/cluster-agent/api/v1/languagedetection" - "github.com/cihub/seelog" "github.com/gorilla/mux" grpc_auth "github.com/grpc-ecosystem/go-grpc-middleware/auth" "google.golang.org/grpc" @@ -44,6 +44,7 @@ import ( pkgconfigsetup "github.com/DataDog/datadog-agent/pkg/config/setup" pb "github.com/DataDog/datadog-agent/pkg/proto/pbgo/core" grpcutil "github.com/DataDog/datadog-agent/pkg/util/grpc" + "github.com/DataDog/datadog-agent/pkg/util/log" pkglogsetup "github.com/DataDog/datadog-agent/pkg/util/log/setup" ) @@ -113,10 +114,10 @@ func StartServer(ctx context.Context, w workloadmeta.Component, taggerComp tagge } // Use a stack depth of 4 on top of the default one to get a relevant filename in the stdlib - logWriter, _ := pkglogsetup.NewTLSHandshakeErrorWriter(4, seelog.WarnLvl) + logWriter, _ := pkglogsetup.NewTLSHandshakeErrorWriter(4, log.WarnLvl) authInterceptor := grpcutil.AuthInterceptor(func(token string) (interface{}, error) { - if token != util.GetDCAAuthToken() { + if subtle.ConstantTimeCompare([]byte(token), []byte(util.GetDCAAuthToken())) == 0 { return struct{}{}, errors.New("Invalid session token") } diff --git a/cmd/cluster-agent/subcommands/start/command.go b/cmd/cluster-agent/subcommands/start/command.go index f43ae03615401..80fe4a3b6d383 100644 --- a/cmd/cluster-agent/subcommands/start/command.go +++ b/cmd/cluster-agent/subcommands/start/command.go @@ -81,7 +81,7 @@ import ( hostnameStatus "github.com/DataDog/datadog-agent/pkg/status/clusteragent/hostname" endpointsStatus "github.com/DataDog/datadog-agent/pkg/status/endpoints" "github.com/DataDog/datadog-agent/pkg/status/health" - "github.com/DataDog/datadog-agent/pkg/util" + "github.com/DataDog/datadog-agent/pkg/util/coredump" "github.com/DataDog/datadog-agent/pkg/util/fxutil" "github.com/DataDog/datadog-agent/pkg/util/hostname" "github.com/DataDog/datadog-agent/pkg/util/kubernetes/apiserver" @@ -241,7 +241,7 @@ func start(log log.Component, // Starting Cluster Agent sequence // Initialization order is important for multiple reasons, see comments - if err := util.SetupCoreDump(config); err != nil { + if err := coredump.Setup(config); err != nil { pkglog.Warnf("Can't setup core dumps: %v, core dumps might not be available after a crash", err) } @@ -455,13 +455,12 @@ func start(log log.Component, if config.GetBool("admission_controller.enabled") { if config.GetBool("admission_controller.auto_instrumentation.patcher.enabled") { patchCtx := admissionpatch.ControllerContext{ - IsLeaderFunc: le.IsLeader, - LeaderSubscribeFunc: le.Subscribe, - K8sClient: apiCl.Cl, - RcClient: rcClient, - ClusterName: clusterName, - ClusterID: clusterID, - StopCh: stopCh, + LeadershipStateSubscribeFunc: le.Subscribe, + K8sClient: apiCl.Cl, + RcClient: rcClient, + ClusterName: clusterName, + ClusterID: clusterID, + StopCh: stopCh, } if err := admissionpatch.StartControllers(patchCtx); err != nil { log.Errorf("Cannot start auto instrumentation patcher: %v", err) @@ -471,15 +470,14 @@ func start(log log.Component, } admissionCtx := admissionpkg.ControllerContext{ - IsLeaderFunc: le.IsLeader, - LeaderSubscribeFunc: le.Subscribe, - SecretInformers: apiCl.CertificateSecretInformerFactory, - ValidatingInformers: apiCl.WebhookConfigInformerFactory, - MutatingInformers: apiCl.WebhookConfigInformerFactory, - Client: apiCl.Cl, - StopCh: stopCh, - ValidatingStopCh: validatingStopCh, - Demultiplexer: demultiplexer, + LeadershipStateSubscribeFunc: le.Subscribe, + SecretInformers: apiCl.CertificateSecretInformerFactory, + ValidatingInformers: apiCl.WebhookConfigInformerFactory, + MutatingInformers: apiCl.WebhookConfigInformerFactory, + Client: apiCl.Cl, + StopCh: stopCh, + ValidatingStopCh: validatingStopCh, + Demultiplexer: demultiplexer, } webhooks, err := admissionpkg.StartControllers(admissionCtx, wmeta, pa, datadogConfig) diff --git a/cmd/dogstatsd/subcommands/start/command.go b/cmd/dogstatsd/subcommands/start/command.go index f61ae13db837d..b6e6a63361ae8 100644 --- a/cmd/dogstatsd/subcommands/start/command.go +++ b/cmd/dogstatsd/subcommands/start/command.go @@ -57,7 +57,7 @@ import ( compressionfx "github.com/DataDog/datadog-agent/comp/serializer/compression/fx" "github.com/DataDog/datadog-agent/pkg/serializer" "github.com/DataDog/datadog-agent/pkg/status/health" - "github.com/DataDog/datadog-agent/pkg/util" + "github.com/DataDog/datadog-agent/pkg/util/coredump" "github.com/DataDog/datadog-agent/pkg/util/fxutil" pkglog "github.com/DataDog/datadog-agent/pkg/util/log" pkglogsetup "github.com/DataDog/datadog-agent/pkg/util/log/setup" @@ -235,7 +235,7 @@ func RunDogstatsd(_ context.Context, cliParams *CLIParams, config config.Compone } }() - if err := util.SetupCoreDump(config); err != nil { + if err := coredump.Setup(config); err != nil { log.Warnf("Can't setup core dumps: %v, core dumps might not be available after a crash", err) } diff --git a/cmd/installer-downloader/main.go b/cmd/installer-downloader/main.go index db35a6c337519..60e2141af944e 100644 --- a/cmd/installer-downloader/main.go +++ b/cmd/installer-downloader/main.go @@ -17,7 +17,6 @@ import ( "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/telemetry" - "gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer" ) const ( @@ -45,12 +44,12 @@ func main() { ctx := context.Background() t := telemetry.NewTelemetry(env.HTTPClient(), env.APIKey, env.Site, fmt.Sprintf("datadog-installer-downloader-%s", Flavor)) - _ = t.Start(ctx) - defer func() { _ = t.Stop(ctx) }() var err error - span, ctx := telemetry.StartSpanFromEnv(ctx, "downloader") - defer func() { span.Finish(tracer.WithError(err)) }() + span, ctx := telemetry.StartSpanFromEnv(ctx, fmt.Sprintf("downloader-%s", Flavor)) err = runDownloader(ctx, env, Version, Flavor) + + span.Finish(err) + t.Stop() if err != nil { fmt.Fprintf(os.Stderr, "Installation failed: %v\n", err) os.Exit(1) @@ -72,9 +71,10 @@ 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 = os.Environ() + cmd.Env = append(os.Environ(), telemetry.EnvFromContext(ctx)...) err = cmd.Run() if err != nil { return fmt.Errorf("failed to run installer: %w", err) @@ -92,6 +92,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/installer/main.go b/cmd/installer/main.go index e7d94bb6d70fe..bf05b5b6a0e08 100644 --- a/cmd/installer/main.go +++ b/cmd/installer/main.go @@ -29,9 +29,9 @@ func runCmd(cmd *cobra.Command) int { err := cmd.Execute() if err != nil { if rootCauseErr := dig.RootCause(err); rootCauseErr != err { - fmt.Fprintln(cmd.ErrOrStderr(), installerErrors.FromErr(rootCauseErr).ToJSON()) + fmt.Fprintln(cmd.ErrOrStderr(), installerErrors.ToJSON(rootCauseErr)) } else { - fmt.Fprintln(cmd.ErrOrStderr(), installerErrors.FromErr(err).ToJSON()) + fmt.Fprintln(cmd.ErrOrStderr(), installerErrors.ToJSON(err)) } return -1 } diff --git a/cmd/installer/subcommands/daemon/status.tmpl b/cmd/installer/subcommands/daemon/status.tmpl index 045b819d53764..02481dea5c50d 100644 --- a/cmd/installer/subcommands/daemon/status.tmpl +++ b/cmd/installer/subcommands/daemon/status.tmpl @@ -1,12 +1,12 @@ Datadog Installer v{{ htmlSafe .Version }} {{ range $name, $package := .Packages }} {{ boldText $name }} - State: {{ if $package.Experiment -}}{{ yellowText "Upgrading" }}{{- else if $package.Stable -}}{{ greenText "OK" }}{{- else -}}{{ redText "no stable version" }}{{- end }} + State: {{ if $package.Experiment -}}{{ yellowText "Upgrading" }}{{- else if $package.Stable -}}{{ greenText "OK" }}{{- else -}}config only{{- end }} Installed versions: {{- if $package.Stable }} {{ greenText "●" }} stable: v{{ htmlSafe $package.Stable }} {{- else }} - {{ redText "●" }} stable: none + ● stable: none {{- end }} {{- if $package.Experiment }} {{ yellowText "●" }} experiment: v{{ htmlSafe $package.Experiment }} @@ -23,9 +23,9 @@ Datadog Installer v{{ htmlSafe .Version }} Remote configuration client state: StableVersion: {{ $remoteConfig.StableVersion }} ExperimentVersion: {{ $remoteConfig.ExperimentVersion }} - StableConfigVersion: {{ $remoteConfig.StableConfigVersion }} - ExperimentConfigVersion: {{ $remoteConfig.ExperimentConfigVersion }} - RemoteConfigVersion: {{ $remoteConfig.RemoteConfigVersion }} + StableConfigVersion: {{ if $remoteConfig.StableConfigState }}{{ $remoteConfig.StableConfigState.Version }}{{ else }}{{ "" }}{{ end }} + ExperimentConfigVersion: {{ if $remoteConfig.ExperimentConfigState }}{{ $remoteConfig.ExperimentConfigState.Version }}{{ else }}{{ "" }}{{ end }} + RemoteConfigVersion: {{ if $remoteConfig.RemoteConfigState }}{{ $remoteConfig.RemoteConfigState.Version }}{{ else }}{{ "" }}{{ end }} Task: {{- if $remoteConfig.Task }} Id: {{ $remoteConfig.Task.Id }} diff --git a/cmd/installer/subcommands/installer/command.go b/cmd/installer/subcommands/installer/command.go index 186367fc20b42..f394d9955d407 100644 --- a/cmd/installer/subcommands/installer/command.go +++ b/cmd/installer/subcommands/installer/command.go @@ -22,8 +22,6 @@ import ( "github.com/DataDog/datadog-agent/pkg/fleet/telemetry" "github.com/DataDog/datadog-agent/pkg/version" "github.com/spf13/cobra" - "gopkg.in/DataDog/dd-trace-go.v1/ddtrace" - "gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer" "gopkg.in/yaml.v2" ) @@ -89,7 +87,7 @@ func UnprivilegedCommands(_ *command.GlobalParams) []*cobra.Command { type cmd struct { t *telemetry.Telemetry ctx context.Context - span ddtrace.Span + span *telemetry.Span env *env.Env } @@ -107,12 +105,9 @@ func newCmd(operation string) *cmd { } func (c *cmd) Stop(err error) { - c.span.Finish(tracer.WithError(err)) + c.span.Finish(err) if c.t != nil { - err := c.t.Stop(context.Background()) - if err != nil { - fmt.Fprintf(os.Stderr, "failed to stop telemetry: %v\n", err) - } + c.t.Stop() } } @@ -227,11 +222,6 @@ func newTelemetry(env *env.Env) *telemetry.Telemetry { site = config.Site } t := telemetry.NewTelemetry(env.HTTPClient(), apiKey, site, "datadog-installer") // No sampling rules for commands - err := t.Start(context.Background()) - if err != nil { - fmt.Printf("failed to start telemetry: %v\n", err) - return nil - } return t } diff --git a/cmd/installer/subcommands/installer/umask_nix.go b/cmd/installer/subcommands/installer/umask_nix.go index b4062c09a4f77..dec64eccd6860 100644 --- a/cmd/installer/subcommands/installer/umask_nix.go +++ b/cmd/installer/subcommands/installer/umask_nix.go @@ -10,11 +10,11 @@ package installer import ( "syscall" - "gopkg.in/DataDog/dd-trace-go.v1/ddtrace" + "github.com/DataDog/datadog-agent/pkg/fleet/telemetry" ) // setInstallerUmask sets umask 0 to override any inherited umask -func setInstallerUmask(span ddtrace.Span) { +func setInstallerUmask(span *telemetry.Span) { oldmask := syscall.Umask(0) span.SetTag("inherited_umask", oldmask) } diff --git a/cmd/installer/subcommands/installer/umask_windows.go b/cmd/installer/subcommands/installer/umask_windows.go index 3d308c67cc318..d8661700cd56e 100644 --- a/cmd/installer/subcommands/installer/umask_windows.go +++ b/cmd/installer/subcommands/installer/umask_windows.go @@ -7,9 +7,7 @@ package installer -import ( - "gopkg.in/DataDog/dd-trace-go.v1/ddtrace" -) +import "github.com/DataDog/datadog-agent/pkg/fleet/telemetry" // setInstallerUmask no-op on Windows -func setInstallerUmask(_ ddtrace.Span) {} +func setInstallerUmask(_ *telemetry.Span) {} diff --git a/cmd/iot-agent/main_windows.go b/cmd/iot-agent/main_windows.go index b7a9183b4bcb7..a53048ea9a100 100644 --- a/cmd/iot-agent/main_windows.go +++ b/cmd/iot-agent/main_windows.go @@ -12,7 +12,6 @@ import ( "os" "github.com/DataDog/datadog-agent/cmd/agent/command" - "github.com/DataDog/datadog-agent/cmd/agent/common" "github.com/DataDog/datadog-agent/cmd/agent/subcommands" "github.com/DataDog/datadog-agent/cmd/agent/windows/service" "github.com/DataDog/datadog-agent/pkg/util/flavor" @@ -24,7 +23,6 @@ func main() { // set the Agent flavor flavor.SetFlavor(flavor.IotAgent) - common.EnableLoggingToFile() // if command line arguments are supplied, even in a non interactive session, // then just execute that. Used when the service is executing the executable, // for instance to trigger a restart. diff --git a/cmd/otel-agent/config/agent_config_test.go b/cmd/otel-agent/config/agent_config_test.go index 2d08cfb4ac58f..01567d48d7ffe 100644 --- a/cmd/otel-agent/config/agent_config_test.go +++ b/cmd/otel-agent/config/agent_config_test.go @@ -78,7 +78,7 @@ func (suite *ConfigTestSuite) TestAgentConfigDefaults() { assert.Equal(t, 6, c.Get("logs_config.compression_level")) assert.Equal(t, "https://trace.agent.datadoghq.com", c.Get("apm_config.apm_dd_url")) assert.Equal(t, false, c.Get("apm_config.receiver_enabled")) - assert.Equal(t, true, c.Get("otlp_config.traces.span_name_as_resource_name")) + assert.Equal(t, false, c.Get("otlp_config.traces.span_name_as_resource_name")) assert.Equal(t, []string{"enable_receive_resource_spans_v2", "enable_operation_and_resource_name_logic_v2", "enable_otlp_compute_top_level_by_span_kind"}, c.Get("apm_config.features")) } @@ -104,7 +104,7 @@ func (suite *ConfigTestSuite) TestAgentConfigWithDatadogYamlDefaults() { assert.Equal(t, 6, c.Get("logs_config.compression_level")) assert.Equal(t, "https://trace.agent.datadoghq.com", c.Get("apm_config.apm_dd_url")) assert.Equal(t, false, c.Get("apm_config.receiver_enabled")) - assert.Equal(t, true, c.Get("otlp_config.traces.span_name_as_resource_name")) + assert.Equal(t, false, c.Get("otlp_config.traces.span_name_as_resource_name")) assert.Equal(t, []string{"enable_receive_resource_spans_v2", "enable_operation_and_resource_name_logic_v2", "enable_otlp_compute_top_level_by_span_kind"}, c.Get("apm_config.features")) // log_level from datadog.yaml takes precedence -> more verbose diff --git a/cmd/otel-agent/subcommands/run/command.go b/cmd/otel-agent/subcommands/run/command.go index a414674620e44..d7958c6dabc59 100644 --- a/cmd/otel-agent/subcommands/run/command.go +++ b/cmd/otel-agent/subcommands/run/command.go @@ -25,6 +25,7 @@ import ( "github.com/DataDog/datadog-agent/comp/core/hostname/hostnameinterface" "github.com/DataDog/datadog-agent/comp/core/hostname/remotehostnameimpl" log "github.com/DataDog/datadog-agent/comp/core/log/def" + logfx "github.com/DataDog/datadog-agent/comp/core/log/fx" logtracefx "github.com/DataDog/datadog-agent/comp/core/log/fx-trace" "github.com/DataDog/datadog-agent/comp/core/secrets" tagger "github.com/DataDog/datadog-agent/comp/core/tagger/def" @@ -106,8 +107,20 @@ func runOTelAgentCommand(ctx context.Context, params *subcommands.GlobalParams, fx.Provide(func() coreconfig.Component { return acfg }), + fx.Provide(func(_ coreconfig.Component) log.Params { + return log.ForDaemon(params.LoggerName, "log_file", pkgconfigsetup.DefaultOTelAgentLogFile) + }), + logfx.Module(), + fetchonlyimpl.Module(), + // TODO: don't rely on this pattern; remove this `ModuleWithParams` thing + // and instead adapt OptionalModule to allow parameter passing naturally. + // See: https://github.com/DataDog/datadog-agent/pull/28386 + configsyncimpl.ModuleWithParams(), + fx.Provide(func() configsyncimpl.Params { + return configsyncimpl.NewParams(params.SyncTimeout, params.SyncDelay, true) + }), converterfx.Module(), - fx.Provide(func(cp converter.Component) confmap.Converter { + fx.Provide(func(cp converter.Component, _ configsync.Component) confmap.Converter { return cp }), collectorcontribFx.Module(), @@ -178,10 +191,10 @@ func runOTelAgentCommand(ctx context.Context, params *subcommands.GlobalParams, fx.Invoke(func(_ collectordef.Component, _ defaultforwarder.Forwarder, _ optional.Option[logsagentpipeline.Component]) { }), - // TODO: don't rely on this pattern; remove this `OptionalModuleWithParams` thing + // TODO: don't rely on this pattern; remove this `ModuleWithParams` thing // and instead adapt OptionalModule to allow parameter passing naturally. // See: https://github.com/DataDog/datadog-agent/pull/28386 - configsyncimpl.OptionalModuleWithParams(), + configsyncimpl.ModuleWithParams(), fx.Provide(func() configsyncimpl.Params { return configsyncimpl.NewParams(params.SyncTimeout, params.SyncDelay, true) }), @@ -205,7 +218,7 @@ func runOTelAgentCommand(ctx context.Context, params *subcommands.GlobalParams, // TODO: consider adding configsync.Component as an explicit dependency for traceconfig // to avoid this sort of dependency tree hack. - fx.Provide(func(deps traceconfig.Dependencies, _ optional.Option[configsync.Component]) (traceconfig.Component, error) { + fx.Provide(func(deps traceconfig.Dependencies, _ configsync.Component) (traceconfig.Component, error) { // TODO: this would be much better if we could leverage traceconfig.Module // Must add a new parameter to traconfig.Module to handle this. return traceconfig.NewConfig(deps) @@ -223,13 +236,13 @@ func runOTelAgentCommand(ctx context.Context, params *subcommands.GlobalParams, // ForwarderBundle returns the fx.Option for the forwarder bundle. // TODO: cleanup the forwarder instantiation with fx. -// This is a bit of a hack because we need to enforce optional.Option[configsync.Component] +// This is a bit of a hack because we need to enforce configsync.Component // is passed to newForwarder to enforce the correct instantiation order. Currently, the // new forwarder.BundleWithProvider makes a few assumptions in its generic prototype, and // this is the current workaround to leverage it. func ForwarderBundle() fx.Option { return defaultforwarder.ModulWithOptionTMP( - fx.Provide(func(_ optional.Option[configsync.Component]) defaultforwarder.Params { + fx.Provide(func(_ configsync.Component) defaultforwarder.Params { return defaultforwarder.NewParams() })) } diff --git a/cmd/process-agent/command/main_common.go b/cmd/process-agent/command/main_common.go index 188c9684fd30b..4d6b33d5ad831 100644 --- a/cmd/process-agent/command/main_common.go +++ b/cmd/process-agent/command/main_common.go @@ -61,11 +61,10 @@ import ( "github.com/DataDog/datadog-agent/pkg/process/metadata/workloadmeta/collector" "github.com/DataDog/datadog-agent/pkg/process/util" proccontainers "github.com/DataDog/datadog-agent/pkg/process/util/containers" - ddutil "github.com/DataDog/datadog-agent/pkg/util" + "github.com/DataDog/datadog-agent/pkg/util/coredump" "github.com/DataDog/datadog-agent/pkg/util/fxutil" "github.com/DataDog/datadog-agent/pkg/util/fxutil/logging" "github.com/DataDog/datadog-agent/pkg/util/log" - "github.com/DataDog/datadog-agent/pkg/util/optional" "github.com/DataDog/datadog-agent/pkg/version" ) @@ -156,7 +155,7 @@ func runApp(ctx context.Context, globalParams *GlobalParams) error { fetchonlyimpl.Module(), // Provide configsync module - configsyncimpl.OptionalModule(), + configsyncimpl.Module(), // Provide autoexit module autoexitimpl.Module(), @@ -215,7 +214,7 @@ func runApp(ctx context.Context, globalParams *GlobalParams) error { _ expvars.Component, _ apiserver.Component, cfg config.Component, - _ optional.Option[configsync.Component], + _ configsync.Component, // TODO: This is needed by the container-provider which is not currently a component. // We should ensure the tagger is a dependency when converting to a component. _ tagger.Component, @@ -296,7 +295,7 @@ type miscDeps struct { // Todo: (Components) WorkloadMeta, remoteTagger // Todo: move metadata/workloadmeta/collector to workloadmeta func initMisc(deps miscDeps) error { - if err := ddutil.SetupCoreDump(deps.Config); err != nil { + if err := coredump.Setup(deps.Config); err != nil { deps.Logger.Warnf("Can't setup core dumps: %v, core dumps might not be available after a crash", err) } diff --git a/cmd/process-agent/subcommands/config/config.go b/cmd/process-agent/subcommands/config/config.go index 1acd0ec15e5e2..ea776ffd07a47 100644 --- a/cmd/process-agent/subcommands/config/config.go +++ b/cmd/process-agent/subcommands/config/config.go @@ -181,6 +181,11 @@ func getConfigValue(deps dependencies, args []string) error { } func getClient(cfg model.Reader) (settings.Client, error) { + err := util.SetAuthToken(cfg) + if err != nil { + return nil, err + } + httpClient := apiutil.GetClient(false) ipcAddress, err := pkgconfigsetup.GetIPCAddress(pkgconfigsetup.Datadog()) @@ -189,7 +194,7 @@ func getClient(cfg model.Reader) (settings.Client, error) { return nil, fmt.Errorf("invalid process_config.cmd_port -- %d", port) } - ipcAddressWithPort := fmt.Sprintf("http://%s:%d/config", ipcAddress, port) + ipcAddressWithPort := fmt.Sprintf("https://%s:%d/config", ipcAddress, port) if err != nil { return nil, err } diff --git a/cmd/process-agent/subcommands/status/status.go b/cmd/process-agent/subcommands/status/status.go index 2660ee8fb71b4..225817d4fa121 100644 --- a/cmd/process-agent/subcommands/status/status.go +++ b/cmd/process-agent/subcommands/status/status.go @@ -21,6 +21,7 @@ import ( log "github.com/DataDog/datadog-agent/comp/core/log/def" compStatus "github.com/DataDog/datadog-agent/comp/core/status" "github.com/DataDog/datadog-agent/comp/process" + "github.com/DataDog/datadog-agent/pkg/api/util" apiutil "github.com/DataDog/datadog-agent/pkg/api/util" "github.com/DataDog/datadog-agent/pkg/collector/python" pkgconfigsetup "github.com/DataDog/datadog-agent/pkg/config/setup" @@ -28,8 +29,6 @@ import ( "github.com/DataDog/datadog-agent/pkg/util/fxutil" ) -var httpClient = apiutil.GetClient(false) - const ( notRunning = ` ============= @@ -111,6 +110,7 @@ func writeError(log log.Component, w io.Writer, e error) { } func fetchStatus(statusURL string) ([]byte, error) { + httpClient := apiutil.GetClient(false) body, err := apiutil.DoGet(httpClient, statusURL, apiutil.LeaveConnectionOpen) if err != nil { return nil, status.NewConnectionError(err) @@ -138,7 +138,7 @@ func getStatusURL() (string, error) { if err != nil { return "", fmt.Errorf("config error: %s", err.Error()) } - return fmt.Sprintf("http://%s/agent/status", addressPort), nil + return fmt.Sprintf("https://%s/agent/status", addressPort), nil } func runStatus(deps dependencies) error { @@ -148,6 +148,11 @@ func runStatus(deps dependencies) error { return err } + err = util.SetAuthToken(deps.Config) + if err != nil { + return err + } + getAndWriteStatus(deps.Log, statusURL, os.Stdout) return nil } diff --git a/cmd/process-agent/subcommands/status/status_test.go b/cmd/process-agent/subcommands/status/status_test.go index e6aabd23aeb17..a6dc7dcd631e9 100644 --- a/cmd/process-agent/subcommands/status/status_test.go +++ b/cmd/process-agent/subcommands/status/status_test.go @@ -68,7 +68,7 @@ func TestNotRunning(t *testing.T) { addressPort, err := pkgconfigsetup.GetProcessAPIAddressPort(pkgconfigsetup.Datadog()) require.NoError(t, err) - statusURL := fmt.Sprintf("http://%s/agent/status", addressPort) + statusURL := fmt.Sprintf("https://%s/agent/status", addressPort) var b strings.Builder getAndWriteStatus(log.NoopLogger, statusURL, &b) diff --git a/cmd/process-agent/subcommands/taggerlist/tagger_list.go b/cmd/process-agent/subcommands/taggerlist/tagger_list.go index e7ec238efdeea..fac3127349075 100644 --- a/cmd/process-agent/subcommands/taggerlist/tagger_list.go +++ b/cmd/process-agent/subcommands/taggerlist/tagger_list.go @@ -18,11 +18,12 @@ import ( "github.com/DataDog/datadog-agent/comp/core/config" log "github.com/DataDog/datadog-agent/comp/core/log/def" "github.com/DataDog/datadog-agent/comp/core/tagger/api" + "github.com/DataDog/datadog-agent/pkg/api/util" pkgconfigsetup "github.com/DataDog/datadog-agent/pkg/config/setup" "github.com/DataDog/datadog-agent/pkg/util/fxutil" ) -const taggerListURLTpl = "http://%s/agent/tagger-list" +const taggerListURLTpl = "https://%s/agent/tagger-list" // Commands returns a slice of subcommands for the `tagger-list` command in the Process Agent func Commands(globalParams *command.GlobalParams) []*cobra.Command { @@ -58,6 +59,10 @@ func taggerList(deps dependencies) error { return err } + err = util.SetAuthToken(deps.Config) + if err != nil { + return err + } return api.GetTaggerList(color.Output, taggerURL) } diff --git a/cmd/process-agent/subcommands/workloadlist/command.go b/cmd/process-agent/subcommands/workloadlist/command.go index a123e4c4f9fa2..8da7a727cc74e 100644 --- a/cmd/process-agent/subcommands/workloadlist/command.go +++ b/cmd/process-agent/subcommands/workloadlist/command.go @@ -91,7 +91,7 @@ func workloadURL(verbose bool) (string, error) { return "", fmt.Errorf("config error: %s", err.Error()) } - url := fmt.Sprintf("http://%s/agent/workload-list", addressPort) + url := fmt.Sprintf("https://%s/agent/workload-list", addressPort) if verbose { return url + "/verbose", nil diff --git a/cmd/security-agent/api/server.go b/cmd/security-agent/api/server.go index 3b44b83e39436..307a4e4c6cd43 100644 --- a/cmd/security-agent/api/server.go +++ b/cmd/security-agent/api/server.go @@ -12,42 +12,41 @@ package api import ( "crypto/tls" - "crypto/x509" - "encoding/pem" - "fmt" stdLog "log" "net" "net/http" "time" - "github.com/cihub/seelog" "github.com/gorilla/mux" "github.com/DataDog/datadog-agent/cmd/security-agent/api/agent" + "github.com/DataDog/datadog-agent/comp/api/authtoken" "github.com/DataDog/datadog-agent/comp/core/settings" "github.com/DataDog/datadog-agent/comp/core/status" workloadmeta "github.com/DataDog/datadog-agent/comp/core/workloadmeta/def" - "github.com/DataDog/datadog-agent/pkg/api/security" "github.com/DataDog/datadog-agent/pkg/api/util" pkgconfigsetup "github.com/DataDog/datadog-agent/pkg/config/setup" + "github.com/DataDog/datadog-agent/pkg/util/log" pkglogsetup "github.com/DataDog/datadog-agent/pkg/util/log/setup" ) // Server implements security agent API server type Server struct { - listener net.Listener - agent *agent.Agent + listener net.Listener + agent *agent.Agent + tlsConfig *tls.Config } // NewServer creates a new Server instance -func NewServer(statusComponent status.Component, settings settings.Component, wmeta workloadmeta.Component) (*Server, error) { +func NewServer(statusComponent status.Component, settings settings.Component, wmeta workloadmeta.Component, at authtoken.Component) (*Server, error) { listener, err := newListener() if err != nil { return nil, err } return &Server{ - listener: listener, - agent: agent.NewAgent(statusComponent, settings, wmeta), + listener: listener, + agent: agent.NewAgent(statusComponent, settings, wmeta), + tlsConfig: at.GetTLSServerConfig(), }, nil } @@ -62,43 +61,16 @@ func (s *Server) Start() error { // Validate token for every request r.Use(validateToken) - err := util.CreateAndSetAuthToken(pkgconfigsetup.Datadog()) - if err != nil { - return err - } - - hosts := []string{"127.0.0.1", "localhost"} - _, rootCertPEM, rootKey, err := security.GenerateRootCert(hosts, 2048) - if err != nil { - return fmt.Errorf("unable to start TLS server") - } - - // PEM encode the private key - rootKeyPEM := pem.EncodeToMemory(&pem.Block{ - Type: "RSA PRIVATE KEY", Bytes: x509.MarshalPKCS1PrivateKey(rootKey), - }) - - // Create a TLS cert using the private key and certificate - rootTLSCert, err := tls.X509KeyPair(rootCertPEM, rootKeyPEM) - if err != nil { - return fmt.Errorf("invalid key pair: %v", err) - } - - tlsConfig := tls.Config{ - Certificates: []tls.Certificate{rootTLSCert}, - MinVersion: tls.VersionTLS13, - } - // Use a stack depth of 4 on top of the default one to get a relevant filename in the stdlib - logWriter, _ := pkglogsetup.NewLogWriter(4, seelog.ErrorLvl) + logWriter, _ := pkglogsetup.NewLogWriter(4, log.ErrorLvl) srv := &http.Server{ Handler: r, ErrorLog: stdLog.New(logWriter, "Error from the agent http API server: ", 0), // log errors to seelog, - TLSConfig: &tlsConfig, + TLSConfig: s.tlsConfig, WriteTimeout: pkgconfigsetup.Datadog().GetDuration("server_timeout") * time.Second, } - tlsListener := tls.NewListener(s.listener, &tlsConfig) + tlsListener := tls.NewListener(s.listener, s.tlsConfig) go srv.Serve(tlsListener) //nolint:errcheck return nil diff --git a/cmd/security-agent/main_windows.go b/cmd/security-agent/main_windows.go index 6aa47f99d56b4..f6a2e3aedf28f 100644 --- a/cmd/security-agent/main_windows.go +++ b/cmd/security-agent/main_windows.go @@ -25,6 +25,7 @@ import ( "github.com/DataDog/datadog-agent/cmd/security-agent/subcommands/start" "github.com/DataDog/datadog-agent/comp/agent/autoexit" "github.com/DataDog/datadog-agent/comp/agent/autoexit/autoexitimpl" + "github.com/DataDog/datadog-agent/comp/api/authtoken" "github.com/DataDog/datadog-agent/comp/api/authtoken/fetchonlyimpl" "github.com/DataDog/datadog-agent/comp/core" "github.com/DataDog/datadog-agent/comp/core/config" @@ -54,7 +55,6 @@ import ( "github.com/DataDog/datadog-agent/pkg/util/defaultpaths" "github.com/DataDog/datadog-agent/pkg/util/fxutil" - "github.com/DataDog/datadog-agent/pkg/util/optional" "github.com/DataDog/datadog-agent/pkg/util/startstop" "github.com/DataDog/datadog-agent/pkg/util/winutil/servicemain" ) @@ -91,10 +91,11 @@ func (s *service) Run(svcctx context.Context) error { params := &cliParams{} err := fxutil.OneShot( func(log log.Component, config config.Component, _ secrets.Component, _ statsd.Component, _ sysprobeconfig.Component, - telemetry telemetry.Component, _ workloadmeta.Component, _ *cliParams, statusComponent status.Component, _ autoexit.Component, settings settings.Component, wmeta workloadmeta.Component) error { + telemetry telemetry.Component, _ workloadmeta.Component, _ *cliParams, statusComponent status.Component, _ autoexit.Component, + settings settings.Component, wmeta workloadmeta.Component, at authtoken.Component) error { defer start.StopAgent(log) - err := start.RunAgent(log, config, telemetry, statusComponent, settings, wmeta) + err := start.RunAgent(log, config, telemetry, statusComponent, settings, wmeta, at) if err != nil { if errors.Is(err, start.ErrAllComponentsDisabled) { // If all components are disabled, we should exit cleanly @@ -121,17 +122,8 @@ func (s *service) Run(svcctx context.Context) error { // workloadmeta setup wmcatalog.GetCatalog(), - workloadmetafx.ModuleWithProvider(func(config config.Component) workloadmeta.Params { - - catalog := workloadmeta.NodeAgent - - if config.GetBool("security_agent.remote_workloadmeta") { - catalog = workloadmeta.Remote - } - - return workloadmeta.Params{ - AgentType: catalog, - } + workloadmetafx.Module(workloadmeta.Params{ + AgentType: workloadmeta.Remote, }), fx.Provide(func(log log.Component, config config.Component, statsd statsd.Component, wmeta workloadmeta.Component) (status.InformationProvider, *agent.RuntimeSecurityAgent, error) { stopper := startstop.NewSerialStopper() @@ -173,9 +165,9 @@ func (s *service) Run(svcctx context.Context) error { statusimpl.Module(), fetchonlyimpl.Module(), - configsyncimpl.OptionalModule(), + configsyncimpl.Module(), // Force the instantiation of the component - fx.Invoke(func(_ optional.Option[configsync.Component]) {}), + fx.Invoke(func(_ configsync.Component) {}), autoexitimpl.Module(), fx.Provide(func(c config.Component) settings.Params { return settings.Params{ 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/cmd/security-agent/subcommands/runtime/activity_dump.go b/cmd/security-agent/subcommands/runtime/activity_dump.go index 514cdda1bc612..0f15351d72e02 100644 --- a/cmd/security-agent/subcommands/runtime/activity_dump.go +++ b/cmd/security-agent/subcommands/runtime/activity_dump.go @@ -12,6 +12,7 @@ import ( "encoding/json" "fmt" "os" + "time" "github.com/spf13/cobra" "go.uber.org/fx" @@ -37,6 +38,7 @@ type activityDumpCliParams struct { name string containerID string + cgroupID string file string file2 string timeout string @@ -113,7 +115,13 @@ func stopCommands(globalParams *command.GlobalParams) []*cobra.Command { &cliParams.containerID, "container-id", "", - "an containerID can be used to filter the activity dump.", + "a containerID can be used to filter the activity dump.", + ) + activityDumpStopCmd.Flags().StringVar( + &cliParams.cgroupID, + "cgroup-id", + "", + "a cgroup ID can be used to filter the activity dump.", ) return []*cobra.Command{activityDumpStopCmd} @@ -157,10 +165,16 @@ func generateDumpCommands(globalParams *command.GlobalParams) []*cobra.Command { "", "a container identifier can be used to filter the activity dump from a specific container.", ) + activityDumpGenerateDumpCmd.Flags().StringVar( + &cliParams.cgroupID, + "cgroup-id", + "", + "a cgroup identifier can be used to filter the activity dump from a specific cgroup.", + ) activityDumpGenerateDumpCmd.Flags().StringVar( &cliParams.timeout, "timeout", - "1m", + "", "timeout for the activity dump", ) activityDumpGenerateDumpCmd.Flags().BoolVar( @@ -172,7 +186,7 @@ func generateDumpCommands(globalParams *command.GlobalParams) []*cobra.Command { activityDumpGenerateDumpCmd.Flags().StringVar( &cliParams.localStorageDirectory, "output", - "/tmp/activity_dumps/", + "", "local storage output directory", ) activityDumpGenerateDumpCmd.Flags().BoolVar( @@ -459,8 +473,15 @@ func generateActivityDump(_ log.Component, _ config.Component, _ secrets.Compone return err } + if activityDumpArgs.timeout != "" { + if _, err = time.ParseDuration(activityDumpArgs.timeout); err != nil { + return err + } + } + output, err := client.GenerateActivityDump(&api.ActivityDumpParams{ ContainerID: activityDumpArgs.containerID, + CGroupID: activityDumpArgs.cgroupID, Timeout: activityDumpArgs.timeout, DifferentiateArgs: activityDumpArgs.differentiateArgs, Storage: storage, @@ -609,7 +630,7 @@ func stopActivityDump(_ log.Component, _ config.Component, _ secrets.Component, } defer client.Close() - output, err := client.StopActivityDump(activityDumpArgs.name, activityDumpArgs.containerID) + output, err := client.StopActivityDump(activityDumpArgs.name, activityDumpArgs.containerID, activityDumpArgs.cgroupID) if err != nil { return fmt.Errorf("unable to send request to system-probe: %w", err) } diff --git a/cmd/security-agent/subcommands/runtime/command.go b/cmd/security-agent/subcommands/runtime/command.go index 08bbdcea4c787..c0b5e2c0775ff 100644 --- a/cmd/security-agent/subcommands/runtime/command.go +++ b/cmd/security-agent/subcommands/runtime/command.go @@ -41,6 +41,7 @@ import ( "github.com/DataDog/datadog-agent/pkg/security/probe/kfilters" "github.com/DataDog/datadog-agent/pkg/security/proto/api" "github.com/DataDog/datadog-agent/pkg/security/reporter" + "github.com/DataDog/datadog-agent/pkg/security/rules/filtermodel" "github.com/DataDog/datadog-agent/pkg/security/secl/compiler/eval" "github.com/DataDog/datadog-agent/pkg/security/secl/model" "github.com/DataDog/datadog-agent/pkg/security/secl/rules" @@ -463,12 +464,22 @@ func checkPoliciesLocal(args *checkPoliciesCliParams, writer io.Writer) error { return fmt.Errorf("failed to create agent version filter: %w", err) } + os := runtime.GOOS + if args.windowsModel { + os = "windows" + } + + ruleFilterModel := filtermodel.NewOSOnlyFilterModel(os) + seclRuleFilter := rules.NewSECLRuleFilter(ruleFilterModel) + loaderOpts := rules.PolicyLoaderOpts{ MacroFilters: []rules.MacroFilter{ agentVersionFilter, + seclRuleFilter, }, RuleFilters: []rules.RuleFilter{ agentVersionFilter, + seclRuleFilter, }, } diff --git a/cmd/security-agent/subcommands/runtime/command_linux.go b/cmd/security-agent/subcommands/runtime/command_linux.go index 4c5a90d3167cd..a813dc82b0385 100644 --- a/cmd/security-agent/subcommands/runtime/command_linux.go +++ b/cmd/security-agent/subcommands/runtime/command_linux.go @@ -46,6 +46,9 @@ func printSecurityActivityDumpMessage(prefix string, msg *api.ActivityDumpMessag if len(msg.GetMetadata().GetContainerID()) > 0 { fmt.Printf("%s container ID: %s\n", prefix, msg.GetMetadata().GetContainerID()) } + if len(msg.GetMetadata().GetCGroupID()) > 0 { + fmt.Printf("%s cgroup ID: %s\n", prefix, msg.GetMetadata().GetCGroupID()) + } if len(msg.GetTags()) > 0 { fmt.Printf("%s tags: %s\n", prefix, strings.Join(msg.GetTags(), ", ")) } diff --git a/cmd/security-agent/subcommands/start/command.go b/cmd/security-agent/subcommands/start/command.go index 6dec7ce712a4e..933a44f4a0135 100644 --- a/cmd/security-agent/subcommands/start/command.go +++ b/cmd/security-agent/subcommands/start/command.go @@ -29,6 +29,7 @@ import ( "github.com/DataDog/datadog-agent/cmd/security-agent/subcommands/runtime" "github.com/DataDog/datadog-agent/comp/agent/autoexit" "github.com/DataDog/datadog-agent/comp/agent/autoexit/autoexitimpl" + "github.com/DataDog/datadog-agent/comp/api/authtoken" "github.com/DataDog/datadog-agent/comp/api/authtoken/fetchonlyimpl" "github.com/DataDog/datadog-agent/comp/core" "github.com/DataDog/datadog-agent/comp/core/config" @@ -48,7 +49,7 @@ import ( remoteTaggerfx "github.com/DataDog/datadog-agent/comp/core/tagger/fx-remote" taggerTypes "github.com/DataDog/datadog-agent/comp/core/tagger/types" "github.com/DataDog/datadog-agent/comp/core/telemetry" - wmcatalog "github.com/DataDog/datadog-agent/comp/core/workloadmeta/collectors/catalog" + wmcatalog "github.com/DataDog/datadog-agent/comp/core/workloadmeta/collectors/catalog-remote" workloadmeta "github.com/DataDog/datadog-agent/comp/core/workloadmeta/def" workloadmetafx "github.com/DataDog/datadog-agent/comp/core/workloadmeta/fx" "github.com/DataDog/datadog-agent/comp/dogstatsd" @@ -63,9 +64,8 @@ import ( "github.com/DataDog/datadog-agent/pkg/security/agent" "github.com/DataDog/datadog-agent/pkg/security/utils" "github.com/DataDog/datadog-agent/pkg/status/health" - "github.com/DataDog/datadog-agent/pkg/util" + "github.com/DataDog/datadog-agent/pkg/util/coredump" "github.com/DataDog/datadog-agent/pkg/util/fxutil" - "github.com/DataDog/datadog-agent/pkg/util/optional" "github.com/DataDog/datadog-agent/pkg/util/profiling" "github.com/DataDog/datadog-agent/pkg/util/startstop" "github.com/DataDog/datadog-agent/pkg/version" @@ -104,14 +104,8 @@ func Commands(globalParams *command.GlobalParams) []*cobra.Command { dogstatsd.ClientBundle, // workloadmeta setup wmcatalog.GetCatalog(), - workloadmetafx.ModuleWithProvider(func(config config.Component) workloadmeta.Params { - catalog := workloadmeta.NodeAgent - if config.GetBool("security_agent.remote_workloadmeta") { - catalog = workloadmeta.Remote - } - return workloadmeta.Params{ - AgentType: catalog, - } + workloadmetafx.Module(workloadmeta.Params{ + AgentType: workloadmeta.Remote, }), remoteTaggerfx.Module(tagger.RemoteParams{ RemoteTarget: func(c config.Component) (string, error) { @@ -179,9 +173,9 @@ func Commands(globalParams *command.GlobalParams) []*cobra.Command { }), statusimpl.Module(), fetchonlyimpl.Module(), - configsyncimpl.OptionalModule(), + configsyncimpl.Module(), // Force the instantiation of the component - fx.Invoke(func(_ optional.Option[configsync.Component]) {}), + fx.Invoke(func(_ configsync.Component) {}), autoexitimpl.Module(), fx.Supply(pidimpl.NewParams(params.pidfilePath)), fx.Provide(func(c config.Component) settings.Params { @@ -207,10 +201,10 @@ func Commands(globalParams *command.GlobalParams) []*cobra.Command { // TODO(components): note how workloadmeta is passed anonymously, it is still required as it is used // as a global. This should eventually be fixed and all workloadmeta interactions should be via the // injected instance. -func start(log log.Component, config config.Component, _ secrets.Component, _ statsd.Component, _ sysprobeconfig.Component, telemetry telemetry.Component, statusComponent status.Component, _ pid.Component, _ autoexit.Component, settings settings.Component, wmeta workloadmeta.Component) error { +func start(log log.Component, config config.Component, _ secrets.Component, _ statsd.Component, _ sysprobeconfig.Component, telemetry telemetry.Component, statusComponent status.Component, _ pid.Component, _ autoexit.Component, settings settings.Component, wmeta workloadmeta.Component, at authtoken.Component) error { defer StopAgent(log) - err := RunAgent(log, config, telemetry, statusComponent, settings, wmeta) + err := RunAgent(log, config, telemetry, statusComponent, settings, wmeta, at) if errors.Is(err, ErrAllComponentsDisabled) || errors.Is(err, errNoAPIKeyConfigured) { return nil } @@ -262,8 +256,8 @@ var ErrAllComponentsDisabled = errors.New("all security-agent component are disa var errNoAPIKeyConfigured = errors.New("no API key configured") // RunAgent initialized resources and starts API server -func RunAgent(log log.Component, config config.Component, telemetry telemetry.Component, statusComponent status.Component, settings settings.Component, wmeta workloadmeta.Component) (err error) { - if err := util.SetupCoreDump(config); err != nil { +func RunAgent(log log.Component, config config.Component, telemetry telemetry.Component, statusComponent status.Component, settings settings.Component, wmeta workloadmeta.Component, at authtoken.Component) (err error) { + if err := coredump.Setup(config); err != nil { log.Warnf("Can't setup core dumps: %v, core dumps might not be available after a crash", err) } @@ -305,7 +299,7 @@ func RunAgent(log log.Component, config config.Component, telemetry telemetry.Co } }() - srv, err = api.NewServer(statusComponent, settings, wmeta) + srv, err = api.NewServer(statusComponent, settings, wmeta, at) if err != nil { return log.Errorf("Error while creating api server, exiting: %v", err) } diff --git a/cmd/serverless-init/main.go b/cmd/serverless-init/main.go index 1b5242fa41e21..b4e2076350ff5 100644 --- a/cmd/serverless-init/main.go +++ b/cmd/serverless-init/main.go @@ -146,7 +146,7 @@ func setup(_ mode.Conf, tagger tagger.Component) (cloudservice.CloudService, *se metricAgent := setupMetricAgent(tags, tagger) metric.AddColdStartMetric(prefix, metricAgent.GetExtraTags(), time.Now(), metricAgent.Demux) - setupOtlpAgent(metricAgent) + setupOtlpAgent(metricAgent, tagger) go flushMetricsAgent(metricAgent) return cloudService, agentLogConfig, traceAgent, metricAgent, logsAgent @@ -200,12 +200,12 @@ func setupMetricAgent(tags map[string]string, tagger tagger.Component) *metrics. return metricAgent } -func setupOtlpAgent(metricAgent *metrics.ServerlessMetricAgent) { +func setupOtlpAgent(metricAgent *metrics.ServerlessMetricAgent, tagger tagger.Component) { if !otlp.IsEnabled() { log.Debugf("otlp endpoint disabled") return } - otlpAgent := otlp.NewServerlessOTLPAgent(metricAgent.Demux.Serializer()) + otlpAgent := otlp.NewServerlessOTLPAgent(metricAgent.Demux.Serializer(), tagger) otlpAgent.Start() } diff --git a/cmd/serverless/main.go b/cmd/serverless/main.go index 77f46c01fded4..a679ceef10181 100644 --- a/cmd/serverless/main.go +++ b/cmd/serverless/main.go @@ -124,7 +124,7 @@ func runAgent(tagger tagger.Component) { wg.Add(3) go startTraceAgent(&wg, lambdaSpanChan, coldStartSpanId, serverlessDaemon, tagger, rcService) - go startOtlpAgent(&wg, metricAgent, serverlessDaemon) + go startOtlpAgent(&wg, metricAgent, serverlessDaemon, tagger) go startTelemetryCollection(&wg, serverlessID, logChannel, serverlessDaemon, tagger) // start appsec @@ -330,13 +330,13 @@ func startTelemetryCollection(wg *sync.WaitGroup, serverlessID registration.ID, } } -func startOtlpAgent(wg *sync.WaitGroup, metricAgent *metrics.ServerlessMetricAgent, serverlessDaemon *daemon.Daemon) { +func startOtlpAgent(wg *sync.WaitGroup, metricAgent *metrics.ServerlessMetricAgent, serverlessDaemon *daemon.Daemon, tagger tagger.Component) { defer wg.Done() if !otlp.IsEnabled() { log.Debug("otlp endpoint disabled") return } - otlpAgent := otlp.NewServerlessOTLPAgent(metricAgent.Demux.Serializer()) + otlpAgent := otlp.NewServerlessOTLPAgent(metricAgent.Demux.Serializer(), tagger) otlpAgent.Start() serverlessDaemon.SetOTLPAgent(otlpAgent) diff --git a/cmd/system-probe/api/debug/handlers_linux.go b/cmd/system-probe/api/debug/handlers_linux.go new file mode 100644 index 0000000000000..07ba06c49354f --- /dev/null +++ b/cmd/system-probe/api/debug/handlers_linux.go @@ -0,0 +1,56 @@ +// 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 + +// Package debug contains handlers for debug information global to all of system-probe +package debug + +import ( + "context" + "errors" + "fmt" + "net/http" + "os/exec" + "time" +) + +// handleCommand runs commandName with the provided arguments and writes it to the HTTP response. +// If the command exits with a failure or doesn't exist in the PATH, it will still 200 but report the failure. +// Any other kind of error will 500. +func handleCommand(ctx context.Context, w http.ResponseWriter, commandName string, args ...string) { + cmd := exec.CommandContext(ctx, commandName, args...) + output, err := cmd.CombinedOutput() + + var execError *exec.Error + var exitErr *exec.ExitError + + if err != nil { + // don't 500 for ExitErrors etc, to report "normal" failures to the flare log file + if !errors.As(err, &execError) && !errors.As(err, &exitErr) { + w.WriteHeader(500) + } + fmt.Fprintf(w, "command failed: %s\n%s", err, output) + return + } + + w.Write(output) +} + +// HandleSelinuxSestatus reports the output of sestatus as an http result +func HandleSelinuxSestatus(w http.ResponseWriter, r *http.Request) { + ctx, cancel := context.WithTimeout(r.Context(), 5*time.Second) + defer cancel() + + handleCommand(ctx, w, "sestatus") +} + +// HandleSelinuxSemoduleList reports the output of semodule -l as an http result +func HandleSelinuxSemoduleList(w http.ResponseWriter, r *http.Request) { + ctx, cancel := context.WithTimeout(r.Context(), 5*time.Second) + defer cancel() + + handleCommand(ctx, w, "semodule", "-l") +} diff --git a/cmd/system-probe/api/debug/handlers_nolinux.go b/cmd/system-probe/api/debug/handlers_nolinux.go new file mode 100644 index 0000000000000..246f4a3a7c78a --- /dev/null +++ b/cmd/system-probe/api/debug/handlers_nolinux.go @@ -0,0 +1,26 @@ +// 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 + +// Package debug contains handlers for debug information global to all of system-probe +package debug + +import ( + "io" + "net/http" +) + +// HandleSelinuxSestatus is not supported +func HandleSelinuxSestatus(w http.ResponseWriter, _ *http.Request) { + w.WriteHeader(500) + io.WriteString(w, "HandleSelinuxSestatus is not supported on this platform") +} + +// HandleSelinuxSemoduleList is not supported +func HandleSelinuxSemoduleList(w http.ResponseWriter, _ *http.Request) { + w.WriteHeader(500) + io.WriteString(w, "HandleSelinuxSemoduleList is not supported on this platform") +} diff --git a/cmd/system-probe/api/server.go b/cmd/system-probe/api/server.go index 3e4a71056f143..f4d9e85522d91 100644 --- a/cmd/system-probe/api/server.go +++ b/cmd/system-probe/api/server.go @@ -15,6 +15,7 @@ import ( gorilla "github.com/gorilla/mux" + "github.com/DataDog/datadog-agent/cmd/system-probe/api/debug" "github.com/DataDog/datadog-agent/cmd/system-probe/api/module" "github.com/DataDog/datadog-agent/cmd/system-probe/api/server" sysconfigtypes "github.com/DataDog/datadog-agent/cmd/system-probe/config/types" @@ -58,6 +59,8 @@ func StartServer(cfg *sysconfigtypes.Config, telemetry telemetry.Component, wmet if runtime.GOOS == "linux" { mux.HandleFunc("/debug/ebpf_btf_loader_info", ebpf.HandleBTFLoaderInfo) + mux.HandleFunc("/debug/selinux_sestatus", debug.HandleSelinuxSestatus) + mux.HandleFunc("/debug/selinux_semodule_list", debug.HandleSelinuxSemoduleList) } go func() { diff --git a/cmd/system-probe/modules/eventmonitor.go b/cmd/system-probe/modules/eventmonitor.go index f74b13bec36af..41707ad513dec 100644 --- a/cmd/system-probe/modules/eventmonitor.go +++ b/cmd/system-probe/modules/eventmonitor.go @@ -85,14 +85,9 @@ func createEventMonitorModule(_ *sysconfigtypes.Config, deps module.FactoryDepen netconfig := netconfig.New() if netconfig.EnableUSMEventStream { - procmonconsumer, err := createProcessMonitorConsumer(evm, netconfig) - if err != nil { + if err := createProcessMonitorConsumer(evm, netconfig); err != nil { return nil, err } - if procmonconsumer != nil { - evm.RegisterEventConsumer(procmonconsumer) - log.Info("USM process monitoring consumer initialized") - } } gpucfg := gpuconfig.New() diff --git a/cmd/system-probe/modules/eventmonitor_linux.go b/cmd/system-probe/modules/eventmonitor_linux.go index 498e3b9feb92d..a3ee2f33666da 100644 --- a/cmd/system-probe/modules/eventmonitor_linux.go +++ b/cmd/system-probe/modules/eventmonitor_linux.go @@ -11,11 +11,13 @@ import ( "github.com/DataDog/datadog-agent/cmd/system-probe/api/module" "github.com/DataDog/datadog-agent/cmd/system-probe/config" "github.com/DataDog/datadog-agent/pkg/eventmonitor" + "github.com/DataDog/datadog-agent/pkg/eventmonitor/consumers" netconfig "github.com/DataDog/datadog-agent/pkg/network/config" usmconfig "github.com/DataDog/datadog-agent/pkg/network/usm/config" usmstate "github.com/DataDog/datadog-agent/pkg/network/usm/state" - procmon "github.com/DataDog/datadog-agent/pkg/process/monitor" + "github.com/DataDog/datadog-agent/pkg/process/monitor" secconfig "github.com/DataDog/datadog-agent/pkg/security/config" + "github.com/DataDog/datadog-agent/pkg/util/log" ) // EventMonitor - Event monitor Factory @@ -28,10 +30,28 @@ var EventMonitor = module.Factory{ }, } -func createProcessMonitorConsumer(evm *eventmonitor.EventMonitor, config *netconfig.Config) (eventmonitor.EventConsumer, error) { +const ( + eventMonitorID = "PROCESS_MONITOR" + eventMonitorChannelSize = 500 +) + +var ( + eventTypes = []consumers.ProcessConsumerEventTypes{ + consumers.ExecEventType, + consumers.ExitEventType, + } +) + +func createProcessMonitorConsumer(evm *eventmonitor.EventMonitor, config *netconfig.Config) error { if !usmconfig.IsUSMSupportedAndEnabled(config) || !usmconfig.NeedProcessMonitor(config) || usmstate.Get() != usmstate.Running { - return nil, nil + return nil } - return procmon.NewProcessMonitorEventConsumer(evm) + consumer, err := consumers.NewProcessConsumer(eventMonitorID, eventMonitorChannelSize, eventTypes, evm) + if err != nil { + return err + } + monitor.InitializeEventConsumer(consumer) + log.Info("USM process monitoring consumer initialized") + return nil } diff --git a/cmd/system-probe/modules/eventmonitor_windows.go b/cmd/system-probe/modules/eventmonitor_windows.go index 870c707f8f3e7..7ec627c076d67 100644 --- a/cmd/system-probe/modules/eventmonitor_windows.go +++ b/cmd/system-probe/modules/eventmonitor_windows.go @@ -21,8 +21,8 @@ var EventMonitor = module.Factory{ Fn: createEventMonitorModule, } -func createProcessMonitorConsumer(_ *eventmonitor.EventMonitor, _ *netconfig.Config) (eventmonitor.EventConsumer, error) { - return nil, nil +func createProcessMonitorConsumer(_ *eventmonitor.EventMonitor, _ *netconfig.Config) error { + return nil } func createGPUProcessEventConsumer(_ *eventmonitor.EventMonitor) error { diff --git a/cmd/system-probe/modules/gpu.go b/cmd/system-probe/modules/gpu.go index 7ec273e7c2869..c7dbac874dccd 100644 --- a/cmd/system-probe/modules/gpu.go +++ b/cmd/system-probe/modules/gpu.go @@ -55,6 +55,7 @@ var GPUMonitoring = module.Factory{ //(https://github.com/NVIDIA/go-nvml/blob/main/pkg/nvml/lib.go#L30) NvmlLib: nvml.New(nvml.WithLibraryPath(c.NVMLLibraryPath)), ProcessMonitor: processEventConsumer, + WorkloadMeta: deps.WMeta, } ret := probeDeps.NvmlLib.Init() diff --git a/cmd/system-probe/modules/network_tracer_test.go b/cmd/system-probe/modules/network_tracer_test.go index bbe67d3d3df99..8a7a31cde06dd 100644 --- a/cmd/system-probe/modules/network_tracer_test.go +++ b/cmd/system-probe/modules/network_tracer_test.go @@ -28,14 +28,15 @@ func TestDecode(t *testing.T) { BufferedData: network.BufferedData{ Conns: []network.ConnectionStats{ {ConnectionTuple: network.ConnectionTuple{ - Source: util.AddressFromString("10.1.1.1"), - Dest: util.AddressFromString("10.2.2.2"), - Pid: 6000, - NetNS: 7, - SPort: 1000, - DPort: 9000, - Type: network.UDP, - Family: network.AFINET6, + Source: util.AddressFromString("10.1.1.1"), + Dest: util.AddressFromString("10.2.2.2"), + Pid: 6000, + NetNS: 7, + SPort: 1000, + DPort: 9000, + Type: network.UDP, + Family: network.AFINET6, + Direction: network.LOCAL, }, Monotonic: network.StatCounters{ SentBytes: 1, @@ -54,7 +55,6 @@ func TestDecode(t *testing.T) { ReplSrcPort: 40, ReplDstPort: 70, }, - Direction: network.LOCAL, }, }, }, diff --git a/cmd/system-probe/subcommands/run/command.go b/cmd/system-probe/subcommands/run/command.go index ab55fc4287c0a..659f7e2fe0f52 100644 --- a/cmd/system-probe/subcommands/run/command.go +++ b/cmd/system-probe/subcommands/run/command.go @@ -47,7 +47,7 @@ import ( taggerTypes "github.com/DataDog/datadog-agent/comp/core/tagger/types" "github.com/DataDog/datadog-agent/comp/core/telemetry" "github.com/DataDog/datadog-agent/comp/core/telemetry/telemetryimpl" - wmcatalog "github.com/DataDog/datadog-agent/comp/core/workloadmeta/collectors/catalog" + wmcatalog "github.com/DataDog/datadog-agent/comp/core/workloadmeta/collectors/catalog-remote" workloadmeta "github.com/DataDog/datadog-agent/comp/core/workloadmeta/def" workloadmetafx "github.com/DataDog/datadog-agent/comp/core/workloadmeta/fx" compstatsd "github.com/DataDog/datadog-agent/comp/dogstatsd/statsd" @@ -61,7 +61,7 @@ import ( ebpftelemetry "github.com/DataDog/datadog-agent/pkg/ebpf/telemetry" processstatsd "github.com/DataDog/datadog-agent/pkg/process/statsd" ddruntime "github.com/DataDog/datadog-agent/pkg/runtime" - "github.com/DataDog/datadog-agent/pkg/util" + "github.com/DataDog/datadog-agent/pkg/util/coredump" "github.com/DataDog/datadog-agent/pkg/util/fxutil" pkglog "github.com/DataDog/datadog-agent/pkg/util/log" "github.com/DataDog/datadog-agent/pkg/util/optional" @@ -333,7 +333,7 @@ func startSystemProbe(log log.Component, statsd compstatsd.Component, telemetry return ErrNotEnabled } - if err := util.SetupCoreDump(sysprobeconfig); err != nil { + if err := coredump.Setup(sysprobeconfig); err != nil { log.Warnf("cannot setup core dumps: %s, core dumps might not be available after a crash", err) } diff --git a/cmd/system-probe/subcommands/runtime/activity_dump.go b/cmd/system-probe/subcommands/runtime/activity_dump.go index 72096d1160bbd..e00d027c94d7b 100644 --- a/cmd/system-probe/subcommands/runtime/activity_dump.go +++ b/cmd/system-probe/subcommands/runtime/activity_dump.go @@ -34,6 +34,7 @@ type activityDumpCliParams struct { name string containerID string + cgroupID string file string file2 string timeout string @@ -109,7 +110,12 @@ func stopCommands(globalParams *command.GlobalParams) []*cobra.Command { "", "an containerID can be used to filter the activity dump.", ) - + activityDumpStopCmd.Flags().StringVar( + &cliParams.cgroupID, + "cgroup-id", + "", + "a cgroup ID can be used to filter the activity dump.", + ) return []*cobra.Command{activityDumpStopCmd} } @@ -151,6 +157,12 @@ func generateDumpCommands(globalParams *command.GlobalParams) []*cobra.Command { "", "a container identifier can be used to filter the activity dump from a specific container.", ) + activityDumpGenerateDumpCmd.Flags().StringVar( + &cliParams.cgroupID, + "cgroup-id", + "", + "a cgroup identifier can be used to filter the activity dump from a specific cgroup.", + ) activityDumpGenerateDumpCmd.Flags().StringVar( &cliParams.timeout, "timeout", @@ -449,6 +461,7 @@ func generateActivityDump(_ log.Component, _ config.Component, _ secrets.Compone output, err := client.GenerateActivityDump(&api.ActivityDumpParams{ ContainerID: activityDumpArgs.containerID, + CGroupID: activityDumpArgs.cgroupID, Timeout: activityDumpArgs.timeout, DifferentiateArgs: activityDumpArgs.differentiateArgs, Storage: storage, @@ -573,7 +586,7 @@ func stopActivityDump(_ log.Component, _ config.Component, _ secrets.Component, } defer client.Close() - output, err := client.StopActivityDump(activityDumpArgs.name, activityDumpArgs.containerID) + output, err := client.StopActivityDump(activityDumpArgs.name, activityDumpArgs.containerID, activityDumpArgs.cgroupID) if err != nil { return fmt.Errorf("unable to send request to system-probe: %w", err) } diff --git a/cmd/system-probe/subcommands/runtime/command_linux.go b/cmd/system-probe/subcommands/runtime/command_linux.go index 51d2a8c92dec7..1980ac0fbfb23 100644 --- a/cmd/system-probe/subcommands/runtime/command_linux.go +++ b/cmd/system-probe/subcommands/runtime/command_linux.go @@ -42,6 +42,9 @@ func printSecurityActivityDumpMessage(prefix string, msg *api.ActivityDumpMessag if len(msg.GetMetadata().GetContainerID()) > 0 { fmt.Printf("%s container ID: %s\n", prefix, msg.GetMetadata().GetContainerID()) } + if len(msg.GetMetadata().GetCGroupID()) > 0 { + fmt.Printf("%s cgroup ID: %s\n", prefix, msg.GetMetadata().GetCGroupID()) + } if len(msg.GetTags()) > 0 { fmt.Printf("%s tags: %s\n", prefix, strings.Join(msg.GetTags(), ", ")) } diff --git a/cmd/trace-agent/config/remote/config.go b/cmd/trace-agent/config/remote/config.go index d2c511a4586e7..6b650364743a7 100644 --- a/cmd/trace-agent/config/remote/config.go +++ b/cmd/trace-agent/config/remote/config.go @@ -43,7 +43,7 @@ func putBuffer(buffer *bytes.Buffer) { // ConfigHandler is the HTTP handler for configs func ConfigHandler(r *api.HTTPReceiver, cf rcclient.ConfigFetcher, cfg *config.AgentConfig, statsd statsd.ClientInterface, timing timing.Reporter) http.Handler { - cidProvider := api.NewIDProvider(cfg.ContainerProcRoot) + cidProvider := api.NewIDProvider(cfg.ContainerProcRoot, cfg.ContainerIDFromOriginInfo) return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { defer timing.Since("datadog.trace_agent.receiver.config_process_ms", time.Now()) tags := r.TagStats(api.V07, req.Header, "").AsTags() diff --git a/cmd/trace-agent/subcommands/run/command.go b/cmd/trace-agent/subcommands/run/command.go index 1d0788501ffae..4526101362de1 100644 --- a/cmd/trace-agent/subcommands/run/command.go +++ b/cmd/trace-agent/subcommands/run/command.go @@ -113,9 +113,9 @@ func runTraceAgentProcess(ctx context.Context, cliParams *Params, defaultConfPat zstdfx.Module(), trace.Bundle(), fetchonlyimpl.Module(), - configsyncimpl.OptionalModule(), + configsyncimpl.Module(), // Force the instantiation of the components - fx.Invoke(func(_ traceagent.Component, _ optional.Option[configsync.Component], _ autoexit.Component) {}), + fx.Invoke(func(_ traceagent.Component, _ configsync.Component, _ autoexit.Component) {}), ) if err != nil && errors.Is(err, traceagentimpl.ErrAgentDisabled) { return nil diff --git a/cmd/trace-agent/test/testsuite/config_set_test.go b/cmd/trace-agent/test/testsuite/config_set_test.go index ee2065f63c7a2..1a9175490aca2 100644 --- a/cmd/trace-agent/test/testsuite/config_set_test.go +++ b/cmd/trace-agent/test/testsuite/config_set_test.go @@ -11,10 +11,10 @@ import ( "testing" "time" - "github.com/cihub/seelog" "github.com/stretchr/testify/assert" "github.com/DataDog/datadog-agent/cmd/trace-agent/test" + "github.com/DataDog/datadog-agent/pkg/util/log" ) func TestConfigSetHandlerUnauthenticated(t *testing.T) { @@ -36,7 +36,7 @@ func TestConfigSetHandlerUnauthenticated(t *testing.T) { assert.NotContains(t, logstr, "| DEBUG |") assert.Contains(t, logstr, "| INFO |") - resp, err := r.DoReq(fmt.Sprintf("config/set?log_level=%s", seelog.WarnStr), http.MethodPost, nil) + resp, err := r.DoReq(fmt.Sprintf("config/set?log_level=%s", log.WarnStr), http.MethodPost, nil) if err != nil { t.Fatal(err) } diff --git a/comp/README.md b/comp/README.md index d9c2cf8ab27d4..f011bc57fe71d 100644 --- a/comp/README.md +++ b/comp/README.md @@ -392,7 +392,7 @@ Package logsagentpipeline contains logs agent pipeline component ## [comp/process](https://pkg.go.dev/github.com/DataDog/datadog-agent/comp/process) (Component Bundle) -*Datadog Team*: processes +*Datadog Team*: container-intake Package process implements the "process" bundle, providing components for the Process Agent 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/api/apiimpl/api_test.go b/comp/api/api/apiimpl/api_test.go index d92e8f1e4fa48..b248dc9531330 100644 --- a/comp/api/api/apiimpl/api_test.go +++ b/comp/api/api/apiimpl/api_test.go @@ -20,7 +20,7 @@ import ( "github.com/DataDog/datadog-agent/comp/aggregator/demultiplexer/demultiplexerimpl" "github.com/DataDog/datadog-agent/comp/api/api/apiimpl/observability" api "github.com/DataDog/datadog-agent/comp/api/api/def" - "github.com/DataDog/datadog-agent/comp/api/authtoken/fetchonlyimpl" + "github.com/DataDog/datadog-agent/comp/api/authtoken/createandfetchimpl" "github.com/DataDog/datadog-agent/comp/collector/collector" "github.com/DataDog/datadog-agent/comp/core/autodiscovery" "github.com/DataDog/datadog-agent/comp/core/autodiscovery/autodiscoveryimpl" @@ -76,7 +76,7 @@ func getTestAPIServer(t *testing.T, params config.MockParams) testdeps { demultiplexerimpl.MockModule(), fx.Supply(optional.NewNoneOption[rcservice.Component]()), fx.Supply(optional.NewNoneOption[rcservicemrf.Component]()), - fetchonlyimpl.MockModule(), + createandfetchimpl.Module(), fx.Supply(context.Background()), taggermock.Module(), fx.Provide(func(mock taggermock.Mock) tagger.Component { @@ -166,7 +166,6 @@ func TestStartBothServersWithObservability(t *testing.T) { req, err := http.NewRequest(http.MethodGet, url, nil) require.NoError(t, err) - req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", authTokenValue)) resp, err := util.GetClient(false).Do(req) require.NoError(t, err) defer resp.Body.Close() diff --git a/comp/api/api/apiimpl/grpc.go b/comp/api/api/apiimpl/grpc.go index 0386f022c6927..6272a7f00fe05 100644 --- a/comp/api/api/apiimpl/grpc.go +++ b/comp/api/api/apiimpl/grpc.go @@ -10,30 +10,30 @@ import ( "fmt" "time" - "github.com/DataDog/datadog-agent/comp/remote-config/rcservice" - "github.com/DataDog/datadog-agent/comp/remote-config/rcservicemrf" - "github.com/DataDog/datadog-agent/pkg/util/optional" - "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" "google.golang.org/grpc/status" "google.golang.org/protobuf/types/known/emptypb" + "github.com/DataDog/datadog-agent/comp/core/autodiscovery" + autodiscoverystream "github.com/DataDog/datadog-agent/comp/core/autodiscovery/stream" remoteagentregistry "github.com/DataDog/datadog-agent/comp/core/remoteagentregistry/def" rarproto "github.com/DataDog/datadog-agent/comp/core/remoteagentregistry/proto" - workloadmetaServer "github.com/DataDog/datadog-agent/comp/core/workloadmeta/server" - tagger "github.com/DataDog/datadog-agent/comp/core/tagger/def" taggerProto "github.com/DataDog/datadog-agent/comp/core/tagger/proto" taggerserver "github.com/DataDog/datadog-agent/comp/core/tagger/server" taggerTypes "github.com/DataDog/datadog-agent/comp/core/tagger/types" + workloadmetaServer "github.com/DataDog/datadog-agent/comp/core/workloadmeta/server" "github.com/DataDog/datadog-agent/comp/dogstatsd/pidmap" dsdReplay "github.com/DataDog/datadog-agent/comp/dogstatsd/replay/def" dogstatsdServer "github.com/DataDog/datadog-agent/comp/dogstatsd/server" + "github.com/DataDog/datadog-agent/comp/remote-config/rcservice" + "github.com/DataDog/datadog-agent/comp/remote-config/rcservicemrf" pb "github.com/DataDog/datadog-agent/pkg/proto/pbgo/core" "github.com/DataDog/datadog-agent/pkg/util/grpc" "github.com/DataDog/datadog-agent/pkg/util/hostname" "github.com/DataDog/datadog-agent/pkg/util/log" + "github.com/DataDog/datadog-agent/pkg/util/optional" ) type grpcServer struct { @@ -51,6 +51,7 @@ type serverSecure struct { capture dsdReplay.Component pidMap pidmap.Component remoteAgentRegistry remoteagentregistry.Component + autodiscovery autodiscovery.Component } func (s *grpcServer) GetHostname(ctx context.Context, _ *pb.HostnameRequest) (*pb.HostnameReply, error) { @@ -73,6 +74,12 @@ func (s *serverSecure) TaggerStreamEntities(req *pb.StreamTagsRequest, srv pb.Ag return s.taggerServer.TaggerStreamEntities(req, srv) } +// TaggerGenerateContainerIDFromOriginInfo generates a container ID from the Origin Info. +// This function takes an Origin Info but only uses the ExternalData part of it, this is done for backward compatibility. +func (s *serverSecure) TaggerGenerateContainerIDFromOriginInfo(ctx context.Context, req *pb.GenerateContainerIDFromOriginInfoRequest) (*pb.GenerateContainerIDFromOriginInfoResponse, error) { + return s.taggerServer.TaggerGenerateContainerIDFromOriginInfo(ctx, req) +} + func (s *serverSecure) TaggerFetchEntity(ctx context.Context, req *pb.FetchEntityRequest) (*pb.FetchEntityResponse, error) { return s.taggerServer.TaggerFetchEntity(ctx, req) } @@ -202,6 +209,10 @@ func (s *serverSecure) RegisterRemoteAgent(_ context.Context, in *pb.RegisterRem }, nil } +func (s *serverSecure) AutodiscoveryStreamConfig(_ *emptypb.Empty, out pb.AgentSecure_AutodiscoveryStreamConfigServer) error { + return autodiscoverystream.Config(s.autodiscovery, out) +} + func init() { grpclog.SetLoggerV2(grpc.NewLogger()) } diff --git a/comp/api/api/apiimpl/security.go b/comp/api/api/apiimpl/security.go index 4587871aecec3..4b8b17d2ba33d 100644 --- a/comp/api/api/apiimpl/security.go +++ b/comp/api/api/apiimpl/security.go @@ -6,16 +6,10 @@ package apiimpl import ( - "crypto/tls" - "crypto/x509" - "encoding/pem" + "crypto/subtle" "errors" - "fmt" "net/http" - "runtime" - "strings" - "github.com/DataDog/datadog-agent/pkg/api/security" "github.com/DataDog/datadog-agent/pkg/api/util" "github.com/DataDog/datadog-agent/pkg/util/log" ) @@ -34,7 +28,7 @@ func validateToken(next http.Handler) http.Handler { // parseToken parses the token and validate it for our gRPC API, it returns an empty // struct and an error or nil func parseToken(token string) (interface{}, error) { - if token != util.GetAuthToken() { + if subtle.ConstantTimeCompare([]byte(token), []byte(util.GetAuthToken())) == 0 { return struct{}{}, errors.New("Invalid session token") } @@ -43,44 +37,3 @@ func parseToken(token string) (interface{}, error) { // type. return struct{}{}, nil } - -func buildSelfSignedKeyPair(additionalHostIdentities ...string) ([]byte, []byte) { - hosts := []string{"127.0.0.1", "localhost", "::1"} - hosts = append(hosts, additionalHostIdentities...) - _, rootCertPEM, rootKey, err := security.GenerateRootCert(hosts, 2048) - if err != nil { - return nil, nil - } - - // PEM encode the private key - rootKeyPEM := pem.EncodeToMemory(&pem.Block{ - Type: "RSA PRIVATE KEY", Bytes: x509.MarshalPKCS1PrivateKey(rootKey), - }) - - // Create and return TLS private cert and key - return rootCertPEM, rootKeyPEM -} - -func initializeTLS(additionalHostIdentities ...string) (*tls.Certificate, *x509.CertPool, error) { - // print the caller to identify what is calling this function - if _, file, line, ok := runtime.Caller(1); ok { - log.Infof("[%s:%d] Initializing TLS certificates for hosts %v", file, line, strings.Join(additionalHostIdentities, ", ")) - } - - cert, key := buildSelfSignedKeyPair(additionalHostIdentities...) - if cert == nil { - return nil, nil, errors.New("unable to generate certificate") - } - pair, err := tls.X509KeyPair(cert, key) - if err != nil { - return nil, nil, fmt.Errorf("unable to generate TLS key pair: %v", err) - } - - tlsCertPool := x509.NewCertPool() - ok := tlsCertPool.AppendCertsFromPEM(cert) - if !ok { - return nil, nil, fmt.Errorf("unable to add new certificate to pool") - } - - return &pair, tlsCertPool, nil -} diff --git a/comp/api/api/apiimpl/server.go b/comp/api/api/apiimpl/server.go index b4d42f1178218..6def35781eb1a 100644 --- a/comp/api/api/apiimpl/server.go +++ b/comp/api/api/apiimpl/server.go @@ -11,18 +11,16 @@ import ( stdLog "log" "net" "net/http" - - "github.com/cihub/seelog" + "strconv" "github.com/DataDog/datadog-agent/comp/api/api/apiimpl/observability" - "github.com/DataDog/datadog-agent/pkg/util/log" pkglogsetup "github.com/DataDog/datadog-agent/pkg/util/log/setup" ) func startServer(listener net.Listener, srv *http.Server, name string) { // Use a stack depth of 4 on top of the default one to get a relevant filename in the stdlib - logWriter, _ := pkglogsetup.NewLogWriter(5, seelog.ErrorLvl) + logWriter, _ := pkglogsetup.NewLogWriter(5, log.ErrorLvl) srv.ErrorLog = stdLog.New(logWriter, fmt.Sprintf("Error from the Agent HTTP server '%s': ", name), 0) // log errors to seelog @@ -50,34 +48,11 @@ func (server *apiServer) startServers() error { return fmt.Errorf("unable to get IPC address and port: %v", err) } - additionalHostIdentities := []string{apiAddr} - - ipcServerHost, ipcServerHostPort, ipcServerEnabled := getIPCServerAddressPort() - if ipcServerEnabled { - additionalHostIdentities = append(additionalHostIdentities, ipcServerHost) - } - - tlsKeyPair, tlsCertPool, err := initializeTLS(additionalHostIdentities...) - if err != nil { - return fmt.Errorf("unable to initialize TLS: %v", err) - } - - // tls.Config is written to when serving, so it has to be cloned for each server - tlsConfig := func() *tls.Config { - return &tls.Config{ - Certificates: []tls.Certificate{*tlsKeyPair}, - NextProtos: []string{"h2"}, - MinVersion: tls.VersionTLS12, - } - } - tmf := observability.NewTelemetryMiddlewareFactory(server.telemetry) // start the CMD server if err := server.startCMDServer( apiAddr, - tlsConfig(), - tlsCertPool, tmf, server.cfg, ); err != nil { @@ -85,8 +60,11 @@ func (server *apiServer) startServers() error { } // start the IPC server - if ipcServerEnabled { - if err := server.startIPCServer(ipcServerHostPort, tlsConfig(), tmf); err != nil { + if ipcServerPort := server.cfg.GetInt("agent_ipc.port"); ipcServerPort > 0 { + ipcServerHost := server.cfg.GetString("agent_ipc.host") + ipcServerHostPort := net.JoinHostPort(ipcServerHost, strconv.Itoa(ipcServerPort)) + + if err := server.startIPCServer(ipcServerHostPort, tmf); err != nil { // if we fail to start the IPC server, we should stop the CMD server server.stopServers() return fmt.Errorf("unable to start IPC API server: %v", err) diff --git a/comp/api/api/apiimpl/server_cmd.go b/comp/api/api/apiimpl/server_cmd.go index daf855a161d41..2eca0fe7abd09 100644 --- a/comp/api/api/apiimpl/server_cmd.go +++ b/comp/api/api/apiimpl/server_cmd.go @@ -7,8 +7,6 @@ package apiimpl import ( "context" - "crypto/tls" - "crypto/x509" "fmt" "net/http" "time" @@ -35,8 +33,6 @@ const cmdServerShortName string = "CMD" func (server *apiServer) startCMDServer( cmdAddr string, - tlsConfig *tls.Config, - tlsCertPool *x509.CertPool, tmf observability.TelemetryMiddlewareFactory, cfg config.Component, ) (err error) { @@ -54,7 +50,7 @@ func (server *apiServer) startCMDServer( maxMessageSize := cfg.GetInt("cluster_agent.cluster_tagger.grpc_max_message_size") opts := []grpc.ServerOption{ - grpc.Creds(credentials.NewClientTLSFromCert(tlsCertPool, cmdAddr)), + grpc.Creds(credentials.NewTLS(server.authToken.GetTLSServerConfig())), grpc.StreamInterceptor(grpc_auth.StreamServerInterceptor(authInterceptor)), grpc.UnaryInterceptor(grpc_auth.UnaryServerInterceptor(authInterceptor)), grpc.MaxRecvMsgSize(maxMessageSize), @@ -76,13 +72,10 @@ func (server *apiServer) startCMDServer( capture: server.capture, pidMap: server.pidMap, remoteAgentRegistry: server.remoteAgentRegistry, + autodiscovery: server.autoConfig, }) - dcreds := credentials.NewTLS(&tls.Config{ - ServerName: cmdAddr, - RootCAs: tlsCertPool, - }) - dopts := []grpc.DialOption{grpc.WithTransportCredentials(dcreds)} + dopts := []grpc.DialOption{grpc.WithTransportCredentials(credentials.NewTLS(server.authToken.GetTLSClientConfig()))} // starting grpc gateway ctx := context.Background() @@ -132,7 +125,7 @@ func (server *apiServer) startCMDServer( srv := grpcutil.NewMuxedGRPCServer( cmdAddr, - tlsConfig, + server.authToken.GetTLSServerConfig(), s, grpcutil.TimeoutHandlerFunc(cmdMuxHandler, time.Duration(pkgconfigsetup.Datadog().GetInt64("server_timeout"))*time.Second), ) diff --git a/comp/api/api/apiimpl/server_ipc.go b/comp/api/api/apiimpl/server_ipc.go index 10e17509f75e3..634ec1810f35a 100644 --- a/comp/api/api/apiimpl/server_ipc.go +++ b/comp/api/api/apiimpl/server_ipc.go @@ -6,7 +6,6 @@ package apiimpl import ( - "crypto/tls" "net/http" "time" @@ -18,7 +17,7 @@ import ( const ipcServerName string = "IPC API Server" const ipcServerShortName string = "IPC" -func (server *apiServer) startIPCServer(ipcServerAddr string, tlsConfig *tls.Config, tmf observability.TelemetryMiddlewareFactory) (err error) { +func (server *apiServer) startIPCServer(ipcServerAddr string, tmf observability.TelemetryMiddlewareFactory) (err error) { server.ipcListener, err = getListener(ipcServerAddr) if err != nil { return err @@ -39,7 +38,7 @@ func (server *apiServer) startIPCServer(ipcServerAddr string, tlsConfig *tls.Con ipcServer := &http.Server{ Addr: ipcServerAddr, Handler: http.TimeoutHandler(ipcMuxHandler, time.Duration(pkgconfigsetup.Datadog().GetInt64("server_timeout"))*time.Second, "timeout"), - TLSConfig: tlsConfig, + TLSConfig: server.authToken.GetTLSServerConfig(), } startServer(server.ipcListener, ipcServer, ipcServerName) diff --git a/comp/api/api/def/go.mod b/comp/api/api/def/go.mod index 09f4bd9d7e62e..8a89ca045e6d6 100644 --- a/comp/api/api/def/go.mod +++ b/comp/api/api/def/go.mod @@ -11,5 +11,5 @@ require ( go.uber.org/dig v1.18.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect - golang.org/x/sys v0.27.0 // indirect + golang.org/x/sys v0.28.0 // indirect ) diff --git a/comp/api/api/def/go.sum b/comp/api/api/def/go.sum index e01f4bd76ea76..7b69276ecf542 100644 --- a/comp/api/api/def/go.sum +++ b/comp/api/api/def/go.sum @@ -14,7 +14,7 @@ go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.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= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/comp/api/authtoken/component.go b/comp/api/authtoken/component.go index 2aae4096f392d..fbe0ef3558028 100644 --- a/comp/api/authtoken/component.go +++ b/comp/api/authtoken/component.go @@ -9,9 +9,12 @@ package authtoken import ( + "crypto/tls" + + "go.uber.org/fx" + "github.com/DataDog/datadog-agent/pkg/util/fxutil" "github.com/DataDog/datadog-agent/pkg/util/optional" - "go.uber.org/fx" ) // team: agent-shared-components @@ -19,6 +22,8 @@ import ( // Component is the component type. type Component interface { Get() string + GetTLSClientConfig() *tls.Config + GetTLSServerConfig() *tls.Config } // NoneModule return a None optional type for authtoken.Component. diff --git a/comp/api/authtoken/createandfetchimpl/authtoken.go b/comp/api/authtoken/createandfetchimpl/authtoken.go index 9afffdeff362d..8f5408083f49f 100644 --- a/comp/api/authtoken/createandfetchimpl/authtoken.go +++ b/comp/api/authtoken/createandfetchimpl/authtoken.go @@ -8,6 +8,8 @@ package createandfetchimpl import ( + "crypto/tls" + "go.uber.org/fx" "github.com/DataDog/datadog-agent/comp/api/authtoken" @@ -49,3 +51,13 @@ func newAuthToken(deps dependencies) (authtoken.Component, error) { func (at *authToken) Get() string { return util.GetAuthToken() } + +// GetTLSServerConfig return a TLS configuration with the IPC certificate for http.Server +func (at *authToken) GetTLSClientConfig() *tls.Config { + return util.GetTLSClientConfig() +} + +// GetTLSServerConfig return a TLS configuration with the IPC certificate for http.Client +func (at *authToken) GetTLSServerConfig() *tls.Config { + return util.GetTLSServerConfig() +} diff --git a/comp/api/authtoken/createandfetchimpl/authtoken_test.go b/comp/api/authtoken/createandfetchimpl/authtoken_test.go index 1eb9e11f6ba81..51f2db29e1142 100644 --- a/comp/api/authtoken/createandfetchimpl/authtoken_test.go +++ b/comp/api/authtoken/createandfetchimpl/authtoken_test.go @@ -10,8 +10,6 @@ import ( "path/filepath" "testing" - "github.com/DataDog/datadog-agent/pkg/api/util" - "github.com/DataDog/datadog-agent/pkg/util/fxutil" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.uber.org/fx" @@ -19,13 +17,17 @@ import ( "github.com/DataDog/datadog-agent/comp/core/config" log "github.com/DataDog/datadog-agent/comp/core/log/def" logmock "github.com/DataDog/datadog-agent/comp/core/log/mock" + "github.com/DataDog/datadog-agent/pkg/api/util" + "github.com/DataDog/datadog-agent/pkg/util/fxutil" ) func TestGet(t *testing.T) { dir := t.TempDir() authPath := filepath.Join(dir, "auth_token") + ipcPath := filepath.Join(dir, "ipc_cert") overrides := map[string]any{ "auth_token_file_path": authPath, + "ipc_cert_file_path": ipcPath, } comp, err := newAuthToken( diff --git a/comp/api/authtoken/fetchonlyimpl/authtoken.go b/comp/api/authtoken/fetchonlyimpl/authtoken.go index ac07402b8c960..f353bc3706c3d 100644 --- a/comp/api/authtoken/fetchonlyimpl/authtoken.go +++ b/comp/api/authtoken/fetchonlyimpl/authtoken.go @@ -8,6 +8,9 @@ package fetchonlyimpl import ( + "crypto/tls" + "fmt" + "go.uber.org/fx" "github.com/DataDog/datadog-agent/comp/api/authtoken" @@ -26,9 +29,8 @@ func Module() fxutil.Module { } type authToken struct { - log log.Component - conf config.Component - + log log.Component + conf config.Component tokenLoaded bool } @@ -48,17 +50,44 @@ func newAuthToken(deps dependencies) authtoken.Component { } } -// Get returns the session token -func (at *authToken) Get() string { +func (at *authToken) setToken() error { if !at.tokenLoaded { // We try to load the auth_token until we succeed since it might be created at some point by another // process. if err := util.SetAuthToken(at.conf); err != nil { - at.log.Debugf("could not load auth_token: %s", err) - return "" + return fmt.Errorf("could not load auth_token: %s", err) } at.tokenLoaded = true } + return nil +} + +// Get returns the session token +func (at *authToken) Get() string { + if err := at.setToken(); err != nil { + at.log.Debugf("%s", err.Error()) + return "" + } return util.GetAuthToken() } + +// GetTLSClientConfig return a TLS configuration with the IPC certificate for http.Client +func (at *authToken) GetTLSClientConfig() *tls.Config { + if err := at.setToken(); err != nil { + at.log.Debugf("%s", err.Error()) + return nil + } + + return util.GetTLSClientConfig() +} + +// GetTLSServerConfig return a TLS configuration with the IPC certificate for http.Server +func (at *authToken) GetTLSServerConfig() *tls.Config { + if err := at.setToken(); err != nil { + at.log.Debugf("%s", err.Error()) + return nil + } + + return util.GetTLSServerConfig() +} diff --git a/comp/api/authtoken/fetchonlyimpl/authtoken_test.go b/comp/api/authtoken/fetchonlyimpl/authtoken_test.go index 4492ab4ff4105..4073ee0db7779 100644 --- a/comp/api/authtoken/fetchonlyimpl/authtoken_test.go +++ b/comp/api/authtoken/fetchonlyimpl/authtoken_test.go @@ -10,11 +10,13 @@ import ( "path/filepath" "testing" - "github.com/DataDog/datadog-agent/pkg/util/fxutil" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.uber.org/fx" + "github.com/DataDog/datadog-agent/pkg/api/security/cert" + "github.com/DataDog/datadog-agent/pkg/util/fxutil" + "github.com/DataDog/datadog-agent/comp/core/config" log "github.com/DataDog/datadog-agent/comp/core/log/def" logmock "github.com/DataDog/datadog-agent/comp/core/log/mock" @@ -23,6 +25,7 @@ import ( func TestGet(t *testing.T) { dir := t.TempDir() authPath := filepath.Join(dir, "auth_token") + var cfg config.Component overrides := map[string]any{ "auth_token_file_path": authPath, } @@ -32,6 +35,7 @@ func TestGet(t *testing.T) { t, fx.Provide(func() log.Component { return logmock.New(t) }), config.MockModule(), + fx.Populate(&cfg), fx.Replace(config.MockParams{Overrides: overrides}), ), ).(*authToken) @@ -42,6 +46,14 @@ func TestGet(t *testing.T) { err := os.WriteFile(authPath, []byte("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), 0777) require.NoError(t, err) + // Should be empty because the cert/key weren't generated yet + assert.Empty(t, comp.Get()) + assert.False(t, comp.tokenLoaded) + + // generating IPC cert/key files + _, _, err = cert.CreateOrFetchAgentIPCCert(cfg) + require.NoError(t, err) + assert.Equal(t, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", comp.Get()) assert.True(t, comp.tokenLoaded) diff --git a/comp/api/authtoken/fetchonlyimpl/mock.go b/comp/api/authtoken/fetchonlyimpl/mock.go index 2dea209906a3c..967c064870e55 100644 --- a/comp/api/authtoken/fetchonlyimpl/mock.go +++ b/comp/api/authtoken/fetchonlyimpl/mock.go @@ -8,9 +8,14 @@ package fetchonlyimpl import ( + "crypto/tls" + "net/http" + "net/http/httptest" + + "go.uber.org/fx" + authtokeninterface "github.com/DataDog/datadog-agent/comp/api/authtoken" "github.com/DataDog/datadog-agent/pkg/util/fxutil" - "go.uber.org/fx" ) // MockModule defines the fx options for the mock component. @@ -28,6 +33,23 @@ func (fc *MockFetchOnly) Get() string { return "a string" } +// GetTLSClientConfig is a mock of the fetchonly GetTLSClientConfig function +func (fc *MockFetchOnly) GetTLSClientConfig() *tls.Config { + return &tls.Config{ + InsecureSkipVerify: true, + } +} + +// GetTLSServerConfig is a mock of the fetchonly GetTLSServerConfig function +func (fc *MockFetchOnly) GetTLSServerConfig() *tls.Config { + // Starting a TLS httptest server to retrieve a localhost tlsCert + ts := httptest.NewTLSServer(http.HandlerFunc(func(_ http.ResponseWriter, _ *http.Request) {})) + tlsConfig := ts.TLS.Clone() + ts.Close() + + return tlsConfig +} + // NewMock returns a new fetch only authtoken mock func newMock() authtokeninterface.Component { return &MockFetchOnly{} diff --git a/comp/api/authtoken/go.mod b/comp/api/authtoken/go.mod index 532d1be88a5c4..ca1756a04df7e 100644 --- a/comp/api/authtoken/go.mod +++ b/comp/api/authtoken/go.mod @@ -68,33 +68,33 @@ require ( github.com/DataDog/datadog-agent/pkg/util/executable v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/filesystem v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.59.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/log v0.59.1 // indirect github.com/DataDog/datadog-agent/pkg/util/log/setup v0.58.0-devel // indirect github.com/DataDog/datadog-agent/pkg/util/pointer v0.59.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.1 // indirect 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.0 // indirect - github.com/DataDog/datadog-agent/pkg/version v0.56.0 // indirect - github.com/DataDog/viper v1.13.5 // 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.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 - github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 // indirect + github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 // indirect - github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c // indirect + github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c // indirect github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect 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/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // 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 @@ -107,9 +107,9 @@ require ( go.uber.org/dig v1.18.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect - golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f // indirect - golang.org/x/sys v0.27.0 // indirect - golang.org/x/text v0.20.0 // indirect + golang.org/x/exp v0.0.0-20241210194714-1829a127f884 // indirect + golang.org/x/sys v0.28.0 // indirect + golang.org/x/text v0.21.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/comp/api/authtoken/go.sum b/comp/api/authtoken/go.sum index 324945ccfacf2..6ffaa516a7a51 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= @@ -70,7 +72,6 @@ github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/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= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -85,8 +86,8 @@ github.com/grpc-ecosystem/grpc-gateway v1.13.0/go.mod h1:8XEsbTttt/W+VvjtQhLACqC github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/hcl v1.0.1-vault-5 h1:kI3hhbbyzr4dldA8UdTb7ZlVVlI2DACdCfz31RPDgJM= github.com/hashicorp/hcl v1.0.1-vault-5/go.mod h1:XYhtn6ijBSAj6n4YqAaf7RBPS4I06AItNorpy+MoQNM= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 h1:S4qyfL2sEm5Budr4KVMyEniCy+PbS55651I/a+Kn/NQ= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb h1:PGufWXXDq9yaev6xX1YQauaO1MV90e6Mpoq1I7Lz/VM= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= @@ -108,8 +109,8 @@ 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-20220913051719-115f729f3c8c h1:VtwQ41oftZwlMnOEbMWQtSEUgU64U4s+GHk7hZK+jtY= -github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c/go.mod h1:JKx41uQRwqlTZabZc+kILPrO/3jlKnQ2Z8b7YiVw5cE= +github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a h1:3Bm7EwfUQUvhNeKIkUct/gl9eod1TcXuj8stxvi/GoI= +github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a/go.mod h1:ilwx/Dta8jXAgpFYFvSWEMwxmbWXyiUHkd5FwyKhb5k= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= @@ -136,8 +137,8 @@ github.com/pkg/errors v0.8.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-20220216144756-c35f1ee13d7c h1:NRoLoZvkBTKvR5gQLgA3e0hqjkY9u1wm+iOL45VN/qI= -github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 h1:o4JXh1EVt9k/+g42oCprj/FisM4qX9L3sZB3upGN2ZU= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= @@ -169,12 +170,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= @@ -241,8 +238,8 @@ golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnf golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f h1:XdNn9LlyWAhLVp6P/i8QYBW+hlyhrhei9uErw2B5GJo= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f/go.mod h1:D5SMRVC3C2/4+F/DB1wZsLRnSNimn2Sp/NPsCrsv8ak= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884 h1:Y/Mj/94zIQQGHVSv1tTtQBDaQaJe62U9bkDZKKyhPCU= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -279,11 +276,11 @@ golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20220829200755-d48e67d00261/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.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/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= -golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= diff --git a/comp/checks/agentcrashdetect/agentcrashdetectimpl/agentcrashdetect.go b/comp/checks/agentcrashdetect/agentcrashdetectimpl/agentcrashdetect.go index d8631536c3a44..6098dcf98f629 100644 --- a/comp/checks/agentcrashdetect/agentcrashdetectimpl/agentcrashdetect.go +++ b/comp/checks/agentcrashdetect/agentcrashdetectimpl/agentcrashdetect.go @@ -168,11 +168,22 @@ func (wcd *AgentCrashDetect) Run() error { } log.Infof("Sending crash: %v", formatText(crash)) - lts := internaltelemetry.NewClient(wcd.tconfig.NewHTTPClient(), wcd.tconfig.TelemetryConfig.Endpoints, "ddnpm", true) + lts := internaltelemetry.NewClient(wcd.tconfig.NewHTTPClient(), toTelemEndpoints(wcd.tconfig.TelemetryConfig.Endpoints), "ddnpm", true) lts.SendLog("WARN", formatText(crash)) return nil } +func toTelemEndpoints(endpoints []*traceconfig.Endpoint) []*internaltelemetry.Endpoint { + telemEndpoints := make([]*internaltelemetry.Endpoint, 0, len(endpoints)) + for _, e := range endpoints { + telemEndpoints = append(telemEndpoints, &internaltelemetry.Endpoint{ + Host: e.Host, + APIKey: e.APIKey, + }) + } + return telemEndpoints +} + func newAgentCrashComponent(deps dependencies) agentcrashdetect.Component { instance := &agentCrashComponent{} instance.tconfig = deps.TConfig.Object() diff --git a/comp/core/agenttelemetry/impl/agenttelemetry.go b/comp/core/agenttelemetry/impl/agenttelemetry.go index 2b54f2b1eb5c7..e936282917900 100644 --- a/comp/core/agenttelemetry/impl/agenttelemetry.go +++ b/comp/core/agenttelemetry/impl/agenttelemetry.go @@ -208,12 +208,15 @@ func (a *atel) aggregateMetricTags(mCfg *MetricConfig, mt dto.MetricType, ms []* // create a key from the tags (and drop not specified in the configuration tags) var specTags = make([]*dto.LabelPair, 0, len(origTags)) + var sb strings.Builder for _, t := range tags { if _, ok := mCfg.aggregateTagsMap[t.GetName()]; ok { specTags = append(specTags, t) - tagsKey += makeLabelPairKey(t) + sb.WriteString(makeLabelPairKey(t)) } } + tagsKey = sb.String() + if mCfg.AggregateTotal { aggregateMetric(mt, totalm, m) } @@ -255,65 +258,73 @@ func (a *atel) aggregateMetricTags(mCfg *MetricConfig, mt dto.MetricType, ms []* return maps.Values(amMap) } +// Using Prometheus terminology. Metrics name or in "Prom" MetricFamily is technically a Datadog metrics. +// dto.Metric are a metric values for each timeseries (tag/value combination). func buildKeysForMetricsPreviousValues(mt dto.MetricType, metricName string, metrics []*dto.Metric) []string { keyNames := make([]string, 0, len(metrics)) for _, m := range metrics { var keyName string tags := m.GetLabel() if len(tags) == 0 { - // start with the metric name + // For "tagless" MetricFamily, len(metrics) will be 1, with single iteration and m.GetLabel() + // will be nil. Accordingly, to form a key for that metric its name alone is sufficient. keyName = metricName } else { - // Sort tags to stability of the key - sortedTags := cloneLabelsSorted(tags) - var builder strings.Builder - - // start with the metric name plus the tags - builder.WriteString(metricName) - for _, tag := range sortedTags { - builder.WriteString(makeLabelPairKey(tag)) - } - keyName = builder.String() + //If the metric has tags, len(metrics) will be equal to the number of metric's timeseries. + // Each timeseries or "m" on each iteration in this code, will contain a set of unique + // tagset (as m.GetLabel()). Accordingly, each timeseries should be represented by a unique + // and stable (reproducible) key formed by tagset key names and values. + keyName = fmt.Sprintf("%s%s:", metricName, convertLabelsToKey(tags)) } if mt == dto.MetricType_HISTOGRAM { - // add bucket names to the key + // On each iteration for metrics without tags (only 1 iteration) or with tags (iteration per + // timeseries). If the metric is a HISTOGRAM, each timeseries bucket individually plus + // implicit "+Inf" bucket. For example, for 3 timeseries with 4-bucket histogram, we will + // track 15 values using 15 keys (3x(4+1)). for _, bucket := range m.Histogram.GetBucket() { keyNames = append(keyNames, fmt.Sprintf("%v:%v", keyName, bucket.GetUpperBound())) } - } else { - keyNames = append(keyNames, keyName) } + + // Add the key for Counter, Gauge metric and HISTOGRAM's +Inf bucket + keyNames = append(keyNames, keyName) } return keyNames } +// Swap current value with the previous value and deduct the previous value from the current value +func deductAndUpdatePrevValue(key string, prevPromMetricValues map[string]uint64, curValue *uint64) { + origCurValue := *curValue + if prevValue, ok := prevPromMetricValues[key]; ok { + *curValue -= prevValue + } + prevPromMetricValues[key] = origCurValue +} + func convertPromHistogramsToDatadogHistogramsValues(metrics []*dto.Metric, prevPromMetricValues map[string]uint64, keyNames []string) { if len(metrics) > 0 { bucketCount := len(metrics[0].Histogram.GetBucket()) + var prevValue uint64 + for i, m := range metrics { - // First, deduct the previous cumulative count from the current one + // 1. deduct the previous cumulative count from each explicit buckets for j, b := range m.Histogram.GetBucket() { - key := keyNames[(i*bucketCount)+j] - curValue := b.GetCumulativeCount() - - // Adjust the counter value if found - if prevValue, ok := prevPromMetricValues[key]; ok { - *b.CumulativeCount -= prevValue - } - - // Upsert the cache of previous counter values - prevPromMetricValues[key] = curValue + deductAndUpdatePrevValue(keyNames[(i*(bucketCount+1))+j], prevPromMetricValues, b.CumulativeCount) } + // 2. deduct the previous cumulative count from the implicit "+Inf" bucket + deductAndUpdatePrevValue(keyNames[((i+1)*(bucketCount+1))-1], prevPromMetricValues, m.Histogram.SampleCount) - // Then, de-cumulate next bucket value from the previous bucket values - var prevValue uint64 + // 3. "De-cumulate" next explicit bucket value from the preceding bucket value + prevValue = 0 for _, b := range m.Histogram.GetBucket() { curValue := b.GetCumulativeCount() *b.CumulativeCount -= prevValue prevValue = curValue } + // 4. "De-cumulate" implicit "+Inf" bucket value from the preceding bucket value + *m.Histogram.SampleCount -= prevValue } } } diff --git a/comp/core/agenttelemetry/impl/agenttelemetry_test.go b/comp/core/agenttelemetry/impl/agenttelemetry_test.go index f0524cae80129..d982800caddd5 100644 --- a/comp/core/agenttelemetry/impl/agenttelemetry_test.go +++ b/comp/core/agenttelemetry/impl/agenttelemetry_test.go @@ -10,6 +10,7 @@ import ( "encoding/json" "fmt" "io" + "maps" "net/http" "testing" @@ -27,6 +28,7 @@ import ( "github.com/DataDog/datadog-agent/comp/core/telemetry" "github.com/DataDog/datadog-agent/comp/core/telemetry/telemetryimpl" "github.com/DataDog/datadog-agent/pkg/util/fxutil" + "github.com/DataDog/zstd" ) // HTTP client mock @@ -138,12 +140,14 @@ func makeLogMock(t *testing.T) log.Component { return logmock.New(t) } -func makeSenderImpl(t *testing.T, c string) sender { +func makeSenderImpl(t *testing.T, cl client, c string) sender { o := convertYamlStrToMap(t, c) cfg := makeCfgMock(t, o) log := makeLogMock(t) - client := newClientMock() - sndr, err := newSenderImpl(cfg, log, client) + if cl == nil { + cl = newClientMock() + } + sndr, err := newSenderImpl(cfg, log, cl) assert.NoError(t, err) return sndr } @@ -198,6 +202,94 @@ func getCommonOverrideConfig(enabled bool, site string) map[string]any { } } +func (p *Payload) UnmarshalAgentMetrics(itfPayload map[string]interface{}) error { + var ok bool + + p.RequestType = "agent-metrics" + p.APIVersion = itfPayload["request_type"].(string) + + var metricsItfPayload map[string]interface{} + metricsItfPayload, ok = itfPayload["payload"].(map[string]interface{}) + if !ok { + return fmt.Errorf("payload not found") + } + var metricsItf map[string]interface{} + metricsItf, ok = metricsItfPayload["metrics"].(map[string]interface{}) + if !ok { + return fmt.Errorf("metrics not found") + } + + var err error + var metricsPayload AgentMetricsPayload + metricsPayload.Metrics = make(map[string]interface{}) + for k, v := range metricsItf { + if k == "agent_metadata" { + // Re(un)marshal the meatadata + var metadata AgentMetadataPayload + var metadataBytes []byte + if metadataBytes, err = json.Marshal(v); err != nil { + return err + } + if err = json.Unmarshal(metadataBytes, &metadata); err != nil { + return err + } + metricsPayload.Metrics[k] = metadata + } else { + // Re(un)marshal the metric + var metric MetricPayload + var metricBytes []byte + if metricBytes, err = json.Marshal(v); err != nil { + return err + } + if err = json.Unmarshal(metricBytes, &metric); err != nil { + return err + } + metricsPayload.Metrics[k] = metric + } + } + p.Payload = metricsPayload + return nil +} + +func (p *Payload) UnmarshalMessageBatch(itfPayload map[string]interface{}) error { + payloadsRaw, ok := itfPayload["payload"].([]interface{}) + if !ok { + return fmt.Errorf("payload not found") + } + + // ensure all payloads which should be agent-metrics + var payloads []Payload + for _, payloadRaw := range payloadsRaw { + itfChildPayload, ok := payloadRaw.(map[string]interface{}) + if !ok { + return fmt.Errorf("invalid payload item type") + } + + requestTypeRaw, ok := itfChildPayload["request_type"] + if !ok { + return fmt.Errorf("request_type not found") + } + requestType, ok := requestTypeRaw.(string) + if !ok { + return fmt.Errorf("request_type type is invalid") + } + + if requestType != "agent-metrics" { + return fmt.Errorf("request_type should be agent-metrics") + } + + var payload Payload + if err := payload.UnmarshalAgentMetrics(itfChildPayload); err != nil { + return err + } + payloads = append(payloads, payload) + + } + p.Payload = payloads + + return nil +} + // This is a unit test function do not use it for actual code (at least yet) // since it is not 100% full implementation of the unmarshalling func (p *Payload) UnmarshalJSON(b []byte) (err error) { @@ -206,60 +298,21 @@ func (p *Payload) UnmarshalJSON(b []byte) (err error) { return err } - requestType, ok := itfPayload["request_type"] + requestTypeRaw, ok := itfPayload["request_type"] if !ok { return fmt.Errorf("request_type not found") } - if requestType.(string) == "agent-metrics" { - p.RequestType = requestType.(string) - p.APIVersion = itfPayload["request_type"].(string) - p.EventTime = int64(itfPayload["event_time"].(float64)) - p.DebugFlag = itfPayload["debug"].(bool) - - var metricsItfPayload map[string]interface{} - metricsItfPayload, ok = itfPayload["payload"].(map[string]interface{}) - if !ok { - return fmt.Errorf("payload not found") - } - var metricsItf map[string]interface{} - metricsItf, ok = metricsItfPayload["metrics"].(map[string]interface{}) - if !ok { - return fmt.Errorf("metrics not found") - } + requestType, ok := requestTypeRaw.(string) + if !ok { + return fmt.Errorf("request_type type is invalid") + } - var metricsPayload AgentMetricsPayload - metricsPayload.Metrics = make(map[string]interface{}) - for k, v := range metricsItf { - if k == "agent_metadata" { - // Re(un)marshal the meatadata - var metadata AgentMetadataPayload - var metadataBytes []byte - if metadataBytes, err = json.Marshal(v); err != nil { - return err - } - if err = json.Unmarshal(metadataBytes, &metadata); err != nil { - return err - } - metricsPayload.Metrics[k] = metadata - } else { - // Re(un)marshal the metric - var metric MetricPayload - var metricBytes []byte - if metricBytes, err = json.Marshal(v); err != nil { - return err - } - if err = json.Unmarshal(metricBytes, &metric); err != nil { - return err - } - metricsPayload.Metrics[k] = metric - } - } - p.Payload = metricsPayload - return nil + if requestType == "agent-metrics" { + return p.UnmarshalAgentMetrics(itfPayload) } - if requestType.(string) == "message-batch" { - return fmt.Errorf("message-batch request_type is not supported yet") + if requestType == "message-batch" { + return p.UnmarshalMessageBatch(itfPayload) } return fmt.Errorf("request_type should be either agent-metrics or message-batch") @@ -290,6 +343,34 @@ func getPayloadMetric(a *atel, metricName string) (*MetricPayload, bool) { return nil, false } +func getPayloadMetrics(a *atel, metricName string) ([]*MetricPayload, bool) { + payload, err := getPayload(a) + if err != nil { + return nil, false + } + + var payloads []*MetricPayload + for _, payload := range payload.Payload.([]Payload) { + metrics := payload.Payload.(AgentMetricsPayload).Metrics + if metricItf, ok := metrics[metricName]; ok { + metric := metricItf.(MetricPayload) + payloads = append(payloads, &metric) + } + } + + return payloads, true +} + +func getPayloadMetricByTagValues(metrics []*MetricPayload, tags map[string]interface{}) (*MetricPayload, bool) { + for _, m := range metrics { + if maps.Equal(m.Tags, tags) { + return m, true + } + } + + return nil, false +} + // Validate the payload // metric, ok := metrics["foo.bar"] @@ -474,10 +555,10 @@ func TestNoTagSpecifiedAggregationHistogram(t *testing.T) { // setup and initiate atel tel := makeTelMock(t) buckets := []float64{10, 100, 1000, 10000} - gauge := tel.NewHistogram("bar", "zoo", []string{"tag1", "tag2", "tag3"}, "", buckets) - gauge.WithTags(map[string]string{"tag1": "a1", "tag2": "b1", "tag3": "c1"}).Observe(1001) - gauge.WithTags(map[string]string{"tag1": "a2", "tag2": "b2", "tag3": "c2"}).Observe(1002) - gauge.WithTags(map[string]string{"tag1": "a3", "tag2": "b3", "tag3": "c3"}).Observe(1003) + hist := tel.NewHistogram("bar", "zoo", []string{"tag1", "tag2", "tag3"}, "", buckets) + hist.WithTags(map[string]string{"tag1": "a1", "tag2": "b1", "tag3": "c1"}).Observe(1001) + hist.WithTags(map[string]string{"tag1": "a2", "tag2": "b2", "tag3": "c2"}).Observe(1002) + hist.WithTags(map[string]string{"tag1": "a3", "tag2": "b3", "tag3": "c3"}).Observe(1003) o := convertYamlStrToMap(t, c) s := &senderMock{} @@ -636,7 +717,7 @@ func TestTwoProfilesOnTheSameScheduleGenerateSinglePayload(t *testing.T) { counter2.AddWithTags(20, map[string]string{"tag1": "a1", "tag2": "b1", "tag3": "c1"}) o := convertYamlStrToMap(t, c) - s := makeSenderImpl(t, c) + s := makeSenderImpl(t, nil, c) r := newRunnerMock() a := getTestAtel(t, tel, o, s, nil, r) require.True(t, a.enabled) @@ -673,7 +754,7 @@ func TestOneProfileWithOneMetricMultipleContextsGenerateTwoPayloads(t *testing.T counter1.AddWithTags(20, map[string]string{"tag1": "a2", "tag2": "b2", "tag3": "c2"}) o := convertYamlStrToMap(t, c) - s := makeSenderImpl(t, c) + s := makeSenderImpl(t, nil, c) r := newRunnerMock() a := getTestAtel(t, tel, o, s, nil, r) require.True(t, a.enabled) @@ -749,7 +830,7 @@ func TestOneProfileWithTwoMetricGenerateSinglePayloads(t *testing.T) { counter2.AddWithTags(20, map[string]string{"tag1": "a1", "tag2": "b1", "tag3": "c1"}) o := convertYamlStrToMap(t, c) - s := makeSenderImpl(t, c) + s := makeSenderImpl(t, nil, c) r := newRunnerMock() a := getTestAtel(t, tel, o, s, nil, r) require.True(t, a.enabled) @@ -771,7 +852,7 @@ func TestSenderConfigNoConfig(t *testing.T) { agent_telemetry: enabled: true ` - sndr := makeSenderImpl(t, c) + sndr := makeSenderImpl(t, nil, c) url := buildURL(sndr.(*senderImpl).endpoints.Main) assert.Equal(t, "https://instrumentation-telemetry-intake.datadoghq.com/api/v2/apmtelemetry", url) @@ -799,7 +880,7 @@ func TestSenderConfigOnlySites(t *testing.T) { for _, tt := range tests { c := fmt.Sprintf(ctemp, tt.site) - sndr := makeSenderImpl(t, c) + sndr := makeSenderImpl(t, nil, c) url := buildURL(sndr.(*senderImpl).endpoints.Main) assert.Equal(t, tt.testURL, url) } @@ -816,7 +897,7 @@ func TestSenderConfigAdditionalEndpoint(t *testing.T) { - api_key: bar host: instrumentation-telemetry-intake.us5.datadoghq.com ` - sndr := makeSenderImpl(t, c) + sndr := makeSenderImpl(t, nil, c) assert.NotNil(t, sndr) assert.Len(t, sndr.(*senderImpl).endpoints.Endpoints, 2) @@ -835,7 +916,7 @@ func TestSenderConfigPartialDDUrl(t *testing.T) { enabled: true dd_url: instrumentation-telemetry-intake.us5.datadoghq.com. ` - sndr := makeSenderImpl(t, c) + sndr := makeSenderImpl(t, nil, c) assert.NotNil(t, sndr) assert.Len(t, sndr.(*senderImpl).endpoints.Endpoints, 1) @@ -852,7 +933,7 @@ func TestSenderConfigFullDDUrl(t *testing.T) { enabled: true dd_url: https://instrumentation-telemetry-intake.us5.datadoghq.com. ` - sndr := makeSenderImpl(t, c) + sndr := makeSenderImpl(t, nil, c) assert.NotNil(t, sndr) assert.Len(t, sndr.(*senderImpl).endpoints.Endpoints, 1) @@ -872,7 +953,7 @@ func TestSenderConfigDDUrlWithAdditionalEndpoints(t *testing.T) { - api_key: bar host: instrumentation-telemetry-intake.us3.datadoghq.com. ` - sndr := makeSenderImpl(t, c) + sndr := makeSenderImpl(t, nil, c) assert.NotNil(t, sndr) assert.Len(t, sndr.(*senderImpl).endpoints.Endpoints, 2) @@ -892,7 +973,7 @@ func TestSenderConfigDDUrlWithEmptyAdditionalPoint(t *testing.T) { dd_url: instrumentation-telemetry-intake.us5.datadoghq.com. additional_endpoints: ` - sndr := makeSenderImpl(t, c) + sndr := makeSenderImpl(t, nil, c) assert.NotNil(t, sndr) assert.Len(t, sndr.(*senderImpl).endpoints.Endpoints, 1) @@ -932,7 +1013,7 @@ func TestGetAsJSONScrub(t *testing.T) { counter3.AddWithTags(11, map[string]string{"text": "test"}) o := convertYamlStrToMap(t, c) - s := makeSenderImpl(t, c) + s := makeSenderImpl(t, nil, c) r := newRunnerMock() a := getTestAtel(t, tel, o, s, nil, r) require.True(t, a.enabled) @@ -955,7 +1036,7 @@ func TestGetAsJSONScrub(t *testing.T) { assert.Equal(t, "test", metric.(MetricPayload).Tags["text"]) } -func TestAdjustPrometheusCounterValue(t *testing.T) { +func TestAdjustPrometheusCounterValueMultipleTags(t *testing.T) { var c = ` agent_telemetry: enabled: true @@ -980,7 +1061,7 @@ func TestAdjustPrometheusCounterValue(t *testing.T) { // setup and initiate atel tel := makeTelMock(t) o := convertYamlStrToMap(t, c) - s := makeSenderImpl(t, c) + s := makeSenderImpl(t, nil, c) r := newRunnerMock() a := getTestAtel(t, tel, o, s, nil, r) require.True(t, a.enabled) @@ -1073,6 +1154,189 @@ func TestAdjustPrometheusCounterValue(t *testing.T) { } } +func TestAdjustPrometheusCounterValueMultipleTagValues(t *testing.T) { + var c = ` + agent_telemetry: + enabled: true + profiles: + - name: xxx + metric: + metrics: + - name: foo.bar + aggregate_tags: + - tag + ` + + // setup and initiate atel + tel := makeTelMock(t) + o := convertYamlStrToMap(t, c) + s := makeSenderImpl(t, nil, c) + r := newRunnerMock() + a := getTestAtel(t, tel, o, s, nil, r) + require.True(t, a.enabled) + + // setup metrics using few family names, metric names and tag- and tag-less counters + // to test various scenarios + counter := tel.NewCounter("foo", "bar", []string{"tag"}, "") + + // First addition (expected values should be the same as the added values) + counter.AddWithTags(1, map[string]string{"tag": "val1"}) + counter.AddWithTags(2, map[string]string{"tag": "val2"}) + + ms, ok := getPayloadMetrics(a, "foo.bar") + require.True(t, ok) + m1, ok1 := getPayloadMetricByTagValues(ms, map[string]interface{}{"tag": "val1"}) + require.True(t, ok1) + assert.Equal(t, m1.Value, 1.0) + m2, ok2 := getPayloadMetricByTagValues(ms, map[string]interface{}{"tag": "val2"}) + require.True(t, ok2) + assert.Equal(t, m2.Value, 2.0) + + // Second addition (expected values should be the same as the added values) + counter.AddWithTags(10, map[string]string{"tag": "val1"}) + counter.AddWithTags(20, map[string]string{"tag": "val2"}) + ms, ok = getPayloadMetrics(a, "foo.bar") + require.True(t, ok) + m1, ok1 = getPayloadMetricByTagValues(ms, map[string]interface{}{"tag": "val1"}) + require.True(t, ok1) + assert.Equal(t, m1.Value, 10.0) + m2, ok2 = getPayloadMetricByTagValues(ms, map[string]interface{}{"tag": "val2"}) + require.True(t, ok2) + assert.Equal(t, m2.Value, 20.0) + + // Third and fourth addition (expected values should be the sum of 3rd and 4th values) + counter.AddWithTags(100, map[string]string{"tag": "val1"}) + counter.AddWithTags(200, map[string]string{"tag": "val2"}) + ms, ok = getPayloadMetrics(a, "foo.bar") + require.True(t, ok) + m1, ok1 = getPayloadMetricByTagValues(ms, map[string]interface{}{"tag": "val1"}) + require.True(t, ok1) + assert.Equal(t, m1.Value, 100.0) + m2, ok2 = getPayloadMetricByTagValues(ms, map[string]interface{}{"tag": "val2"}) + require.True(t, ok2) + assert.Equal(t, m2.Value, 200.0) + + // No addition (expected values should be zero) + ms, ok = getPayloadMetrics(a, "foo.bar") + require.True(t, ok) + m1, ok1 = getPayloadMetricByTagValues(ms, map[string]interface{}{"tag": "val1"}) + require.True(t, ok1) + assert.Equal(t, m1.Value, 0.0) + m2, ok2 = getPayloadMetricByTagValues(ms, map[string]interface{}{"tag": "val2"}) + require.True(t, ok2) + assert.Equal(t, m2.Value, 0.0) +} + +func TestAdjustPrometheusCounterValueTagless(t *testing.T) { + var c = ` + agent_telemetry: + enabled: true + profiles: + - name: xxx + metric: + metrics: + - name: foo.bar + - name: foo.cat + - name: zoo.bar + - name: zoo.cat + ` + + // setup and initiate atel + tel := makeTelMock(t) + o := convertYamlStrToMap(t, c) + s := makeSenderImpl(t, nil, c) + r := newRunnerMock() + a := getTestAtel(t, tel, o, s, nil, r) + require.True(t, a.enabled) + + // setup metrics using few family names, metric names and tag- and tag-less counters + // to test various scenarios + counter1 := tel.NewCounter("foo", "bar", nil, "") + counter2 := tel.NewCounter("foo", "cat", nil, "") + counter3 := tel.NewCounter("zoo", "bar", nil, "") + counter4 := tel.NewCounter("zoo", "cat", nil, "") + + // First addition (expected values should be the same as the added values) + counter1.Add(1) + counter2.Add(2) + counter3.Add(3) + counter4.Add(4) + payload1, err1 := getPayload(a) + require.NoError(t, err1) + metrics1 := payload1.Payload.(AgentMetricsPayload).Metrics + expecVals1 := map[string]float64{ + "foo.bar": 1.0, + "foo.cat": 2.0, + "zoo.bar": 3.0, + "zoo.cat": 4.0, + } + for ek, ev := range expecVals1 { + v, ok := metrics1[ek] + require.True(t, ok) + assert.Equal(t, ev, v.(MetricPayload).Value) + } + + // Second addition (expected values should be the same as the added values) + counter1.Add(10) + counter2.Add(20) + counter3.Add(30) + counter4.Add(40) + payload2, err2 := getPayload(a) + require.NoError(t, err2) + metrics2 := payload2.Payload.(AgentMetricsPayload).Metrics + expecVals2 := map[string]float64{ + "foo.bar": 10.0, + "foo.cat": 20.0, + "zoo.bar": 30.0, + "zoo.cat": 40.0, + } + for ek, ev := range expecVals2 { + v, ok := metrics2[ek] + require.True(t, ok) + assert.Equal(t, ev, v.(MetricPayload).Value) + } + + // Third and fourth addition (expected values should be the sum of 3rd and 4th values) + counter1.Add(100) + counter2.Add(200) + counter3.Add(300) + counter4.Add(400) + counter1.Add(1000) + counter2.Add(2000) + counter3.Add(3000) + counter4.Add(4000) + payload34, err34 := getPayload(a) + require.NoError(t, err34) + metrics34 := payload34.Payload.(AgentMetricsPayload).Metrics + expecVals34 := map[string]float64{ + "foo.bar": 1100.0, + "foo.cat": 2200.0, + "zoo.bar": 3300.0, + "zoo.cat": 4400.0, + } + for ek, ev := range expecVals34 { + v, ok := metrics34[ek] + require.True(t, ok) + assert.Equal(t, ev, v.(MetricPayload).Value) + } + + // No addition (expected values should be zero) + payload5, err5 := getPayload(a) + require.NoError(t, err5) + metrics5 := payload5.Payload.(AgentMetricsPayload).Metrics + expecVals5 := map[string]float64{ + "foo.bar": 0.0, + "foo.cat": 0.0, + "zoo.bar": 0.0, + "zoo.cat": 0.0, + } + for ek, ev := range expecVals5 { + v, ok := metrics5[ek] + require.True(t, ok) + assert.Equal(t, ev, v.(MetricPayload).Value) + } +} + func TestHistogramFloatUpperBoundNormalization(t *testing.T) { var c = ` agent_telemetry: @@ -1087,7 +1351,7 @@ func TestHistogramFloatUpperBoundNormalization(t *testing.T) { // setup and initiate atel tel := makeTelMock(t) o := convertYamlStrToMap(t, c) - s := makeSenderImpl(t, c) + s := makeSenderImpl(t, nil, c) r := newRunnerMock() a := getTestAtel(t, tel, o, s, nil, r) require.True(t, a.enabled) @@ -1113,16 +1377,20 @@ func TestHistogramFloatUpperBoundNormalization(t *testing.T) { hist.Observe(100) hist.Observe(100) hist.Observe(100) + // +inf - 2 + hist.Observe(10000) + hist.Observe(20000) // Test payload1 metric1, ok := getPayloadMetric(a, "foo.bar") require.True(t, ok) - require.True(t, len(metric1.Buckets) > 0) + require.Len(t, metric1.Buckets, 5) expecVals1 := map[string]uint64{ - "1": 5, - "2": 0, - "5": 3, - "100": 6, + "1": 5, + "2": 0, + "5": 3, + "100": 6, + "+Inf": 2, } for k, b := range metric1.Buckets { assert.Equal(t, expecVals1[k], b) @@ -1131,12 +1399,13 @@ func TestHistogramFloatUpperBoundNormalization(t *testing.T) { // Test payload2 (no new observations, everything is reset) metric2, ok := getPayloadMetric(a, "foo.bar") require.True(t, ok) - require.True(t, len(metric2.Buckets) > 0) + require.Len(t, metric2.Buckets, 5) expecVals2 := map[string]uint64{ - "1": 0, - "2": 0, - "5": 0, - "100": 0, + "1": 0, + "2": 0, + "5": 0, + "100": 0, + "+Inf": 0, } for k, b := range metric2.Buckets { assert.Equal(t, expecVals2[k], b) @@ -1162,15 +1431,21 @@ func TestHistogramFloatUpperBoundNormalization(t *testing.T) { hist.Observe(100) hist.Observe(100) hist.Observe(100) + // +inf - 3 + hist.Observe(10000) + hist.Observe(20000) + hist.Observe(30000) + // Test payload3 metric3, ok := getPayloadMetric(a, "foo.bar") require.True(t, ok) - require.True(t, len(metric3.Buckets) > 0) + require.Len(t, metric3.Buckets, 5) expecVals3 := map[string]uint64{ - "1": 5, - "2": 0, - "5": 3, - "100": 6, + "1": 5, + "2": 0, + "5": 3, + "100": 6, + "+Inf": 3, } for k, b := range metric3.Buckets { assert.Equal(t, expecVals3[k], b) @@ -1202,7 +1477,7 @@ func TestHistogramFloatUpperBoundNormalizationWithTags(t *testing.T) { // setup and initiate atel tel := makeTelMock(t) o := convertYamlStrToMap(t, c) - s := makeSenderImpl(t, c) + s := makeSenderImpl(t, nil, c) r := newRunnerMock() a := getTestAtel(t, tel, o, s, nil, r) require.True(t, a.enabled) @@ -1232,12 +1507,13 @@ func TestHistogramFloatUpperBoundNormalizationWithTags(t *testing.T) { // Test payload1 metric1, ok := getPayloadMetric(a, "foo.bar") require.True(t, ok) - require.True(t, len(metric1.Buckets) > 0) + require.Len(t, metric1.Buckets, 5) expecVals1 := map[string]uint64{ - "1": 5, - "2": 0, - "5": 3, - "100": 6, + "1": 5, + "2": 0, + "5": 3, + "100": 6, + "+inf": 0, } for k, b := range metric1.Buckets { assert.Equal(t, expecVals1[k], b) @@ -1246,12 +1522,13 @@ func TestHistogramFloatUpperBoundNormalizationWithTags(t *testing.T) { // Test payload2 (no new observations, everything is reset) metric2, ok := getPayloadMetric(a, "foo.bar") require.True(t, ok) - require.True(t, len(metric2.Buckets) > 0) + require.Len(t, metric2.Buckets, 5) expecVals2 := map[string]uint64{ - "1": 0, - "2": 0, - "5": 0, - "100": 0, + "1": 0, + "2": 0, + "5": 0, + "100": 0, + "+inf": 0, } for k, b := range metric2.Buckets { assert.Equal(t, expecVals2[k], b) @@ -1280,12 +1557,13 @@ func TestHistogramFloatUpperBoundNormalizationWithTags(t *testing.T) { // Test payload3 metric3, ok := getPayloadMetric(a, "foo.bar") require.True(t, ok) - require.True(t, len(metric3.Buckets) > 0) + require.Len(t, metric3.Buckets, 5) expecVals3 := map[string]uint64{ - "1": 5, - "2": 0, - "5": 3, - "100": 6, + "1": 5, + "2": 0, + "5": 3, + "100": 6, + "+inf": 0, } for k, b := range metric3.Buckets { assert.Equal(t, expecVals3[k], b) @@ -1299,3 +1577,393 @@ func TestHistogramFloatUpperBoundNormalizationWithTags(t *testing.T) { assert.Equal(t, expecVals4[i], b.Count) } } + +func TestHistogramFloatUpperBoundNormalizationWithMultivalueTags(t *testing.T) { + var c = ` + agent_telemetry: + enabled: true + profiles: + - name: xxx + metric: + metrics: + - name: foo.bar + aggregate_tags: + - tag + ` + + // setup and initiate atel + tel := makeTelMock(t) + o := convertYamlStrToMap(t, c) + s := makeSenderImpl(t, nil, c) + r := newRunnerMock() + a := getTestAtel(t, tel, o, s, nil, r) + require.True(t, a.enabled) + + // setup and initiate atel + hist := tel.NewHistogram("foo", "bar", []string{"tag"}, "", []float64{1, 2, 5, 100}) + + // bucket 0 - 5 + hist.Observe(1, "val1") + hist.Observe(1, "val1") + hist.Observe(1, "val1") + hist.Observe(1, "val1") + hist.Observe(1, "val1") + // bucket 1 - 0 + // .. + // bucket 2 - 3 + hist.Observe(5, "val1") + hist.Observe(5, "val1") + hist.Observe(5, "val1") + // bucket 4 - 6 + hist.Observe(6, "val1") + hist.Observe(100, "val1") + hist.Observe(100, "val1") + hist.Observe(100, "val1") + hist.Observe(100, "val1") + hist.Observe(100, "val1") + // bucket +inf - 2 + hist.Observe(1000, "val1") + hist.Observe(2000, "val1") + + // bucket 0 - 10 + hist.Observe(1, "val2") + hist.Observe(1, "val2") + hist.Observe(1, "val2") + hist.Observe(1, "val2") + hist.Observe(1, "val2") + hist.Observe(1, "val2") + hist.Observe(1, "val2") + hist.Observe(1, "val2") + hist.Observe(1, "val2") + hist.Observe(1, "val2") + // bucket 1 - 5 + hist.Observe(2, "val2") + hist.Observe(2, "val2") + hist.Observe(2, "val2") + hist.Observe(2, "val2") + hist.Observe(2, "val2") + // bucket 2 - 6 + hist.Observe(5, "val2") + hist.Observe(5, "val2") + hist.Observe(5, "val2") + hist.Observe(5, "val2") + hist.Observe(5, "val2") + hist.Observe(5, "val2") + // bucket 4 - 12 + hist.Observe(6, "val2") + hist.Observe(6, "val2") + hist.Observe(100, "val2") + hist.Observe(100, "val2") + hist.Observe(100, "val2") + hist.Observe(100, "val2") + hist.Observe(100, "val2") + hist.Observe(100, "val2") + hist.Observe(100, "val2") + hist.Observe(100, "val2") + hist.Observe(100, "val2") + hist.Observe(100, "val2") + // bucket +inf - 4 + hist.Observe(1000, "val2") + hist.Observe(1000, "val2") + hist.Observe(2000, "val2") + hist.Observe(2000, "val2") + + // Test payload1 + metrics1, ok := getPayloadMetrics(a, "foo.bar") + require.True(t, ok) + require.Len(t, metrics1, 2) + require.Len(t, metrics1[0].Buckets, 5) + expecVals1 := map[string]struct { + n1 uint64 + n2 uint64 + }{ + "1": {5, 10}, + "2": {0, 5}, + "5": {3, 6}, + "100": {6, 12}, + "+Inf": {2, 4}, + } + metrics11, ok := getPayloadMetricByTagValues(metrics1, map[string]interface{}{"tag": "val1"}) + require.True(t, ok) + for k, b := range metrics11.Buckets { + assert.Equal(t, expecVals1[k].n1, b) + } + metrics12, ok := getPayloadMetricByTagValues(metrics1, map[string]interface{}{"tag": "val2"}) + require.True(t, ok) + for k, b := range metrics12.Buckets { + assert.Equal(t, expecVals1[k].n2, b) + } + + // Test payload2 (no new observations, everything is reset) + metrics2, ok := getPayloadMetrics(a, "foo.bar") + require.True(t, ok) + require.Len(t, metrics2, 2) + require.Len(t, metrics2[0].Buckets, 5) + require.Len(t, metrics2[1].Buckets, 5) + expecVals2 := map[string]struct { + n1 uint64 + n2 uint64 + }{ + "1": {0, 0}, + "2": {0, 0}, + "5": {0, 0}, + "100": {0, 0}, + "+Inf": {0, 0}, + } + metrics21, ok := getPayloadMetricByTagValues(metrics2, map[string]interface{}{"tag": "val1"}) + require.True(t, ok) + for k, b := range metrics21.Buckets { + assert.Equal(t, expecVals2[k].n1, b) + } + metrics22, ok := getPayloadMetricByTagValues(metrics2, map[string]interface{}{"tag": "val2"}) + require.True(t, ok) + for k, b := range metrics22.Buckets { + assert.Equal(t, expecVals2[k].n2, b) + } + + // Repeat the same observation with the same results) + // bucket 0 - 5 + hist.Observe(1, "val1") + hist.Observe(1, "val1") + hist.Observe(1, "val1") + hist.Observe(1, "val1") + hist.Observe(1, "val1") + // bucket 1 - 0 + // .. + // bucket 2 - 3 + hist.Observe(5, "val1") + hist.Observe(5, "val1") + hist.Observe(5, "val1") + // bucket 4 - 6 + hist.Observe(6, "val1") + hist.Observe(100, "val1") + hist.Observe(100, "val1") + hist.Observe(100, "val1") + hist.Observe(100, "val1") + hist.Observe(100, "val1") + // bucket +inf - 2 + hist.Observe(1000, "val1") + hist.Observe(2000, "val1") + + // bucket 0 - 10 + hist.Observe(1, "val2") + hist.Observe(1, "val2") + hist.Observe(1, "val2") + hist.Observe(1, "val2") + hist.Observe(1, "val2") + hist.Observe(1, "val2") + hist.Observe(1, "val2") + hist.Observe(1, "val2") + hist.Observe(1, "val2") + hist.Observe(1, "val2") + // bucket 1 - 5 + hist.Observe(2, "val2") + hist.Observe(2, "val2") + hist.Observe(2, "val2") + hist.Observe(2, "val2") + hist.Observe(2, "val2") + // bucket 2 - 6 + hist.Observe(5, "val2") + hist.Observe(5, "val2") + hist.Observe(5, "val2") + hist.Observe(5, "val2") + hist.Observe(5, "val2") + hist.Observe(5, "val2") + // bucket 4 - 12 + hist.Observe(6, "val2") + hist.Observe(6, "val2") + hist.Observe(100, "val2") + hist.Observe(100, "val2") + hist.Observe(100, "val2") + hist.Observe(100, "val2") + hist.Observe(100, "val2") + hist.Observe(100, "val2") + hist.Observe(100, "val2") + hist.Observe(100, "val2") + hist.Observe(100, "val2") + hist.Observe(100, "val2") + // bucket +inf - 4 + hist.Observe(1000, "val2") + hist.Observe(1000, "val2") + hist.Observe(2000, "val2") + hist.Observe(2000, "val2") + + // Test payload3 + metrics3, ok := getPayloadMetrics(a, "foo.bar") + require.True(t, ok) + require.Len(t, metrics3, 2) + require.Len(t, metrics3[0].Buckets, 5) + require.Len(t, metrics3[1].Buckets, 5) + expecVals3 := map[string]struct { + n1 uint64 + n2 uint64 + }{ + "1": {5, 10}, + "2": {0, 5}, + "5": {3, 6}, + "100": {6, 12}, + "+Inf": {2, 4}, + } + metrics31, ok := getPayloadMetricByTagValues(metrics3, map[string]interface{}{"tag": "val1"}) + require.True(t, ok) + for k, b := range metrics31.Buckets { + assert.Equal(t, expecVals3[k].n1, b) + } + metrics32, ok := getPayloadMetricByTagValues(metrics3, map[string]interface{}{"tag": "val2"}) + require.True(t, ok) + for k, b := range metrics32.Buckets { + assert.Equal(t, expecVals3[k].n2, b) + } + + // Test raw buckets, they should be still accumulated + tags1 := map[string]string{"tag": "val1"} + rawHist1 := hist.WithTags(tags1) + expecVals41 := []uint64{10, 10, 16, 28} + for i, b := range rawHist1.Get().Buckets { + assert.Equal(t, expecVals41[i], b.Count) + } + tags2 := map[string]string{"tag": "val2"} + rawHist2 := hist.WithTags(tags2) + expecVals42 := []uint64{20, 30, 42, 66} + for i, b := range rawHist2.Get().Buckets { + assert.Equal(t, expecVals42[i], b.Count) + } +} + +func TestHistogramPercentile(t *testing.T) { + var c = ` + agent_telemetry: + enabled: true + profiles: + - name: xxx + metric: + metrics: + - name: foo.bar + ` + + // setup and initiate atel + tel := makeTelMock(t) + o := convertYamlStrToMap(t, c) + s := makeSenderImpl(t, nil, c) + r := newRunnerMock() + a := getTestAtel(t, tel, o, s, nil, r) + require.True(t, a.enabled) + + // setup and initiate atel + hist := tel.NewHistogram("foo", "bar", nil, "", []float64{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}) + for i := 1; i <= 10; i++ { + hist.Observe(1) + hist.Observe(2) + hist.Observe(3) + hist.Observe(4) + hist.Observe(5) + hist.Observe(6) + hist.Observe(7) + hist.Observe(8) + hist.Observe(9) + } + hist.Observe(10) + hist.Observe(10) + + metric, ok := getPayloadMetric(a, "foo.bar") + require.True(t, ok) + require.NotNil(t, metric.P75) + require.NotNil(t, metric.P95) + require.NotNil(t, metric.P99) + + // 75% of 92 observations is 69.0 (upper bound of the 6th bucket - 7) + // 95% of 92 observations is 87.0 (upper bound of the 8th bucket - 9) + // 95% of 92 observations is 92.0 (upper bound of the 10th bucket - 10) + assert.Equal(t, 7.0, *metric.P75) + assert.Equal(t, 9.0, *metric.P95) + assert.Equal(t, 10.0, *metric.P99) + + // Test percentile in +Inf upper bound (p75 in 10th bucket) and p95 and p99 in +Inf bucket) + for i := 1; i <= 10; i++ { + hist.Observe(10) + } + for i := 1; i <= 4; i++ { + hist.Observe(11) + } + + metric, ok = getPayloadMetric(a, "foo.bar") + require.True(t, ok) + require.NotNil(t, metric.P75) + require.NotNil(t, metric.P95) + require.NotNil(t, metric.P99) + + // For percentile point of view +Inf bucket upper boundary is 2x of last explicit upper boundary + // maybe in the future it will be configurable + assert.Equal(t, 10.0, *metric.P75) + assert.Equal(t, 20.0, *metric.P95) + assert.Equal(t, 20.0, *metric.P99) +} + +func TestUsingPayloadCompressionInAgentTelemetrySender(t *testing.T) { + // Run with compression (by default default) + var cfg1 = ` + agent_telemetry: + enabled: true + profiles: + - name: xxx + metric: + metrics: + - name: foo.bar + ` + + tel := makeTelMock(t) + hist := tel.NewHistogram("foo", "bar", nil, "", []float64{1, 2, 5, 100}) + hist.Observe(1) + hist.Observe(5) + hist.Observe(6) + hist.Observe(100) + + // setup and initiate atel + o1 := convertYamlStrToMap(t, cfg1) + cl1 := newClientMock() + s1 := makeSenderImpl(t, cl1, cfg1) + r1 := newRunnerMock() + a1 := getTestAtel(t, tel, o1, s1, cl1, r1) + require.True(t, a1.enabled) + + // run the runner to trigger the telemetry report + a1.start() + r1.(*runnerMock).run() + assert.True(t, len(cl1.(*clientMock).body) > 0) + + // Run without compression + var cfg2 = ` + agent_telemetry: + use_compression: false + enabled: true + profiles: + - name: xxx + metric: + metrics: + - name: foo.bar + aggregate_tags: + ` + + // setup and initiate atel + o2 := convertYamlStrToMap(t, cfg2) + cl2 := newClientMock() + s2 := makeSenderImpl(t, cl2, cfg2) + r2 := newRunnerMock() + a2 := getTestAtel(t, tel, o2, s2, cl2, r2) + require.True(t, a2.enabled) + + // run the runner to trigger the telemetry report + a2.start() + r2.(*runnerMock).run() + assert.True(t, len(cl2.(*clientMock).body) > 0) + decompressBody, err := zstd.Decompress(nil, cl1.(*clientMock).body) + require.NoError(t, err) + require.NotZero(t, len(decompressBody)) + + // we cannot compare body (time stamp different and internal + // bucket serialization, but success above and significant size differences + // should be suffient + compressBodyLen := len(cl1.(*clientMock).body) + nonCompressBodyLen := len(cl2.(*clientMock).body) + assert.True(t, float64(nonCompressBodyLen)/float64(compressBodyLen) > 1.5) +} diff --git a/comp/core/agenttelemetry/impl/sender.go b/comp/core/agenttelemetry/impl/sender.go index 585807eb6a539..b7b62f460b933 100644 --- a/comp/core/agenttelemetry/impl/sender.go +++ b/comp/core/agenttelemetry/impl/sender.go @@ -11,6 +11,7 @@ import ( "encoding/json" "errors" "fmt" + "math" "net/http" "net/url" "strconv" @@ -26,6 +27,7 @@ import ( httputils "github.com/DataDog/datadog-agent/pkg/util/http" "github.com/DataDog/datadog-agent/pkg/util/scrubber" "github.com/DataDog/datadog-agent/pkg/version" + "github.com/DataDog/zstd" ) const ( @@ -57,7 +59,9 @@ type senderImpl struct { cfgComp config.Reader logComp log.Component - client client + compress bool + compressionLevel int + client client endpoints *logconfig.Endpoints @@ -133,6 +137,9 @@ type MetricPayload struct { Type string `json:"type"` Tags map[string]interface{} `json:"tags,omitempty"` Buckets map[string]uint64 `json:"buckets,omitempty"` + P75 *float64 `json:"p75,omitempty"` + P95 *float64 `json:"p95,omitempty"` + P99 *float64 `json:"p99,omitempty"` } func httpClientFactory(cfg config.Reader, timeout time.Duration) func() *http.Client { @@ -207,9 +214,12 @@ func newSenderImpl( cfgComp: cfgComp, logComp: logComp, - client: client, - endpoints: endpoints, - agentVersion: agentVersion.GetNumberAndPre(), + compress: cfgComp.GetBool("agent_telemetry.use_compression"), + compressionLevel: cfgComp.GetInt("agent_telemetry.compression_level"), + client: client, + endpoints: endpoints, + agentVersion: agentVersion.GetNumberAndPre(), + // pre-fill parts of payload which are not changing during run-time payloadTemplate: Payload{ APIVersion: "v2", @@ -253,8 +263,53 @@ func (s *senderImpl) addMetricPayload( for _, bucket := range histogram.GetBucket() { boundNameRaw := fmt.Sprintf("%v", bucket.GetUpperBound()) boundName := strings.ReplaceAll(boundNameRaw, ".", "_") + payload.Buckets[boundName] = bucket.GetCumulativeCount() } + payload.Buckets["+Inf"] = histogram.GetSampleCount() + + // Calculate fixed 75, 95 and 99 precentiles. Percentile calculation finds + // a bucket which, with all preceding buckets, contains that percentile item. + // For convenience, percentile values are not the bucket number but its + // upper-bound. If a percentile belongs to the implicit "+inf" bucket, which + // has no explicit upper-bound, we will use the last bucket upper bound times 2. + // The upper-bound of the "+Inf" bucket is defined as 2x of the preceding + // bucket boundary, but it is totally arbitrary. In the future we may use a + // configuration value to set it up. + var totalCount uint64 + for _, bucket := range histogram.GetBucket() { + totalCount += bucket.GetCumulativeCount() + } + totalCount += histogram.GetSampleCount() + p75 := uint64(math.Floor(float64(totalCount) * 0.75)) + p95 := uint64(math.Floor(float64(totalCount) * 0.95)) + p99 := uint64(math.Floor(float64(totalCount) * 0.99)) + var curCount uint64 + for _, bucket := range histogram.GetBucket() { + curCount += bucket.GetCumulativeCount() + if payload.P75 == nil && curCount >= p75 { + p75Value := bucket.GetUpperBound() + payload.P75 = &p75Value + } + if payload.P95 == nil && curCount >= p95 { + p95Value := bucket.GetUpperBound() + payload.P95 = &p95Value + } + if payload.P99 == nil && curCount >= p99 { + p99Value := bucket.GetUpperBound() + payload.P99 = &p99Value + } + } + maxUpperBound := 2 * (histogram.GetBucket()[len(histogram.GetBucket())-1].GetUpperBound()) + if payload.P75 == nil { + payload.P75 = &maxUpperBound + } + if payload.P95 == nil { + payload.P95 = &maxUpperBound + } + if payload.P99 == nil { + payload.P99 = &maxUpperBound + } } // Add metric tags @@ -321,11 +376,24 @@ func (s *senderImpl) flushSession(ss *senderSession) error { return fmt.Errorf("failed to marshal agent telemetry payload: %w", err) } - reqBody, err := scrubber.ScrubJSON(payloadJSON) + reqBodyRaw, err := scrubber.ScrubJSON(payloadJSON) if err != nil { return fmt.Errorf("failed to scrubl agent telemetry payload: %w", err) } + // Try to compress the payload if needed + reqBody := reqBodyRaw + compressed := false + if s.compress { + reqBodyCompressed, err2 := zstd.CompressLevel(nil, reqBodyRaw, s.compressionLevel) + if err2 == nil { + compressed = true + reqBody = reqBodyCompressed + } else { + s.logComp.Errorf("Failed to compress agent telemetry payload: %v", err) + } + } + // Send the payload to all endpoints var errs error reqType := payloads.RequestType @@ -337,7 +405,7 @@ func (s *senderImpl) flushSession(ss *senderSession) error { errs = errors.Join(errs, err) continue } - s.addHeaders(req, reqType, ep.GetAPIKey(), bodyLen) + s.addHeaders(req, reqType, ep.GetAPIKey(), bodyLen, compressed) resp, err := s.client.Do(req.WithContext(ss.cancelCtx)) if err != nil { errs = errors.Join(errs, err) @@ -387,7 +455,7 @@ func (s *senderImpl) sendAgentMetricPayloads(ss *senderSession, metrics []*agent } } -func (s *senderImpl) addHeaders(req *http.Request, requesttype, apikey, bodylen string) { +func (s *senderImpl) addHeaders(req *http.Request, requesttype, apikey, bodylen string, compressed bool) { req.Header.Add("DD-Api-Key", apikey) req.Header.Add("Content-Type", "application/json") req.Header.Add("Content-Length", bodylen) @@ -397,4 +465,8 @@ func (s *senderImpl) addHeaders(req *http.Request, requesttype, apikey, bodylen req.Header.Add("DD-Telemetry-Product-Version", s.agentVersion) // Not clear how to acquire that. Appears that EVP adds it automatically req.Header.Add("datadog-container-id", "") + + if compressed { + req.Header.Set("Content-Encoding", "zstd") + } } diff --git a/comp/core/agenttelemetry/impl/utils.go b/comp/core/agenttelemetry/impl/utils.go index 07f6b86aebf40..01ca50637a6b7 100644 --- a/comp/core/agenttelemetry/impl/utils.go +++ b/comp/core/agenttelemetry/impl/utils.go @@ -8,6 +8,7 @@ package agenttelemetryimpl import ( "fmt" "sort" + "strings" dto "github.com/prometheus/client_model/go" ) @@ -98,11 +99,16 @@ func aggregateMetric(mt dto.MetricType, aggm *dto.Metric, srcm *dto.Metric) { aggmb.Exemplar.Label = nil } } + + // copy the sample count (it is implicit "+Inf" bucket) + aggm.Histogram.SampleCount = srcm.Histogram.SampleCount } else { // for the same metric family bucket structure is the same for i, srcb := range srcm.Histogram.Bucket { *aggm.Histogram.Bucket[i].CumulativeCount += srcb.GetCumulativeCount() } + // copy the sample count (it is implicit "+Inf" bucket) + *aggm.Histogram.SampleCount += srcm.Histogram.GetSampleCount() } } } @@ -123,3 +129,13 @@ func cloneLabelsSorted(labels []*dto.LabelPair) []*dto.LabelPair { func makeLabelPairKey(l *dto.LabelPair) string { return fmt.Sprintf("%s:%s:", l.GetName(), l.GetValue()) } + +// Sort and serialize labels into a string +func convertLabelsToKey(labels []*dto.LabelPair) string { + sortedLabels := cloneLabelsSorted(labels) + var sb strings.Builder + for _, tag := range sortedLabels { + sb.WriteString(makeLabelPairKey(tag)) + } + return sb.String() +} diff --git a/comp/core/autodiscovery/listeners/dbm_aurora.go b/comp/core/autodiscovery/listeners/dbm_aurora.go index bce4704331fa1..c0b61641c4e61 100644 --- a/comp/core/autodiscovery/listeners/dbm_aurora.go +++ b/comp/core/autodiscovery/listeners/dbm_aurora.go @@ -277,7 +277,10 @@ func (d *DBMAuroraService) GetExtraConfig(key string) (string, error) { return strconv.FormatBool(d.instance.IamEnabled), nil case "dbclusteridentifier": return d.clusterID, nil + case "dbname": + return d.instance.DbName, nil } + return "", ErrNotSupported } diff --git a/comp/core/autodiscovery/listeners/dbm_aurora_test.go b/comp/core/autodiscovery/listeners/dbm_aurora_test.go index 1243cd9beceec..33be75f09834c 100644 --- a/comp/core/autodiscovery/listeners/dbm_aurora_test.go +++ b/comp/core/autodiscovery/listeners/dbm_aurora_test.go @@ -279,6 +279,44 @@ func TestDBMAuroraListener(t *testing.T) { } } +func TestGetExtraConfig(t *testing.T) { + testCases := []struct { + service *DBMAuroraService + expectedExtra map[string]string + }{ + { + service: &DBMAuroraService{ + adIdentifier: dbmPostgresADIdentifier, + entityID: "f7fee36c58e3da8a", + checkName: "postgres", + clusterID: "my-cluster-1", + region: "us-east-1", + instance: &aws.Instance{ + Endpoint: "my-endpoint", + Port: 5432, + IamEnabled: true, + Engine: "aurora-postgresql", + DbName: "app", + }, + }, + expectedExtra: map[string]string{ + "dbname": "app", + "region": "us-east-1", + "managed_authentication_enabled": "true", + "dbclusteridentifier": "my-cluster-1", + }, + }, + } + + for _, tc := range testCases { + for key, value := range tc.expectedExtra { + v, err := tc.service.GetExtraConfig(key) + assert.NoError(t, err) + assert.Equal(t, value, v) + } + } +} + func contextWithTimeout(t time.Duration) gomock.Matcher { return contextWithTimeoutMatcher{ timeout: t, diff --git a/comp/core/autodiscovery/proto/proto.go b/comp/core/autodiscovery/proto/proto.go new file mode 100644 index 0000000000000..0ba534caebed3 --- /dev/null +++ b/comp/core/autodiscovery/proto/proto.go @@ -0,0 +1,104 @@ +// 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 proto provides autodiscovery proto util functions +package proto + +import ( + "github.com/DataDog/datadog-agent/comp/core/autodiscovery/integration" + "github.com/DataDog/datadog-agent/pkg/proto/pbgo/core" +) + +// ProtobufConfigFromAutodiscoveryConfig converts an autodiscovery config to a protobuf config +func ProtobufConfigFromAutodiscoveryConfig(config *integration.Config) *core.Config { + if config == nil { + return nil + } + + instances := [][]byte{} + + for _, instance := range config.Instances { + instances = append(instances, []byte(instance)) + } + + advancedAdIdentifiers := make([]*core.AdvancedADIdentifier, 0, len(config.AdvancedADIdentifiers)) + for _, advancedAdIdentifier := range config.AdvancedADIdentifiers { + advancedAdIdentifiers = append(advancedAdIdentifiers, &core.AdvancedADIdentifier{ + KubeService: &core.KubeNamespacedName{ + Name: advancedAdIdentifier.KubeService.Name, + Namespace: advancedAdIdentifier.KubeService.Namespace, + }, + KubeEndpoints: &core.KubeNamespacedName{ + Name: advancedAdIdentifier.KubeEndpoints.Name, + Namespace: advancedAdIdentifier.KubeEndpoints.Namespace, + }, + }) + } + + return &core.Config{ + Name: config.Name, + Instances: instances, + InitConfig: config.InitConfig, + MetricConfig: config.MetricConfig, + LogsConfig: config.LogsConfig, + AdIdentifiers: config.ADIdentifiers, + AdvancedAdIdentifiers: advancedAdIdentifiers, + Provider: config.Provider, + ServiceId: config.ServiceID, + TaggerEntity: config.TaggerEntity, + ClusterCheck: config.ClusterCheck, + NodeName: config.NodeName, + Source: config.Source, + IgnoreAutodiscoveryTags: config.IgnoreAutodiscoveryTags, + MetricsExcluded: config.MetricsExcluded, + LogsExcluded: config.LogsExcluded, + } +} + +// AutodiscoveryConfigFromProtobufConfig converts a protobuf config to an autodiscovery config +func AutodiscoveryConfigFromProtobufConfig(config *core.Config) integration.Config { + if config == nil { + return integration.Config{} + } + + instances := []integration.Data{} + + for _, instance := range config.Instances { + instances = append(instances, integration.Data(instance)) + } + + advancedAdIdentifiers := make([]integration.AdvancedADIdentifier, 0, len(config.AdvancedAdIdentifiers)) + for _, advancedAdIdentifier := range config.AdvancedAdIdentifiers { + advancedAdIdentifiers = append(advancedAdIdentifiers, integration.AdvancedADIdentifier{ + KubeService: integration.KubeNamespacedName{ + Name: advancedAdIdentifier.KubeService.Name, + Namespace: advancedAdIdentifier.KubeService.Namespace, + }, + KubeEndpoints: integration.KubeNamespacedName{ + Name: advancedAdIdentifier.KubeEndpoints.Name, + Namespace: advancedAdIdentifier.KubeEndpoints.Namespace, + }, + }) + } + + return integration.Config{ + Name: config.Name, + Instances: instances, + InitConfig: config.InitConfig, + MetricConfig: config.MetricConfig, + LogsConfig: config.LogsConfig, + ADIdentifiers: config.AdIdentifiers, + AdvancedADIdentifiers: advancedAdIdentifiers, + Provider: config.Provider, + ServiceID: config.ServiceId, + TaggerEntity: config.TaggerEntity, + ClusterCheck: config.ClusterCheck, + NodeName: config.NodeName, + Source: config.Source, + IgnoreAutodiscoveryTags: config.IgnoreAutodiscoveryTags, + MetricsExcluded: config.MetricsExcluded, + LogsExcluded: config.LogsExcluded, + } +} diff --git a/comp/core/autodiscovery/proto/proto_test.go b/comp/core/autodiscovery/proto/proto_test.go new file mode 100644 index 0000000000000..6ae1620476d74 --- /dev/null +++ b/comp/core/autodiscovery/proto/proto_test.go @@ -0,0 +1,291 @@ +// 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 proto + +import ( + "testing" + + "github.com/stretchr/testify/assert" + + "github.com/DataDog/datadog-agent/comp/core/autodiscovery/integration" + "github.com/DataDog/datadog-agent/pkg/proto/pbgo/core" +) + +func TestProtobufConfigFromAutodiscoveryConfig(t *testing.T) { + tests := []struct { + name string + input *integration.Config + expected *core.Config + }{ + { + name: "all fields set", + input: &integration.Config{ + Name: "test_config", + Instances: []integration.Data{ + []byte("instance1"), + []byte("instance2"), + }, + InitConfig: []byte("init_config"), + MetricConfig: []byte("metric_config"), + LogsConfig: []byte("logs_config"), + ADIdentifiers: []string{"ad_identifier1", "ad_identifier2"}, + AdvancedADIdentifiers: []integration.AdvancedADIdentifier{ + { + KubeService: integration.KubeNamespacedName{ + Name: "service1", + Namespace: "namespace1", + }, + KubeEndpoints: integration.KubeNamespacedName{ + Name: "endpoint1", + Namespace: "namespace1", + }, + }, + }, + Provider: "provider", + ServiceID: "service_id", + TaggerEntity: "tagger_entity", + ClusterCheck: true, + NodeName: "node_name", + Source: "source", + IgnoreAutodiscoveryTags: true, + MetricsExcluded: true, + LogsExcluded: true, + }, + expected: &core.Config{ + Name: "test_config", + Instances: [][]byte{ + []byte("instance1"), + []byte("instance2"), + }, + InitConfig: []byte("init_config"), + MetricConfig: []byte("metric_config"), + LogsConfig: []byte("logs_config"), + AdIdentifiers: []string{"ad_identifier1", "ad_identifier2"}, + AdvancedAdIdentifiers: []*core.AdvancedADIdentifier{ + { + KubeService: &core.KubeNamespacedName{ + Name: "service1", + Namespace: "namespace1", + }, + KubeEndpoints: &core.KubeNamespacedName{ + Name: "endpoint1", + Namespace: "namespace1", + }, + }, + }, + Provider: "provider", + ServiceId: "service_id", + TaggerEntity: "tagger_entity", + ClusterCheck: true, + NodeName: "node_name", + Source: "source", + IgnoreAutodiscoveryTags: true, + MetricsExcluded: true, + LogsExcluded: true, + }, + }, + { + name: "some fields set", + input: &integration.Config{ + Name: "test_config", + Instances: []integration.Data{ + []byte("instance1"), + }, + InitConfig: []byte("init_config"), + MetricConfig: []byte("metric_config"), + LogsConfig: []byte("logs_config"), + ADIdentifiers: []string{"ad_identifier1"}, + Provider: "provider", + ServiceID: "service_id", + TaggerEntity: "tagger_entity", + ClusterCheck: true, + NodeName: "node_name", + Source: "source", + IgnoreAutodiscoveryTags: true, + MetricsExcluded: true, + LogsExcluded: true, + }, + expected: &core.Config{ + Name: "test_config", + Instances: [][]byte{ + []byte("instance1"), + }, + InitConfig: []byte("init_config"), + MetricConfig: []byte("metric_config"), + LogsConfig: []byte("logs_config"), + AdIdentifiers: []string{"ad_identifier1"}, + Provider: "provider", + ServiceId: "service_id", + TaggerEntity: "tagger_entity", + ClusterCheck: true, + NodeName: "node_name", + Source: "source", + IgnoreAutodiscoveryTags: true, + MetricsExcluded: true, + LogsExcluded: true, + AdvancedAdIdentifiers: []*core.AdvancedADIdentifier{}, + }, + }, + { + name: "no fields set", + input: &integration.Config{}, + expected: &core.Config{ + Instances: [][]byte{}, + AdvancedAdIdentifiers: []*core.AdvancedADIdentifier{}, + }, + }, + { + "nil", + nil, + nil, + }, + } + + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + result := ProtobufConfigFromAutodiscoveryConfig(test.input) + assert.Equal(t, test.expected, result) + }) + } +} + +func TestAutodiscoveryConfigFromProtobufConfig(t *testing.T) { + tests := []struct { + name string + input *core.Config + expected integration.Config + }{ + { + name: "all fields set", + input: &core.Config{ + Name: "test_config", + Instances: [][]byte{ + []byte("instance1"), + []byte("instance2"), + }, + InitConfig: []byte("init_config"), + MetricConfig: []byte("metric_config"), + LogsConfig: []byte("logs_config"), + AdIdentifiers: []string{"ad_identifier1", "ad_identifier2"}, + AdvancedAdIdentifiers: []*core.AdvancedADIdentifier{ + { + KubeService: &core.KubeNamespacedName{ + Name: "service1", + Namespace: "namespace1", + }, + KubeEndpoints: &core.KubeNamespacedName{ + Name: "endpoint1", + Namespace: "namespace1", + }, + }, + }, + Provider: "provider", + ServiceId: "service_id", + TaggerEntity: "tagger_entity", + ClusterCheck: true, + NodeName: "node_name", + Source: "source", + IgnoreAutodiscoveryTags: true, + MetricsExcluded: true, + LogsExcluded: true, + }, + expected: integration.Config{ + Name: "test_config", + Instances: []integration.Data{ + []byte("instance1"), + []byte("instance2"), + }, + InitConfig: []byte("init_config"), + MetricConfig: []byte("metric_config"), + LogsConfig: []byte("logs_config"), + ADIdentifiers: []string{"ad_identifier1", "ad_identifier2"}, + AdvancedADIdentifiers: []integration.AdvancedADIdentifier{ + { + KubeService: integration.KubeNamespacedName{ + Name: "service1", + Namespace: "namespace1", + }, + KubeEndpoints: integration.KubeNamespacedName{ + Name: "endpoint1", + Namespace: "namespace1", + }, + }, + }, + Provider: "provider", + ServiceID: "service_id", + TaggerEntity: "tagger_entity", + ClusterCheck: true, + NodeName: "node_name", + Source: "source", + IgnoreAutodiscoveryTags: true, + MetricsExcluded: true, + LogsExcluded: true, + }, + }, + { + name: "some fields set", + input: &core.Config{ + Name: "test_config", + Instances: [][]byte{ + []byte("instance1"), + }, + InitConfig: []byte("init_config"), + MetricConfig: []byte("metric_config"), + LogsConfig: []byte("logs_config"), + AdIdentifiers: []string{"ad_identifier1"}, + Provider: "provider", + ServiceId: "service_id", + TaggerEntity: "tagger_entity", + ClusterCheck: true, + NodeName: "node_name", + Source: "source", + IgnoreAutodiscoveryTags: true, + MetricsExcluded: true, + LogsExcluded: true, + }, + expected: integration.Config{ + Name: "test_config", + Instances: []integration.Data{ + []byte("instance1"), + }, + InitConfig: []byte("init_config"), + MetricConfig: []byte("metric_config"), + LogsConfig: []byte("logs_config"), + ADIdentifiers: []string{"ad_identifier1"}, + Provider: "provider", + ServiceID: "service_id", + TaggerEntity: "tagger_entity", + ClusterCheck: true, + NodeName: "node_name", + Source: "source", + IgnoreAutodiscoveryTags: true, + MetricsExcluded: true, + LogsExcluded: true, + AdvancedADIdentifiers: []integration.AdvancedADIdentifier{}, + }, + }, + { + name: "no fields set", + input: &core.Config{}, + expected: integration.Config{ + AdvancedADIdentifiers: []integration.AdvancedADIdentifier{}, + Instances: []integration.Data{}, + }, + }, + { + "nil", + nil, + integration.Config{}, + }, + } + + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + result := AutodiscoveryConfigFromProtobufConfig(test.input) + assert.Equal(t, test.expected, result) + }) + } +} diff --git a/comp/core/autodiscovery/stream/stream.go b/comp/core/autodiscovery/stream/stream.go new file mode 100644 index 0000000000000..7fbbe04633090 --- /dev/null +++ b/comp/core/autodiscovery/stream/stream.go @@ -0,0 +1,89 @@ +// 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 stream provides the autodiscovery config streaming logic +package stream + +import ( + "time" + + "github.com/google/uuid" + + "github.com/DataDog/datadog-agent/comp/core/autodiscovery" + "github.com/DataDog/datadog-agent/comp/core/autodiscovery/integration" + "github.com/DataDog/datadog-agent/comp/core/autodiscovery/proto" + pb "github.com/DataDog/datadog-agent/pkg/proto/pbgo/core" + "github.com/DataDog/datadog-agent/pkg/util/grpc" + "github.com/DataDog/datadog-agent/pkg/util/log" +) + +// Config streams autodiscovery configs +func Config(ac autodiscovery.Component, out pb.AgentSecure_AutodiscoveryStreamConfigServer) error { + s := &scheduler{ + out: out, + done: make(chan error, 1), + } + + // Generate a unique scheduler name + id := uuid.New().String() + schedulerName := "remote-" + id + + // replay the existing configs + ac.AddScheduler(schedulerName, s, true) + defer ac.RemoveScheduler(schedulerName) + + select { + case err := <-s.done: + return err + case <-out.Context().Done(): + return nil + } +} + +type scheduler struct { + out pb.AgentSecure_AutodiscoveryStreamConfigServer + done chan error +} + +func (s *scheduler) Schedule(config []integration.Config) { + s.handleEvent(config, pb.ConfigEventType_SCHEDULE) +} + +func (s *scheduler) Unschedule(configs []integration.Config) { + s.handleEvent(configs, pb.ConfigEventType_UNSCHEDULE) +} + +func (s *scheduler) Stop() { + close(s.done) +} + +func (s *scheduler) handleEvent(configs []integration.Config, eventType pb.ConfigEventType) { + protobufConfigs := protobufConfigFromAutodiscoveryConfigs(configs, eventType) + + err := grpc.DoWithTimeout(func() error { + return s.out.Send(&pb.AutodiscoveryStreamResponse{ + Configs: protobufConfigs, + }) + }, 1*time.Minute) + + if err != nil { + log.Warnf("error sending %s autodiscovery event: %s", eventType.String(), err) + // do not block if an error was already sent + select { + case s.done <- err: + default: + } + } +} + +func protobufConfigFromAutodiscoveryConfigs(config []integration.Config, eventType pb.ConfigEventType) []*pb.Config { + res := make([]*pb.Config, 0, len(config)) + for _, c := range config { + protobufConfig := proto.ProtobufConfigFromAutodiscoveryConfig(&c) + protobufConfig.EventType = eventType + res = append(res, protobufConfig) + } + return res +} diff --git a/comp/core/autodiscovery/stream/stream_test.go b/comp/core/autodiscovery/stream/stream_test.go new file mode 100644 index 0000000000000..914c8d3a3654c --- /dev/null +++ b/comp/core/autodiscovery/stream/stream_test.go @@ -0,0 +1,168 @@ +// 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 stream + +import ( + "context" + "errors" + "testing" + + "google.golang.org/grpc/metadata" + + "github.com/stretchr/testify/require" + + "github.com/DataDog/datadog-agent/comp/core/autodiscovery" + "github.com/DataDog/datadog-agent/comp/core/autodiscovery/integration" + noopautoconfig "github.com/DataDog/datadog-agent/comp/core/autodiscovery/noopimpl" + autodiscoveryscheduler "github.com/DataDog/datadog-agent/comp/core/autodiscovery/scheduler" + pb "github.com/DataDog/datadog-agent/pkg/proto/pbgo/core" + "github.com/DataDog/datadog-agent/pkg/util/fxutil" +) + +func getAutodiscoveryNoop(t *testing.T) autodiscovery.Component { + return fxutil.Test[autodiscovery.Component]( + t, + noopautoconfig.Module(), + ) +} + +type acMock struct { + autodiscovery.Component + + addScheduler func(string, autodiscoveryscheduler.Scheduler, bool) +} + +func (ac *acMock) AddScheduler(name string, scheduler autodiscoveryscheduler.Scheduler, replay bool) { + ac.addScheduler(name, scheduler, replay) +} + +type outMock struct { + send func(*pb.AutodiscoveryStreamResponse) error + ctx context.Context +} + +func (out *outMock) Send(resp *pb.AutodiscoveryStreamResponse) error { + return out.send(resp) +} + +func (out *outMock) SetHeader(metadata.MD) error { + panic("not implemented") +} + +func (out *outMock) SendHeader(metadata.MD) error { + panic("not implemented") +} + +func (out *outMock) SetTrailer(metadata.MD) { + panic("not implemented") +} + +func (out *outMock) Context() context.Context { + return out.ctx +} + +func (out *outMock) SendMsg(any) error { + panic("not implemented") +} + +func (out *outMock) RecvMsg(any) error { + panic("not implemented") +} + +func setupTestConfig(t *testing.T, sendErr error) (chan error, chan autodiscoveryscheduler.Scheduler, chan *pb.AutodiscoveryStreamResponse, context.CancelFunc) { + schedulerChan := make(chan autodiscoveryscheduler.Scheduler, 1) + sendChan := make(chan *pb.AutodiscoveryStreamResponse, 1) + + acNoop := getAutodiscoveryNoop(t) + ac := &acMock{ + acNoop, + func(_ string, scheduler autodiscoveryscheduler.Scheduler, _ bool) { + schedulerChan <- scheduler + }, + } + + ctx, cancel := context.WithCancel(context.Background()) + + out := &outMock{ + send: func(resp *pb.AutodiscoveryStreamResponse) error { + sendChan <- resp + return sendErr + }, + ctx: ctx, + } + + configErrChan := make(chan error) + go func() { + configErrChan <- Config(ac, out) + }() + + return configErrChan, schedulerChan, sendChan, cancel +} + +func TestConfig(t *testing.T) { + configs := []integration.Config{ + { + Name: "test", + }, + } + + t.Run("schedule unschedule", func(t *testing.T) { + configErrChan, schedulerChan, sendChan, cancel := setupTestConfig(t, nil) + + scheduler := <-schedulerChan + require.NotNil(t, scheduler) + + scheduler.Schedule(configs) + sent := <-sendChan + require.NotNil(t, sent) + require.Len(t, sent.Configs, 1) + require.Equal(t, "test", sent.Configs[0].Name) + require.Equal(t, pb.ConfigEventType_SCHEDULE, sent.Configs[0].EventType) + + scheduler.Unschedule(configs) + sent = <-sendChan + require.NotNil(t, sent) + require.Len(t, sent.Configs, 1) + require.Equal(t, "test", sent.Configs[0].Name) + require.Equal(t, pb.ConfigEventType_UNSCHEDULE, sent.Configs[0].EventType) + + cancel() + + require.NoError(t, <-configErrChan) + }) + + t.Run("send error", func(t *testing.T) { + sendError := errors.New("send error") + configErrChan, schedulerChan, sendChan, _ := setupTestConfig(t, sendError) + + scheduler := <-schedulerChan + require.NotNil(t, scheduler) + + scheduler.Schedule(configs) + sent := <-sendChan + require.NotNil(t, sent) + require.Len(t, sent.Configs, 1) + require.Equal(t, "test", sent.Configs[0].Name) + require.Equal(t, pb.ConfigEventType_SCHEDULE, sent.Configs[0].EventType) + + require.ErrorIs(t, <-configErrChan, sendError) + }) + + t.Run("multiple errors", func(t *testing.T) { + sendError := errors.New("send error") + configErrChan, schedulerChan, sendChan, _ := setupTestConfig(t, sendError) + + scheduler := <-schedulerChan + require.NotNil(t, scheduler) + + scheduler.Schedule(configs) + <-sendChan + scheduler.Unschedule(configs) + <-sendChan + + require.ErrorIs(t, <-configErrChan, sendError) + }) +} diff --git a/comp/core/config/go.mod b/comp/core/config/go.mod index 2973aa62895a7..ec86f060fc244 100644 --- a/comp/core/config/go.mod +++ b/comp/core/config/go.mod @@ -42,8 +42,8 @@ require ( github.com/DataDog/datadog-agent/pkg/util/defaultpaths v0.0.0-00010101000000-000000000000 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.0 - github.com/DataDog/viper v1.13.5 + github.com/DataDog/datadog-agent/pkg/util/winutil v0.59.1 + github.com/DataDog/viper v1.14.0 github.com/stretchr/testify v1.10.0 go.uber.org/fx v1.23.0 ) @@ -60,36 +60,37 @@ require ( github.com/DataDog/datadog-agent/pkg/util/executable v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/filesystem v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.59.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/log v0.59.1 // indirect github.com/DataDog/datadog-agent/pkg/util/pointer v0.59.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.1 // indirect 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/version v0.59.1 // 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 - github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 // indirect + github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 // indirect - github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c // indirect + github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c // indirect github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect 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/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect github.com/prometheus/client_golang v1.20.5 // indirect 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 @@ -102,12 +103,14 @@ require ( go.uber.org/dig v1.18.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect - golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f // indirect - golang.org/x/sys v0.27.0 // indirect - golang.org/x/text v0.20.0 // indirect + golang.org/x/exp v0.0.0-20241210194714-1829a127f884 // indirect + golang.org/x/sys v0.28.0 // indirect + golang.org/x/text v0.21.0 // indirect google.golang.org/protobuf v1.35.2 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) replace github.com/DataDog/datadog-agent/pkg/config/structure => ../../../pkg/config/structure + +replace github.com/DataDog/datadog-agent/pkg/version => ../../../pkg/version diff --git a/comp/core/config/go.sum b/comp/core/config/go.sum index f3d0810fd9fec..bc10129e630f0 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= @@ -71,7 +73,6 @@ github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/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= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -86,8 +87,8 @@ github.com/grpc-ecosystem/grpc-gateway v1.13.0/go.mod h1:8XEsbTttt/W+VvjtQhLACqC github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/hcl v1.0.1-vault-5 h1:kI3hhbbyzr4dldA8UdTb7ZlVVlI2DACdCfz31RPDgJM= github.com/hashicorp/hcl v1.0.1-vault-5/go.mod h1:XYhtn6ijBSAj6n4YqAaf7RBPS4I06AItNorpy+MoQNM= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 h1:S4qyfL2sEm5Budr4KVMyEniCy+PbS55651I/a+Kn/NQ= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb h1:PGufWXXDq9yaev6xX1YQauaO1MV90e6Mpoq1I7Lz/VM= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= @@ -111,8 +112,8 @@ 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-20220913051719-115f729f3c8c h1:VtwQ41oftZwlMnOEbMWQtSEUgU64U4s+GHk7hZK+jtY= -github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c/go.mod h1:JKx41uQRwqlTZabZc+kILPrO/3jlKnQ2Z8b7YiVw5cE= +github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a h1:3Bm7EwfUQUvhNeKIkUct/gl9eod1TcXuj8stxvi/GoI= +github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a/go.mod h1:ilwx/Dta8jXAgpFYFvSWEMwxmbWXyiUHkd5FwyKhb5k= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= @@ -139,8 +140,8 @@ github.com/pkg/errors v0.8.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-20220216144756-c35f1ee13d7c h1:NRoLoZvkBTKvR5gQLgA3e0hqjkY9u1wm+iOL45VN/qI= -github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 h1:o4JXh1EVt9k/+g42oCprj/FisM4qX9L3sZB3upGN2ZU= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= @@ -172,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= @@ -244,8 +241,8 @@ golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnf golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f h1:XdNn9LlyWAhLVp6P/i8QYBW+hlyhrhei9uErw2B5GJo= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f/go.mod h1:D5SMRVC3C2/4+F/DB1wZsLRnSNimn2Sp/NPsCrsv8ak= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884 h1:Y/Mj/94zIQQGHVSv1tTtQBDaQaJe62U9bkDZKKyhPCU= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -282,11 +279,11 @@ golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20220829200755-d48e67d00261/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.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/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= -golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= diff --git a/comp/core/configsync/configsyncimpl/module.go b/comp/core/configsync/configsyncimpl/module.go index 0b77c1370de20..a89bbacc91197 100644 --- a/comp/core/configsync/configsyncimpl/module.go +++ b/comp/core/configsync/configsyncimpl/module.go @@ -22,7 +22,6 @@ import ( log "github.com/DataDog/datadog-agent/comp/core/log/def" apiutil "github.com/DataDog/datadog-agent/pkg/api/util" "github.com/DataDog/datadog-agent/pkg/util/fxutil" - "github.com/DataDog/datadog-agent/pkg/util/optional" ) type dependencies struct { @@ -35,20 +34,20 @@ type dependencies struct { SyncParams Params } -// OptionalModule defines the fx options for this component. -func OptionalModule() fxutil.Module { +// Module defines the fx options for this component. +func Module() fxutil.Module { return fxutil.Component( - fx.Provide(newOptionalConfigSync), + fx.Provide(newComponent), fx.Supply(Params{}), ) } -// OptionalModuleWithParams defines the fx options for this component, but +// ModuleWithParams defines the fx options for this component, but // requires additionally specifying custom Params from the fx App, to be // passed to the constructor. -func OptionalModuleWithParams() fxutil.Module { +func ModuleWithParams() fxutil.Module { return fxutil.Component( - fx.Provide(newOptionalConfigSync), + fx.Provide(newComponent), ) } @@ -61,19 +60,21 @@ type configSync struct { client *http.Client connected bool ctx context.Context + enabled bool } -// newOptionalConfigSync checks if the component was enabled as per the config, and returns an optional.Option -func newOptionalConfigSync(deps dependencies) optional.Option[configsync.Component] { +// newComponent checks if the component was enabled as per the config and return a enable/disabled configsync +func newComponent(deps dependencies) configsync.Component { agentIPCPort := deps.Config.GetInt("agent_ipc.port") configRefreshIntervalSec := deps.Config.GetInt("agent_ipc.config_refresh_interval") if agentIPCPort <= 0 || configRefreshIntervalSec <= 0 { - return optional.NewNoneOption[configsync.Component]() + deps.Log.Infof("configsync disabled (agent_ipc.port: %d | agent_ipc.config_refresh_interval: %d)", agentIPCPort, configRefreshIntervalSec) + return configSync{} } - configSync := newConfigSync(deps, agentIPCPort, configRefreshIntervalSec) - return optional.NewOption(configSync) + deps.Log.Infof("configsync enabled (agent_ipc '%s:%d' | agent_ipc.config_refresh_interval: %d)", deps.Config.GetString("agent_ipc.host"), agentIPCPort, configRefreshIntervalSec) + return newConfigSync(deps, agentIPCPort, configRefreshIntervalSec) } // newConfigSync creates a new configSync component. @@ -98,6 +99,7 @@ func newConfigSync(deps dependencies, agentIPCPort int, configRefreshIntervalSec url: url, client: client, ctx: ctx, + enabled: true, } if deps.SyncParams.OnInit { diff --git a/comp/core/configsync/configsyncimpl/module_integration_test.go b/comp/core/configsync/configsyncimpl/module_integration_test.go index e4cfa8ec1ba63..5d0fde62a449a 100644 --- a/comp/core/configsync/configsyncimpl/module_integration_test.go +++ b/comp/core/configsync/configsyncimpl/module_integration_test.go @@ -22,7 +22,6 @@ import ( "github.com/DataDog/datadog-agent/comp/core/config" "github.com/DataDog/datadog-agent/comp/core/configsync" "github.com/DataDog/datadog-agent/pkg/util/fxutil" - "github.com/DataDog/datadog-agent/pkg/util/optional" ) func TestOptionalModule(t *testing.T) { @@ -44,16 +43,14 @@ func TestOptionalModule(t *testing.T) { "agent_ipc.port": port, "agent_ipc.config_refresh_interval": 1, } - csopt := fxutil.Test[optional.Option[configsync.Component]](t, fx.Options( + comp := fxutil.Test[configsync.Component](t, fx.Options( core.MockBundle(), fetchonlyimpl.Module(), - OptionalModule(), + Module(), fx.Populate(&cfg), fx.Replace(config.MockParams{Overrides: overrides}), )) - - _, ok := csopt.Get() - require.True(t, ok) + require.True(t, comp.(configSync).enabled) require.EventuallyWithT(t, func(t *assert.CollectT) { assert.Equal(t, "value1", cfg.Get("key1")) diff --git a/comp/core/configsync/configsyncimpl/module_test.go b/comp/core/configsync/configsyncimpl/module_test.go index 076288737a65e..8051e4cce793c 100644 --- a/comp/core/configsync/configsyncimpl/module_test.go +++ b/comp/core/configsync/configsyncimpl/module_test.go @@ -8,34 +8,30 @@ package configsyncimpl import ( "testing" - "github.com/stretchr/testify/require" - pkgconfigmodel "github.com/DataDog/datadog-agent/pkg/config/model" + "github.com/stretchr/testify/assert" ) -func TestNewOptionalConfigSync(t *testing.T) { +func TestNewConfigSync(t *testing.T) { t.Run("enabled", func(t *testing.T) { deps := makeDeps(t) deps.Config.Set("agent_ipc.port", 1234, pkgconfigmodel.SourceFile) deps.Config.Set("agent_ipc.config_refresh_interval", 30, pkgconfigmodel.SourceFile) - optConfigSync := newOptionalConfigSync(deps) - _, ok := optConfigSync.Get() - require.True(t, ok) + comp := newComponent(deps) + assert.True(t, comp.(configSync).enabled) }) t.Run("disabled ipc port zero", func(t *testing.T) { deps := makeDeps(t) deps.Config.Set("agent_ipc.port", 0, pkgconfigmodel.SourceFile) - optConfigSync := newOptionalConfigSync(deps) - _, ok := optConfigSync.Get() - require.False(t, ok) + comp := newComponent(deps) + assert.False(t, comp.(configSync).enabled) }) t.Run("disabled config refresh interval zero", func(t *testing.T) { deps := makeDeps(t) deps.Config.Set("agent_ipc.config_refresh_interval", 0, pkgconfigmodel.SourceFile) - optConfigSync := newOptionalConfigSync(deps) - _, ok := optConfigSync.Get() - require.False(t, ok) + comp := newComponent(deps) + assert.False(t, comp.(configSync).enabled) }) } diff --git a/comp/core/configsync/configsyncimpl/sync_integration_test.go b/comp/core/configsync/configsyncimpl/sync_integration_test.go index 50c7e3680ed0d..91b615bb53493 100644 --- a/comp/core/configsync/configsyncimpl/sync_integration_test.go +++ b/comp/core/configsync/configsyncimpl/sync_integration_test.go @@ -38,7 +38,7 @@ func TestRunWithChan(t *testing.T) { ch := make(chan time.Time, 1) ch <- time.Now() - time.AfterFunc(100*time.Millisecond, cancel) + time.AfterFunc(500*time.Millisecond, cancel) cs.runWithChan(ch) require.True(t, called) diff --git a/comp/core/flare/flare_test.go b/comp/core/flare/flare_test.go index 69341d602611f..54589c35d23ea 100644 --- a/comp/core/flare/flare_test.go +++ b/comp/core/flare/flare_test.go @@ -75,8 +75,7 @@ func TestFlareCreation(t *testing.T) { } func TestRunProviders(t *testing.T) { - var firstRan atomic.Bool - var secondRan atomic.Bool + firstStarted := make(chan struct{}, 1) var secondDone atomic.Bool fakeTagger := mockTagger.SetupFakeTagger(t) @@ -105,7 +104,7 @@ func TestRunProviders(t *testing.T) { fx.Provide(fx.Annotate( func() *types.FlareFiller { return types.NewFiller(func(_ types.FlareBuilder) error { - firstRan.Store(true) + firstStarted <- struct{}{} return nil }) }, @@ -114,7 +113,6 @@ func TestRunProviders(t *testing.T) { fx.Provide(fx.Annotate( func() *types.FlareFiller { return types.NewFiller(func(_ types.FlareBuilder) error { - secondRan.Store(true) time.Sleep(10 * time.Second) secondDone.Store(true) return nil @@ -130,9 +128,13 @@ func TestRunProviders(t *testing.T) { fb, err := helpers.NewFlareBuilder(false, flarebuilder.FlareArgs{}) require.NoError(t, err) + start := time.Now() f.Comp.(*flare).runProviders(fb, cliProviderTimeout) + // ensure that providers are actually started + <-firstStarted + elapsed := time.Since(start) - require.True(t, firstRan.Load()) - require.True(t, secondRan.Load()) - require.False(t, secondDone.Load()) + // ensure that we're not blocking for the slow provider + assert.Less(t, elapsed, 5*time.Second) + assert.False(t, secondDone.Load()) } diff --git a/comp/core/flare/helpers/builder_test.go b/comp/core/flare/helpers/builder_test.go index 26508575eef92..ccc544eb6ecb9 100644 --- a/comp/core/flare/helpers/builder_test.go +++ b/comp/core/flare/helpers/builder_test.go @@ -213,8 +213,8 @@ func TestAddFileYamlDetection(t *testing.T) { - abcdef - abcdef`) redacted := `instances: -- host: 127.0.0.1 - token: "********"` + - host: 127.0.0.1 + token: "********"` fb.AddFile("test.yaml", clear) assertFileContent(t, fb, redacted, "test.yaml") @@ -297,8 +297,8 @@ func TestCopyFileYamlDetection(t *testing.T) { - abcdef - abcdef`) redacted := `instances: -- host: 127.0.0.1 - token: "********"` + - host: 127.0.0.1 + token: "********"` path1 := filepath.Join(t.TempDir(), "test.yaml") os.WriteFile(path1, []byte(input), os.ModePerm) diff --git a/comp/core/flare/providers.go b/comp/core/flare/providers.go index edb2c7ac86520..69ceae5ccf76f 100644 --- a/comp/core/flare/providers.go +++ b/comp/core/flare/providers.go @@ -53,6 +53,7 @@ func (f *flare) collectLogsFiles(fb types.FlareBuilder) error { func (f *flare) collectConfigFiles(fb types.FlareBuilder) error { confSearchPaths := map[string]string{ "": f.config.GetString("confd_path"), + "fleet": filepath.Join(f.config.GetString("fleet_policies_dir"), "conf.d"), "dist": filepath.Join(f.params.distPath, "conf.d"), "checksd": f.params.pythonChecksPath, } diff --git a/comp/core/flare/types/go.mod b/comp/core/flare/types/go.mod index a6ebdcf9f8a92..a3526c64a15dc 100644 --- a/comp/core/flare/types/go.mod +++ b/comp/core/flare/types/go.mod @@ -16,5 +16,5 @@ require ( go.uber.org/dig v1.18.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect - golang.org/x/sys v0.27.0 // indirect + golang.org/x/sys v0.28.0 // indirect ) diff --git a/comp/core/flare/types/go.sum b/comp/core/flare/types/go.sum index e01f4bd76ea76..7b69276ecf542 100644 --- a/comp/core/flare/types/go.sum +++ b/comp/core/flare/types/go.sum @@ -14,7 +14,7 @@ go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.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= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/comp/core/gui/guiimpl/checks.go b/comp/core/gui/guiimpl/checks.go index 058a75b08f05c..f54c682f72b8b 100644 --- a/comp/core/gui/guiimpl/checks.go +++ b/comp/core/gui/guiimpl/checks.go @@ -42,9 +42,19 @@ var ( filepath.Join(defaultpaths.GetDistPath(), "checks.d"), // Custom checks pkgconfigsetup.Datadog().GetString("additional_checksd"), // Custom checks defaultpaths.PyChecksPath, // Integrations-core checks + getFleetPoliciesPath(), // Fleet Policies } ) +// getFleetPoliciesPath returns the path to the fleet policies directory if it is set in the configuration +// otherwise it returns an empty string +func getFleetPoliciesPath() string { + if len(pkgconfigsetup.Datadog().GetString("fleet_policies_dir")) > 0 { + return filepath.Join(pkgconfigsetup.Datadog().GetString("fleet_policies_dir"), "conf.d") + } + return "" +} + // Adds the specific handlers for /checks/ endpoints func checkHandler(r *mux.Router, collector collector.Component, ac autodiscovery.Component) { r.HandleFunc("/running", http.HandlerFunc(sendRunningChecks)).Methods("POST") @@ -208,6 +218,9 @@ func getCheckConfigFile(w http.ResponseWriter, r *http.Request) { var file []byte var e error for _, path := range configPaths { + if len(path) == 0 { + continue + } filePath, err := securejoin.SecureJoin(path, fileName) if err != nil { log.Errorf("Error: Unable to join config path with the file name: %s", fileName) @@ -443,7 +456,9 @@ func getConfigsInPath(path string) ([]string, error) { func listConfigs(w http.ResponseWriter, _ *http.Request) { filenames := []string{} for _, path := range configPaths { - + if len(path) == 0 { + continue + } configs, e := getConfigsInPath(path) if e != nil { log.Errorf("Unable to list configurations from %s: %v", path, e) diff --git a/comp/core/hostname/hostnameinterface/go.mod b/comp/core/hostname/hostnameinterface/go.mod index 4f6e92eb22127..c097205307cf6 100644 --- a/comp/core/hostname/hostnameinterface/go.mod +++ b/comp/core/hostname/hostnameinterface/go.mod @@ -25,6 +25,6 @@ require ( go.uber.org/dig v1.18.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect - golang.org/x/sys v0.27.0 // indirect + golang.org/x/sys v0.28.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/comp/core/hostname/hostnameinterface/go.sum b/comp/core/hostname/hostnameinterface/go.sum index b6080ae54f78c..3dcc180d9ba1c 100644 --- a/comp/core/hostname/hostnameinterface/go.sum +++ b/comp/core/hostname/hostnameinterface/go.sum @@ -28,8 +28,8 @@ go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.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= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= diff --git a/comp/core/log/impl-systemprobe/systemprobe_logger.go b/comp/core/log/impl-systemprobe/systemprobe_logger.go index 8457442cc1c93..5cbf8dc21e5de 100644 --- a/comp/core/log/impl-systemprobe/systemprobe_logger.go +++ b/comp/core/log/impl-systemprobe/systemprobe_logger.go @@ -3,8 +3,8 @@ // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2016-present Datadog, Inc. -// Package logimpl implements a component to handle logging internal to the agent for system-probe. -package logimpl +// Package systemprobeimpl implements a component to handle logging internal to the agent for system-probe. +package systemprobeimpl import ( "context" diff --git a/comp/core/log/impl-systemprobe/systemprobe_logger_test.go b/comp/core/log/impl-systemprobe/systemprobe_logger_test.go index e6a2c6682a593..3ad4e5dad9198 100644 --- a/comp/core/log/impl-systemprobe/systemprobe_logger_test.go +++ b/comp/core/log/impl-systemprobe/systemprobe_logger_test.go @@ -3,7 +3,7 @@ // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2016-present Datadog, Inc. -package logimpl +package systemprobeimpl import ( "testing" diff --git a/comp/core/log/impl-trace/go.mod b/comp/core/log/impl-trace/go.mod index 46dbc7aba09c2..3af1ae1f0f1d8 100644 --- a/comp/core/log/impl-trace/go.mod +++ b/comp/core/log/impl-trace/go.mod @@ -45,7 +45,7 @@ require ( github.com/DataDog/datadog-agent/pkg/config/env v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/trace v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/util/fxutil v0.59.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 + github.com/DataDog/datadog-agent/pkg/util/log v0.59.1 github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 // indirect; v2.6 github.com/stretchr/testify v1.10.0 go.uber.org/fx v1.23.0 // indirect @@ -72,28 +72,29 @@ require ( github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/optional v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/pointer v0.59.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.1 // indirect 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.0 // indirect - github.com/DataDog/viper v1.13.5 // 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.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 - github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 // indirect + github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 // indirect - github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c // indirect + github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c // indirect github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect 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/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // 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 @@ -106,11 +107,13 @@ require ( go.uber.org/dig v1.18.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect - golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f // indirect - golang.org/x/sys v0.27.0 // indirect - golang.org/x/text v0.20.0 // indirect + golang.org/x/exp v0.0.0-20241210194714-1829a127f884 // indirect + golang.org/x/sys v0.28.0 // indirect + golang.org/x/text v0.21.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) replace github.com/DataDog/datadog-agent/pkg/config/structure => ../../../../pkg/config/structure + +replace github.com/DataDog/datadog-agent/pkg/version => ../../../../pkg/version diff --git a/comp/core/log/impl-trace/go.sum b/comp/core/log/impl-trace/go.sum index 324945ccfacf2..6ffaa516a7a51 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= @@ -70,7 +72,6 @@ github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/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= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -85,8 +86,8 @@ github.com/grpc-ecosystem/grpc-gateway v1.13.0/go.mod h1:8XEsbTttt/W+VvjtQhLACqC github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/hcl v1.0.1-vault-5 h1:kI3hhbbyzr4dldA8UdTb7ZlVVlI2DACdCfz31RPDgJM= github.com/hashicorp/hcl v1.0.1-vault-5/go.mod h1:XYhtn6ijBSAj6n4YqAaf7RBPS4I06AItNorpy+MoQNM= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 h1:S4qyfL2sEm5Budr4KVMyEniCy+PbS55651I/a+Kn/NQ= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb h1:PGufWXXDq9yaev6xX1YQauaO1MV90e6Mpoq1I7Lz/VM= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= @@ -108,8 +109,8 @@ 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-20220913051719-115f729f3c8c h1:VtwQ41oftZwlMnOEbMWQtSEUgU64U4s+GHk7hZK+jtY= -github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c/go.mod h1:JKx41uQRwqlTZabZc+kILPrO/3jlKnQ2Z8b7YiVw5cE= +github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a h1:3Bm7EwfUQUvhNeKIkUct/gl9eod1TcXuj8stxvi/GoI= +github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a/go.mod h1:ilwx/Dta8jXAgpFYFvSWEMwxmbWXyiUHkd5FwyKhb5k= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= @@ -136,8 +137,8 @@ github.com/pkg/errors v0.8.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-20220216144756-c35f1ee13d7c h1:NRoLoZvkBTKvR5gQLgA3e0hqjkY9u1wm+iOL45VN/qI= -github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 h1:o4JXh1EVt9k/+g42oCprj/FisM4qX9L3sZB3upGN2ZU= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= @@ -169,12 +170,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= @@ -241,8 +238,8 @@ golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnf golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f h1:XdNn9LlyWAhLVp6P/i8QYBW+hlyhrhei9uErw2B5GJo= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f/go.mod h1:D5SMRVC3C2/4+F/DB1wZsLRnSNimn2Sp/NPsCrsv8ak= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884 h1:Y/Mj/94zIQQGHVSv1tTtQBDaQaJe62U9bkDZKKyhPCU= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -279,11 +276,11 @@ golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20220829200755-d48e67d00261/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.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/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= -golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= diff --git a/comp/core/log/impl-trace/trace_logger.go b/comp/core/log/impl-trace/trace_logger.go index 71f4f32fdbf45..cbbc8fe5d8a0d 100644 --- a/comp/core/log/impl-trace/trace_logger.go +++ b/comp/core/log/impl-trace/trace_logger.go @@ -3,8 +3,8 @@ // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2016-present Datadog, Inc. -// Package logimpl provides a component that implements the log.Component for the trace-agent logger -package logimpl +// Package traceimpl provides a component that implements the log.Component for the trace-agent logger +package traceimpl import ( "context" diff --git a/comp/core/log/impl-trace/trace_logger_test.go b/comp/core/log/impl-trace/trace_logger_test.go index 8e074becb0772..83c5a18d14aa2 100644 --- a/comp/core/log/impl-trace/trace_logger_test.go +++ b/comp/core/log/impl-trace/trace_logger_test.go @@ -3,7 +3,7 @@ // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2016-present Datadog, Inc. -package logimpl +package traceimpl import ( "testing" diff --git a/comp/core/log/impl/go.mod b/comp/core/log/impl/go.mod index 116cf25e6c584..d0253d6b6c9cf 100644 --- a/comp/core/log/impl/go.mod +++ b/comp/core/log/impl/go.mod @@ -39,7 +39,7 @@ require ( github.com/DataDog/datadog-agent/comp/core/log/def v0.0.0-00010101000000-000000000000 github.com/DataDog/datadog-agent/comp/def v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/config/mock v0.59.0 - github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 + github.com/DataDog/datadog-agent/pkg/util/log v0.59.1 github.com/DataDog/datadog-agent/pkg/util/log/setup v0.0.0-00010101000000-000000000000 github.com/stretchr/testify v1.10.0 ) @@ -61,29 +61,30 @@ require ( github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/optional v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/pointer v0.59.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.1 // indirect 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.0 // indirect - github.com/DataDog/viper v1.13.5 // 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.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 - github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 // indirect + github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 // indirect - github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c // indirect + github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c // indirect github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect 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/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // 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 @@ -97,11 +98,13 @@ require ( go.uber.org/fx v1.23.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect - golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f // indirect - golang.org/x/sys v0.27.0 // indirect - golang.org/x/text v0.20.0 // indirect + golang.org/x/exp v0.0.0-20241210194714-1829a127f884 // indirect + golang.org/x/sys v0.28.0 // indirect + golang.org/x/text v0.21.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) replace github.com/DataDog/datadog-agent/pkg/config/structure => ../../../../pkg/config/structure + +replace github.com/DataDog/datadog-agent/pkg/version => ../../../../pkg/version diff --git a/comp/core/log/impl/go.sum b/comp/core/log/impl/go.sum index 324945ccfacf2..6ffaa516a7a51 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= @@ -70,7 +72,6 @@ github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/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= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -85,8 +86,8 @@ github.com/grpc-ecosystem/grpc-gateway v1.13.0/go.mod h1:8XEsbTttt/W+VvjtQhLACqC github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/hcl v1.0.1-vault-5 h1:kI3hhbbyzr4dldA8UdTb7ZlVVlI2DACdCfz31RPDgJM= github.com/hashicorp/hcl v1.0.1-vault-5/go.mod h1:XYhtn6ijBSAj6n4YqAaf7RBPS4I06AItNorpy+MoQNM= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 h1:S4qyfL2sEm5Budr4KVMyEniCy+PbS55651I/a+Kn/NQ= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb h1:PGufWXXDq9yaev6xX1YQauaO1MV90e6Mpoq1I7Lz/VM= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= @@ -108,8 +109,8 @@ 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-20220913051719-115f729f3c8c h1:VtwQ41oftZwlMnOEbMWQtSEUgU64U4s+GHk7hZK+jtY= -github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c/go.mod h1:JKx41uQRwqlTZabZc+kILPrO/3jlKnQ2Z8b7YiVw5cE= +github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a h1:3Bm7EwfUQUvhNeKIkUct/gl9eod1TcXuj8stxvi/GoI= +github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a/go.mod h1:ilwx/Dta8jXAgpFYFvSWEMwxmbWXyiUHkd5FwyKhb5k= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= @@ -136,8 +137,8 @@ github.com/pkg/errors v0.8.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-20220216144756-c35f1ee13d7c h1:NRoLoZvkBTKvR5gQLgA3e0hqjkY9u1wm+iOL45VN/qI= -github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 h1:o4JXh1EVt9k/+g42oCprj/FisM4qX9L3sZB3upGN2ZU= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= @@ -169,12 +170,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= @@ -241,8 +238,8 @@ golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnf golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f h1:XdNn9LlyWAhLVp6P/i8QYBW+hlyhrhei9uErw2B5GJo= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f/go.mod h1:D5SMRVC3C2/4+F/DB1wZsLRnSNimn2Sp/NPsCrsv8ak= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884 h1:Y/Mj/94zIQQGHVSv1tTtQBDaQaJe62U9bkDZKKyhPCU= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -279,11 +276,11 @@ golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20220829200755-d48e67d00261/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.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/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= -golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= diff --git a/comp/core/log/mock/go.mod b/comp/core/log/mock/go.mod index 96c709d9f2f32..e4f0f87cabdcb 100644 --- a/comp/core/log/mock/go.mod +++ b/comp/core/log/mock/go.mod @@ -31,17 +31,18 @@ replace ( require ( github.com/DataDog/datadog-agent/comp/core/log/def v0.0.0-00010101000000-000000000000 - github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 + github.com/DataDog/datadog-agent/pkg/util/log v0.59.1 github.com/DataDog/datadog-agent/pkg/util/log/setup v0.0.0-00010101000000-000000000000 - github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 ) require ( github.com/DataDog/datadog-agent/pkg/config/model v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/config/nodetreemodel v0.60.0-devel // indirect github.com/DataDog/datadog-agent/pkg/config/teeconfig v0.60.0-devel // indirect - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.0 // indirect - github.com/DataDog/viper v1.13.5 // 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.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 github.com/magiconair/properties v1.8.7 // indirect @@ -53,10 +54,13 @@ require ( github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect go.uber.org/atomic v1.11.0 // indirect - golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f // indirect - golang.org/x/sys v0.27.0 // indirect - golang.org/x/text v0.20.0 // indirect + golang.org/x/exp v0.0.0-20241210194714-1829a127f884 // indirect + golang.org/x/sys v0.28.0 // indirect + golang.org/x/text v0.21.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect ) replace github.com/DataDog/datadog-agent/pkg/config/structure => ../../../../pkg/config/structure + +replace github.com/DataDog/datadog-agent/pkg/version => ../../../../pkg/version diff --git a/comp/core/log/mock/go.sum b/comp/core/log/mock/go.sum index b3bd1378fba86..7df81a96382fb 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= @@ -78,8 +80,8 @@ github.com/grpc-ecosystem/grpc-gateway v1.13.0/go.mod h1:8XEsbTttt/W+VvjtQhLACqC github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/hcl v1.0.1-vault-5 h1:kI3hhbbyzr4dldA8UdTb7ZlVVlI2DACdCfz31RPDgJM= github.com/hashicorp/hcl v1.0.1-vault-5/go.mod h1:XYhtn6ijBSAj6n4YqAaf7RBPS4I06AItNorpy+MoQNM= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 h1:S4qyfL2sEm5Budr4KVMyEniCy+PbS55651I/a+Kn/NQ= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb h1:PGufWXXDq9yaev6xX1YQauaO1MV90e6Mpoq1I7Lz/VM= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= @@ -99,8 +101,8 @@ 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-20220913051719-115f729f3c8c h1:VtwQ41oftZwlMnOEbMWQtSEUgU64U4s+GHk7hZK+jtY= -github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c/go.mod h1:JKx41uQRwqlTZabZc+kILPrO/3jlKnQ2Z8b7YiVw5cE= +github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a h1:3Bm7EwfUQUvhNeKIkUct/gl9eod1TcXuj8stxvi/GoI= +github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a/go.mod h1:ilwx/Dta8jXAgpFYFvSWEMwxmbWXyiUHkd5FwyKhb5k= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= @@ -125,8 +127,8 @@ github.com/pkg/errors v0.8.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-20220216144756-c35f1ee13d7c h1:NRoLoZvkBTKvR5gQLgA3e0hqjkY9u1wm+iOL45VN/qI= -github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 h1:o4JXh1EVt9k/+g42oCprj/FisM4qX9L3sZB3upGN2ZU= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= @@ -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= @@ -207,8 +207,8 @@ golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnf golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f h1:XdNn9LlyWAhLVp6P/i8QYBW+hlyhrhei9uErw2B5GJo= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f/go.mod h1:D5SMRVC3C2/4+F/DB1wZsLRnSNimn2Sp/NPsCrsv8ak= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884 h1:Y/Mj/94zIQQGHVSv1tTtQBDaQaJe62U9bkDZKKyhPCU= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -241,11 +241,11 @@ golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20220829200755-d48e67d00261/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.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/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= -golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= diff --git a/comp/core/log/mock/mock.go b/comp/core/log/mock/mock.go index b3dde056dcb8f..9e29cdf5fb65a 100644 --- a/comp/core/log/mock/mock.go +++ b/comp/core/log/mock/mock.go @@ -10,8 +10,6 @@ import ( "strings" "testing" - "github.com/cihub/seelog" - log "github.com/DataDog/datadog-agent/comp/core/log/def" pkglog "github.com/DataDog/datadog-agent/pkg/util/log" @@ -37,7 +35,7 @@ func (tbw *tbWriter) Write(p []byte) (n int, err error) { // New returns a new mock for the log Component func New(t testing.TB) log.Component { // Build a logger that only logs to t.Log(..) - iface, err := seelog.LoggerFromWriterWithMinLevelAndFormat(&tbWriter{t}, seelog.TraceLvl, + iface, err := pkglog.LoggerFromWriterWithMinLevelAndFormat(&tbWriter{t}, pkglog.TraceLvl, "%Date(2006-01-02 15:04:05 MST) | %LEVEL | (%ShortFilePath:%Line in %FuncShort) | %ExtraTextContext%Msg%n") if err != nil { t.Fatal(err.Error()) @@ -45,7 +43,7 @@ func New(t testing.TB) log.Component { t.Cleanup(func() { // stop using the logger to avoid a race condition - pkglog.ChangeLogLevel(seelog.Default, "debug") + pkglog.ChangeLogLevel(pkglog.Default(), "debug") iface.Flush() }) diff --git a/comp/core/secrets/go.mod b/comp/core/secrets/go.mod index c5ef5998edc5d..82884c83888ab 100644 --- a/comp/core/secrets/go.mod +++ b/comp/core/secrets/go.mod @@ -27,8 +27,8 @@ require ( github.com/benbjohnson/clock v1.3.5 github.com/stretchr/testify v1.10.0 go.uber.org/fx v1.23.0 - golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f - golang.org/x/sys v0.27.0 + golang.org/x/exp v0.0.0-20241210194714-1829a127f884 + golang.org/x/sys v0.28.0 gopkg.in/yaml.v2 v2.4.0 ) @@ -36,6 +36,7 @@ require ( github.com/DataDog/datadog-agent/comp/core/flare/builder v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/comp/def v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/pkg/util/optional v0.55.0 // indirect + github.com/DataDog/datadog-agent/pkg/version v0.59.1 // 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 @@ -57,3 +58,5 @@ require ( google.golang.org/protobuf v1.35.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) + +replace github.com/DataDog/datadog-agent/pkg/version => ../../../pkg/version diff --git a/comp/core/secrets/go.sum b/comp/core/secrets/go.sum index 24378e0ee687b..73448320077c4 100644 --- a/comp/core/secrets/go.sum +++ b/comp/core/secrets/go.sum @@ -54,10 +54,10 @@ go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f h1:XdNn9LlyWAhLVp6P/i8QYBW+hlyhrhei9uErw2B5GJo= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f/go.mod h1:D5SMRVC3C2/4+F/DB1wZsLRnSNimn2Sp/NPsCrsv8ak= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884 h1:Y/Mj/94zIQQGHVSv1tTtQBDaQaJe62U9bkDZKKyhPCU= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c= +golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= +golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= google.golang.org/protobuf v1.35.2 h1:8Ar7bF+apOIoThw1EdZl0p1oWvMqTHmpA2fRTyZO8io= google.golang.org/protobuf v1.35.2/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/comp/core/status/go.mod b/comp/core/status/go.mod index c71d31a9e3d40..0080f560df33f 100644 --- a/comp/core/status/go.mod +++ b/comp/core/status/go.mod @@ -8,7 +8,7 @@ require ( github.com/spf13/cast v1.7.0 github.com/stretchr/testify v1.10.0 go.uber.org/fx v1.23.0 - golang.org/x/text v0.20.0 + golang.org/x/text v0.21.0 ) require ( @@ -21,7 +21,7 @@ require ( go.uber.org/dig v1.18.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect - golang.org/x/sys v0.27.0 // indirect + golang.org/x/sys v0.28.0 // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/comp/core/status/go.sum b/comp/core/status/go.sum index 5c1fe66f815be..5008e39745d3e 100644 --- a/comp/core/status/go.sum +++ b/comp/core/status/go.sum @@ -40,10 +40,10 @@ go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= -golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= +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/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= diff --git a/comp/core/status/render_helpers.go b/comp/core/status/render_helpers.go index 7ee0830c50e1b..4c4769927d4c9 100644 --- a/comp/core/status/render_helpers.go +++ b/comp/core/status/render_helpers.go @@ -23,8 +23,6 @@ import ( "github.com/fatih/color" "github.com/spf13/cast" - "golang.org/x/text/cases" - "golang.org/x/text/language" "golang.org/x/text/unicode/norm" ) @@ -290,8 +288,12 @@ func formatTitle(title string) string { } title = strings.Join(words, " ") + if title == "" { + return "" + } + // Capitalize the first letter - return cases.Title(language.English, cases.NoLower).String(title) + return strings.ToUpper(string(title[0])) + title[1:] } func status(check map[string]interface{}) string { diff --git a/comp/core/status/statusimpl/go.mod b/comp/core/status/statusimpl/go.mod index bc13e9cf4a943..58ab1eecba087 100644 --- a/comp/core/status/statusimpl/go.mod +++ b/comp/core/status/statusimpl/go.mod @@ -50,11 +50,11 @@ require ( github.com/DataDog/datadog-agent/pkg/config/setup v0.59.0 github.com/DataDog/datadog-agent/pkg/util/flavor v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/util/fxutil v0.56.0-rc.3 - github.com/DataDog/datadog-agent/pkg/version v0.56.0-rc.3 + github.com/DataDog/datadog-agent/pkg/version v0.59.1 github.com/gorilla/mux v1.8.1 github.com/stretchr/testify v1.10.0 go.uber.org/fx v1.23.0 - golang.org/x/text v0.20.0 + golang.org/x/text v0.21.0 ) require ( @@ -70,27 +70,28 @@ require ( github.com/DataDog/datadog-agent/pkg/util/executable v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/filesystem v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.59.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/log v0.59.1 // indirect github.com/DataDog/datadog-agent/pkg/util/log/setup v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/pkg/util/optional v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/pointer v0.59.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.1 // indirect 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.0 // indirect - github.com/DataDog/viper v1.13.5 // indirect + github.com/DataDog/datadog-agent/pkg/util/winutil v0.59.1 // 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 github.com/hashicorp/hcl v1.0.1-vault-5 // indirect - github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 // indirect + github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 // indirect - github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c // indirect + github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect @@ -98,9 +99,8 @@ require ( github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect 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/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // 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 @@ -113,8 +113,8 @@ require ( go.uber.org/dig v1.18.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect - golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f // indirect - golang.org/x/sys v0.27.0 // indirect + golang.org/x/exp v0.0.0-20241210194714-1829a127f884 // indirect + golang.org/x/sys v0.28.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/comp/core/status/statusimpl/go.sum b/comp/core/status/statusimpl/go.sum index 2d668dccb3ae5..85ab630b30e4b 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= @@ -74,7 +76,6 @@ github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/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= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -91,8 +92,8 @@ github.com/grpc-ecosystem/grpc-gateway v1.13.0/go.mod h1:8XEsbTttt/W+VvjtQhLACqC github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/hcl v1.0.1-vault-5 h1:kI3hhbbyzr4dldA8UdTb7ZlVVlI2DACdCfz31RPDgJM= github.com/hashicorp/hcl v1.0.1-vault-5/go.mod h1:XYhtn6ijBSAj6n4YqAaf7RBPS4I06AItNorpy+MoQNM= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 h1:S4qyfL2sEm5Budr4KVMyEniCy+PbS55651I/a+Kn/NQ= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb h1:PGufWXXDq9yaev6xX1YQauaO1MV90e6Mpoq1I7Lz/VM= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= @@ -114,8 +115,8 @@ 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-20220913051719-115f729f3c8c h1:VtwQ41oftZwlMnOEbMWQtSEUgU64U4s+GHk7hZK+jtY= -github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c/go.mod h1:JKx41uQRwqlTZabZc+kILPrO/3jlKnQ2Z8b7YiVw5cE= +github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a h1:3Bm7EwfUQUvhNeKIkUct/gl9eod1TcXuj8stxvi/GoI= +github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a/go.mod h1:ilwx/Dta8jXAgpFYFvSWEMwxmbWXyiUHkd5FwyKhb5k= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= @@ -147,8 +148,8 @@ github.com/pkg/errors v0.8.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-20220216144756-c35f1ee13d7c h1:NRoLoZvkBTKvR5gQLgA3e0hqjkY9u1wm+iOL45VN/qI= -github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 h1:o4JXh1EVt9k/+g42oCprj/FisM4qX9L3sZB3upGN2ZU= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= @@ -180,12 +181,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= @@ -252,8 +249,8 @@ golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnf golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f h1:XdNn9LlyWAhLVp6P/i8QYBW+hlyhrhei9uErw2B5GJo= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f/go.mod h1:D5SMRVC3C2/4+F/DB1wZsLRnSNimn2Sp/NPsCrsv8ak= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884 h1:Y/Mj/94zIQQGHVSv1tTtQBDaQaJe62U9bkDZKKyhPCU= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -292,11 +289,11 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220829200755-d48e67d00261/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.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/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= -golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= diff --git a/comp/core/tagger/collectors/pod_tag_extractor.go b/comp/core/tagger/collectors/pod_tag_extractor.go index 669a71584f609..aded502edaf4c 100644 --- a/comp/core/tagger/collectors/pod_tag_extractor.go +++ b/comp/core/tagger/collectors/pod_tag_extractor.go @@ -34,6 +34,8 @@ func (p *PodTagExtractor) Extract(podEntity *workloadmeta.KubernetesPod, cardina return append(tagInfos.LowCardTags, tagInfos.OrchestratorCardTags...) case types.LowCardinality: return tagInfos.LowCardTags + case types.NoneCardinality: + return []string{} default: log.Errorf("unsupported tag cardinality %v", cardinality) return []string{} diff --git a/comp/core/tagger/collectors/workloadmeta_main.go b/comp/core/tagger/collectors/workloadmeta_main.go index 3c4150c9f3efb..15fec7fe4ce5b 100644 --- a/comp/core/tagger/collectors/workloadmeta_main.go +++ b/comp/core/tagger/collectors/workloadmeta_main.go @@ -96,7 +96,7 @@ func (c *WorkloadMetaCollector) Run(ctx context.Context, datadogConfig config.Co } func (c *WorkloadMetaCollector) collectStaticGlobalTags(ctx context.Context, datadogConfig config.Component) { - c.staticTags = util.GetStaticTags(ctx) + c.staticTags = util.GetStaticTags(ctx, datadogConfig) if _, exists := c.staticTags[clusterTagNamePrefix]; flavor.GetFlavor() == flavor.ClusterAgent && !exists { // If we are running the cluster agent, we want to set the kube_cluster_name tag as a global tag if we are able // to read it, for the instances where we are running in an environment where hostname cannot be detected. diff --git a/comp/core/tagger/def/component.go b/comp/core/tagger/def/component.go index c580325c3bf81..619196f41de95 100644 --- a/comp/core/tagger/def/component.go +++ b/comp/core/tagger/def/component.go @@ -9,6 +9,7 @@ package tagger import ( "context" + "github.com/DataDog/datadog-agent/comp/core/tagger/origindetection" "github.com/DataDog/datadog-agent/comp/core/tagger/telemetry" "github.com/DataDog/datadog-agent/comp/core/tagger/types" taggertypes "github.com/DataDog/datadog-agent/pkg/tagger/types" @@ -37,6 +38,7 @@ type Component interface { // integrations using the tagger LegacyTag(entity string, cardinality types.TagCardinality) ([]string, error) Tag(entityID types.EntityID, cardinality types.TagCardinality) ([]string, error) + GenerateContainerIDFromOriginInfo(originInfo origindetection.OriginInfo) (string, error) AccumulateTagsFor(entityID types.EntityID, cardinality types.TagCardinality, tb tagset.TagsAccumulator) error Standard(entityID types.EntityID) ([]string, error) List() types.TaggerListResponse diff --git a/comp/core/tagger/impl-noop/tagger.go b/comp/core/tagger/impl-noop/tagger.go index 811a60e905923..986e113df2c1e 100644 --- a/comp/core/tagger/impl-noop/tagger.go +++ b/comp/core/tagger/impl-noop/tagger.go @@ -17,6 +17,7 @@ import ( "context" tagger "github.com/DataDog/datadog-agent/comp/core/tagger/def" + "github.com/DataDog/datadog-agent/comp/core/tagger/origindetection" "github.com/DataDog/datadog-agent/comp/core/tagger/telemetry" "github.com/DataDog/datadog-agent/comp/core/tagger/types" taggertypes "github.com/DataDog/datadog-agent/pkg/tagger/types" @@ -49,6 +50,12 @@ func (n *noopTagger) LegacyTag(string, types.TagCardinality) ([]string, error) { return nil, nil } +// GenerateContainerIDFromOriginInfo generates a container ID from Origin Info. +// This is a no-op for the noop tagger +func (n *noopTagger) GenerateContainerIDFromOriginInfo(origindetection.OriginInfo) (string, error) { + return "", nil +} + func (n *noopTagger) AccumulateTagsFor(types.EntityID, types.TagCardinality, tagset.TagsAccumulator) error { return nil } diff --git a/comp/core/tagger/impl-remote/remote.go b/comp/core/tagger/impl-remote/remote.go index c5a1fb6dad36c..2da451af35302 100644 --- a/comp/core/tagger/impl-remote/remote.go +++ b/comp/core/tagger/impl-remote/remote.go @@ -3,8 +3,8 @@ // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2016-present Datadog, Inc. -// Package remotetaggerimpl implements a remote Tagger. -package remotetaggerimpl +// Package remoteimpl implements a remote Tagger. +package remoteimpl import ( "context" @@ -27,6 +27,7 @@ import ( "github.com/DataDog/datadog-agent/comp/core/config" log "github.com/DataDog/datadog-agent/comp/core/log/def" tagger "github.com/DataDog/datadog-agent/comp/core/tagger/def" + "github.com/DataDog/datadog-agent/comp/core/tagger/origindetection" "github.com/DataDog/datadog-agent/comp/core/tagger/telemetry" "github.com/DataDog/datadog-agent/comp/core/tagger/types" "github.com/DataDog/datadog-agent/comp/core/tagger/utils" @@ -35,6 +36,7 @@ import ( pb "github.com/DataDog/datadog-agent/pkg/proto/pbgo/core" taggertypes "github.com/DataDog/datadog-agent/pkg/tagger/types" "github.com/DataDog/datadog-agent/pkg/tagset" + "github.com/DataDog/datadog-agent/pkg/util/cache" "github.com/DataDog/datadog-agent/pkg/util/common" grpcutil "github.com/DataDog/datadog-agent/pkg/util/grpc" httputils "github.com/DataDog/datadog-agent/pkg/util/http" @@ -43,9 +45,13 @@ import ( const ( noTimeout = 0 * time.Minute streamRecvTimeout = 10 * time.Minute + cacheExpiration = 1 * time.Minute ) -var errTaggerStreamNotStarted = errors.New("tagger stream not started") +var ( + errTaggerStreamNotStarted = errors.New("tagger stream not started") + errTaggerFailedGenerateContainerIDFromOriginInfo = errors.New("tagger failed to generate container ID from origin info") +) // Requires defines the dependencies for the remote tagger. type Requires struct { @@ -75,6 +81,7 @@ type remoteTagger struct { log log.Component conn *grpc.ClientConn + token string client pb.AgentSecureClient stream pb.AgentSecure_TaggerStreamEntitiesClient @@ -250,6 +257,99 @@ func (t *remoteTagger) LegacyTag(entity string, cardinality types.TagCardinality return t.Tag(entityID, cardinality) } +// GenerateContainerIDFromOriginInfo returns a container ID for the given Origin Info. +// This function currently only uses the External Data from the Origin Info to generate the container ID. +func (t *remoteTagger) GenerateContainerIDFromOriginInfo(originInfo origindetection.OriginInfo) (string, error) { + fail := true + defer func() { + if fail { + t.telemetryStore.OriginInfoRequests.Inc("failed") + } else { + t.telemetryStore.OriginInfoRequests.Inc("success") + } + }() + + // Generate cache key + initPrefix := "" + if originInfo.ExternalData.Init { + initPrefix = "i/" + } + key := cache.BuildAgentKey( + "remoteTagger", + "cid", + initPrefix+originInfo.ExternalData.PodUID+"/"+originInfo.ExternalData.ContainerName, + ) + + cachedContainerID, err := cache.GetWithExpiration(key, func() (containerID string, err error) { + containerID, err = t.queryContainerIDFromOriginInfo(originInfo) + return containerID, err + }, cacheExpiration) + + if err != nil { + return "", err + } + fail = false + return cachedContainerID, nil +} + +// queryContainerIDFromOriginInfo calls the local tagger to get the container ID from the Origin Info. +func (t *remoteTagger) queryContainerIDFromOriginInfo(originInfo origindetection.OriginInfo) (containerID string, err error) { + expBackoff := backoff.NewExponentialBackOff() + expBackoff.InitialInterval = 200 * time.Millisecond + expBackoff.MaxInterval = 1 * time.Second + expBackoff.MaxElapsedTime = 15 * time.Second + + err = backoff.Retry(func() error { + select { + case <-t.ctx.Done(): + return &backoff.PermanentError{Err: errTaggerFailedGenerateContainerIDFromOriginInfo} + default: + } + + // Fetch the auth token + if t.token == "" { + var authError error + t.token, authError = t.options.TokenFetcher() + if authError != nil { + _ = t.log.Errorf("unable to fetch auth token, will possibly retry: %s", authError) + return authError + } + } + + // Create the context with the auth token + queryCtx, queryCancel := context.WithCancel( + metadata.NewOutgoingContext(t.ctx, metadata.MD{ + "authorization": []string{fmt.Sprintf("Bearer %s", t.token)}, + }), + ) + defer queryCancel() + + // Call the gRPC method to get the container ID from the origin info + containerIDResponse, err := t.client.TaggerGenerateContainerIDFromOriginInfo(queryCtx, &pb.GenerateContainerIDFromOriginInfoRequest{ + ExternalData: &pb.GenerateContainerIDFromOriginInfoRequest_ExternalData{ + Init: &originInfo.ExternalData.Init, + ContainerName: &originInfo.ExternalData.ContainerName, + PodUID: &originInfo.ExternalData.PodUID, + }, + }) + if err != nil { + _ = t.log.Errorf("unable to generate container ID from origin info, will retry: %s", err) + return err + } + + if containerIDResponse == nil { + _ = t.log.Warnf("unable to generate container ID from origin info, will retry: %s", err) + return errors.New("containerIDResponse is nil") + } + containerID = containerIDResponse.ContainerID + + t.log.Debugf("Container ID generated successfully from origin info %+v: %s", originInfo, containerID) + return nil + }, expBackoff) + + return containerID, err +} + // AccumulateTagsFor returns tags for a given entity at the desired cardinality. func (t *remoteTagger) AccumulateTagsFor(entityID types.EntityID, cardinality types.TagCardinality, tb tagset.TagsAccumulator) error { tags, err := t.Tag(entityID, cardinality) diff --git a/comp/core/tagger/impl-remote/remote_test.go b/comp/core/tagger/impl-remote/remote_test.go index 48c00d8006bf7..c19b8f5fe1336 100644 --- a/comp/core/tagger/impl-remote/remote_test.go +++ b/comp/core/tagger/impl-remote/remote_test.go @@ -3,7 +3,7 @@ // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2016-present Datadog, Inc. -package remotetaggerimpl +package remoteimpl import ( "context" diff --git a/comp/core/tagger/impl-remote/tagstore.go b/comp/core/tagger/impl-remote/tagstore.go index de354cf070ad6..11f189ae6da90 100644 --- a/comp/core/tagger/impl-remote/tagstore.go +++ b/comp/core/tagger/impl-remote/tagstore.go @@ -3,7 +3,7 @@ // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2016-present Datadog, Inc. -package remotetaggerimpl +package remoteimpl import ( "sync" diff --git a/comp/core/tagger/impl-remote/tagstore_test.go b/comp/core/tagger/impl-remote/tagstore_test.go index 8cd92107d56cc..ce2a226ed5dd8 100644 --- a/comp/core/tagger/impl-remote/tagstore_test.go +++ b/comp/core/tagger/impl-remote/tagstore_test.go @@ -3,7 +3,7 @@ // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2016-present Datadog, Inc. -package remotetaggerimpl +package remoteimpl import ( "testing" diff --git a/comp/core/tagger/impl/local_tagger.go b/comp/core/tagger/impl/local_tagger.go index ac2259342eb25..85c8741c52b02 100644 --- a/comp/core/tagger/impl/local_tagger.go +++ b/comp/core/tagger/impl/local_tagger.go @@ -9,16 +9,20 @@ import ( "context" "fmt" "sync" + "time" "github.com/DataDog/datadog-agent/comp/core/config" "github.com/DataDog/datadog-agent/comp/core/tagger/collectors" tagger "github.com/DataDog/datadog-agent/comp/core/tagger/def" + "github.com/DataDog/datadog-agent/comp/core/tagger/origindetection" "github.com/DataDog/datadog-agent/comp/core/tagger/tagstore" "github.com/DataDog/datadog-agent/comp/core/tagger/telemetry" "github.com/DataDog/datadog-agent/comp/core/tagger/types" workloadmeta "github.com/DataDog/datadog-agent/comp/core/workloadmeta/def" taggertypes "github.com/DataDog/datadog-agent/pkg/tagger/types" "github.com/DataDog/datadog-agent/pkg/tagset" + "github.com/DataDog/datadog-agent/pkg/util/containers/metrics" + "github.com/DataDog/datadog-agent/pkg/util/optional" ) // Tagger is the entry class for entity tagging. It hold the tagger collector, @@ -99,6 +103,12 @@ func (t *localTagger) Tag(entityID types.EntityID, cardinality types.TagCardinal return tags.Copy(), nil } +// GenerateContainerIDFromOriginInfo generates a container ID from Origin Info. +func (t *localTagger) GenerateContainerIDFromOriginInfo(originInfo origindetection.OriginInfo) (string, error) { + metaCollector := metrics.GetProvider(optional.NewOption(t.workloadStore)).GetMetaCollector() + return metaCollector.ContainerIDForPodUIDAndContName(originInfo.ExternalData.PodUID, originInfo.ExternalData.ContainerName, originInfo.ExternalData.Init, time.Second) +} + // LegacyTag has the same behaviour as the Tag method, but it receives the entity id as a string and parses it. // If possible, avoid using this function, and use the Tag method instead. // This function exists in order not to break backward compatibility with rtloader and python diff --git a/comp/core/tagger/impl/replay_tagger.go b/comp/core/tagger/impl/replay_tagger.go index ddc9851a898db..6f012e9c9d680 100644 --- a/comp/core/tagger/impl/replay_tagger.go +++ b/comp/core/tagger/impl/replay_tagger.go @@ -11,6 +11,7 @@ import ( "time" tagger "github.com/DataDog/datadog-agent/comp/core/tagger/def" + "github.com/DataDog/datadog-agent/comp/core/tagger/origindetection" "github.com/DataDog/datadog-agent/comp/core/tagger/tagstore" "github.com/DataDog/datadog-agent/comp/core/tagger/telemetry" "github.com/DataDog/datadog-agent/comp/core/tagger/types" @@ -77,6 +78,12 @@ func (t *replayTagger) LegacyTag(entity string, cardinality types.TagCardinality return t.Tag(entityID, cardinality) } +// GenerateContainerIDFromOriginInfo generates a container ID from Origin Info. +// This is a no-op for the replay tagger +func (t *replayTagger) GenerateContainerIDFromOriginInfo(origindetection.OriginInfo) (string, error) { + return "", nil +} + // AccumulateTagsFor returns tags for a given entity at the desired cardinality. func (t *replayTagger) AccumulateTagsFor(entityID types.EntityID, cardinality types.TagCardinality, tb tagset.TagsAccumulator) error { tags := t.store.LookupHashed(entityID, cardinality) diff --git a/comp/core/tagger/impl/tagger.go b/comp/core/tagger/impl/tagger.go index 1ef1a137d6a34..de05b9f6eaa09 100644 --- a/comp/core/tagger/impl/tagger.go +++ b/comp/core/tagger/impl/tagger.go @@ -27,6 +27,7 @@ import ( log "github.com/DataDog/datadog-agent/comp/core/log/def" tagger "github.com/DataDog/datadog-agent/comp/core/tagger/def" taggermock "github.com/DataDog/datadog-agent/comp/core/tagger/mock" + "github.com/DataDog/datadog-agent/comp/core/tagger/origindetection" "github.com/DataDog/datadog-agent/comp/core/tagger/telemetry" "github.com/DataDog/datadog-agent/comp/core/tagger/types" "github.com/DataDog/datadog-agent/comp/core/tagger/utils" @@ -421,7 +422,7 @@ func (t *TaggerWrapper) EnrichTags(tb tagset.TagsAccumulator, originInfo taggert // | none | empty || empty | // | empty | not empty || container prefix + originFromMsg | // | none | not empty || container prefix + originFromMsg | - if t.datadogConfig.dogstatsdOptOutEnabled && originInfo.Cardinality == "none" { + if t.datadogConfig.dogstatsdOptOutEnabled && originInfo.Cardinality == types.NoneCardinalityString { originInfo.ContainerIDFromSocket = packets.NoOrigin originInfo.PodUID = "" originInfo.ContainerID = "" @@ -459,8 +460,7 @@ func (t *TaggerWrapper) EnrichTags(tb tagset.TagsAccumulator, originInfo taggert } default: // Disable origin detection if cardinality is none - // TODO: The `none` cardinality should be directly supported by the Tagger. - if originInfo.Cardinality == "none" { + if originInfo.Cardinality == types.NoneCardinalityString { originInfo.ContainerIDFromSocket = packets.NoOrigin originInfo.PodUID = "" originInfo.ContainerID = "" @@ -538,7 +538,12 @@ func (t *TaggerWrapper) EnrichTags(tb tagset.TagsAccumulator, originInfo taggert } } -// generateContainerIDFromExternalData generates a container ID from the external data +// GenerateContainerIDFromOriginInfo generates a container ID from Origin Info. +func (t *TaggerWrapper) GenerateContainerIDFromOriginInfo(originInfo origindetection.OriginInfo) (string, error) { + return t.defaultTagger.GenerateContainerIDFromOriginInfo(originInfo) +} + +// generateContainerIDFromExternalData generates a container ID from the External Data. func (t *TaggerWrapper) generateContainerIDFromExternalData(e externalData, metricsProvider provider.ContainerIDForPodUIDAndContNameRetriever) (string, error) { return metricsProvider.ContainerIDForPodUIDAndContName(e.podUID, e.containerName, e.init, time.Second) } diff --git a/comp/core/tagger/mock/fake_tagger.go b/comp/core/tagger/mock/fake_tagger.go index b4ff66a65d2c6..8a609d052c766 100644 --- a/comp/core/tagger/mock/fake_tagger.go +++ b/comp/core/tagger/mock/fake_tagger.go @@ -10,6 +10,7 @@ import ( "strconv" tagger "github.com/DataDog/datadog-agent/comp/core/tagger/def" + "github.com/DataDog/datadog-agent/comp/core/tagger/origindetection" "github.com/DataDog/datadog-agent/comp/core/tagger/tagstore" "github.com/DataDog/datadog-agent/comp/core/tagger/telemetry" "github.com/DataDog/datadog-agent/comp/core/tagger/types" @@ -118,6 +119,11 @@ func (f *FakeTagger) LegacyTag(entity string, cardinality types.TagCardinality) return f.Tag(entityID, cardinality) } +// GenerateContainerIDFromOriginInfo fake implementation +func (f *FakeTagger) GenerateContainerIDFromOriginInfo(origindetection.OriginInfo) (string, error) { + return "", nil +} + // GlobalTags fake implementation func (f *FakeTagger) GlobalTags(cardinality types.TagCardinality) ([]string, error) { return f.Tag(types.GetGlobalEntityID(), cardinality) diff --git a/comp/core/tagger/origindetection/go.mod b/comp/core/tagger/origindetection/go.mod new file mode 100644 index 0000000000000..10e53c86ea39d --- /dev/null +++ b/comp/core/tagger/origindetection/go.mod @@ -0,0 +1,14 @@ +module github.com/DataDog/datadog-agent/comp/core/tagger/origindetection + +go 1.22.0 + +require github.com/stretchr/testify v1.10.0 + +require ( + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/kr/pretty v0.3.1 // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect + github.com/rogpeppe/go-internal v1.13.1 // indirect + gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect +) diff --git a/comp/core/tagger/origindetection/go.sum b/comp/core/tagger/origindetection/go.sum new file mode 100644 index 0000000000000..cec386e1e2769 --- /dev/null +++ b/comp/core/tagger/origindetection/go.sum @@ -0,0 +1,23 @@ +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +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/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= +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/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= +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/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= +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/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/comp/core/tagger/origindetection/origindetection.go b/comp/core/tagger/origindetection/origindetection.go new file mode 100644 index 0000000000000..712792c54f298 --- /dev/null +++ b/comp/core/tagger/origindetection/origindetection.go @@ -0,0 +1,84 @@ +// 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. + +// TODO: A lot of the code in this file is currently duplicated in taggertypes. +// We will need to move all the code in taggertype to this file and remove the taggertypes package. + +// Package origindetection contains the types and functions used for Origin Detection. +package origindetection + +import ( + "strconv" + "strings" +) + +// ProductOrigin is the origin of the product that sent the entity. +type ProductOrigin int + +const ( + // ProductOriginDogStatsDLegacy is the ProductOrigin for DogStatsD in Legacy mode. + // TODO: remove this when dogstatsd_origin_detection_unified is enabled by default + ProductOriginDogStatsDLegacy ProductOrigin = iota + // ProductOriginDogStatsD is the ProductOrigin for DogStatsD. + ProductOriginDogStatsD ProductOrigin = iota + // ProductOriginAPM is the ProductOrigin for APM. + ProductOriginAPM ProductOrigin = iota + + // External Data Prefixes + // These prefixes are used to build the External Data Environment Variable. + + // ExternalDataInitPrefix is the prefix for the Init flag in the External Data. + ExternalDataInitPrefix = "it-" + // ExternalDataContainerNamePrefix is the prefix for the Container Name in the External Data. + ExternalDataContainerNamePrefix = "cn-" + // ExternalDataPodUIDPrefix is the prefix for the Pod UID in the External Data. + ExternalDataPodUIDPrefix = "pu-" +) + +// OriginInfo contains the Origin Detection information. +type OriginInfo struct { + LocalData LocalData // LocalData is the local data list. + ExternalData ExternalData // ExternalData is the external data list. + Cardinality string // Cardinality is the cardinality of the resolved origin. + ProductOrigin ProductOrigin // ProductOrigin is the product that sent the origin information. +} + +// LocalData that is generated by the client and sent to the Agent. +type LocalData struct { + ProcessID uint32 // ProcessID of the container process on the host. + ContainerID string // ContainerID sent from the client. + Inode uint64 // Inode is the Cgroup inode of the container. + PodUID string // PodUID of the pod sent from the client. +} + +// ExternalData generated by the Admission Controller and sent to the Agent. +type ExternalData struct { + Init bool // Init is true if the container is an init container. + ContainerName string // ContainerName is the name of the container as seen by the Admission Controller. + PodUID string // PodUID is the UID of the pod as seen by the Admission Controller. +} + +// GenerateContainerIDFromExternalData generates a container ID from the external data. +type GenerateContainerIDFromExternalData func(externalData ExternalData) (string, error) + +// ParseExternalData parses the external data string into an ExternalData struct. +func ParseExternalData(externalEnv string) (ExternalData, error) { + if externalEnv == "" { + return ExternalData{}, nil + } + var externalData ExternalData + var parsingError error + for _, item := range strings.Split(externalEnv, ",") { + switch { + case strings.HasPrefix(item, ExternalDataInitPrefix): + externalData.Init, parsingError = strconv.ParseBool(item[len(ExternalDataInitPrefix):]) + case strings.HasPrefix(item, ExternalDataContainerNamePrefix): + externalData.ContainerName = item[len(ExternalDataContainerNamePrefix):] + case strings.HasPrefix(item, ExternalDataPodUIDPrefix): + externalData.PodUID = item[len(ExternalDataPodUIDPrefix):] + } + } + return externalData, parsingError +} diff --git a/comp/core/tagger/origindetection/origindetection_test.go b/comp/core/tagger/origindetection/origindetection_test.go new file mode 100644 index 0000000000000..a873093f6191b --- /dev/null +++ b/comp/core/tagger/origindetection/origindetection_test.go @@ -0,0 +1,81 @@ +// 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 origindetection contains the types and functions used for Origin Detection. +package origindetection + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestParseExternalData(t *testing.T) { + tests := []struct { + name string + externalEnv string + expectedData ExternalData + expectedError bool + }{ + { + name: "Empty external data", + externalEnv: "", + expectedData: ExternalData{ + Init: false, + ContainerName: "", + PodUID: "", + }, + expectedError: false, + }, + { + name: "Valid external data with Init", + externalEnv: "it-true,cn-container-name,pu-12345678-90ab-cdef-1234-567890abcdef", + expectedData: ExternalData{ + Init: true, + ContainerName: "container-name", + PodUID: "12345678-90ab-cdef-1234-567890abcdef", + }, + expectedError: false, + }, + { + name: "Invalid Init value", + externalEnv: "it-invalid,cn-container-name,pu-12345678-90ab-cdef-1234-567890abcdef", + expectedData: ExternalData{}, + expectedError: true, + }, + { + name: "Partial external data", + externalEnv: "cn-container-name", + expectedData: ExternalData{ + Init: false, + ContainerName: "container-name", + PodUID: "", + }, + expectedError: false, + }, + { + name: "Unrecognized prefix", + externalEnv: "unknown-prefix", + expectedData: ExternalData{ + Init: false, + ContainerName: "", + PodUID: "", + }, + expectedError: false, + }, + } + + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + result, err := ParseExternalData(tc.externalEnv) + + if tc.expectedError { + assert.Error(t, err) + } else { + assert.Equal(t, tc.expectedData, result) + } + }) + } +} diff --git a/comp/core/tagger/server/server.go b/comp/core/tagger/server/server.go index 5e323c43c7ee2..34a719f32c440 100644 --- a/comp/core/tagger/server/server.go +++ b/comp/core/tagger/server/server.go @@ -17,6 +17,7 @@ import ( "github.com/google/uuid" tagger "github.com/DataDog/datadog-agent/comp/core/tagger/def" + "github.com/DataDog/datadog-agent/comp/core/tagger/origindetection" "github.com/DataDog/datadog-agent/comp/core/tagger/proto" "github.com/DataDog/datadog-agent/comp/core/tagger/types" pb "github.com/DataDog/datadog-agent/pkg/proto/pbgo/core" @@ -165,3 +166,22 @@ func (s *Server) TaggerFetchEntity(_ context.Context, in *pb.FetchEntityRequest) Tags: tags, }, nil } + +// TaggerGenerateContainerIDFromOriginInfo request the generation of a container ID from external data from the Tagger. +// This function takes an Origin Info but only uses the ExternalData part of it, this is done for backward compatibility. +func (s *Server) TaggerGenerateContainerIDFromOriginInfo(_ context.Context, in *pb.GenerateContainerIDFromOriginInfoRequest) (*pb.GenerateContainerIDFromOriginInfoResponse, error) { + generatedContainerID, err := s.taggerComponent.GenerateContainerIDFromOriginInfo(origindetection.OriginInfo{ + ExternalData: origindetection.ExternalData{ + Init: *in.ExternalData.Init, + ContainerName: *in.ExternalData.ContainerName, + PodUID: *in.ExternalData.PodUID, + }, + }) + if err != nil { + return nil, status.Errorf(codes.InvalidArgument, "%s", err) + } + + return &pb.GenerateContainerIDFromOriginInfoResponse{ + ContainerID: generatedContainerID, + }, nil +} diff --git a/comp/core/tagger/subscriber/subscription_manager_test.go b/comp/core/tagger/subscriber/subscription_manager_test.go index b9684af30e2d4..dbebd8ed23d98 100644 --- a/comp/core/tagger/subscriber/subscription_manager_test.go +++ b/comp/core/tagger/subscriber/subscription_manager_test.go @@ -109,6 +109,21 @@ func TestSubscriptionManager(t *testing.T) { highCardSubscription.Unsubscribe() + // None Cardinality Subscriber + noneCardSubID := "none-card-sub" + noneCardSubscription, err := sm.Subscribe(noneCardSubID, types.NewFilterBuilder().Include(types.EntityIDPrefix("foo")).Build(types.NoneCardinality), nil) + require.NoError(t, err) + + sm.Notify([]types.EntityEvent{ + events["added"], + events["modified"], + events["deleted"], + events["added-with-no-id"], + events["added-with-unmatched-prefix"], + }) + + noneCardSubscription.Unsubscribe() + // Verify low cardinality subscriber received events assertReceivedEvents(t, lowCardSubscription.EventsChan(), []types.EntityEvent{ { @@ -192,6 +207,28 @@ func TestSubscriptionManager(t *testing.T) { }, }, }) + + // Verify none cardinality subscriber received events + assertReceivedEvents(t, noneCardSubscription.EventsChan(), []types.EntityEvent{ + { + EventType: types.EventTypeAdded, + Entity: types.Entity{ + ID: entityID, + }, + }, + { + EventType: types.EventTypeModified, + Entity: types.Entity{ + ID: entityID, + }, + }, + { + EventType: types.EventTypeDeleted, + Entity: types.Entity{ + ID: entityID, + }, + }, + }) } func assertReceivedEvents(t *testing.T, ch chan []types.EntityEvent, expectedEvents []types.EntityEvent) { diff --git a/comp/core/tagger/tagstore/entity_tags.go b/comp/core/tagger/tagstore/entity_tags.go index 3488a8e345c16..ed62d45849109 100644 --- a/comp/core/tagger/tagstore/entity_tags.go +++ b/comp/core/tagger/tagstore/entity_tags.go @@ -109,12 +109,16 @@ func (e *EntityTagsWithMultipleSources) getStandard() []string { func (e *EntityTagsWithMultipleSources) getHashedTags(cardinality types.TagCardinality) tagset.HashedTags { e.computeCache() - if cardinality == types.HighCardinality { + switch cardinality { + case types.HighCardinality: return e.cachedAll - } else if cardinality == types.OrchestratorCardinality { + case types.OrchestratorCardinality: return e.cachedOrchestrator + case types.NoneCardinality: + return tagset.HashedTags{} + default: + return e.cachedLow } - return e.cachedLow } func (e *EntityTagsWithMultipleSources) computeCache() { @@ -302,6 +306,8 @@ func (e *EntityTagsWithSingleSource) getHashedTags(cardinality types.TagCardinal return e.cachedAll case types.OrchestratorCardinality: return e.cachedOrchestrator + case types.NoneCardinality: + return tagset.HashedTags{} default: return e.cachedLow } diff --git a/comp/core/tagger/tagstore/entity_tags_test.go b/comp/core/tagger/tagstore/entity_tags_test.go index c93d764377aaf..16e2d4b077f86 100644 --- a/comp/core/tagger/tagstore/entity_tags_test.go +++ b/comp/core/tagger/tagstore/entity_tags_test.go @@ -100,6 +100,12 @@ func TestGetHashedTags(t *testing.T) { []string{"l1:v1", "l2:v2", "service:s1", "o1:v1", "o2:v2", "h1:v1", "h2:v2"}, entityTags.getHashedTags(types.HighCardinality).Get(), ) + + assert.Equal( + t, + []string(nil), + entityTags.getHashedTags(types.NoneCardinality).Get(), + ) } func TestTagsForSource(t *testing.T) { diff --git a/comp/core/tagger/tagstore/tagstore_test.go b/comp/core/tagger/tagstore/tagstore_test.go index 4699aa6ad56cb..0d992b682ca68 100644 --- a/comp/core/tagger/tagstore/tagstore_test.go +++ b/comp/core/tagger/tagstore/tagstore_test.go @@ -88,10 +88,12 @@ func (s *StoreTestSuite) TestLookup() { tagsHigh := s.tagstore.Lookup(entityID, types.HighCardinality) tagsOrch := s.tagstore.Lookup(entityID, types.OrchestratorCardinality) tagsLow := s.tagstore.Lookup(entityID, types.LowCardinality) + tagsNone := s.tagstore.Lookup(entityID, types.NoneCardinality) assert.Len(s.T(), tagsHigh, 4) assert.Len(s.T(), tagsLow, 2) assert.Len(s.T(), tagsOrch, 3) + assert.Nil(s.T(), tagsNone) } func (s *StoreTestSuite) TestLookupHashedWithEntityStr() { @@ -118,10 +120,12 @@ func (s *StoreTestSuite) TestLookupHashedWithEntityStr() { tagsLow := s.tagstore.LookupHashedWithEntityStr(entityID, types.LowCardinality) tagsOrch := s.tagstore.LookupHashedWithEntityStr(entityID, types.OrchestratorCardinality) tagsHigh := s.tagstore.LookupHashedWithEntityStr(entityID, types.HighCardinality) + tagsNone := s.tagstore.LookupHashedWithEntityStr(entityID, types.NoneCardinality) assert.ElementsMatch(s.T(), tagsLow.Get(), []string{"low1", "low2"}) assert.ElementsMatch(s.T(), tagsOrch.Get(), []string{"low1", "low2", "orchestrator1"}) assert.ElementsMatch(s.T(), tagsHigh.Get(), []string{"low1", "low2", "orchestrator1", "high1"}) + assert.ElementsMatch(s.T(), tagsNone.Get(), []string{}) } func (s *StoreTestSuite) TestLookupStandard() { diff --git a/comp/core/tagger/telemetry/telemetry.go b/comp/core/tagger/telemetry/telemetry.go index 8b50202dd2e99..0682475eb6d8e 100644 --- a/comp/core/tagger/telemetry/telemetry.go +++ b/comp/core/tagger/telemetry/telemetry.go @@ -61,9 +61,14 @@ type Store struct { // notification with a group of events. Receives telemetry.Counter + // OriginInfoRequests tracks the number of requests to the Tagger + // to generate a container ID from Origin Info. + OriginInfoRequests telemetry.Counter + LowCardinalityQueries CardinalityTelemetry OrchestratorCardinalityQueries CardinalityTelemetry HighCardinalityQueries CardinalityTelemetry + NoneCardinalityQueries CardinalityTelemetry UnknownCardinalityQueries CardinalityTelemetry } @@ -131,9 +136,16 @@ func NewStore(telemetryComp telemetry.Component) *Store { []string{}, "Number of of times the tagger has received a notification with a group of events", telemetry.Options{NoDoubleUnderscoreSep: true}), + // OriginInfoRequests tracks the number of requests to the tagger + // to generate a container ID from origin info. + OriginInfoRequests: telemetryComp.NewCounterWithOpts(subsystem, "origin_info_requests", + []string{"status"}, "Number of requests to the tagger to generate a container ID from origin info.", + telemetry.Options{NoDoubleUnderscoreSep: true}), + LowCardinalityQueries: newCardinalityTelemetry(queries, types.LowCardinalityString), OrchestratorCardinalityQueries: newCardinalityTelemetry(queries, types.OrchestratorCardinalityString), HighCardinalityQueries: newCardinalityTelemetry(queries, types.HighCardinalityString), + NoneCardinalityQueries: newCardinalityTelemetry(queries, types.NoneCardinalityString), UnknownCardinalityQueries: newCardinalityTelemetry(queries, types.UnknownCardinalityString), } }) @@ -150,6 +162,8 @@ func (s *Store) QueriesByCardinality(card types.TagCardinality) *CardinalityTele return &s.OrchestratorCardinalityQueries case types.HighCardinality: return &s.HighCardinalityQueries + case types.NoneCardinality: + return &s.NoneCardinalityQueries default: return &s.UnknownCardinalityQueries } diff --git a/comp/core/tagger/types/types.go b/comp/core/tagger/types/types.go index e45f9e6daa084..dc53af7baf27b 100644 --- a/comp/core/tagger/types/types.go +++ b/comp/core/tagger/types/types.go @@ -78,6 +78,7 @@ const ( LowCardinality TagCardinality = iota OrchestratorCardinality HighCardinality + NoneCardinality ) // Entity is an entity ID + tags. @@ -92,6 +93,10 @@ type Entity struct { // GetTags flattens all tags from all cardinalities into a single slice of tag // strings. func (e Entity) GetTags(cardinality TagCardinality) []string { + if cardinality == NoneCardinality { + return []string{} + } + tagArrays := make([][]string, 0, 3) tagArrays = append(tagArrays, e.LowCardinalityTags) @@ -117,6 +122,11 @@ func (e Entity) Copy(cardinality TagCardinality) Entity { case LowCardinality: newEntity.HighCardinalityTags = nil newEntity.OrchestratorCardinalityTags = nil + case NoneCardinality: + newEntity.HighCardinalityTags = nil + newEntity.OrchestratorCardinalityTags = nil + newEntity.LowCardinalityTags = nil + newEntity.StandardTags = nil } return newEntity @@ -131,6 +141,8 @@ const ( ShortOrchestratorCardinalityString = "orch" // HighCardinalityString is the string representation of the high cardinality HighCardinalityString = "high" + // NoneCardinalityString is the string representation of the none cardinality + NoneCardinalityString = "none" // UnknownCardinalityString represents an unknown level of cardinality UnknownCardinalityString = "unknown" ) @@ -145,6 +157,8 @@ func StringToTagCardinality(c string) (TagCardinality, error) { return OrchestratorCardinality, nil case LowCardinalityString: return LowCardinality, nil + case NoneCardinalityString: + return NoneCardinality, nil default: return LowCardinality, fmt.Errorf("unsupported value %s received for tag cardinality", c) } @@ -160,6 +174,8 @@ func TagCardinalityToString(c TagCardinality) string { return OrchestratorCardinalityString case LowCardinality: return LowCardinalityString + case NoneCardinality: + return NoneCardinalityString default: return UnknownCardinalityString } diff --git a/comp/core/telemetry/go.mod b/comp/core/telemetry/go.mod index 23f49ade405b7..4d38df7857b77 100644 --- a/comp/core/telemetry/go.mod +++ b/comp/core/telemetry/go.mod @@ -33,7 +33,7 @@ require ( go.uber.org/dig v1.18.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect - golang.org/x/sys v0.27.0 // indirect + golang.org/x/sys v0.28.0 // indirect google.golang.org/protobuf v1.35.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/comp/core/telemetry/go.sum b/comp/core/telemetry/go.sum index 6a015a3b68188..9067c10872735 100644 --- a/comp/core/telemetry/go.sum +++ b/comp/core/telemetry/go.sum @@ -48,8 +48,8 @@ go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.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= google.golang.org/protobuf v1.35.2 h1:8Ar7bF+apOIoThw1EdZl0p1oWvMqTHmpA2fRTyZO8io= google.golang.org/protobuf v1.35.2/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/comp/core/workloadmeta/collectors/catalog-remote/catalog.go b/comp/core/workloadmeta/collectors/catalog-remote/catalog.go new file mode 100644 index 0000000000000..f0d659ea1d7f6 --- /dev/null +++ b/comp/core/workloadmeta/collectors/catalog-remote/catalog.go @@ -0,0 +1,27 @@ +// 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 catalog is a wrapper that loads the available workloadmeta +// collectors. It exists as a shorthand for importing all packages manually in +// all of the agents. +package catalog + +import ( + "go.uber.org/fx" +) + +// GetCatalog returns the set of FX options to populate the catalog +func GetCatalog() fx.Option { + options := getCollectorOptions() + + // remove nil options + opts := make([]fx.Option, 0, len(options)) + for _, item := range options { + if item != nil { + opts = append(opts, item) + } + } + return fx.Options(opts...) +} diff --git a/comp/core/workloadmeta/collectors/catalog/remote_options.go b/comp/core/workloadmeta/collectors/catalog-remote/options.go similarity index 71% rename from comp/core/workloadmeta/collectors/catalog/remote_options.go rename to comp/core/workloadmeta/collectors/catalog-remote/options.go index d0cb01c69b2d2..5d5868723f1c3 100644 --- a/comp/core/workloadmeta/collectors/catalog/remote_options.go +++ b/comp/core/workloadmeta/collectors/catalog-remote/options.go @@ -3,9 +3,7 @@ // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2016-present Datadog, Inc. -//go:build remotewmonly - -// Package collectors is a wrapper that loads the available workloadmeta +// Package catalog is a wrapper that loads the available workloadmeta // collectors. It exists as a shorthand for importing all packages manually in // all of the agents. package catalog @@ -16,12 +14,15 @@ import ( remoteworkloadmeta "github.com/DataDog/datadog-agent/comp/core/workloadmeta/collectors/internal/remote/workloadmeta" ) -// TODO: (components) Move remote-only to its own catalog, similar to how catalog-less works -// Depend on this catalog-remote using fx, instead of build tags - func getCollectorOptions() []fx.Option { return []fx.Option{ remoteworkloadmeta.GetFxOptions(), remoteWorkloadmetaParams(), } } + +func remoteWorkloadmetaParams() fx.Option { + return fx.Provide(func() remoteworkloadmeta.Params { + return remoteworkloadmeta.Params{} + }) +} diff --git a/comp/core/workloadmeta/collectors/catalog/catalog.go b/comp/core/workloadmeta/collectors/catalog/catalog.go index e303a42328269..9133c24eab5e2 100644 --- a/comp/core/workloadmeta/collectors/catalog/catalog.go +++ b/comp/core/workloadmeta/collectors/catalog/catalog.go @@ -12,8 +12,6 @@ import ( "go.uber.org/fx" remoteworkloadmeta "github.com/DataDog/datadog-agent/comp/core/workloadmeta/collectors/internal/remote/workloadmeta" - workloadmeta "github.com/DataDog/datadog-agent/comp/core/workloadmeta/def" - "github.com/DataDog/datadog-agent/pkg/util/flavor" ) // GetCatalog returns the set of FX options to populate the catalog @@ -30,22 +28,8 @@ func GetCatalog() fx.Option { return fx.Options(opts...) } -// TODO: (components) Move remote-only to its own catalog, similar to how catalog-less works -// Depend on this catalog-remote using fx, instead of build tags - func remoteWorkloadmetaParams() fx.Option { - var filter *workloadmeta.Filter // Nil filter accepts everything - - // Security Agent is only interested in containers - // TODO: (components) create a Catalog component, the implementation used by - // security-agent can use this filter, instead of needing to chekc agent.flavor - if flavor.GetFlavor() == flavor.SecurityAgent { - filter = workloadmeta.NewFilterBuilder().AddKind(workloadmeta.KindContainer).Build() - } - return fx.Provide(func() remoteworkloadmeta.Params { - return remoteworkloadmeta.Params{ - Filter: filter, - } + return remoteworkloadmeta.Params{} }) } diff --git a/comp/core/workloadmeta/collectors/catalog/all_options.go b/comp/core/workloadmeta/collectors/catalog/options.go similarity index 92% rename from comp/core/workloadmeta/collectors/catalog/all_options.go rename to comp/core/workloadmeta/collectors/catalog/options.go index 65011caeccfc1..05f6ca9ac5e12 100644 --- a/comp/core/workloadmeta/collectors/catalog/all_options.go +++ b/comp/core/workloadmeta/collectors/catalog/options.go @@ -3,11 +3,6 @@ // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2016-present Datadog, Inc. -// TODO: (components) Move remote-only to its own catalog, similar to how catalog-less works -// Depend on this catalog-remote using fx, instead of build tags - -//go:build !remotewmonly - // Package catalog is a wrapper that loads the available workloadmeta // collectors. It exists as a shorthand for importing all packages manually in // all of the agents. diff --git a/comp/core/workloadmeta/collectors/util/kubernetes_resource_parsers/pod_test.go b/comp/core/workloadmeta/collectors/util/kubernetes_resource_parsers/pod_test.go index 5f604e3568220..d02d5177f5a74 100644 --- a/comp/core/workloadmeta/collectors/util/kubernetes_resource_parsers/pod_test.go +++ b/comp/core/workloadmeta/collectors/util/kubernetes_resource_parsers/pod_test.go @@ -8,9 +8,10 @@ package kubernetesresourceparsers import ( - "reflect" "testing" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" "github.com/stretchr/testify/assert" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" @@ -125,6 +126,11 @@ func TestPodParser_Parse(t *testing.T) { QOSClass: "Guaranteed", } - assert.True(t, reflect.DeepEqual(expected, parsed), - "Expected: %v, Actual: %v", expected, parsed) + opt := cmpopts.SortSlices(func(a, b string) bool { + return a < b + }) + assert.True(t, + cmp.Equal(expected, parsed, opt), + cmp.Diff(expected, parsed, opt), + ) } 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/dogstatsd/replay/impl-noop/noop.go b/comp/dogstatsd/replay/impl-noop/noop.go index 100d295a8bd0b..06e4985e0ace0 100644 --- a/comp/dogstatsd/replay/impl-noop/noop.go +++ b/comp/dogstatsd/replay/impl-noop/noop.go @@ -3,8 +3,8 @@ // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2016-2021 Datadog, Inc. -// Package replayimpl implements a no-op version of the component -package replayimpl +// Package noopimpl implements a no-op version of the component +package noopimpl import ( "sync" diff --git a/comp/dogstatsd/server/server.go b/comp/dogstatsd/server/server.go index 662d5b2092a8d..a879dac31f828 100644 --- a/comp/dogstatsd/server/server.go +++ b/comp/dogstatsd/server/server.go @@ -236,7 +236,7 @@ func newServerCompat(cfg model.Reader, log log.Component, capture replay.Compone // if the server is running in a context where static tags are required, add those // to extraTags. - if staticTags := util.GetStaticTagsSlice(context.TODO()); staticTags != nil { + if staticTags := util.GetStaticTagsSlice(context.TODO(), cfg); staticTags != nil { extraTags = append(extraTags, staticTags...) } util.SortUniqInPlace(extraTags) diff --git a/comp/dogstatsd/server/server_util_test.go b/comp/dogstatsd/server/server_util_test.go index 33355d4cbc982..f2c542f45c0e0 100644 --- a/comp/dogstatsd/server/server_util_test.go +++ b/comp/dogstatsd/server/server_util_test.go @@ -8,14 +8,12 @@ package server import ( - "runtime" "testing" "github.com/stretchr/testify/assert" "github.com/DataDog/datadog-agent/pkg/metrics/event" "github.com/DataDog/datadog-agent/pkg/metrics/servicecheck" - "github.com/DataDog/datadog-agent/pkg/util/testutil/flake" "go.uber.org/fx" @@ -77,10 +75,6 @@ func fulfillDeps(t testing.TB) serverDeps { } func fulfillDepsWithConfigOverride(t testing.TB, overrides map[string]interface{}) serverDeps { - // TODO: https://datadoghq.atlassian.net/browse/AMLII-1948 - if runtime.GOOS == "darwin" { - flake.Mark(t) - } return fxutil.Test[serverDeps](t, fx.Options( core.MockBundle(), serverdebugimpl.MockModule(), diff --git a/comp/dogstatsd/serverDebug/serverdebugimpl/debug.go b/comp/dogstatsd/serverDebug/serverdebugimpl/debug.go index 90c528919bef1..4a8a7a5926ba4 100644 --- a/comp/dogstatsd/serverDebug/serverdebugimpl/debug.go +++ b/comp/dogstatsd/serverDebug/serverdebugimpl/debug.go @@ -16,7 +16,6 @@ import ( "time" "github.com/benbjohnson/clock" - slog "github.com/cihub/seelog" "go.uber.org/atomic" "go.uber.org/fx" @@ -31,6 +30,7 @@ import ( "github.com/DataDog/datadog-agent/pkg/tagset" "github.com/DataDog/datadog-agent/pkg/util/defaultpaths" "github.com/DataDog/datadog-agent/pkg/util/fxutil" + pkglog "github.com/DataDog/datadog-agent/pkg/util/log" pkglogsetup "github.com/DataDog/datadog-agent/pkg/util/log/setup" ) @@ -71,7 +71,7 @@ type serverDebugImpl struct { clock clock.Clock tagsAccumulator *tagset.HashingTagsAccumulator // dogstatsdDebugLogger is an instance of the logger config that can be used to create new logger for dogstatsd-stats metrics - dogstatsdDebugLogger slog.LoggerInterface + dogstatsdDebugLogger pkglog.LoggerInterface } // NewServerlessServerDebug creates a new instance of serverDebug.Component @@ -279,9 +279,9 @@ func (d *serverDebugImpl) disableMetricsStats() { } // build a local dogstatsd logger and bubbling up any errors -func (d *serverDebugImpl) getDogstatsdDebug(cfg model.Reader) slog.LoggerInterface { +func (d *serverDebugImpl) getDogstatsdDebug(cfg model.Reader) pkglog.LoggerInterface { - var dogstatsdLogger slog.LoggerInterface + var dogstatsdLogger pkglog.LoggerInterface // Configuring the log file path logFile := cfg.GetString("dogstatsd_log_file") diff --git a/comp/forwarder/defaultforwarder/go.mod b/comp/forwarder/defaultforwarder/go.mod index a6e6b5f2297da..ff9c6b2c32158 100644 --- a/comp/forwarder/defaultforwarder/go.mod +++ b/comp/forwarder/defaultforwarder/go.mod @@ -71,14 +71,13 @@ require ( github.com/DataDog/datadog-agent/pkg/util/fxutil v0.57.1 github.com/DataDog/datadog-agent/pkg/util/http v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/util/optional v0.59.0 - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.0 - github.com/DataDog/datadog-agent/pkg/version v0.57.1 + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.1 + github.com/DataDog/datadog-agent/pkg/version v0.59.1 github.com/golang/protobuf v1.5.4 github.com/hashicorp/go-multierror v1.1.1 github.com/stretchr/testify v1.10.0 go.uber.org/atomic v1.11.0 go.uber.org/fx v1.23.0 - golang.org/x/text v0.20.0 ) require ( @@ -94,29 +93,30 @@ require ( github.com/DataDog/datadog-agent/pkg/config/teeconfig v0.60.0-devel // indirect github.com/DataDog/datadog-agent/pkg/util/executable v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.59.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/log v0.59.1 // indirect github.com/DataDog/datadog-agent/pkg/util/log/setup v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/pkg/util/pointer v0.59.0 // indirect 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.0 // indirect - github.com/DataDog/viper v1.13.5 // indirect + github.com/DataDog/datadog-agent/pkg/util/winutil v0.59.1 // 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 github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/hcl v1.0.1-vault-5 // indirect - github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 // indirect + github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 // indirect github.com/klauspost/compress v1.17.11 // indirect - github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c // indirect + github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect @@ -126,13 +126,12 @@ require ( github.com/patrickmn/go-cache v2.1.0+incompatible // indirect 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/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect github.com/prometheus/client_golang v1.20.5 // indirect 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 @@ -145,9 +144,10 @@ require ( go.uber.org/dig v1.18.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect - golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f // indirect - golang.org/x/net v0.31.0 // indirect - golang.org/x/sys v0.27.0 // indirect + golang.org/x/exp v0.0.0-20241210194714-1829a127f884 // indirect + golang.org/x/net v0.33.0 // indirect + golang.org/x/sys v0.28.0 // indirect + golang.org/x/text v0.21.0 // indirect google.golang.org/protobuf v1.35.2 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/comp/forwarder/defaultforwarder/go.sum b/comp/forwarder/defaultforwarder/go.sum index 66f7616ec4418..68028d1e242ea 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= @@ -75,7 +77,6 @@ github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/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= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -95,8 +96,8 @@ github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9 github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/hcl v1.0.1-vault-5 h1:kI3hhbbyzr4dldA8UdTb7ZlVVlI2DACdCfz31RPDgJM= github.com/hashicorp/hcl v1.0.1-vault-5/go.mod h1:XYhtn6ijBSAj6n4YqAaf7RBPS4I06AItNorpy+MoQNM= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 h1:S4qyfL2sEm5Budr4KVMyEniCy+PbS55651I/a+Kn/NQ= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb h1:PGufWXXDq9yaev6xX1YQauaO1MV90e6Mpoq1I7Lz/VM= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= @@ -122,8 +123,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -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/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a h1:3Bm7EwfUQUvhNeKIkUct/gl9eod1TcXuj8stxvi/GoI= +github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a/go.mod h1:ilwx/Dta8jXAgpFYFvSWEMwxmbWXyiUHkd5FwyKhb5k= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= @@ -157,8 +158,8 @@ github.com/pkg/errors v0.8.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-20220216144756-c35f1ee13d7c h1:NRoLoZvkBTKvR5gQLgA3e0hqjkY9u1wm+iOL45VN/qI= -github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 h1:o4JXh1EVt9k/+g42oCprj/FisM4qX9L3sZB3upGN2ZU= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= @@ -190,12 +191,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= @@ -264,8 +261,8 @@ golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnf golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f h1:XdNn9LlyWAhLVp6P/i8QYBW+hlyhrhei9uErw2B5GJo= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f/go.mod h1:D5SMRVC3C2/4+F/DB1wZsLRnSNimn2Sp/NPsCrsv8ak= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884 h1:Y/Mj/94zIQQGHVSv1tTtQBDaQaJe62U9bkDZKKyhPCU= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -283,8 +280,8 @@ golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191002035440-2ec189313ef0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.31.0 h1:68CPQngjLL0r2AlUKiSxtQFKvzRVbnzLwMUn5SzcLHo= -golang.org/x/net v0.31.0/go.mod h1:P4fl1q7dY2hnZFxEk4pPSkDHF+QqjitcnDjUQyMM+pM= +golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= +golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -306,11 +303,11 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220829200755-d48e67d00261/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.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/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= -golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= diff --git a/comp/forwarder/defaultforwarder/internal/retry/telemetry.go b/comp/forwarder/defaultforwarder/internal/retry/telemetry.go index ba3d2c7c35f53..f676c5bc75d8a 100644 --- a/comp/forwarder/defaultforwarder/internal/retry/telemetry.go +++ b/comp/forwarder/defaultforwarder/internal/retry/telemetry.go @@ -9,9 +9,6 @@ import ( "expvar" "strings" - "golang.org/x/text/cases" - "golang.org/x/text/language" - "github.com/DataDog/datadog-agent/comp/forwarder/defaultforwarder/transaction" "github.com/DataDog/datadog-agent/pkg/telemetry" ) @@ -308,11 +305,14 @@ func (t onDiskRetryQueueTelemetry) addDeserializeTransactionsCount(count int) { } func toCamelCase(s string) string { - caser := cases.Title(language.English) parts := strings.Split(s, "_") var camelCase string for _, p := range parts { - camelCase += caser.String(p) + if p == "" { + continue + } + camelCase += strings.ToUpper(string(p[0])) + camelCase += string(p[1:]) } return camelCase } diff --git a/comp/forwarder/orchestrator/orchestratorinterface/go.mod b/comp/forwarder/orchestrator/orchestratorinterface/go.mod index d5f8d766d32f6..77d79402af77c 100644 --- a/comp/forwarder/orchestrator/orchestratorinterface/go.mod +++ b/comp/forwarder/orchestrator/orchestratorinterface/go.mod @@ -94,21 +94,22 @@ require ( github.com/DataDog/datadog-agent/pkg/util/fxutil v0.57.1 // indirect github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/http v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/log v0.59.1 // indirect github.com/DataDog/datadog-agent/pkg/util/optional v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/pointer v0.59.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.1 // indirect 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.0 // indirect - github.com/DataDog/datadog-agent/pkg/version v0.57.1 // indirect - github.com/DataDog/viper v1.13.5 // 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.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 @@ -116,11 +117,11 @@ require ( github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hashicorp/hcl v1.0.1-vault-5 // indirect - github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 // indirect + github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 // indirect github.com/klauspost/compress v1.17.11 // indirect - github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c // indirect + github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect @@ -130,13 +131,12 @@ require ( github.com/patrickmn/go-cache v2.1.0+incompatible // indirect 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/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect github.com/prometheus/client_golang v1.20.5 // indirect 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 @@ -152,10 +152,10 @@ require ( go.uber.org/fx v1.23.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect - golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f // indirect - golang.org/x/net v0.31.0 // indirect - golang.org/x/sys v0.27.0 // indirect - golang.org/x/text v0.20.0 // indirect + golang.org/x/exp v0.0.0-20241210194714-1829a127f884 // indirect + golang.org/x/net v0.33.0 // indirect + golang.org/x/sys v0.28.0 // indirect + golang.org/x/text v0.21.0 // indirect google.golang.org/protobuf v1.35.2 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/comp/forwarder/orchestrator/orchestratorinterface/go.sum b/comp/forwarder/orchestrator/orchestratorinterface/go.sum index 53177ac4376d6..997b317049db8 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= @@ -98,8 +100,8 @@ github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9 github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/hcl v1.0.1-vault-5 h1:kI3hhbbyzr4dldA8UdTb7ZlVVlI2DACdCfz31RPDgJM= github.com/hashicorp/hcl v1.0.1-vault-5/go.mod h1:XYhtn6ijBSAj6n4YqAaf7RBPS4I06AItNorpy+MoQNM= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 h1:S4qyfL2sEm5Budr4KVMyEniCy+PbS55651I/a+Kn/NQ= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb h1:PGufWXXDq9yaev6xX1YQauaO1MV90e6Mpoq1I7Lz/VM= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= @@ -125,8 +127,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -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/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a h1:3Bm7EwfUQUvhNeKIkUct/gl9eod1TcXuj8stxvi/GoI= +github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a/go.mod h1:ilwx/Dta8jXAgpFYFvSWEMwxmbWXyiUHkd5FwyKhb5k= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= @@ -161,8 +163,8 @@ github.com/pkg/errors v0.8.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-20220216144756-c35f1ee13d7c h1:NRoLoZvkBTKvR5gQLgA3e0hqjkY9u1wm+iOL45VN/qI= -github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 h1:o4JXh1EVt9k/+g42oCprj/FisM4qX9L3sZB3upGN2ZU= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= @@ -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= @@ -265,8 +263,8 @@ golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnf golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f h1:XdNn9LlyWAhLVp6P/i8QYBW+hlyhrhei9uErw2B5GJo= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f/go.mod h1:D5SMRVC3C2/4+F/DB1wZsLRnSNimn2Sp/NPsCrsv8ak= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884 h1:Y/Mj/94zIQQGHVSv1tTtQBDaQaJe62U9bkDZKKyhPCU= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -284,8 +282,8 @@ golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191002035440-2ec189313ef0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.31.0 h1:68CPQngjLL0r2AlUKiSxtQFKvzRVbnzLwMUn5SzcLHo= -golang.org/x/net v0.31.0/go.mod h1:P4fl1q7dY2hnZFxEk4pPSkDHF+QqjitcnDjUQyMM+pM= +golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= +golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -307,11 +305,11 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220829200755-d48e67d00261/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.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/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= -golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= diff --git a/comp/haagent/helpers/helpers.go b/comp/haagent/helpers/helpers.go new file mode 100644 index 0000000000000..4b5e755e04936 --- /dev/null +++ b/comp/haagent/helpers/helpers.go @@ -0,0 +1,26 @@ +// 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. + +// Package haagenthelpers provides helpers for haagent component +package haagenthelpers + +import ( + "github.com/DataDog/datadog-agent/pkg/config/model" +) + +// IsEnabled returns true if HA Agent is enabled +func IsEnabled(agentConfig model.Reader) bool { + return agentConfig.GetBool("ha_agent.enabled") +} + +// GetGroup returns HA Agent group +func GetGroup(agentConfig model.Reader) string { + return agentConfig.GetString("ha_agent.group") +} + +// GetHaAgentTags returns HA Agent related tags +func GetHaAgentTags(agentConfig model.Reader) []string { + return []string{"agent_group:" + GetGroup(agentConfig)} +} diff --git a/comp/haagent/helpers/helpers_test.go b/comp/haagent/helpers/helpers_test.go new file mode 100644 index 0000000000000..987ab6a5cccf4 --- /dev/null +++ b/comp/haagent/helpers/helpers_test.go @@ -0,0 +1,33 @@ +// 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. + +package haagenthelpers + +import ( + "testing" + + "github.com/DataDog/datadog-agent/comp/core/config" + "github.com/stretchr/testify/assert" +) + +func TestIsEnabled(t *testing.T) { + cfg := config.NewMock(t) + assert.False(t, IsEnabled(cfg)) + + cfg.SetWithoutSource("ha_agent.enabled", true) + assert.True(t, IsEnabled(cfg)) +} + +func TestGetGroup(t *testing.T) { + cfg := config.NewMock(t) + cfg.SetWithoutSource("ha_agent.group", "my-group") + assert.Equal(t, "my-group", GetGroup(cfg)) +} + +func TestGetHaAgentTags(t *testing.T) { + cfg := config.NewMock(t) + cfg.SetWithoutSource("ha_agent.group", "my-group") + assert.Equal(t, []string{"agent_group:my-group"}, GetHaAgentTags(cfg)) +} diff --git a/comp/haagent/impl/config.go b/comp/haagent/impl/config.go index 2a6c4e20a8d12..ea9f54d9f16ea 100644 --- a/comp/haagent/impl/config.go +++ b/comp/haagent/impl/config.go @@ -7,6 +7,7 @@ package haagentimpl import ( "github.com/DataDog/datadog-agent/comp/core/config" + helpers "github.com/DataDog/datadog-agent/comp/haagent/helpers" ) // validHaIntegrations represent the list of integrations that will be considered as @@ -30,7 +31,7 @@ type haAgentConfigs struct { func newHaAgentConfigs(agentConfig config.Component) *haAgentConfigs { return &haAgentConfigs{ - enabled: agentConfig.GetBool("ha_agent.enabled"), - group: agentConfig.GetString("ha_agent.group"), + enabled: helpers.IsEnabled(agentConfig), + group: helpers.GetGroup(agentConfig), } } diff --git a/comp/logs/agent/agentimpl/agent_core_init.go b/comp/logs/agent/agentimpl/agent_core_init.go index 37d5c029cf0f6..fae9804bae9b8 100644 --- a/comp/logs/agent/agentimpl/agent_core_init.go +++ b/comp/logs/agent/agentimpl/agent_core_init.go @@ -46,7 +46,7 @@ func (a *logAgent) SetupPipeline(processingRules []*config.ProcessingRule, wmeta diagnosticMessageReceiver := diagnostic.NewBufferedMessageReceiver(nil, a.hostname) // setup the pipeline provider that provides pairs of processor and sender - pipelineProvider := pipeline.NewProvider(config.NumberOfPipelines, auditor, diagnosticMessageReceiver, processingRules, a.endpoints, destinationsCtx, NewStatusProvider(), a.hostname, a.config) + pipelineProvider := pipeline.NewProvider(a.config.GetInt("logs_config.pipelines"), auditor, diagnosticMessageReceiver, processingRules, a.endpoints, destinationsCtx, NewStatusProvider(), a.hostname, a.config) // setup the launchers lnchrs := launchers.NewLaunchers(a.sources, pipelineProvider, auditor, a.tracker) diff --git a/comp/logs/agent/agentimpl/agent_serverless_init.go b/comp/logs/agent/agentimpl/agent_serverless_init.go index 31dbf3e41d2dc..67711def14029 100644 --- a/comp/logs/agent/agentimpl/agent_serverless_init.go +++ b/comp/logs/agent/agentimpl/agent_serverless_init.go @@ -49,7 +49,7 @@ func (a *logAgent) SetupPipeline( destinationsCtx := client.NewDestinationsContext() // setup the pipeline provider that provides pairs of processor and sender - pipelineProvider := pipeline.NewServerlessProvider(config.NumberOfPipelines, a.auditor, diagnosticMessageReceiver, processingRules, a.endpoints, destinationsCtx, NewStatusProvider(), a.hostname, a.config) + pipelineProvider := pipeline.NewServerlessProvider(a.config.GetInt("logs_config.pipelines"), a.auditor, diagnosticMessageReceiver, processingRules, a.endpoints, destinationsCtx, NewStatusProvider(), a.hostname, a.config) lnchrs := launchers.NewLaunchers(a.sources, pipelineProvider, a.auditor, a.tracker) lnchrs.AddLauncher(channel.NewLauncher()) diff --git a/comp/logs/agent/agentimpl/analyze_logs_init.go b/comp/logs/agent/agentimpl/analyze_logs_init.go new file mode 100644 index 0000000000000..cfa476fb5a2ed --- /dev/null +++ b/comp/logs/agent/agentimpl/analyze_logs_init.go @@ -0,0 +1,61 @@ +// 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 !serverless + +package agentimpl + +import ( + "time" + + configComponent "github.com/DataDog/datadog-agent/comp/core/config" + "github.com/DataDog/datadog-agent/comp/logs/agent/config" + "github.com/DataDog/datadog-agent/comp/logs/agent/flare" + pkgconfigsetup "github.com/DataDog/datadog-agent/pkg/config/setup" + "github.com/DataDog/datadog-agent/pkg/logs/auditor" + "github.com/DataDog/datadog-agent/pkg/logs/diagnostic" + "github.com/DataDog/datadog-agent/pkg/logs/launchers" + filelauncher "github.com/DataDog/datadog-agent/pkg/logs/launchers/file" + "github.com/DataDog/datadog-agent/pkg/logs/message" + "github.com/DataDog/datadog-agent/pkg/logs/pipeline" + "github.com/DataDog/datadog-agent/pkg/logs/sources" + "github.com/DataDog/datadog-agent/pkg/logs/tailers" + "github.com/DataDog/datadog-agent/pkg/util/log" +) + +// SetUpLaunchers creates intializes the launcher. The launchers schedule the tailers to read the log files provided by the analyze-logs command +func SetUpLaunchers(conf configComponent.Component, sourceProvider *sources.ConfigSources) (chan *message.Message, *launchers.Launchers, pipeline.Provider) { + processingRules, err := config.GlobalProcessingRules(conf) + if err != nil { + log.Errorf("Error while getting processing rules from config: %v", err) + return nil, nil, nil + } + + diagnosticMessageReceiver := diagnostic.NewBufferedMessageReceiver(nil, nil) + pipelineProvider := pipeline.NewProcessorOnlyProvider(diagnosticMessageReceiver, processingRules, conf, nil) + + // setup the launchers + lnchrs := launchers.NewLaunchers(nil, pipelineProvider, nil, nil) + fileLimits := pkgconfigsetup.Datadog().GetInt("logs_config.open_files_limit") + fileValidatePodContainer := pkgconfigsetup.Datadog().GetBool("logs_config.validate_pod_container_id") + fileScanPeriod := time.Duration(pkgconfigsetup.Datadog().GetFloat64("logs_config.file_scan_period") * float64(time.Second)) + fileWildcardSelectionMode := pkgconfigsetup.Datadog().GetString("logs_config.file_wildcard_selection_mode") + fileLauncher := filelauncher.NewLauncher( + fileLimits, + filelauncher.DefaultSleepDuration, + fileValidatePodContainer, + fileScanPeriod, + fileWildcardSelectionMode, + flare.NewFlareController(), + nil) + tracker := tailers.NewTailerTracker() + + a := auditor.NewNullAuditor() + pipelineProvider.Start() + fileLauncher.Start(sourceProvider, pipelineProvider, a, tracker) + lnchrs.AddLauncher(fileLauncher) + outputChan := pipelineProvider.GetOutputChan() + return outputChan, lnchrs, pipelineProvider +} diff --git a/comp/logs/agent/config/constants.go b/comp/logs/agent/config/constants.go index ae9a0d74680f0..a66b989366370 100644 --- a/comp/logs/agent/config/constants.go +++ b/comp/logs/agent/config/constants.go @@ -5,11 +5,6 @@ package config -// Pipeline constraints -const ( - NumberOfPipelines = 4 -) - const ( // DateFormat is the default date format. DateFormat = "2006-01-02T15:04:05.000000000Z" diff --git a/comp/logs/agent/config/go.mod b/comp/logs/agent/config/go.mod index 91137e7bcc76c..dce42b5daf126 100644 --- a/comp/logs/agent/config/go.mod +++ b/comp/logs/agent/config/go.mod @@ -43,9 +43,9 @@ require ( github.com/DataDog/datadog-agent/pkg/config/structure v0.59.0 github.com/DataDog/datadog-agent/pkg/config/utils v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/util/fxutil v0.56.0-rc.3 - github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 + 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 ) @@ -64,29 +64,29 @@ require ( github.com/DataDog/datadog-agent/pkg/util/filesystem v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/optional v0.59.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.1 // indirect 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.0 // indirect - github.com/DataDog/datadog-agent/pkg/version v0.56.0-rc.3 // 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/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 - github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 // indirect + github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 // indirect - github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c // indirect + github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c // indirect github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect 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/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // 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 @@ -99,9 +99,9 @@ require ( go.uber.org/dig v1.18.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect - golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f // indirect - golang.org/x/sys v0.27.0 // indirect - golang.org/x/text v0.20.0 // indirect + golang.org/x/exp v0.0.0-20241210194714-1829a127f884 // indirect + golang.org/x/sys v0.28.0 // indirect + golang.org/x/text v0.21.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/comp/logs/agent/config/go.sum b/comp/logs/agent/config/go.sum index 324945ccfacf2..6ffaa516a7a51 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= @@ -70,7 +72,6 @@ github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/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= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -85,8 +86,8 @@ github.com/grpc-ecosystem/grpc-gateway v1.13.0/go.mod h1:8XEsbTttt/W+VvjtQhLACqC github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/hcl v1.0.1-vault-5 h1:kI3hhbbyzr4dldA8UdTb7ZlVVlI2DACdCfz31RPDgJM= github.com/hashicorp/hcl v1.0.1-vault-5/go.mod h1:XYhtn6ijBSAj6n4YqAaf7RBPS4I06AItNorpy+MoQNM= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 h1:S4qyfL2sEm5Budr4KVMyEniCy+PbS55651I/a+Kn/NQ= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb h1:PGufWXXDq9yaev6xX1YQauaO1MV90e6Mpoq1I7Lz/VM= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= @@ -108,8 +109,8 @@ 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-20220913051719-115f729f3c8c h1:VtwQ41oftZwlMnOEbMWQtSEUgU64U4s+GHk7hZK+jtY= -github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c/go.mod h1:JKx41uQRwqlTZabZc+kILPrO/3jlKnQ2Z8b7YiVw5cE= +github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a h1:3Bm7EwfUQUvhNeKIkUct/gl9eod1TcXuj8stxvi/GoI= +github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a/go.mod h1:ilwx/Dta8jXAgpFYFvSWEMwxmbWXyiUHkd5FwyKhb5k= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= @@ -136,8 +137,8 @@ github.com/pkg/errors v0.8.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-20220216144756-c35f1ee13d7c h1:NRoLoZvkBTKvR5gQLgA3e0hqjkY9u1wm+iOL45VN/qI= -github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 h1:o4JXh1EVt9k/+g42oCprj/FisM4qX9L3sZB3upGN2ZU= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= @@ -169,12 +170,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= @@ -241,8 +238,8 @@ golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnf golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f h1:XdNn9LlyWAhLVp6P/i8QYBW+hlyhrhei9uErw2B5GJo= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f/go.mod h1:D5SMRVC3C2/4+F/DB1wZsLRnSNimn2Sp/NPsCrsv8ak= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884 h1:Y/Mj/94zIQQGHVSv1tTtQBDaQaJe62U9bkDZKKyhPCU= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -279,11 +276,11 @@ golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20220829200755-d48e67d00261/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.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/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= -golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= diff --git a/comp/metadata/host/hostimpl/hosttags/tags.go b/comp/metadata/host/hostimpl/hosttags/tags.go index 606a874bf7fd3..92d610d49e079 100644 --- a/comp/metadata/host/hostimpl/hosttags/tags.go +++ b/comp/metadata/host/hostimpl/hosttags/tags.go @@ -12,6 +12,7 @@ import ( "strings" "time" + haagenthelpers "github.com/DataDog/datadog-agent/comp/haagent/helpers" "github.com/DataDog/datadog-agent/pkg/config/env" "github.com/DataDog/datadog-agent/pkg/config/model" configUtils "github.com/DataDog/datadog-agent/pkg/config/utils" @@ -133,6 +134,10 @@ func Get(ctx context.Context, cached bool, conf model.Reader) *Tags { hostTags = appendToHostTags(hostTags, clusterNameTags) } + if haagenthelpers.IsEnabled(conf) { + hostTags = appendToHostTags(hostTags, haagenthelpers.GetHaAgentTags(conf)) + } + gceTags := []string{} providers := getProvidersDefinitionsFunc(conf) for { diff --git a/comp/metadata/host/hostimpl/hosttags/tags_test.go b/comp/metadata/host/hostimpl/hosttags/tags_test.go index 64460410ac143..274250a432e46 100644 --- a/comp/metadata/host/hostimpl/hosttags/tags_test.go +++ b/comp/metadata/host/hostimpl/hosttags/tags_test.go @@ -137,3 +137,18 @@ func TestHostTagsCache(t *testing.T) { assert.Equal(t, []string{"foo1:value1"}, hostTags.System) assert.Equal(t, 2, nbCall) } + +func TestHaAgentTags(t *testing.T) { + mockConfig, ctx := setupTest(t) + + hostTags := Get(ctx, false, mockConfig) + assert.NotNil(t, hostTags.System) + assert.Equal(t, []string{}, hostTags.System) + + mockConfig.SetWithoutSource("ha_agent.enabled", true) + mockConfig.SetWithoutSource("ha_agent.group", "my-group") + + hostTags = Get(ctx, false, mockConfig) + assert.NotNil(t, hostTags.System) + assert.Equal(t, []string{"agent_group:my-group"}, hostTags.System) +} 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/netflow/flowaggregator/aggregator_test.go b/comp/netflow/flowaggregator/aggregator_test.go index 181915ab3f628..3ba87f0a12639 100644 --- a/comp/netflow/flowaggregator/aggregator_test.go +++ b/comp/netflow/flowaggregator/aggregator_test.go @@ -18,7 +18,6 @@ import ( "testing" "time" - "github.com/cihub/seelog" "github.com/gogo/protobuf/proto" "github.com/golang/mock/gomock" "github.com/prometheus/client_golang/prometheus" @@ -336,7 +335,7 @@ func TestFlowAggregator_flush_submitCollectorMetrics_error(t *testing.T) { var b bytes.Buffer w := bufio.NewWriter(&b) - l, err := seelog.LoggerFromWriterWithMinLevelAndFormat(w, seelog.DebugLvl, "[%LEVEL] %FuncShort: %Msg") + l, err := ddlog.LoggerFromWriterWithMinLevelAndFormat(w, ddlog.DebugLvl, "[%LEVEL] %FuncShort: %Msg") require.NoError(t, err) ddlog.SetupLogger(l, "debug") diff --git a/comp/netflow/goflowlib/logger.go b/comp/netflow/goflowlib/logger.go index 62035bcd052e5..e0a61338c7c46 100644 --- a/comp/netflow/goflowlib/logger.go +++ b/comp/netflow/goflowlib/logger.go @@ -6,20 +6,19 @@ package goflowlib import ( - "github.com/cihub/seelog" "github.com/sirupsen/logrus" log "github.com/DataDog/datadog-agent/comp/core/log/def" ddlog "github.com/DataDog/datadog-agent/pkg/util/log" ) -var ddLogToLogrusLevel = map[seelog.LogLevel]logrus.Level{ - seelog.TraceLvl: logrus.TraceLevel, - seelog.DebugLvl: logrus.DebugLevel, - seelog.InfoLvl: logrus.InfoLevel, - seelog.WarnLvl: logrus.WarnLevel, - seelog.ErrorLvl: logrus.ErrorLevel, - seelog.CriticalLvl: logrus.FatalLevel, +var ddLogToLogrusLevel = map[ddlog.LogLevel]logrus.Level{ + ddlog.TraceLvl: logrus.TraceLevel, + ddlog.DebugLvl: logrus.DebugLevel, + ddlog.InfoLvl: logrus.InfoLevel, + ddlog.WarnLvl: logrus.WarnLevel, + ddlog.ErrorLvl: logrus.ErrorLevel, + ddlog.CriticalLvl: logrus.FatalLevel, } // GetLogrusLevel returns logrus log level from log.GetLogLevel() diff --git a/comp/networkpath/npcollector/npcollectorimpl/npcollector_test.go b/comp/networkpath/npcollector/npcollectorimpl/npcollector_test.go index 6b6416e0d47ae..a5bdcd86f7e4f 100644 --- a/comp/networkpath/npcollector/npcollectorimpl/npcollector_test.go +++ b/comp/networkpath/npcollector/npcollectorimpl/npcollector_test.go @@ -19,7 +19,6 @@ import ( "time" model "github.com/DataDog/agent-payload/v5/process" - "github.com/cihub/seelog" "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" @@ -46,7 +45,7 @@ func Test_NpCollector_StartAndStop(t *testing.T) { var b bytes.Buffer w := bufio.NewWriter(&b) - l, err := seelog.LoggerFromWriterWithMinLevelAndFormat(w, seelog.DebugLvl, "[%LEVEL] %FuncShort: %Msg") + l, err := utillog.LoggerFromWriterWithMinLevelAndFormat(w, utillog.DebugLvl, "[%LEVEL] %FuncShort: %Msg") assert.Nil(t, err) utillog.SetupLogger(l, "debug") @@ -510,7 +509,7 @@ func Test_npCollectorImpl_ScheduleConns(t *testing.T) { var b bytes.Buffer w := bufio.NewWriter(&b) - l, err := seelog.LoggerFromWriterWithMinLevelAndFormat(w, seelog.DebugLvl, "[%LEVEL] %FuncShort: %Msg") + l, err := utillog.LoggerFromWriterWithMinLevelAndFormat(w, utillog.DebugLvl, "[%LEVEL] %FuncShort: %Msg") assert.Nil(t, err) utillog.SetupLogger(l, "debug") @@ -564,7 +563,7 @@ func Test_npCollectorImpl_stopWorker(t *testing.T) { var b bytes.Buffer w := bufio.NewWriter(&b) - l, err := seelog.LoggerFromWriterWithMinLevelAndFormat(w, seelog.DebugLvl, "[%LEVEL] %FuncShort: %Msg") + l, err := utillog.LoggerFromWriterWithMinLevelAndFormat(w, utillog.DebugLvl, "[%LEVEL] %FuncShort: %Msg") assert.Nil(t, err) utillog.SetupLogger(l, "debug") @@ -759,7 +758,7 @@ func Benchmark_npCollectorImpl_ScheduleConns(b *testing.B) { assert.Nil(b, err) defer file.Close() w := bufio.NewWriter(file) - l, err := seelog.LoggerFromWriterWithMinLevelAndFormat(w, seelog.DebugLvl, "[%LEVEL] %FuncShort: %Msg\n") + l, err := utillog.LoggerFromWriterWithMinLevelAndFormat(w, utillog.DebugLvl, "[%LEVEL] %FuncShort: %Msg\n") assert.Nil(b, err) utillog.SetupLogger(l, "debug") defer w.Flush() diff --git a/comp/networkpath/npcollector/npcollectorimpl/pathteststore/pathteststore_test.go b/comp/networkpath/npcollector/npcollectorimpl/pathteststore/pathteststore_test.go index a758c0664fa14..bf809bd31d9b6 100644 --- a/comp/networkpath/npcollector/npcollectorimpl/pathteststore/pathteststore_test.go +++ b/comp/networkpath/npcollector/npcollectorimpl/pathteststore/pathteststore_test.go @@ -12,7 +12,6 @@ import ( "testing" "time" - "github.com/cihub/seelog" "github.com/stretchr/testify/assert" logmock "github.com/DataDog/datadog-agent/comp/core/log/mock" @@ -87,7 +86,7 @@ func Test_pathtestStore_add(t *testing.T) { t.Run(tc.name, func(t *testing.T) { var b bytes.Buffer w := bufio.NewWriter(&b) - l, err := seelog.LoggerFromWriterWithMinLevelAndFormat(w, seelog.DebugLvl, "[%LEVEL] %FuncShort: %Msg") + l, err := utillog.LoggerFromWriterWithMinLevelAndFormat(w, utillog.DebugLvl, "[%LEVEL] %FuncShort: %Msg") assert.Nil(t, err) utillog.SetupLogger(l, "debug") diff --git a/comp/otelcol/collector-contrib/def/go.mod b/comp/otelcol/collector-contrib/def/go.mod index e1998d2b7c5d4..de371feafc0c9 100644 --- a/comp/otelcol/collector-contrib/def/go.mod +++ b/comp/otelcol/collector-contrib/def/go.mod @@ -2,21 +2,21 @@ module github.com/DataDog/datadog-agent/comp/otelcol/collector-contrib/def go 1.22.0 -require go.opentelemetry.io/collector/otelcol v0.114.0 +require go.opentelemetry.io/collector/otelcol v0.115.0 require ( - go.opentelemetry.io/collector/component/componenttest v0.114.0 // indirect - go.opentelemetry.io/collector/extension/extensiontest v0.114.0 // indirect + go.opentelemetry.io/collector/component/componenttest v0.115.0 // indirect + go.opentelemetry.io/collector/extension/extensiontest v0.115.0 // indirect ) require ( - go.opentelemetry.io/collector/connector/connectortest v0.114.0 // indirect - go.opentelemetry.io/collector/consumer/consumererror v0.114.0 // indirect - go.opentelemetry.io/collector/exporter/exportertest v0.114.0 // indirect - go.opentelemetry.io/collector/internal/fanoutconsumer v0.114.0 // indirect - go.opentelemetry.io/collector/pipeline/pipelineprofiles v0.114.0 // indirect - go.opentelemetry.io/collector/processor/processortest v0.114.0 // indirect - go.opentelemetry.io/collector/receiver/receivertest v0.114.0 // indirect + go.opentelemetry.io/collector/connector/connectortest v0.115.0 // indirect + go.opentelemetry.io/collector/consumer/consumererror v0.115.0 // indirect + go.opentelemetry.io/collector/exporter/exportertest v0.115.0 // indirect + go.opentelemetry.io/collector/internal/fanoutconsumer v0.115.0 // indirect + go.opentelemetry.io/collector/pipeline/pipelineprofiles v0.115.0 // indirect + go.opentelemetry.io/collector/processor/processortest v0.115.0 // indirect + go.opentelemetry.io/collector/receiver/receivertest v0.115.0 // indirect go.opentelemetry.io/contrib/bridges/otelzap v0.6.0 // indirect ) @@ -53,37 +53,37 @@ 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/v4 v4.24.10 // indirect + github.com/shirou/gopsutil/v4 v4.24.11 // indirect github.com/spf13/cobra v1.8.1 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/stretchr/testify v1.10.0 // indirect github.com/tklauser/go-sysconf v0.3.12 // indirect github.com/tklauser/numcpus v0.6.1 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect - go.opentelemetry.io/collector/component v0.114.0 // indirect - go.opentelemetry.io/collector/component/componentstatus v0.114.0 // indirect - go.opentelemetry.io/collector/config/configtelemetry v0.114.0 // indirect - go.opentelemetry.io/collector/confmap v1.20.0 // indirect - go.opentelemetry.io/collector/connector v0.114.0 // indirect - go.opentelemetry.io/collector/connector/connectorprofiles v0.114.0 // indirect - go.opentelemetry.io/collector/consumer v0.114.0 // indirect - go.opentelemetry.io/collector/consumer/consumerprofiles v0.114.0 // indirect - go.opentelemetry.io/collector/consumer/consumertest v0.114.0 // indirect - go.opentelemetry.io/collector/exporter v0.114.0 // indirect - go.opentelemetry.io/collector/exporter/exporterprofiles v0.114.0 // indirect - go.opentelemetry.io/collector/extension v0.114.0 // indirect - go.opentelemetry.io/collector/extension/extensioncapabilities v0.114.0 // indirect - go.opentelemetry.io/collector/featuregate v1.20.0 // indirect - go.opentelemetry.io/collector/pdata v1.20.0 // indirect - go.opentelemetry.io/collector/pdata/pprofile v0.114.0 // indirect - go.opentelemetry.io/collector/pdata/testdata v0.114.0 // indirect - go.opentelemetry.io/collector/pipeline v0.114.0 // indirect - go.opentelemetry.io/collector/processor v0.114.0 // indirect - go.opentelemetry.io/collector/processor/processorprofiles v0.114.0 // indirect - go.opentelemetry.io/collector/receiver v0.114.0 // indirect - go.opentelemetry.io/collector/receiver/receiverprofiles v0.114.0 // indirect - go.opentelemetry.io/collector/semconv v0.114.0 // indirect - go.opentelemetry.io/collector/service v0.114.0 // indirect + go.opentelemetry.io/collector/component v0.115.0 // indirect + go.opentelemetry.io/collector/component/componentstatus v0.115.0 // indirect + go.opentelemetry.io/collector/config/configtelemetry v0.115.0 // indirect + go.opentelemetry.io/collector/confmap v1.21.0 // indirect + go.opentelemetry.io/collector/connector v0.115.0 // indirect + go.opentelemetry.io/collector/connector/connectorprofiles v0.115.0 // indirect + go.opentelemetry.io/collector/consumer v1.21.0 // indirect + go.opentelemetry.io/collector/consumer/consumerprofiles v0.115.0 // indirect + go.opentelemetry.io/collector/consumer/consumertest v0.115.0 // indirect + go.opentelemetry.io/collector/exporter v0.115.0 // indirect + go.opentelemetry.io/collector/exporter/exporterprofiles v0.115.0 // indirect + go.opentelemetry.io/collector/extension v0.115.0 // indirect + go.opentelemetry.io/collector/extension/extensioncapabilities v0.115.0 // indirect + go.opentelemetry.io/collector/featuregate v1.21.0 // indirect + go.opentelemetry.io/collector/pdata v1.21.0 // indirect + go.opentelemetry.io/collector/pdata/pprofile v0.115.0 // indirect + go.opentelemetry.io/collector/pdata/testdata v0.115.0 // indirect + go.opentelemetry.io/collector/pipeline v0.115.0 // indirect + go.opentelemetry.io/collector/processor v0.115.0 // indirect + go.opentelemetry.io/collector/processor/processorprofiles v0.115.0 // indirect + go.opentelemetry.io/collector/receiver v0.115.0 // indirect + go.opentelemetry.io/collector/receiver/receiverprofiles v0.115.0 // indirect + go.opentelemetry.io/collector/semconv v0.115.0 // indirect + go.opentelemetry.io/collector/service v0.115.0 // indirect go.opentelemetry.io/contrib/config v0.10.0 // indirect go.opentelemetry.io/contrib/propagators/b3 v1.31.0 // indirect go.opentelemetry.io/otel v1.32.0 // indirect @@ -107,9 +107,9 @@ require ( go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f // indirect - golang.org/x/net v0.31.0 // indirect - golang.org/x/sys v0.27.0 // indirect - golang.org/x/text v0.20.0 // indirect + golang.org/x/net v0.33.0 // indirect + golang.org/x/sys v0.28.0 // indirect + golang.org/x/text v0.21.0 // indirect gonum.org/v1/gonum v0.15.1 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20241104194629-dd2ea8efbc28 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect diff --git a/comp/otelcol/collector-contrib/def/go.sum b/comp/otelcol/collector-contrib/def/go.sum index 85afb038b26d8..258b336c23443 100644 --- a/comp/otelcol/collector-contrib/def/go.sum +++ b/comp/otelcol/collector-contrib/def/go.sum @@ -92,8 +92,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/v4 v4.24.10 h1:7VOzPtfw/5YDU+jLEoBwXwxJbQetULywoSV4RYY7HkM= -github.com/shirou/gopsutil/v4 v4.24.10/go.mod h1:s4D/wg+ag4rG0WO7AiTj2BeYCRhym0vM7DHbZRxnIT8= +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/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= @@ -110,98 +110,98 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0= github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= -go.opentelemetry.io/collector v0.114.0 h1:XLLLOHns06P9XjVHyp0OdEMdwXvol5MLzugqQMmXYuU= -go.opentelemetry.io/collector v0.114.0/go.mod h1:XbjD4Yw9LunLo3IJu3ZZytNZ0drEVznxw1Z14Ujlw3s= -go.opentelemetry.io/collector/client v1.20.0 h1:o60wPcj5nLtaRenF+1E5p4QXFS3TDL6vHlw+GOon3rg= -go.opentelemetry.io/collector/client v1.20.0/go.mod h1:6aqkszco9FaLWCxyJEVam6PP7cUa8mPRIXeS5eZGj0U= -go.opentelemetry.io/collector/component v0.114.0 h1:SVGbm5LvHGSTEDv7p92oPuBgK5tuiWR82I9+LL4TtBE= -go.opentelemetry.io/collector/component v0.114.0/go.mod h1:MLxtjZ6UVHjDxSdhGLuJfHBHvfl1iT/Y7IaQPD24Eww= -go.opentelemetry.io/collector/component/componentstatus v0.114.0 h1:y9my/xink8KB5lK8zFAjgB2+pEh0QYy5TM972fxZY9w= -go.opentelemetry.io/collector/component/componentstatus v0.114.0/go.mod h1:RIoeCYZpPaae7QLE/1RacqzhHuXBmzRAk9H/EwYtIIs= -go.opentelemetry.io/collector/component/componenttest v0.114.0 h1:GM4FTTlfeXoVm6sZYBHImwlRN8ayh2oAfUhvaFj7Zo8= -go.opentelemetry.io/collector/component/componenttest v0.114.0/go.mod h1:ZZEJMtbJtoVC/3/9R1HzERq+cYQRxuMFQrPCpfZ4Xos= -go.opentelemetry.io/collector/config/configauth v0.114.0 h1:R2sJ6xpsLYGH0yU0vCxotzBYDKR/Hrjv0A7y9lwMyiw= -go.opentelemetry.io/collector/config/configauth v0.114.0/go.mod h1:3Z24KcCpG+WYCeQYfs/cNp5cP2BDeOqLCtOEgs/rPqM= -go.opentelemetry.io/collector/config/configcompression v1.20.0 h1:H/mvz7J/5z+O74YsO0t2tk+REnO2tzLM8TgIQ4AZ5w0= -go.opentelemetry.io/collector/config/configcompression v1.20.0/go.mod h1:pnxkFCLUZLKWzYJvfSwZnPrnm0twX14CYj2ADth5xiU= -go.opentelemetry.io/collector/config/confighttp v0.114.0 h1:DjGsBvVm+mGK3IpJBaXianWhwcxEC1fF33cpuC1LY/I= -go.opentelemetry.io/collector/config/confighttp v0.114.0/go.mod h1:nrlNLxOZ+4JQaV9j0TiqQV7LOHhrRivPrT8nQRHED3Q= -go.opentelemetry.io/collector/config/configopaque v1.20.0 h1:2I48zKiyyyYqjm7y0B9OLp24ku2ZSX3nCHG0r5FdWOQ= -go.opentelemetry.io/collector/config/configopaque v1.20.0/go.mod h1:6zlLIyOoRpJJ+0bEKrlZOZon3rOp5Jrz9fMdR4twOS4= -go.opentelemetry.io/collector/config/configretry v1.20.0 h1:z679mrMlW2a6tOOYPGdrS/QfALxdzWLQUOpH8Uu+D5Y= -go.opentelemetry.io/collector/config/configretry v1.20.0/go.mod h1:KvQF5cfphq1rQm1dKR4eLDNQYw6iI2fY72NMZVa+0N0= -go.opentelemetry.io/collector/config/configtelemetry v0.114.0 h1:kjLeyrumge6wsX6ZIkicdNOlBXaEyW2PI2ZdVXz/rzY= -go.opentelemetry.io/collector/config/configtelemetry v0.114.0/go.mod h1:R0MBUxjSMVMIhljuDHWIygzzJWQyZHXXWIgQNxcFwhc= -go.opentelemetry.io/collector/config/configtls v1.20.0 h1:hNlJdwfyY5Qe54RLJ41lfLqKTn9ypkR7sk7JNCcSe2U= -go.opentelemetry.io/collector/config/configtls v1.20.0/go.mod h1:sav/txSHguadTYlSSK+BJO2ljJeYEtRoBahgzWAguYg= -go.opentelemetry.io/collector/config/internal v0.114.0 h1:uWSDWTJb8T6xRjKD9/XmEARakXnxgYVYKUeId78hErc= -go.opentelemetry.io/collector/config/internal v0.114.0/go.mod h1:yC7E4h1Uj0SubxcFImh6OvBHFTjMh99+A5PuyIgDWqc= -go.opentelemetry.io/collector/confmap v1.20.0 h1:ARfOwmkKxFOud1njl03yAHQ30+uenlzqCO6LBYamDTE= -go.opentelemetry.io/collector/confmap v1.20.0/go.mod h1:DMpd9Ay/ffls3JoQBQ73vWeRsz1rNuLbwjo6WtjSQus= -go.opentelemetry.io/collector/connector v0.114.0 h1:efGAeTCtg8zp5Hyd7Am8kBUgsSxWEFlFtAu4OX4mcEA= -go.opentelemetry.io/collector/connector v0.114.0/go.mod h1:8DhGgD8RhkF0ooELl4NOPPD/wgHuXHmY7g90RwJ2eNo= -go.opentelemetry.io/collector/connector/connectorprofiles v0.114.0 h1:uVs9gy3UfQBmH0636ouIbGIoWis7zmKN+ny4XOGm36U= -go.opentelemetry.io/collector/connector/connectorprofiles v0.114.0/go.mod h1:X681qFEAsEPMDQ0pMsD/3DqePw58sfLew1QbBKvGnmw= -go.opentelemetry.io/collector/connector/connectortest v0.114.0 h1:Fpy1JHyNOLdVzNcmxUY6Jwxdz6JDcTXL1NCfw8k1AOc= -go.opentelemetry.io/collector/connector/connectortest v0.114.0/go.mod h1:1zaAlODuL9iNyfyjHQeGCpbcaUjf5b68t8LqlwHKBNA= -go.opentelemetry.io/collector/consumer v0.114.0 h1:1zVaHvfIZowGwZRitRBRo3i+RP2StlU+GClYiofSw0Q= -go.opentelemetry.io/collector/consumer v0.114.0/go.mod h1:d+Mrzt9hsH1ub3zmwSlnQVPLeTYir4Mgo7CrWfnncN4= -go.opentelemetry.io/collector/consumer/consumererror v0.114.0 h1:r2YiELfWerb40FHD23V04gNjIkLUcjEKGxI4Vtm2iO4= -go.opentelemetry.io/collector/consumer/consumererror v0.114.0/go.mod h1:MzIrLQ5jptO2egypolhlAbZsWZr29WC4FhSxQjnxcvg= -go.opentelemetry.io/collector/consumer/consumerprofiles v0.114.0 h1:5pXYy3E6UK5Huu3aQbsYL8B6E6MyWx4fvXXDn+oXZaA= -go.opentelemetry.io/collector/consumer/consumerprofiles v0.114.0/go.mod h1:PMq3f54KcJQO4v1tue0QxQScu7REFVADlXxXSAYMiN0= -go.opentelemetry.io/collector/consumer/consumertest v0.114.0 h1:isaTwJK5DOy8Bs7GuLq23ejfgj8gLIo5dOUvkRnLF4g= -go.opentelemetry.io/collector/consumer/consumertest v0.114.0/go.mod h1:GNeLPkfRPdh06n/Rv1UKa/cAtCKjN0a7ADyHjIj4HFE= -go.opentelemetry.io/collector/exporter v0.114.0 h1:5/0BBpXuCJQSQ5SQf31g7j6T4XEKkyx9mZMcA2rS5e8= -go.opentelemetry.io/collector/exporter v0.114.0/go.mod h1:atpd0wWXgh5LAZ0REU/d/Ti/q50HDfnlBIjMjJQlKFg= -go.opentelemetry.io/collector/exporter/exporterprofiles v0.114.0 h1:/wmWOSBHcvtz3Pbv7+rWCqPPQuNvYaoidKKaOqZsLKs= -go.opentelemetry.io/collector/exporter/exporterprofiles v0.114.0/go.mod h1:epRYTkyJZTSQZBJflMGHUyUo2EdLPhsaZEyo5Qm848A= -go.opentelemetry.io/collector/exporter/exportertest v0.114.0 h1:vo0idBJT+QACSM1KpjVLm9VeiXVwO7y4UnMpGxN6EyM= -go.opentelemetry.io/collector/exporter/exportertest v0.114.0/go.mod h1:420ssFrhaphneybstbMeSIiqSRoaBARPgO71O17foaM= -go.opentelemetry.io/collector/extension v0.114.0 h1:9Qb92y8hD2WDC5aMDoj4JNQN+/5BQYJWPUPzLXX+iGw= -go.opentelemetry.io/collector/extension v0.114.0/go.mod h1:Yk2/1ptVgfTr12t+22v93nYJpioP14pURv2YercSzU0= -go.opentelemetry.io/collector/extension/auth v0.114.0 h1:1K2qh4yvG8kKR/sTAobI/rw5VxzPZoKcl3FmC195vvo= -go.opentelemetry.io/collector/extension/auth v0.114.0/go.mod h1:IjtsG+jUVJB0utKF8dAK8pLutRun3aEgASshImzsw/U= -go.opentelemetry.io/collector/extension/experimental/storage v0.114.0 h1:hLyX9UvmY0t6iBnk3CqvyNck2U0QjPACekj7pDRx2hA= -go.opentelemetry.io/collector/extension/experimental/storage v0.114.0/go.mod h1:WqYRQVJjJLE1rm+y/ks1wPdPRGWePEvE1VO07xm2J2k= -go.opentelemetry.io/collector/extension/extensioncapabilities v0.114.0 h1:3OHll7gp5XIu7FVgon+koShPy797nze6EjCDokFUG7w= -go.opentelemetry.io/collector/extension/extensioncapabilities v0.114.0/go.mod h1:f0KdeLmE2jWVBmJ1U4WmfAtz1/tQUErGPfhPLKCQ49U= -go.opentelemetry.io/collector/extension/extensiontest v0.114.0 h1:ibXDms1qrswlvlR6b3d2BeyI8sXUXoFV11yOi9Sop8o= -go.opentelemetry.io/collector/extension/extensiontest v0.114.0/go.mod h1:/bOYmqu5yTDfI1bJZUxFqm8ZtmcodpquebiSxiQxtDY= -go.opentelemetry.io/collector/extension/zpagesextension v0.114.0 h1:JosqAcdWw7IGsURJNR8f17xmaGCQEtKhQt9tM0T/DEg= -go.opentelemetry.io/collector/extension/zpagesextension v0.114.0/go.mod h1:+VO4p2GZvmIMqCVyIfS/U85Xqg+HIOe+mdl/ya+jVTE= -go.opentelemetry.io/collector/featuregate v1.20.0 h1:Mi7nMy/q52eruI+6jWnMKUOeM55XvwoPnGcdB1++O8c= -go.opentelemetry.io/collector/featuregate v1.20.0/go.mod h1:47xrISO71vJ83LSMm8+yIDsUbKktUp48Ovt7RR6VbRs= -go.opentelemetry.io/collector/internal/fanoutconsumer v0.114.0 h1:JM9huYqy5LTzmuxQmbPST3l5Ez5kJNit28c6WFWls34= -go.opentelemetry.io/collector/internal/fanoutconsumer v0.114.0/go.mod h1:V28tDU4Wvf1PfW1Ty/SBL9tpKul2iYGno/HkCWGDrj0= -go.opentelemetry.io/collector/otelcol v0.114.0 h1:d/nmYc+adzZ70g4zBMtgujGHVNulF59ExCpuM/3ZKV4= -go.opentelemetry.io/collector/otelcol v0.114.0/go.mod h1:DGmFFao5jHSwD6G1HjUjs0CYcyrTau+u7GjTRUGKN+4= -go.opentelemetry.io/collector/pdata v1.20.0 h1:ePcwt4bdtISP0loHaE+C9xYoU2ZkIvWv89Fob16o9SM= -go.opentelemetry.io/collector/pdata v1.20.0/go.mod h1:Ox1YVLe87cZDB/TL30i4SUz1cA5s6AM6SpFMfY61ICs= -go.opentelemetry.io/collector/pdata/pprofile v0.114.0 h1:pUNfTzsI/JUTiE+DScDM4lsrPoxnVNLI2fbTxR/oapo= -go.opentelemetry.io/collector/pdata/pprofile v0.114.0/go.mod h1:4aNcj6WM1n1uXyFSXlhVs4ibrERgNYsTbzcYI2zGhxA= -go.opentelemetry.io/collector/pdata/testdata v0.114.0 h1:+AzszWSL1i4K6meQ8rU0JDDW55SYCXa6FVqfDixhhTo= -go.opentelemetry.io/collector/pdata/testdata v0.114.0/go.mod h1:bv8XFdCTZxG2MQB5l9dKxSxf5zBrcodwO6JOy1+AxXM= -go.opentelemetry.io/collector/pipeline v0.114.0 h1:v3YOhc5z0tD6QbO5n/pnftpIeroihM2ks9Z2yKPCcwY= -go.opentelemetry.io/collector/pipeline v0.114.0/go.mod h1:4vOvjVsoYTHVGTbfFwqfnQOSV2K3RKUHofh3jNRc2Mg= -go.opentelemetry.io/collector/pipeline/pipelineprofiles v0.114.0 h1:LZgxMQ2zXcz8ILBefhxpZBpn/Rx+TJTncIIQy0LgtgY= -go.opentelemetry.io/collector/pipeline/pipelineprofiles v0.114.0/go.mod h1:bmyqQCJWcA53/GtqZJ2ahwmLdFl6UelFH2nR6OJFqpw= -go.opentelemetry.io/collector/processor v0.114.0 h1:6bqQgLL7BtKrNv4YkEOGjZfkcfZv/ciJSQx1epGG9Zk= -go.opentelemetry.io/collector/processor v0.114.0/go.mod h1:DV/wa+nAmSHIDeD9NblPwkY9PbgtDQAZJ+PE5biZwPc= -go.opentelemetry.io/collector/processor/processorprofiles v0.114.0 h1:+P/1nLouEXTnN8DVQl+qWwO4BTkQyNPG9t/FrpUqrSI= -go.opentelemetry.io/collector/processor/processorprofiles v0.114.0/go.mod h1:3fuHeNIpINwx3bqFMprmDJyr6y5tWoWbJH599kltO5Y= -go.opentelemetry.io/collector/processor/processortest v0.114.0 h1:3FTaVXAp0LoVmUJn1ewBFckAby7AHa6/Kcdj0xuW14c= -go.opentelemetry.io/collector/processor/processortest v0.114.0/go.mod h1:OgsdOs1Fv5ZGTTJPF5nNIUJh2YkuV1acWd73yWgnti4= -go.opentelemetry.io/collector/receiver v0.114.0 h1:90SAnXAjNq7/k52/pFmmb06Cf1YauoPYtbio4aOXafY= -go.opentelemetry.io/collector/receiver v0.114.0/go.mod h1:KUGT0/D953LXbGH/D3lLPU8yrU3HfWnUqpt4W4hSOnE= -go.opentelemetry.io/collector/receiver/receiverprofiles v0.114.0 h1:ibhEfGpvNB3yrtpl2jYFabrunMk1hurxvMYpM0b1Ck4= -go.opentelemetry.io/collector/receiver/receiverprofiles v0.114.0/go.mod h1:UZyRfaasw+NLvN10AN8IQnmj5tQ3BOUH1uP2ctpO9f0= -go.opentelemetry.io/collector/receiver/receivertest v0.114.0 h1:D+Kh9t2n4asTnM+TiSxbrKlUemLZandWntj17BJWWb0= -go.opentelemetry.io/collector/receiver/receivertest v0.114.0/go.mod h1:mNSHQ13vFmqD+VAcRzLjStFBejbcWUn2Mp0pAd7Op+U= -go.opentelemetry.io/collector/semconv v0.114.0 h1:/eKcCJwZepQUtEuFuxa0thx2XIOvhFpaf214ZG1a11k= -go.opentelemetry.io/collector/semconv v0.114.0/go.mod h1:zCJ5njhWpejR+A40kiEoeFm1xq1uzyZwMnRNX6/D82A= -go.opentelemetry.io/collector/service v0.114.0 h1:MYF/4nH1CgtiLx09503xPAAUZefCzG1kaO+oanwX590= -go.opentelemetry.io/collector/service v0.114.0/go.mod h1:xH5/RapJdf5Ohh8iU8J0ZstfFYciP1oJPesiByteZxo= +go.opentelemetry.io/collector v0.115.0 h1:qUZ0bTeNBudMxNQ7FJKS//TxTjeJ7tfU/z22mcFavWU= +go.opentelemetry.io/collector v0.115.0/go.mod h1:66qx0xKnVvdwq60e1DEfb4e+zmM9szhPsv2hxZ/Mpj4= +go.opentelemetry.io/collector/client v1.21.0 h1:3Kes8lOFMYVxoxeAmX+DTEAkuS1iTA3NkSfqzGmygJA= +go.opentelemetry.io/collector/client v1.21.0/go.mod h1:jYJGiL0UA975OOyHmjbQSokNWt1OiviI5KjPOMUMGwc= +go.opentelemetry.io/collector/component v0.115.0 h1:iLte1oCiXzjiCnaOBKdsXacfFiECecpWxW3/LeriMoo= +go.opentelemetry.io/collector/component v0.115.0/go.mod h1:oIUFiH7w1eOimdeYhFI+gAIxYSiLDocKVJ0PTvX7d6s= +go.opentelemetry.io/collector/component/componentstatus v0.115.0 h1:pbpUIL+uKDfEiSgKK+S5nuSL6MDIIQYsp4b65ZGVb9M= +go.opentelemetry.io/collector/component/componentstatus v0.115.0/go.mod h1:36A+9XSiOz0Cdhq+UwwPRlEr5CYuSkEnVO9om4BH7d0= +go.opentelemetry.io/collector/component/componenttest v0.115.0 h1:9URDJ9VyP6tuij+YHjp/kSSMecnZOd7oGvzu+rw9SJY= +go.opentelemetry.io/collector/component/componenttest v0.115.0/go.mod h1:PzXvNqKLCiSADZGZFKH+IOHMkaQ0GTHuzysfVbTPKYY= +go.opentelemetry.io/collector/config/configauth v0.115.0 h1:xa+ALdyPgva3rZnLBh1H2oS5MsHP6JxSqMtQmcELnys= +go.opentelemetry.io/collector/config/configauth v0.115.0/go.mod h1:C7anpb3Rf4KswMT+dgOzkW9UX0z/65PLORpUw3p0VYc= +go.opentelemetry.io/collector/config/configcompression v1.21.0 h1:0zbPdZAgPFMAarwJEC4gaR6f/JBP686A3TYSgb3oa+E= +go.opentelemetry.io/collector/config/configcompression v1.21.0/go.mod h1:LvYG00tbPTv0NOLoZN0wXq1F5thcxvukO8INq7xyfWU= +go.opentelemetry.io/collector/config/confighttp v0.115.0 h1:BIy394oNXnqySJwrCqgAJu4gWgAV5aQUDD6k1hy6C8o= +go.opentelemetry.io/collector/config/confighttp v0.115.0/go.mod h1:Wr50ut12NmCEAl4bWLJryw2EjUmJTtYRg89560Q51wc= +go.opentelemetry.io/collector/config/configopaque v1.21.0 h1:PcvRGkBk4Px8BQM7tX+kw4i3jBsfAHGoGQbtZg6Ox7U= +go.opentelemetry.io/collector/config/configopaque v1.21.0/go.mod h1:sW0t0iI/VfRL9VYX7Ik6XzVgPcR+Y5kejTLsYcMyDWs= +go.opentelemetry.io/collector/config/configretry v1.21.0 h1:ZHoOvAkEcv5BBeaJn8IQ6rQ4GMPZWW4S+W7R4QTEbZU= +go.opentelemetry.io/collector/config/configretry v1.21.0/go.mod h1:cleBc9I0DIWpTiiHfu9v83FUaCTqcPXmebpLxjEIqro= +go.opentelemetry.io/collector/config/configtelemetry v0.115.0 h1:U07FinCDop+r2RjWQ3aP9ZWONC7r7kQIp1GkXQi6nsI= +go.opentelemetry.io/collector/config/configtelemetry v0.115.0/go.mod h1:SlBEwQg0qly75rXZ6W1Ig8jN25KBVBkFIIAUI1GiAAE= +go.opentelemetry.io/collector/config/configtls v1.21.0 h1:ZfrlAYgBD8lzp04W0GxwiDmUbrvKsvDYJi+wkyiXlpA= +go.opentelemetry.io/collector/config/configtls v1.21.0/go.mod h1:5EsNefPfVCMOTlOrr3wyj7LrsOgY7V8iqRl8oFZEqtw= +go.opentelemetry.io/collector/config/internal v0.115.0 h1:eVk57iufZpUXyPJFKTb1Ebx5tmcCyroIlt427r5pxS8= +go.opentelemetry.io/collector/config/internal v0.115.0/go.mod h1:OVkadRWlKAoWjHslqjWtBLAne8ceQm8WYT71ZcBWLFc= +go.opentelemetry.io/collector/confmap v1.21.0 h1:1tIcx2/Suwg8VhuPmQw87ba0ludPmumpFCFRZZa6RXA= +go.opentelemetry.io/collector/confmap v1.21.0/go.mod h1:Rrhs+MWoaP6AswZp+ReQ2VO9dfOfcUjdjiSHBsG+nec= +go.opentelemetry.io/collector/connector v0.115.0 h1:4Kkm3HQFzNT1eliMOB8FbIn+PLMRJ2qQku5Vmy3V8Ko= +go.opentelemetry.io/collector/connector v0.115.0/go.mod h1:+ByuAmYLrYHoKh9B+LGqUc0N2kXcN2l8Dea8Mp6brZ8= +go.opentelemetry.io/collector/connector/connectorprofiles v0.115.0 h1:aW1f4Az0I+QJyImFccNWAXqik80bnNu27aQqi2hFfD8= +go.opentelemetry.io/collector/connector/connectorprofiles v0.115.0/go.mod h1:lmynB1CucydOsHa8RSSBh5roUZPfuiv65imXhtNzClM= +go.opentelemetry.io/collector/connector/connectortest v0.115.0 h1:GjtourFr0MJmlbtEPAZ/1BZCxkNAeJ0aMTlrxwftJ0k= +go.opentelemetry.io/collector/connector/connectortest v0.115.0/go.mod h1:f3KQXXNlh/XuV8elmnuVVyfY92dJCAovz10gD72OH0k= +go.opentelemetry.io/collector/consumer v1.21.0 h1:THKZ2Vbi6GkamjTBI2hFq5Dc4kINZTWGwQNa8d/Ty9g= +go.opentelemetry.io/collector/consumer v1.21.0/go.mod h1:FQcC4ThMtRYY41dv+IPNK8POLLhAFY3r1YR5fuP7iiY= +go.opentelemetry.io/collector/consumer/consumererror v0.115.0 h1:yli//xBCQMPZKXNgNlXemo4dvqhnFrAmCZ11DvQgmcY= +go.opentelemetry.io/collector/consumer/consumererror v0.115.0/go.mod h1:LwVzAvQ6ZVNG7mbOvurbAo+W/rKws0IcjOwriuZXqPE= +go.opentelemetry.io/collector/consumer/consumerprofiles v0.115.0 h1:H3fDuyQW1t2HWHkz96WMBQJKUevypOCjBqnqtaAWyoA= +go.opentelemetry.io/collector/consumer/consumerprofiles v0.115.0/go.mod h1:IzEmZ91Tp7TBxVDq8Cc9xvLsmO7H08njr6Pu9P5d9ns= +go.opentelemetry.io/collector/consumer/consumertest v0.115.0 h1:hru0I2447y0TluCdwlKYFFtgcpyCnlM+LiOK1JZyA70= +go.opentelemetry.io/collector/consumer/consumertest v0.115.0/go.mod h1:ybjALRJWR6aKNOzEMy1T1ruCULVDEjj4omtOJMrH/kU= +go.opentelemetry.io/collector/exporter v0.115.0 h1:JnxfpOnsuqhTPKJXVKJLS1Cv3BiVrVLzpHOjJEQw+xw= +go.opentelemetry.io/collector/exporter v0.115.0/go.mod h1:xof3fHQK8wADhaKLIJcQ7ChZaFLNC+haRdPN0wgl6kY= +go.opentelemetry.io/collector/exporter/exporterprofiles v0.115.0 h1:lSQEleCn/q9eFufcuK61NdFKU70ZlgI9dBjPCO/4CrE= +go.opentelemetry.io/collector/exporter/exporterprofiles v0.115.0/go.mod h1:7l5K2AecimX2kx+nZC1gKG3QkP247CO1+SodmJ4fFkQ= +go.opentelemetry.io/collector/exporter/exportertest v0.115.0 h1:P9SMTUXQOtcaq40bGtnnAe14zRmR4/yUgj/Tb2BEf/k= +go.opentelemetry.io/collector/exporter/exportertest v0.115.0/go.mod h1:1jMZ9gFGXglb8wfNrBZIgd+RvpZhSyFwdfE+Jtf9w4U= +go.opentelemetry.io/collector/extension v0.115.0 h1:/cBb8AUdD0KMWC6V3lvCC16eP9Fg0wd1Upcp5rgvuGI= +go.opentelemetry.io/collector/extension v0.115.0/go.mod h1:HI7Ak6loyi6ZrZPsQJW1OO1wbaAW8OqXLFNQlTZnreQ= +go.opentelemetry.io/collector/extension/auth v0.115.0 h1:TTMokbBsSHZRFH48PvGSJmgSS8F3Rkr9MWGHZn8eJDk= +go.opentelemetry.io/collector/extension/auth v0.115.0/go.mod h1:3w+2mzeb2OYNOO4Bi41TUo4jr32ap2y7AOq64IDpxQo= +go.opentelemetry.io/collector/extension/experimental/storage v0.115.0 h1:sZXw0+77092pq24CkUoTRoHQPLQUsDq6HFRNB0g5yR4= +go.opentelemetry.io/collector/extension/experimental/storage v0.115.0/go.mod h1:qjFH7Y3QYYs88By2ZB5GMSUN5k3ul4Brrq2J6lKACA0= +go.opentelemetry.io/collector/extension/extensioncapabilities v0.115.0 h1:/g25Hp5aoCNKdDjIb3Fc7XRglO8yaBRFLO/IUNPnqNI= +go.opentelemetry.io/collector/extension/extensioncapabilities v0.115.0/go.mod h1:EQx7ETiy330O6q05S2KRZsRNDg0aQEeJmVl7Ipx+Fcw= +go.opentelemetry.io/collector/extension/extensiontest v0.115.0 h1:GBVFxFEskR8jSdu9uaQh2qpXnN5VNXhXjpJ2UjxtE8I= +go.opentelemetry.io/collector/extension/extensiontest v0.115.0/go.mod h1:eu1ecbz5mT+cHoH2H3GmD/rOO0WsicSJD2RLrYuOmRA= +go.opentelemetry.io/collector/extension/zpagesextension v0.115.0 h1:zYrZZocc7n0ZuDyXNkIaX0P0qk2fjMQj7NegwBJZA4k= +go.opentelemetry.io/collector/extension/zpagesextension v0.115.0/go.mod h1:OaXwNHF3MAcInBzCXrhXbTNHfIi9b7YGhXjtCFZqxNY= +go.opentelemetry.io/collector/featuregate v1.21.0 h1:+EULHPJDLMipcwAGZVp9Nm8NriRvoBBMxp7MSiIZVMI= +go.opentelemetry.io/collector/featuregate v1.21.0/go.mod h1:3GaXqflNDVwWndNGBJ1+XJFy3Fv/XrFgjMN60N3z7yg= +go.opentelemetry.io/collector/internal/fanoutconsumer v0.115.0 h1:6DRiSECeApFq6Jj5ug77rG53R6FzJEZBfygkyMEXdpg= +go.opentelemetry.io/collector/internal/fanoutconsumer v0.115.0/go.mod h1:vgQf5HQdmLQqpDHpDq2S3nTRoUuKtRcZpRTsy+UiwYw= +go.opentelemetry.io/collector/otelcol v0.115.0 h1:wZhFGrSCZcTQ4qw4ePjI2PaSrOCejoQKAjprKD/xavs= +go.opentelemetry.io/collector/otelcol v0.115.0/go.mod h1:iK8DPvaizirIYKDl1zZG7DDYUj6GkkH4KHifVVM88vk= +go.opentelemetry.io/collector/pdata v1.21.0 h1:PG+UbiFMJ35X/WcAR7Rf/PWmWtRdW0aHlOidsR6c5MA= +go.opentelemetry.io/collector/pdata v1.21.0/go.mod h1:GKb1/zocKJMvxKbS+sl0W85lxhYBTFJ6h6I1tphVyDU= +go.opentelemetry.io/collector/pdata/pprofile v0.115.0 h1:NI89hy13vNDw7EOnQf7Jtitks4HJFO0SUWznTssmP94= +go.opentelemetry.io/collector/pdata/pprofile v0.115.0/go.mod h1:jGzdNfO0XTtfLjXCL/uCC1livg1LlfR+ix2WE/z3RpQ= +go.opentelemetry.io/collector/pdata/testdata v0.115.0 h1:Rblz+AKXdo3fG626jS+KSd0OSA4uMXcTQfpwed6P8LI= +go.opentelemetry.io/collector/pdata/testdata v0.115.0/go.mod h1:inNnRt6S2Nn260EfCBEcjesjlKOSsr0jPwkPqpBkt4s= +go.opentelemetry.io/collector/pipeline v0.115.0 h1:bmACBqb0e8U9ag+vGGHUP7kCfAO7HHROdtzIEg8ulus= +go.opentelemetry.io/collector/pipeline v0.115.0/go.mod h1:qE3DmoB05AW0C3lmPvdxZqd/H4po84NPzd5MrqgtL74= +go.opentelemetry.io/collector/pipeline/pipelineprofiles v0.115.0 h1:3l9ruCAOrssTUDnyChKNzHWOdTtfThnYaoPZ1/+5sD0= +go.opentelemetry.io/collector/pipeline/pipelineprofiles v0.115.0/go.mod h1:2Myg+law/5lcezo9PhhZ0wjCaLYdGK24s1jDWbSW9VY= +go.opentelemetry.io/collector/processor v0.115.0 h1:+fveHGRe24PZPv/F5taahGuZ9HdNW44hgNWEJhIUdyc= +go.opentelemetry.io/collector/processor v0.115.0/go.mod h1:/oLHBlLsm7tFb7zOIrA5C0j14yBtjXKAgxJJ2Bktyk4= +go.opentelemetry.io/collector/processor/processorprofiles v0.115.0 h1:cCZAs+FXaebZPppqAN3m+X3etoSBL6NvyQo8l0hOZoo= +go.opentelemetry.io/collector/processor/processorprofiles v0.115.0/go.mod h1:kMxF0gknlWX4duuAJFi2/HuIRi6C3w95tOenRa0GKOY= +go.opentelemetry.io/collector/processor/processortest v0.115.0 h1:j9HEaYFOeOB6VYl9zGhBnhQbTkqGBa2udUvu5NTh6hc= +go.opentelemetry.io/collector/processor/processortest v0.115.0/go.mod h1:Gws+VEnp/eW3qAqPpqbKsrbnnxxNfyDjqrfUXbZfZic= +go.opentelemetry.io/collector/receiver v0.115.0 h1:55Q3Jvj6zHCIA1psKqi/3kEMJO4OqUF5tNAEYNdB1U8= +go.opentelemetry.io/collector/receiver v0.115.0/go.mod h1:nBSCh2O/WUcfgpJ+Jpz+B0z0Hn5jHeRvF2WmLij5EIY= +go.opentelemetry.io/collector/receiver/receiverprofiles v0.115.0 h1:R9JLaj2Al93smIPUkbJshAkb/cY0H5JBOxIx+Zu0NG4= +go.opentelemetry.io/collector/receiver/receiverprofiles v0.115.0/go.mod h1:05E5hGujWeeXJmzKZwTdHyZ/+rRyrQlQB5p5Q2XY39M= +go.opentelemetry.io/collector/receiver/receivertest v0.115.0 h1:OiB684SbHQi6/Pd3ZH0cXjYvCpBS9ilQBfTQx0wVXHg= +go.opentelemetry.io/collector/receiver/receivertest v0.115.0/go.mod h1:Y8Z9U/bz9Xpyt8GI8DxZZgryw3mnnIw+AeKVLTD2cP8= +go.opentelemetry.io/collector/semconv v0.115.0 h1:SoqMvg4ZEB3mz2EdAb6XYa+TuMo5Mir5FRBr3nVFUDY= +go.opentelemetry.io/collector/semconv v0.115.0/go.mod h1:N6XE8Q0JKgBN2fAhkUQtqK9LT7rEGR6+Wu/Rtbal1iI= +go.opentelemetry.io/collector/service v0.115.0 h1:k4GAOiI5tZgB2QKgwA6c3TeAVr7QL/ft5cOQbzUr8Iw= +go.opentelemetry.io/collector/service v0.115.0/go.mod h1:DKde9LMhNebdREecDSsqiTFLI2wRc+IoV4/wGxU6goY= go.opentelemetry.io/contrib/bridges/otelzap v0.6.0 h1:j8icMXyyqNf6HGuwlYhniPnVsbJIq7n+WirDu3VAJdQ= go.opentelemetry.io/contrib/bridges/otelzap v0.6.0/go.mod h1:evIOZpl+kAlU5IsaYX2Siw+IbpacAZvXemVsgt70uvw= go.opentelemetry.io/contrib/config v0.10.0 h1:2JknAzMaYjxrHkTnZh3eOme/Y2P5eHE2SWfhfV6Xd6c= @@ -265,8 +265,8 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.31.0 h1:68CPQngjLL0r2AlUKiSxtQFKvzRVbnzLwMUn5SzcLHo= -golang.org/x/net v0.31.0/go.mod h1:P4fl1q7dY2hnZFxEk4pPSkDHF+QqjitcnDjUQyMM+pM= +golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= +golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -278,12 +278,12 @@ golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7w 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.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.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/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= -golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= diff --git a/comp/otelcol/collector-contrib/impl/components.go b/comp/otelcol/collector-contrib/impl/components.go index c5cdd8d5504c2..82de6f29c43a8 100644 --- a/comp/otelcol/collector-contrib/impl/components.go +++ b/comp/otelcol/collector-contrib/impl/components.go @@ -8,29 +8,15 @@ package collectorcontribimpl import ( - "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/connector" - "go.opentelemetry.io/collector/exporter" - "go.opentelemetry.io/collector/extension" - "go.opentelemetry.io/collector/otelcol" - "go.opentelemetry.io/collector/processor" - "go.opentelemetry.io/collector/receiver" spanmetricsconnector "github.com/open-telemetry/opentelemetry-collector-contrib/connector/spanmetricsconnector" - debugexporter "go.opentelemetry.io/collector/exporter/debugexporter" - nopexporter "go.opentelemetry.io/collector/exporter/nopexporter" - otlpexporter "go.opentelemetry.io/collector/exporter/otlpexporter" - otlphttpexporter "go.opentelemetry.io/collector/exporter/otlphttpexporter" sapmexporter "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/sapmexporter" - zpagesextension "go.opentelemetry.io/collector/extension/zpagesextension" healthcheckextension "github.com/open-telemetry/opentelemetry-collector-contrib/extension/healthcheckextension" - pprofextension "github.com/open-telemetry/opentelemetry-collector-contrib/extension/pprofextension" dockerobserver "github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/dockerobserver" ecsobserver "github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/ecsobserver" ecstaskobserver "github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/ecstaskobserver" hostobserver "github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/hostobserver" k8sobserver "github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/k8sobserver" - batchprocessor "go.opentelemetry.io/collector/processor/batchprocessor" - memorylimiterprocessor "go.opentelemetry.io/collector/processor/memorylimiterprocessor" + pprofextension "github.com/open-telemetry/opentelemetry-collector-contrib/extension/pprofextension" attributesprocessor "github.com/open-telemetry/opentelemetry-collector-contrib/processor/attributesprocessor" cumulativetodeltaprocessor "github.com/open-telemetry/opentelemetry-collector-contrib/processor/cumulativetodeltaprocessor" filterprocessor "github.com/open-telemetry/opentelemetry-collector-contrib/processor/filterprocessor" @@ -42,8 +28,6 @@ import ( routingprocessor "github.com/open-telemetry/opentelemetry-collector-contrib/processor/routingprocessor" tailsamplingprocessor "github.com/open-telemetry/opentelemetry-collector-contrib/processor/tailsamplingprocessor" transformprocessor "github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor" - nopreceiver "go.opentelemetry.io/collector/receiver/nopreceiver" - otlpreceiver "go.opentelemetry.io/collector/receiver/otlpreceiver" filelogreceiver "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filelogreceiver" fluentforwardreceiver "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/fluentforwardreceiver" hostmetricsreceiver "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver" @@ -51,6 +35,22 @@ import ( prometheusreceiver "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusreceiver" receivercreator "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/receivercreator" zipkinreceiver "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/zipkinreceiver" + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/connector" + "go.opentelemetry.io/collector/exporter" + debugexporter "go.opentelemetry.io/collector/exporter/debugexporter" + nopexporter "go.opentelemetry.io/collector/exporter/nopexporter" + otlpexporter "go.opentelemetry.io/collector/exporter/otlpexporter" + otlphttpexporter "go.opentelemetry.io/collector/exporter/otlphttpexporter" + "go.opentelemetry.io/collector/extension" + zpagesextension "go.opentelemetry.io/collector/extension/zpagesextension" + "go.opentelemetry.io/collector/otelcol" + "go.opentelemetry.io/collector/processor" + batchprocessor "go.opentelemetry.io/collector/processor/batchprocessor" + memorylimiterprocessor "go.opentelemetry.io/collector/processor/memorylimiterprocessor" + "go.opentelemetry.io/collector/receiver" + nopreceiver "go.opentelemetry.io/collector/receiver/nopreceiver" + otlpreceiver "go.opentelemetry.io/collector/receiver/otlpreceiver" ) func components() (otelcol.Factories, error) { @@ -71,14 +71,14 @@ func components() (otelcol.Factories, error) { return otelcol.Factories{}, err } factories.ExtensionModules = make(map[component.Type]string, len(factories.Extensions)) - factories.ExtensionModules[zpagesextension.NewFactory().Type()] = "go.opentelemetry.io/collector/extension/zpagesextension v0.114.0" - factories.ExtensionModules[healthcheckextension.NewFactory().Type()] = "github.com/open-telemetry/opentelemetry-collector-contrib/extension/healthcheckextension v0.114.0" - factories.ExtensionModules[pprofextension.NewFactory().Type()] = "github.com/open-telemetry/opentelemetry-collector-contrib/extension/pprofextension v0.114.0" - factories.ExtensionModules[dockerobserver.NewFactory().Type()] = "github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/dockerobserver v0.114.0" - factories.ExtensionModules[ecsobserver.NewFactory().Type()] = "github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/ecsobserver v0.114.0" - factories.ExtensionModules[ecstaskobserver.NewFactory().Type()] = "github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/ecstaskobserver v0.114.0" - factories.ExtensionModules[hostobserver.NewFactory().Type()] = "github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/hostobserver v0.114.0" - factories.ExtensionModules[k8sobserver.NewFactory().Type()] = "github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/k8sobserver v0.114.0" + factories.ExtensionModules[zpagesextension.NewFactory().Type()] = "go.opentelemetry.io/collector/extension/zpagesextension v0.115.0" + factories.ExtensionModules[healthcheckextension.NewFactory().Type()] = "github.com/open-telemetry/opentelemetry-collector-contrib/extension/healthcheckextension v0.115.0" + factories.ExtensionModules[pprofextension.NewFactory().Type()] = "github.com/open-telemetry/opentelemetry-collector-contrib/extension/pprofextension v0.115.0" + factories.ExtensionModules[dockerobserver.NewFactory().Type()] = "github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/dockerobserver v0.115.0" + factories.ExtensionModules[ecsobserver.NewFactory().Type()] = "github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/ecsobserver v0.115.0" + factories.ExtensionModules[ecstaskobserver.NewFactory().Type()] = "github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/ecstaskobserver v0.115.0" + factories.ExtensionModules[hostobserver.NewFactory().Type()] = "github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/hostobserver v0.115.0" + factories.ExtensionModules[k8sobserver.NewFactory().Type()] = "github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/k8sobserver v0.115.0" factories.Receivers, err = receiver.MakeFactoryMap( nopreceiver.NewFactory(), @@ -95,15 +95,15 @@ func components() (otelcol.Factories, error) { return otelcol.Factories{}, err } factories.ReceiverModules = make(map[component.Type]string, len(factories.Receivers)) - factories.ReceiverModules[nopreceiver.NewFactory().Type()] = "go.opentelemetry.io/collector/receiver/nopreceiver v0.114.0" - factories.ReceiverModules[otlpreceiver.NewFactory().Type()] = "go.opentelemetry.io/collector/receiver/otlpreceiver v0.114.0" - factories.ReceiverModules[filelogreceiver.NewFactory().Type()] = "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filelogreceiver v0.114.0" - factories.ReceiverModules[fluentforwardreceiver.NewFactory().Type()] = "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/fluentforwardreceiver v0.114.0" - factories.ReceiverModules[hostmetricsreceiver.NewFactory().Type()] = "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver v0.114.0" - factories.ReceiverModules[jaegerreceiver.NewFactory().Type()] = "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/jaegerreceiver v0.114.0" - factories.ReceiverModules[prometheusreceiver.NewFactory().Type()] = "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusreceiver v0.114.0" - factories.ReceiverModules[receivercreator.NewFactory().Type()] = "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/receivercreator v0.114.0" - factories.ReceiverModules[zipkinreceiver.NewFactory().Type()] = "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/zipkinreceiver v0.114.0" + factories.ReceiverModules[nopreceiver.NewFactory().Type()] = "go.opentelemetry.io/collector/receiver/nopreceiver v0.115.0" + factories.ReceiverModules[otlpreceiver.NewFactory().Type()] = "go.opentelemetry.io/collector/receiver/otlpreceiver v0.115.0" + factories.ReceiverModules[filelogreceiver.NewFactory().Type()] = "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filelogreceiver v0.115.0" + factories.ReceiverModules[fluentforwardreceiver.NewFactory().Type()] = "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/fluentforwardreceiver v0.115.0" + factories.ReceiverModules[hostmetricsreceiver.NewFactory().Type()] = "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver v0.115.0" + factories.ReceiverModules[jaegerreceiver.NewFactory().Type()] = "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/jaegerreceiver v0.115.0" + factories.ReceiverModules[prometheusreceiver.NewFactory().Type()] = "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusreceiver v0.115.0" + factories.ReceiverModules[receivercreator.NewFactory().Type()] = "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/receivercreator v0.115.0" + factories.ReceiverModules[zipkinreceiver.NewFactory().Type()] = "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/zipkinreceiver v0.115.0" factories.Exporters, err = exporter.MakeFactoryMap( debugexporter.NewFactory(), @@ -116,11 +116,11 @@ func components() (otelcol.Factories, error) { return otelcol.Factories{}, err } factories.ExporterModules = make(map[component.Type]string, len(factories.Exporters)) - factories.ExporterModules[debugexporter.NewFactory().Type()] = "go.opentelemetry.io/collector/exporter/debugexporter v0.114.0" - factories.ExporterModules[nopexporter.NewFactory().Type()] = "go.opentelemetry.io/collector/exporter/nopexporter v0.114.0" - factories.ExporterModules[otlpexporter.NewFactory().Type()] = "go.opentelemetry.io/collector/exporter/otlpexporter v0.114.0" - factories.ExporterModules[otlphttpexporter.NewFactory().Type()] = "go.opentelemetry.io/collector/exporter/otlphttpexporter v0.114.0" - factories.ExporterModules[sapmexporter.NewFactory().Type()] = "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/sapmexporter v0.114.0" + factories.ExporterModules[debugexporter.NewFactory().Type()] = "go.opentelemetry.io/collector/exporter/debugexporter v0.115.0" + factories.ExporterModules[nopexporter.NewFactory().Type()] = "go.opentelemetry.io/collector/exporter/nopexporter v0.115.0" + factories.ExporterModules[otlpexporter.NewFactory().Type()] = "go.opentelemetry.io/collector/exporter/otlpexporter v0.115.0" + factories.ExporterModules[otlphttpexporter.NewFactory().Type()] = "go.opentelemetry.io/collector/exporter/otlphttpexporter v0.115.0" + factories.ExporterModules[sapmexporter.NewFactory().Type()] = "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/sapmexporter v0.115.0" factories.Processors, err = processor.MakeFactoryMap( batchprocessor.NewFactory(), @@ -141,19 +141,19 @@ func components() (otelcol.Factories, error) { return otelcol.Factories{}, err } factories.ProcessorModules = make(map[component.Type]string, len(factories.Processors)) - factories.ProcessorModules[batchprocessor.NewFactory().Type()] = "go.opentelemetry.io/collector/processor/batchprocessor v0.114.0" - factories.ProcessorModules[memorylimiterprocessor.NewFactory().Type()] = "go.opentelemetry.io/collector/processor/memorylimiterprocessor v0.114.0" - factories.ProcessorModules[attributesprocessor.NewFactory().Type()] = "github.com/open-telemetry/opentelemetry-collector-contrib/processor/attributesprocessor v0.114.0" - factories.ProcessorModules[cumulativetodeltaprocessor.NewFactory().Type()] = "github.com/open-telemetry/opentelemetry-collector-contrib/processor/cumulativetodeltaprocessor v0.114.0" - factories.ProcessorModules[filterprocessor.NewFactory().Type()] = "github.com/open-telemetry/opentelemetry-collector-contrib/processor/filterprocessor v0.114.0" - factories.ProcessorModules[groupbyattrsprocessor.NewFactory().Type()] = "github.com/open-telemetry/opentelemetry-collector-contrib/processor/groupbyattrsprocessor v0.114.0" - factories.ProcessorModules[k8sattributesprocessor.NewFactory().Type()] = "github.com/open-telemetry/opentelemetry-collector-contrib/processor/k8sattributesprocessor v0.114.0" - factories.ProcessorModules[probabilisticsamplerprocessor.NewFactory().Type()] = "github.com/open-telemetry/opentelemetry-collector-contrib/processor/probabilisticsamplerprocessor v0.114.0" - factories.ProcessorModules[resourcedetectionprocessor.NewFactory().Type()] = "github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.114.0" - factories.ProcessorModules[resourceprocessor.NewFactory().Type()] = "github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourceprocessor v0.114.0" - factories.ProcessorModules[routingprocessor.NewFactory().Type()] = "github.com/open-telemetry/opentelemetry-collector-contrib/processor/routingprocessor v0.114.0" - factories.ProcessorModules[tailsamplingprocessor.NewFactory().Type()] = "github.com/open-telemetry/opentelemetry-collector-contrib/processor/tailsamplingprocessor v0.114.0" - factories.ProcessorModules[transformprocessor.NewFactory().Type()] = "github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor v0.114.0" + factories.ProcessorModules[batchprocessor.NewFactory().Type()] = "go.opentelemetry.io/collector/processor/batchprocessor v0.115.0" + factories.ProcessorModules[memorylimiterprocessor.NewFactory().Type()] = "go.opentelemetry.io/collector/processor/memorylimiterprocessor v0.115.0" + factories.ProcessorModules[attributesprocessor.NewFactory().Type()] = "github.com/open-telemetry/opentelemetry-collector-contrib/processor/attributesprocessor v0.115.0" + factories.ProcessorModules[cumulativetodeltaprocessor.NewFactory().Type()] = "github.com/open-telemetry/opentelemetry-collector-contrib/processor/cumulativetodeltaprocessor v0.115.0" + factories.ProcessorModules[filterprocessor.NewFactory().Type()] = "github.com/open-telemetry/opentelemetry-collector-contrib/processor/filterprocessor v0.115.0" + factories.ProcessorModules[groupbyattrsprocessor.NewFactory().Type()] = "github.com/open-telemetry/opentelemetry-collector-contrib/processor/groupbyattrsprocessor v0.115.0" + factories.ProcessorModules[k8sattributesprocessor.NewFactory().Type()] = "github.com/open-telemetry/opentelemetry-collector-contrib/processor/k8sattributesprocessor v0.115.0" + factories.ProcessorModules[probabilisticsamplerprocessor.NewFactory().Type()] = "github.com/open-telemetry/opentelemetry-collector-contrib/processor/probabilisticsamplerprocessor v0.115.0" + factories.ProcessorModules[resourcedetectionprocessor.NewFactory().Type()] = "github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.115.0" + factories.ProcessorModules[resourceprocessor.NewFactory().Type()] = "github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourceprocessor v0.115.0" + factories.ProcessorModules[routingprocessor.NewFactory().Type()] = "github.com/open-telemetry/opentelemetry-collector-contrib/processor/routingprocessor v0.115.0" + factories.ProcessorModules[tailsamplingprocessor.NewFactory().Type()] = "github.com/open-telemetry/opentelemetry-collector-contrib/processor/tailsamplingprocessor v0.115.0" + factories.ProcessorModules[transformprocessor.NewFactory().Type()] = "github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor v0.115.0" factories.Connectors, err = connector.MakeFactoryMap( spanmetricsconnector.NewFactory(), @@ -162,7 +162,7 @@ func components() (otelcol.Factories, error) { return otelcol.Factories{}, err } factories.ConnectorModules = make(map[component.Type]string, len(factories.Connectors)) - factories.ConnectorModules[spanmetricsconnector.NewFactory().Type()] = "github.com/open-telemetry/opentelemetry-collector-contrib/connector/spanmetricsconnector v0.114.0" + factories.ConnectorModules[spanmetricsconnector.NewFactory().Type()] = "github.com/open-telemetry/opentelemetry-collector-contrib/connector/spanmetricsconnector v0.115.0" return factories, nil } diff --git a/comp/otelcol/collector-contrib/impl/go.mod b/comp/otelcol/collector-contrib/impl/go.mod index d23c34cd7c2f2..9b14be986534c 100644 --- a/comp/otelcol/collector-contrib/impl/go.mod +++ b/comp/otelcol/collector-contrib/impl/go.mod @@ -4,60 +4,59 @@ module github.com/DataDog/datadog-agent/comp/otelcol/collector-contrib/impl go 1.22.0 -toolchain go1.22.8 +toolchain go1.23.3 require ( github.com/DataDog/datadog-agent/comp/otelcol/collector-contrib/def v0.0.0-00010101000000-000000000000 - github.com/open-telemetry/opentelemetry-collector-contrib/connector/spanmetricsconnector v0.114.0 - github.com/open-telemetry/opentelemetry-collector-contrib/exporter/sapmexporter v0.114.0 - github.com/open-telemetry/opentelemetry-collector-contrib/extension/healthcheckextension v0.114.0 - github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/dockerobserver v0.114.0 - github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/ecsobserver v0.114.0 - github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/ecstaskobserver v0.114.0 - github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/hostobserver v0.114.0 - github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/k8sobserver v0.114.0 - github.com/open-telemetry/opentelemetry-collector-contrib/extension/pprofextension v0.114.0 - github.com/open-telemetry/opentelemetry-collector-contrib/processor/attributesprocessor v0.114.0 - github.com/open-telemetry/opentelemetry-collector-contrib/processor/cumulativetodeltaprocessor v0.114.0 - github.com/open-telemetry/opentelemetry-collector-contrib/processor/filterprocessor v0.114.0 - github.com/open-telemetry/opentelemetry-collector-contrib/processor/groupbyattrsprocessor v0.114.0 - github.com/open-telemetry/opentelemetry-collector-contrib/processor/k8sattributesprocessor v0.114.0 - github.com/open-telemetry/opentelemetry-collector-contrib/processor/probabilisticsamplerprocessor v0.114.0 - github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.114.0 - github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourceprocessor v0.114.0 - github.com/open-telemetry/opentelemetry-collector-contrib/processor/routingprocessor v0.114.0 - github.com/open-telemetry/opentelemetry-collector-contrib/processor/tailsamplingprocessor v0.114.0 - github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor v0.114.0 - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filelogreceiver v0.114.0 - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/fluentforwardreceiver v0.114.0 - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver v0.114.0 - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/jaegerreceiver v0.114.0 - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusreceiver v0.114.0 - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/receivercreator v0.114.0 - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/zipkinreceiver v0.114.0 - go.opentelemetry.io/collector/component v0.114.0 - go.opentelemetry.io/collector/connector v0.114.0 - go.opentelemetry.io/collector/exporter v0.114.0 - go.opentelemetry.io/collector/exporter/debugexporter v0.114.0 - go.opentelemetry.io/collector/exporter/nopexporter v0.114.0 - go.opentelemetry.io/collector/exporter/otlpexporter v0.114.0 - go.opentelemetry.io/collector/exporter/otlphttpexporter v0.114.0 - go.opentelemetry.io/collector/extension v0.114.0 - go.opentelemetry.io/collector/extension/zpagesextension v0.114.0 - go.opentelemetry.io/collector/otelcol v0.114.0 - go.opentelemetry.io/collector/processor v0.114.0 - go.opentelemetry.io/collector/processor/batchprocessor v0.114.0 - go.opentelemetry.io/collector/processor/memorylimiterprocessor v0.114.0 - go.opentelemetry.io/collector/receiver v0.114.0 - go.opentelemetry.io/collector/receiver/nopreceiver v0.114.0 - go.opentelemetry.io/collector/receiver/otlpreceiver v0.114.0 + github.com/open-telemetry/opentelemetry-collector-contrib/connector/spanmetricsconnector v0.115.0 + github.com/open-telemetry/opentelemetry-collector-contrib/exporter/sapmexporter v0.115.0 + github.com/open-telemetry/opentelemetry-collector-contrib/extension/healthcheckextension v0.115.0 + github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/dockerobserver v0.115.0 + github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/ecsobserver v0.115.0 + github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/ecstaskobserver v0.115.0 + github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/hostobserver v0.115.0 + github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/k8sobserver v0.115.0 + github.com/open-telemetry/opentelemetry-collector-contrib/extension/pprofextension v0.115.0 + github.com/open-telemetry/opentelemetry-collector-contrib/processor/attributesprocessor v0.115.0 + github.com/open-telemetry/opentelemetry-collector-contrib/processor/cumulativetodeltaprocessor v0.115.0 + github.com/open-telemetry/opentelemetry-collector-contrib/processor/filterprocessor v0.115.0 + github.com/open-telemetry/opentelemetry-collector-contrib/processor/groupbyattrsprocessor v0.115.0 + github.com/open-telemetry/opentelemetry-collector-contrib/processor/k8sattributesprocessor v0.115.0 + github.com/open-telemetry/opentelemetry-collector-contrib/processor/probabilisticsamplerprocessor v0.115.0 + github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.115.0 + github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourceprocessor v0.115.0 + github.com/open-telemetry/opentelemetry-collector-contrib/processor/routingprocessor v0.115.0 + github.com/open-telemetry/opentelemetry-collector-contrib/processor/tailsamplingprocessor v0.115.0 + github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor v0.115.0 + github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filelogreceiver v0.115.0 + github.com/open-telemetry/opentelemetry-collector-contrib/receiver/fluentforwardreceiver v0.115.0 + github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver v0.115.0 + github.com/open-telemetry/opentelemetry-collector-contrib/receiver/jaegerreceiver v0.115.0 + github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusreceiver v0.115.0 + github.com/open-telemetry/opentelemetry-collector-contrib/receiver/receivercreator v0.115.0 + github.com/open-telemetry/opentelemetry-collector-contrib/receiver/zipkinreceiver v0.115.0 + go.opentelemetry.io/collector/component v0.115.0 + go.opentelemetry.io/collector/connector v0.115.0 + go.opentelemetry.io/collector/exporter v0.115.0 + go.opentelemetry.io/collector/exporter/debugexporter v0.115.0 + go.opentelemetry.io/collector/exporter/nopexporter v0.115.0 + go.opentelemetry.io/collector/exporter/otlpexporter v0.115.0 + go.opentelemetry.io/collector/exporter/otlphttpexporter v0.115.0 + go.opentelemetry.io/collector/extension v0.115.0 + go.opentelemetry.io/collector/extension/zpagesextension v0.115.0 + go.opentelemetry.io/collector/otelcol v0.115.0 + go.opentelemetry.io/collector/processor v0.115.0 + go.opentelemetry.io/collector/processor/batchprocessor v0.115.0 + go.opentelemetry.io/collector/processor/memorylimiterprocessor v0.115.0 + go.opentelemetry.io/collector/receiver v0.115.0 + go.opentelemetry.io/collector/receiver/nopreceiver v0.115.0 + go.opentelemetry.io/collector/receiver/otlpreceiver v0.115.0 ) require ( - cloud.google.com/go/auth v0.9.5 // indirect - cloud.google.com/go/auth/oauth2adapt v0.2.4 // indirect + cloud.google.com/go/auth v0.7.0 // indirect + cloud.google.com/go/auth/oauth2adapt v0.2.2 // indirect cloud.google.com/go/compute/metadata v0.5.2 // indirect - dario.cat/mergo v1.0.1 // indirect github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect @@ -79,7 +78,7 @@ require ( github.com/bmatcuk/doublestar/v4 v4.7.1 // indirect github.com/cenkalti/backoff/v4 v4.3.0 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect - github.com/cncf/xds/go v0.0.0-20240905190251-b4127c9b8d78 // indirect + github.com/cncf/xds/go v0.0.0-20240723142845-024c85f92f20 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/dennwc/varint v1.0.0 // indirect github.com/digitalocean/godo v1.118.0 // indirect @@ -90,11 +89,11 @@ require ( github.com/ebitengine/purego v0.8.1 // indirect github.com/elastic/go-grok v0.3.1 // indirect github.com/elastic/lunes v0.1.0 // indirect - github.com/emicklei/go-restful/v3 v3.12.1 // indirect + github.com/emicklei/go-restful/v3 v3.11.0 // indirect github.com/envoyproxy/go-control-plane v0.13.0 // indirect github.com/envoyproxy/protoc-gen-validate v1.1.0 // indirect github.com/expr-lang/expr v1.16.9 // indirect - github.com/fatih/color v1.18.0 // indirect + github.com/fatih/color v1.16.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/fxamacker/cbor/v2 v2.7.0 // indirect @@ -117,18 +116,17 @@ require ( github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.4 // indirect github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect - github.com/google/btree v1.1.3 // indirect github.com/google/gnostic-models v0.6.8 // indirect github.com/google/go-cmp v0.6.0 // indirect github.com/google/go-querystring v1.1.0 // indirect github.com/google/gofuzz v1.2.0 // indirect - github.com/google/s2a-go v0.1.8 // indirect + github.com/google/s2a-go v0.1.7 // indirect github.com/google/uuid v1.6.0 // indirect - github.com/googleapis/enterprise-certificate-proxy v0.3.4 // indirect - github.com/googleapis/gax-go/v2 v2.13.0 // indirect + github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect + github.com/googleapis/gax-go/v2 v2.12.5 // indirect github.com/gophercloud/gophercloud v1.13.0 // indirect github.com/gorilla/mux v1.8.1 // indirect - github.com/gorilla/websocket v1.5.1 // indirect + github.com/gorilla/websocket v1.5.0 // indirect github.com/grafana/regexp v0.0.0-20240518133315-a468a5bfb3bc // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.23.0 // indirect github.com/hashicorp/consul/api v1.30.0 // indirect @@ -140,11 +138,9 @@ require ( github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hashicorp/go-retryablehttp v0.7.7 // indirect github.com/hashicorp/go-rootcerts v1.0.2 // indirect - github.com/hashicorp/go-sockaddr v1.0.6 // indirect github.com/hashicorp/go-version v1.7.0 // indirect github.com/hashicorp/golang-lru v1.0.2 // indirect github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect - github.com/hashicorp/hcl v1.0.1-vault-5 // indirect github.com/hashicorp/nomad/api v0.0.0-20240717122358-3d93bd3778f3 // indirect github.com/hashicorp/serf v0.10.1 // indirect github.com/hetznercloud/hcloud-go/v2 v2.10.2 // indirect @@ -173,40 +169,37 @@ require ( github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect - github.com/miekg/dns v1.1.62 // indirect + github.com/miekg/dns v1.1.61 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/moby/docker-image-spec v1.3.1 // indirect - github.com/moby/sys/user v0.3.0 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/mostynb/go-grpc-compression v1.2.3 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f // indirect - github.com/onsi/ginkgo/v2 v2.20.2 // indirect - github.com/onsi/gomega v1.34.1 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer v0.114.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/ecsutil v0.114.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.114.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.114.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/internal/docker v0.114.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter v0.114.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8sconfig v0.114.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/internal/metadataproviders v0.114.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/internal/pdatautil v0.114.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent v0.114.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/internal/splunk v0.114.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/batchperresourceattr v0.114.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/experimentalmetricmetadata v0.114.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl v0.114.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.114.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/sampling v0.114.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza v0.114.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.114.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheus v0.114.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/zipkin v0.114.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer v0.115.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/ecsutil v0.115.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.115.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.115.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/internal/docker v0.115.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter v0.115.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8sconfig v0.115.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/internal/metadataproviders v0.115.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/internal/pdatautil v0.115.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent v0.115.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/internal/splunk v0.115.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/batchperresourceattr v0.115.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/experimentalmetricmetadata v0.115.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl v0.115.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.115.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/sampling v0.115.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza v0.115.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.115.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheus v0.115.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/zipkin v0.115.0 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect github.com/opencontainers/image-spec v1.1.0 // indirect github.com/openshift/api v3.9.0+incompatible // indirect @@ -229,68 +222,69 @@ require ( github.com/prometheus/prometheus v0.54.1 // indirect github.com/rs/cors v1.11.1 // indirect github.com/scaleway/scaleway-sdk-go v1.0.0-beta.29 // indirect - github.com/shirou/gopsutil/v4 v4.24.10 // indirect - github.com/signalfx/sapm-proto v0.16.0 // indirect + github.com/shirou/gopsutil/v4 v4.24.11 // indirect + github.com/signalfx/sapm-proto v0.17.0 // indirect github.com/spf13/cast v1.7.0 // indirect github.com/spf13/cobra v1.8.1 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/stretchr/objx v0.5.2 // indirect github.com/stretchr/testify v1.10.0 // 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 + github.com/tklauser/go-sysconf v0.3.12 // indirect + github.com/tklauser/numcpus v0.6.1 // indirect github.com/ua-parser/uap-go v0.0.0-20240611065828-3a4781585db6 // indirect github.com/valyala/fastjson v1.6.4 // indirect github.com/vultr/govultr/v2 v2.17.2 // indirect github.com/x448/float16 v0.8.4 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect go.opencensus.io v0.24.0 // indirect - go.opentelemetry.io/collector v0.114.0 // indirect - go.opentelemetry.io/collector/client v1.20.0 // indirect - go.opentelemetry.io/collector/component/componentstatus v0.114.0 // indirect - go.opentelemetry.io/collector/component/componenttest v0.114.0 // indirect - go.opentelemetry.io/collector/config/configauth v0.114.0 // indirect - go.opentelemetry.io/collector/config/configcompression v1.20.0 // indirect - go.opentelemetry.io/collector/config/configgrpc v0.114.0 // indirect - go.opentelemetry.io/collector/config/confighttp v0.114.0 // indirect - go.opentelemetry.io/collector/config/confignet v1.20.0 // indirect - go.opentelemetry.io/collector/config/configopaque v1.20.0 // indirect - go.opentelemetry.io/collector/config/configretry v1.20.0 // indirect - go.opentelemetry.io/collector/config/configtelemetry v0.114.0 // indirect - go.opentelemetry.io/collector/config/configtls v1.20.0 // indirect - go.opentelemetry.io/collector/config/internal v0.114.0 // indirect - go.opentelemetry.io/collector/confmap v1.20.0 // indirect - go.opentelemetry.io/collector/connector/connectorprofiles v0.114.0 // indirect - go.opentelemetry.io/collector/connector/connectortest v0.114.0 // indirect - go.opentelemetry.io/collector/consumer v0.114.0 // indirect - go.opentelemetry.io/collector/consumer/consumererror v0.114.0 // indirect - go.opentelemetry.io/collector/consumer/consumererror/consumererrorprofiles v0.114.0 // indirect - go.opentelemetry.io/collector/consumer/consumerprofiles v0.114.0 // indirect - go.opentelemetry.io/collector/consumer/consumertest v0.114.0 // indirect - go.opentelemetry.io/collector/exporter/exporterhelper/exporterhelperprofiles v0.114.0 // indirect - go.opentelemetry.io/collector/exporter/exporterprofiles v0.114.0 // indirect - go.opentelemetry.io/collector/exporter/exportertest v0.114.0 // indirect - go.opentelemetry.io/collector/extension/auth v0.114.0 // indirect - go.opentelemetry.io/collector/extension/experimental/storage v0.114.0 // indirect - go.opentelemetry.io/collector/extension/extensioncapabilities v0.114.0 // indirect - go.opentelemetry.io/collector/extension/extensiontest v0.114.0 // indirect - go.opentelemetry.io/collector/featuregate v1.20.0 // indirect - go.opentelemetry.io/collector/filter v0.114.0 // indirect - go.opentelemetry.io/collector/internal/fanoutconsumer v0.114.0 // indirect - go.opentelemetry.io/collector/internal/memorylimiter v0.114.0 // indirect - go.opentelemetry.io/collector/internal/sharedcomponent v0.114.0 // indirect - go.opentelemetry.io/collector/pdata v1.20.0 // indirect - go.opentelemetry.io/collector/pdata/pprofile v0.114.0 // indirect - go.opentelemetry.io/collector/pdata/testdata v0.114.0 // indirect - go.opentelemetry.io/collector/pipeline v0.114.0 // indirect - go.opentelemetry.io/collector/pipeline/pipelineprofiles v0.114.0 // indirect - go.opentelemetry.io/collector/processor/processorhelper/processorhelperprofiles v0.114.0 // indirect - go.opentelemetry.io/collector/processor/processorprofiles v0.114.0 // indirect - go.opentelemetry.io/collector/processor/processortest v0.114.0 // indirect - go.opentelemetry.io/collector/receiver/receiverprofiles v0.114.0 // indirect - go.opentelemetry.io/collector/receiver/receivertest v0.114.0 // indirect - go.opentelemetry.io/collector/semconv v0.114.0 // indirect - go.opentelemetry.io/collector/service v0.114.0 // indirect + go.opentelemetry.io/collector v0.115.0 // indirect + go.opentelemetry.io/collector/client v1.21.0 // indirect + go.opentelemetry.io/collector/component/componentstatus v0.115.0 // indirect + go.opentelemetry.io/collector/component/componenttest v0.115.0 // indirect + go.opentelemetry.io/collector/config/configauth v0.115.0 // indirect + go.opentelemetry.io/collector/config/configcompression v1.21.0 // indirect + go.opentelemetry.io/collector/config/configgrpc v0.115.0 // indirect + go.opentelemetry.io/collector/config/confighttp v0.115.0 // indirect + go.opentelemetry.io/collector/config/confignet v1.21.0 // indirect + go.opentelemetry.io/collector/config/configopaque v1.21.0 // indirect + go.opentelemetry.io/collector/config/configretry v1.21.0 // indirect + go.opentelemetry.io/collector/config/configtelemetry v0.115.0 // indirect + go.opentelemetry.io/collector/config/configtls v1.21.0 // indirect + go.opentelemetry.io/collector/config/internal v0.115.0 // indirect + go.opentelemetry.io/collector/confmap v1.21.0 // indirect + go.opentelemetry.io/collector/connector/connectorprofiles v0.115.0 // indirect + go.opentelemetry.io/collector/connector/connectortest v0.115.0 // indirect + go.opentelemetry.io/collector/consumer v1.21.0 // indirect + go.opentelemetry.io/collector/consumer/consumererror v0.115.0 // indirect + go.opentelemetry.io/collector/consumer/consumererror/consumererrorprofiles v0.115.0 // indirect + go.opentelemetry.io/collector/consumer/consumerprofiles v0.115.0 // indirect + go.opentelemetry.io/collector/consumer/consumertest v0.115.0 // indirect + go.opentelemetry.io/collector/exporter/exporterhelper/exporterhelperprofiles v0.115.0 // indirect + go.opentelemetry.io/collector/exporter/exporterprofiles v0.115.0 // indirect + go.opentelemetry.io/collector/exporter/exportertest v0.115.0 // indirect + go.opentelemetry.io/collector/extension/auth v0.115.0 // indirect + go.opentelemetry.io/collector/extension/experimental/storage v0.115.0 // indirect + go.opentelemetry.io/collector/extension/extensioncapabilities v0.115.0 // indirect + go.opentelemetry.io/collector/extension/extensiontest v0.115.0 // indirect + go.opentelemetry.io/collector/featuregate v1.21.0 // indirect + go.opentelemetry.io/collector/filter v0.115.0 // indirect + go.opentelemetry.io/collector/internal/fanoutconsumer v0.115.0 // indirect + go.opentelemetry.io/collector/internal/memorylimiter v0.115.0 // indirect + go.opentelemetry.io/collector/internal/sharedcomponent v0.115.0 // indirect + go.opentelemetry.io/collector/pdata v1.21.0 // indirect + go.opentelemetry.io/collector/pdata/pprofile v0.115.0 // indirect + go.opentelemetry.io/collector/pdata/testdata v0.115.0 // indirect + go.opentelemetry.io/collector/pipeline v0.115.0 // indirect + go.opentelemetry.io/collector/pipeline/pipelineprofiles v0.115.0 // indirect + go.opentelemetry.io/collector/processor/processorhelper/processorhelperprofiles v0.115.0 // indirect + go.opentelemetry.io/collector/processor/processorprofiles v0.115.0 // indirect + go.opentelemetry.io/collector/processor/processortest v0.115.0 // indirect + go.opentelemetry.io/collector/receiver/receiverprofiles v0.115.0 // indirect + go.opentelemetry.io/collector/receiver/receivertest v0.115.0 // indirect + go.opentelemetry.io/collector/scraper v0.115.0 // indirect + go.opentelemetry.io/collector/semconv v0.115.0 // indirect + go.opentelemetry.io/collector/service v0.115.0 // indirect go.opentelemetry.io/contrib/bridges/otelzap v0.6.0 // indirect go.opentelemetry.io/contrib/config v0.10.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.56.0 // indirect @@ -318,19 +312,19 @@ require ( go.uber.org/atomic v1.11.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect - golang.org/x/crypto v0.29.0 // indirect + golang.org/x/crypto v0.31.0 // indirect golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f // indirect golang.org/x/mod v0.22.0 // indirect - golang.org/x/net v0.31.0 // indirect + golang.org/x/net v0.33.0 // indirect golang.org/x/oauth2 v0.23.0 // indirect - golang.org/x/sync v0.9.0 // indirect - golang.org/x/sys v0.27.0 // indirect - golang.org/x/term v0.26.0 // indirect - golang.org/x/text v0.20.0 // indirect - golang.org/x/time v0.8.0 // indirect + golang.org/x/sync v0.10.0 // indirect + golang.org/x/sys v0.28.0 // indirect + golang.org/x/term v0.27.0 // indirect + golang.org/x/text v0.21.0 // indirect + golang.org/x/time v0.5.0 // indirect golang.org/x/tools v0.27.0 // indirect gonum.org/v1/gonum v0.15.1 // indirect - google.golang.org/api v0.199.0 // indirect + google.golang.org/api v0.188.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20241104194629-dd2ea8efbc28 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect google.golang.org/grpc v1.67.1 // indirect @@ -339,13 +333,12 @@ require ( gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - gotest.tools/v3 v3.5.1 // indirect - k8s.io/api v0.31.2 // indirect - k8s.io/apimachinery v0.31.2 // indirect - k8s.io/client-go v0.31.2 // indirect + k8s.io/api v0.31.3 // indirect + k8s.io/apimachinery v0.31.3 // indirect + k8s.io/client-go v0.31.3 // indirect k8s.io/klog/v2 v2.130.1 // indirect - k8s.io/kube-openapi v0.0.0-20240430033511-f0e62f92d13f // indirect - k8s.io/utils v0.0.0-20240821151609-f90d01438635 // indirect + k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 // indirect + k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect sigs.k8s.io/yaml v1.4.0 // indirect diff --git a/comp/otelcol/collector-contrib/impl/go.sum b/comp/otelcol/collector-contrib/impl/go.sum index fe8e6e271ecb8..c97ea3c785b72 100644 --- a/comp/otelcol/collector-contrib/impl/go.sum +++ b/comp/otelcol/collector-contrib/impl/go.sum @@ -13,10 +13,10 @@ cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKV cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= -cloud.google.com/go/auth v0.9.5 h1:4CTn43Eynw40aFVr3GpPqsQponx2jv0BQpjvajsbbzw= -cloud.google.com/go/auth v0.9.5/go.mod h1:Xo0n7n66eHyOWWCnitop6870Ilwo3PiZyodVkkH1xWM= -cloud.google.com/go/auth/oauth2adapt v0.2.4 h1:0GWE/FUsXhf6C+jAkWgYm7X9tK8cuEIfy19DBn6B6bY= -cloud.google.com/go/auth/oauth2adapt v0.2.4/go.mod h1:jC/jOpwFP6JBxhB3P5Rr0a9HLMC/Pe3eaL4NmdvqPtc= +cloud.google.com/go/auth v0.7.0 h1:kf/x9B3WTbBUHkC+1VS8wwwli9TzhSt0vSTVBmMR8Ts= +cloud.google.com/go/auth v0.7.0/go.mod h1:D+WqdrpcjmiCgWrXmLLxOVq1GACoE36chW6KXoEvuIw= +cloud.google.com/go/auth/oauth2adapt v0.2.2 h1:+TTV8aXpjeChS9M+aTtN/TjdQnzJvmzKFt//oWu7HX4= +cloud.google.com/go/auth/oauth2adapt v0.2.2/go.mod h1:wcYjgpZI9+Yu7LyYBg4pqSiaRkfEK3GQcpb7C/uyF1Q= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= @@ -36,8 +36,8 @@ cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0Zeo cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= -dario.cat/mergo v1.0.1 h1:Ra4+bf83h2ztPIQYNP99R6m+Y7KfnARDfID+a+vLl4s= -dario.cat/mergo v1.0.1/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= +dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= +dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0 h1:GJHeeA2N7xrG3q30L2UXDyuWRzDM900/65j70wcM4Ww= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0/go.mod h1:l38EPgmsp71HHLq9j7De57JcKOWPyhrsW1Awm1JS6K0= @@ -132,8 +132,8 @@ github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6D github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/cncf/xds/go v0.0.0-20240905190251-b4127c9b8d78 h1:QVw89YDxXxEe+l8gU8ETbOasdwEV+avkR75ZzsVV9WI= -github.com/cncf/xds/go v0.0.0-20240905190251-b4127c9b8d78/go.mod h1:W+zGtBO5Y1IgJhy4+A9GOqVhqLpfZi+vwmdNXUehLA8= +github.com/cncf/xds/go v0.0.0-20240723142845-024c85f92f20 h1:N+3sFI5GUjRKBi+i0TxYVST9h4Ie192jJWpHvthBBgg= +github.com/cncf/xds/go v0.0.0-20240723142845-024c85f92f20/go.mod h1:W+zGtBO5Y1IgJhy4+A9GOqVhqLpfZi+vwmdNXUehLA8= github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I= github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo= github.com/containerd/platforms v0.2.1 h1:zvwtM3rz2YHPQsF2CHYM8+KtB5dvhISiXh5ZpSBQv6A= @@ -171,8 +171,8 @@ github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkg github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/emicklei/go-restful/v3 v3.8.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= -github.com/emicklei/go-restful/v3 v3.12.1 h1:PJMDIM/ak7btuL8Ex0iYET9hxM3CI2sjZtzpL63nKAU= -github.com/emicklei/go-restful/v3 v3.12.1/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= +github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g= +github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= 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= @@ -188,8 +188,8 @@ github.com/expr-lang/expr v1.16.9/go.mod h1:8/vRC7+7HBzESEqt5kKpYXxrxkr31SaO8r40 github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= -github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM= -github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU= +github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= +github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= @@ -302,8 +302,8 @@ github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb h1:PBC98N2aIaM3XXi github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.1.3 h1:CVpQJjYgC4VbzxeGVHfvZrv1ctoYCAI8vbl07Fcxlyg= -github.com/google/btree v1.1.3/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= +github.com/google/btree v1.0.1 h1:gK4Kx5IaGY9CD5sPJ36FHiBJ6ZXl0kilRiiCj+jdYp4= +github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= github.com/google/gnostic v0.5.7-v3refs/go.mod h1:73MKFl6jIHelAJNaBGFzt3SPtZULs9dYrGFt8OiIsHQ= github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I= github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U= @@ -339,22 +339,22 @@ github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5 h1:5iH8iuqE5apketRbSFBy+X1V0o+l+8NF1avt4HWl7cA= -github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144= +github.com/google/pprof v0.0.0-20240711041743-f6c9dda6c6da h1:xRmpO92tb8y+Z85iUOMOicpCfaYcv7o3Cg3wKrIpg8g= +github.com/google/pprof v0.0.0-20240711041743-f6c9dda6c6da/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/s2a-go v0.1.8 h1:zZDs9gcbt9ZPLV0ndSyQk6Kacx2g/X+SKYovpnz3SMM= -github.com/google/s2a-go v0.1.8/go.mod h1:6iNWHTpQ+nfNRN5E00MSdfDwVesa8hhS32PhPO8deJA= +github.com/google/s2a-go v0.1.7 h1:60BLSyTrOV4/haCDW4zb1guZItoSq8foHCXrAnjBo/o= +github.com/google/s2a-go v0.1.7/go.mod h1:50CgR4k1jNlWBu4UfS4AcfhVe1r6pdZPygJ3R8F0Qdw= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/enterprise-certificate-proxy v0.3.4 h1:XYIDZApgAnrN1c855gTgghdIA6Stxb52D5RnLI1SLyw= -github.com/googleapis/enterprise-certificate-proxy v0.3.4/go.mod h1:YKe7cfqYXjKGpGvmSg28/fFvhNzinZQm8DGnaburhGA= +github.com/googleapis/enterprise-certificate-proxy v0.3.2 h1:Vie5ybvEvT75RniqhfFxPRy3Bf7vr3h0cechB90XaQs= +github.com/googleapis/enterprise-certificate-proxy v0.3.2/go.mod h1:VLSiSSBs/ksPL8kq3OBOQ6WRI2QnaFynd1DCjZ62+V0= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gax-go/v2 v2.13.0 h1:yitjD5f7jQHhyDsnhKEBU52NdvvdSeGzlAnDPT0hH1s= -github.com/googleapis/gax-go/v2 v2.13.0/go.mod h1:Z/fvTZXF8/uw7Xu5GuslPw+bplx6SS338j1Is2S+B7A= +github.com/googleapis/gax-go/v2 v2.12.5 h1:8gw9KZK8TiVKB6q3zHY3SBzLnrGp6HQjyfYBYGmXdxA= +github.com/googleapis/gax-go/v2 v2.12.5/go.mod h1:BUDKcWo+RaKq5SC9vVYL0wLADa3VcfswbOMMRmB9H3E= github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg= github.com/gophercloud/gophercloud v1.13.0 h1:8iY9d1DAbzMW6Vok1AxbbK5ZaUjzMp0tdyt4fX9IeJ0= github.com/gophercloud/gophercloud v1.13.0/go.mod h1:aAVqcocTSXh2vYFZ1JTvx4EQmfgzxRcNupUfxZbBNDM= @@ -363,8 +363,8 @@ github.com/gorilla/handlers v1.5.2/go.mod h1:dX+xVpaxdSw+q0Qek8SSsl3dfMk3jNddUkM github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY= -github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY= +github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= +github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/grafana/regexp v0.0.0-20240518133315-a468a5bfb3bc h1:GN2Lv3MGO7AS6PrRoT6yV5+wkrOpcszoIsO4+4ds248= github.com/grafana/regexp v0.0.0-20240518133315-a468a5bfb3bc/go.mod h1:+JKpmjMGhpgPL+rXZ5nsZieVzvarn86asRlBg4uNGnk= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= @@ -402,8 +402,8 @@ github.com/hashicorp/go-retryablehttp v0.7.7/go.mod h1:pkQpWZeYWskR+D1tR2O5OcBFO github.com/hashicorp/go-rootcerts v1.0.2 h1:jzhAVGtqPKbwpyCPELlgNWhE1znq+qwJtW5Oi2viEzc= github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= -github.com/hashicorp/go-sockaddr v1.0.6 h1:RSG8rKU28VTUTvEKghe5gIhIQpv8evvNpnDEyqO4u9I= -github.com/hashicorp/go-sockaddr v1.0.6/go.mod h1:uoUUmtwU7n9Dv3O4SNLeFvg0SxQ3lyjsj6+CCykpaxI= +github.com/hashicorp/go-sockaddr v1.0.2 h1:ztczhD1jLxIRjVejw8gFomI1BQZOe2WoVOu0SyteCQc= +github.com/hashicorp/go-sockaddr v1.0.2/go.mod h1:rB4wwRAUzs07qva3c5SdrY/NEtAUjGlgmH/UkBUC97A= github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= @@ -418,8 +418,8 @@ github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iP github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= -github.com/hashicorp/hcl v1.0.1-vault-5 h1:kI3hhbbyzr4dldA8UdTb7ZlVVlI2DACdCfz31RPDgJM= -github.com/hashicorp/hcl v1.0.1-vault-5/go.mod h1:XYhtn6ijBSAj6n4YqAaf7RBPS4I06AItNorpy+MoQNM= +github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= +github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/mdns v1.0.4/go.mod h1:mtBihi+LeNXGtG8L9dX59gAEa12BDtBQSp4v/YAJqrc= github.com/hashicorp/memberlist v0.5.0 h1:EtYPN8DpAURiapus508I4n9CzHs2W+8NZGbmmR/prTM= @@ -535,8 +535,8 @@ github.com/maxatome/go-testdeep v1.12.0 h1:Ql7Go8Tg0C1D/uMMX59LAoYK7LffeJQ6X2T04 github.com/maxatome/go-testdeep v1.12.0/go.mod h1:lPZc/HAcJMP92l7yI6TRz1aZN5URwUBUAfUNvrclaNM= github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= -github.com/miekg/dns v1.1.62 h1:cN8OuEF1/x5Rq6Np+h1epln8OiyPWV+lROx9LxcGgIQ= -github.com/miekg/dns v1.1.62/go.mod h1:mvDlcItzm+br7MToIKqkglaGhlFMHJ9DTNNWONWXbNQ= +github.com/miekg/dns v1.1.61 h1:nLxbwF3XxhwVSm8g9Dghm9MHPaUZuqhPiGL+675ZmEs= +github.com/miekg/dns v1.1.61/go.mod h1:mnAarhS3nWaW+NVP2wTkYVIZyHNJ098SJZUki3eykwQ= github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= @@ -557,8 +557,8 @@ github.com/moby/patternmatcher v0.6.0/go.mod h1:hDPoyOpDY7OrrMDLaYoY3hf52gNCR/YO github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= github.com/moby/sys/sequential v0.5.0 h1:OPvI35Lzn9K04PBbCLW0g4LcFAJgHsvXsRyewg5lXtc= github.com/moby/sys/sequential v0.5.0/go.mod h1:tH2cOOs5V9MlPiXcQzRC+eEyab644PWKGRYaaV5ZZlo= -github.com/moby/sys/user v0.3.0 h1:9ni5DlcW5an3SvRSx4MouotOygvzaXbaSrc/wGDFWPo= -github.com/moby/sys/user v0.3.0/go.mod h1:bG+tYYYJgaMtRKgEmuueC0hJEAZWwtIbZTB+85uoHjs= +github.com/moby/sys/user v0.1.0 h1:WmZ93f5Ux6het5iituh9x2zAG7NFY9Aqi49jjE1PaQg= +github.com/moby/sys/user v0.1.0/go.mod h1:fKJhFOnsCN6xZ5gSfbM6zaHGgDJMrqt9/reuj4T7MmU= github.com/moby/sys/userns v0.1.0 h1:tVLXkFOxVu9A64/yh59slHVv9ahO9UIev4JZusOLG/g= github.com/moby/sys/userns v0.1.0/go.mod h1:IHUYgu/kao6N8YZlp9Cf444ySSvCmDlmzUcYfDHOl28= github.com/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0= @@ -591,6 +591,7 @@ github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+W github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= +github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= github.com/onsi/ginkgo/v2 v2.1.4/go.mod h1:um6tUpWM/cxCK3/FK8BXqEiUMUwRgSM4JXG47RKZmLU= github.com/onsi/ginkgo/v2 v2.1.6/go.mod h1:MEH45j8TBi6u9BMogfbp0stKC5cdGjumZj5Y7AG4VIk= @@ -601,8 +602,8 @@ github.com/onsi/ginkgo/v2 v2.7.0/go.mod h1:yjiuMwPokqY1XauOgju45q3sJt6VzQ/Fict1L github.com/onsi/ginkgo/v2 v2.8.1/go.mod h1:N1/NbDngAFcSLdyZ+/aYTYGSlq9qMCS/cNKGJjy+csc= github.com/onsi/ginkgo/v2 v2.9.0/go.mod h1:4xkjoL/tZv4SMWeww56BU5kAt19mVB47gTWxmrTcxyk= github.com/onsi/ginkgo/v2 v2.9.1/go.mod h1:FEcmzVcCHl+4o9bQZVab+4dC9+j+91t2FHSzmGAPfuo= -github.com/onsi/ginkgo/v2 v2.20.2 h1:7NVCeyIWROIAheY21RLS+3j2bb52W0W82tkberYytp4= -github.com/onsi/ginkgo/v2 v2.20.2/go.mod h1:K9gyxPIlb+aIvnZ8bd9Ak+YP18w3APlR+5coaZoE2ag= +github.com/onsi/ginkgo/v2 v2.19.0 h1:9Cnnf7UHo57Hy3k6/m5k3dRfGTMXGvxhHFvkDTCTpvA= +github.com/onsi/ginkgo/v2 v2.19.0/go.mod h1:rlwLi9PilAFJ8jCg9UE1QP6VBpd6/xj3SRC0d6TU0To= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= @@ -618,116 +619,116 @@ github.com/onsi/gomega v1.26.0/go.mod h1:r+zV744Re+DiYCIPRlYOTxn0YkOLcAnW8k1xXdM github.com/onsi/gomega v1.27.1/go.mod h1:aHX5xOykVYzWOV4WqQy0sy8BQptgukenXpCXfadcIAw= github.com/onsi/gomega v1.27.3/go.mod h1:5vG284IBtfDAmDyrK+eGyZmUgUlmi+Wngqo557cZ6Gw= github.com/onsi/gomega v1.27.4/go.mod h1:riYq/GJKh8hhoM01HN6Vmuy93AarCXCBGpvFDK3q3fQ= -github.com/onsi/gomega v1.34.1 h1:EUMJIKUjM8sKjYbtxQI9A4z2o+rruxnzNvpknOXie6k= -github.com/onsi/gomega v1.34.1/go.mod h1:kU1QgUvBDLXBJq618Xvm2LUX6rSAfRaFRTcdOeDLwwY= -github.com/open-telemetry/opentelemetry-collector-contrib/connector/spanmetricsconnector v0.114.0 h1:oA79wMjQSQBKz+X90LD5edNOyaEsewspJRBYgxliEMA= -github.com/open-telemetry/opentelemetry-collector-contrib/connector/spanmetricsconnector v0.114.0/go.mod h1:uk7Z36vhLtevNy5672jGxgzNJA2LND6wmispTuhHCxI= -github.com/open-telemetry/opentelemetry-collector-contrib/exporter/prometheusremotewriteexporter v0.114.0 h1:quLs6NbDeG2x2eLmncaq/P4yvnCPLAelFqXac2eMRSw= -github.com/open-telemetry/opentelemetry-collector-contrib/exporter/prometheusremotewriteexporter v0.114.0/go.mod h1:xX2v2kixYWZbFvnT5re3BGg2pyLy78KSIiMed7P2c/c= -github.com/open-telemetry/opentelemetry-collector-contrib/exporter/sapmexporter v0.114.0 h1:93/S5dh3snAbC81fuGP7c+nn2OhgP59UTrXqmFtK1Ww= -github.com/open-telemetry/opentelemetry-collector-contrib/exporter/sapmexporter v0.114.0/go.mod h1:fyU1pLPKcXDWkUwO075jt1YOjFS/XIZXDwHEV3xy93g= -github.com/open-telemetry/opentelemetry-collector-contrib/extension/healthcheckextension v0.114.0 h1:G7SHyt5TvFSEsiaxyhZdqkjcRoK2rP5wl4a3Mu31JM4= -github.com/open-telemetry/opentelemetry-collector-contrib/extension/healthcheckextension v0.114.0/go.mod h1:TRsDReUh7ALEUutKVoLlGMRc2QECZAyT/5g/cpAr+aw= -github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer v0.114.0 h1:xZL2FLnVTKqVeZQuTBSMmVLr3FQUN/N8x7VL70Gd07k= -github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer v0.114.0/go.mod h1:betAqGGfDFb8SLyMYBwH9BQyB9wzxWOWXXC/Ht6/kas= -github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/dockerobserver v0.114.0 h1:OwLYURmQGKEo9jyhlMsI3JtFLiYChZIrA2M3MxuomTY= -github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/dockerobserver v0.114.0/go.mod h1:1UZtI+tYvVvvKkPv5NmggvPpxkQEyKaUVg2ygtCjVoQ= -github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/ecsobserver v0.114.0 h1:aAobCSGIhUYohlzbMQdfDDtQoKlofPROL3+WSSPxz+c= -github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/ecsobserver v0.114.0/go.mod h1:4m8sQMLNgHexFom7YEFi2khcsUUqKxEdIWgUOYKcmLI= -github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/ecstaskobserver v0.114.0 h1:t59jxlv7dIF+f6SaG8V5mx/+Hxfoy4S5qlMpJlkcPo0= -github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/ecstaskobserver v0.114.0/go.mod h1:HbUoZclDdXYC7L6lvh44olwDpJBIoTw9fls1bjqyMZY= -github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/hostobserver v0.114.0 h1:1TNrKEIfTHAhQDVzQczhReo2+Rw5q9VNCVZgq5SKq/Y= -github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/hostobserver v0.114.0/go.mod h1:3AzBMlWooaEO8LvLWqYQoOhqxQ+fAaUlC09sCicB91s= -github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/k8sobserver v0.114.0 h1:FetZgJSBHH9xw1JKr3Wetek54bpVYkwJrVJJrO271vU= -github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/k8sobserver v0.114.0/go.mod h1:QWdTwjk67PGv3AyMT+8yEQXU3laW+PMLCFE8PSewWkM= -github.com/open-telemetry/opentelemetry-collector-contrib/extension/pprofextension v0.114.0 h1:6g5EvbygaEBqed0rJotGHcfxgxGV8hSN/4ZoZFfac5M= -github.com/open-telemetry/opentelemetry-collector-contrib/extension/pprofextension v0.114.0/go.mod h1:gU87iMdDAdHrQQCWTURbrlE/dLYgFecJ/+WBHuNMjQI= -github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage v0.114.0 h1:mchuc816TxLpmsGvFbtGA3KBVx91vAXi7vJnlvsQdiU= -github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage v0.114.0/go.mod h1:vgCMUWPVrfjNux9P9G053fRqGFF6BS3xtxNFZZdFTCM= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/ecsutil v0.114.0 h1:4qELD/ZwgvXE5PshGzJ9Eu+JEQdLIok6V1x8rvqL+yk= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/ecsutil v0.114.0/go.mod h1:3U1KoAsmQd9H37t8VkesFfB56tThrPsNVG+ddsMJ2zM= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.114.0 h1:0LbaoE7Aof8J4CVQ5kYv1QbuL3usTxLRSMFisDNBX9U= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.114.0/go.mod h1:ByoGXMLeHE/k5ELO3EITitVmvq3bh4Z/GVwWZZxrQ5s= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.114.0 h1:d2wCLlENxH4I2axQWaogivx/5ZIjDYgn9MIf6sFxlJ4= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.114.0/go.mod h1:Psyligv8GKL9WI3TraW3BLwkOX4TRxaaa1BBQQyICzA= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/docker v0.114.0 h1:AReCF/mzq8+1BORde9m96xAZ+nnv22/B1b+H56hlFIs= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/docker v0.114.0/go.mod h1:dCQeeAQww9++hvoqQ69QzTN6SGbq3DoVs1+Z1wcKAX8= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter v0.114.0 h1:WrVBqO/ps3KvUyEhtdL/uDDHhKoszLEE1ywDbwskNRg= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter v0.114.0/go.mod h1:JYklzR+ZxQaxjzlfJP3bxX6rQFl/Hbo0vd3yNj/1s1s= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8sconfig v0.114.0 h1:dtW9JkkpAm33Y47estFyqEL0CW05DHGmlLQxZUSx78w= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8sconfig v0.114.0/go.mod h1:FcClDm9XVV5tzUDzmH2Mhe6TfYiZ/3GSAQITnuCjZgg= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8stest v0.114.0 h1:Lgk9OkyDQQYWtfZ3DEyfQ+08NM4+dBO3fP0OQN10cXA= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8stest v0.114.0/go.mod h1:2/6/eY8Uvg+NfYDsAbND96A4u5q4UjcDlBJolYcj6jE= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/metadataproviders v0.114.0 h1:cGJRIzB5N3oe1c8vD5HqCuy4dbQE9EDJZ9C7vJn+K8U= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/metadataproviders v0.114.0/go.mod h1:p53t8aSCVoTKXVOsNx62rDLrSdEkBFB4H85yEiTWkyI= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/pdatautil v0.114.0 h1:lt87gwZaUP9Lh0EAgZFTYego0k89NU8K6Qkk82oR/n8= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/pdatautil v0.114.0/go.mod h1:nxxBsX9Z2Q7HQvybUTx8CzUvYCJewKBM1Eys6SiS0eg= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent v0.114.0 h1:TrGpqqMJxh5fTzdu5HZORKvDiIUBK8b9K/3zUCGbjps= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent v0.114.0/go.mod h1:mw+aVzR/3HtuGZE5xM6zEXHFv411QG8MxI8mQFJSd5c= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/splunk v0.114.0 h1:2uThKlp4NoQbIm7k9ZRGCKVJjMcibffb8NLcsPslq9o= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/splunk v0.114.0/go.mod h1:jSpHMXCxgNLBIfselixqXAUn0pXDfE5LEuNkz0WjK68= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/batchperresourceattr v0.114.0 h1:Z+WmSDshEjfNy09A7+opWO01L5LwkZC3Ze9AgfLfuAk= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/batchperresourceattr v0.114.0/go.mod h1:p58MQDR97vRdpY8vh6JuCqjKp0W+kpo5qHmuqhd7L00= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/experimentalmetricmetadata v0.114.0 h1:lvpwitQL0CDKHyExi+Wi0MPXGBjpgK5YbXljRYE6YTU= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/experimentalmetricmetadata v0.114.0/go.mod h1:/peNiVTNFe3osINRwW88WB0v5BC1ifjEmDL5oui+ry0= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden v0.114.0 h1:SXi6JSSs2cWROnC1U2v3XysG3t58ilGUwoLqxpGuwFU= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden v0.114.0/go.mod h1:LSd6sus2Jvpg3M3vM4HgmVh3/dmMtcJmTqELrFOQFRg= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl v0.114.0 h1:G6U2eHR2CGSYb2btot6l05o+mdqsC0ZN7dH8QssXSdk= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl v0.114.0/go.mod h1:kZQvVVzpahX8kFUfEBmzFtDhkKAQW6i8XQCMozDRUlk= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.114.0 h1:m8uPYU2rTj0sKiYgzCvIPajD3meiYsu+nX0hplUnlEU= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.114.0/go.mod h1:P0BaP92pXPkTyTmObfLYUoRBfMYU+i0hdS3oM1DpGJo= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.114.0 h1:Qg80zPfNMlub7LO07VMDElOu3M2oxqdZgvvB+X72a4U= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.114.0/go.mod h1:5qsGcjFV3WFI6J2onAlkR7Xd/8VtwJcECaDRZfW4Tb4= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/resourcetotelemetry v0.114.0 h1:PwUMZ6fHMEUV5i9hUly+z3UujDTTdxQtWzL0rWc/lgA= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/resourcetotelemetry v0.114.0/go.mod h1:YEHL6w4vvB9b0/lNwGjz8DyWXTF/7Xw0Hkgc3mGWwa8= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/sampling v0.114.0 h1:mtSN/07RGQPi1/zHVSZg4G0qRtOoJpPew5jsQWv9uS0= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/sampling v0.114.0/go.mod h1:C9Zgh/N3j4NR2D+1FGAA1YizhFW9OS51DwLUFJTdXN4= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza v0.114.0 h1:Xr3Hvm9cxOSQX94tLX1yX63uvuvtglJICrOz9YcxiuI= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza v0.114.0/go.mod h1:cgIgmEg66RhVtAv4JkIhHdy70kn2EtVhrH8CtyvhfuI= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.114.0 h1:WymtAsFHYen4GTTTXvVqZCoMz6vPADYUf4xIP0Gvm+E= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.114.0/go.mod h1:FcTNci+LpU5x5FkHM0Su3k6/ESDHWQsL30AFISzaIyk= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheus v0.114.0 h1:eJxap/u8Q5wYnBcJTrTS1Tq6wq31SOlIr+FMJX5ZoC8= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheus v0.114.0/go.mod h1:H7uIA2RBaxit2mSwSU8Wc7QXSJX7r8UR66YvdcLmtto= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheusremotewrite v0.114.0 h1:tG98F8g5T7lKYaoxSh9e76agmkauPtXiMbQhuWAeG+I= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheusremotewrite v0.114.0/go.mod h1:eN3xPxPcRZH0wofEQ1Greu1c561qEGeYv5Zt0uedmMM= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/zipkin v0.114.0 h1:xDbTY8zDUP3RKG1kg1tmULnBkLEDMwmSpf9j2H0sIcc= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/zipkin v0.114.0/go.mod h1:t5uoTcckI8kQeW1sZl8A+1UebVJPe47Qi3WQeNZu6w4= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/attributesprocessor v0.114.0 h1:fltPkjMuiVTtIVwoWUzbL0ad2CTCJsWfnCSDJQ9hSxU= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/attributesprocessor v0.114.0/go.mod h1:HcG364Is9u2EDqOUtQX0RwnbHtQqSh5+x2FdcYC+F1M= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/cumulativetodeltaprocessor v0.114.0 h1:rYwgdR8GE7QEtQlkQxXq5f1JQrd3v36g4yXXljicKoM= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/cumulativetodeltaprocessor v0.114.0/go.mod h1:TjEgPVMRxi93SdN0N0qv0hx5L+FF2csgo3YwfzVGJ3g= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/filterprocessor v0.114.0 h1:QBR07Gaw6ePkufQ/AhHgBv4OlwzXlULTdiUnaKIlvLk= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/filterprocessor v0.114.0/go.mod h1:coY0CV/sNj1hltRXKZr2gnrLvr7xUbnW+GhpCQpGR/Y= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/groupbyattrsprocessor v0.114.0 h1:ap7EK1GxLHau1jKJP8tYcZDb+tEntzx2Kj97XdNb7s4= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/groupbyattrsprocessor v0.114.0/go.mod h1:1uyslltGfwWhG7F/t41t43dBzrZpEkFzo2hR0OmyZi4= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/k8sattributesprocessor v0.114.0 h1:nldvWnYvTjIDi1xmZKgS2b0vz0Ja9UMV2m7ffg/HMDk= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/k8sattributesprocessor v0.114.0/go.mod h1:yRuZU0Rd/twuSQFme3WiVB7x9ECgIEwDBs2mPwkqUYY= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/probabilisticsamplerprocessor v0.114.0 h1:I4ZYVRYW3Cjb65sPENZ9kHam/JUMXNEp2n/knJ0C0Vc= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/probabilisticsamplerprocessor v0.114.0/go.mod h1:4BhyIaOn2LS48WS+ZNix4TpP0+goq9gDEtGzth5Cr3M= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.114.0 h1:ttRj/3GIpg+vUTeBI+EBeeWdNuvBT3S/ayoqpvA9B9s= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.114.0/go.mod h1:xoJgFdZUIxlvF8eUHIYiZGmf39zAwditW3sc2SBirAo= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourceprocessor v0.114.0 h1:je7Aiyn5AHAcpCNpTN5Q4l2SIeqJEvtOjoaZhHszGrs= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourceprocessor v0.114.0/go.mod h1:cVG4aXgfQFSdSfhAgoawDmmKixogjlvqQtmjmqVJgb4= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/routingprocessor v0.114.0 h1:AsYYMzt+ZGGQaq3S21REATxZsUI4aOuFAOPq09tSPnI= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/routingprocessor v0.114.0/go.mod h1:ifqisebKudvS+YARMbFRyX8/UgdXitSfCD1JCoGOxlY= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/tailsamplingprocessor v0.114.0 h1:NrD8Qo2CxrHRAlLuOHm75RtO1xEnul6DDkn6tQMsuSg= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/tailsamplingprocessor v0.114.0/go.mod h1:XOlJzIYwicEPMxu6Gv9TL9pS6El+ffjQOAu/wPiL+Jg= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor v0.114.0 h1:lKG7Ghtba2l9P4FFP7I+SbVRqHEpXCGOZs367YTEwGc= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor v0.114.0/go.mod h1:5U/lrnkK5YtIeTFXI8OzDN/d827WtI6pQvu7/59pUVA= -github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filelogreceiver v0.114.0 h1:Ivu3DRhbERboPxMJeyJpmretbKDJ3hsOAGBQXt2yY3U= -github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filelogreceiver v0.114.0/go.mod h1:UrMGrA8bA1VeYhdiam7/Xu/U4joG6JftMULEVWLDbe0= -github.com/open-telemetry/opentelemetry-collector-contrib/receiver/fluentforwardreceiver v0.114.0 h1:Yx0RUwviLdYyozkuqbfpEhSH+ehXlKsW5TtlZbiKm4Q= -github.com/open-telemetry/opentelemetry-collector-contrib/receiver/fluentforwardreceiver v0.114.0/go.mod h1:Bh9h5hYTgr/zQgXUnvihkLvN1IMmVY/OFa8aHc3gMJU= -github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver v0.114.0 h1:kSxkZPWBA6je7xXkpMWycjyc2BIMvLGD+OGTIRtJ0xw= -github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver v0.114.0/go.mod h1:rBegsrFk6WSDU4v9TiOvH3h7xintiOhPq9qd+72SlK8= -github.com/open-telemetry/opentelemetry-collector-contrib/receiver/jaegerreceiver v0.114.0 h1:1NeG/cgiqBMWQJxFvWQmWo9BVj3k4uOvEK0o++BFINY= -github.com/open-telemetry/opentelemetry-collector-contrib/receiver/jaegerreceiver v0.114.0/go.mod h1:skPwfv1xYwB5onG9sj31J4OYUxx6p+wc40aogGy+nVE= -github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusreceiver v0.114.0 h1:gdljk66vBTT3lWfSdP4Hl7FaABdH1YPhUCH6jnG2+qY= -github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusreceiver v0.114.0/go.mod h1:T1p6ShTr8farkE4qUB2TyGUIvRSN3s17D0qY7rMqCRM= -github.com/open-telemetry/opentelemetry-collector-contrib/receiver/receivercreator v0.114.0 h1:PwaceYEl50C1OK5MxpH95hnn58CNRzINP2p5YvluZj4= -github.com/open-telemetry/opentelemetry-collector-contrib/receiver/receivercreator v0.114.0/go.mod h1:FrJqdSI+4QuU/w9XtoW9d1Ywp09u2cYaPUOZFqzDtNY= -github.com/open-telemetry/opentelemetry-collector-contrib/receiver/zipkinreceiver v0.114.0 h1:E686MeQcQ+a3Q47A/xAc3Nk6Qdz8wHcBLMJ3Y8bNKi0= -github.com/open-telemetry/opentelemetry-collector-contrib/receiver/zipkinreceiver v0.114.0/go.mod h1:zkQAapuNRobj7GY8kKRal+2EYkAMWmZ1KMysUrQI48A= +github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI= +github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M= +github.com/open-telemetry/opentelemetry-collector-contrib/connector/spanmetricsconnector v0.115.0 h1:sO4fPw0NRUibgBVvQVTqPBCBRFh0I+ODIr3HAwcWezI= +github.com/open-telemetry/opentelemetry-collector-contrib/connector/spanmetricsconnector v0.115.0/go.mod h1:HqzCXJ4rxXzWNYaUtCqJzXyTsCGEKSa/d+tHcyeRDY0= +github.com/open-telemetry/opentelemetry-collector-contrib/exporter/prometheusremotewriteexporter v0.115.0 h1:u7Ht+E1ghQESffcjyaxWrXGsfSWa1VE9LKC4f2PPx84= +github.com/open-telemetry/opentelemetry-collector-contrib/exporter/prometheusremotewriteexporter v0.115.0/go.mod h1:r3iS2mDYu+cnGjgNc8TgvuUUAN6A6/1BvR1e1YJBrqM= +github.com/open-telemetry/opentelemetry-collector-contrib/exporter/sapmexporter v0.115.0 h1:RXYLbv2uTJlJTJcEa5H8/fLdX419XUlbn6mjzEgTWxc= +github.com/open-telemetry/opentelemetry-collector-contrib/exporter/sapmexporter v0.115.0/go.mod h1:ngeyITKu+koaagA/sFpnuT+x0nFVBNdWq60/h5buSr4= +github.com/open-telemetry/opentelemetry-collector-contrib/extension/healthcheckextension v0.115.0 h1:51D/x3xIAnWgVrY0lgdU+b+yb2aWd72uDqu9GhjRcNI= +github.com/open-telemetry/opentelemetry-collector-contrib/extension/healthcheckextension v0.115.0/go.mod h1:nLau1YUdjhtLrk4jXLPb2l9riQ1Ap4xytTLl7MBedBg= +github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer v0.115.0 h1:eJk/gbfWpGKTIGLUN+EWpqM52Zf4LFTfIeMnDji+dqM= +github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer v0.115.0/go.mod h1:+GPzqBFeqV90U4/bntDRPMxo/i/12lxH7GyPJmqz4ls= +github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/dockerobserver v0.115.0 h1:790+/iSYt6bMs/OA3AfLlZl9E/Zpb0pm5X628TCncE4= +github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/dockerobserver v0.115.0/go.mod h1:LtsKKBDZyn02DiqvuOZapGg75P/FqGQNelTI6fO12o0= +github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/ecsobserver v0.115.0 h1:BtYrSkQSYGJufsmbqqrpzb+BJXH2S4CKL14i1bxOFCU= +github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/ecsobserver v0.115.0/go.mod h1:4LQ1S3eBu+MyCNaCkBk0hIoAhvJJS851i/tY45FtDf4= +github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/ecstaskobserver v0.115.0 h1:zi0LLZp26hAycIKNbmOIMGc0ZnkikrciTHl1tiJuo4Y= +github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/ecstaskobserver v0.115.0/go.mod h1:a/UMjV9mrFJ5WIlpaDQ/S5KgCrg0H3kD8nlhfQRxfBI= +github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/hostobserver v0.115.0 h1:5PiDmieivpExBd2LchzSIvEls+cjUeJtPLXvvHxLZoI= +github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/hostobserver v0.115.0/go.mod h1:FIFNtgEoqcI/evvgSL+5qO/cdRUK+6ixFKKUdKpmMeA= +github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/k8sobserver v0.115.0 h1:sMHHN4HrakORqrpsTLQQVGiDjKg4QreBJ+UCx/1OI+I= +github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/k8sobserver v0.115.0/go.mod h1:q1950sX5QqCGDurVOkwatDSc5de4gpGfuPGVtFgNo3I= +github.com/open-telemetry/opentelemetry-collector-contrib/extension/pprofextension v0.115.0 h1:HVGG31WeB6Fn2+il2/ycWj9tDP0fxOeOqD1rKCjsBSc= +github.com/open-telemetry/opentelemetry-collector-contrib/extension/pprofextension v0.115.0/go.mod h1:2hYojHs5daPVWECuZsPViKwty0ojuHUEmk8GEuaFqO0= +github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage v0.115.0 h1:4Ycg73pYVdiF+oq+BmUq7Dkg0WKeKvBSk9AOKvBe4LU= +github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage v0.115.0/go.mod h1:l2Q+MmYk2ZRDSbhX9GlJYvBXC51AqhDJAj2ne290Xik= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/ecsutil v0.115.0 h1:SF3gOOEkfntE3zEhY80yO7BVQ5CkaK8ecic2U2AZPHE= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/ecsutil v0.115.0/go.mod h1:jeBzX5m8O9X0LQxiryV9sJUIrn+QAwOnCBE2wZWIltQ= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.115.0 h1:vRQQFD4YpasQFUAdF030UWtaflSYFXK542bfWMGhOK0= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.115.0/go.mod h1:BZ7DT+0VkKR7P3I9PGEDfVa0GdB0ty41eEcejIUXF9A= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.115.0 h1:a36EJz/mb83f6ieX0v4fNDJ1jXqpeaM6DVQXeFDvdhw= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.115.0/go.mod h1:r5/40YO1eSP5ZreOmRzVOUtDr7YG39ZIUcVjHd+9Izc= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/docker v0.115.0 h1:xITYM8BkEgs2Wf+PczOrVv0b1Fk4N929/xR9YtxLpkw= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/docker v0.115.0/go.mod h1:m+5tYnZKfNDtnZKknOfssYSXBEL5Yqse4CJMpaY5kMk= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter v0.115.0 h1:h6zEsBtuZalQu7lKYf6ZCcj8fTocT+zxdmuOou9515Q= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter v0.115.0/go.mod h1:6QU/K0dGCGYorkOvJmhbDFCspy4RPxRkFjf9I64y6I0= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8sconfig v0.115.0 h1:f/HrZgTf6TF97v67uEZB3v2UtBT9aQojBvnloD3LOm4= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8sconfig v0.115.0/go.mod h1:Hp9uSq3qNJqdxu24u7RWyuPT9x1GgEUSx9US1LLeLi0= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8stest v0.115.0 h1:vXDJE8YHfAoYIAlPRtODchlqb6lWnGhJxPaT2ljvN7I= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8stest v0.115.0/go.mod h1:f3IgMFHIjEUEI/I+5e3KWMPq9h2PSMy9WovmvPdmlb0= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/metadataproviders v0.115.0 h1:4RoU3SlcNe6Dxyxfv8JVsrN8QgjBQ44Pkt9FLKK095I= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/metadataproviders v0.115.0/go.mod h1:jfPlBpZT+hvp52Ldcx+srxaqyYuKxBkxOd3KtxbveCU= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/pdatautil v0.115.0 h1:8A+iBT5G23zvBPqYx32Qh4800jHFo4X9T1fpQKVQ+4E= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/pdatautil v0.115.0/go.mod h1:AhdPvwYKu7G8LKRWzHTNQYBq27RinsMm5qSanwSA/rU= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent v0.115.0 h1:MuyDWyVoCty8HyP2CAYoRZXwINiThHovcC1Bj3+H8lk= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent v0.115.0/go.mod h1:asekVnrdzYsMJBaJtIyXOt8p07l1x0xs8X3h00sZyf0= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/splunk v0.115.0 h1:6GIJOSEIWBt9bprARMtTjRlENrwNsJl2UzbtjOBk7A0= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/splunk v0.115.0/go.mod h1:/Fg/itwlAzDjyM0Sjenup9TbdOT+aVNPSqXsF80M8hw= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/batchperresourceattr v0.115.0 h1:l4NBxl2AELPlyqupLu1IVAjtbGOEovaKEyt0UGMsuq8= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/batchperresourceattr v0.115.0/go.mod h1:j1qF1hE/Qcy2I655yXbf2ItezXok61OW+9AAxbH2ORw= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/experimentalmetricmetadata v0.115.0 h1:l9AsnVHr3Sp4lAGFlBJ6Ochl7mlPE0d5MNd70o4qKEM= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/experimentalmetricmetadata v0.115.0/go.mod h1:kARk81QZpcX6L8x4fLo4Nr/z/+jpo5PxXtugBxF2DyE= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden v0.115.0 h1:Z9p78zj9Qblw472mGkPieuX7mqduAp47rzMbFfq5evI= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden v0.115.0/go.mod h1:mtxUxJEIQy27MaGR1yzcn/OK8NoddEgb7fumpEbKYss= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl v0.115.0 h1:qdZ9EqmdM19pWhPoFA7VivBTdzP2HvNwXa3CCMHYoDQ= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl v0.115.0/go.mod h1:mrL1MNrcg0zYAJ+aK9WtOH062dl2wN9DDG7mZk9H8v4= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.115.0 h1:MerLKMrkM4YoGF6Di0D9yMXO02yCX8mrZAi/+jJVVeI= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.115.0/go.mod h1:R8AkVWe9G5Q0oMOapvm9HNS076E3Min8SVlmhBL3QD0= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.115.0 h1:WEqcnWSy9dNSlGb8pYRBX7zhaz2ReyaeImlenbzNTB4= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.115.0/go.mod h1:6Mk71CakHUA3I6oM9hARDiyQypYyOolvb+4PFYyVEFg= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/resourcetotelemetry v0.115.0 h1:eoapW0JBablApkdv4C1RUuOKfz0U6SwuKMYYSAJH6fE= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/resourcetotelemetry v0.115.0/go.mod h1:hW2AaybTRcwxJySGLC3Fh1vd2VDaQhRBfa7O7w30NS8= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/sampling v0.115.0 h1:R9MRrO+dSkAHBQLZjuwjv2RHXHQqF2Wtm1Ki0VKD5cs= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/sampling v0.115.0/go.mod h1:rKXLXmwdUVcUHwTilroKSejbg3KSwLeYzNPSpkIEnv4= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza v0.115.0 h1:7tQ+WjojXhtWDFTJlwCvkjpvdTed5YkVKVQKVAu1alg= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza v0.115.0/go.mod h1:iqgJP7+N03pOIOqYaKjVWYoIKweNdFivsvWJfFw6MTQ= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.115.0 h1:rrIm0dyEdaHmQo6udPK1V3opkzEKa0PrZzSdY5oGqmQ= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.115.0/go.mod h1:AMeisxL/9gs0bzozaymUqI1/EJ9GPvtnLh/BtqtjSF8= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheus v0.115.0 h1:KghgAubxdDqP4eUQ+d2GzHXUAwtFxpSDToqFVnax0XA= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheus v0.115.0/go.mod h1:cW/BaYE6Uo7ZYHbmT0wVBktHP0SfeLqGHMf0qks7rOE= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheusremotewrite v0.115.0 h1:ioGiKiO0WqT3PxkzanuJsPVA24FItH6nTJeDeSMFpYA= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheusremotewrite v0.115.0/go.mod h1:x1W4J+pzK/Bi9jjYBYESTsPq0nRJJLZoN7cPNd0vYSU= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/zipkin v0.115.0 h1:A9zqBtUJZ5J/0VI+B1dxuQhc2iVYpD9c54SgaKtFIN8= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/zipkin v0.115.0/go.mod h1:hG7GOrBBux/cg1fAUzvSlzYY02ekxjF9IvH4ls/nGXA= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/attributesprocessor v0.115.0 h1:hAsK9I081ShnSDSKPVEHB3TLawyOmbR6bPDiQEkgo2Y= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/attributesprocessor v0.115.0/go.mod h1:z8XdvlhXSYVboxS3TPGembE9kfxLAYH2PxPLMvf8wTk= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/cumulativetodeltaprocessor v0.115.0 h1:t3BGnPpmeuxW51vISSu51PrAs49ACBCa1Yl1NfZGE5Y= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/cumulativetodeltaprocessor v0.115.0/go.mod h1:jQLYyroEYEV1kWJApmGBgVuGUd73v+Q6EUJ6Wy7N508= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/filterprocessor v0.115.0 h1:ficXJmB6l6kfiu+R6CmggtnlQWMHUNzu2csDYA4CFSs= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/filterprocessor v0.115.0/go.mod h1:ykraxSeEVCuA43oqlMWnex78+vNQ+1dBTJUeInkqIpA= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/groupbyattrsprocessor v0.115.0 h1:LVe/Oh2un9CFKFYtepB9oZ6j38whFPVYl01RAVsdxHg= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/groupbyattrsprocessor v0.115.0/go.mod h1:mGSGQCX5dT5KUxBkuCO15CNqB+8Cb+qj0edt/oKmA34= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/k8sattributesprocessor v0.115.0 h1:6RGhDlZkekmp12EvK6JV9fiIwrdZBOJID6/Ts9tXzL4= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/k8sattributesprocessor v0.115.0/go.mod h1:qZRQtGr/DAjuBqAuKJMN2cWvc9RI94lB0Oq8UyGAduo= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/probabilisticsamplerprocessor v0.115.0 h1:vwZQ7k8oqlK0bdZYTsjP/59zjQQfjSD4fNsWIWsTu2w= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/probabilisticsamplerprocessor v0.115.0/go.mod h1:5ObSa9amrbzbYTdAK1Qhv3D/YqCxxnQhP0sk2eWB7Oo= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.115.0 h1:jQ6mIXhWqXhl8MPun9soNynsQ0lpOpOYQyAnQ28F014= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.115.0/go.mod h1:oRxNwm6HN7ckp4aJOAFC8BVBPa0UDhB8vNGTFL3QBJg= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourceprocessor v0.115.0 h1:KbfjEsr2d/5TGWHvcaBC3lOpYAnquEraLXcis4IamAs= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourceprocessor v0.115.0/go.mod h1:fmtZPK5RIz+2Lcm9xQZuwiM+M8/juSSeJufSxUT+J9w= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/routingprocessor v0.115.0 h1:Ea5v0Q6VNIMRbXVJjHUsSbdOSkB+80sCOH7Y9yhStnY= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/routingprocessor v0.115.0/go.mod h1:IkiZL9vOU8qNCkrnJP0GOWPoFTED+yhB94wJbcLYcGA= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/tailsamplingprocessor v0.115.0 h1:olyiml73slGYORDjZNViW3nKiysC+K+h5yPsSBjUxQ4= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/tailsamplingprocessor v0.115.0/go.mod h1:N00k1mTxzfS2clqxSP4Dxk7iX8GWbbuCq6LF8/ECk/M= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor v0.115.0 h1:sLRTfXUFiqJ5Qe/NN5MUJxTaFt46E0Y/xjSY+KesCQc= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor v0.115.0/go.mod h1:361IqXD4jnfs6G+Yn7978uv1UNozhZo4yBYy4p6Nqzc= +github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filelogreceiver v0.115.0 h1:JSFnfWwlVGLul8p9DE6Sk6E0zaqCvbys7CqvJQD4MIs= +github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filelogreceiver v0.115.0/go.mod h1:cw0qzwXzKKxM7QyDcNSp9OSDLySVXyaSrgdqWPqlDk8= +github.com/open-telemetry/opentelemetry-collector-contrib/receiver/fluentforwardreceiver v0.115.0 h1:2xlgF/vCUsZx9HDqhDi0XyR1QXBM67YFRyWrEq5Ydos= +github.com/open-telemetry/opentelemetry-collector-contrib/receiver/fluentforwardreceiver v0.115.0/go.mod h1:vWTdohkLm9S+3Ekz4aq1jW0xt8wD2jrdOOSOJNllppo= +github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver v0.115.0 h1:XDlXWa6pdAp02kdfZdzZ0cjeZMNHjI7dj2dNgKdzOfo= +github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver v0.115.0/go.mod h1:Zo6YARAWAMCdlUmyKBq0EcuKmLjxfC2hUNd3jIAFsWE= +github.com/open-telemetry/opentelemetry-collector-contrib/receiver/jaegerreceiver v0.115.0 h1:hYNlyUj3F43cuv1ap19NlEEchQfs91vYeNoQ1+nswLo= +github.com/open-telemetry/opentelemetry-collector-contrib/receiver/jaegerreceiver v0.115.0/go.mod h1:1o6wF5HJdpb2hd2eGMoQhGuTKb4F2+j/IHBJJSPdM2w= +github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusreceiver v0.115.0 h1:GIyMUiud3T8nyCJP9KVhxVKvfcNQRBCde5uTCl6K/i0= +github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusreceiver v0.115.0/go.mod h1:x4hCznyUolxGt5cE/uXWRCckdIDrUYqH5hJddvdKZd4= +github.com/open-telemetry/opentelemetry-collector-contrib/receiver/receivercreator v0.115.0 h1:Di0uc2QvwEVrq1PEReZ34FpPuo1z5QhHmT0bvdTe0DU= +github.com/open-telemetry/opentelemetry-collector-contrib/receiver/receivercreator v0.115.0/go.mod h1:ODvjmz18PDQnX/BruQ8IFOpiz/HdGOpUWMEKq7f3nhA= +github.com/open-telemetry/opentelemetry-collector-contrib/receiver/zipkinreceiver v0.115.0 h1:h/HAHLIZnIyu85l8wOeggOyiI8z8citNAqxQktVKUpk= +github.com/open-telemetry/opentelemetry-collector-contrib/receiver/zipkinreceiver v0.115.0/go.mod h1:iEU0NA/i2sUREqD19JYmjKwrjMUTcddad/h1LGdSMHw= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.1.0 h1:8SG7/vwALn54lVB/0yZ/MMwhFrPYtpEHQb2IpWsCzug= @@ -817,14 +818,14 @@ github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 h1:nn5Wsu0esKSJiIVhscUt github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= 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.10 h1:7VOzPtfw/5YDU+jLEoBwXwxJbQetULywoSV4RYY7HkM= -github.com/shirou/gopsutil/v4 v4.24.10/go.mod h1:s4D/wg+ag4rG0WO7AiTj2BeYCRhym0vM7DHbZRxnIT8= +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 v1.7.1 h1:UJcjSAI3aUKx52kfcfhblgyhZceouhvvs3OYdWgn+PY= github.com/shoenig/test v1.7.1/go.mod h1:UxJ6u/x2v/TNs/LoLxBNJRV9DiwBBKYxXSyczsBHFoI= -github.com/signalfx/sapm-proto v0.16.0 h1:E8W+awZBl3nmpDTdbPK8Uwla9FdSCWpZChR3p+7bzw0= -github.com/signalfx/sapm-proto v0.16.0/go.mod h1:7VTAIoYIgkAK+j6w3l4Aici+EYySGAmXCK0rfD2OZkU= +github.com/signalfx/sapm-proto v0.17.0 h1:KY+9zm/yDOq6uzaguI1RmrJcWxzbkGv0zE6GplA3ytc= +github.com/signalfx/sapm-proto v0.17.0/go.mod h1:c8fGx9DjGP7Hqif7g6Zy6E+BCMXK/dERFU2b3faA0gk= 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.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= @@ -878,14 +879,14 @@ github.com/tidwall/pretty v1.2.0 h1:RWIZEg2iJ8/g6fDDYzMpobmaoGh5OLl4AXtGUGPcqCs= github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= github.com/tidwall/tinylru v1.1.0 h1:XY6IUfzVTU9rpwdhKUF6nQdChgCdGjkMfLzbWyiau6I= github.com/tidwall/tinylru v1.1.0/go.mod h1:3+bX+TJ2baOLMWTnlyNWHh4QMnFyARg2TLTQ6OFbzw8= -github.com/tidwall/wal v1.1.7 h1:emc1TRjIVsdKKSnpwGBAcsAGg0767SvUk8+ygx7Bb+4= -github.com/tidwall/wal v1.1.7/go.mod h1:r6lR1j27W9EPalgHiB7zLJDYu3mzW5BQP5KrzBpYY/E= +github.com/tidwall/wal v1.1.8 h1:2qDSGdAdjaY3PEvHRva+9UFqgk+ef7cOiW1Qn5JH1y0= +github.com/tidwall/wal v1.1.8/go.mod h1:r6lR1j27W9EPalgHiB7zLJDYu3mzW5BQP5KrzBpYY/E= 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.14 h1:g5vzr9iPFFz24v2KZXs/pvpvh8/V9Fw6vQK5ZZb78yU= -github.com/tklauser/go-sysconf v0.3.14/go.mod h1:1ym4lWMLUOhuBOPGtRcJm7tEGX4SCYNEEEtghGG/8uY= -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/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= +github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= +github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+Fk= +github.com/tklauser/numcpus v0.6.1/go.mod h1:1XfjsgE2zo8GVw7POkMbHENHzVg3GzmoZ9fESEdAacY= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= github.com/ua-parser/uap-go v0.0.0-20240611065828-3a4781585db6 h1:SIKIoA4e/5Y9ZOl0DCe3eVMLPOQzJxgZpfdHHeauNTM= github.com/ua-parser/uap-go v0.0.0-20240611065828-3a4781585db6/go.mod h1:BUbeWZiieNxAuuADTBNb3/aeje6on3DhU3rpWsQSB1E= @@ -910,140 +911,144 @@ go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= -go.opentelemetry.io/collector v0.114.0 h1:XLLLOHns06P9XjVHyp0OdEMdwXvol5MLzugqQMmXYuU= -go.opentelemetry.io/collector v0.114.0/go.mod h1:XbjD4Yw9LunLo3IJu3ZZytNZ0drEVznxw1Z14Ujlw3s= -go.opentelemetry.io/collector/client v1.20.0 h1:o60wPcj5nLtaRenF+1E5p4QXFS3TDL6vHlw+GOon3rg= -go.opentelemetry.io/collector/client v1.20.0/go.mod h1:6aqkszco9FaLWCxyJEVam6PP7cUa8mPRIXeS5eZGj0U= -go.opentelemetry.io/collector/component v0.114.0 h1:SVGbm5LvHGSTEDv7p92oPuBgK5tuiWR82I9+LL4TtBE= -go.opentelemetry.io/collector/component v0.114.0/go.mod h1:MLxtjZ6UVHjDxSdhGLuJfHBHvfl1iT/Y7IaQPD24Eww= -go.opentelemetry.io/collector/component/componentstatus v0.114.0 h1:y9my/xink8KB5lK8zFAjgB2+pEh0QYy5TM972fxZY9w= -go.opentelemetry.io/collector/component/componentstatus v0.114.0/go.mod h1:RIoeCYZpPaae7QLE/1RacqzhHuXBmzRAk9H/EwYtIIs= -go.opentelemetry.io/collector/component/componenttest v0.114.0 h1:GM4FTTlfeXoVm6sZYBHImwlRN8ayh2oAfUhvaFj7Zo8= -go.opentelemetry.io/collector/component/componenttest v0.114.0/go.mod h1:ZZEJMtbJtoVC/3/9R1HzERq+cYQRxuMFQrPCpfZ4Xos= -go.opentelemetry.io/collector/config/configauth v0.114.0 h1:R2sJ6xpsLYGH0yU0vCxotzBYDKR/Hrjv0A7y9lwMyiw= -go.opentelemetry.io/collector/config/configauth v0.114.0/go.mod h1:3Z24KcCpG+WYCeQYfs/cNp5cP2BDeOqLCtOEgs/rPqM= -go.opentelemetry.io/collector/config/configcompression v1.20.0 h1:H/mvz7J/5z+O74YsO0t2tk+REnO2tzLM8TgIQ4AZ5w0= -go.opentelemetry.io/collector/config/configcompression v1.20.0/go.mod h1:pnxkFCLUZLKWzYJvfSwZnPrnm0twX14CYj2ADth5xiU= -go.opentelemetry.io/collector/config/configgrpc v0.114.0 h1:3kGI9CljNtzClF+9sg7NWZ5qUoy4qZvGxv9q3phDn7k= -go.opentelemetry.io/collector/config/configgrpc v0.114.0/go.mod h1:IHSyqSdjPXW34aif/8BhNlXxRcIVV6026jVi0/+ituY= -go.opentelemetry.io/collector/config/confighttp v0.114.0 h1:DjGsBvVm+mGK3IpJBaXianWhwcxEC1fF33cpuC1LY/I= -go.opentelemetry.io/collector/config/confighttp v0.114.0/go.mod h1:nrlNLxOZ+4JQaV9j0TiqQV7LOHhrRivPrT8nQRHED3Q= -go.opentelemetry.io/collector/config/confignet v1.20.0 h1:LrM6AuiY8N/woTP4SWhL2V0562JXwJs9MRNFZJFLtRY= -go.opentelemetry.io/collector/config/confignet v1.20.0/go.mod h1:o3v4joAEjvLwntqexg5ixMqRrU1+Vst+jWuCUaBNgOg= -go.opentelemetry.io/collector/config/configopaque v1.20.0 h1:2I48zKiyyyYqjm7y0B9OLp24ku2ZSX3nCHG0r5FdWOQ= -go.opentelemetry.io/collector/config/configopaque v1.20.0/go.mod h1:6zlLIyOoRpJJ+0bEKrlZOZon3rOp5Jrz9fMdR4twOS4= -go.opentelemetry.io/collector/config/configretry v1.20.0 h1:z679mrMlW2a6tOOYPGdrS/QfALxdzWLQUOpH8Uu+D5Y= -go.opentelemetry.io/collector/config/configretry v1.20.0/go.mod h1:KvQF5cfphq1rQm1dKR4eLDNQYw6iI2fY72NMZVa+0N0= -go.opentelemetry.io/collector/config/configtelemetry v0.114.0 h1:kjLeyrumge6wsX6ZIkicdNOlBXaEyW2PI2ZdVXz/rzY= -go.opentelemetry.io/collector/config/configtelemetry v0.114.0/go.mod h1:R0MBUxjSMVMIhljuDHWIygzzJWQyZHXXWIgQNxcFwhc= -go.opentelemetry.io/collector/config/configtls v1.20.0 h1:hNlJdwfyY5Qe54RLJ41lfLqKTn9ypkR7sk7JNCcSe2U= -go.opentelemetry.io/collector/config/configtls v1.20.0/go.mod h1:sav/txSHguadTYlSSK+BJO2ljJeYEtRoBahgzWAguYg= -go.opentelemetry.io/collector/config/internal v0.114.0 h1:uWSDWTJb8T6xRjKD9/XmEARakXnxgYVYKUeId78hErc= -go.opentelemetry.io/collector/config/internal v0.114.0/go.mod h1:yC7E4h1Uj0SubxcFImh6OvBHFTjMh99+A5PuyIgDWqc= -go.opentelemetry.io/collector/confmap v1.20.0 h1:ARfOwmkKxFOud1njl03yAHQ30+uenlzqCO6LBYamDTE= -go.opentelemetry.io/collector/confmap v1.20.0/go.mod h1:DMpd9Ay/ffls3JoQBQ73vWeRsz1rNuLbwjo6WtjSQus= -go.opentelemetry.io/collector/confmap/provider/envprovider v1.20.0 h1:I3xDecFXJVZBo5zJS7Y5SWBjF22XDWGZJgwotiwA5QM= -go.opentelemetry.io/collector/confmap/provider/envprovider v1.20.0/go.mod h1:CF0l8V8MNv+Wag8UkqObotFnlhMzdTFuk4/6kylKwYU= -go.opentelemetry.io/collector/confmap/provider/fileprovider v1.20.0 h1:wWxvQ7wj+1O9yDGM5m1HPEz8FJewAHAUWadAAi0KVbM= -go.opentelemetry.io/collector/confmap/provider/fileprovider v1.20.0/go.mod h1:/5HWIPjGYk8IUurs1CZUSjGaSsaQyJsfR8+Zs5rGJ6Y= -go.opentelemetry.io/collector/confmap/provider/httpprovider v1.20.0 h1:YS1nB8vDoCS8IlfX5OP3QGS90y/hfflwZ7CoPQcAOlU= -go.opentelemetry.io/collector/confmap/provider/httpprovider v1.20.0/go.mod h1:aV4UfkgcJ3eyXvfd3m694omN++1c96Joitab+YL6Xks= -go.opentelemetry.io/collector/confmap/provider/yamlprovider v1.20.0 h1:jSXTojCPI6Xr98m99nF7qbQFnw3INLEOHRcqcHS+lak= -go.opentelemetry.io/collector/confmap/provider/yamlprovider v1.20.0/go.mod h1:Pu95O2JE3R+0BBTbe4gpAC8ms3w6FbICHJw3WvGWrjs= -go.opentelemetry.io/collector/connector v0.114.0 h1:efGAeTCtg8zp5Hyd7Am8kBUgsSxWEFlFtAu4OX4mcEA= -go.opentelemetry.io/collector/connector v0.114.0/go.mod h1:8DhGgD8RhkF0ooELl4NOPPD/wgHuXHmY7g90RwJ2eNo= -go.opentelemetry.io/collector/connector/connectorprofiles v0.114.0 h1:uVs9gy3UfQBmH0636ouIbGIoWis7zmKN+ny4XOGm36U= -go.opentelemetry.io/collector/connector/connectorprofiles v0.114.0/go.mod h1:X681qFEAsEPMDQ0pMsD/3DqePw58sfLew1QbBKvGnmw= -go.opentelemetry.io/collector/connector/connectortest v0.114.0 h1:Fpy1JHyNOLdVzNcmxUY6Jwxdz6JDcTXL1NCfw8k1AOc= -go.opentelemetry.io/collector/connector/connectortest v0.114.0/go.mod h1:1zaAlODuL9iNyfyjHQeGCpbcaUjf5b68t8LqlwHKBNA= -go.opentelemetry.io/collector/consumer v0.114.0 h1:1zVaHvfIZowGwZRitRBRo3i+RP2StlU+GClYiofSw0Q= -go.opentelemetry.io/collector/consumer v0.114.0/go.mod h1:d+Mrzt9hsH1ub3zmwSlnQVPLeTYir4Mgo7CrWfnncN4= -go.opentelemetry.io/collector/consumer/consumererror v0.114.0 h1:r2YiELfWerb40FHD23V04gNjIkLUcjEKGxI4Vtm2iO4= -go.opentelemetry.io/collector/consumer/consumererror v0.114.0/go.mod h1:MzIrLQ5jptO2egypolhlAbZsWZr29WC4FhSxQjnxcvg= -go.opentelemetry.io/collector/consumer/consumererror/consumererrorprofiles v0.114.0 h1:0IpwQXyHDXhIaLA6w2VlD6Ca0iuX4wlfCDiF+BKCwEo= -go.opentelemetry.io/collector/consumer/consumererror/consumererrorprofiles v0.114.0/go.mod h1:9pKeVRcCT92x5/UIULMLAop+J23VYJCWSZcVhmbup5I= -go.opentelemetry.io/collector/consumer/consumerprofiles v0.114.0 h1:5pXYy3E6UK5Huu3aQbsYL8B6E6MyWx4fvXXDn+oXZaA= -go.opentelemetry.io/collector/consumer/consumerprofiles v0.114.0/go.mod h1:PMq3f54KcJQO4v1tue0QxQScu7REFVADlXxXSAYMiN0= -go.opentelemetry.io/collector/consumer/consumertest v0.114.0 h1:isaTwJK5DOy8Bs7GuLq23ejfgj8gLIo5dOUvkRnLF4g= -go.opentelemetry.io/collector/consumer/consumertest v0.114.0/go.mod h1:GNeLPkfRPdh06n/Rv1UKa/cAtCKjN0a7ADyHjIj4HFE= -go.opentelemetry.io/collector/exporter v0.114.0 h1:5/0BBpXuCJQSQ5SQf31g7j6T4XEKkyx9mZMcA2rS5e8= -go.opentelemetry.io/collector/exporter v0.114.0/go.mod h1:atpd0wWXgh5LAZ0REU/d/Ti/q50HDfnlBIjMjJQlKFg= -go.opentelemetry.io/collector/exporter/debugexporter v0.114.0 h1:7t1ij8fuV510SRT+eabgbl4973DaAtGmTx0RuGJy8DU= -go.opentelemetry.io/collector/exporter/debugexporter v0.114.0/go.mod h1:rC8PHnf1MniZN4ryU4i5GsyXKRkMEGwEGF2hxHx/JyU= -go.opentelemetry.io/collector/exporter/exporterhelper/exporterhelperprofiles v0.114.0 h1:W/KsD33oMg/M7Kd5/m2riliWrTg3W9IgQVNeZL3cZjs= -go.opentelemetry.io/collector/exporter/exporterhelper/exporterhelperprofiles v0.114.0/go.mod h1:Fh47qYBjX+jm+mpWBcqmaaQucZ6KiKm5P0drEt+xNRc= -go.opentelemetry.io/collector/exporter/exporterprofiles v0.114.0 h1:/wmWOSBHcvtz3Pbv7+rWCqPPQuNvYaoidKKaOqZsLKs= -go.opentelemetry.io/collector/exporter/exporterprofiles v0.114.0/go.mod h1:epRYTkyJZTSQZBJflMGHUyUo2EdLPhsaZEyo5Qm848A= -go.opentelemetry.io/collector/exporter/exportertest v0.114.0 h1:vo0idBJT+QACSM1KpjVLm9VeiXVwO7y4UnMpGxN6EyM= -go.opentelemetry.io/collector/exporter/exportertest v0.114.0/go.mod h1:420ssFrhaphneybstbMeSIiqSRoaBARPgO71O17foaM= -go.opentelemetry.io/collector/exporter/nopexporter v0.114.0 h1:uMtQQjkAK62tzy2Rs/KCgRofNW7uo0EgU5xn3xmgB2w= -go.opentelemetry.io/collector/exporter/nopexporter v0.114.0/go.mod h1:jV9/E7Twphys1df6m7HgvqgJXpmppxFJb/DYy3XLR94= -go.opentelemetry.io/collector/exporter/otlpexporter v0.114.0 h1:SC/xZNCB/eCVflrhDFX4WtrpvBPsZhmXVuSvgHQBsB8= -go.opentelemetry.io/collector/exporter/otlpexporter v0.114.0/go.mod h1:q1273aUuYewtDUFwizv0AKu5/D+gbQAi8UFLKDv1eMk= -go.opentelemetry.io/collector/exporter/otlphttpexporter v0.114.0 h1:+nPJraioPpLS2Kj3+YIfErDDFHsLX/5oPMSMAYKoggM= -go.opentelemetry.io/collector/exporter/otlphttpexporter v0.114.0/go.mod h1:O+75KYmyJwK61VDsW7LHo2qFFXCTf3kEJH3ZvW1bb4Y= -go.opentelemetry.io/collector/extension v0.114.0 h1:9Qb92y8hD2WDC5aMDoj4JNQN+/5BQYJWPUPzLXX+iGw= -go.opentelemetry.io/collector/extension v0.114.0/go.mod h1:Yk2/1ptVgfTr12t+22v93nYJpioP14pURv2YercSzU0= -go.opentelemetry.io/collector/extension/auth v0.114.0 h1:1K2qh4yvG8kKR/sTAobI/rw5VxzPZoKcl3FmC195vvo= -go.opentelemetry.io/collector/extension/auth v0.114.0/go.mod h1:IjtsG+jUVJB0utKF8dAK8pLutRun3aEgASshImzsw/U= -go.opentelemetry.io/collector/extension/experimental/storage v0.114.0 h1:hLyX9UvmY0t6iBnk3CqvyNck2U0QjPACekj7pDRx2hA= -go.opentelemetry.io/collector/extension/experimental/storage v0.114.0/go.mod h1:WqYRQVJjJLE1rm+y/ks1wPdPRGWePEvE1VO07xm2J2k= -go.opentelemetry.io/collector/extension/extensioncapabilities v0.114.0 h1:3OHll7gp5XIu7FVgon+koShPy797nze6EjCDokFUG7w= -go.opentelemetry.io/collector/extension/extensioncapabilities v0.114.0/go.mod h1:f0KdeLmE2jWVBmJ1U4WmfAtz1/tQUErGPfhPLKCQ49U= -go.opentelemetry.io/collector/extension/extensiontest v0.114.0 h1:ibXDms1qrswlvlR6b3d2BeyI8sXUXoFV11yOi9Sop8o= -go.opentelemetry.io/collector/extension/extensiontest v0.114.0/go.mod h1:/bOYmqu5yTDfI1bJZUxFqm8ZtmcodpquebiSxiQxtDY= -go.opentelemetry.io/collector/extension/zpagesextension v0.114.0 h1:JosqAcdWw7IGsURJNR8f17xmaGCQEtKhQt9tM0T/DEg= -go.opentelemetry.io/collector/extension/zpagesextension v0.114.0/go.mod h1:+VO4p2GZvmIMqCVyIfS/U85Xqg+HIOe+mdl/ya+jVTE= -go.opentelemetry.io/collector/featuregate v1.20.0 h1:Mi7nMy/q52eruI+6jWnMKUOeM55XvwoPnGcdB1++O8c= -go.opentelemetry.io/collector/featuregate v1.20.0/go.mod h1:47xrISO71vJ83LSMm8+yIDsUbKktUp48Ovt7RR6VbRs= -go.opentelemetry.io/collector/filter v0.114.0 h1:5I97yblUxc6rXCYRn542aSrsNQLo/dE+87XROW2b5oU= -go.opentelemetry.io/collector/filter v0.114.0/go.mod h1:Nxwc+RD9AH4y/qYtkTP+Ac19CxgW5GAB+sJU4ACLr6g= -go.opentelemetry.io/collector/internal/fanoutconsumer v0.114.0 h1:JM9huYqy5LTzmuxQmbPST3l5Ez5kJNit28c6WFWls34= -go.opentelemetry.io/collector/internal/fanoutconsumer v0.114.0/go.mod h1:V28tDU4Wvf1PfW1Ty/SBL9tpKul2iYGno/HkCWGDrj0= -go.opentelemetry.io/collector/internal/memorylimiter v0.114.0 h1:UpKQ/GtWw7Mh/PjR03NdgR9PG7uT7mnfbQVxpDQVBgk= -go.opentelemetry.io/collector/internal/memorylimiter v0.114.0/go.mod h1:QUZr3bBguTmgLJUFuqVVsOxKr7Y/2JO49k3I1tUH88U= -go.opentelemetry.io/collector/internal/sharedcomponent v0.114.0 h1:DjX9ubjkKDnioQB03FYc40FTyhR25CdobMfjinKkZ1w= -go.opentelemetry.io/collector/internal/sharedcomponent v0.114.0/go.mod h1:lYlFiGIjPjhwTS/Xc+toJ9o3D8A6cCHuK1JX+ZbujVs= -go.opentelemetry.io/collector/otelcol v0.114.0 h1:d/nmYc+adzZ70g4zBMtgujGHVNulF59ExCpuM/3ZKV4= -go.opentelemetry.io/collector/otelcol v0.114.0/go.mod h1:DGmFFao5jHSwD6G1HjUjs0CYcyrTau+u7GjTRUGKN+4= -go.opentelemetry.io/collector/otelcol/otelcoltest v0.114.0 h1:Em5e1EgrPrS90EWDWLJHCvyFIDl5PIq1DuW9zd8F3pY= -go.opentelemetry.io/collector/otelcol/otelcoltest v0.114.0/go.mod h1:YAs78SaOJsf1HNWrNH+GFTdkS58dpQI98cok6gZP4Lg= -go.opentelemetry.io/collector/pdata v1.20.0 h1:ePcwt4bdtISP0loHaE+C9xYoU2ZkIvWv89Fob16o9SM= -go.opentelemetry.io/collector/pdata v1.20.0/go.mod h1:Ox1YVLe87cZDB/TL30i4SUz1cA5s6AM6SpFMfY61ICs= -go.opentelemetry.io/collector/pdata/pprofile v0.114.0 h1:pUNfTzsI/JUTiE+DScDM4lsrPoxnVNLI2fbTxR/oapo= -go.opentelemetry.io/collector/pdata/pprofile v0.114.0/go.mod h1:4aNcj6WM1n1uXyFSXlhVs4ibrERgNYsTbzcYI2zGhxA= -go.opentelemetry.io/collector/pdata/testdata v0.114.0 h1:+AzszWSL1i4K6meQ8rU0JDDW55SYCXa6FVqfDixhhTo= -go.opentelemetry.io/collector/pdata/testdata v0.114.0/go.mod h1:bv8XFdCTZxG2MQB5l9dKxSxf5zBrcodwO6JOy1+AxXM= -go.opentelemetry.io/collector/pipeline v0.114.0 h1:v3YOhc5z0tD6QbO5n/pnftpIeroihM2ks9Z2yKPCcwY= -go.opentelemetry.io/collector/pipeline v0.114.0/go.mod h1:4vOvjVsoYTHVGTbfFwqfnQOSV2K3RKUHofh3jNRc2Mg= -go.opentelemetry.io/collector/pipeline/pipelineprofiles v0.114.0 h1:LZgxMQ2zXcz8ILBefhxpZBpn/Rx+TJTncIIQy0LgtgY= -go.opentelemetry.io/collector/pipeline/pipelineprofiles v0.114.0/go.mod h1:bmyqQCJWcA53/GtqZJ2ahwmLdFl6UelFH2nR6OJFqpw= -go.opentelemetry.io/collector/processor v0.114.0 h1:6bqQgLL7BtKrNv4YkEOGjZfkcfZv/ciJSQx1epGG9Zk= -go.opentelemetry.io/collector/processor v0.114.0/go.mod h1:DV/wa+nAmSHIDeD9NblPwkY9PbgtDQAZJ+PE5biZwPc= -go.opentelemetry.io/collector/processor/batchprocessor v0.114.0 h1:Xu+pdPGIh6gLqHW5oYJsiim1mbnG85QaaUQy0YPoL+c= -go.opentelemetry.io/collector/processor/batchprocessor v0.114.0/go.mod h1:emnnL5CaliCnWjXNpNixqpvn7uc/kyUTv2939J/reMY= -go.opentelemetry.io/collector/processor/memorylimiterprocessor v0.114.0 h1:gfzShbdzhbA2lsRSx2z9i9QO/FJwAzOSrBW2ObPqf38= -go.opentelemetry.io/collector/processor/memorylimiterprocessor v0.114.0/go.mod h1:leElNJO5dnpOg0o1Gr2Ok59HKADRznbrZ3u2oTfx50Q= -go.opentelemetry.io/collector/processor/processorhelper/processorhelperprofiles v0.114.0 h1:/CQJ0UQRStwBQnM4Z9lTr6D4IqEKH1iuUWVr21fP4To= -go.opentelemetry.io/collector/processor/processorhelper/processorhelperprofiles v0.114.0/go.mod h1:HD2uDr7TIWQ+TsXBLmrHu396EeClj7YNoNzoWJw4jrY= -go.opentelemetry.io/collector/processor/processorprofiles v0.114.0 h1:+P/1nLouEXTnN8DVQl+qWwO4BTkQyNPG9t/FrpUqrSI= -go.opentelemetry.io/collector/processor/processorprofiles v0.114.0/go.mod h1:3fuHeNIpINwx3bqFMprmDJyr6y5tWoWbJH599kltO5Y= -go.opentelemetry.io/collector/processor/processortest v0.114.0 h1:3FTaVXAp0LoVmUJn1ewBFckAby7AHa6/Kcdj0xuW14c= -go.opentelemetry.io/collector/processor/processortest v0.114.0/go.mod h1:OgsdOs1Fv5ZGTTJPF5nNIUJh2YkuV1acWd73yWgnti4= -go.opentelemetry.io/collector/receiver v0.114.0 h1:90SAnXAjNq7/k52/pFmmb06Cf1YauoPYtbio4aOXafY= -go.opentelemetry.io/collector/receiver v0.114.0/go.mod h1:KUGT0/D953LXbGH/D3lLPU8yrU3HfWnUqpt4W4hSOnE= -go.opentelemetry.io/collector/receiver/nopreceiver v0.114.0 h1:CMtfS6fwEwqwTMeC17A3Q2xsSkXfH4gG2SBZDr2txCw= -go.opentelemetry.io/collector/receiver/nopreceiver v0.114.0/go.mod h1:ajp6ok8iSSAcyq58wcOUJVe++1mTQ1isxqlaNUgQNzo= -go.opentelemetry.io/collector/receiver/otlpreceiver v0.114.0 h1:8ASaxRWLe8P0pefOiYbCSZ0aXmwE4K06I8FBGc/n+J0= -go.opentelemetry.io/collector/receiver/otlpreceiver v0.114.0/go.mod h1:3vjOvYBWGUVzuaovoumMbNHEIK3PqDs5rzEyd/nzsLU= -go.opentelemetry.io/collector/receiver/receiverprofiles v0.114.0 h1:ibhEfGpvNB3yrtpl2jYFabrunMk1hurxvMYpM0b1Ck4= -go.opentelemetry.io/collector/receiver/receiverprofiles v0.114.0/go.mod h1:UZyRfaasw+NLvN10AN8IQnmj5tQ3BOUH1uP2ctpO9f0= -go.opentelemetry.io/collector/receiver/receivertest v0.114.0 h1:D+Kh9t2n4asTnM+TiSxbrKlUemLZandWntj17BJWWb0= -go.opentelemetry.io/collector/receiver/receivertest v0.114.0/go.mod h1:mNSHQ13vFmqD+VAcRzLjStFBejbcWUn2Mp0pAd7Op+U= -go.opentelemetry.io/collector/semconv v0.114.0 h1:/eKcCJwZepQUtEuFuxa0thx2XIOvhFpaf214ZG1a11k= -go.opentelemetry.io/collector/semconv v0.114.0/go.mod h1:zCJ5njhWpejR+A40kiEoeFm1xq1uzyZwMnRNX6/D82A= -go.opentelemetry.io/collector/service v0.114.0 h1:MYF/4nH1CgtiLx09503xPAAUZefCzG1kaO+oanwX590= -go.opentelemetry.io/collector/service v0.114.0/go.mod h1:xH5/RapJdf5Ohh8iU8J0ZstfFYciP1oJPesiByteZxo= +go.opentelemetry.io/collector v0.115.0 h1:qUZ0bTeNBudMxNQ7FJKS//TxTjeJ7tfU/z22mcFavWU= +go.opentelemetry.io/collector v0.115.0/go.mod h1:66qx0xKnVvdwq60e1DEfb4e+zmM9szhPsv2hxZ/Mpj4= +go.opentelemetry.io/collector/client v1.21.0 h1:3Kes8lOFMYVxoxeAmX+DTEAkuS1iTA3NkSfqzGmygJA= +go.opentelemetry.io/collector/client v1.21.0/go.mod h1:jYJGiL0UA975OOyHmjbQSokNWt1OiviI5KjPOMUMGwc= +go.opentelemetry.io/collector/component v0.115.0 h1:iLte1oCiXzjiCnaOBKdsXacfFiECecpWxW3/LeriMoo= +go.opentelemetry.io/collector/component v0.115.0/go.mod h1:oIUFiH7w1eOimdeYhFI+gAIxYSiLDocKVJ0PTvX7d6s= +go.opentelemetry.io/collector/component/componentstatus v0.115.0 h1:pbpUIL+uKDfEiSgKK+S5nuSL6MDIIQYsp4b65ZGVb9M= +go.opentelemetry.io/collector/component/componentstatus v0.115.0/go.mod h1:36A+9XSiOz0Cdhq+UwwPRlEr5CYuSkEnVO9om4BH7d0= +go.opentelemetry.io/collector/component/componenttest v0.115.0 h1:9URDJ9VyP6tuij+YHjp/kSSMecnZOd7oGvzu+rw9SJY= +go.opentelemetry.io/collector/component/componenttest v0.115.0/go.mod h1:PzXvNqKLCiSADZGZFKH+IOHMkaQ0GTHuzysfVbTPKYY= +go.opentelemetry.io/collector/config/configauth v0.115.0 h1:xa+ALdyPgva3rZnLBh1H2oS5MsHP6JxSqMtQmcELnys= +go.opentelemetry.io/collector/config/configauth v0.115.0/go.mod h1:C7anpb3Rf4KswMT+dgOzkW9UX0z/65PLORpUw3p0VYc= +go.opentelemetry.io/collector/config/configcompression v1.21.0 h1:0zbPdZAgPFMAarwJEC4gaR6f/JBP686A3TYSgb3oa+E= +go.opentelemetry.io/collector/config/configcompression v1.21.0/go.mod h1:LvYG00tbPTv0NOLoZN0wXq1F5thcxvukO8INq7xyfWU= +go.opentelemetry.io/collector/config/configgrpc v0.115.0 h1:gZzXSFe6hB3RUcEeAYqk1yT+TBa+X9tp6/1x29Yg2yk= +go.opentelemetry.io/collector/config/configgrpc v0.115.0/go.mod h1:107lRZ5LdQPMdGJGd4m1GhyKxyH0az2cUOqrJgTEN8E= +go.opentelemetry.io/collector/config/confighttp v0.115.0 h1:BIy394oNXnqySJwrCqgAJu4gWgAV5aQUDD6k1hy6C8o= +go.opentelemetry.io/collector/config/confighttp v0.115.0/go.mod h1:Wr50ut12NmCEAl4bWLJryw2EjUmJTtYRg89560Q51wc= +go.opentelemetry.io/collector/config/confignet v1.21.0 h1:PeQ5YrMnfftysFL/WVaSrjPOWjD6DfeABY50pf9CZxU= +go.opentelemetry.io/collector/config/confignet v1.21.0/go.mod h1:ZppUH1hgUJOubawEsxsQ9MzEYFytqo2GnVSS7d4CVxc= +go.opentelemetry.io/collector/config/configopaque v1.21.0 h1:PcvRGkBk4Px8BQM7tX+kw4i3jBsfAHGoGQbtZg6Ox7U= +go.opentelemetry.io/collector/config/configopaque v1.21.0/go.mod h1:sW0t0iI/VfRL9VYX7Ik6XzVgPcR+Y5kejTLsYcMyDWs= +go.opentelemetry.io/collector/config/configretry v1.21.0 h1:ZHoOvAkEcv5BBeaJn8IQ6rQ4GMPZWW4S+W7R4QTEbZU= +go.opentelemetry.io/collector/config/configretry v1.21.0/go.mod h1:cleBc9I0DIWpTiiHfu9v83FUaCTqcPXmebpLxjEIqro= +go.opentelemetry.io/collector/config/configtelemetry v0.115.0 h1:U07FinCDop+r2RjWQ3aP9ZWONC7r7kQIp1GkXQi6nsI= +go.opentelemetry.io/collector/config/configtelemetry v0.115.0/go.mod h1:SlBEwQg0qly75rXZ6W1Ig8jN25KBVBkFIIAUI1GiAAE= +go.opentelemetry.io/collector/config/configtls v1.21.0 h1:ZfrlAYgBD8lzp04W0GxwiDmUbrvKsvDYJi+wkyiXlpA= +go.opentelemetry.io/collector/config/configtls v1.21.0/go.mod h1:5EsNefPfVCMOTlOrr3wyj7LrsOgY7V8iqRl8oFZEqtw= +go.opentelemetry.io/collector/config/internal v0.115.0 h1:eVk57iufZpUXyPJFKTb1Ebx5tmcCyroIlt427r5pxS8= +go.opentelemetry.io/collector/config/internal v0.115.0/go.mod h1:OVkadRWlKAoWjHslqjWtBLAne8ceQm8WYT71ZcBWLFc= +go.opentelemetry.io/collector/confmap v1.21.0 h1:1tIcx2/Suwg8VhuPmQw87ba0ludPmumpFCFRZZa6RXA= +go.opentelemetry.io/collector/confmap v1.21.0/go.mod h1:Rrhs+MWoaP6AswZp+ReQ2VO9dfOfcUjdjiSHBsG+nec= +go.opentelemetry.io/collector/confmap/provider/envprovider v1.21.0 h1:YLf++Z8CMp86AanfOCWUiE7vKbb1kSjgC3a9VJoxbD4= +go.opentelemetry.io/collector/confmap/provider/envprovider v1.21.0/go.mod h1:aSWLYcmgZZJDNtWN1M8JKQuehoGgOxibl1KuvKTar4M= +go.opentelemetry.io/collector/confmap/provider/fileprovider v1.21.0 h1:+zukkM+3l426iGoJkXTpLB2Z8QnZFu26TkGPjh5Rn/4= +go.opentelemetry.io/collector/confmap/provider/fileprovider v1.21.0/go.mod h1:BXBpQhF3n4CNLYO2n/mWZPd2U9ekpbLXLRGZrun1VfI= +go.opentelemetry.io/collector/confmap/provider/httpprovider v1.21.0 h1:NYYGM+SgIlTuNGjd8eGzDr8DkvOe4q7cXon8djF9yyI= +go.opentelemetry.io/collector/confmap/provider/httpprovider v1.21.0/go.mod h1:XRYbuwqq1awFuNhLDUv4aSvn6MzqX+abcevx1O+APJI= +go.opentelemetry.io/collector/confmap/provider/yamlprovider v1.21.0 h1:P3Q9RytCMY76ORPCnkkjOa4fkuFqmZiQRor+F/nPlYE= +go.opentelemetry.io/collector/confmap/provider/yamlprovider v1.21.0/go.mod h1:xhYhHK3yLQ78tsoaKPIGUfFulgy961ImOe2gATH3RQc= +go.opentelemetry.io/collector/connector v0.115.0 h1:4Kkm3HQFzNT1eliMOB8FbIn+PLMRJ2qQku5Vmy3V8Ko= +go.opentelemetry.io/collector/connector v0.115.0/go.mod h1:+ByuAmYLrYHoKh9B+LGqUc0N2kXcN2l8Dea8Mp6brZ8= +go.opentelemetry.io/collector/connector/connectorprofiles v0.115.0 h1:aW1f4Az0I+QJyImFccNWAXqik80bnNu27aQqi2hFfD8= +go.opentelemetry.io/collector/connector/connectorprofiles v0.115.0/go.mod h1:lmynB1CucydOsHa8RSSBh5roUZPfuiv65imXhtNzClM= +go.opentelemetry.io/collector/connector/connectortest v0.115.0 h1:GjtourFr0MJmlbtEPAZ/1BZCxkNAeJ0aMTlrxwftJ0k= +go.opentelemetry.io/collector/connector/connectortest v0.115.0/go.mod h1:f3KQXXNlh/XuV8elmnuVVyfY92dJCAovz10gD72OH0k= +go.opentelemetry.io/collector/consumer v1.21.0 h1:THKZ2Vbi6GkamjTBI2hFq5Dc4kINZTWGwQNa8d/Ty9g= +go.opentelemetry.io/collector/consumer v1.21.0/go.mod h1:FQcC4ThMtRYY41dv+IPNK8POLLhAFY3r1YR5fuP7iiY= +go.opentelemetry.io/collector/consumer/consumererror v0.115.0 h1:yli//xBCQMPZKXNgNlXemo4dvqhnFrAmCZ11DvQgmcY= +go.opentelemetry.io/collector/consumer/consumererror v0.115.0/go.mod h1:LwVzAvQ6ZVNG7mbOvurbAo+W/rKws0IcjOwriuZXqPE= +go.opentelemetry.io/collector/consumer/consumererror/consumererrorprofiles v0.115.0 h1:gaIhzpaGFWauiyznrQ3f++TbcdXxA5rpsX3L9uGjMM8= +go.opentelemetry.io/collector/consumer/consumererror/consumererrorprofiles v0.115.0/go.mod h1:7oXvuGBSawS5bc413lh1KEMcXkqBcrCqZQahOdnE24U= +go.opentelemetry.io/collector/consumer/consumerprofiles v0.115.0 h1:H3fDuyQW1t2HWHkz96WMBQJKUevypOCjBqnqtaAWyoA= +go.opentelemetry.io/collector/consumer/consumerprofiles v0.115.0/go.mod h1:IzEmZ91Tp7TBxVDq8Cc9xvLsmO7H08njr6Pu9P5d9ns= +go.opentelemetry.io/collector/consumer/consumertest v0.115.0 h1:hru0I2447y0TluCdwlKYFFtgcpyCnlM+LiOK1JZyA70= +go.opentelemetry.io/collector/consumer/consumertest v0.115.0/go.mod h1:ybjALRJWR6aKNOzEMy1T1ruCULVDEjj4omtOJMrH/kU= +go.opentelemetry.io/collector/exporter v0.115.0 h1:JnxfpOnsuqhTPKJXVKJLS1Cv3BiVrVLzpHOjJEQw+xw= +go.opentelemetry.io/collector/exporter v0.115.0/go.mod h1:xof3fHQK8wADhaKLIJcQ7ChZaFLNC+haRdPN0wgl6kY= +go.opentelemetry.io/collector/exporter/debugexporter v0.115.0 h1:gb9VMQhcbvYqp0SJ4Hp8R9XqOLNLsoTgNJCPKpNEaVc= +go.opentelemetry.io/collector/exporter/debugexporter v0.115.0/go.mod h1:H/HS1UJlcZPNBbOcrsGZc2sPdQDHtbOjHOxMtJkmlcU= +go.opentelemetry.io/collector/exporter/exporterhelper/exporterhelperprofiles v0.115.0 h1:fetbc740pODH6JW+H49SW0hiAJwQE+/B0SbuIlaY2rg= +go.opentelemetry.io/collector/exporter/exporterhelper/exporterhelperprofiles v0.115.0/go.mod h1:oEKZ/d5BeaCK6Made9iwaeqmlT4lRbJSlW9nhIn/TwM= +go.opentelemetry.io/collector/exporter/exporterprofiles v0.115.0 h1:lSQEleCn/q9eFufcuK61NdFKU70ZlgI9dBjPCO/4CrE= +go.opentelemetry.io/collector/exporter/exporterprofiles v0.115.0/go.mod h1:7l5K2AecimX2kx+nZC1gKG3QkP247CO1+SodmJ4fFkQ= +go.opentelemetry.io/collector/exporter/exportertest v0.115.0 h1:P9SMTUXQOtcaq40bGtnnAe14zRmR4/yUgj/Tb2BEf/k= +go.opentelemetry.io/collector/exporter/exportertest v0.115.0/go.mod h1:1jMZ9gFGXglb8wfNrBZIgd+RvpZhSyFwdfE+Jtf9w4U= +go.opentelemetry.io/collector/exporter/nopexporter v0.115.0 h1:ufwLbNp7mfoSxWJcoded3D9f/nIVvCwNa/0+ZqxzkzU= +go.opentelemetry.io/collector/exporter/nopexporter v0.115.0/go.mod h1:iIJgru1t+VJVVCE5KMAKjXbq9RkK4/5FCClnWnAlGtc= +go.opentelemetry.io/collector/exporter/otlpexporter v0.115.0 h1:Kqr31VFrQvgEMzeg8T1JSXWacjUQoZph39efKN8jBpY= +go.opentelemetry.io/collector/exporter/otlpexporter v0.115.0/go.mod h1:5uy/gduFx2mH0GxJ84sY75NfzQJb9xYmgiL9Pf0dKF8= +go.opentelemetry.io/collector/exporter/otlphttpexporter v0.115.0 h1:I0qzSWGbgph+iva5/jU8tkeUTkkqqcj8+UzMxg5ubF8= +go.opentelemetry.io/collector/exporter/otlphttpexporter v0.115.0/go.mod h1:cUrv5EG12iOs5MXaecfi9K+ZATEELefpyZY6Hj4NlUo= +go.opentelemetry.io/collector/extension v0.115.0 h1:/cBb8AUdD0KMWC6V3lvCC16eP9Fg0wd1Upcp5rgvuGI= +go.opentelemetry.io/collector/extension v0.115.0/go.mod h1:HI7Ak6loyi6ZrZPsQJW1OO1wbaAW8OqXLFNQlTZnreQ= +go.opentelemetry.io/collector/extension/auth v0.115.0 h1:TTMokbBsSHZRFH48PvGSJmgSS8F3Rkr9MWGHZn8eJDk= +go.opentelemetry.io/collector/extension/auth v0.115.0/go.mod h1:3w+2mzeb2OYNOO4Bi41TUo4jr32ap2y7AOq64IDpxQo= +go.opentelemetry.io/collector/extension/auth/authtest v0.115.0 h1:OZe7dKbZ01qodSpZU0ZYzI6zpmmzJ3UvfdBSFAbSgDw= +go.opentelemetry.io/collector/extension/auth/authtest v0.115.0/go.mod h1:fk9WCXP0x91Q64Z8HZKWTHh9PWtgoWE1KXe3n2Bff3U= +go.opentelemetry.io/collector/extension/experimental/storage v0.115.0 h1:sZXw0+77092pq24CkUoTRoHQPLQUsDq6HFRNB0g5yR4= +go.opentelemetry.io/collector/extension/experimental/storage v0.115.0/go.mod h1:qjFH7Y3QYYs88By2ZB5GMSUN5k3ul4Brrq2J6lKACA0= +go.opentelemetry.io/collector/extension/extensioncapabilities v0.115.0 h1:/g25Hp5aoCNKdDjIb3Fc7XRglO8yaBRFLO/IUNPnqNI= +go.opentelemetry.io/collector/extension/extensioncapabilities v0.115.0/go.mod h1:EQx7ETiy330O6q05S2KRZsRNDg0aQEeJmVl7Ipx+Fcw= +go.opentelemetry.io/collector/extension/extensiontest v0.115.0 h1:GBVFxFEskR8jSdu9uaQh2qpXnN5VNXhXjpJ2UjxtE8I= +go.opentelemetry.io/collector/extension/extensiontest v0.115.0/go.mod h1:eu1ecbz5mT+cHoH2H3GmD/rOO0WsicSJD2RLrYuOmRA= +go.opentelemetry.io/collector/extension/zpagesextension v0.115.0 h1:zYrZZocc7n0ZuDyXNkIaX0P0qk2fjMQj7NegwBJZA4k= +go.opentelemetry.io/collector/extension/zpagesextension v0.115.0/go.mod h1:OaXwNHF3MAcInBzCXrhXbTNHfIi9b7YGhXjtCFZqxNY= +go.opentelemetry.io/collector/featuregate v1.21.0 h1:+EULHPJDLMipcwAGZVp9Nm8NriRvoBBMxp7MSiIZVMI= +go.opentelemetry.io/collector/featuregate v1.21.0/go.mod h1:3GaXqflNDVwWndNGBJ1+XJFy3Fv/XrFgjMN60N3z7yg= +go.opentelemetry.io/collector/filter v0.115.0 h1:pYnHUFDSHSjEIFZit+CU09itVkDXgV+WcV2HOkjvQcE= +go.opentelemetry.io/collector/filter v0.115.0/go.mod h1:aewQ+jmvpH88gPVWpNXiWSm+wwJVxTK4f23ex2NMd2c= +go.opentelemetry.io/collector/internal/fanoutconsumer v0.115.0 h1:6DRiSECeApFq6Jj5ug77rG53R6FzJEZBfygkyMEXdpg= +go.opentelemetry.io/collector/internal/fanoutconsumer v0.115.0/go.mod h1:vgQf5HQdmLQqpDHpDq2S3nTRoUuKtRcZpRTsy+UiwYw= +go.opentelemetry.io/collector/internal/memorylimiter v0.115.0 h1:U07IJxyHZXM6eLn8cOq/Lycx6DhQZhpDOuYtIRw/d6I= +go.opentelemetry.io/collector/internal/memorylimiter v0.115.0/go.mod h1:KNcU8WVpW5y7Ij6CGnsefb7q1UZT7VvrTDhe5FKNOA4= +go.opentelemetry.io/collector/internal/sharedcomponent v0.115.0 h1:9TL6T6ALqDpumUJ0tYIuPIg5LGo4r6eoqlNArYX116o= +go.opentelemetry.io/collector/internal/sharedcomponent v0.115.0/go.mod h1:SgBLKMh11bOTPR1bdDZbi5MlqsoDBBFI3uBIwnei+0k= +go.opentelemetry.io/collector/otelcol v0.115.0 h1:wZhFGrSCZcTQ4qw4ePjI2PaSrOCejoQKAjprKD/xavs= +go.opentelemetry.io/collector/otelcol v0.115.0/go.mod h1:iK8DPvaizirIYKDl1zZG7DDYUj6GkkH4KHifVVM88vk= +go.opentelemetry.io/collector/otelcol/otelcoltest v0.115.0 h1:HNlFpQujlnvawBk8nvMGxzjDHWDCfSprxem/EpQn4u8= +go.opentelemetry.io/collector/otelcol/otelcoltest v0.115.0/go.mod h1:WsMbqYl2rm3nPFbdxQqyLXf4iu97nYLeuQ1seZIpV3Y= +go.opentelemetry.io/collector/pdata v1.21.0 h1:PG+UbiFMJ35X/WcAR7Rf/PWmWtRdW0aHlOidsR6c5MA= +go.opentelemetry.io/collector/pdata v1.21.0/go.mod h1:GKb1/zocKJMvxKbS+sl0W85lxhYBTFJ6h6I1tphVyDU= +go.opentelemetry.io/collector/pdata/pprofile v0.115.0 h1:NI89hy13vNDw7EOnQf7Jtitks4HJFO0SUWznTssmP94= +go.opentelemetry.io/collector/pdata/pprofile v0.115.0/go.mod h1:jGzdNfO0XTtfLjXCL/uCC1livg1LlfR+ix2WE/z3RpQ= +go.opentelemetry.io/collector/pdata/testdata v0.115.0 h1:Rblz+AKXdo3fG626jS+KSd0OSA4uMXcTQfpwed6P8LI= +go.opentelemetry.io/collector/pdata/testdata v0.115.0/go.mod h1:inNnRt6S2Nn260EfCBEcjesjlKOSsr0jPwkPqpBkt4s= +go.opentelemetry.io/collector/pipeline v0.115.0 h1:bmACBqb0e8U9ag+vGGHUP7kCfAO7HHROdtzIEg8ulus= +go.opentelemetry.io/collector/pipeline v0.115.0/go.mod h1:qE3DmoB05AW0C3lmPvdxZqd/H4po84NPzd5MrqgtL74= +go.opentelemetry.io/collector/pipeline/pipelineprofiles v0.115.0 h1:3l9ruCAOrssTUDnyChKNzHWOdTtfThnYaoPZ1/+5sD0= +go.opentelemetry.io/collector/pipeline/pipelineprofiles v0.115.0/go.mod h1:2Myg+law/5lcezo9PhhZ0wjCaLYdGK24s1jDWbSW9VY= +go.opentelemetry.io/collector/processor v0.115.0 h1:+fveHGRe24PZPv/F5taahGuZ9HdNW44hgNWEJhIUdyc= +go.opentelemetry.io/collector/processor v0.115.0/go.mod h1:/oLHBlLsm7tFb7zOIrA5C0j14yBtjXKAgxJJ2Bktyk4= +go.opentelemetry.io/collector/processor/batchprocessor v0.115.0 h1:dgw1jcE/YVFTs41b3Y7SerU3BBSyMEE93AYV+BAxR8E= +go.opentelemetry.io/collector/processor/batchprocessor v0.115.0/go.mod h1:imG1kDEq14UGlxyCjSCf1TUEFdSWRvF7tLoYX9nixEQ= +go.opentelemetry.io/collector/processor/memorylimiterprocessor v0.115.0 h1:LCA2jwxy1PRc7X/AtRJfMdOANh5rVLdwo5PAM+gAuyo= +go.opentelemetry.io/collector/processor/memorylimiterprocessor v0.115.0/go.mod h1:gPcHyza7Rek3jfrQFxw99fcWBDkkRqBaMHcUz9yYv5I= +go.opentelemetry.io/collector/processor/processorhelper/processorhelperprofiles v0.115.0 h1:r1UF8LPICTRXBL0685zV/CC8J4sWg/qm1g+sHOYMq2Y= +go.opentelemetry.io/collector/processor/processorhelper/processorhelperprofiles v0.115.0/go.mod h1:3erq5umu5a7DKXo4PBm4I5yJjc6r0aJNvBV2nVSPDuE= +go.opentelemetry.io/collector/processor/processorprofiles v0.115.0 h1:cCZAs+FXaebZPppqAN3m+X3etoSBL6NvyQo8l0hOZoo= +go.opentelemetry.io/collector/processor/processorprofiles v0.115.0/go.mod h1:kMxF0gknlWX4duuAJFi2/HuIRi6C3w95tOenRa0GKOY= +go.opentelemetry.io/collector/processor/processortest v0.115.0 h1:j9HEaYFOeOB6VYl9zGhBnhQbTkqGBa2udUvu5NTh6hc= +go.opentelemetry.io/collector/processor/processortest v0.115.0/go.mod h1:Gws+VEnp/eW3qAqPpqbKsrbnnxxNfyDjqrfUXbZfZic= +go.opentelemetry.io/collector/receiver v0.115.0 h1:55Q3Jvj6zHCIA1psKqi/3kEMJO4OqUF5tNAEYNdB1U8= +go.opentelemetry.io/collector/receiver v0.115.0/go.mod h1:nBSCh2O/WUcfgpJ+Jpz+B0z0Hn5jHeRvF2WmLij5EIY= +go.opentelemetry.io/collector/receiver/nopreceiver v0.115.0 h1:87dxAcHekbXqLtjcQjnK1An2PWkWAhTly+EXzPEgYOE= +go.opentelemetry.io/collector/receiver/nopreceiver v0.115.0/go.mod h1:Llu88KNSNwvmYPRr2PMDDbVY9zHfHEbPPB4yTjjQQe0= +go.opentelemetry.io/collector/receiver/otlpreceiver v0.115.0 h1:NqMWsGuVy6y6VKTaPeJS7NZ9KAxhE/xyGUC7GaLYm/o= +go.opentelemetry.io/collector/receiver/otlpreceiver v0.115.0/go.mod h1:9ituzngnjsh/YvO+Phayq9BTk/nw0rgK5ZVvX1oxULk= +go.opentelemetry.io/collector/receiver/receiverprofiles v0.115.0 h1:R9JLaj2Al93smIPUkbJshAkb/cY0H5JBOxIx+Zu0NG4= +go.opentelemetry.io/collector/receiver/receiverprofiles v0.115.0/go.mod h1:05E5hGujWeeXJmzKZwTdHyZ/+rRyrQlQB5p5Q2XY39M= +go.opentelemetry.io/collector/receiver/receivertest v0.115.0 h1:OiB684SbHQi6/Pd3ZH0cXjYvCpBS9ilQBfTQx0wVXHg= +go.opentelemetry.io/collector/receiver/receivertest v0.115.0/go.mod h1:Y8Z9U/bz9Xpyt8GI8DxZZgryw3mnnIw+AeKVLTD2cP8= +go.opentelemetry.io/collector/scraper v0.115.0 h1:hbfebO7x1Xm96OwqeuLz5w7QAaB3ZMlwOkUo0XzPadc= +go.opentelemetry.io/collector/scraper v0.115.0/go.mod h1:7YoCO6/4PeExLiX1FokcydJGCQUa7lUqZsqXokJ5VZ4= +go.opentelemetry.io/collector/semconv v0.115.0 h1:SoqMvg4ZEB3mz2EdAb6XYa+TuMo5Mir5FRBr3nVFUDY= +go.opentelemetry.io/collector/semconv v0.115.0/go.mod h1:N6XE8Q0JKgBN2fAhkUQtqK9LT7rEGR6+Wu/Rtbal1iI= +go.opentelemetry.io/collector/service v0.115.0 h1:k4GAOiI5tZgB2QKgwA6c3TeAVr7QL/ft5cOQbzUr8Iw= +go.opentelemetry.io/collector/service v0.115.0/go.mod h1:DKde9LMhNebdREecDSsqiTFLI2wRc+IoV4/wGxU6goY= go.opentelemetry.io/contrib/bridges/otelzap v0.6.0 h1:j8icMXyyqNf6HGuwlYhniPnVsbJIq7n+WirDu3VAJdQ= go.opentelemetry.io/contrib/bridges/otelzap v0.6.0/go.mod h1:evIOZpl+kAlU5IsaYX2Siw+IbpacAZvXemVsgt70uvw= go.opentelemetry.io/contrib/config v0.10.0 h1:2JknAzMaYjxrHkTnZh3eOme/Y2P5eHE2SWfhfV6Xd6c= @@ -1115,8 +1120,8 @@ golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90/go.mod h1:IxCIyHEi3zRg3s0 golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= -golang.org/x/crypto v0.29.0 h1:L5SG1JTTXupVV3n6sUqMTeWbjAyfPwoda2DLX8J8FrQ= -golang.org/x/crypto v0.29.0/go.mod h1:+F4F4N5hv6v38hfeYwTdx20oUvLLc+QfrE9Ax9HtgRg= +golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U= +golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1213,8 +1218,8 @@ golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= -golang.org/x/net v0.31.0 h1:68CPQngjLL0r2AlUKiSxtQFKvzRVbnzLwMUn5SzcLHo= -golang.org/x/net v0.31.0/go.mod h1:P4fl1q7dY2hnZFxEk4pPSkDHF+QqjitcnDjUQyMM+pM= +golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= +golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1236,8 +1241,8 @@ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.9.0 h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ= -golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= +golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1311,10 +1316,11 @@ golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.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.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.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-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= @@ -1328,8 +1334,8 @@ golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= -golang.org/x/term v0.26.0 h1:WEQa6V3Gja/BhNxg540hBip/kkaYtRg3cxg4oXSw4AU= -golang.org/x/term v0.26.0/go.mod h1:Si5m1o57C5nBNQo5z1iq+XDijt21BDBDp2bK0QI8e3E= +golang.org/x/term v0.27.0 h1:WP60Sv1nlK1T6SupCHbXzSaN0b9wUmsPoRS9b61A23Q= +golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1346,16 +1352,15 @@ golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= -golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20220210224613-90d013bbcef8/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= -golang.org/x/time v0.8.0 h1:9i3RxcPv3PZnitoVGMPDKZSq1xW1gK1Xy3ArNOGZfEg= -golang.org/x/time v0.8.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= @@ -1434,8 +1439,8 @@ google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0M google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= -google.golang.org/api v0.199.0 h1:aWUXClp+VFJmqE0JPvpZOK3LDQMyFKYIow4etYd9qxs= -google.golang.org/api v0.199.0/go.mod h1:ohG4qSztDJmZdjK/Ar6MhbAmb/Rpi4JHOqagsh90K28= +google.golang.org/api v0.188.0 h1:51y8fJ/b1AaaBRJr4yWm96fPcuxSo0JcegXE3DaHQHw= +google.golang.org/api v0.188.0/go.mod h1:VR0d+2SIiWOYG3r/jdm7adPW9hI2aRv9ETOSCQ9Beag= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -1536,8 +1541,8 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gotest.tools/v3 v3.5.1 h1:EENdUnS3pdur5nybKYIh2Vfgc8IUNBjxDPSjtiJcOzU= -gotest.tools/v3 v3.5.1/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU= +gotest.tools/v3 v3.2.0 h1:I0DwBVMGAx26dttAj1BtJLAkVGncrkkUXfJLC4Flt/I= +gotest.tools/v3 v3.2.0/go.mod h1:Mcr9QNxkg0uMvy/YElmo4SpXgJKWgQvYrT7Kw5RzJ1A= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -1547,15 +1552,15 @@ honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9 honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= k8s.io/api v0.21.1/go.mod h1:FstGROTmsSHBarKc8bylzXih8BLNYTiS3TZcsoEDg2s= k8s.io/api v0.27.1/go.mod h1:z5g/BpAiD+f6AArpqNjkY+cji8ueZDU/WV1jcj5Jk4E= -k8s.io/api v0.31.2 h1:3wLBbL5Uom/8Zy98GRPXpJ254nEFpl+hwndmk9RwmL0= -k8s.io/api v0.31.2/go.mod h1:bWmGvrGPssSK1ljmLzd3pwCQ9MgoTsRCuK35u6SygUk= +k8s.io/api v0.31.3 h1:umzm5o8lFbdN/hIXbrK9oRpOproJO62CV1zqxXrLgk8= +k8s.io/api v0.31.3/go.mod h1:UJrkIp9pnMOI9K2nlL6vwpxRzzEX5sWgn8kGQe92kCE= k8s.io/apimachinery v0.21.1/go.mod h1:jbreFvJo3ov9rj7eWT7+sYiRx+qZuCYXwWT1bcDswPY= k8s.io/apimachinery v0.27.1/go.mod h1:5ikh59fK3AJ287GUvpUsryoMFtH9zj/ARfWCo3AyXTM= -k8s.io/apimachinery v0.31.2 h1:i4vUt2hPK56W6mlT7Ry+AO8eEsyxMD1U44NR22CLTYw= -k8s.io/apimachinery v0.31.2/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo= +k8s.io/apimachinery v0.31.3 h1:6l0WhcYgasZ/wk9ktLq5vLaoXJJr5ts6lkaQzgeYPq4= +k8s.io/apimachinery v0.31.3/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo= k8s.io/client-go v0.21.1/go.mod h1:/kEw4RgW+3xnBGzvp9IWxKSNA+lXn3A7AuH3gdOAzLs= -k8s.io/client-go v0.31.2 h1:Y2F4dxU5d3AQj+ybwSMqQnpZH9F30//1ObxOKlTI9yc= -k8s.io/client-go v0.31.2/go.mod h1:NPa74jSVR/+eez2dFsEIHNa+3o09vtNaWwWwb1qSxSs= +k8s.io/client-go v0.31.3 h1:CAlZuM+PH2cm+86LOBemaJI/lQ5linJ6UFxKX/SoG+4= +k8s.io/client-go v0.31.3/go.mod h1:2CgjPUTpv3fE5dNygAr2NcM8nhHzXvxB8KL5gYc3kJs= k8s.io/code-generator v0.21.1/go.mod h1:hUlps5+9QaTrKx+jiM4rmq7YmH8wPOIko64uZCHDh6Q= k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20201214224949-b6c5ce23f027/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= @@ -1569,13 +1574,13 @@ k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kube-openapi v0.0.0-20210305001622-591a79e4bda7/go.mod h1:wXW5VT87nVfh/iLV8FpR2uDvrFyomxbtb1KivDbvPTE= k8s.io/kube-openapi v0.0.0-20230308215209-15aac26d736a/go.mod h1:y5VtZWM9sHHc2ZodIH/6SHzXj+TPU5USoA8lcIeKEKY= -k8s.io/kube-openapi v0.0.0-20240430033511-f0e62f92d13f h1:0LQagt0gDpKqvIkAMPaRGcXawNMouPECM1+F9BVxEaM= -k8s.io/kube-openapi v0.0.0-20240430033511-f0e62f92d13f/go.mod h1:S9tOR0FxgyusSNR+MboCuiDpVWkAifZvaYI1Q2ubgro= +k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag= +k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340/go.mod h1:yD4MZYeKMBwQKVht279WycxKyM84kkAx2DPrTXaeb98= k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= k8s.io/utils v0.0.0-20230209194617-a36077c30491/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= -k8s.io/utils v0.0.0-20240821151609-f90d01438635 h1:2wThSvJoW/Ncn9TmQEYXRnevZXi2duqHWf5OX9S3zjI= -k8s.io/utils v0.0.0-20240821151609-f90d01438635/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 h1:pUdcCO1Lk/tbT5ztQWOBi5HBgbBP1J8+AsQnQCKsi8A= +k8s.io/utils v0.0.0-20240711033017-18e509b52bc8/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= diff --git a/comp/otelcol/collector-contrib/impl/manifest.yaml b/comp/otelcol/collector-contrib/impl/manifest.yaml index 6f878f6d19c84..952a5f97e483f 100644 --- a/comp/otelcol/collector-contrib/impl/manifest.yaml +++ b/comp/otelcol/collector-contrib/impl/manifest.yaml @@ -1,83 +1,83 @@ connectors: - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/connector/spanmetricsconnector - v0.114.0 + v0.115.0 dist: description: Datadog OpenTelemetry Collector module: github.com/DataDog/datadog-agent/comp/otelcol/collector-contrib/impl name: otelcol-contrib output_path: ./comp/otelcol/collector-contrib/impl - version: 0.114.0 + version: 0.115.0 exporters: -- gomod: go.opentelemetry.io/collector/exporter/debugexporter v0.114.0 -- gomod: go.opentelemetry.io/collector/exporter/nopexporter v0.114.0 -- gomod: go.opentelemetry.io/collector/exporter/otlpexporter v0.114.0 -- gomod: go.opentelemetry.io/collector/exporter/otlphttpexporter v0.114.0 +- gomod: go.opentelemetry.io/collector/exporter/debugexporter v0.115.0 +- gomod: go.opentelemetry.io/collector/exporter/nopexporter v0.115.0 +- gomod: go.opentelemetry.io/collector/exporter/otlpexporter v0.115.0 +- gomod: go.opentelemetry.io/collector/exporter/otlphttpexporter v0.115.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/sapmexporter - v0.114.0 + v0.115.0 extensions: -- gomod: go.opentelemetry.io/collector/extension/zpagesextension v0.114.0 +- gomod: go.opentelemetry.io/collector/extension/zpagesextension v0.115.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/healthcheckextension - v0.114.0 + v0.115.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/pprofextension - v0.114.0 + v0.115.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/dockerobserver - v0.114.0 + v0.115.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/ecsobserver - v0.114.0 + v0.115.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/ecstaskobserver - v0.114.0 + v0.115.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/hostobserver - v0.114.0 + v0.115.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/k8sobserver - v0.114.0 + v0.115.0 processors: -- gomod: go.opentelemetry.io/collector/processor/batchprocessor v0.114.0 -- gomod: go.opentelemetry.io/collector/processor/memorylimiterprocessor v0.114.0 +- gomod: go.opentelemetry.io/collector/processor/batchprocessor v0.115.0 +- gomod: go.opentelemetry.io/collector/processor/memorylimiterprocessor v0.115.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/attributesprocessor - v0.114.0 + v0.115.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/cumulativetodeltaprocessor - v0.114.0 + v0.115.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/filterprocessor - v0.114.0 + v0.115.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/groupbyattrsprocessor - v0.114.0 + v0.115.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/k8sattributesprocessor - v0.114.0 + v0.115.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/probabilisticsamplerprocessor - v0.114.0 + v0.115.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor - v0.114.0 + v0.115.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourceprocessor - v0.114.0 + v0.115.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/routingprocessor - v0.114.0 + v0.115.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/tailsamplingprocessor - v0.114.0 + v0.115.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor - v0.114.0 + v0.115.0 providers: -- gomod: go.opentelemetry.io/collector/confmap/provider/envprovider v1.20.0 -- gomod: go.opentelemetry.io/collector/confmap/provider/fileprovider v1.20.0 -- gomod: go.opentelemetry.io/collector/confmap/provider/httpprovider v1.20.0 -- gomod: go.opentelemetry.io/collector/confmap/provider/httpsprovider v1.20.0 -- gomod: go.opentelemetry.io/collector/confmap/provider/yamlprovider v1.20.0 +- gomod: go.opentelemetry.io/collector/confmap/provider/envprovider v1.21.0 +- gomod: go.opentelemetry.io/collector/confmap/provider/fileprovider v1.21.0 +- gomod: go.opentelemetry.io/collector/confmap/provider/httpprovider v1.21.0 +- gomod: go.opentelemetry.io/collector/confmap/provider/httpsprovider v1.21.0 +- gomod: go.opentelemetry.io/collector/confmap/provider/yamlprovider v1.21.0 receivers: -- gomod: go.opentelemetry.io/collector/receiver/nopreceiver v0.114.0 -- gomod: go.opentelemetry.io/collector/receiver/otlpreceiver v0.114.0 +- gomod: go.opentelemetry.io/collector/receiver/nopreceiver v0.115.0 +- gomod: go.opentelemetry.io/collector/receiver/otlpreceiver v0.115.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filelogreceiver - v0.114.0 + v0.115.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/fluentforwardreceiver - v0.114.0 + v0.115.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver - v0.114.0 + v0.115.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/jaegerreceiver - v0.114.0 + v0.115.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusreceiver - v0.114.0 + v0.115.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/receivercreator - v0.114.0 + v0.115.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/zipkinreceiver - v0.114.0 + v0.115.0 replaces: - github.com/googleapis/gnostic v0.5.6 => github.com/googleapis/gnostic v0.5.5 - github.com/docker/go-connections v0.4.1-0.20210727194412-58542c764a11 => github.com/docker/go-connections diff --git a/comp/otelcol/collector/impl-pipeline/flare_filler.go b/comp/otelcol/collector/impl-pipeline/flare_filler.go index 97378486d1a22..8c170152f98ca 100644 --- a/comp/otelcol/collector/impl-pipeline/flare_filler.go +++ b/comp/otelcol/collector/impl-pipeline/flare_filler.go @@ -5,8 +5,8 @@ //go:build otlp -// Package collectorimpl implements the collector component -package collectorimpl +// Package pipelineimpl implements the collector component +package pipelineimpl import ( "encoding/json" diff --git a/comp/otelcol/collector/impl-pipeline/flare_filler_test.go b/comp/otelcol/collector/impl-pipeline/flare_filler_test.go index ed98632b0f171..93075929746d4 100644 --- a/comp/otelcol/collector/impl-pipeline/flare_filler_test.go +++ b/comp/otelcol/collector/impl-pipeline/flare_filler_test.go @@ -6,8 +6,8 @@ //go:build test && otlp // +build test,otlp -// Package collectorimpl implements the collector component -package collectorimpl +// Package pipelineimpl implements the collector component +package pipelineimpl import ( "bytes" diff --git a/comp/otelcol/collector/impl-pipeline/no_otlp.go b/comp/otelcol/collector/impl-pipeline/no_otlp.go index c1e5ae7c03789..60f1295ee33aa 100644 --- a/comp/otelcol/collector/impl-pipeline/no_otlp.go +++ b/comp/otelcol/collector/impl-pipeline/no_otlp.go @@ -5,8 +5,8 @@ //go:build !otlp -// Package collectorimpl contains a no-op implementation of the collector -package collectorimpl +// Package pipelineimpl contains a no-op implementation of the collector +package pipelineimpl import ( collector "github.com/DataDog/datadog-agent/comp/otelcol/collector/def" diff --git a/comp/otelcol/collector/impl-pipeline/pipeline.go b/comp/otelcol/collector/impl-pipeline/pipeline.go index ab46ab875bcff..34cd92d133ed8 100644 --- a/comp/otelcol/collector/impl-pipeline/pipeline.go +++ b/comp/otelcol/collector/impl-pipeline/pipeline.go @@ -5,8 +5,8 @@ //go:build otlp -// Package collectorimpl implements the collector component -package collectorimpl +// Package pipelineimpl implements the collector component +package pipelineimpl import ( "context" diff --git a/comp/otelcol/collector/impl-pipeline/status.go b/comp/otelcol/collector/impl-pipeline/status.go index e3c0b01791bc1..a94bb76a0e5dd 100644 --- a/comp/otelcol/collector/impl-pipeline/status.go +++ b/comp/otelcol/collector/impl-pipeline/status.go @@ -5,7 +5,7 @@ //go:build otlp -package collectorimpl +package pipelineimpl import ( "embed" diff --git a/comp/otelcol/collector/impl-pipeline/status_test.go b/comp/otelcol/collector/impl-pipeline/status_test.go index 0e9b6a82e364b..8ae735534ed69 100644 --- a/comp/otelcol/collector/impl-pipeline/status_test.go +++ b/comp/otelcol/collector/impl-pipeline/status_test.go @@ -5,7 +5,7 @@ //go:build otlp && test -package collectorimpl +package pipelineimpl import ( "bytes" diff --git a/comp/otelcol/collector/impl/collector.go b/comp/otelcol/collector/impl/collector.go index 7da391585dd7d..5bc453ed970ef 100644 --- a/comp/otelcol/collector/impl/collector.go +++ b/comp/otelcol/collector/impl/collector.go @@ -139,7 +139,7 @@ func addFactories(reqs Requires, factories otelcol.Factories) { } var buildInfo = component.BuildInfo{ - Version: "v0.114.0", + Version: "v0.115.0", Command: filepath.Base(os.Args[0]), Description: "Datadog Agent OpenTelemetry Collector", } diff --git a/comp/otelcol/converter/README.md b/comp/otelcol/converter/README.md index 31c0c53f7176b..ad8c831ada147 100644 --- a/comp/otelcol/converter/README.md +++ b/comp/otelcol/converter/README.md @@ -1,8 +1,6 @@ # Converter Component -The converter: -- Enhances the user provided configuration -- Provides an API which returns the provided and enhanced configurations +The converter enhances the user provided configuration. ## Autoconfigure logic @@ -32,12 +30,6 @@ If `api_key` is unset, set to an empty string or set to a secret, the converter The converter will automatically set `datadogconnector` config `trace.span_name_as_resource_name` to true in any datadog connectors in your configuration. -## Provided and enhanced config - -`GetProvidedConf` and `GetEnhancedConf` return the string representation of the user provided and autoconfigured conf respectively. Currently, these APIs have two limitations: -- They do not redact sensitive data -- They do not provide the effective config (including defaults...etc) - ## Opting out of converter It is possible to opt out of the converter by setting env var `DD_OTELCOLLECTOR_CONVERTER_ENABLED` or agent config `otelcollector.converter.enabled` to `false` (`true` by default). Please note that by doing so, you are removing functionality including flare collection from otel-agent, health metrics from collector, or infra level tagging on your telemetry data. If you want to opt out of some components, you can disable all and add the components that you require manually: diff --git a/comp/otelcol/converter/def/go.mod b/comp/otelcol/converter/def/go.mod index a0cb90be3f0d1..eea27b7e5bbd3 100644 --- a/comp/otelcol/converter/def/go.mod +++ b/comp/otelcol/converter/def/go.mod @@ -2,7 +2,7 @@ module github.com/DataDog/datadog-agent/comp/otelcol/converter/def go 1.22.0 -require go.opentelemetry.io/collector/confmap v1.20.0 +require go.opentelemetry.io/collector/confmap v1.21.0 require ( github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect @@ -12,7 +12,6 @@ require ( github.com/knadh/koanf/v2 v2.1.2 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect - github.com/stretchr/testify v1.10.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/comp/otelcol/converter/def/go.sum b/comp/otelcol/converter/def/go.sum index 3a078b063a674..42f05aac3c99a 100644 --- a/comp/otelcol/converter/def/go.sum +++ b/comp/otelcol/converter/def/go.sum @@ -22,8 +22,8 @@ github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjR github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -go.opentelemetry.io/collector/confmap v1.20.0 h1:ARfOwmkKxFOud1njl03yAHQ30+uenlzqCO6LBYamDTE= -go.opentelemetry.io/collector/confmap v1.20.0/go.mod h1:DMpd9Ay/ffls3JoQBQ73vWeRsz1rNuLbwjo6WtjSQus= +go.opentelemetry.io/collector/confmap v1.21.0 h1:1tIcx2/Suwg8VhuPmQw87ba0ludPmumpFCFRZZa6RXA= +go.opentelemetry.io/collector/confmap v1.21.0/go.mod h1:Rrhs+MWoaP6AswZp+ReQ2VO9dfOfcUjdjiSHBsG+nec= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= diff --git a/comp/otelcol/converter/impl/go.mod b/comp/otelcol/converter/impl/go.mod index b321ff5db70ad..d89a5e3a0731e 100644 --- a/comp/otelcol/converter/impl/go.mod +++ b/comp/otelcol/converter/impl/go.mod @@ -42,12 +42,12 @@ require ( github.com/DataDog/datadog-agent/comp/core/config v0.56.2 github.com/DataDog/datadog-agent/comp/otelcol/converter/def v0.56.0-rc.3 github.com/stretchr/testify v1.10.0 - go.opentelemetry.io/collector/confmap v1.20.0 - go.opentelemetry.io/collector/confmap/provider/envprovider v1.20.0 - go.opentelemetry.io/collector/confmap/provider/fileprovider v1.20.0 - go.opentelemetry.io/collector/confmap/provider/httpprovider v1.20.0 - go.opentelemetry.io/collector/confmap/provider/httpsprovider v1.20.0 - go.opentelemetry.io/collector/confmap/provider/yamlprovider v1.20.0 + go.opentelemetry.io/collector/confmap v1.21.0 + go.opentelemetry.io/collector/confmap/provider/envprovider v1.21.0 + go.opentelemetry.io/collector/confmap/provider/fileprovider v1.21.0 + go.opentelemetry.io/collector/confmap/provider/httpprovider v1.21.0 + go.opentelemetry.io/collector/confmap/provider/httpsprovider v1.21.0 + go.opentelemetry.io/collector/confmap/provider/yamlprovider v1.21.0 go.uber.org/zap v1.27.0 ) @@ -69,28 +69,30 @@ require ( github.com/DataDog/datadog-agent/pkg/util/filesystem v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/fxutil v0.56.2 // indirect github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.59.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/log v0.59.1 // indirect github.com/DataDog/datadog-agent/pkg/util/optional v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/pointer v0.59.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.1 // indirect 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.0 // indirect - github.com/DataDog/viper v1.13.5 // 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.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 github.com/hashicorp/hcl v1.0.1-vault-5 // indirect - github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 // indirect + github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 // indirect github.com/knadh/koanf/maps v0.1.1 // indirect github.com/knadh/koanf/providers/confmap v0.1.0 // indirect github.com/knadh/koanf/v2 v2.1.2 // indirect - github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c // indirect + github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c // indirect @@ -98,9 +100,8 @@ require ( github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect 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/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // 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 @@ -113,9 +114,9 @@ require ( go.uber.org/dig v1.18.0 // indirect go.uber.org/fx v1.23.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f // indirect - golang.org/x/sys v0.27.0 // indirect - golang.org/x/text v0.20.0 // indirect + golang.org/x/exp v0.0.0-20241210194714-1829a127f884 // indirect + golang.org/x/sys v0.28.0 // indirect + golang.org/x/text v0.21.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/comp/otelcol/converter/impl/go.sum b/comp/otelcol/converter/impl/go.sum index 6a6b8e8abfdf0..e3241a18e3ad4 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= @@ -72,7 +74,6 @@ github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/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= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -87,8 +88,8 @@ github.com/grpc-ecosystem/grpc-gateway v1.13.0/go.mod h1:8XEsbTttt/W+VvjtQhLACqC github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/hcl v1.0.1-vault-5 h1:kI3hhbbyzr4dldA8UdTb7ZlVVlI2DACdCfz31RPDgJM= github.com/hashicorp/hcl v1.0.1-vault-5/go.mod h1:XYhtn6ijBSAj6n4YqAaf7RBPS4I06AItNorpy+MoQNM= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 h1:S4qyfL2sEm5Budr4KVMyEniCy+PbS55651I/a+Kn/NQ= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb h1:PGufWXXDq9yaev6xX1YQauaO1MV90e6Mpoq1I7Lz/VM= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= @@ -116,8 +117,8 @@ 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-20220913051719-115f729f3c8c h1:VtwQ41oftZwlMnOEbMWQtSEUgU64U4s+GHk7hZK+jtY= -github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c/go.mod h1:JKx41uQRwqlTZabZc+kILPrO/3jlKnQ2Z8b7YiVw5cE= +github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a h1:3Bm7EwfUQUvhNeKIkUct/gl9eod1TcXuj8stxvi/GoI= +github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a/go.mod h1:ilwx/Dta8jXAgpFYFvSWEMwxmbWXyiUHkd5FwyKhb5k= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= @@ -148,8 +149,8 @@ github.com/pkg/errors v0.8.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-20220216144756-c35f1ee13d7c h1:NRoLoZvkBTKvR5gQLgA3e0hqjkY9u1wm+iOL45VN/qI= -github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 h1:o4JXh1EVt9k/+g42oCprj/FisM4qX9L3sZB3upGN2ZU= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= @@ -181,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= @@ -230,18 +227,18 @@ github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1: github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0= github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.opentelemetry.io/collector/confmap v1.20.0 h1:ARfOwmkKxFOud1njl03yAHQ30+uenlzqCO6LBYamDTE= -go.opentelemetry.io/collector/confmap v1.20.0/go.mod h1:DMpd9Ay/ffls3JoQBQ73vWeRsz1rNuLbwjo6WtjSQus= -go.opentelemetry.io/collector/confmap/provider/envprovider v1.20.0 h1:I3xDecFXJVZBo5zJS7Y5SWBjF22XDWGZJgwotiwA5QM= -go.opentelemetry.io/collector/confmap/provider/envprovider v1.20.0/go.mod h1:CF0l8V8MNv+Wag8UkqObotFnlhMzdTFuk4/6kylKwYU= -go.opentelemetry.io/collector/confmap/provider/fileprovider v1.20.0 h1:wWxvQ7wj+1O9yDGM5m1HPEz8FJewAHAUWadAAi0KVbM= -go.opentelemetry.io/collector/confmap/provider/fileprovider v1.20.0/go.mod h1:/5HWIPjGYk8IUurs1CZUSjGaSsaQyJsfR8+Zs5rGJ6Y= -go.opentelemetry.io/collector/confmap/provider/httpprovider v1.20.0 h1:YS1nB8vDoCS8IlfX5OP3QGS90y/hfflwZ7CoPQcAOlU= -go.opentelemetry.io/collector/confmap/provider/httpprovider v1.20.0/go.mod h1:aV4UfkgcJ3eyXvfd3m694omN++1c96Joitab+YL6Xks= -go.opentelemetry.io/collector/confmap/provider/httpsprovider v1.20.0 h1:0BJHAeKFb46FCT0ehOmmGs0v31cGuAh4DIic07J71NU= -go.opentelemetry.io/collector/confmap/provider/httpsprovider v1.20.0/go.mod h1:gBiweuH4EDuPh9mpLCB/wPZzostdA+gKY8hABwbotQk= -go.opentelemetry.io/collector/confmap/provider/yamlprovider v1.20.0 h1:jSXTojCPI6Xr98m99nF7qbQFnw3INLEOHRcqcHS+lak= -go.opentelemetry.io/collector/confmap/provider/yamlprovider v1.20.0/go.mod h1:Pu95O2JE3R+0BBTbe4gpAC8ms3w6FbICHJw3WvGWrjs= +go.opentelemetry.io/collector/confmap v1.21.0 h1:1tIcx2/Suwg8VhuPmQw87ba0ludPmumpFCFRZZa6RXA= +go.opentelemetry.io/collector/confmap v1.21.0/go.mod h1:Rrhs+MWoaP6AswZp+ReQ2VO9dfOfcUjdjiSHBsG+nec= +go.opentelemetry.io/collector/confmap/provider/envprovider v1.21.0 h1:YLf++Z8CMp86AanfOCWUiE7vKbb1kSjgC3a9VJoxbD4= +go.opentelemetry.io/collector/confmap/provider/envprovider v1.21.0/go.mod h1:aSWLYcmgZZJDNtWN1M8JKQuehoGgOxibl1KuvKTar4M= +go.opentelemetry.io/collector/confmap/provider/fileprovider v1.21.0 h1:+zukkM+3l426iGoJkXTpLB2Z8QnZFu26TkGPjh5Rn/4= +go.opentelemetry.io/collector/confmap/provider/fileprovider v1.21.0/go.mod h1:BXBpQhF3n4CNLYO2n/mWZPd2U9ekpbLXLRGZrun1VfI= +go.opentelemetry.io/collector/confmap/provider/httpprovider v1.21.0 h1:NYYGM+SgIlTuNGjd8eGzDr8DkvOe4q7cXon8djF9yyI= +go.opentelemetry.io/collector/confmap/provider/httpprovider v1.21.0/go.mod h1:XRYbuwqq1awFuNhLDUv4aSvn6MzqX+abcevx1O+APJI= +go.opentelemetry.io/collector/confmap/provider/httpsprovider v1.21.0 h1:2EEUI2DzA2DvrvCImMWRSNqIHdRJ6+qbgvZL44Zb2ac= +go.opentelemetry.io/collector/confmap/provider/httpsprovider v1.21.0/go.mod h1:axezjjQWY4kZc5pr/+wOKAuqSYMhea/tWzP5S30h+dc= +go.opentelemetry.io/collector/confmap/provider/yamlprovider v1.21.0 h1:P3Q9RytCMY76ORPCnkkjOa4fkuFqmZiQRor+F/nPlYE= +go.opentelemetry.io/collector/confmap/provider/yamlprovider v1.21.0/go.mod h1:xhYhHK3yLQ78tsoaKPIGUfFulgy961ImOe2gATH3RQc= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= @@ -265,8 +262,8 @@ golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnf golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f h1:XdNn9LlyWAhLVp6P/i8QYBW+hlyhrhei9uErw2B5GJo= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f/go.mod h1:D5SMRVC3C2/4+F/DB1wZsLRnSNimn2Sp/NPsCrsv8ak= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884 h1:Y/Mj/94zIQQGHVSv1tTtQBDaQaJe62U9bkDZKKyhPCU= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -303,11 +300,11 @@ golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20220829200755-d48e67d00261/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.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/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= -golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= diff --git a/comp/otelcol/ddflareextension/README.md b/comp/otelcol/ddflareextension/README.md index 13f5902877c4e..c54027041c70f 100644 --- a/comp/otelcol/ddflareextension/README.md +++ b/comp/otelcol/ddflareextension/README.md @@ -32,7 +32,7 @@ The port is the location in which the otel-agent will expose the data required t The flare will collect both the provided collector config and the enhanced config (enhanced via [converter](../converter/README.md)). -The provided collector configs can be found in `otel/otel-flare/customer.cfg` and the enhanced config can be found in `otel/otel-flare/customer.cfg`. +The provided collector configs can be found in `otel/otel-flare/customer.cfg` and the enhanced config can be found in `otel/otel-flare/runtime.cfg`. ### Environment variables diff --git a/comp/otelcol/ddflareextension/def/go.mod b/comp/otelcol/ddflareextension/def/go.mod index bda6d4d0adf21..2160a62e2f369 100644 --- a/comp/otelcol/ddflareextension/def/go.mod +++ b/comp/otelcol/ddflareextension/def/go.mod @@ -2,24 +2,23 @@ module github.com/DataDog/datadog-agent/comp/otelcol/ddflareextension/def go 1.22.0 -require go.opentelemetry.io/collector/extension v0.114.0 +require go.opentelemetry.io/collector/extension v0.115.0 require ( github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect - github.com/stretchr/testify v1.10.0 // indirect - go.opentelemetry.io/collector/component v0.114.0 // indirect - go.opentelemetry.io/collector/config/configtelemetry v0.114.0 // indirect - go.opentelemetry.io/collector/pdata v1.20.0 // indirect + go.opentelemetry.io/collector/component v0.115.0 // indirect + go.opentelemetry.io/collector/config/configtelemetry v0.115.0 // indirect + go.opentelemetry.io/collector/pdata v1.21.0 // indirect go.opentelemetry.io/otel v1.32.0 // indirect go.opentelemetry.io/otel/metric v1.32.0 // indirect go.opentelemetry.io/otel/trace v1.32.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect - golang.org/x/net v0.31.0 // indirect - golang.org/x/sys v0.27.0 // indirect - golang.org/x/text v0.20.0 // indirect + golang.org/x/net v0.33.0 // indirect + golang.org/x/sys v0.28.0 // indirect + golang.org/x/text v0.21.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect google.golang.org/grpc v1.67.1 // indirect google.golang.org/protobuf v1.35.2 // indirect diff --git a/comp/otelcol/ddflareextension/def/go.sum b/comp/otelcol/ddflareextension/def/go.sum index 2285317ce7f89..e8348caae0f44 100644 --- a/comp/otelcol/ddflareextension/def/go.sum +++ b/comp/otelcol/ddflareextension/def/go.sum @@ -16,14 +16,14 @@ github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOf github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -go.opentelemetry.io/collector/component v0.114.0 h1:SVGbm5LvHGSTEDv7p92oPuBgK5tuiWR82I9+LL4TtBE= -go.opentelemetry.io/collector/component v0.114.0/go.mod h1:MLxtjZ6UVHjDxSdhGLuJfHBHvfl1iT/Y7IaQPD24Eww= -go.opentelemetry.io/collector/config/configtelemetry v0.114.0 h1:kjLeyrumge6wsX6ZIkicdNOlBXaEyW2PI2ZdVXz/rzY= -go.opentelemetry.io/collector/config/configtelemetry v0.114.0/go.mod h1:R0MBUxjSMVMIhljuDHWIygzzJWQyZHXXWIgQNxcFwhc= -go.opentelemetry.io/collector/extension v0.114.0 h1:9Qb92y8hD2WDC5aMDoj4JNQN+/5BQYJWPUPzLXX+iGw= -go.opentelemetry.io/collector/extension v0.114.0/go.mod h1:Yk2/1ptVgfTr12t+22v93nYJpioP14pURv2YercSzU0= -go.opentelemetry.io/collector/pdata v1.20.0 h1:ePcwt4bdtISP0loHaE+C9xYoU2ZkIvWv89Fob16o9SM= -go.opentelemetry.io/collector/pdata v1.20.0/go.mod h1:Ox1YVLe87cZDB/TL30i4SUz1cA5s6AM6SpFMfY61ICs= +go.opentelemetry.io/collector/component v0.115.0 h1:iLte1oCiXzjiCnaOBKdsXacfFiECecpWxW3/LeriMoo= +go.opentelemetry.io/collector/component v0.115.0/go.mod h1:oIUFiH7w1eOimdeYhFI+gAIxYSiLDocKVJ0PTvX7d6s= +go.opentelemetry.io/collector/config/configtelemetry v0.115.0 h1:U07FinCDop+r2RjWQ3aP9ZWONC7r7kQIp1GkXQi6nsI= +go.opentelemetry.io/collector/config/configtelemetry v0.115.0/go.mod h1:SlBEwQg0qly75rXZ6W1Ig8jN25KBVBkFIIAUI1GiAAE= +go.opentelemetry.io/collector/extension v0.115.0 h1:/cBb8AUdD0KMWC6V3lvCC16eP9Fg0wd1Upcp5rgvuGI= +go.opentelemetry.io/collector/extension v0.115.0/go.mod h1:HI7Ak6loyi6ZrZPsQJW1OO1wbaAW8OqXLFNQlTZnreQ= +go.opentelemetry.io/collector/pdata v1.21.0 h1:PG+UbiFMJ35X/WcAR7Rf/PWmWtRdW0aHlOidsR6c5MA= +go.opentelemetry.io/collector/pdata v1.21.0/go.mod h1:GKb1/zocKJMvxKbS+sl0W85lxhYBTFJ6h6I1tphVyDU= go.opentelemetry.io/otel v1.32.0 h1:WnBN+Xjcteh0zdk01SVqV55d/m62NJLJdIyb4y/WO5U= go.opentelemetry.io/otel v1.32.0/go.mod h1:00DCVSB0RQcnzlwyTfqtxSm+DRr9hpYrHjNGiBHVQIg= go.opentelemetry.io/otel/metric v1.32.0 h1:xV2umtmNcThh2/a/aCP+h64Xx5wsj8qqnkYZktzNa0M= @@ -45,20 +45,20 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.31.0 h1:68CPQngjLL0r2AlUKiSxtQFKvzRVbnzLwMUn5SzcLHo= -golang.org/x/net v0.31.0/go.mod h1:P4fl1q7dY2hnZFxEk4pPSkDHF+QqjitcnDjUQyMM+pM= +golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= +golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.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/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= -golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= diff --git a/comp/otelcol/ddflareextension/impl/go.mod b/comp/otelcol/ddflareextension/impl/go.mod index 6c75776d13338..2c7558943396f 100644 --- a/comp/otelcol/ddflareextension/impl/go.mod +++ b/comp/otelcol/ddflareextension/impl/go.mod @@ -13,6 +13,7 @@ replace ( github.com/DataDog/datadog-agent/comp/core/log/mock => ../../../core/log/mock github.com/DataDog/datadog-agent/comp/core/secrets => ../../../core/secrets github.com/DataDog/datadog-agent/comp/core/status => ../../../core/status + github.com/DataDog/datadog-agent/comp/core/tagger/origindetection => ../../../core/tagger/origindetection github.com/DataDog/datadog-agent/comp/core/tagger/tags => ../../../core/tagger/tags github.com/DataDog/datadog-agent/comp/core/tagger/types => ../../../core/tagger/types github.com/DataDog/datadog-agent/comp/core/tagger/utils => ../../../core/tagger/utils @@ -110,61 +111,62 @@ require ( github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/processor/infraattributesprocessor v0.59.0 github.com/DataDog/datadog-agent/pkg/api v0.59.0 github.com/DataDog/datadog-agent/pkg/config/mock v0.59.0 - github.com/DataDog/datadog-agent/pkg/version v0.59.0 + github.com/DataDog/datadog-agent/pkg/version v0.59.1 github.com/google/go-cmp v0.6.0 github.com/gorilla/mux v1.8.1 - github.com/open-telemetry/opentelemetry-collector-contrib/connector/datadogconnector v0.114.0 - github.com/open-telemetry/opentelemetry-collector-contrib/connector/spanmetricsconnector v0.114.0 - github.com/open-telemetry/opentelemetry-collector-contrib/extension/healthcheckextension v0.114.0 - github.com/open-telemetry/opentelemetry-collector-contrib/extension/pprofextension v0.114.0 - github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor v0.114.0 - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusreceiver v0.114.0 + github.com/open-telemetry/opentelemetry-collector-contrib/connector/datadogconnector v0.115.0 + github.com/open-telemetry/opentelemetry-collector-contrib/connector/spanmetricsconnector v0.115.0 + github.com/open-telemetry/opentelemetry-collector-contrib/extension/healthcheckextension v0.115.0 + github.com/open-telemetry/opentelemetry-collector-contrib/extension/pprofextension v0.115.0 + github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor v0.115.0 + github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusreceiver v0.115.0 github.com/stretchr/testify v1.10.0 - go.opentelemetry.io/collector/component v0.114.0 - go.opentelemetry.io/collector/component/componentstatus v0.114.0 - go.opentelemetry.io/collector/component/componenttest v0.114.0 - go.opentelemetry.io/collector/config/confighttp v0.114.0 - go.opentelemetry.io/collector/confmap v1.20.0 - go.opentelemetry.io/collector/confmap/provider/envprovider v1.20.0 - go.opentelemetry.io/collector/confmap/provider/fileprovider v1.20.0 - go.opentelemetry.io/collector/confmap/provider/httpprovider v1.20.0 - go.opentelemetry.io/collector/confmap/provider/httpsprovider v1.20.0 - go.opentelemetry.io/collector/confmap/provider/yamlprovider v1.20.0 - go.opentelemetry.io/collector/connector v0.114.0 - go.opentelemetry.io/collector/exporter v0.114.0 - go.opentelemetry.io/collector/exporter/otlpexporter v0.114.0 - go.opentelemetry.io/collector/exporter/otlphttpexporter v0.114.0 - go.opentelemetry.io/collector/extension v0.114.0 - go.opentelemetry.io/collector/extension/extensioncapabilities v0.114.0 - go.opentelemetry.io/collector/extension/zpagesextension v0.114.0 - go.opentelemetry.io/collector/otelcol v0.114.0 - go.opentelemetry.io/collector/processor v0.114.0 - go.opentelemetry.io/collector/processor/batchprocessor v0.114.0 - go.opentelemetry.io/collector/receiver v0.114.0 - go.opentelemetry.io/collector/receiver/nopreceiver v0.114.0 - go.opentelemetry.io/collector/receiver/otlpreceiver v0.114.0 + go.opentelemetry.io/collector/component v0.115.0 + go.opentelemetry.io/collector/component/componentstatus v0.115.0 + go.opentelemetry.io/collector/component/componenttest v0.115.0 + go.opentelemetry.io/collector/config/confighttp v0.115.0 + go.opentelemetry.io/collector/confmap v1.21.0 + go.opentelemetry.io/collector/confmap/provider/envprovider v1.21.0 + go.opentelemetry.io/collector/confmap/provider/fileprovider v1.21.0 + go.opentelemetry.io/collector/confmap/provider/httpprovider v1.21.0 + go.opentelemetry.io/collector/confmap/provider/httpsprovider v1.21.0 + go.opentelemetry.io/collector/confmap/provider/yamlprovider v1.21.0 + go.opentelemetry.io/collector/connector v0.115.0 + go.opentelemetry.io/collector/exporter v0.115.0 + go.opentelemetry.io/collector/exporter/otlpexporter v0.115.0 + go.opentelemetry.io/collector/exporter/otlphttpexporter v0.115.0 + go.opentelemetry.io/collector/extension v0.115.0 + go.opentelemetry.io/collector/extension/extensioncapabilities v0.115.0 + go.opentelemetry.io/collector/extension/zpagesextension v0.115.0 + go.opentelemetry.io/collector/otelcol v0.115.0 + go.opentelemetry.io/collector/processor v0.115.0 + go.opentelemetry.io/collector/processor/batchprocessor v0.115.0 + go.opentelemetry.io/collector/receiver v0.115.0 + go.opentelemetry.io/collector/receiver/nopreceiver v0.115.0 + go.opentelemetry.io/collector/receiver/otlpreceiver v0.115.0 go.uber.org/zap v1.27.0 gopkg.in/yaml.v2 v2.4.0 ) -require go.opentelemetry.io/collector/extension/extensiontest v0.114.0 // indirect +require go.opentelemetry.io/collector/extension/extensiontest v0.115.0 // indirect require ( + github.com/DataDog/datadog-agent/comp/core/tagger/origindetection v0.0.0-20241217122454-175edb6c74f2 // indirect github.com/knadh/koanf/maps v0.1.1 // indirect github.com/knadh/koanf/providers/confmap v0.1.0 // indirect github.com/moby/sys/userns v0.1.0 // indirect github.com/pierrec/lz4/v4 v4.1.21 // indirect - go.opentelemetry.io/collector/connector/connectortest v0.114.0 // indirect - go.opentelemetry.io/collector/consumer/consumererror v0.114.0 // indirect - go.opentelemetry.io/collector/consumer/consumererror/consumererrorprofiles v0.114.0 // indirect - go.opentelemetry.io/collector/exporter/exporterhelper/exporterhelperprofiles v0.114.0 // indirect - go.opentelemetry.io/collector/exporter/exportertest v0.114.0 // indirect - go.opentelemetry.io/collector/internal/fanoutconsumer v0.114.0 // indirect - go.opentelemetry.io/collector/internal/sharedcomponent v0.114.0 // indirect - go.opentelemetry.io/collector/pipeline/pipelineprofiles v0.114.0 // indirect - go.opentelemetry.io/collector/processor/processortest v0.114.0 // indirect - go.opentelemetry.io/collector/receiver/receivertest v0.114.0 // indirect + go.opentelemetry.io/collector/connector/connectortest v0.115.0 // indirect + go.opentelemetry.io/collector/consumer/consumererror v0.115.0 // indirect + go.opentelemetry.io/collector/consumer/consumererror/consumererrorprofiles v0.115.0 // indirect + go.opentelemetry.io/collector/exporter/exporterhelper/exporterhelperprofiles v0.115.0 // indirect + go.opentelemetry.io/collector/exporter/exportertest v0.115.0 // indirect + go.opentelemetry.io/collector/internal/fanoutconsumer v0.115.0 // indirect + go.opentelemetry.io/collector/internal/sharedcomponent v0.115.0 // indirect + go.opentelemetry.io/collector/pipeline/pipelineprofiles v0.115.0 // indirect + go.opentelemetry.io/collector/processor/processortest v0.115.0 // indirect + go.opentelemetry.io/collector/receiver/receivertest v0.115.0 // indirect go.opentelemetry.io/contrib/bridges/otelzap v0.6.0 // indirect ) @@ -180,7 +182,7 @@ require ( github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 // indirect github.com/Code-Hex/go-generics-cache v1.5.1 // indirect - github.com/DataDog/agent-payload/v5 v5.0.137 // indirect + github.com/DataDog/agent-payload/v5 v5.0.138 // indirect github.com/DataDog/datadog-agent/comp/core/config v0.59.0 // indirect github.com/DataDog/datadog-agent/comp/core/flare/builder v0.59.0 // indirect github.com/DataDog/datadog-agent/comp/core/flare/types v0.59.0 // indirect @@ -251,29 +253,29 @@ require ( github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/http v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/json v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/log v0.59.1 // indirect github.com/DataDog/datadog-agent/pkg/util/log/setup v0.58.0-devel // indirect github.com/DataDog/datadog-agent/pkg/util/optional v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/pointer v0.59.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.1 // indirect github.com/DataDog/datadog-agent/pkg/util/sort v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/pkg/util/startstop v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/statstracker v0.59.0 // indirect 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.0 // indirect - github.com/DataDog/datadog-api-client-go/v2 v2.31.0 // indirect - github.com/DataDog/datadog-go/v5 v5.5.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/winutil v0.59.1 // indirect + github.com/DataDog/datadog-api-client-go/v2 v2.33.0 // indirect + github.com/DataDog/datadog-go/v5 v5.6.0 // indirect github.com/DataDog/dd-sensitive-data-scanner/sds-go/go v0.0.0-20240816154533-f7f9beb53a42 // indirect github.com/DataDog/go-sqllexer v0.0.17 // indirect github.com/DataDog/go-tuf v1.1.0-0.5.2 // indirect github.com/DataDog/mmh3 v0.0.0-20210722141835-012dc69a9e49 // indirect - 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/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/opentelemetry-mapping-go/pkg/otlp/attributes v0.22.0 // indirect + github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.22.0 // indirect + github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.22.0 // indirect + github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.22.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 @@ -358,7 +360,7 @@ require ( github.com/hashicorp/hcl v1.0.1-vault-5 // indirect github.com/hashicorp/nomad/api v0.0.0-20240717122358-3d93bd3778f3 // indirect github.com/hashicorp/serf v0.10.1 // indirect - github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 // indirect + github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb // indirect github.com/hetznercloud/hcloud-go/v2 v2.10.2 // indirect github.com/iancoleman/strcase v0.3.0 // indirect github.com/imdario/mergo v0.3.16 // indirect @@ -377,7 +379,7 @@ require ( github.com/kylelemons/godebug v1.1.0 // indirect github.com/lightstep/go-expohisto v1.0.0 // indirect github.com/linode/linodego v1.37.0 // indirect - github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c // indirect + github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a // indirect github.com/magefile/mage v1.15.0 // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mailru/easyjson v0.7.7 // indirect @@ -397,15 +399,15 @@ require ( github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f // indirect github.com/onsi/ginkgo/v2 v2.20.2 // indirect github.com/onsi/gomega v1.34.1 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.114.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.114.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter v0.114.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/internal/pdatautil v0.114.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/datadog v0.114.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl v0.114.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.114.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/resourcetotelemetry v0.114.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheus v0.114.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.115.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.115.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter v0.115.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/internal/pdatautil v0.115.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/datadog v0.115.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl v0.115.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.115.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/resourcetotelemetry v0.115.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheus v0.115.0 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect github.com/opencontainers/image-spec v1.1.0 // indirect github.com/opencontainers/runtime-spec v1.2.0 // indirect @@ -418,7 +420,7 @@ require ( github.com/pkg/errors v0.9.1 // indirect github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // 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/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect github.com/prometheus/client_golang v1.20.5 // indirect github.com/prometheus/client_model v0.6.1 // indirect github.com/prometheus/common v0.60.1 // indirect @@ -429,9 +431,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.10 // 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 @@ -450,33 +450,33 @@ require ( github.com/x448/float16 v0.8.4 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect go.opencensus.io v0.24.0 // indirect - go.opentelemetry.io/collector v0.114.0 // indirect - go.opentelemetry.io/collector/client v1.20.0 // indirect - go.opentelemetry.io/collector/config/configauth v0.114.0 // indirect - go.opentelemetry.io/collector/config/configcompression v1.20.0 // indirect - go.opentelemetry.io/collector/config/configgrpc v0.114.0 // indirect - go.opentelemetry.io/collector/config/confignet v1.20.0 // indirect - go.opentelemetry.io/collector/config/configopaque v1.20.0 // indirect - go.opentelemetry.io/collector/config/configretry v1.20.0 // indirect - go.opentelemetry.io/collector/config/configtelemetry v0.114.0 // indirect - go.opentelemetry.io/collector/config/configtls v1.20.0 // indirect - go.opentelemetry.io/collector/config/internal v0.114.0 // indirect - go.opentelemetry.io/collector/connector/connectorprofiles v0.114.0 // indirect - go.opentelemetry.io/collector/consumer v0.114.0 // indirect - go.opentelemetry.io/collector/consumer/consumerprofiles v0.114.0 // indirect - go.opentelemetry.io/collector/consumer/consumertest v0.114.0 // indirect - go.opentelemetry.io/collector/exporter/exporterprofiles v0.114.0 // indirect - go.opentelemetry.io/collector/extension/auth v0.114.0 // indirect - go.opentelemetry.io/collector/extension/experimental/storage v0.114.0 // indirect - go.opentelemetry.io/collector/featuregate v1.20.0 // indirect - go.opentelemetry.io/collector/pdata v1.20.0 // indirect - go.opentelemetry.io/collector/pdata/pprofile v0.114.0 // indirect - go.opentelemetry.io/collector/pdata/testdata v0.114.0 // indirect - go.opentelemetry.io/collector/pipeline v0.114.0 // indirect - go.opentelemetry.io/collector/processor/processorprofiles v0.114.0 // indirect - go.opentelemetry.io/collector/receiver/receiverprofiles v0.114.0 // indirect - go.opentelemetry.io/collector/semconv v0.114.0 // indirect - go.opentelemetry.io/collector/service v0.114.0 // indirect + go.opentelemetry.io/collector v0.115.0 // 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 + go.opentelemetry.io/collector/config/configgrpc v0.115.0 // indirect + go.opentelemetry.io/collector/config/confignet v1.21.0 // indirect + go.opentelemetry.io/collector/config/configopaque v1.21.0 // indirect + go.opentelemetry.io/collector/config/configretry v1.21.0 // indirect + go.opentelemetry.io/collector/config/configtelemetry v0.115.0 // indirect + go.opentelemetry.io/collector/config/configtls v1.21.0 // indirect + go.opentelemetry.io/collector/config/internal v0.115.0 // indirect + go.opentelemetry.io/collector/connector/connectorprofiles v0.115.0 // indirect + go.opentelemetry.io/collector/consumer v1.21.0 // indirect + go.opentelemetry.io/collector/consumer/consumerprofiles v0.115.0 // indirect + go.opentelemetry.io/collector/consumer/consumertest v0.115.0 // indirect + go.opentelemetry.io/collector/exporter/exporterprofiles v0.115.0 // indirect + go.opentelemetry.io/collector/extension/auth v0.115.0 // indirect + go.opentelemetry.io/collector/extension/experimental/storage v0.115.0 // indirect + go.opentelemetry.io/collector/featuregate v1.21.0 // indirect + go.opentelemetry.io/collector/pdata v1.21.0 // indirect + go.opentelemetry.io/collector/pdata/pprofile v0.115.0 // indirect + go.opentelemetry.io/collector/pdata/testdata v0.115.0 // indirect + go.opentelemetry.io/collector/pipeline v0.115.0 // indirect + go.opentelemetry.io/collector/processor/processorprofiles v0.115.0 // indirect + go.opentelemetry.io/collector/receiver/receiverprofiles v0.115.0 // indirect + go.opentelemetry.io/collector/semconv v0.115.0 // indirect + go.opentelemetry.io/collector/service v0.115.0 // indirect go.opentelemetry.io/contrib/config v0.10.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.56.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.56.0 // indirect @@ -504,17 +504,17 @@ require ( go.uber.org/dig v1.18.0 // indirect go.uber.org/fx v1.23.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.29.0 // indirect - golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f // indirect + golang.org/x/crypto v0.31.0 // indirect + golang.org/x/exp v0.0.0-20241210194714-1829a127f884 // indirect golang.org/x/mod v0.22.0 // indirect - golang.org/x/net v0.31.0 // indirect + golang.org/x/net v0.33.0 // indirect golang.org/x/oauth2 v0.23.0 // indirect - golang.org/x/sync v0.9.0 // indirect - golang.org/x/sys v0.27.0 // indirect - golang.org/x/term v0.26.0 // indirect - golang.org/x/text v0.20.0 // indirect + golang.org/x/sync v0.10.0 // indirect + golang.org/x/sys v0.28.0 // indirect + golang.org/x/term v0.27.0 // indirect + golang.org/x/text v0.21.0 // indirect golang.org/x/time v0.8.0 // indirect - golang.org/x/tools v0.27.0 // indirect + golang.org/x/tools v0.28.0 // indirect gonum.org/v1/gonum v0.15.1 // indirect google.golang.org/api v0.199.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20241104194629-dd2ea8efbc28 // indirect @@ -525,9 +525,9 @@ require ( gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect gotest.tools/v3 v3.5.1 // indirect - k8s.io/api v0.31.2 // indirect - k8s.io/apimachinery v0.31.2 // indirect - k8s.io/client-go v0.31.2 // indirect + k8s.io/api v0.31.3 // indirect + k8s.io/apimachinery v0.31.3 // indirect + k8s.io/client-go v0.31.3 // indirect k8s.io/klog/v2 v2.130.1 // indirect k8s.io/kube-openapi v0.0.0-20240430033511-f0e62f92d13f // indirect k8s.io/utils v0.0.0-20240821151609-f90d01438635 // indirect diff --git a/comp/otelcol/ddflareextension/impl/go.sum b/comp/otelcol/ddflareextension/impl/go.sum index aa6426785ee4b..f1d97d93368db 100644 --- a/comp/otelcol/ddflareextension/impl/go.sum +++ b/comp/otelcol/ddflareextension/impl/go.sum @@ -59,15 +59,15 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03 github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/Code-Hex/go-generics-cache v1.5.1 h1:6vhZGc5M7Y/YD8cIUcY8kcuQLB4cHR7U+0KMqAA0KcU= github.com/Code-Hex/go-generics-cache v1.5.1/go.mod h1:qxcC9kRVrct9rHeiYpFWSoW1vxyillCVzX13KZG8dl4= -github.com/DataDog/agent-payload/v5 v5.0.137 h1:nV02RrYj6AwlQBGIEv6yG23CuxGtG0YWoFZAVE6vwxY= -github.com/DataDog/agent-payload/v5 v5.0.137/go.mod h1:lxh9lb5xYrBXjblpIWYUi4deJqVbkIfkjwesi5nskDc= +github.com/DataDog/agent-payload/v5 v5.0.138 h1:Wg7hmWuoLC/o0X3zZ+uGcfRHPyaytljudgSY9O59zjc= +github.com/DataDog/agent-payload/v5 v5.0.138/go.mod h1:lxh9lb5xYrBXjblpIWYUi4deJqVbkIfkjwesi5nskDc= github.com/DataDog/datadog-agent/comp/core/log v0.56.2 h1:qvBT+FfjKGqimyEvmsNHCZKbTfBJAdUZSVy2IZQ8HS4= github.com/DataDog/datadog-agent/comp/core/log v0.56.2/go.mod h1:ivJ/RMZjTNkoPPNDX+v/nnBwABLCiMv1vQA5tk/HCR4= -github.com/DataDog/datadog-api-client-go/v2 v2.31.0 h1:JfJhYlHfLzvauI8u6h23smTooWYe6quNhhg9gpTszWY= -github.com/DataDog/datadog-api-client-go/v2 v2.31.0/go.mod h1:d3tOEgUd2kfsr9uuHQdY+nXrWp4uikgTgVCPdKNK30U= +github.com/DataDog/datadog-api-client-go/v2 v2.33.0 h1:OI6kDnJeQmkjfGzxmP0XUQUxMD4tp6oAPXnnJ4VpgUM= +github.com/DataDog/datadog-api-client-go/v2 v2.33.0/go.mod h1:d3tOEgUd2kfsr9uuHQdY+nXrWp4uikgTgVCPdKNK30U= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= -github.com/DataDog/datadog-go/v5 v5.5.0 h1:G5KHeB8pWBNXT4Jtw0zAkhdxEAWSpWH00geHI6LDrKU= -github.com/DataDog/datadog-go/v5 v5.5.0/go.mod h1:K9kcYBlxkcPP8tvvjZZKs/m1edNAUFzBbdpTUKfCsuw= +github.com/DataDog/datadog-go/v5 v5.6.0 h1:2oCLxjF/4htd55piM75baflj/KoE6VYS7alEUqFvRDw= +github.com/DataDog/datadog-go/v5 v5.6.0/go.mod h1:K9kcYBlxkcPP8tvvjZZKs/m1edNAUFzBbdpTUKfCsuw= 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/go-sqllexer v0.0.17 h1:u47fJAVg/+5DA74ZW3w0Qu+3qXHd3GtnA8ZBYixdPrM= @@ -78,22 +78,22 @@ github.com/DataDog/gohai v0.0.0-20230524154621-4316413895ee h1:tXibLZk3G6HncIFJK github.com/DataDog/gohai v0.0.0-20230524154621-4316413895ee/go.mod h1:nTot/Iy0kW16bXgXr6blEc8gFeAS7vTqYlhAxh+dbc0= 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/opentelemetry-mapping-go/pkg/inframetadata v0.21.0 h1:U+p1i7+upWb4qOIOOvjS/92iMUGlSzEC1tRxVo0Lg8Y= -github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.21.0/go.mod h1:dOjp1lg4jwYyIbpnqW+DoOV8qD+70C+lgpINFvUqasQ= -github.com/DataDog/opentelemetry-mapping-go/pkg/internal/sketchtest v0.21.0 h1:VS4NTqwczwezMVvI6A7xYR3ugPmMUJ4FcdFrsdnZI2I= -github.com/DataDog/opentelemetry-mapping-go/pkg/internal/sketchtest v0.21.0/go.mod h1:66XlN7QpQKqIvw8e2UbCXV5X8wGnEw851nT9BjJ75dY= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.21.0 h1:hgbTFS6SkqbzOiWSfP58dZ/Jpjlmv6dpD4+V4LDHm2Q= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.21.0/go.mod h1:dvIWN9pA2zWNTw5rhDWZgzZnhcfpH++d+8d1SWW6xkY= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.21.0 h1:XD9Kd+baO66+tfbdanOFSMGEfwWfnrn/IxG/Dc5bv5I= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.21.0/go.mod h1:9ByLz9jISc176DzjIdaRfRKwaitqF8ie6RTvfP8Aufo= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.21.0 h1:8nW8jfcCIWzxWrpI31C0QYoOjTaUGp6USCwiRbP5Fp4= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.21.0/go.mod h1:wuatEozcLYinJ0WYf0MlVTFtTzEmf+qyJet0H9foVAs= -github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.21.0 h1:/Dp1WBvekdusS9Tw9pLE7RG04eluNktQ29arLS4SpGM= -github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.21.0/go.mod h1:asNuwNy1O2HbadkcZVuqmFGonfEzXS/SBvOo8V1MJvQ= +github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.22.0 h1:r1Dx2cRHCBWkVluSZA41i4eoI/nOGbcrrZdkqWjoFCc= +github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.22.0/go.mod h1:+/dkO8ZiMa8rfm4SmtTF6qPUdBbBcvsWWKaO4xPKAIk= +github.com/DataDog/opentelemetry-mapping-go/pkg/internal/sketchtest v0.22.0 h1:cXcKVEU1D0HlguR7GunnvuI70TghkarCa9DApqzMY94= +github.com/DataDog/opentelemetry-mapping-go/pkg/internal/sketchtest v0.22.0/go.mod h1:ES00EXfyEKgUkjd93tAXCxJA6i0seeOhZoS5Cj2qzzg= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.22.0 h1:yfk2cF8Bx98fSFpGrehEHh1FRqewfxcCTAbUDt5r3F8= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.22.0/go.mod h1:9qzpnBSxSOnKzbF/uHket3SSlQihQHix/ZRC2nZUUYQ= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.22.0 h1:Zqj8YUZ/ualUhM8GDCQX6xKnUJKEiG0eYdFGWmIDG30= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.22.0/go.mod h1:lpr4q6g2TB0BHeLHaz/XleKm8YXQjuxiQEb9Q9HXXE0= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.22.0 h1:w9+ngZDYUMLW+GSRA8x1DvVbuMR+cwlGb8VLwZfgBGs= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.22.0/go.mod h1:UsfqLgiD6Sjhpjkg+YzAd+TdKUZ2m6ZZ8t+tEkLNTMA= +github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.22.0 h1:63SzQz9Ab8XJj8fQKQz6UZNBhOm8rucwzbDfwTVF6dQ= +github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.22.0/go.mod h1:E/PY/aQ6S/N5hBPHXZRGmovs5b1BSi4RHGNcB4yP/Z0= 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= @@ -443,8 +443,8 @@ github.com/hashicorp/nomad/api v0.0.0-20240717122358-3d93bd3778f3 h1:fgVfQ4AC1av github.com/hashicorp/nomad/api v0.0.0-20240717122358-3d93bd3778f3/go.mod h1:svtxn6QnrQ69P23VvIWMR34tg3vmwLz4UdUzm1dSCgE= github.com/hashicorp/serf v0.10.1 h1:Z1H2J60yRKvfDYAOZLd2MU0ND4AH/WDz7xYHDWQsIPY= github.com/hashicorp/serf v0.10.1/go.mod h1:yL2t6BqATOLGc5HF7qbFkTfXoPIY0WZdWHfEvMqbG+4= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 h1:S4qyfL2sEm5Budr4KVMyEniCy+PbS55651I/a+Kn/NQ= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb h1:PGufWXXDq9yaev6xX1YQauaO1MV90e6Mpoq1I7Lz/VM= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= github.com/hetznercloud/hcloud-go/v2 v2.10.2 h1:9gyTUPhfNbfbS40Spgij5mV5k37bOZgt8iHKCbfGs5I= github.com/hetznercloud/hcloud-go/v2 v2.10.2/go.mod h1:xQ+8KhIS62W0D78Dpi57jsufWh844gUw1az5OUvaeq8= github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM= @@ -516,8 +516,8 @@ github.com/lightstep/go-expohisto v1.0.0 h1:UPtTS1rGdtehbbAF7o/dhkWLTDI73UifG8Lb github.com/lightstep/go-expohisto v1.0.0/go.mod h1:xDXD0++Mu2FOaItXtdDfksfgxfV0z1TMPa+e/EUd0cs= github.com/linode/linodego v1.37.0 h1:B/2Spzv9jYXzKA+p+GD8fVCNJ7Wuw6P91ZDD9eCkkso= github.com/linode/linodego v1.37.0/go.mod h1:L7GXKFD3PoN2xSEtFc04wIXP5WK65O10jYQx0PQISWQ= -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/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a h1:3Bm7EwfUQUvhNeKIkUct/gl9eod1TcXuj8stxvi/GoI= +github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a/go.mod h1:ilwx/Dta8jXAgpFYFvSWEMwxmbWXyiUHkd5FwyKhb5k= github.com/magefile/mage v1.15.0 h1:BvGheCMAsG3bWUDbZ8AyXXpCNwU9u5CB6sM+HNb9HYg= github.com/magefile/mage v1.15.0/go.mod h1:z5UZb/iS3GoOSn0JgWuiw7dxlurVYTu+/jHXqQg881A= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= @@ -590,58 +590,58 @@ github.com/onsi/ginkgo/v2 v2.20.2 h1:7NVCeyIWROIAheY21RLS+3j2bb52W0W82tkberYytp4 github.com/onsi/ginkgo/v2 v2.20.2/go.mod h1:K9gyxPIlb+aIvnZ8bd9Ak+YP18w3APlR+5coaZoE2ag= github.com/onsi/gomega v1.34.1 h1:EUMJIKUjM8sKjYbtxQI9A4z2o+rruxnzNvpknOXie6k= github.com/onsi/gomega v1.34.1/go.mod h1:kU1QgUvBDLXBJq618Xvm2LUX6rSAfRaFRTcdOeDLwwY= -github.com/open-telemetry/opentelemetry-collector-contrib/connector/datadogconnector v0.114.0 h1:cjiWapRbK28GxsZyKCegQOLJCEiwIWEV+INvxrS8HSA= -github.com/open-telemetry/opentelemetry-collector-contrib/connector/datadogconnector v0.114.0/go.mod h1:1Mx3wOciTCjrN9PgVAB4uFBeoqEfyeZEuvpguOasm4s= -github.com/open-telemetry/opentelemetry-collector-contrib/connector/spanmetricsconnector v0.114.0 h1:oA79wMjQSQBKz+X90LD5edNOyaEsewspJRBYgxliEMA= -github.com/open-telemetry/opentelemetry-collector-contrib/connector/spanmetricsconnector v0.114.0/go.mod h1:uk7Z36vhLtevNy5672jGxgzNJA2LND6wmispTuhHCxI= -github.com/open-telemetry/opentelemetry-collector-contrib/exporter/datadogexporter v0.114.0 h1:K1/5bZ5EbmxHH4cfvPo/3sYrHUVnM6H86C0dVkf+6TM= -github.com/open-telemetry/opentelemetry-collector-contrib/exporter/datadogexporter v0.114.0/go.mod h1:XWnw+AWGoINC/fG4urgmiLVXDaYeqkRVLKUJMPqC3Ls= -github.com/open-telemetry/opentelemetry-collector-contrib/exporter/prometheusremotewriteexporter v0.114.0 h1:quLs6NbDeG2x2eLmncaq/P4yvnCPLAelFqXac2eMRSw= -github.com/open-telemetry/opentelemetry-collector-contrib/exporter/prometheusremotewriteexporter v0.114.0/go.mod h1:xX2v2kixYWZbFvnT5re3BGg2pyLy78KSIiMed7P2c/c= -github.com/open-telemetry/opentelemetry-collector-contrib/extension/healthcheckextension v0.114.0 h1:G7SHyt5TvFSEsiaxyhZdqkjcRoK2rP5wl4a3Mu31JM4= -github.com/open-telemetry/opentelemetry-collector-contrib/extension/healthcheckextension v0.114.0/go.mod h1:TRsDReUh7ALEUutKVoLlGMRc2QECZAyT/5g/cpAr+aw= -github.com/open-telemetry/opentelemetry-collector-contrib/extension/pprofextension v0.114.0 h1:6g5EvbygaEBqed0rJotGHcfxgxGV8hSN/4ZoZFfac5M= -github.com/open-telemetry/opentelemetry-collector-contrib/extension/pprofextension v0.114.0/go.mod h1:gU87iMdDAdHrQQCWTURbrlE/dLYgFecJ/+WBHuNMjQI= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/ecsutil v0.114.0 h1:4qELD/ZwgvXE5PshGzJ9Eu+JEQdLIok6V1x8rvqL+yk= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/ecsutil v0.114.0/go.mod h1:3U1KoAsmQd9H37t8VkesFfB56tThrPsNVG+ddsMJ2zM= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.114.0 h1:0LbaoE7Aof8J4CVQ5kYv1QbuL3usTxLRSMFisDNBX9U= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.114.0/go.mod h1:ByoGXMLeHE/k5ELO3EITitVmvq3bh4Z/GVwWZZxrQ5s= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.114.0 h1:d2wCLlENxH4I2axQWaogivx/5ZIjDYgn9MIf6sFxlJ4= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.114.0/go.mod h1:Psyligv8GKL9WI3TraW3BLwkOX4TRxaaa1BBQQyICzA= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter v0.114.0 h1:WrVBqO/ps3KvUyEhtdL/uDDHhKoszLEE1ywDbwskNRg= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter v0.114.0/go.mod h1:JYklzR+ZxQaxjzlfJP3bxX6rQFl/Hbo0vd3yNj/1s1s= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8sconfig v0.114.0 h1:dtW9JkkpAm33Y47estFyqEL0CW05DHGmlLQxZUSx78w= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8sconfig v0.114.0/go.mod h1:FcClDm9XVV5tzUDzmH2Mhe6TfYiZ/3GSAQITnuCjZgg= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/metadataproviders v0.114.0 h1:cGJRIzB5N3oe1c8vD5HqCuy4dbQE9EDJZ9C7vJn+K8U= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/metadataproviders v0.114.0/go.mod h1:p53t8aSCVoTKXVOsNx62rDLrSdEkBFB4H85yEiTWkyI= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/pdatautil v0.114.0 h1:lt87gwZaUP9Lh0EAgZFTYego0k89NU8K6Qkk82oR/n8= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/pdatautil v0.114.0/go.mod h1:nxxBsX9Z2Q7HQvybUTx8CzUvYCJewKBM1Eys6SiS0eg= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/datadog v0.114.0 h1:Wq1iTmd0K1SSOIA43Wy2uAU6SB4f9ogyN3ZmvDgTURg= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/datadog v0.114.0/go.mod h1:VCj9H0QxRBWSgbl1pUo8p0NrqnmcxpPo0QjKLFtWkO0= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden v0.114.0 h1:SXi6JSSs2cWROnC1U2v3XysG3t58ilGUwoLqxpGuwFU= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden v0.114.0/go.mod h1:LSd6sus2Jvpg3M3vM4HgmVh3/dmMtcJmTqELrFOQFRg= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl v0.114.0 h1:G6U2eHR2CGSYb2btot6l05o+mdqsC0ZN7dH8QssXSdk= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl v0.114.0/go.mod h1:kZQvVVzpahX8kFUfEBmzFtDhkKAQW6i8XQCMozDRUlk= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.114.0 h1:m8uPYU2rTj0sKiYgzCvIPajD3meiYsu+nX0hplUnlEU= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.114.0/go.mod h1:P0BaP92pXPkTyTmObfLYUoRBfMYU+i0hdS3oM1DpGJo= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.114.0 h1:Qg80zPfNMlub7LO07VMDElOu3M2oxqdZgvvB+X72a4U= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.114.0/go.mod h1:5qsGcjFV3WFI6J2onAlkR7Xd/8VtwJcECaDRZfW4Tb4= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/resourcetotelemetry v0.114.0 h1:PwUMZ6fHMEUV5i9hUly+z3UujDTTdxQtWzL0rWc/lgA= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/resourcetotelemetry v0.114.0/go.mod h1:YEHL6w4vvB9b0/lNwGjz8DyWXTF/7Xw0Hkgc3mGWwa8= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/sampling v0.114.0 h1:mtSN/07RGQPi1/zHVSZg4G0qRtOoJpPew5jsQWv9uS0= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/sampling v0.114.0/go.mod h1:C9Zgh/N3j4NR2D+1FGAA1YizhFW9OS51DwLUFJTdXN4= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheus v0.114.0 h1:eJxap/u8Q5wYnBcJTrTS1Tq6wq31SOlIr+FMJX5ZoC8= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheus v0.114.0/go.mod h1:H7uIA2RBaxit2mSwSU8Wc7QXSJX7r8UR66YvdcLmtto= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheusremotewrite v0.114.0 h1:tG98F8g5T7lKYaoxSh9e76agmkauPtXiMbQhuWAeG+I= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheusremotewrite v0.114.0/go.mod h1:eN3xPxPcRZH0wofEQ1Greu1c561qEGeYv5Zt0uedmMM= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/probabilisticsamplerprocessor v0.114.0 h1:I4ZYVRYW3Cjb65sPENZ9kHam/JUMXNEp2n/knJ0C0Vc= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/probabilisticsamplerprocessor v0.114.0/go.mod h1:4BhyIaOn2LS48WS+ZNix4TpP0+goq9gDEtGzth5Cr3M= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/tailsamplingprocessor v0.114.0 h1:NrD8Qo2CxrHRAlLuOHm75RtO1xEnul6DDkn6tQMsuSg= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/tailsamplingprocessor v0.114.0/go.mod h1:XOlJzIYwicEPMxu6Gv9TL9pS6El+ffjQOAu/wPiL+Jg= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor v0.114.0 h1:lKG7Ghtba2l9P4FFP7I+SbVRqHEpXCGOZs367YTEwGc= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor v0.114.0/go.mod h1:5U/lrnkK5YtIeTFXI8OzDN/d827WtI6pQvu7/59pUVA= -github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusreceiver v0.114.0 h1:gdljk66vBTT3lWfSdP4Hl7FaABdH1YPhUCH6jnG2+qY= -github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusreceiver v0.114.0/go.mod h1:T1p6ShTr8farkE4qUB2TyGUIvRSN3s17D0qY7rMqCRM= +github.com/open-telemetry/opentelemetry-collector-contrib/connector/datadogconnector v0.115.0 h1:Xkfl44ZRgkz1EoCCYgwPomQkV+BrYOPvv9v1Kd1gZE4= +github.com/open-telemetry/opentelemetry-collector-contrib/connector/datadogconnector v0.115.0/go.mod h1:Sr/upBdJeJ7nxDfmCFCl9iHosXiPoQCPHkCJslDyoUA= +github.com/open-telemetry/opentelemetry-collector-contrib/connector/spanmetricsconnector v0.115.0 h1:sO4fPw0NRUibgBVvQVTqPBCBRFh0I+ODIr3HAwcWezI= +github.com/open-telemetry/opentelemetry-collector-contrib/connector/spanmetricsconnector v0.115.0/go.mod h1:HqzCXJ4rxXzWNYaUtCqJzXyTsCGEKSa/d+tHcyeRDY0= +github.com/open-telemetry/opentelemetry-collector-contrib/exporter/datadogexporter v0.115.0 h1:qtct9PsKONY6YOMc+QGBE/uGs8KMBcF6mvYJbyFHFt8= +github.com/open-telemetry/opentelemetry-collector-contrib/exporter/datadogexporter v0.115.0/go.mod h1:OR9DKWrSRpfc3+CxwsL2QTOuHD03S9w0Jubi3EhTcy4= +github.com/open-telemetry/opentelemetry-collector-contrib/exporter/prometheusremotewriteexporter v0.115.0 h1:u7Ht+E1ghQESffcjyaxWrXGsfSWa1VE9LKC4f2PPx84= +github.com/open-telemetry/opentelemetry-collector-contrib/exporter/prometheusremotewriteexporter v0.115.0/go.mod h1:r3iS2mDYu+cnGjgNc8TgvuUUAN6A6/1BvR1e1YJBrqM= +github.com/open-telemetry/opentelemetry-collector-contrib/extension/healthcheckextension v0.115.0 h1:51D/x3xIAnWgVrY0lgdU+b+yb2aWd72uDqu9GhjRcNI= +github.com/open-telemetry/opentelemetry-collector-contrib/extension/healthcheckextension v0.115.0/go.mod h1:nLau1YUdjhtLrk4jXLPb2l9riQ1Ap4xytTLl7MBedBg= +github.com/open-telemetry/opentelemetry-collector-contrib/extension/pprofextension v0.115.0 h1:HVGG31WeB6Fn2+il2/ycWj9tDP0fxOeOqD1rKCjsBSc= +github.com/open-telemetry/opentelemetry-collector-contrib/extension/pprofextension v0.115.0/go.mod h1:2hYojHs5daPVWECuZsPViKwty0ojuHUEmk8GEuaFqO0= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/ecsutil v0.115.0 h1:SF3gOOEkfntE3zEhY80yO7BVQ5CkaK8ecic2U2AZPHE= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/ecsutil v0.115.0/go.mod h1:jeBzX5m8O9X0LQxiryV9sJUIrn+QAwOnCBE2wZWIltQ= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.115.0 h1:vRQQFD4YpasQFUAdF030UWtaflSYFXK542bfWMGhOK0= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.115.0/go.mod h1:BZ7DT+0VkKR7P3I9PGEDfVa0GdB0ty41eEcejIUXF9A= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.115.0 h1:a36EJz/mb83f6ieX0v4fNDJ1jXqpeaM6DVQXeFDvdhw= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.115.0/go.mod h1:r5/40YO1eSP5ZreOmRzVOUtDr7YG39ZIUcVjHd+9Izc= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter v0.115.0 h1:h6zEsBtuZalQu7lKYf6ZCcj8fTocT+zxdmuOou9515Q= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter v0.115.0/go.mod h1:6QU/K0dGCGYorkOvJmhbDFCspy4RPxRkFjf9I64y6I0= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8sconfig v0.115.0 h1:f/HrZgTf6TF97v67uEZB3v2UtBT9aQojBvnloD3LOm4= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8sconfig v0.115.0/go.mod h1:Hp9uSq3qNJqdxu24u7RWyuPT9x1GgEUSx9US1LLeLi0= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/metadataproviders v0.115.0 h1:4RoU3SlcNe6Dxyxfv8JVsrN8QgjBQ44Pkt9FLKK095I= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/metadataproviders v0.115.0/go.mod h1:jfPlBpZT+hvp52Ldcx+srxaqyYuKxBkxOd3KtxbveCU= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/pdatautil v0.115.0 h1:8A+iBT5G23zvBPqYx32Qh4800jHFo4X9T1fpQKVQ+4E= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/pdatautil v0.115.0/go.mod h1:AhdPvwYKu7G8LKRWzHTNQYBq27RinsMm5qSanwSA/rU= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/datadog v0.115.0 h1:WOqt8NpU/JPGYDR4CiWx7g/sHV6Oe9FChzhushwmVdo= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/datadog v0.115.0/go.mod h1:wV/+iU7MyXcyTaY8K5Qx+1Z3yUzrxA40nydPQA476Iw= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden v0.115.0 h1:Z9p78zj9Qblw472mGkPieuX7mqduAp47rzMbFfq5evI= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden v0.115.0/go.mod h1:mtxUxJEIQy27MaGR1yzcn/OK8NoddEgb7fumpEbKYss= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl v0.115.0 h1:qdZ9EqmdM19pWhPoFA7VivBTdzP2HvNwXa3CCMHYoDQ= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl v0.115.0/go.mod h1:mrL1MNrcg0zYAJ+aK9WtOH062dl2wN9DDG7mZk9H8v4= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.115.0 h1:MerLKMrkM4YoGF6Di0D9yMXO02yCX8mrZAi/+jJVVeI= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.115.0/go.mod h1:R8AkVWe9G5Q0oMOapvm9HNS076E3Min8SVlmhBL3QD0= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.115.0 h1:WEqcnWSy9dNSlGb8pYRBX7zhaz2ReyaeImlenbzNTB4= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.115.0/go.mod h1:6Mk71CakHUA3I6oM9hARDiyQypYyOolvb+4PFYyVEFg= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/resourcetotelemetry v0.115.0 h1:eoapW0JBablApkdv4C1RUuOKfz0U6SwuKMYYSAJH6fE= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/resourcetotelemetry v0.115.0/go.mod h1:hW2AaybTRcwxJySGLC3Fh1vd2VDaQhRBfa7O7w30NS8= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/sampling v0.115.0 h1:R9MRrO+dSkAHBQLZjuwjv2RHXHQqF2Wtm1Ki0VKD5cs= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/sampling v0.115.0/go.mod h1:rKXLXmwdUVcUHwTilroKSejbg3KSwLeYzNPSpkIEnv4= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheus v0.115.0 h1:KghgAubxdDqP4eUQ+d2GzHXUAwtFxpSDToqFVnax0XA= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheus v0.115.0/go.mod h1:cW/BaYE6Uo7ZYHbmT0wVBktHP0SfeLqGHMf0qks7rOE= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheusremotewrite v0.115.0 h1:ioGiKiO0WqT3PxkzanuJsPVA24FItH6nTJeDeSMFpYA= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheusremotewrite v0.115.0/go.mod h1:x1W4J+pzK/Bi9jjYBYESTsPq0nRJJLZoN7cPNd0vYSU= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/probabilisticsamplerprocessor v0.115.0 h1:vwZQ7k8oqlK0bdZYTsjP/59zjQQfjSD4fNsWIWsTu2w= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/probabilisticsamplerprocessor v0.115.0/go.mod h1:5ObSa9amrbzbYTdAK1Qhv3D/YqCxxnQhP0sk2eWB7Oo= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/tailsamplingprocessor v0.115.0 h1:olyiml73slGYORDjZNViW3nKiysC+K+h5yPsSBjUxQ4= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/tailsamplingprocessor v0.115.0/go.mod h1:N00k1mTxzfS2clqxSP4Dxk7iX8GWbbuCq6LF8/ECk/M= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor v0.115.0 h1:sLRTfXUFiqJ5Qe/NN5MUJxTaFt46E0Y/xjSY+KesCQc= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor v0.115.0/go.mod h1:361IqXD4jnfs6G+Yn7978uv1UNozhZo4yBYy4p6Nqzc= +github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusreceiver v0.115.0 h1:GIyMUiud3T8nyCJP9KVhxVKvfcNQRBCde5uTCl6K/i0= +github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusreceiver v0.115.0/go.mod h1:x4hCznyUolxGt5cE/uXWRCckdIDrUYqH5hJddvdKZd4= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.1.0 h1:8SG7/vwALn54lVB/0yZ/MMwhFrPYtpEHQb2IpWsCzug= @@ -682,8 +682,8 @@ github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRI github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= -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/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 h1:o4JXh1EVt9k/+g42oCprj/FisM4qX9L3sZB3upGN2ZU= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= @@ -742,8 +742,8 @@ github.com/secure-systems-lab/go-securesystemslib v0.8.0 h1:mr5An6X45Kb2nddcFlbm 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/shirou/gopsutil/v4 v4.24.10 h1:7VOzPtfw/5YDU+jLEoBwXwxJbQetULywoSV4RYY7HkM= -github.com/shirou/gopsutil/v4 v4.24.10/go.mod h1:s4D/wg+ag4rG0WO7AiTj2BeYCRhym0vM7DHbZRxnIT8= +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 v1.7.1 h1:UJcjSAI3aUKx52kfcfhblgyhZceouhvvs3OYdWgn+PY= @@ -804,8 +804,8 @@ github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4= github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= github.com/tidwall/tinylru v1.1.0 h1:XY6IUfzVTU9rpwdhKUF6nQdChgCdGjkMfLzbWyiau6I= github.com/tidwall/tinylru v1.1.0/go.mod h1:3+bX+TJ2baOLMWTnlyNWHh4QMnFyARg2TLTQ6OFbzw8= -github.com/tidwall/wal v1.1.7 h1:emc1TRjIVsdKKSnpwGBAcsAGg0767SvUk8+ygx7Bb+4= -github.com/tidwall/wal v1.1.7/go.mod h1:r6lR1j27W9EPalgHiB7zLJDYu3mzW5BQP5KrzBpYY/E= +github.com/tidwall/wal v1.1.8 h1:2qDSGdAdjaY3PEvHRva+9UFqgk+ef7cOiW1Qn5JH1y0= +github.com/tidwall/wal v1.1.8/go.mod h1:r6lR1j27W9EPalgHiB7zLJDYu3mzW5BQP5KrzBpYY/E= 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.14 h1:g5vzr9iPFFz24v2KZXs/pvpvh8/V9Fw6vQK5ZZb78yU= @@ -848,132 +848,134 @@ go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= -go.opentelemetry.io/collector v0.114.0 h1:XLLLOHns06P9XjVHyp0OdEMdwXvol5MLzugqQMmXYuU= -go.opentelemetry.io/collector v0.114.0/go.mod h1:XbjD4Yw9LunLo3IJu3ZZytNZ0drEVznxw1Z14Ujlw3s= -go.opentelemetry.io/collector/client v1.20.0 h1:o60wPcj5nLtaRenF+1E5p4QXFS3TDL6vHlw+GOon3rg= -go.opentelemetry.io/collector/client v1.20.0/go.mod h1:6aqkszco9FaLWCxyJEVam6PP7cUa8mPRIXeS5eZGj0U= -go.opentelemetry.io/collector/component v0.114.0 h1:SVGbm5LvHGSTEDv7p92oPuBgK5tuiWR82I9+LL4TtBE= -go.opentelemetry.io/collector/component v0.114.0/go.mod h1:MLxtjZ6UVHjDxSdhGLuJfHBHvfl1iT/Y7IaQPD24Eww= -go.opentelemetry.io/collector/component/componentstatus v0.114.0 h1:y9my/xink8KB5lK8zFAjgB2+pEh0QYy5TM972fxZY9w= -go.opentelemetry.io/collector/component/componentstatus v0.114.0/go.mod h1:RIoeCYZpPaae7QLE/1RacqzhHuXBmzRAk9H/EwYtIIs= -go.opentelemetry.io/collector/component/componenttest v0.114.0 h1:GM4FTTlfeXoVm6sZYBHImwlRN8ayh2oAfUhvaFj7Zo8= -go.opentelemetry.io/collector/component/componenttest v0.114.0/go.mod h1:ZZEJMtbJtoVC/3/9R1HzERq+cYQRxuMFQrPCpfZ4Xos= -go.opentelemetry.io/collector/config/configauth v0.114.0 h1:R2sJ6xpsLYGH0yU0vCxotzBYDKR/Hrjv0A7y9lwMyiw= -go.opentelemetry.io/collector/config/configauth v0.114.0/go.mod h1:3Z24KcCpG+WYCeQYfs/cNp5cP2BDeOqLCtOEgs/rPqM= -go.opentelemetry.io/collector/config/configcompression v1.20.0 h1:H/mvz7J/5z+O74YsO0t2tk+REnO2tzLM8TgIQ4AZ5w0= -go.opentelemetry.io/collector/config/configcompression v1.20.0/go.mod h1:pnxkFCLUZLKWzYJvfSwZnPrnm0twX14CYj2ADth5xiU= -go.opentelemetry.io/collector/config/configgrpc v0.114.0 h1:3kGI9CljNtzClF+9sg7NWZ5qUoy4qZvGxv9q3phDn7k= -go.opentelemetry.io/collector/config/configgrpc v0.114.0/go.mod h1:IHSyqSdjPXW34aif/8BhNlXxRcIVV6026jVi0/+ituY= -go.opentelemetry.io/collector/config/confighttp v0.114.0 h1:DjGsBvVm+mGK3IpJBaXianWhwcxEC1fF33cpuC1LY/I= -go.opentelemetry.io/collector/config/confighttp v0.114.0/go.mod h1:nrlNLxOZ+4JQaV9j0TiqQV7LOHhrRivPrT8nQRHED3Q= -go.opentelemetry.io/collector/config/confignet v1.20.0 h1:LrM6AuiY8N/woTP4SWhL2V0562JXwJs9MRNFZJFLtRY= -go.opentelemetry.io/collector/config/confignet v1.20.0/go.mod h1:o3v4joAEjvLwntqexg5ixMqRrU1+Vst+jWuCUaBNgOg= -go.opentelemetry.io/collector/config/configopaque v1.20.0 h1:2I48zKiyyyYqjm7y0B9OLp24ku2ZSX3nCHG0r5FdWOQ= -go.opentelemetry.io/collector/config/configopaque v1.20.0/go.mod h1:6zlLIyOoRpJJ+0bEKrlZOZon3rOp5Jrz9fMdR4twOS4= -go.opentelemetry.io/collector/config/configretry v1.20.0 h1:z679mrMlW2a6tOOYPGdrS/QfALxdzWLQUOpH8Uu+D5Y= -go.opentelemetry.io/collector/config/configretry v1.20.0/go.mod h1:KvQF5cfphq1rQm1dKR4eLDNQYw6iI2fY72NMZVa+0N0= -go.opentelemetry.io/collector/config/configtelemetry v0.114.0 h1:kjLeyrumge6wsX6ZIkicdNOlBXaEyW2PI2ZdVXz/rzY= -go.opentelemetry.io/collector/config/configtelemetry v0.114.0/go.mod h1:R0MBUxjSMVMIhljuDHWIygzzJWQyZHXXWIgQNxcFwhc= -go.opentelemetry.io/collector/config/configtls v1.20.0 h1:hNlJdwfyY5Qe54RLJ41lfLqKTn9ypkR7sk7JNCcSe2U= -go.opentelemetry.io/collector/config/configtls v1.20.0/go.mod h1:sav/txSHguadTYlSSK+BJO2ljJeYEtRoBahgzWAguYg= -go.opentelemetry.io/collector/config/internal v0.114.0 h1:uWSDWTJb8T6xRjKD9/XmEARakXnxgYVYKUeId78hErc= -go.opentelemetry.io/collector/config/internal v0.114.0/go.mod h1:yC7E4h1Uj0SubxcFImh6OvBHFTjMh99+A5PuyIgDWqc= -go.opentelemetry.io/collector/confmap v1.20.0 h1:ARfOwmkKxFOud1njl03yAHQ30+uenlzqCO6LBYamDTE= -go.opentelemetry.io/collector/confmap v1.20.0/go.mod h1:DMpd9Ay/ffls3JoQBQ73vWeRsz1rNuLbwjo6WtjSQus= -go.opentelemetry.io/collector/confmap/provider/envprovider v1.20.0 h1:I3xDecFXJVZBo5zJS7Y5SWBjF22XDWGZJgwotiwA5QM= -go.opentelemetry.io/collector/confmap/provider/envprovider v1.20.0/go.mod h1:CF0l8V8MNv+Wag8UkqObotFnlhMzdTFuk4/6kylKwYU= -go.opentelemetry.io/collector/confmap/provider/fileprovider v1.20.0 h1:wWxvQ7wj+1O9yDGM5m1HPEz8FJewAHAUWadAAi0KVbM= -go.opentelemetry.io/collector/confmap/provider/fileprovider v1.20.0/go.mod h1:/5HWIPjGYk8IUurs1CZUSjGaSsaQyJsfR8+Zs5rGJ6Y= -go.opentelemetry.io/collector/confmap/provider/httpprovider v1.20.0 h1:YS1nB8vDoCS8IlfX5OP3QGS90y/hfflwZ7CoPQcAOlU= -go.opentelemetry.io/collector/confmap/provider/httpprovider v1.20.0/go.mod h1:aV4UfkgcJ3eyXvfd3m694omN++1c96Joitab+YL6Xks= -go.opentelemetry.io/collector/confmap/provider/httpsprovider v1.20.0 h1:0BJHAeKFb46FCT0ehOmmGs0v31cGuAh4DIic07J71NU= -go.opentelemetry.io/collector/confmap/provider/httpsprovider v1.20.0/go.mod h1:gBiweuH4EDuPh9mpLCB/wPZzostdA+gKY8hABwbotQk= -go.opentelemetry.io/collector/confmap/provider/yamlprovider v1.20.0 h1:jSXTojCPI6Xr98m99nF7qbQFnw3INLEOHRcqcHS+lak= -go.opentelemetry.io/collector/confmap/provider/yamlprovider v1.20.0/go.mod h1:Pu95O2JE3R+0BBTbe4gpAC8ms3w6FbICHJw3WvGWrjs= -go.opentelemetry.io/collector/connector v0.114.0 h1:efGAeTCtg8zp5Hyd7Am8kBUgsSxWEFlFtAu4OX4mcEA= -go.opentelemetry.io/collector/connector v0.114.0/go.mod h1:8DhGgD8RhkF0ooELl4NOPPD/wgHuXHmY7g90RwJ2eNo= -go.opentelemetry.io/collector/connector/connectorprofiles v0.114.0 h1:uVs9gy3UfQBmH0636ouIbGIoWis7zmKN+ny4XOGm36U= -go.opentelemetry.io/collector/connector/connectorprofiles v0.114.0/go.mod h1:X681qFEAsEPMDQ0pMsD/3DqePw58sfLew1QbBKvGnmw= -go.opentelemetry.io/collector/connector/connectortest v0.114.0 h1:Fpy1JHyNOLdVzNcmxUY6Jwxdz6JDcTXL1NCfw8k1AOc= -go.opentelemetry.io/collector/connector/connectortest v0.114.0/go.mod h1:1zaAlODuL9iNyfyjHQeGCpbcaUjf5b68t8LqlwHKBNA= -go.opentelemetry.io/collector/consumer v0.114.0 h1:1zVaHvfIZowGwZRitRBRo3i+RP2StlU+GClYiofSw0Q= -go.opentelemetry.io/collector/consumer v0.114.0/go.mod h1:d+Mrzt9hsH1ub3zmwSlnQVPLeTYir4Mgo7CrWfnncN4= -go.opentelemetry.io/collector/consumer/consumererror v0.114.0 h1:r2YiELfWerb40FHD23V04gNjIkLUcjEKGxI4Vtm2iO4= -go.opentelemetry.io/collector/consumer/consumererror v0.114.0/go.mod h1:MzIrLQ5jptO2egypolhlAbZsWZr29WC4FhSxQjnxcvg= -go.opentelemetry.io/collector/consumer/consumererror/consumererrorprofiles v0.114.0 h1:0IpwQXyHDXhIaLA6w2VlD6Ca0iuX4wlfCDiF+BKCwEo= -go.opentelemetry.io/collector/consumer/consumererror/consumererrorprofiles v0.114.0/go.mod h1:9pKeVRcCT92x5/UIULMLAop+J23VYJCWSZcVhmbup5I= -go.opentelemetry.io/collector/consumer/consumerprofiles v0.114.0 h1:5pXYy3E6UK5Huu3aQbsYL8B6E6MyWx4fvXXDn+oXZaA= -go.opentelemetry.io/collector/consumer/consumerprofiles v0.114.0/go.mod h1:PMq3f54KcJQO4v1tue0QxQScu7REFVADlXxXSAYMiN0= -go.opentelemetry.io/collector/consumer/consumertest v0.114.0 h1:isaTwJK5DOy8Bs7GuLq23ejfgj8gLIo5dOUvkRnLF4g= -go.opentelemetry.io/collector/consumer/consumertest v0.114.0/go.mod h1:GNeLPkfRPdh06n/Rv1UKa/cAtCKjN0a7ADyHjIj4HFE= -go.opentelemetry.io/collector/exporter v0.114.0 h1:5/0BBpXuCJQSQ5SQf31g7j6T4XEKkyx9mZMcA2rS5e8= -go.opentelemetry.io/collector/exporter v0.114.0/go.mod h1:atpd0wWXgh5LAZ0REU/d/Ti/q50HDfnlBIjMjJQlKFg= -go.opentelemetry.io/collector/exporter/debugexporter v0.114.0 h1:7t1ij8fuV510SRT+eabgbl4973DaAtGmTx0RuGJy8DU= -go.opentelemetry.io/collector/exporter/debugexporter v0.114.0/go.mod h1:rC8PHnf1MniZN4ryU4i5GsyXKRkMEGwEGF2hxHx/JyU= -go.opentelemetry.io/collector/exporter/exporterhelper/exporterhelperprofiles v0.114.0 h1:W/KsD33oMg/M7Kd5/m2riliWrTg3W9IgQVNeZL3cZjs= -go.opentelemetry.io/collector/exporter/exporterhelper/exporterhelperprofiles v0.114.0/go.mod h1:Fh47qYBjX+jm+mpWBcqmaaQucZ6KiKm5P0drEt+xNRc= -go.opentelemetry.io/collector/exporter/exporterprofiles v0.114.0 h1:/wmWOSBHcvtz3Pbv7+rWCqPPQuNvYaoidKKaOqZsLKs= -go.opentelemetry.io/collector/exporter/exporterprofiles v0.114.0/go.mod h1:epRYTkyJZTSQZBJflMGHUyUo2EdLPhsaZEyo5Qm848A= -go.opentelemetry.io/collector/exporter/exportertest v0.114.0 h1:vo0idBJT+QACSM1KpjVLm9VeiXVwO7y4UnMpGxN6EyM= -go.opentelemetry.io/collector/exporter/exportertest v0.114.0/go.mod h1:420ssFrhaphneybstbMeSIiqSRoaBARPgO71O17foaM= -go.opentelemetry.io/collector/exporter/otlpexporter v0.114.0 h1:SC/xZNCB/eCVflrhDFX4WtrpvBPsZhmXVuSvgHQBsB8= -go.opentelemetry.io/collector/exporter/otlpexporter v0.114.0/go.mod h1:q1273aUuYewtDUFwizv0AKu5/D+gbQAi8UFLKDv1eMk= -go.opentelemetry.io/collector/exporter/otlphttpexporter v0.114.0 h1:+nPJraioPpLS2Kj3+YIfErDDFHsLX/5oPMSMAYKoggM= -go.opentelemetry.io/collector/exporter/otlphttpexporter v0.114.0/go.mod h1:O+75KYmyJwK61VDsW7LHo2qFFXCTf3kEJH3ZvW1bb4Y= -go.opentelemetry.io/collector/extension v0.114.0 h1:9Qb92y8hD2WDC5aMDoj4JNQN+/5BQYJWPUPzLXX+iGw= -go.opentelemetry.io/collector/extension v0.114.0/go.mod h1:Yk2/1ptVgfTr12t+22v93nYJpioP14pURv2YercSzU0= -go.opentelemetry.io/collector/extension/auth v0.114.0 h1:1K2qh4yvG8kKR/sTAobI/rw5VxzPZoKcl3FmC195vvo= -go.opentelemetry.io/collector/extension/auth v0.114.0/go.mod h1:IjtsG+jUVJB0utKF8dAK8pLutRun3aEgASshImzsw/U= -go.opentelemetry.io/collector/extension/experimental/storage v0.114.0 h1:hLyX9UvmY0t6iBnk3CqvyNck2U0QjPACekj7pDRx2hA= -go.opentelemetry.io/collector/extension/experimental/storage v0.114.0/go.mod h1:WqYRQVJjJLE1rm+y/ks1wPdPRGWePEvE1VO07xm2J2k= -go.opentelemetry.io/collector/extension/extensioncapabilities v0.114.0 h1:3OHll7gp5XIu7FVgon+koShPy797nze6EjCDokFUG7w= -go.opentelemetry.io/collector/extension/extensioncapabilities v0.114.0/go.mod h1:f0KdeLmE2jWVBmJ1U4WmfAtz1/tQUErGPfhPLKCQ49U= -go.opentelemetry.io/collector/extension/extensiontest v0.114.0 h1:ibXDms1qrswlvlR6b3d2BeyI8sXUXoFV11yOi9Sop8o= -go.opentelemetry.io/collector/extension/extensiontest v0.114.0/go.mod h1:/bOYmqu5yTDfI1bJZUxFqm8ZtmcodpquebiSxiQxtDY= -go.opentelemetry.io/collector/extension/zpagesextension v0.114.0 h1:JosqAcdWw7IGsURJNR8f17xmaGCQEtKhQt9tM0T/DEg= -go.opentelemetry.io/collector/extension/zpagesextension v0.114.0/go.mod h1:+VO4p2GZvmIMqCVyIfS/U85Xqg+HIOe+mdl/ya+jVTE= -go.opentelemetry.io/collector/featuregate v1.20.0 h1:Mi7nMy/q52eruI+6jWnMKUOeM55XvwoPnGcdB1++O8c= -go.opentelemetry.io/collector/featuregate v1.20.0/go.mod h1:47xrISO71vJ83LSMm8+yIDsUbKktUp48Ovt7RR6VbRs= -go.opentelemetry.io/collector/internal/fanoutconsumer v0.114.0 h1:JM9huYqy5LTzmuxQmbPST3l5Ez5kJNit28c6WFWls34= -go.opentelemetry.io/collector/internal/fanoutconsumer v0.114.0/go.mod h1:V28tDU4Wvf1PfW1Ty/SBL9tpKul2iYGno/HkCWGDrj0= -go.opentelemetry.io/collector/internal/sharedcomponent v0.114.0 h1:DjX9ubjkKDnioQB03FYc40FTyhR25CdobMfjinKkZ1w= -go.opentelemetry.io/collector/internal/sharedcomponent v0.114.0/go.mod h1:lYlFiGIjPjhwTS/Xc+toJ9o3D8A6cCHuK1JX+ZbujVs= -go.opentelemetry.io/collector/otelcol v0.114.0 h1:d/nmYc+adzZ70g4zBMtgujGHVNulF59ExCpuM/3ZKV4= -go.opentelemetry.io/collector/otelcol v0.114.0/go.mod h1:DGmFFao5jHSwD6G1HjUjs0CYcyrTau+u7GjTRUGKN+4= -go.opentelemetry.io/collector/otelcol/otelcoltest v0.114.0 h1:Em5e1EgrPrS90EWDWLJHCvyFIDl5PIq1DuW9zd8F3pY= -go.opentelemetry.io/collector/otelcol/otelcoltest v0.114.0/go.mod h1:YAs78SaOJsf1HNWrNH+GFTdkS58dpQI98cok6gZP4Lg= -go.opentelemetry.io/collector/pdata v1.20.0 h1:ePcwt4bdtISP0loHaE+C9xYoU2ZkIvWv89Fob16o9SM= -go.opentelemetry.io/collector/pdata v1.20.0/go.mod h1:Ox1YVLe87cZDB/TL30i4SUz1cA5s6AM6SpFMfY61ICs= -go.opentelemetry.io/collector/pdata/pprofile v0.114.0 h1:pUNfTzsI/JUTiE+DScDM4lsrPoxnVNLI2fbTxR/oapo= -go.opentelemetry.io/collector/pdata/pprofile v0.114.0/go.mod h1:4aNcj6WM1n1uXyFSXlhVs4ibrERgNYsTbzcYI2zGhxA= -go.opentelemetry.io/collector/pdata/testdata v0.114.0 h1:+AzszWSL1i4K6meQ8rU0JDDW55SYCXa6FVqfDixhhTo= -go.opentelemetry.io/collector/pdata/testdata v0.114.0/go.mod h1:bv8XFdCTZxG2MQB5l9dKxSxf5zBrcodwO6JOy1+AxXM= -go.opentelemetry.io/collector/pipeline v0.114.0 h1:v3YOhc5z0tD6QbO5n/pnftpIeroihM2ks9Z2yKPCcwY= -go.opentelemetry.io/collector/pipeline v0.114.0/go.mod h1:4vOvjVsoYTHVGTbfFwqfnQOSV2K3RKUHofh3jNRc2Mg= -go.opentelemetry.io/collector/pipeline/pipelineprofiles v0.114.0 h1:LZgxMQ2zXcz8ILBefhxpZBpn/Rx+TJTncIIQy0LgtgY= -go.opentelemetry.io/collector/pipeline/pipelineprofiles v0.114.0/go.mod h1:bmyqQCJWcA53/GtqZJ2ahwmLdFl6UelFH2nR6OJFqpw= -go.opentelemetry.io/collector/processor v0.114.0 h1:6bqQgLL7BtKrNv4YkEOGjZfkcfZv/ciJSQx1epGG9Zk= -go.opentelemetry.io/collector/processor v0.114.0/go.mod h1:DV/wa+nAmSHIDeD9NblPwkY9PbgtDQAZJ+PE5biZwPc= -go.opentelemetry.io/collector/processor/batchprocessor v0.114.0 h1:Xu+pdPGIh6gLqHW5oYJsiim1mbnG85QaaUQy0YPoL+c= -go.opentelemetry.io/collector/processor/batchprocessor v0.114.0/go.mod h1:emnnL5CaliCnWjXNpNixqpvn7uc/kyUTv2939J/reMY= -go.opentelemetry.io/collector/processor/processorprofiles v0.114.0 h1:+P/1nLouEXTnN8DVQl+qWwO4BTkQyNPG9t/FrpUqrSI= -go.opentelemetry.io/collector/processor/processorprofiles v0.114.0/go.mod h1:3fuHeNIpINwx3bqFMprmDJyr6y5tWoWbJH599kltO5Y= -go.opentelemetry.io/collector/processor/processortest v0.114.0 h1:3FTaVXAp0LoVmUJn1ewBFckAby7AHa6/Kcdj0xuW14c= -go.opentelemetry.io/collector/processor/processortest v0.114.0/go.mod h1:OgsdOs1Fv5ZGTTJPF5nNIUJh2YkuV1acWd73yWgnti4= -go.opentelemetry.io/collector/receiver v0.114.0 h1:90SAnXAjNq7/k52/pFmmb06Cf1YauoPYtbio4aOXafY= -go.opentelemetry.io/collector/receiver v0.114.0/go.mod h1:KUGT0/D953LXbGH/D3lLPU8yrU3HfWnUqpt4W4hSOnE= -go.opentelemetry.io/collector/receiver/nopreceiver v0.114.0 h1:CMtfS6fwEwqwTMeC17A3Q2xsSkXfH4gG2SBZDr2txCw= -go.opentelemetry.io/collector/receiver/nopreceiver v0.114.0/go.mod h1:ajp6ok8iSSAcyq58wcOUJVe++1mTQ1isxqlaNUgQNzo= -go.opentelemetry.io/collector/receiver/otlpreceiver v0.114.0 h1:8ASaxRWLe8P0pefOiYbCSZ0aXmwE4K06I8FBGc/n+J0= -go.opentelemetry.io/collector/receiver/otlpreceiver v0.114.0/go.mod h1:3vjOvYBWGUVzuaovoumMbNHEIK3PqDs5rzEyd/nzsLU= -go.opentelemetry.io/collector/receiver/receiverprofiles v0.114.0 h1:ibhEfGpvNB3yrtpl2jYFabrunMk1hurxvMYpM0b1Ck4= -go.opentelemetry.io/collector/receiver/receiverprofiles v0.114.0/go.mod h1:UZyRfaasw+NLvN10AN8IQnmj5tQ3BOUH1uP2ctpO9f0= -go.opentelemetry.io/collector/receiver/receivertest v0.114.0 h1:D+Kh9t2n4asTnM+TiSxbrKlUemLZandWntj17BJWWb0= -go.opentelemetry.io/collector/receiver/receivertest v0.114.0/go.mod h1:mNSHQ13vFmqD+VAcRzLjStFBejbcWUn2Mp0pAd7Op+U= -go.opentelemetry.io/collector/semconv v0.114.0 h1:/eKcCJwZepQUtEuFuxa0thx2XIOvhFpaf214ZG1a11k= -go.opentelemetry.io/collector/semconv v0.114.0/go.mod h1:zCJ5njhWpejR+A40kiEoeFm1xq1uzyZwMnRNX6/D82A= -go.opentelemetry.io/collector/service v0.114.0 h1:MYF/4nH1CgtiLx09503xPAAUZefCzG1kaO+oanwX590= -go.opentelemetry.io/collector/service v0.114.0/go.mod h1:xH5/RapJdf5Ohh8iU8J0ZstfFYciP1oJPesiByteZxo= +go.opentelemetry.io/collector v0.115.0 h1:qUZ0bTeNBudMxNQ7FJKS//TxTjeJ7tfU/z22mcFavWU= +go.opentelemetry.io/collector v0.115.0/go.mod h1:66qx0xKnVvdwq60e1DEfb4e+zmM9szhPsv2hxZ/Mpj4= +go.opentelemetry.io/collector/client v1.21.0 h1:3Kes8lOFMYVxoxeAmX+DTEAkuS1iTA3NkSfqzGmygJA= +go.opentelemetry.io/collector/client v1.21.0/go.mod h1:jYJGiL0UA975OOyHmjbQSokNWt1OiviI5KjPOMUMGwc= +go.opentelemetry.io/collector/component v0.115.0 h1:iLte1oCiXzjiCnaOBKdsXacfFiECecpWxW3/LeriMoo= +go.opentelemetry.io/collector/component v0.115.0/go.mod h1:oIUFiH7w1eOimdeYhFI+gAIxYSiLDocKVJ0PTvX7d6s= +go.opentelemetry.io/collector/component/componentstatus v0.115.0 h1:pbpUIL+uKDfEiSgKK+S5nuSL6MDIIQYsp4b65ZGVb9M= +go.opentelemetry.io/collector/component/componentstatus v0.115.0/go.mod h1:36A+9XSiOz0Cdhq+UwwPRlEr5CYuSkEnVO9om4BH7d0= +go.opentelemetry.io/collector/component/componenttest v0.115.0 h1:9URDJ9VyP6tuij+YHjp/kSSMecnZOd7oGvzu+rw9SJY= +go.opentelemetry.io/collector/component/componenttest v0.115.0/go.mod h1:PzXvNqKLCiSADZGZFKH+IOHMkaQ0GTHuzysfVbTPKYY= +go.opentelemetry.io/collector/config/configauth v0.115.0 h1:xa+ALdyPgva3rZnLBh1H2oS5MsHP6JxSqMtQmcELnys= +go.opentelemetry.io/collector/config/configauth v0.115.0/go.mod h1:C7anpb3Rf4KswMT+dgOzkW9UX0z/65PLORpUw3p0VYc= +go.opentelemetry.io/collector/config/configcompression v1.21.0 h1:0zbPdZAgPFMAarwJEC4gaR6f/JBP686A3TYSgb3oa+E= +go.opentelemetry.io/collector/config/configcompression v1.21.0/go.mod h1:LvYG00tbPTv0NOLoZN0wXq1F5thcxvukO8INq7xyfWU= +go.opentelemetry.io/collector/config/configgrpc v0.115.0 h1:gZzXSFe6hB3RUcEeAYqk1yT+TBa+X9tp6/1x29Yg2yk= +go.opentelemetry.io/collector/config/configgrpc v0.115.0/go.mod h1:107lRZ5LdQPMdGJGd4m1GhyKxyH0az2cUOqrJgTEN8E= +go.opentelemetry.io/collector/config/confighttp v0.115.0 h1:BIy394oNXnqySJwrCqgAJu4gWgAV5aQUDD6k1hy6C8o= +go.opentelemetry.io/collector/config/confighttp v0.115.0/go.mod h1:Wr50ut12NmCEAl4bWLJryw2EjUmJTtYRg89560Q51wc= +go.opentelemetry.io/collector/config/confignet v1.21.0 h1:PeQ5YrMnfftysFL/WVaSrjPOWjD6DfeABY50pf9CZxU= +go.opentelemetry.io/collector/config/confignet v1.21.0/go.mod h1:ZppUH1hgUJOubawEsxsQ9MzEYFytqo2GnVSS7d4CVxc= +go.opentelemetry.io/collector/config/configopaque v1.21.0 h1:PcvRGkBk4Px8BQM7tX+kw4i3jBsfAHGoGQbtZg6Ox7U= +go.opentelemetry.io/collector/config/configopaque v1.21.0/go.mod h1:sW0t0iI/VfRL9VYX7Ik6XzVgPcR+Y5kejTLsYcMyDWs= +go.opentelemetry.io/collector/config/configretry v1.21.0 h1:ZHoOvAkEcv5BBeaJn8IQ6rQ4GMPZWW4S+W7R4QTEbZU= +go.opentelemetry.io/collector/config/configretry v1.21.0/go.mod h1:cleBc9I0DIWpTiiHfu9v83FUaCTqcPXmebpLxjEIqro= +go.opentelemetry.io/collector/config/configtelemetry v0.115.0 h1:U07FinCDop+r2RjWQ3aP9ZWONC7r7kQIp1GkXQi6nsI= +go.opentelemetry.io/collector/config/configtelemetry v0.115.0/go.mod h1:SlBEwQg0qly75rXZ6W1Ig8jN25KBVBkFIIAUI1GiAAE= +go.opentelemetry.io/collector/config/configtls v1.21.0 h1:ZfrlAYgBD8lzp04W0GxwiDmUbrvKsvDYJi+wkyiXlpA= +go.opentelemetry.io/collector/config/configtls v1.21.0/go.mod h1:5EsNefPfVCMOTlOrr3wyj7LrsOgY7V8iqRl8oFZEqtw= +go.opentelemetry.io/collector/config/internal v0.115.0 h1:eVk57iufZpUXyPJFKTb1Ebx5tmcCyroIlt427r5pxS8= +go.opentelemetry.io/collector/config/internal v0.115.0/go.mod h1:OVkadRWlKAoWjHslqjWtBLAne8ceQm8WYT71ZcBWLFc= +go.opentelemetry.io/collector/confmap v1.21.0 h1:1tIcx2/Suwg8VhuPmQw87ba0ludPmumpFCFRZZa6RXA= +go.opentelemetry.io/collector/confmap v1.21.0/go.mod h1:Rrhs+MWoaP6AswZp+ReQ2VO9dfOfcUjdjiSHBsG+nec= +go.opentelemetry.io/collector/confmap/provider/envprovider v1.21.0 h1:YLf++Z8CMp86AanfOCWUiE7vKbb1kSjgC3a9VJoxbD4= +go.opentelemetry.io/collector/confmap/provider/envprovider v1.21.0/go.mod h1:aSWLYcmgZZJDNtWN1M8JKQuehoGgOxibl1KuvKTar4M= +go.opentelemetry.io/collector/confmap/provider/fileprovider v1.21.0 h1:+zukkM+3l426iGoJkXTpLB2Z8QnZFu26TkGPjh5Rn/4= +go.opentelemetry.io/collector/confmap/provider/fileprovider v1.21.0/go.mod h1:BXBpQhF3n4CNLYO2n/mWZPd2U9ekpbLXLRGZrun1VfI= +go.opentelemetry.io/collector/confmap/provider/httpprovider v1.21.0 h1:NYYGM+SgIlTuNGjd8eGzDr8DkvOe4q7cXon8djF9yyI= +go.opentelemetry.io/collector/confmap/provider/httpprovider v1.21.0/go.mod h1:XRYbuwqq1awFuNhLDUv4aSvn6MzqX+abcevx1O+APJI= +go.opentelemetry.io/collector/confmap/provider/httpsprovider v1.21.0 h1:2EEUI2DzA2DvrvCImMWRSNqIHdRJ6+qbgvZL44Zb2ac= +go.opentelemetry.io/collector/confmap/provider/httpsprovider v1.21.0/go.mod h1:axezjjQWY4kZc5pr/+wOKAuqSYMhea/tWzP5S30h+dc= +go.opentelemetry.io/collector/confmap/provider/yamlprovider v1.21.0 h1:P3Q9RytCMY76ORPCnkkjOa4fkuFqmZiQRor+F/nPlYE= +go.opentelemetry.io/collector/confmap/provider/yamlprovider v1.21.0/go.mod h1:xhYhHK3yLQ78tsoaKPIGUfFulgy961ImOe2gATH3RQc= +go.opentelemetry.io/collector/connector v0.115.0 h1:4Kkm3HQFzNT1eliMOB8FbIn+PLMRJ2qQku5Vmy3V8Ko= +go.opentelemetry.io/collector/connector v0.115.0/go.mod h1:+ByuAmYLrYHoKh9B+LGqUc0N2kXcN2l8Dea8Mp6brZ8= +go.opentelemetry.io/collector/connector/connectorprofiles v0.115.0 h1:aW1f4Az0I+QJyImFccNWAXqik80bnNu27aQqi2hFfD8= +go.opentelemetry.io/collector/connector/connectorprofiles v0.115.0/go.mod h1:lmynB1CucydOsHa8RSSBh5roUZPfuiv65imXhtNzClM= +go.opentelemetry.io/collector/connector/connectortest v0.115.0 h1:GjtourFr0MJmlbtEPAZ/1BZCxkNAeJ0aMTlrxwftJ0k= +go.opentelemetry.io/collector/connector/connectortest v0.115.0/go.mod h1:f3KQXXNlh/XuV8elmnuVVyfY92dJCAovz10gD72OH0k= +go.opentelemetry.io/collector/consumer v1.21.0 h1:THKZ2Vbi6GkamjTBI2hFq5Dc4kINZTWGwQNa8d/Ty9g= +go.opentelemetry.io/collector/consumer v1.21.0/go.mod h1:FQcC4ThMtRYY41dv+IPNK8POLLhAFY3r1YR5fuP7iiY= +go.opentelemetry.io/collector/consumer/consumererror v0.115.0 h1:yli//xBCQMPZKXNgNlXemo4dvqhnFrAmCZ11DvQgmcY= +go.opentelemetry.io/collector/consumer/consumererror v0.115.0/go.mod h1:LwVzAvQ6ZVNG7mbOvurbAo+W/rKws0IcjOwriuZXqPE= +go.opentelemetry.io/collector/consumer/consumererror/consumererrorprofiles v0.115.0 h1:gaIhzpaGFWauiyznrQ3f++TbcdXxA5rpsX3L9uGjMM8= +go.opentelemetry.io/collector/consumer/consumererror/consumererrorprofiles v0.115.0/go.mod h1:7oXvuGBSawS5bc413lh1KEMcXkqBcrCqZQahOdnE24U= +go.opentelemetry.io/collector/consumer/consumerprofiles v0.115.0 h1:H3fDuyQW1t2HWHkz96WMBQJKUevypOCjBqnqtaAWyoA= +go.opentelemetry.io/collector/consumer/consumerprofiles v0.115.0/go.mod h1:IzEmZ91Tp7TBxVDq8Cc9xvLsmO7H08njr6Pu9P5d9ns= +go.opentelemetry.io/collector/consumer/consumertest v0.115.0 h1:hru0I2447y0TluCdwlKYFFtgcpyCnlM+LiOK1JZyA70= +go.opentelemetry.io/collector/consumer/consumertest v0.115.0/go.mod h1:ybjALRJWR6aKNOzEMy1T1ruCULVDEjj4omtOJMrH/kU= +go.opentelemetry.io/collector/exporter v0.115.0 h1:JnxfpOnsuqhTPKJXVKJLS1Cv3BiVrVLzpHOjJEQw+xw= +go.opentelemetry.io/collector/exporter v0.115.0/go.mod h1:xof3fHQK8wADhaKLIJcQ7ChZaFLNC+haRdPN0wgl6kY= +go.opentelemetry.io/collector/exporter/debugexporter v0.115.0 h1:gb9VMQhcbvYqp0SJ4Hp8R9XqOLNLsoTgNJCPKpNEaVc= +go.opentelemetry.io/collector/exporter/debugexporter v0.115.0/go.mod h1:H/HS1UJlcZPNBbOcrsGZc2sPdQDHtbOjHOxMtJkmlcU= +go.opentelemetry.io/collector/exporter/exporterhelper/exporterhelperprofiles v0.115.0 h1:fetbc740pODH6JW+H49SW0hiAJwQE+/B0SbuIlaY2rg= +go.opentelemetry.io/collector/exporter/exporterhelper/exporterhelperprofiles v0.115.0/go.mod h1:oEKZ/d5BeaCK6Made9iwaeqmlT4lRbJSlW9nhIn/TwM= +go.opentelemetry.io/collector/exporter/exporterprofiles v0.115.0 h1:lSQEleCn/q9eFufcuK61NdFKU70ZlgI9dBjPCO/4CrE= +go.opentelemetry.io/collector/exporter/exporterprofiles v0.115.0/go.mod h1:7l5K2AecimX2kx+nZC1gKG3QkP247CO1+SodmJ4fFkQ= +go.opentelemetry.io/collector/exporter/exportertest v0.115.0 h1:P9SMTUXQOtcaq40bGtnnAe14zRmR4/yUgj/Tb2BEf/k= +go.opentelemetry.io/collector/exporter/exportertest v0.115.0/go.mod h1:1jMZ9gFGXglb8wfNrBZIgd+RvpZhSyFwdfE+Jtf9w4U= +go.opentelemetry.io/collector/exporter/otlpexporter v0.115.0 h1:Kqr31VFrQvgEMzeg8T1JSXWacjUQoZph39efKN8jBpY= +go.opentelemetry.io/collector/exporter/otlpexporter v0.115.0/go.mod h1:5uy/gduFx2mH0GxJ84sY75NfzQJb9xYmgiL9Pf0dKF8= +go.opentelemetry.io/collector/exporter/otlphttpexporter v0.115.0 h1:I0qzSWGbgph+iva5/jU8tkeUTkkqqcj8+UzMxg5ubF8= +go.opentelemetry.io/collector/exporter/otlphttpexporter v0.115.0/go.mod h1:cUrv5EG12iOs5MXaecfi9K+ZATEELefpyZY6Hj4NlUo= +go.opentelemetry.io/collector/extension v0.115.0 h1:/cBb8AUdD0KMWC6V3lvCC16eP9Fg0wd1Upcp5rgvuGI= +go.opentelemetry.io/collector/extension v0.115.0/go.mod h1:HI7Ak6loyi6ZrZPsQJW1OO1wbaAW8OqXLFNQlTZnreQ= +go.opentelemetry.io/collector/extension/auth v0.115.0 h1:TTMokbBsSHZRFH48PvGSJmgSS8F3Rkr9MWGHZn8eJDk= +go.opentelemetry.io/collector/extension/auth v0.115.0/go.mod h1:3w+2mzeb2OYNOO4Bi41TUo4jr32ap2y7AOq64IDpxQo= +go.opentelemetry.io/collector/extension/auth/authtest v0.115.0 h1:OZe7dKbZ01qodSpZU0ZYzI6zpmmzJ3UvfdBSFAbSgDw= +go.opentelemetry.io/collector/extension/auth/authtest v0.115.0/go.mod h1:fk9WCXP0x91Q64Z8HZKWTHh9PWtgoWE1KXe3n2Bff3U= +go.opentelemetry.io/collector/extension/experimental/storage v0.115.0 h1:sZXw0+77092pq24CkUoTRoHQPLQUsDq6HFRNB0g5yR4= +go.opentelemetry.io/collector/extension/experimental/storage v0.115.0/go.mod h1:qjFH7Y3QYYs88By2ZB5GMSUN5k3ul4Brrq2J6lKACA0= +go.opentelemetry.io/collector/extension/extensioncapabilities v0.115.0 h1:/g25Hp5aoCNKdDjIb3Fc7XRglO8yaBRFLO/IUNPnqNI= +go.opentelemetry.io/collector/extension/extensioncapabilities v0.115.0/go.mod h1:EQx7ETiy330O6q05S2KRZsRNDg0aQEeJmVl7Ipx+Fcw= +go.opentelemetry.io/collector/extension/extensiontest v0.115.0 h1:GBVFxFEskR8jSdu9uaQh2qpXnN5VNXhXjpJ2UjxtE8I= +go.opentelemetry.io/collector/extension/extensiontest v0.115.0/go.mod h1:eu1ecbz5mT+cHoH2H3GmD/rOO0WsicSJD2RLrYuOmRA= +go.opentelemetry.io/collector/extension/zpagesextension v0.115.0 h1:zYrZZocc7n0ZuDyXNkIaX0P0qk2fjMQj7NegwBJZA4k= +go.opentelemetry.io/collector/extension/zpagesextension v0.115.0/go.mod h1:OaXwNHF3MAcInBzCXrhXbTNHfIi9b7YGhXjtCFZqxNY= +go.opentelemetry.io/collector/featuregate v1.21.0 h1:+EULHPJDLMipcwAGZVp9Nm8NriRvoBBMxp7MSiIZVMI= +go.opentelemetry.io/collector/featuregate v1.21.0/go.mod h1:3GaXqflNDVwWndNGBJ1+XJFy3Fv/XrFgjMN60N3z7yg= +go.opentelemetry.io/collector/internal/fanoutconsumer v0.115.0 h1:6DRiSECeApFq6Jj5ug77rG53R6FzJEZBfygkyMEXdpg= +go.opentelemetry.io/collector/internal/fanoutconsumer v0.115.0/go.mod h1:vgQf5HQdmLQqpDHpDq2S3nTRoUuKtRcZpRTsy+UiwYw= +go.opentelemetry.io/collector/internal/sharedcomponent v0.115.0 h1:9TL6T6ALqDpumUJ0tYIuPIg5LGo4r6eoqlNArYX116o= +go.opentelemetry.io/collector/internal/sharedcomponent v0.115.0/go.mod h1:SgBLKMh11bOTPR1bdDZbi5MlqsoDBBFI3uBIwnei+0k= +go.opentelemetry.io/collector/otelcol v0.115.0 h1:wZhFGrSCZcTQ4qw4ePjI2PaSrOCejoQKAjprKD/xavs= +go.opentelemetry.io/collector/otelcol v0.115.0/go.mod h1:iK8DPvaizirIYKDl1zZG7DDYUj6GkkH4KHifVVM88vk= +go.opentelemetry.io/collector/otelcol/otelcoltest v0.115.0 h1:HNlFpQujlnvawBk8nvMGxzjDHWDCfSprxem/EpQn4u8= +go.opentelemetry.io/collector/otelcol/otelcoltest v0.115.0/go.mod h1:WsMbqYl2rm3nPFbdxQqyLXf4iu97nYLeuQ1seZIpV3Y= +go.opentelemetry.io/collector/pdata v1.21.0 h1:PG+UbiFMJ35X/WcAR7Rf/PWmWtRdW0aHlOidsR6c5MA= +go.opentelemetry.io/collector/pdata v1.21.0/go.mod h1:GKb1/zocKJMvxKbS+sl0W85lxhYBTFJ6h6I1tphVyDU= +go.opentelemetry.io/collector/pdata/pprofile v0.115.0 h1:NI89hy13vNDw7EOnQf7Jtitks4HJFO0SUWznTssmP94= +go.opentelemetry.io/collector/pdata/pprofile v0.115.0/go.mod h1:jGzdNfO0XTtfLjXCL/uCC1livg1LlfR+ix2WE/z3RpQ= +go.opentelemetry.io/collector/pdata/testdata v0.115.0 h1:Rblz+AKXdo3fG626jS+KSd0OSA4uMXcTQfpwed6P8LI= +go.opentelemetry.io/collector/pdata/testdata v0.115.0/go.mod h1:inNnRt6S2Nn260EfCBEcjesjlKOSsr0jPwkPqpBkt4s= +go.opentelemetry.io/collector/pipeline v0.115.0 h1:bmACBqb0e8U9ag+vGGHUP7kCfAO7HHROdtzIEg8ulus= +go.opentelemetry.io/collector/pipeline v0.115.0/go.mod h1:qE3DmoB05AW0C3lmPvdxZqd/H4po84NPzd5MrqgtL74= +go.opentelemetry.io/collector/pipeline/pipelineprofiles v0.115.0 h1:3l9ruCAOrssTUDnyChKNzHWOdTtfThnYaoPZ1/+5sD0= +go.opentelemetry.io/collector/pipeline/pipelineprofiles v0.115.0/go.mod h1:2Myg+law/5lcezo9PhhZ0wjCaLYdGK24s1jDWbSW9VY= +go.opentelemetry.io/collector/processor v0.115.0 h1:+fveHGRe24PZPv/F5taahGuZ9HdNW44hgNWEJhIUdyc= +go.opentelemetry.io/collector/processor v0.115.0/go.mod h1:/oLHBlLsm7tFb7zOIrA5C0j14yBtjXKAgxJJ2Bktyk4= +go.opentelemetry.io/collector/processor/batchprocessor v0.115.0 h1:dgw1jcE/YVFTs41b3Y7SerU3BBSyMEE93AYV+BAxR8E= +go.opentelemetry.io/collector/processor/batchprocessor v0.115.0/go.mod h1:imG1kDEq14UGlxyCjSCf1TUEFdSWRvF7tLoYX9nixEQ= +go.opentelemetry.io/collector/processor/processorprofiles v0.115.0 h1:cCZAs+FXaebZPppqAN3m+X3etoSBL6NvyQo8l0hOZoo= +go.opentelemetry.io/collector/processor/processorprofiles v0.115.0/go.mod h1:kMxF0gknlWX4duuAJFi2/HuIRi6C3w95tOenRa0GKOY= +go.opentelemetry.io/collector/processor/processortest v0.115.0 h1:j9HEaYFOeOB6VYl9zGhBnhQbTkqGBa2udUvu5NTh6hc= +go.opentelemetry.io/collector/processor/processortest v0.115.0/go.mod h1:Gws+VEnp/eW3qAqPpqbKsrbnnxxNfyDjqrfUXbZfZic= +go.opentelemetry.io/collector/receiver v0.115.0 h1:55Q3Jvj6zHCIA1psKqi/3kEMJO4OqUF5tNAEYNdB1U8= +go.opentelemetry.io/collector/receiver v0.115.0/go.mod h1:nBSCh2O/WUcfgpJ+Jpz+B0z0Hn5jHeRvF2WmLij5EIY= +go.opentelemetry.io/collector/receiver/nopreceiver v0.115.0 h1:87dxAcHekbXqLtjcQjnK1An2PWkWAhTly+EXzPEgYOE= +go.opentelemetry.io/collector/receiver/nopreceiver v0.115.0/go.mod h1:Llu88KNSNwvmYPRr2PMDDbVY9zHfHEbPPB4yTjjQQe0= +go.opentelemetry.io/collector/receiver/otlpreceiver v0.115.0 h1:NqMWsGuVy6y6VKTaPeJS7NZ9KAxhE/xyGUC7GaLYm/o= +go.opentelemetry.io/collector/receiver/otlpreceiver v0.115.0/go.mod h1:9ituzngnjsh/YvO+Phayq9BTk/nw0rgK5ZVvX1oxULk= +go.opentelemetry.io/collector/receiver/receiverprofiles v0.115.0 h1:R9JLaj2Al93smIPUkbJshAkb/cY0H5JBOxIx+Zu0NG4= +go.opentelemetry.io/collector/receiver/receiverprofiles v0.115.0/go.mod h1:05E5hGujWeeXJmzKZwTdHyZ/+rRyrQlQB5p5Q2XY39M= +go.opentelemetry.io/collector/receiver/receivertest v0.115.0 h1:OiB684SbHQi6/Pd3ZH0cXjYvCpBS9ilQBfTQx0wVXHg= +go.opentelemetry.io/collector/receiver/receivertest v0.115.0/go.mod h1:Y8Z9U/bz9Xpyt8GI8DxZZgryw3mnnIw+AeKVLTD2cP8= +go.opentelemetry.io/collector/semconv v0.115.0 h1:SoqMvg4ZEB3mz2EdAb6XYa+TuMo5Mir5FRBr3nVFUDY= +go.opentelemetry.io/collector/semconv v0.115.0/go.mod h1:N6XE8Q0JKgBN2fAhkUQtqK9LT7rEGR6+Wu/Rtbal1iI= +go.opentelemetry.io/collector/service v0.115.0 h1:k4GAOiI5tZgB2QKgwA6c3TeAVr7QL/ft5cOQbzUr8Iw= +go.opentelemetry.io/collector/service v0.115.0/go.mod h1:DKde9LMhNebdREecDSsqiTFLI2wRc+IoV4/wGxU6goY= go.opentelemetry.io/contrib/bridges/otelzap v0.6.0 h1:j8icMXyyqNf6HGuwlYhniPnVsbJIq7n+WirDu3VAJdQ= go.opentelemetry.io/contrib/bridges/otelzap v0.6.0/go.mod h1:evIOZpl+kAlU5IsaYX2Siw+IbpacAZvXemVsgt70uvw= go.opentelemetry.io/contrib/config v0.10.0 h1:2JknAzMaYjxrHkTnZh3eOme/Y2P5eHE2SWfhfV6Xd6c= @@ -1053,8 +1055,8 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= -golang.org/x/crypto v0.29.0 h1:L5SG1JTTXupVV3n6sUqMTeWbjAyfPwoda2DLX8J8FrQ= -golang.org/x/crypto v0.29.0/go.mod h1:+F4F4N5hv6v38hfeYwTdx20oUvLLc+QfrE9Ax9HtgRg= +golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U= +golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1065,8 +1067,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f h1:XdNn9LlyWAhLVp6P/i8QYBW+hlyhrhei9uErw2B5GJo= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f/go.mod h1:D5SMRVC3C2/4+F/DB1wZsLRnSNimn2Sp/NPsCrsv8ak= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884 h1:Y/Mj/94zIQQGHVSv1tTtQBDaQaJe62U9bkDZKKyhPCU= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -1137,8 +1139,8 @@ golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= -golang.org/x/net v0.31.0 h1:68CPQngjLL0r2AlUKiSxtQFKvzRVbnzLwMUn5SzcLHo= -golang.org/x/net v0.31.0/go.mod h1:P4fl1q7dY2hnZFxEk4pPSkDHF+QqjitcnDjUQyMM+pM= +golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= +golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1160,8 +1162,8 @@ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.9.0 h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ= -golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= +golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1228,16 +1230,16 @@ golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.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= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= -golang.org/x/term v0.26.0 h1:WEQa6V3Gja/BhNxg540hBip/kkaYtRg3cxg4oXSw4AU= -golang.org/x/term v0.26.0/go.mod h1:Si5m1o57C5nBNQo5z1iq+XDijt21BDBDp2bK0QI8e3E= +golang.org/x/term v0.27.0 h1:WP60Sv1nlK1T6SupCHbXzSaN0b9wUmsPoRS9b61A23Q= +golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1249,8 +1251,8 @@ golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= -golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1308,8 +1310,8 @@ golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.27.0 h1:qEKojBykQkQ4EynWy4S8Weg69NumxKdn40Fce3uc/8o= -golang.org/x/tools v0.27.0/go.mod h1:sUi0ZgbwW9ZPAq26Ekut+weQPR5eIM6GQLQ1Yjm1H0Q= +golang.org/x/tools v0.28.0 h1:WuB6qZ4RPCQo5aP3WdKZS7i595EdWqWR8vqJTlwTVK8= +golang.org/x/tools v0.28.0/go.mod h1:dcIOrVd3mfQKTgrDVQHqCPMWy6lnhfhtX3hLXYVLfRw= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1447,12 +1449,12 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.31.2 h1:3wLBbL5Uom/8Zy98GRPXpJ254nEFpl+hwndmk9RwmL0= -k8s.io/api v0.31.2/go.mod h1:bWmGvrGPssSK1ljmLzd3pwCQ9MgoTsRCuK35u6SygUk= -k8s.io/apimachinery v0.31.2 h1:i4vUt2hPK56W6mlT7Ry+AO8eEsyxMD1U44NR22CLTYw= -k8s.io/apimachinery v0.31.2/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo= -k8s.io/client-go v0.31.2 h1:Y2F4dxU5d3AQj+ybwSMqQnpZH9F30//1ObxOKlTI9yc= -k8s.io/client-go v0.31.2/go.mod h1:NPa74jSVR/+eez2dFsEIHNa+3o09vtNaWwWwb1qSxSs= +k8s.io/api v0.31.3 h1:umzm5o8lFbdN/hIXbrK9oRpOproJO62CV1zqxXrLgk8= +k8s.io/api v0.31.3/go.mod h1:UJrkIp9pnMOI9K2nlL6vwpxRzzEX5sWgn8kGQe92kCE= +k8s.io/apimachinery v0.31.3 h1:6l0WhcYgasZ/wk9ktLq5vLaoXJJr5ts6lkaQzgeYPq4= +k8s.io/apimachinery v0.31.3/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo= +k8s.io/client-go v0.31.3 h1:CAlZuM+PH2cm+86LOBemaJI/lQ5linJ6UFxKX/SoG+4= +k8s.io/client-go v0.31.3/go.mod h1:2CgjPUTpv3fE5dNygAr2NcM8nhHzXvxB8KL5gYc3kJs= k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kube-openapi v0.0.0-20240430033511-f0e62f92d13f h1:0LQagt0gDpKqvIkAMPaRGcXawNMouPECM1+F9BVxEaM= diff --git a/comp/otelcol/ddflareextension/impl/server.go b/comp/otelcol/ddflareextension/impl/server.go index ce1d2ceadef52..233dcddee1977 100644 --- a/comp/otelcol/ddflareextension/impl/server.go +++ b/comp/otelcol/ddflareextension/impl/server.go @@ -116,7 +116,7 @@ func newServer(endpoint string, handler http.Handler, auth bool) (*server, error // no easy way currently to pass required bearer auth token to OSS collector; // skip the validation if running inside a separate collector // TODO: determine way to allow OSS collector to authenticate with agent, OTEL-2226 - if auth { + if auth && util.GetAuthToken() != "" { r.Use(validateToken) } diff --git a/comp/otelcol/ddflareextension/impl/testdata/simple-dd/config-enhanced-result.yaml b/comp/otelcol/ddflareextension/impl/testdata/simple-dd/config-enhanced-result.yaml index 3f481997c9caa..055f7c67144eb 100644 --- a/comp/otelcol/ddflareextension/impl/testdata/simple-dd/config-enhanced-result.yaml +++ b/comp/otelcol/ddflareextension/impl/testdata/simple-dd/config-enhanced-result.yaml @@ -14,6 +14,7 @@ exporters: host_metadata: enabled: false hostname_source: config_or_system + reporter_period: 30m0s tags: [] hostname: "" http2_ping_timeout: 0s @@ -87,7 +88,7 @@ exporters: peer_service_aggregation: false peer_tags: [] peer_tags_aggregation: false - span_name_as_resource_name: true + span_name_as_resource_name: false span_name_remappings: {} trace_buffer: 0 write_buffer_size: 0 diff --git a/comp/otelcol/ddflareextension/impl/testdata/simple-dd/config-provided-result.yaml b/comp/otelcol/ddflareextension/impl/testdata/simple-dd/config-provided-result.yaml index 620eda80c3ba5..d0b9a8b4b3aa8 100644 --- a/comp/otelcol/ddflareextension/impl/testdata/simple-dd/config-provided-result.yaml +++ b/comp/otelcol/ddflareextension/impl/testdata/simple-dd/config-provided-result.yaml @@ -14,6 +14,7 @@ exporters: host_metadata: enabled: false hostname_source: config_or_system + reporter_period: 30m0s tags: [] hostname: "" http2_ping_timeout: 0s @@ -87,7 +88,7 @@ exporters: peer_service_aggregation: false peer_tags: [] peer_tags_aggregation: false - span_name_as_resource_name: true + span_name_as_resource_name: false span_name_remappings: {} trace_buffer: 0 write_buffer_size: 0 diff --git a/comp/otelcol/logsagentpipeline/go.mod b/comp/otelcol/logsagentpipeline/go.mod index 0b8f861795c6c..53814bc1fe4d7 100644 --- a/comp/otelcol/logsagentpipeline/go.mod +++ b/comp/otelcol/logsagentpipeline/go.mod @@ -63,7 +63,7 @@ replace ( require github.com/DataDog/datadog-agent/pkg/logs/pipeline v0.56.0-rc.3 require ( - github.com/DataDog/agent-payload/v5 v5.0.137 // indirect + github.com/DataDog/agent-payload/v5 v5.0.138 // indirect github.com/DataDog/datadog-agent/comp/core/hostname/hostnameinterface v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/comp/core/secrets v0.59.0 // indirect github.com/DataDog/datadog-agent/comp/core/telemetry v0.56.0-rc.3 // indirect @@ -96,48 +96,48 @@ require ( github.com/DataDog/datadog-agent/pkg/util/fxutil v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/http v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/log v0.59.1 // indirect github.com/DataDog/datadog-agent/pkg/util/optional v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/pointer v0.59.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.1 // indirect github.com/DataDog/datadog-agent/pkg/util/startstop v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/pkg/util/statstracker v0.56.0-rc.3 // indirect 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.0 // indirect - github.com/DataDog/datadog-agent/pkg/version v0.56.0-rc.3 // 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/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 github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hashicorp/hcl v1.0.1-vault-5 // indirect - github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 // indirect + github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 // indirect github.com/klauspost/compress v1.17.11 // indirect - github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c // indirect + github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c // indirect github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect 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/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect github.com/prometheus/client_golang v1.20.5 // indirect 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 @@ -152,10 +152,10 @@ require ( go.uber.org/fx v1.23.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect - golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f // indirect - golang.org/x/net v0.31.0 // indirect - golang.org/x/sys v0.27.0 // indirect - golang.org/x/text v0.20.0 // indirect + golang.org/x/exp v0.0.0-20241210194714-1829a127f884 // indirect + golang.org/x/net v0.33.0 // indirect + golang.org/x/sys v0.28.0 // indirect + golang.org/x/text v0.21.0 // indirect google.golang.org/protobuf v1.35.2 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/comp/otelcol/logsagentpipeline/go.sum b/comp/otelcol/logsagentpipeline/go.sum index 97219095a045b..c49694b4b2b0c 100644 --- a/comp/otelcol/logsagentpipeline/go.sum +++ b/comp/otelcol/logsagentpipeline/go.sum @@ -1,11 +1,11 @@ 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/agent-payload/v5 v5.0.137 h1:nV02RrYj6AwlQBGIEv6yG23CuxGtG0YWoFZAVE6vwxY= -github.com/DataDog/agent-payload/v5 v5.0.137/go.mod h1:lxh9lb5xYrBXjblpIWYUi4deJqVbkIfkjwesi5nskDc= +github.com/DataDog/agent-payload/v5 v5.0.138 h1:Wg7hmWuoLC/o0X3zZ+uGcfRHPyaytljudgSY9O59zjc= +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= @@ -77,7 +79,6 @@ github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/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= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -97,8 +98,8 @@ github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9 github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/hcl v1.0.1-vault-5 h1:kI3hhbbyzr4dldA8UdTb7ZlVVlI2DACdCfz31RPDgJM= github.com/hashicorp/hcl v1.0.1-vault-5/go.mod h1:XYhtn6ijBSAj6n4YqAaf7RBPS4I06AItNorpy+MoQNM= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 h1:S4qyfL2sEm5Budr4KVMyEniCy+PbS55651I/a+Kn/NQ= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb h1:PGufWXXDq9yaev6xX1YQauaO1MV90e6Mpoq1I7Lz/VM= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= @@ -125,8 +126,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -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/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a h1:3Bm7EwfUQUvhNeKIkUct/gl9eod1TcXuj8stxvi/GoI= +github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a/go.mod h1:ilwx/Dta8jXAgpFYFvSWEMwxmbWXyiUHkd5FwyKhb5k= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= @@ -153,8 +154,8 @@ github.com/pkg/errors v0.8.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-20220216144756-c35f1ee13d7c h1:NRoLoZvkBTKvR5gQLgA3e0hqjkY9u1wm+iOL45VN/qI= -github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 h1:o4JXh1EVt9k/+g42oCprj/FisM4qX9L3sZB3upGN2ZU= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= @@ -186,12 +187,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= @@ -262,8 +259,8 @@ golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f h1:XdNn9LlyWAhLVp6P/i8QYBW+hlyhrhei9uErw2B5GJo= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f/go.mod h1:D5SMRVC3C2/4+F/DB1wZsLRnSNimn2Sp/NPsCrsv8ak= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884 h1:Y/Mj/94zIQQGHVSv1tTtQBDaQaJe62U9bkDZKKyhPCU= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -284,8 +281,8 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20191002035440-2ec189313ef0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.31.0 h1:68CPQngjLL0r2AlUKiSxtQFKvzRVbnzLwMUn5SzcLHo= -golang.org/x/net v0.31.0/go.mod h1:P4fl1q7dY2hnZFxEk4pPSkDHF+QqjitcnDjUQyMM+pM= +golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= +golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -307,12 +304,12 @@ golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20220829200755-d48e67d00261/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.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/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= -golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= diff --git a/comp/otelcol/logsagentpipeline/logsagentpipelineimpl/agent.go b/comp/otelcol/logsagentpipeline/logsagentpipelineimpl/agent.go index d1910d28db034..b014d5b31689e 100644 --- a/comp/otelcol/logsagentpipeline/logsagentpipelineimpl/agent.go +++ b/comp/otelcol/logsagentpipeline/logsagentpipelineimpl/agent.go @@ -210,7 +210,7 @@ func (a *Agent) SetupPipeline( destinationsCtx := client.NewDestinationsContext() // setup the pipeline provider that provides pairs of processor and sender - pipelineProvider := pipeline.NewProvider(config.NumberOfPipelines, auditor, &diagnostic.NoopMessageReceiver{}, processingRules, a.endpoints, destinationsCtx, NewStatusProvider(), a.hostname, a.config) + pipelineProvider := pipeline.NewProvider(a.config.GetInt("logs_config.pipelines"), auditor, &diagnostic.NoopMessageReceiver{}, processingRules, a.endpoints, destinationsCtx, NewStatusProvider(), a.hostname, a.config) a.auditor = auditor a.destinationsCtx = destinationsCtx diff --git a/comp/otelcol/logsagentpipeline/logsagentpipelineimpl/go.mod b/comp/otelcol/logsagentpipeline/logsagentpipelineimpl/go.mod index ca80a71894cb3..cf11616c244d4 100644 --- a/comp/otelcol/logsagentpipeline/logsagentpipelineimpl/go.mod +++ b/comp/otelcol/logsagentpipeline/logsagentpipelineimpl/go.mod @@ -89,7 +89,7 @@ require ( ) require ( - github.com/DataDog/agent-payload/v5 v5.0.137 // indirect + github.com/DataDog/agent-payload/v5 v5.0.138 // indirect github.com/DataDog/datadog-agent/comp/core/flare/builder v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/comp/core/flare/types v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/comp/core/secrets v0.59.0 // indirect @@ -112,47 +112,47 @@ require ( github.com/DataDog/datadog-agent/pkg/util/filesystem v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/http v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/log v0.59.1 // indirect github.com/DataDog/datadog-agent/pkg/util/log/setup v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/pkg/util/pointer v0.59.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.1 // indirect github.com/DataDog/datadog-agent/pkg/util/statstracker v0.56.0-rc.3 // indirect 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.0 // indirect - github.com/DataDog/datadog-agent/pkg/version v0.56.0-rc.3 // 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/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 github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hashicorp/hcl v1.0.1-vault-5 // indirect - github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 // indirect + github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 // indirect github.com/klauspost/compress v1.17.11 // indirect - github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c // indirect + github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c // indirect github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect 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/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect github.com/prometheus/client_golang v1.20.5 // indirect 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 @@ -164,10 +164,10 @@ require ( go.uber.org/atomic v1.11.0 // indirect go.uber.org/dig v1.18.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f // indirect - golang.org/x/net v0.31.0 // indirect - golang.org/x/sys v0.27.0 // indirect - golang.org/x/text v0.20.0 // indirect + golang.org/x/exp v0.0.0-20241210194714-1829a127f884 // indirect + golang.org/x/net v0.33.0 // indirect + golang.org/x/sys v0.28.0 // indirect + golang.org/x/text v0.21.0 // indirect google.golang.org/protobuf v1.35.2 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/comp/otelcol/logsagentpipeline/logsagentpipelineimpl/go.sum b/comp/otelcol/logsagentpipeline/logsagentpipelineimpl/go.sum index 97219095a045b..c49694b4b2b0c 100644 --- a/comp/otelcol/logsagentpipeline/logsagentpipelineimpl/go.sum +++ b/comp/otelcol/logsagentpipeline/logsagentpipelineimpl/go.sum @@ -1,11 +1,11 @@ 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/agent-payload/v5 v5.0.137 h1:nV02RrYj6AwlQBGIEv6yG23CuxGtG0YWoFZAVE6vwxY= -github.com/DataDog/agent-payload/v5 v5.0.137/go.mod h1:lxh9lb5xYrBXjblpIWYUi4deJqVbkIfkjwesi5nskDc= +github.com/DataDog/agent-payload/v5 v5.0.138 h1:Wg7hmWuoLC/o0X3zZ+uGcfRHPyaytljudgSY9O59zjc= +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= @@ -77,7 +79,6 @@ github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/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= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -97,8 +98,8 @@ github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9 github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/hcl v1.0.1-vault-5 h1:kI3hhbbyzr4dldA8UdTb7ZlVVlI2DACdCfz31RPDgJM= github.com/hashicorp/hcl v1.0.1-vault-5/go.mod h1:XYhtn6ijBSAj6n4YqAaf7RBPS4I06AItNorpy+MoQNM= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 h1:S4qyfL2sEm5Budr4KVMyEniCy+PbS55651I/a+Kn/NQ= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb h1:PGufWXXDq9yaev6xX1YQauaO1MV90e6Mpoq1I7Lz/VM= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= @@ -125,8 +126,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -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/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a h1:3Bm7EwfUQUvhNeKIkUct/gl9eod1TcXuj8stxvi/GoI= +github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a/go.mod h1:ilwx/Dta8jXAgpFYFvSWEMwxmbWXyiUHkd5FwyKhb5k= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= @@ -153,8 +154,8 @@ github.com/pkg/errors v0.8.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-20220216144756-c35f1ee13d7c h1:NRoLoZvkBTKvR5gQLgA3e0hqjkY9u1wm+iOL45VN/qI= -github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 h1:o4JXh1EVt9k/+g42oCprj/FisM4qX9L3sZB3upGN2ZU= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= @@ -186,12 +187,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= @@ -262,8 +259,8 @@ golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f h1:XdNn9LlyWAhLVp6P/i8QYBW+hlyhrhei9uErw2B5GJo= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f/go.mod h1:D5SMRVC3C2/4+F/DB1wZsLRnSNimn2Sp/NPsCrsv8ak= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884 h1:Y/Mj/94zIQQGHVSv1tTtQBDaQaJe62U9bkDZKKyhPCU= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -284,8 +281,8 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20191002035440-2ec189313ef0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.31.0 h1:68CPQngjLL0r2AlUKiSxtQFKvzRVbnzLwMUn5SzcLHo= -golang.org/x/net v0.31.0/go.mod h1:P4fl1q7dY2hnZFxEk4pPSkDHF+QqjitcnDjUQyMM+pM= +golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= +golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -307,12 +304,12 @@ golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20220829200755-d48e67d00261/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.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/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= -golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= diff --git a/comp/otelcol/otlp/components/exporter/datadogexporter/factory.go b/comp/otelcol/otlp/components/exporter/datadogexporter/factory.go index 35cb0957daada..b32933f255ba3 100644 --- a/comp/otelcol/otlp/components/exporter/datadogexporter/factory.go +++ b/comp/otelcol/otlp/components/exporter/datadogexporter/factory.go @@ -119,7 +119,6 @@ func NewFactory( func CreateDefaultConfig() component.Config { ddcfg := datadogconfig.CreateDefaultConfig().(*datadogconfig.Config) ddcfg.Traces.TracesConfig.ComputeTopLevelBySpanKind = true - ddcfg.Traces.TracesConfig.SpanNameAsResourceName = true ddcfg.Logs.Endpoint = "https://agent-http-intake.logs.datadoghq.com" ddcfg.HostMetadata.Enabled = false return ddcfg diff --git a/comp/otelcol/otlp/components/exporter/datadogexporter/go.mod b/comp/otelcol/otlp/components/exporter/datadogexporter/go.mod index 109071e12c948..64b151661f2ba 100644 --- a/comp/otelcol/otlp/components/exporter/datadogexporter/go.mod +++ b/comp/otelcol/otlp/components/exporter/datadogexporter/go.mod @@ -12,6 +12,7 @@ replace ( github.com/DataDog/datadog-agent/comp/core/log/mock => ../../../../../core/log/mock github.com/DataDog/datadog-agent/comp/core/secrets => ../../../../../core/secrets github.com/DataDog/datadog-agent/comp/core/status => ../../../../../core/status + github.com/DataDog/datadog-agent/comp/core/tagger/origindetection => ../../../../../core/tagger/origindetection github.com/DataDog/datadog-agent/comp/core/telemetry => ../../../../../core/telemetry github.com/DataDog/datadog-agent/comp/def => ../../../../../def github.com/DataDog/datadog-agent/comp/forwarder/defaultforwarder => ../../../../../forwarder/defaultforwarder @@ -102,35 +103,35 @@ require ( github.com/DataDog/datadog-agent/pkg/proto v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/serializer v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/trace v0.56.0-rc.3 - github.com/DataDog/datadog-go/v5 v5.5.0 - github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.21.0 - github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.21.0 - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/datadog v0.114.0 + github.com/DataDog/datadog-go/v5 v5.6.0 + github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.22.0 + github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.22.0 + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/datadog v0.115.0 github.com/stretchr/testify v1.10.0 - go.opentelemetry.io/collector/component v0.114.0 - go.opentelemetry.io/collector/config/confignet v1.20.0 - go.opentelemetry.io/collector/config/configretry v1.20.0 - go.opentelemetry.io/collector/consumer v0.114.0 - go.opentelemetry.io/collector/exporter v0.114.0 - go.opentelemetry.io/collector/exporter/exportertest v0.114.0 - go.opentelemetry.io/collector/featuregate v1.20.0 - go.opentelemetry.io/collector/pdata v1.20.0 + go.opentelemetry.io/collector/component v0.115.0 + go.opentelemetry.io/collector/config/confignet v1.21.0 + go.opentelemetry.io/collector/config/configretry v1.21.0 + go.opentelemetry.io/collector/consumer v1.21.0 + go.opentelemetry.io/collector/exporter v0.115.0 + go.opentelemetry.io/collector/exporter/exportertest v0.115.0 + go.opentelemetry.io/collector/featuregate v1.21.0 + go.opentelemetry.io/collector/pdata v1.21.0 go.opentelemetry.io/otel/metric v1.32.0 go.opentelemetry.io/otel/trace v1.32.0 go.uber.org/zap v1.27.0 google.golang.org/protobuf v1.35.2 ) -require go.opentelemetry.io/collector/component/componenttest v0.114.0 // indirect +require go.opentelemetry.io/collector/component/componenttest v0.115.0 // indirect require ( github.com/pierrec/lz4/v4 v4.1.21 // indirect - go.opentelemetry.io/collector/consumer/consumererror v0.114.0 // indirect - go.opentelemetry.io/collector/receiver/receivertest v0.114.0 // indirect + go.opentelemetry.io/collector/consumer/consumererror v0.115.0 // indirect + go.opentelemetry.io/collector/receiver/receivertest v0.115.0 // indirect ) require ( - github.com/DataDog/agent-payload/v5 v5.0.137 // indirect + github.com/DataDog/agent-payload/v5 v5.0.138 // indirect github.com/DataDog/datadog-agent/comp/core/config v0.57.1 // indirect github.com/DataDog/datadog-agent/comp/core/flare/builder v0.57.1 // indirect github.com/DataDog/datadog-agent/comp/core/flare/types v0.57.1 // indirect @@ -138,6 +139,7 @@ require ( github.com/DataDog/datadog-agent/comp/core/log/def v0.0.0-00010101000000-000000000000 // indirect github.com/DataDog/datadog-agent/comp/core/secrets v0.59.0 // indirect github.com/DataDog/datadog-agent/comp/core/status v0.56.0-rc.3 // indirect + github.com/DataDog/datadog-agent/comp/core/tagger/origindetection v0.0.0-20241217122454-175edb6c74f2 // indirect github.com/DataDog/datadog-agent/comp/core/telemetry v0.57.1 // indirect github.com/DataDog/datadog-agent/comp/def v0.59.0 // indirect github.com/DataDog/datadog-agent/comp/forwarder/defaultforwarder v0.56.0-rc.3 // indirect @@ -186,26 +188,26 @@ require ( github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/http v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/pkg/util/json v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/log v0.59.1 // indirect github.com/DataDog/datadog-agent/pkg/util/optional v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/pointer v0.59.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.1 // indirect github.com/DataDog/datadog-agent/pkg/util/sort v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/pkg/util/startstop v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/pkg/util/statstracker v0.56.0-rc.3 // indirect 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.0 // indirect - github.com/DataDog/datadog-agent/pkg/version v0.57.1 // indirect - github.com/DataDog/datadog-api-client-go/v2 v2.31.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/datadog-api-client-go/v2 v2.33.0 // indirect github.com/DataDog/dd-sensitive-data-scanner/sds-go/go v0.0.0-20240816154533-f7f9beb53a42 // indirect github.com/DataDog/go-sqllexer v0.0.17 // indirect github.com/DataDog/go-tuf v1.1.0-0.5.2 // indirect github.com/DataDog/mmh3 v0.0.0-20210722141835-012dc69a9e49 // indirect - 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/opentelemetry-mapping-go/pkg/otlp/logs v0.22.0 // indirect + github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.22.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 +222,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 @@ -238,7 +241,7 @@ require ( github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hashicorp/go-version v1.7.0 // indirect github.com/hashicorp/hcl v1.0.1-vault-5 // indirect - github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 // indirect + github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 // indirect @@ -247,7 +250,7 @@ require ( github.com/knadh/koanf/maps v0.1.1 // indirect github.com/knadh/koanf/providers/confmap v0.1.0 // indirect github.com/knadh/koanf/v2 v2.1.2 // indirect - github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c // indirect + github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect @@ -259,16 +262,16 @@ require ( github.com/modern-go/reflect2 v1.0.2 // indirect github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.114.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/resourcetotelemetry v0.114.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/resourcetotelemetry v0.115.0 // indirect github.com/opencontainers/runtime-spec v1.2.0 // indirect github.com/outcaste-io/ristretto v0.2.3 // indirect github.com/patrickmn/go-cache v2.1.0+incompatible // indirect github.com/pelletier/go-toml v1.9.5 // indirect github.com/philhofer/fwd v1.1.3-0.20240916144458-20a13a1f6b7c // indirect github.com/pkg/errors v0.9.1 // indirect + github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // 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/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect github.com/prometheus/client_golang v1.20.5 // indirect github.com/prometheus/client_model v0.6.1 // indirect github.com/prometheus/common v0.60.1 // indirect @@ -276,8 +279,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 @@ -290,26 +292,26 @@ require ( github.com/tklauser/numcpus v0.8.0 // indirect github.com/twmb/murmur3 v1.1.8 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect - go.opentelemetry.io/collector/client v1.20.0 // indirect - go.opentelemetry.io/collector/config/configauth v0.114.0 // indirect - go.opentelemetry.io/collector/config/configcompression v1.20.0 // indirect - go.opentelemetry.io/collector/config/confighttp v0.114.0 // indirect - go.opentelemetry.io/collector/config/configopaque v1.20.0 // indirect - go.opentelemetry.io/collector/config/configtelemetry v0.114.0 // indirect - go.opentelemetry.io/collector/config/configtls v1.20.0 // indirect - go.opentelemetry.io/collector/config/internal v0.114.0 // indirect - go.opentelemetry.io/collector/confmap v1.20.0 // indirect - go.opentelemetry.io/collector/consumer/consumerprofiles v0.114.0 // indirect - go.opentelemetry.io/collector/consumer/consumertest v0.114.0 // indirect - go.opentelemetry.io/collector/exporter/exporterprofiles v0.114.0 // indirect - go.opentelemetry.io/collector/extension v0.114.0 // indirect - go.opentelemetry.io/collector/extension/auth v0.114.0 // indirect - go.opentelemetry.io/collector/extension/experimental/storage v0.114.0 // indirect - go.opentelemetry.io/collector/pdata/pprofile v0.114.0 // indirect - go.opentelemetry.io/collector/pipeline v0.114.0 // indirect - go.opentelemetry.io/collector/receiver v0.114.0 // indirect - go.opentelemetry.io/collector/receiver/receiverprofiles v0.114.0 // indirect - go.opentelemetry.io/collector/semconv v0.114.0 // 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 + go.opentelemetry.io/collector/config/confighttp v0.115.0 // indirect + go.opentelemetry.io/collector/config/configopaque v1.21.0 // indirect + go.opentelemetry.io/collector/config/configtelemetry v0.115.0 // indirect + go.opentelemetry.io/collector/config/configtls v1.21.0 // indirect + go.opentelemetry.io/collector/config/internal v0.115.0 // indirect + go.opentelemetry.io/collector/confmap v1.21.0 // indirect + go.opentelemetry.io/collector/consumer/consumerprofiles v0.115.0 // indirect + go.opentelemetry.io/collector/consumer/consumertest v0.115.0 // indirect + go.opentelemetry.io/collector/exporter/exporterprofiles v0.115.0 // indirect + go.opentelemetry.io/collector/extension v0.115.0 // indirect + go.opentelemetry.io/collector/extension/auth v0.115.0 // indirect + go.opentelemetry.io/collector/extension/experimental/storage v0.115.0 // indirect + go.opentelemetry.io/collector/pdata/pprofile v0.115.0 // indirect + go.opentelemetry.io/collector/pipeline v0.115.0 // indirect + go.opentelemetry.io/collector/receiver v0.115.0 // indirect + go.opentelemetry.io/collector/receiver/receiverprofiles v0.115.0 // indirect + go.opentelemetry.io/collector/semconv v0.115.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.56.0 // indirect go.opentelemetry.io/otel v1.32.0 // indirect go.opentelemetry.io/otel/sdk v1.32.0 // indirect @@ -318,12 +320,12 @@ require ( go.uber.org/dig v1.18.0 // indirect go.uber.org/fx v1.23.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f // indirect - golang.org/x/net v0.31.0 // indirect + golang.org/x/exp v0.0.0-20241210194714-1829a127f884 // indirect + golang.org/x/net v0.33.0 // indirect golang.org/x/oauth2 v0.23.0 // indirect - golang.org/x/sys v0.27.0 // indirect - golang.org/x/term v0.26.0 // indirect - golang.org/x/text v0.20.0 // indirect + golang.org/x/sys v0.28.0 // indirect + golang.org/x/term v0.27.0 // indirect + golang.org/x/text v0.21.0 // indirect golang.org/x/time v0.8.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect google.golang.org/grpc v1.67.1 // indirect diff --git a/comp/otelcol/otlp/components/exporter/datadogexporter/go.sum b/comp/otelcol/otlp/components/exporter/datadogexporter/go.sum index 384aa70b24a81..b9ba20ea9106e 100644 --- a/comp/otelcol/otlp/components/exporter/datadogexporter/go.sum +++ b/comp/otelcol/otlp/components/exporter/datadogexporter/go.sum @@ -1,11 +1,11 @@ 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/agent-payload/v5 v5.0.137 h1:nV02RrYj6AwlQBGIEv6yG23CuxGtG0YWoFZAVE6vwxY= -github.com/DataDog/agent-payload/v5 v5.0.137/go.mod h1:lxh9lb5xYrBXjblpIWYUi4deJqVbkIfkjwesi5nskDc= -github.com/DataDog/datadog-api-client-go/v2 v2.31.0 h1:JfJhYlHfLzvauI8u6h23smTooWYe6quNhhg9gpTszWY= -github.com/DataDog/datadog-api-client-go/v2 v2.31.0/go.mod h1:d3tOEgUd2kfsr9uuHQdY+nXrWp4uikgTgVCPdKNK30U= -github.com/DataDog/datadog-go/v5 v5.5.0 h1:G5KHeB8pWBNXT4Jtw0zAkhdxEAWSpWH00geHI6LDrKU= -github.com/DataDog/datadog-go/v5 v5.5.0/go.mod h1:K9kcYBlxkcPP8tvvjZZKs/m1edNAUFzBbdpTUKfCsuw= +github.com/DataDog/agent-payload/v5 v5.0.138 h1:Wg7hmWuoLC/o0X3zZ+uGcfRHPyaytljudgSY9O59zjc= +github.com/DataDog/agent-payload/v5 v5.0.138/go.mod h1:lxh9lb5xYrBXjblpIWYUi4deJqVbkIfkjwesi5nskDc= +github.com/DataDog/datadog-api-client-go/v2 v2.33.0 h1:OI6kDnJeQmkjfGzxmP0XUQUxMD4tp6oAPXnnJ4VpgUM= +github.com/DataDog/datadog-api-client-go/v2 v2.33.0/go.mod h1:d3tOEgUd2kfsr9uuHQdY+nXrWp4uikgTgVCPdKNK30U= +github.com/DataDog/datadog-go/v5 v5.6.0 h1:2oCLxjF/4htd55piM75baflj/KoE6VYS7alEUqFvRDw= +github.com/DataDog/datadog-go/v5 v5.6.0/go.mod h1:K9kcYBlxkcPP8tvvjZZKs/m1edNAUFzBbdpTUKfCsuw= 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/go-sqllexer v0.0.17 h1:u47fJAVg/+5DA74ZW3w0Qu+3qXHd3GtnA8ZBYixdPrM= @@ -14,22 +14,22 @@ github.com/DataDog/go-tuf v1.1.0-0.5.2 h1:4CagiIekonLSfL8GMHRHcHudo1fQnxELS9g4ti github.com/DataDog/go-tuf v1.1.0-0.5.2/go.mod h1:zBcq6f654iVqmkk8n2Cx81E1JnNTMOAx1UEO/wZR+P0= 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/opentelemetry-mapping-go/pkg/inframetadata v0.21.0 h1:U+p1i7+upWb4qOIOOvjS/92iMUGlSzEC1tRxVo0Lg8Y= -github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.21.0/go.mod h1:dOjp1lg4jwYyIbpnqW+DoOV8qD+70C+lgpINFvUqasQ= -github.com/DataDog/opentelemetry-mapping-go/pkg/internal/sketchtest v0.21.0 h1:VS4NTqwczwezMVvI6A7xYR3ugPmMUJ4FcdFrsdnZI2I= -github.com/DataDog/opentelemetry-mapping-go/pkg/internal/sketchtest v0.21.0/go.mod h1:66XlN7QpQKqIvw8e2UbCXV5X8wGnEw851nT9BjJ75dY= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.21.0 h1:hgbTFS6SkqbzOiWSfP58dZ/Jpjlmv6dpD4+V4LDHm2Q= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.21.0/go.mod h1:dvIWN9pA2zWNTw5rhDWZgzZnhcfpH++d+8d1SWW6xkY= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.21.0 h1:XD9Kd+baO66+tfbdanOFSMGEfwWfnrn/IxG/Dc5bv5I= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.21.0/go.mod h1:9ByLz9jISc176DzjIdaRfRKwaitqF8ie6RTvfP8Aufo= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.21.0 h1:8nW8jfcCIWzxWrpI31C0QYoOjTaUGp6USCwiRbP5Fp4= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.21.0/go.mod h1:wuatEozcLYinJ0WYf0MlVTFtTzEmf+qyJet0H9foVAs= -github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.21.0 h1:/Dp1WBvekdusS9Tw9pLE7RG04eluNktQ29arLS4SpGM= -github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.21.0/go.mod h1:asNuwNy1O2HbadkcZVuqmFGonfEzXS/SBvOo8V1MJvQ= +github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.22.0 h1:r1Dx2cRHCBWkVluSZA41i4eoI/nOGbcrrZdkqWjoFCc= +github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.22.0/go.mod h1:+/dkO8ZiMa8rfm4SmtTF6qPUdBbBcvsWWKaO4xPKAIk= +github.com/DataDog/opentelemetry-mapping-go/pkg/internal/sketchtest v0.22.0 h1:cXcKVEU1D0HlguR7GunnvuI70TghkarCa9DApqzMY94= +github.com/DataDog/opentelemetry-mapping-go/pkg/internal/sketchtest v0.22.0/go.mod h1:ES00EXfyEKgUkjd93tAXCxJA6i0seeOhZoS5Cj2qzzg= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.22.0 h1:yfk2cF8Bx98fSFpGrehEHh1FRqewfxcCTAbUDt5r3F8= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.22.0/go.mod h1:9qzpnBSxSOnKzbF/uHket3SSlQihQHix/ZRC2nZUUYQ= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.22.0 h1:Zqj8YUZ/ualUhM8GDCQX6xKnUJKEiG0eYdFGWmIDG30= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.22.0/go.mod h1:lpr4q6g2TB0BHeLHaz/XleKm8YXQjuxiQEb9Q9HXXE0= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.22.0 h1:w9+ngZDYUMLW+GSRA8x1DvVbuMR+cwlGb8VLwZfgBGs= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.22.0/go.mod h1:UsfqLgiD6Sjhpjkg+YzAd+TdKUZ2m6ZZ8t+tEkLNTMA= +github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.22.0 h1:63SzQz9Ab8XJj8fQKQz6UZNBhOm8rucwzbDfwTVF6dQ= +github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.22.0/go.mod h1:E/PY/aQ6S/N5hBPHXZRGmovs5b1BSi4RHGNcB4yP/Z0= 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= @@ -146,7 +148,6 @@ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5a github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/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= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -173,8 +174,8 @@ github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09 github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/hcl v1.0.1-vault-5 h1:kI3hhbbyzr4dldA8UdTb7ZlVVlI2DACdCfz31RPDgJM= github.com/hashicorp/hcl v1.0.1-vault-5/go.mod h1:XYhtn6ijBSAj6n4YqAaf7RBPS4I06AItNorpy+MoQNM= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 h1:S4qyfL2sEm5Budr4KVMyEniCy+PbS55651I/a+Kn/NQ= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb h1:PGufWXXDq9yaev6xX1YQauaO1MV90e6Mpoq1I7Lz/VM= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= @@ -213,8 +214,8 @@ github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0 github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/lightstep/go-expohisto v1.0.0 h1:UPtTS1rGdtehbbAF7o/dhkWLTDI73UifG8LbfQI7cA4= github.com/lightstep/go-expohisto v1.0.0/go.mod h1:xDXD0++Mu2FOaItXtdDfksfgxfV0z1TMPa+e/EUd0cs= -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/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a h1:3Bm7EwfUQUvhNeKIkUct/gl9eod1TcXuj8stxvi/GoI= +github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a/go.mod h1:ilwx/Dta8jXAgpFYFvSWEMwxmbWXyiUHkd5FwyKhb5k= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= @@ -246,20 +247,20 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.114.0 h1:d2wCLlENxH4I2axQWaogivx/5ZIjDYgn9MIf6sFxlJ4= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.114.0/go.mod h1:Psyligv8GKL9WI3TraW3BLwkOX4TRxaaa1BBQQyICzA= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/datadog v0.114.0 h1:Wq1iTmd0K1SSOIA43Wy2uAU6SB4f9ogyN3ZmvDgTURg= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/datadog v0.114.0/go.mod h1:VCj9H0QxRBWSgbl1pUo8p0NrqnmcxpPo0QjKLFtWkO0= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.114.0 h1:m8uPYU2rTj0sKiYgzCvIPajD3meiYsu+nX0hplUnlEU= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.114.0/go.mod h1:P0BaP92pXPkTyTmObfLYUoRBfMYU+i0hdS3oM1DpGJo= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.114.0 h1:Qg80zPfNMlub7LO07VMDElOu3M2oxqdZgvvB+X72a4U= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.114.0/go.mod h1:5qsGcjFV3WFI6J2onAlkR7Xd/8VtwJcECaDRZfW4Tb4= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/resourcetotelemetry v0.114.0 h1:PwUMZ6fHMEUV5i9hUly+z3UujDTTdxQtWzL0rWc/lgA= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/resourcetotelemetry v0.114.0/go.mod h1:YEHL6w4vvB9b0/lNwGjz8DyWXTF/7Xw0Hkgc3mGWwa8= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/sampling v0.114.0 h1:mtSN/07RGQPi1/zHVSZg4G0qRtOoJpPew5jsQWv9uS0= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/sampling v0.114.0/go.mod h1:C9Zgh/N3j4NR2D+1FGAA1YizhFW9OS51DwLUFJTdXN4= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/probabilisticsamplerprocessor v0.114.0 h1:I4ZYVRYW3Cjb65sPENZ9kHam/JUMXNEp2n/knJ0C0Vc= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/probabilisticsamplerprocessor v0.114.0/go.mod h1:4BhyIaOn2LS48WS+ZNix4TpP0+goq9gDEtGzth5Cr3M= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.115.0 h1:a36EJz/mb83f6ieX0v4fNDJ1jXqpeaM6DVQXeFDvdhw= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.115.0/go.mod h1:r5/40YO1eSP5ZreOmRzVOUtDr7YG39ZIUcVjHd+9Izc= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/datadog v0.115.0 h1:WOqt8NpU/JPGYDR4CiWx7g/sHV6Oe9FChzhushwmVdo= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/datadog v0.115.0/go.mod h1:wV/+iU7MyXcyTaY8K5Qx+1Z3yUzrxA40nydPQA476Iw= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.115.0 h1:MerLKMrkM4YoGF6Di0D9yMXO02yCX8mrZAi/+jJVVeI= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.115.0/go.mod h1:R8AkVWe9G5Q0oMOapvm9HNS076E3Min8SVlmhBL3QD0= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.115.0 h1:WEqcnWSy9dNSlGb8pYRBX7zhaz2ReyaeImlenbzNTB4= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.115.0/go.mod h1:6Mk71CakHUA3I6oM9hARDiyQypYyOolvb+4PFYyVEFg= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/resourcetotelemetry v0.115.0 h1:eoapW0JBablApkdv4C1RUuOKfz0U6SwuKMYYSAJH6fE= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/resourcetotelemetry v0.115.0/go.mod h1:hW2AaybTRcwxJySGLC3Fh1vd2VDaQhRBfa7O7w30NS8= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/sampling v0.115.0 h1:R9MRrO+dSkAHBQLZjuwjv2RHXHQqF2Wtm1Ki0VKD5cs= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/sampling v0.115.0/go.mod h1:rKXLXmwdUVcUHwTilroKSejbg3KSwLeYzNPSpkIEnv4= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/probabilisticsamplerprocessor v0.115.0 h1:vwZQ7k8oqlK0bdZYTsjP/59zjQQfjSD4fNsWIWsTu2w= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/probabilisticsamplerprocessor v0.115.0/go.mod h1:5ObSa9amrbzbYTdAK1Qhv3D/YqCxxnQhP0sk2eWB7Oo= github.com/opencontainers/runtime-spec v1.2.0 h1:z97+pHb3uELt/yiAWD691HNHQIF07bE7dzrbT927iTk= github.com/opencontainers/runtime-spec v1.2.0/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= @@ -278,11 +279,13 @@ github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 h1:GFCKgmp0tecUJ0sJuv4pzYCqS9+RGSn52M3FUwPs+uo= +github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10/go.mod h1:t/avpk3KcrXxUnYOhZhMXJlSEyie6gQbtLq5NM3loB8= 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-20220216144756-c35f1ee13d7c h1:NRoLoZvkBTKvR5gQLgA3e0hqjkY9u1wm+iOL45VN/qI= -github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 h1:o4JXh1EVt9k/+g42oCprj/FisM4qX9L3sZB3upGN2ZU= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= @@ -322,12 +325,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= @@ -394,80 +393,82 @@ github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1 github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0= github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.opentelemetry.io/collector/client v1.20.0 h1:o60wPcj5nLtaRenF+1E5p4QXFS3TDL6vHlw+GOon3rg= -go.opentelemetry.io/collector/client v1.20.0/go.mod h1:6aqkszco9FaLWCxyJEVam6PP7cUa8mPRIXeS5eZGj0U= -go.opentelemetry.io/collector/component v0.114.0 h1:SVGbm5LvHGSTEDv7p92oPuBgK5tuiWR82I9+LL4TtBE= -go.opentelemetry.io/collector/component v0.114.0/go.mod h1:MLxtjZ6UVHjDxSdhGLuJfHBHvfl1iT/Y7IaQPD24Eww= -go.opentelemetry.io/collector/component/componentstatus v0.114.0 h1:y9my/xink8KB5lK8zFAjgB2+pEh0QYy5TM972fxZY9w= -go.opentelemetry.io/collector/component/componentstatus v0.114.0/go.mod h1:RIoeCYZpPaae7QLE/1RacqzhHuXBmzRAk9H/EwYtIIs= -go.opentelemetry.io/collector/component/componenttest v0.114.0 h1:GM4FTTlfeXoVm6sZYBHImwlRN8ayh2oAfUhvaFj7Zo8= -go.opentelemetry.io/collector/component/componenttest v0.114.0/go.mod h1:ZZEJMtbJtoVC/3/9R1HzERq+cYQRxuMFQrPCpfZ4Xos= -go.opentelemetry.io/collector/config/configauth v0.114.0 h1:R2sJ6xpsLYGH0yU0vCxotzBYDKR/Hrjv0A7y9lwMyiw= -go.opentelemetry.io/collector/config/configauth v0.114.0/go.mod h1:3Z24KcCpG+WYCeQYfs/cNp5cP2BDeOqLCtOEgs/rPqM= -go.opentelemetry.io/collector/config/configcompression v1.20.0 h1:H/mvz7J/5z+O74YsO0t2tk+REnO2tzLM8TgIQ4AZ5w0= -go.opentelemetry.io/collector/config/configcompression v1.20.0/go.mod h1:pnxkFCLUZLKWzYJvfSwZnPrnm0twX14CYj2ADth5xiU= -go.opentelemetry.io/collector/config/confighttp v0.114.0 h1:DjGsBvVm+mGK3IpJBaXianWhwcxEC1fF33cpuC1LY/I= -go.opentelemetry.io/collector/config/confighttp v0.114.0/go.mod h1:nrlNLxOZ+4JQaV9j0TiqQV7LOHhrRivPrT8nQRHED3Q= -go.opentelemetry.io/collector/config/confignet v1.20.0 h1:LrM6AuiY8N/woTP4SWhL2V0562JXwJs9MRNFZJFLtRY= -go.opentelemetry.io/collector/config/confignet v1.20.0/go.mod h1:o3v4joAEjvLwntqexg5ixMqRrU1+Vst+jWuCUaBNgOg= -go.opentelemetry.io/collector/config/configopaque v1.20.0 h1:2I48zKiyyyYqjm7y0B9OLp24ku2ZSX3nCHG0r5FdWOQ= -go.opentelemetry.io/collector/config/configopaque v1.20.0/go.mod h1:6zlLIyOoRpJJ+0bEKrlZOZon3rOp5Jrz9fMdR4twOS4= -go.opentelemetry.io/collector/config/configretry v1.20.0 h1:z679mrMlW2a6tOOYPGdrS/QfALxdzWLQUOpH8Uu+D5Y= -go.opentelemetry.io/collector/config/configretry v1.20.0/go.mod h1:KvQF5cfphq1rQm1dKR4eLDNQYw6iI2fY72NMZVa+0N0= -go.opentelemetry.io/collector/config/configtelemetry v0.114.0 h1:kjLeyrumge6wsX6ZIkicdNOlBXaEyW2PI2ZdVXz/rzY= -go.opentelemetry.io/collector/config/configtelemetry v0.114.0/go.mod h1:R0MBUxjSMVMIhljuDHWIygzzJWQyZHXXWIgQNxcFwhc= -go.opentelemetry.io/collector/config/configtls v1.20.0 h1:hNlJdwfyY5Qe54RLJ41lfLqKTn9ypkR7sk7JNCcSe2U= -go.opentelemetry.io/collector/config/configtls v1.20.0/go.mod h1:sav/txSHguadTYlSSK+BJO2ljJeYEtRoBahgzWAguYg= -go.opentelemetry.io/collector/config/internal v0.114.0 h1:uWSDWTJb8T6xRjKD9/XmEARakXnxgYVYKUeId78hErc= -go.opentelemetry.io/collector/config/internal v0.114.0/go.mod h1:yC7E4h1Uj0SubxcFImh6OvBHFTjMh99+A5PuyIgDWqc= -go.opentelemetry.io/collector/confmap v1.20.0 h1:ARfOwmkKxFOud1njl03yAHQ30+uenlzqCO6LBYamDTE= -go.opentelemetry.io/collector/confmap v1.20.0/go.mod h1:DMpd9Ay/ffls3JoQBQ73vWeRsz1rNuLbwjo6WtjSQus= -go.opentelemetry.io/collector/consumer v0.114.0 h1:1zVaHvfIZowGwZRitRBRo3i+RP2StlU+GClYiofSw0Q= -go.opentelemetry.io/collector/consumer v0.114.0/go.mod h1:d+Mrzt9hsH1ub3zmwSlnQVPLeTYir4Mgo7CrWfnncN4= -go.opentelemetry.io/collector/consumer/consumererror v0.114.0 h1:r2YiELfWerb40FHD23V04gNjIkLUcjEKGxI4Vtm2iO4= -go.opentelemetry.io/collector/consumer/consumererror v0.114.0/go.mod h1:MzIrLQ5jptO2egypolhlAbZsWZr29WC4FhSxQjnxcvg= -go.opentelemetry.io/collector/consumer/consumerprofiles v0.114.0 h1:5pXYy3E6UK5Huu3aQbsYL8B6E6MyWx4fvXXDn+oXZaA= -go.opentelemetry.io/collector/consumer/consumerprofiles v0.114.0/go.mod h1:PMq3f54KcJQO4v1tue0QxQScu7REFVADlXxXSAYMiN0= -go.opentelemetry.io/collector/consumer/consumertest v0.114.0 h1:isaTwJK5DOy8Bs7GuLq23ejfgj8gLIo5dOUvkRnLF4g= -go.opentelemetry.io/collector/consumer/consumertest v0.114.0/go.mod h1:GNeLPkfRPdh06n/Rv1UKa/cAtCKjN0a7ADyHjIj4HFE= -go.opentelemetry.io/collector/exporter v0.114.0 h1:5/0BBpXuCJQSQ5SQf31g7j6T4XEKkyx9mZMcA2rS5e8= -go.opentelemetry.io/collector/exporter v0.114.0/go.mod h1:atpd0wWXgh5LAZ0REU/d/Ti/q50HDfnlBIjMjJQlKFg= -go.opentelemetry.io/collector/exporter/exporterprofiles v0.114.0 h1:/wmWOSBHcvtz3Pbv7+rWCqPPQuNvYaoidKKaOqZsLKs= -go.opentelemetry.io/collector/exporter/exporterprofiles v0.114.0/go.mod h1:epRYTkyJZTSQZBJflMGHUyUo2EdLPhsaZEyo5Qm848A= -go.opentelemetry.io/collector/exporter/exportertest v0.114.0 h1:vo0idBJT+QACSM1KpjVLm9VeiXVwO7y4UnMpGxN6EyM= -go.opentelemetry.io/collector/exporter/exportertest v0.114.0/go.mod h1:420ssFrhaphneybstbMeSIiqSRoaBARPgO71O17foaM= -go.opentelemetry.io/collector/extension v0.114.0 h1:9Qb92y8hD2WDC5aMDoj4JNQN+/5BQYJWPUPzLXX+iGw= -go.opentelemetry.io/collector/extension v0.114.0/go.mod h1:Yk2/1ptVgfTr12t+22v93nYJpioP14pURv2YercSzU0= -go.opentelemetry.io/collector/extension/auth v0.114.0 h1:1K2qh4yvG8kKR/sTAobI/rw5VxzPZoKcl3FmC195vvo= -go.opentelemetry.io/collector/extension/auth v0.114.0/go.mod h1:IjtsG+jUVJB0utKF8dAK8pLutRun3aEgASshImzsw/U= -go.opentelemetry.io/collector/extension/experimental/storage v0.114.0 h1:hLyX9UvmY0t6iBnk3CqvyNck2U0QjPACekj7pDRx2hA= -go.opentelemetry.io/collector/extension/experimental/storage v0.114.0/go.mod h1:WqYRQVJjJLE1rm+y/ks1wPdPRGWePEvE1VO07xm2J2k= -go.opentelemetry.io/collector/extension/extensiontest v0.114.0 h1:ibXDms1qrswlvlR6b3d2BeyI8sXUXoFV11yOi9Sop8o= -go.opentelemetry.io/collector/extension/extensiontest v0.114.0/go.mod h1:/bOYmqu5yTDfI1bJZUxFqm8ZtmcodpquebiSxiQxtDY= -go.opentelemetry.io/collector/featuregate v1.20.0 h1:Mi7nMy/q52eruI+6jWnMKUOeM55XvwoPnGcdB1++O8c= -go.opentelemetry.io/collector/featuregate v1.20.0/go.mod h1:47xrISO71vJ83LSMm8+yIDsUbKktUp48Ovt7RR6VbRs= -go.opentelemetry.io/collector/pdata v1.20.0 h1:ePcwt4bdtISP0loHaE+C9xYoU2ZkIvWv89Fob16o9SM= -go.opentelemetry.io/collector/pdata v1.20.0/go.mod h1:Ox1YVLe87cZDB/TL30i4SUz1cA5s6AM6SpFMfY61ICs= -go.opentelemetry.io/collector/pdata/pprofile v0.114.0 h1:pUNfTzsI/JUTiE+DScDM4lsrPoxnVNLI2fbTxR/oapo= -go.opentelemetry.io/collector/pdata/pprofile v0.114.0/go.mod h1:4aNcj6WM1n1uXyFSXlhVs4ibrERgNYsTbzcYI2zGhxA= -go.opentelemetry.io/collector/pdata/testdata v0.114.0 h1:+AzszWSL1i4K6meQ8rU0JDDW55SYCXa6FVqfDixhhTo= -go.opentelemetry.io/collector/pdata/testdata v0.114.0/go.mod h1:bv8XFdCTZxG2MQB5l9dKxSxf5zBrcodwO6JOy1+AxXM= -go.opentelemetry.io/collector/pipeline v0.114.0 h1:v3YOhc5z0tD6QbO5n/pnftpIeroihM2ks9Z2yKPCcwY= -go.opentelemetry.io/collector/pipeline v0.114.0/go.mod h1:4vOvjVsoYTHVGTbfFwqfnQOSV2K3RKUHofh3jNRc2Mg= -go.opentelemetry.io/collector/processor v0.114.0 h1:6bqQgLL7BtKrNv4YkEOGjZfkcfZv/ciJSQx1epGG9Zk= -go.opentelemetry.io/collector/processor v0.114.0/go.mod h1:DV/wa+nAmSHIDeD9NblPwkY9PbgtDQAZJ+PE5biZwPc= -go.opentelemetry.io/collector/processor/processorprofiles v0.114.0 h1:+P/1nLouEXTnN8DVQl+qWwO4BTkQyNPG9t/FrpUqrSI= -go.opentelemetry.io/collector/processor/processorprofiles v0.114.0/go.mod h1:3fuHeNIpINwx3bqFMprmDJyr6y5tWoWbJH599kltO5Y= -go.opentelemetry.io/collector/processor/processortest v0.114.0 h1:3FTaVXAp0LoVmUJn1ewBFckAby7AHa6/Kcdj0xuW14c= -go.opentelemetry.io/collector/processor/processortest v0.114.0/go.mod h1:OgsdOs1Fv5ZGTTJPF5nNIUJh2YkuV1acWd73yWgnti4= -go.opentelemetry.io/collector/receiver v0.114.0 h1:90SAnXAjNq7/k52/pFmmb06Cf1YauoPYtbio4aOXafY= -go.opentelemetry.io/collector/receiver v0.114.0/go.mod h1:KUGT0/D953LXbGH/D3lLPU8yrU3HfWnUqpt4W4hSOnE= -go.opentelemetry.io/collector/receiver/receiverprofiles v0.114.0 h1:ibhEfGpvNB3yrtpl2jYFabrunMk1hurxvMYpM0b1Ck4= -go.opentelemetry.io/collector/receiver/receiverprofiles v0.114.0/go.mod h1:UZyRfaasw+NLvN10AN8IQnmj5tQ3BOUH1uP2ctpO9f0= -go.opentelemetry.io/collector/receiver/receivertest v0.114.0 h1:D+Kh9t2n4asTnM+TiSxbrKlUemLZandWntj17BJWWb0= -go.opentelemetry.io/collector/receiver/receivertest v0.114.0/go.mod h1:mNSHQ13vFmqD+VAcRzLjStFBejbcWUn2Mp0pAd7Op+U= -go.opentelemetry.io/collector/semconv v0.114.0 h1:/eKcCJwZepQUtEuFuxa0thx2XIOvhFpaf214ZG1a11k= -go.opentelemetry.io/collector/semconv v0.114.0/go.mod h1:zCJ5njhWpejR+A40kiEoeFm1xq1uzyZwMnRNX6/D82A= +go.opentelemetry.io/collector/client v1.21.0 h1:3Kes8lOFMYVxoxeAmX+DTEAkuS1iTA3NkSfqzGmygJA= +go.opentelemetry.io/collector/client v1.21.0/go.mod h1:jYJGiL0UA975OOyHmjbQSokNWt1OiviI5KjPOMUMGwc= +go.opentelemetry.io/collector/component v0.115.0 h1:iLte1oCiXzjiCnaOBKdsXacfFiECecpWxW3/LeriMoo= +go.opentelemetry.io/collector/component v0.115.0/go.mod h1:oIUFiH7w1eOimdeYhFI+gAIxYSiLDocKVJ0PTvX7d6s= +go.opentelemetry.io/collector/component/componentstatus v0.115.0 h1:pbpUIL+uKDfEiSgKK+S5nuSL6MDIIQYsp4b65ZGVb9M= +go.opentelemetry.io/collector/component/componentstatus v0.115.0/go.mod h1:36A+9XSiOz0Cdhq+UwwPRlEr5CYuSkEnVO9om4BH7d0= +go.opentelemetry.io/collector/component/componenttest v0.115.0 h1:9URDJ9VyP6tuij+YHjp/kSSMecnZOd7oGvzu+rw9SJY= +go.opentelemetry.io/collector/component/componenttest v0.115.0/go.mod h1:PzXvNqKLCiSADZGZFKH+IOHMkaQ0GTHuzysfVbTPKYY= +go.opentelemetry.io/collector/config/configauth v0.115.0 h1:xa+ALdyPgva3rZnLBh1H2oS5MsHP6JxSqMtQmcELnys= +go.opentelemetry.io/collector/config/configauth v0.115.0/go.mod h1:C7anpb3Rf4KswMT+dgOzkW9UX0z/65PLORpUw3p0VYc= +go.opentelemetry.io/collector/config/configcompression v1.21.0 h1:0zbPdZAgPFMAarwJEC4gaR6f/JBP686A3TYSgb3oa+E= +go.opentelemetry.io/collector/config/configcompression v1.21.0/go.mod h1:LvYG00tbPTv0NOLoZN0wXq1F5thcxvukO8INq7xyfWU= +go.opentelemetry.io/collector/config/confighttp v0.115.0 h1:BIy394oNXnqySJwrCqgAJu4gWgAV5aQUDD6k1hy6C8o= +go.opentelemetry.io/collector/config/confighttp v0.115.0/go.mod h1:Wr50ut12NmCEAl4bWLJryw2EjUmJTtYRg89560Q51wc= +go.opentelemetry.io/collector/config/confignet v1.21.0 h1:PeQ5YrMnfftysFL/WVaSrjPOWjD6DfeABY50pf9CZxU= +go.opentelemetry.io/collector/config/confignet v1.21.0/go.mod h1:ZppUH1hgUJOubawEsxsQ9MzEYFytqo2GnVSS7d4CVxc= +go.opentelemetry.io/collector/config/configopaque v1.21.0 h1:PcvRGkBk4Px8BQM7tX+kw4i3jBsfAHGoGQbtZg6Ox7U= +go.opentelemetry.io/collector/config/configopaque v1.21.0/go.mod h1:sW0t0iI/VfRL9VYX7Ik6XzVgPcR+Y5kejTLsYcMyDWs= +go.opentelemetry.io/collector/config/configretry v1.21.0 h1:ZHoOvAkEcv5BBeaJn8IQ6rQ4GMPZWW4S+W7R4QTEbZU= +go.opentelemetry.io/collector/config/configretry v1.21.0/go.mod h1:cleBc9I0DIWpTiiHfu9v83FUaCTqcPXmebpLxjEIqro= +go.opentelemetry.io/collector/config/configtelemetry v0.115.0 h1:U07FinCDop+r2RjWQ3aP9ZWONC7r7kQIp1GkXQi6nsI= +go.opentelemetry.io/collector/config/configtelemetry v0.115.0/go.mod h1:SlBEwQg0qly75rXZ6W1Ig8jN25KBVBkFIIAUI1GiAAE= +go.opentelemetry.io/collector/config/configtls v1.21.0 h1:ZfrlAYgBD8lzp04W0GxwiDmUbrvKsvDYJi+wkyiXlpA= +go.opentelemetry.io/collector/config/configtls v1.21.0/go.mod h1:5EsNefPfVCMOTlOrr3wyj7LrsOgY7V8iqRl8oFZEqtw= +go.opentelemetry.io/collector/config/internal v0.115.0 h1:eVk57iufZpUXyPJFKTb1Ebx5tmcCyroIlt427r5pxS8= +go.opentelemetry.io/collector/config/internal v0.115.0/go.mod h1:OVkadRWlKAoWjHslqjWtBLAne8ceQm8WYT71ZcBWLFc= +go.opentelemetry.io/collector/confmap v1.21.0 h1:1tIcx2/Suwg8VhuPmQw87ba0ludPmumpFCFRZZa6RXA= +go.opentelemetry.io/collector/confmap v1.21.0/go.mod h1:Rrhs+MWoaP6AswZp+ReQ2VO9dfOfcUjdjiSHBsG+nec= +go.opentelemetry.io/collector/consumer v1.21.0 h1:THKZ2Vbi6GkamjTBI2hFq5Dc4kINZTWGwQNa8d/Ty9g= +go.opentelemetry.io/collector/consumer v1.21.0/go.mod h1:FQcC4ThMtRYY41dv+IPNK8POLLhAFY3r1YR5fuP7iiY= +go.opentelemetry.io/collector/consumer/consumererror v0.115.0 h1:yli//xBCQMPZKXNgNlXemo4dvqhnFrAmCZ11DvQgmcY= +go.opentelemetry.io/collector/consumer/consumererror v0.115.0/go.mod h1:LwVzAvQ6ZVNG7mbOvurbAo+W/rKws0IcjOwriuZXqPE= +go.opentelemetry.io/collector/consumer/consumerprofiles v0.115.0 h1:H3fDuyQW1t2HWHkz96WMBQJKUevypOCjBqnqtaAWyoA= +go.opentelemetry.io/collector/consumer/consumerprofiles v0.115.0/go.mod h1:IzEmZ91Tp7TBxVDq8Cc9xvLsmO7H08njr6Pu9P5d9ns= +go.opentelemetry.io/collector/consumer/consumertest v0.115.0 h1:hru0I2447y0TluCdwlKYFFtgcpyCnlM+LiOK1JZyA70= +go.opentelemetry.io/collector/consumer/consumertest v0.115.0/go.mod h1:ybjALRJWR6aKNOzEMy1T1ruCULVDEjj4omtOJMrH/kU= +go.opentelemetry.io/collector/exporter v0.115.0 h1:JnxfpOnsuqhTPKJXVKJLS1Cv3BiVrVLzpHOjJEQw+xw= +go.opentelemetry.io/collector/exporter v0.115.0/go.mod h1:xof3fHQK8wADhaKLIJcQ7ChZaFLNC+haRdPN0wgl6kY= +go.opentelemetry.io/collector/exporter/exporterprofiles v0.115.0 h1:lSQEleCn/q9eFufcuK61NdFKU70ZlgI9dBjPCO/4CrE= +go.opentelemetry.io/collector/exporter/exporterprofiles v0.115.0/go.mod h1:7l5K2AecimX2kx+nZC1gKG3QkP247CO1+SodmJ4fFkQ= +go.opentelemetry.io/collector/exporter/exportertest v0.115.0 h1:P9SMTUXQOtcaq40bGtnnAe14zRmR4/yUgj/Tb2BEf/k= +go.opentelemetry.io/collector/exporter/exportertest v0.115.0/go.mod h1:1jMZ9gFGXglb8wfNrBZIgd+RvpZhSyFwdfE+Jtf9w4U= +go.opentelemetry.io/collector/extension v0.115.0 h1:/cBb8AUdD0KMWC6V3lvCC16eP9Fg0wd1Upcp5rgvuGI= +go.opentelemetry.io/collector/extension v0.115.0/go.mod h1:HI7Ak6loyi6ZrZPsQJW1OO1wbaAW8OqXLFNQlTZnreQ= +go.opentelemetry.io/collector/extension/auth v0.115.0 h1:TTMokbBsSHZRFH48PvGSJmgSS8F3Rkr9MWGHZn8eJDk= +go.opentelemetry.io/collector/extension/auth v0.115.0/go.mod h1:3w+2mzeb2OYNOO4Bi41TUo4jr32ap2y7AOq64IDpxQo= +go.opentelemetry.io/collector/extension/auth/authtest v0.115.0 h1:OZe7dKbZ01qodSpZU0ZYzI6zpmmzJ3UvfdBSFAbSgDw= +go.opentelemetry.io/collector/extension/auth/authtest v0.115.0/go.mod h1:fk9WCXP0x91Q64Z8HZKWTHh9PWtgoWE1KXe3n2Bff3U= +go.opentelemetry.io/collector/extension/experimental/storage v0.115.0 h1:sZXw0+77092pq24CkUoTRoHQPLQUsDq6HFRNB0g5yR4= +go.opentelemetry.io/collector/extension/experimental/storage v0.115.0/go.mod h1:qjFH7Y3QYYs88By2ZB5GMSUN5k3ul4Brrq2J6lKACA0= +go.opentelemetry.io/collector/extension/extensiontest v0.115.0 h1:GBVFxFEskR8jSdu9uaQh2qpXnN5VNXhXjpJ2UjxtE8I= +go.opentelemetry.io/collector/extension/extensiontest v0.115.0/go.mod h1:eu1ecbz5mT+cHoH2H3GmD/rOO0WsicSJD2RLrYuOmRA= +go.opentelemetry.io/collector/featuregate v1.21.0 h1:+EULHPJDLMipcwAGZVp9Nm8NriRvoBBMxp7MSiIZVMI= +go.opentelemetry.io/collector/featuregate v1.21.0/go.mod h1:3GaXqflNDVwWndNGBJ1+XJFy3Fv/XrFgjMN60N3z7yg= +go.opentelemetry.io/collector/pdata v1.21.0 h1:PG+UbiFMJ35X/WcAR7Rf/PWmWtRdW0aHlOidsR6c5MA= +go.opentelemetry.io/collector/pdata v1.21.0/go.mod h1:GKb1/zocKJMvxKbS+sl0W85lxhYBTFJ6h6I1tphVyDU= +go.opentelemetry.io/collector/pdata/pprofile v0.115.0 h1:NI89hy13vNDw7EOnQf7Jtitks4HJFO0SUWznTssmP94= +go.opentelemetry.io/collector/pdata/pprofile v0.115.0/go.mod h1:jGzdNfO0XTtfLjXCL/uCC1livg1LlfR+ix2WE/z3RpQ= +go.opentelemetry.io/collector/pdata/testdata v0.115.0 h1:Rblz+AKXdo3fG626jS+KSd0OSA4uMXcTQfpwed6P8LI= +go.opentelemetry.io/collector/pdata/testdata v0.115.0/go.mod h1:inNnRt6S2Nn260EfCBEcjesjlKOSsr0jPwkPqpBkt4s= +go.opentelemetry.io/collector/pipeline v0.115.0 h1:bmACBqb0e8U9ag+vGGHUP7kCfAO7HHROdtzIEg8ulus= +go.opentelemetry.io/collector/pipeline v0.115.0/go.mod h1:qE3DmoB05AW0C3lmPvdxZqd/H4po84NPzd5MrqgtL74= +go.opentelemetry.io/collector/processor v0.115.0 h1:+fveHGRe24PZPv/F5taahGuZ9HdNW44hgNWEJhIUdyc= +go.opentelemetry.io/collector/processor v0.115.0/go.mod h1:/oLHBlLsm7tFb7zOIrA5C0j14yBtjXKAgxJJ2Bktyk4= +go.opentelemetry.io/collector/processor/processorprofiles v0.115.0 h1:cCZAs+FXaebZPppqAN3m+X3etoSBL6NvyQo8l0hOZoo= +go.opentelemetry.io/collector/processor/processorprofiles v0.115.0/go.mod h1:kMxF0gknlWX4duuAJFi2/HuIRi6C3w95tOenRa0GKOY= +go.opentelemetry.io/collector/processor/processortest v0.115.0 h1:j9HEaYFOeOB6VYl9zGhBnhQbTkqGBa2udUvu5NTh6hc= +go.opentelemetry.io/collector/processor/processortest v0.115.0/go.mod h1:Gws+VEnp/eW3qAqPpqbKsrbnnxxNfyDjqrfUXbZfZic= +go.opentelemetry.io/collector/receiver v0.115.0 h1:55Q3Jvj6zHCIA1psKqi/3kEMJO4OqUF5tNAEYNdB1U8= +go.opentelemetry.io/collector/receiver v0.115.0/go.mod h1:nBSCh2O/WUcfgpJ+Jpz+B0z0Hn5jHeRvF2WmLij5EIY= +go.opentelemetry.io/collector/receiver/receiverprofiles v0.115.0 h1:R9JLaj2Al93smIPUkbJshAkb/cY0H5JBOxIx+Zu0NG4= +go.opentelemetry.io/collector/receiver/receiverprofiles v0.115.0/go.mod h1:05E5hGujWeeXJmzKZwTdHyZ/+rRyrQlQB5p5Q2XY39M= +go.opentelemetry.io/collector/receiver/receivertest v0.115.0 h1:OiB684SbHQi6/Pd3ZH0cXjYvCpBS9ilQBfTQx0wVXHg= +go.opentelemetry.io/collector/receiver/receivertest v0.115.0/go.mod h1:Y8Z9U/bz9Xpyt8GI8DxZZgryw3mnnIw+AeKVLTD2cP8= +go.opentelemetry.io/collector/semconv v0.115.0 h1:SoqMvg4ZEB3mz2EdAb6XYa+TuMo5Mir5FRBr3nVFUDY= +go.opentelemetry.io/collector/semconv v0.115.0/go.mod h1:N6XE8Q0JKgBN2fAhkUQtqK9LT7rEGR6+Wu/Rtbal1iI= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.56.0 h1:UP6IpuHFkUgOQL9FFQFrZ+5LiwhhYRbi7VZSIx6Nj5s= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.56.0/go.mod h1:qxuZLtbq5QDtdeSHsS7bcf6EH6uO6jUAgk764zd3rhM= go.opentelemetry.io/otel v1.32.0 h1:WnBN+Xjcteh0zdk01SVqV55d/m62NJLJdIyb4y/WO5U= @@ -505,11 +506,11 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.29.0 h1:L5SG1JTTXupVV3n6sUqMTeWbjAyfPwoda2DLX8J8FrQ= -golang.org/x/crypto v0.29.0/go.mod h1:+F4F4N5hv6v38hfeYwTdx20oUvLLc+QfrE9Ax9HtgRg= +golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U= +golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f h1:XdNn9LlyWAhLVp6P/i8QYBW+hlyhrhei9uErw2B5GJo= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f/go.mod h1:D5SMRVC3C2/4+F/DB1wZsLRnSNimn2Sp/NPsCrsv8ak= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884 h1:Y/Mj/94zIQQGHVSv1tTtQBDaQaJe62U9bkDZKKyhPCU= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -532,8 +533,8 @@ golang.org/x/net v0.0.0-20191002035440-2ec189313ef0/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.31.0 h1:68CPQngjLL0r2AlUKiSxtQFKvzRVbnzLwMUn5SzcLHo= -golang.org/x/net v0.31.0/go.mod h1:P4fl1q7dY2hnZFxEk4pPSkDHF+QqjitcnDjUQyMM+pM= +golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= +golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.23.0 h1:PbgcYx2W7i4LvjJWEbf0ngHV6qJYr86PkAV3bXdLEbs= golang.org/x/oauth2 v0.23.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= @@ -566,15 +567,15 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220829200755-d48e67d00261/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.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= -golang.org/x/term v0.26.0 h1:WEQa6V3Gja/BhNxg540hBip/kkaYtRg3cxg4oXSw4AU= -golang.org/x/term v0.26.0/go.mod h1:Si5m1o57C5nBNQo5z1iq+XDijt21BDBDp2bK0QI8e3E= +golang.org/x/term v0.27.0 h1:WP60Sv1nlK1T6SupCHbXzSaN0b9wUmsPoRS9b61A23Q= +golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= -golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.8.0 h1:9i3RxcPv3PZnitoVGMPDKZSq1xW1gK1Xy3ArNOGZfEg= diff --git a/comp/otelcol/otlp/components/exporter/logsagentexporter/go.mod b/comp/otelcol/otlp/components/exporter/logsagentexporter/go.mod index 63514d6b9afdb..68f382570f8e6 100644 --- a/comp/otelcol/otlp/components/exporter/logsagentexporter/go.mod +++ b/comp/otelcol/otlp/components/exporter/logsagentexporter/go.mod @@ -47,21 +47,23 @@ require ( github.com/DataDog/datadog-agent/comp/otelcol/otlp/testutil v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/logs/message v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/logs/sources v0.56.0-rc.3 - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.0 - github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.21.0 - github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.21.0 + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.1 + github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.22.0 + github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.22.0 github.com/stormcat24/protodep v0.1.8 github.com/stretchr/testify v1.10.0 - go.opentelemetry.io/collector/component v0.114.0 - go.opentelemetry.io/collector/exporter v0.114.0 - go.opentelemetry.io/collector/exporter/exportertest v0.114.0 - go.opentelemetry.io/collector/pdata v1.20.0 + go.opentelemetry.io/collector/component v0.115.0 + go.opentelemetry.io/collector/exporter v0.115.0 + go.opentelemetry.io/collector/exporter/exportertest v0.115.0 + go.opentelemetry.io/collector/pdata v1.21.0 ) require ( - go.opentelemetry.io/collector/component/componenttest v0.114.0 // indirect - go.opentelemetry.io/collector/consumer/consumererror v0.114.0 // indirect - go.opentelemetry.io/collector/receiver/receivertest v0.114.0 // indirect + github.com/hashicorp/go-version v1.7.0 // indirect + go.opentelemetry.io/collector/component/componenttest v0.115.0 // indirect + go.opentelemetry.io/collector/consumer/consumererror v0.115.0 // indirect + go.opentelemetry.io/collector/featuregate v1.21.0 // indirect + go.opentelemetry.io/collector/receiver/receivertest v0.115.0 // indirect ) require ( @@ -80,24 +82,25 @@ require ( github.com/DataDog/datadog-agent/pkg/util/executable v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/filesystem v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.59.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/log v0.59.1 // indirect github.com/DataDog/datadog-agent/pkg/util/optional v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/pointer v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/statstracker v0.56.0-rc.3 // indirect 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.0 // indirect - github.com/DataDog/datadog-agent/pkg/version v0.56.0-rc.3 // indirect - 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/datadog-agent/pkg/util/winutil v0.59.1 // indirect + github.com/DataDog/datadog-agent/pkg/version v0.59.1 // indirect + github.com/DataDog/datadog-api-client-go/v2 v2.33.0 // indirect + github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.22.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 @@ -107,10 +110,10 @@ require ( github.com/gogo/protobuf v1.3.2 // indirect github.com/google/uuid v1.6.0 // indirect github.com/hashicorp/hcl v1.0.1-vault-5 // indirect - github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 // indirect + github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 // indirect - github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c // indirect + github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect @@ -120,10 +123,10 @@ require ( github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect github.com/pelletier/go-toml v1.9.5 // indirect github.com/philhofer/fwd v1.1.3-0.20240916144458-20a13a1f6b7c // indirect + github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // 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/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // 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 @@ -132,19 +135,19 @@ require ( 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 - go.opentelemetry.io/collector/config/configretry v1.20.0 // indirect - go.opentelemetry.io/collector/config/configtelemetry v0.114.0 // indirect - go.opentelemetry.io/collector/consumer v0.114.0 // indirect - go.opentelemetry.io/collector/consumer/consumerprofiles v0.114.0 // indirect - go.opentelemetry.io/collector/consumer/consumertest v0.114.0 // indirect - go.opentelemetry.io/collector/exporter/exporterprofiles v0.114.0 // indirect - go.opentelemetry.io/collector/extension v0.114.0 // indirect - go.opentelemetry.io/collector/extension/experimental/storage v0.114.0 // indirect - go.opentelemetry.io/collector/pdata/pprofile v0.114.0 // indirect - go.opentelemetry.io/collector/pipeline v0.114.0 // indirect - go.opentelemetry.io/collector/receiver v0.114.0 // indirect - go.opentelemetry.io/collector/receiver/receiverprofiles v0.114.0 // indirect - go.opentelemetry.io/collector/semconv v0.114.0 // indirect + go.opentelemetry.io/collector/config/configretry v1.21.0 // indirect + go.opentelemetry.io/collector/config/configtelemetry v0.115.0 // indirect + go.opentelemetry.io/collector/consumer v1.21.0 // indirect + go.opentelemetry.io/collector/consumer/consumerprofiles v0.115.0 // indirect + go.opentelemetry.io/collector/consumer/consumertest v0.115.0 // indirect + go.opentelemetry.io/collector/exporter/exporterprofiles v0.115.0 // indirect + go.opentelemetry.io/collector/extension v0.115.0 // indirect + go.opentelemetry.io/collector/extension/experimental/storage v0.115.0 // indirect + go.opentelemetry.io/collector/pdata/pprofile v0.115.0 // indirect + go.opentelemetry.io/collector/pipeline v0.115.0 // indirect + go.opentelemetry.io/collector/receiver v0.115.0 // indirect + go.opentelemetry.io/collector/receiver/receiverprofiles v0.115.0 // indirect + go.opentelemetry.io/collector/semconv v0.115.0 // indirect go.opentelemetry.io/otel v1.32.0 // indirect go.opentelemetry.io/otel/metric v1.32.0 // indirect go.opentelemetry.io/otel/sdk v1.32.0 // indirect @@ -153,12 +156,12 @@ require ( go.uber.org/atomic v1.11.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect - golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f // indirect - golang.org/x/net v0.31.0 // indirect + golang.org/x/exp v0.0.0-20241210194714-1829a127f884 // indirect + golang.org/x/net v0.33.0 // indirect golang.org/x/oauth2 v0.23.0 // indirect - golang.org/x/sys v0.27.0 // indirect - golang.org/x/term v0.26.0 // indirect - golang.org/x/text v0.20.0 // indirect + golang.org/x/sys v0.28.0 // indirect + golang.org/x/term v0.27.0 // indirect + golang.org/x/text v0.21.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect google.golang.org/grpc v1.67.1 // indirect google.golang.org/protobuf v1.35.2 // indirect diff --git a/comp/otelcol/otlp/components/exporter/logsagentexporter/go.sum b/comp/otelcol/otlp/components/exporter/logsagentexporter/go.sum index b27097f6ddcfe..f85a990c3b689 100644 --- a/comp/otelcol/otlp/components/exporter/logsagentexporter/go.sum +++ b/comp/otelcol/otlp/components/exporter/logsagentexporter/go.sum @@ -1,17 +1,17 @@ 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/datadog-api-client-go/v2 v2.31.0 h1:JfJhYlHfLzvauI8u6h23smTooWYe6quNhhg9gpTszWY= -github.com/DataDog/datadog-api-client-go/v2 v2.31.0/go.mod h1:d3tOEgUd2kfsr9uuHQdY+nXrWp4uikgTgVCPdKNK30U= -github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.21.0 h1:U+p1i7+upWb4qOIOOvjS/92iMUGlSzEC1tRxVo0Lg8Y= -github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.21.0/go.mod h1:dOjp1lg4jwYyIbpnqW+DoOV8qD+70C+lgpINFvUqasQ= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.21.0 h1:hgbTFS6SkqbzOiWSfP58dZ/Jpjlmv6dpD4+V4LDHm2Q= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.21.0/go.mod h1:dvIWN9pA2zWNTw5rhDWZgzZnhcfpH++d+8d1SWW6xkY= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.21.0 h1:XD9Kd+baO66+tfbdanOFSMGEfwWfnrn/IxG/Dc5bv5I= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.21.0/go.mod h1:9ByLz9jISc176DzjIdaRfRKwaitqF8ie6RTvfP8Aufo= +github.com/DataDog/datadog-api-client-go/v2 v2.33.0 h1:OI6kDnJeQmkjfGzxmP0XUQUxMD4tp6oAPXnnJ4VpgUM= +github.com/DataDog/datadog-api-client-go/v2 v2.33.0/go.mod h1:d3tOEgUd2kfsr9uuHQdY+nXrWp4uikgTgVCPdKNK30U= +github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.22.0 h1:r1Dx2cRHCBWkVluSZA41i4eoI/nOGbcrrZdkqWjoFCc= +github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.22.0/go.mod h1:+/dkO8ZiMa8rfm4SmtTF6qPUdBbBcvsWWKaO4xPKAIk= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.22.0 h1:yfk2cF8Bx98fSFpGrehEHh1FRqewfxcCTAbUDt5r3F8= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.22.0/go.mod h1:9qzpnBSxSOnKzbF/uHket3SSlQihQHix/ZRC2nZUUYQ= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.22.0 h1:Zqj8YUZ/ualUhM8GDCQX6xKnUJKEiG0eYdFGWmIDG30= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.22.0/go.mod h1:lpr4q6g2TB0BHeLHaz/XleKm8YXQjuxiQEb9Q9HXXE0= 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= @@ -98,7 +100,6 @@ github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/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= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -114,11 +115,13 @@ github.com/grpc-ecosystem/go-grpc-middleware v1.2.0/go.mod h1:mJzapYve32yjrKlk9G github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.13.0/go.mod h1:8XEsbTttt/W+VvjtQhLACqCisSPWTxCZ7sBRjU6iH9c= +github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY= +github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/hcl v1.0.1-vault-5 h1:kI3hhbbyzr4dldA8UdTb7ZlVVlI2DACdCfz31RPDgJM= github.com/hashicorp/hcl v1.0.1-vault-5/go.mod h1:XYhtn6ijBSAj6n4YqAaf7RBPS4I06AItNorpy+MoQNM= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 h1:S4qyfL2sEm5Budr4KVMyEniCy+PbS55651I/a+Kn/NQ= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb h1:PGufWXXDq9yaev6xX1YQauaO1MV90e6Mpoq1I7Lz/VM= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= @@ -143,8 +146,8 @@ 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-20220913051719-115f729f3c8c h1:VtwQ41oftZwlMnOEbMWQtSEUgU64U4s+GHk7hZK+jtY= -github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c/go.mod h1:JKx41uQRwqlTZabZc+kILPrO/3jlKnQ2Z8b7YiVw5cE= +github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a h1:3Bm7EwfUQUvhNeKIkUct/gl9eod1TcXuj8stxvi/GoI= +github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a/go.mod h1:ilwx/Dta8jXAgpFYFvSWEMwxmbWXyiUHkd5FwyKhb5k= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= @@ -178,11 +181,13 @@ github.com/philhofer/fwd v1.1.3-0.20240916144458-20a13a1f6b7c h1:dAMKvw0MlJT1Gsh github.com/philhofer/fwd v1.1.3-0.20240916144458-20a13a1f6b7c/go.mod h1:RqIHx9QI14HlwKwm98g9Re5prTQ6LdeRQn+gXJFxsJM= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 h1:GFCKgmp0tecUJ0sJuv4pzYCqS9+RGSn52M3FUwPs+uo= +github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10/go.mod h1:t/avpk3KcrXxUnYOhZhMXJlSEyie6gQbtLq5NM3loB8= 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-20220216144756-c35f1ee13d7c h1:NRoLoZvkBTKvR5gQLgA3e0hqjkY9u1wm+iOL45VN/qI= -github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 h1:o4JXh1EVt9k/+g42oCprj/FisM4qX9L3sZB3upGN2ZU= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= @@ -213,12 +218,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= @@ -272,50 +273,52 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0= github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.opentelemetry.io/collector/component v0.114.0 h1:SVGbm5LvHGSTEDv7p92oPuBgK5tuiWR82I9+LL4TtBE= -go.opentelemetry.io/collector/component v0.114.0/go.mod h1:MLxtjZ6UVHjDxSdhGLuJfHBHvfl1iT/Y7IaQPD24Eww= -go.opentelemetry.io/collector/component/componenttest v0.114.0 h1:GM4FTTlfeXoVm6sZYBHImwlRN8ayh2oAfUhvaFj7Zo8= -go.opentelemetry.io/collector/component/componenttest v0.114.0/go.mod h1:ZZEJMtbJtoVC/3/9R1HzERq+cYQRxuMFQrPCpfZ4Xos= -go.opentelemetry.io/collector/config/configretry v1.20.0 h1:z679mrMlW2a6tOOYPGdrS/QfALxdzWLQUOpH8Uu+D5Y= -go.opentelemetry.io/collector/config/configretry v1.20.0/go.mod h1:KvQF5cfphq1rQm1dKR4eLDNQYw6iI2fY72NMZVa+0N0= -go.opentelemetry.io/collector/config/configtelemetry v0.114.0 h1:kjLeyrumge6wsX6ZIkicdNOlBXaEyW2PI2ZdVXz/rzY= -go.opentelemetry.io/collector/config/configtelemetry v0.114.0/go.mod h1:R0MBUxjSMVMIhljuDHWIygzzJWQyZHXXWIgQNxcFwhc= -go.opentelemetry.io/collector/consumer v0.114.0 h1:1zVaHvfIZowGwZRitRBRo3i+RP2StlU+GClYiofSw0Q= -go.opentelemetry.io/collector/consumer v0.114.0/go.mod h1:d+Mrzt9hsH1ub3zmwSlnQVPLeTYir4Mgo7CrWfnncN4= -go.opentelemetry.io/collector/consumer/consumererror v0.114.0 h1:r2YiELfWerb40FHD23V04gNjIkLUcjEKGxI4Vtm2iO4= -go.opentelemetry.io/collector/consumer/consumererror v0.114.0/go.mod h1:MzIrLQ5jptO2egypolhlAbZsWZr29WC4FhSxQjnxcvg= -go.opentelemetry.io/collector/consumer/consumerprofiles v0.114.0 h1:5pXYy3E6UK5Huu3aQbsYL8B6E6MyWx4fvXXDn+oXZaA= -go.opentelemetry.io/collector/consumer/consumerprofiles v0.114.0/go.mod h1:PMq3f54KcJQO4v1tue0QxQScu7REFVADlXxXSAYMiN0= -go.opentelemetry.io/collector/consumer/consumertest v0.114.0 h1:isaTwJK5DOy8Bs7GuLq23ejfgj8gLIo5dOUvkRnLF4g= -go.opentelemetry.io/collector/consumer/consumertest v0.114.0/go.mod h1:GNeLPkfRPdh06n/Rv1UKa/cAtCKjN0a7ADyHjIj4HFE= -go.opentelemetry.io/collector/exporter v0.114.0 h1:5/0BBpXuCJQSQ5SQf31g7j6T4XEKkyx9mZMcA2rS5e8= -go.opentelemetry.io/collector/exporter v0.114.0/go.mod h1:atpd0wWXgh5LAZ0REU/d/Ti/q50HDfnlBIjMjJQlKFg= -go.opentelemetry.io/collector/exporter/exporterprofiles v0.114.0 h1:/wmWOSBHcvtz3Pbv7+rWCqPPQuNvYaoidKKaOqZsLKs= -go.opentelemetry.io/collector/exporter/exporterprofiles v0.114.0/go.mod h1:epRYTkyJZTSQZBJflMGHUyUo2EdLPhsaZEyo5Qm848A= -go.opentelemetry.io/collector/exporter/exportertest v0.114.0 h1:vo0idBJT+QACSM1KpjVLm9VeiXVwO7y4UnMpGxN6EyM= -go.opentelemetry.io/collector/exporter/exportertest v0.114.0/go.mod h1:420ssFrhaphneybstbMeSIiqSRoaBARPgO71O17foaM= -go.opentelemetry.io/collector/extension v0.114.0 h1:9Qb92y8hD2WDC5aMDoj4JNQN+/5BQYJWPUPzLXX+iGw= -go.opentelemetry.io/collector/extension v0.114.0/go.mod h1:Yk2/1ptVgfTr12t+22v93nYJpioP14pURv2YercSzU0= -go.opentelemetry.io/collector/extension/experimental/storage v0.114.0 h1:hLyX9UvmY0t6iBnk3CqvyNck2U0QjPACekj7pDRx2hA= -go.opentelemetry.io/collector/extension/experimental/storage v0.114.0/go.mod h1:WqYRQVJjJLE1rm+y/ks1wPdPRGWePEvE1VO07xm2J2k= -go.opentelemetry.io/collector/extension/extensiontest v0.114.0 h1:ibXDms1qrswlvlR6b3d2BeyI8sXUXoFV11yOi9Sop8o= -go.opentelemetry.io/collector/extension/extensiontest v0.114.0/go.mod h1:/bOYmqu5yTDfI1bJZUxFqm8ZtmcodpquebiSxiQxtDY= -go.opentelemetry.io/collector/pdata v1.20.0 h1:ePcwt4bdtISP0loHaE+C9xYoU2ZkIvWv89Fob16o9SM= -go.opentelemetry.io/collector/pdata v1.20.0/go.mod h1:Ox1YVLe87cZDB/TL30i4SUz1cA5s6AM6SpFMfY61ICs= -go.opentelemetry.io/collector/pdata/pprofile v0.114.0 h1:pUNfTzsI/JUTiE+DScDM4lsrPoxnVNLI2fbTxR/oapo= -go.opentelemetry.io/collector/pdata/pprofile v0.114.0/go.mod h1:4aNcj6WM1n1uXyFSXlhVs4ibrERgNYsTbzcYI2zGhxA= -go.opentelemetry.io/collector/pdata/testdata v0.114.0 h1:+AzszWSL1i4K6meQ8rU0JDDW55SYCXa6FVqfDixhhTo= -go.opentelemetry.io/collector/pdata/testdata v0.114.0/go.mod h1:bv8XFdCTZxG2MQB5l9dKxSxf5zBrcodwO6JOy1+AxXM= -go.opentelemetry.io/collector/pipeline v0.114.0 h1:v3YOhc5z0tD6QbO5n/pnftpIeroihM2ks9Z2yKPCcwY= -go.opentelemetry.io/collector/pipeline v0.114.0/go.mod h1:4vOvjVsoYTHVGTbfFwqfnQOSV2K3RKUHofh3jNRc2Mg= -go.opentelemetry.io/collector/receiver v0.114.0 h1:90SAnXAjNq7/k52/pFmmb06Cf1YauoPYtbio4aOXafY= -go.opentelemetry.io/collector/receiver v0.114.0/go.mod h1:KUGT0/D953LXbGH/D3lLPU8yrU3HfWnUqpt4W4hSOnE= -go.opentelemetry.io/collector/receiver/receiverprofiles v0.114.0 h1:ibhEfGpvNB3yrtpl2jYFabrunMk1hurxvMYpM0b1Ck4= -go.opentelemetry.io/collector/receiver/receiverprofiles v0.114.0/go.mod h1:UZyRfaasw+NLvN10AN8IQnmj5tQ3BOUH1uP2ctpO9f0= -go.opentelemetry.io/collector/receiver/receivertest v0.114.0 h1:D+Kh9t2n4asTnM+TiSxbrKlUemLZandWntj17BJWWb0= -go.opentelemetry.io/collector/receiver/receivertest v0.114.0/go.mod h1:mNSHQ13vFmqD+VAcRzLjStFBejbcWUn2Mp0pAd7Op+U= -go.opentelemetry.io/collector/semconv v0.114.0 h1:/eKcCJwZepQUtEuFuxa0thx2XIOvhFpaf214ZG1a11k= -go.opentelemetry.io/collector/semconv v0.114.0/go.mod h1:zCJ5njhWpejR+A40kiEoeFm1xq1uzyZwMnRNX6/D82A= +go.opentelemetry.io/collector/component v0.115.0 h1:iLte1oCiXzjiCnaOBKdsXacfFiECecpWxW3/LeriMoo= +go.opentelemetry.io/collector/component v0.115.0/go.mod h1:oIUFiH7w1eOimdeYhFI+gAIxYSiLDocKVJ0PTvX7d6s= +go.opentelemetry.io/collector/component/componenttest v0.115.0 h1:9URDJ9VyP6tuij+YHjp/kSSMecnZOd7oGvzu+rw9SJY= +go.opentelemetry.io/collector/component/componenttest v0.115.0/go.mod h1:PzXvNqKLCiSADZGZFKH+IOHMkaQ0GTHuzysfVbTPKYY= +go.opentelemetry.io/collector/config/configretry v1.21.0 h1:ZHoOvAkEcv5BBeaJn8IQ6rQ4GMPZWW4S+W7R4QTEbZU= +go.opentelemetry.io/collector/config/configretry v1.21.0/go.mod h1:cleBc9I0DIWpTiiHfu9v83FUaCTqcPXmebpLxjEIqro= +go.opentelemetry.io/collector/config/configtelemetry v0.115.0 h1:U07FinCDop+r2RjWQ3aP9ZWONC7r7kQIp1GkXQi6nsI= +go.opentelemetry.io/collector/config/configtelemetry v0.115.0/go.mod h1:SlBEwQg0qly75rXZ6W1Ig8jN25KBVBkFIIAUI1GiAAE= +go.opentelemetry.io/collector/consumer v1.21.0 h1:THKZ2Vbi6GkamjTBI2hFq5Dc4kINZTWGwQNa8d/Ty9g= +go.opentelemetry.io/collector/consumer v1.21.0/go.mod h1:FQcC4ThMtRYY41dv+IPNK8POLLhAFY3r1YR5fuP7iiY= +go.opentelemetry.io/collector/consumer/consumererror v0.115.0 h1:yli//xBCQMPZKXNgNlXemo4dvqhnFrAmCZ11DvQgmcY= +go.opentelemetry.io/collector/consumer/consumererror v0.115.0/go.mod h1:LwVzAvQ6ZVNG7mbOvurbAo+W/rKws0IcjOwriuZXqPE= +go.opentelemetry.io/collector/consumer/consumerprofiles v0.115.0 h1:H3fDuyQW1t2HWHkz96WMBQJKUevypOCjBqnqtaAWyoA= +go.opentelemetry.io/collector/consumer/consumerprofiles v0.115.0/go.mod h1:IzEmZ91Tp7TBxVDq8Cc9xvLsmO7H08njr6Pu9P5d9ns= +go.opentelemetry.io/collector/consumer/consumertest v0.115.0 h1:hru0I2447y0TluCdwlKYFFtgcpyCnlM+LiOK1JZyA70= +go.opentelemetry.io/collector/consumer/consumertest v0.115.0/go.mod h1:ybjALRJWR6aKNOzEMy1T1ruCULVDEjj4omtOJMrH/kU= +go.opentelemetry.io/collector/exporter v0.115.0 h1:JnxfpOnsuqhTPKJXVKJLS1Cv3BiVrVLzpHOjJEQw+xw= +go.opentelemetry.io/collector/exporter v0.115.0/go.mod h1:xof3fHQK8wADhaKLIJcQ7ChZaFLNC+haRdPN0wgl6kY= +go.opentelemetry.io/collector/exporter/exporterprofiles v0.115.0 h1:lSQEleCn/q9eFufcuK61NdFKU70ZlgI9dBjPCO/4CrE= +go.opentelemetry.io/collector/exporter/exporterprofiles v0.115.0/go.mod h1:7l5K2AecimX2kx+nZC1gKG3QkP247CO1+SodmJ4fFkQ= +go.opentelemetry.io/collector/exporter/exportertest v0.115.0 h1:P9SMTUXQOtcaq40bGtnnAe14zRmR4/yUgj/Tb2BEf/k= +go.opentelemetry.io/collector/exporter/exportertest v0.115.0/go.mod h1:1jMZ9gFGXglb8wfNrBZIgd+RvpZhSyFwdfE+Jtf9w4U= +go.opentelemetry.io/collector/extension v0.115.0 h1:/cBb8AUdD0KMWC6V3lvCC16eP9Fg0wd1Upcp5rgvuGI= +go.opentelemetry.io/collector/extension v0.115.0/go.mod h1:HI7Ak6loyi6ZrZPsQJW1OO1wbaAW8OqXLFNQlTZnreQ= +go.opentelemetry.io/collector/extension/experimental/storage v0.115.0 h1:sZXw0+77092pq24CkUoTRoHQPLQUsDq6HFRNB0g5yR4= +go.opentelemetry.io/collector/extension/experimental/storage v0.115.0/go.mod h1:qjFH7Y3QYYs88By2ZB5GMSUN5k3ul4Brrq2J6lKACA0= +go.opentelemetry.io/collector/extension/extensiontest v0.115.0 h1:GBVFxFEskR8jSdu9uaQh2qpXnN5VNXhXjpJ2UjxtE8I= +go.opentelemetry.io/collector/extension/extensiontest v0.115.0/go.mod h1:eu1ecbz5mT+cHoH2H3GmD/rOO0WsicSJD2RLrYuOmRA= +go.opentelemetry.io/collector/featuregate v1.21.0 h1:+EULHPJDLMipcwAGZVp9Nm8NriRvoBBMxp7MSiIZVMI= +go.opentelemetry.io/collector/featuregate v1.21.0/go.mod h1:3GaXqflNDVwWndNGBJ1+XJFy3Fv/XrFgjMN60N3z7yg= +go.opentelemetry.io/collector/pdata v1.21.0 h1:PG+UbiFMJ35X/WcAR7Rf/PWmWtRdW0aHlOidsR6c5MA= +go.opentelemetry.io/collector/pdata v1.21.0/go.mod h1:GKb1/zocKJMvxKbS+sl0W85lxhYBTFJ6h6I1tphVyDU= +go.opentelemetry.io/collector/pdata/pprofile v0.115.0 h1:NI89hy13vNDw7EOnQf7Jtitks4HJFO0SUWznTssmP94= +go.opentelemetry.io/collector/pdata/pprofile v0.115.0/go.mod h1:jGzdNfO0XTtfLjXCL/uCC1livg1LlfR+ix2WE/z3RpQ= +go.opentelemetry.io/collector/pdata/testdata v0.115.0 h1:Rblz+AKXdo3fG626jS+KSd0OSA4uMXcTQfpwed6P8LI= +go.opentelemetry.io/collector/pdata/testdata v0.115.0/go.mod h1:inNnRt6S2Nn260EfCBEcjesjlKOSsr0jPwkPqpBkt4s= +go.opentelemetry.io/collector/pipeline v0.115.0 h1:bmACBqb0e8U9ag+vGGHUP7kCfAO7HHROdtzIEg8ulus= +go.opentelemetry.io/collector/pipeline v0.115.0/go.mod h1:qE3DmoB05AW0C3lmPvdxZqd/H4po84NPzd5MrqgtL74= +go.opentelemetry.io/collector/receiver v0.115.0 h1:55Q3Jvj6zHCIA1psKqi/3kEMJO4OqUF5tNAEYNdB1U8= +go.opentelemetry.io/collector/receiver v0.115.0/go.mod h1:nBSCh2O/WUcfgpJ+Jpz+B0z0Hn5jHeRvF2WmLij5EIY= +go.opentelemetry.io/collector/receiver/receiverprofiles v0.115.0 h1:R9JLaj2Al93smIPUkbJshAkb/cY0H5JBOxIx+Zu0NG4= +go.opentelemetry.io/collector/receiver/receiverprofiles v0.115.0/go.mod h1:05E5hGujWeeXJmzKZwTdHyZ/+rRyrQlQB5p5Q2XY39M= +go.opentelemetry.io/collector/receiver/receivertest v0.115.0 h1:OiB684SbHQi6/Pd3ZH0cXjYvCpBS9ilQBfTQx0wVXHg= +go.opentelemetry.io/collector/receiver/receivertest v0.115.0/go.mod h1:Y8Z9U/bz9Xpyt8GI8DxZZgryw3mnnIw+AeKVLTD2cP8= +go.opentelemetry.io/collector/semconv v0.115.0 h1:SoqMvg4ZEB3mz2EdAb6XYa+TuMo5Mir5FRBr3nVFUDY= +go.opentelemetry.io/collector/semconv v0.115.0/go.mod h1:N6XE8Q0JKgBN2fAhkUQtqK9LT7rEGR6+Wu/Rtbal1iI= go.opentelemetry.io/otel v1.32.0 h1:WnBN+Xjcteh0zdk01SVqV55d/m62NJLJdIyb4y/WO5U= go.opentelemetry.io/otel v1.32.0/go.mod h1:00DCVSB0RQcnzlwyTfqtxSm+DRr9hpYrHjNGiBHVQIg= go.opentelemetry.io/otel/metric v1.32.0 h1:xV2umtmNcThh2/a/aCP+h64Xx5wsj8qqnkYZktzNa0M= @@ -351,8 +354,8 @@ golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f h1:XdNn9LlyWAhLVp6P/i8QYBW+hlyhrhei9uErw2B5GJo= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f/go.mod h1:D5SMRVC3C2/4+F/DB1wZsLRnSNimn2Sp/NPsCrsv8ak= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884 h1:Y/Mj/94zIQQGHVSv1tTtQBDaQaJe62U9bkDZKKyhPCU= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -373,8 +376,8 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20191002035440-2ec189313ef0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.31.0 h1:68CPQngjLL0r2AlUKiSxtQFKvzRVbnzLwMUn5SzcLHo= -golang.org/x/net v0.31.0/go.mod h1:P4fl1q7dY2hnZFxEk4pPSkDHF+QqjitcnDjUQyMM+pM= +golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= +golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.23.0 h1:PbgcYx2W7i4LvjJWEbf0ngHV6qJYr86PkAV3bXdLEbs= golang.org/x/oauth2 v0.23.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= @@ -400,14 +403,14 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220829200755-d48e67d00261/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/term v0.26.0 h1:WEQa6V3Gja/BhNxg540hBip/kkaYtRg3cxg4oXSw4AU= -golang.org/x/term v0.26.0/go.mod h1:Si5m1o57C5nBNQo5z1iq+XDijt21BDBDp2bK0QI8e3E= +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.27.0 h1:WP60Sv1nlK1T6SupCHbXzSaN0b9wUmsPoRS9b61A23Q= +golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= -golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= diff --git a/comp/otelcol/otlp/components/exporter/logsagentexporter/logs_exporter.go b/comp/otelcol/otlp/components/exporter/logsagentexporter/logs_exporter.go index 04f8eaeae152b..c6677de7a068a 100644 --- a/comp/otelcol/otlp/components/exporter/logsagentexporter/logs_exporter.go +++ b/comp/otelcol/otlp/components/exporter/logsagentexporter/logs_exporter.go @@ -73,18 +73,22 @@ func (e *Exporter) ConsumeLogs(ctx context.Context, ld plog.Logs) (err error) { if ddLog.Service != nil { service = *ddLog.Service } - status := ddLog.AdditionalProperties["status"] - if status == "" { - status = message.StatusInfo + status := message.StatusInfo + if val, ok := ddLog.AdditionalProperties["status"]; ok { + if strVal, ok := val.(string); ok && strVal != "" { + status = strVal + } } origin := message.NewOrigin(e.logSource) origin.SetTags(tags) origin.SetService(service) - if src, ok := ddLog.AdditionalProperties["datadog.log.source"]; ok { - origin.SetSource(src) - } else { - origin.SetSource(e.logSource.Name) + src := e.logSource.Name + if val, ok := ddLog.AdditionalProperties["datadog.log.source"]; ok { + if strVal, ok := val.(string); ok && strVal != "" { + src = strVal + } } + origin.SetSource(src) content, err := ddLog.MarshalJSON() if err != nil { diff --git a/comp/otelcol/otlp/components/exporter/logsagentexporter/logs_exporter_test.go b/comp/otelcol/otlp/components/exporter/logsagentexporter/logs_exporter_test.go index f7ed2dc597281..cfe69f7a60704 100644 --- a/comp/otelcol/otlp/components/exporter/logsagentexporter/logs_exporter_test.go +++ b/comp/otelcol/otlp/components/exporter/logsagentexporter/logs_exporter_test.go @@ -136,6 +136,38 @@ func TestLogsExporter(t *testing.T) { }, expectedTags: [][]string{{"otel_source:datadog_agent"}}, }, + { + name: "status", + args: args{ + ld: func() plog.Logs { + l := testutil.GenerateLogsOneLogRecord() + rl := l.ResourceLogs().At(0) + rl.ScopeLogs().At(0).LogRecords().At(0).SetSeverityText("Fatal") + return l + }(), + otelSource: otelSource, + logSourceName: LogSourceName, + }, + + want: testutil.JSONLogs{ + { + "message": "This is a log message", + "app": "server", + "instance_num": "1", + "@timestamp": testutil.TestLogTime.Format("2006-01-02T15:04:05.000Z07:00"), + "status": "Fatal", + "dd.span_id": fmt.Sprintf("%d", spanIDToUint64(ld.SpanID())), + "dd.trace_id": fmt.Sprintf("%d", traceIDToUint64(ld.TraceID())), + "otel.severity_text": "Fatal", + "otel.severity_number": "9", + "otel.span_id": spanIDToHexOrEmptyString(ld.SpanID()), + "otel.trace_id": traceIDToHexOrEmptyString(ld.TraceID()), + "otel.timestamp": fmt.Sprintf("%d", testutil.TestLogTime.UnixNano()), + "resource-attr": "resource-attr-val-1", + }, + }, + expectedTags: [][]string{{"otel_source:datadog_agent"}}, + }, { name: "ddtags", args: args{ diff --git a/comp/otelcol/otlp/components/exporter/serializerexporter/go.mod b/comp/otelcol/otlp/components/exporter/serializerexporter/go.mod index 1ca371316a075..6c43de3039293 100644 --- a/comp/otelcol/otlp/components/exporter/serializerexporter/go.mod +++ b/comp/otelcol/otlp/components/exporter/serializerexporter/go.mod @@ -68,29 +68,29 @@ require ( github.com/DataDog/datadog-agent/pkg/proto v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/serializer v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/tagset v0.56.0-rc.3 - github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 - github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.21.0 - 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/datadog-agent/pkg/util/log v0.59.1 + github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.22.0 + github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.22.0 + github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.22.0 github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/resourcetotelemetry v0.114.0 + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/resourcetotelemetry v0.115.0 github.com/stretchr/testify v1.10.0 github.com/tinylib/msgp v1.2.4 - go.opentelemetry.io/collector/component v0.114.0 - go.opentelemetry.io/collector/config/confignet v1.20.0 // indirect - go.opentelemetry.io/collector/config/configtelemetry v0.114.0 // indirect - go.opentelemetry.io/collector/confmap v1.20.0 // indirect - go.opentelemetry.io/collector/consumer v0.114.0 - go.opentelemetry.io/collector/exporter v0.114.0 - go.opentelemetry.io/collector/extension v0.114.0 // indirect - go.opentelemetry.io/collector/pdata v1.20.0 - go.opentelemetry.io/collector/receiver v0.114.0 // indirect - go.opentelemetry.io/collector/semconv v0.114.0 // indirect + go.opentelemetry.io/collector/component v0.115.0 + go.opentelemetry.io/collector/config/confignet v1.21.0 // indirect + go.opentelemetry.io/collector/config/configtelemetry v0.115.0 // indirect + go.opentelemetry.io/collector/confmap v1.21.0 // indirect + go.opentelemetry.io/collector/consumer v1.21.0 + go.opentelemetry.io/collector/exporter v0.115.0 + go.opentelemetry.io/collector/extension v0.115.0 // indirect + go.opentelemetry.io/collector/pdata v1.21.0 + go.opentelemetry.io/collector/receiver v0.115.0 // indirect + go.opentelemetry.io/collector/semconv v0.115.0 // indirect go.uber.org/multierr v1.11.0 ) require ( - github.com/DataDog/agent-payload/v5 v5.0.137 // indirect + github.com/DataDog/agent-payload/v5 v5.0.138 // indirect github.com/DataDog/datadog-agent/comp/core/config v0.57.1 // indirect github.com/DataDog/datadog-agent/comp/core/flare/builder v0.57.1 // indirect github.com/DataDog/datadog-agent/comp/core/flare/types v0.57.1 // indirect @@ -129,15 +129,15 @@ require ( github.com/DataDog/datadog-agent/pkg/util/json v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/pkg/util/optional v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/pointer v0.59.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.1 // indirect github.com/DataDog/datadog-agent/pkg/util/sort v0.56.0-rc.3 // indirect 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.0 // indirect - github.com/DataDog/datadog-agent/pkg/version v0.57.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/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 @@ -161,13 +161,13 @@ require ( github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hashicorp/hcl v1.0.1-vault-5 // indirect - github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 // indirect + github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 // indirect github.com/klauspost/compress v1.17.11 // indirect github.com/knadh/koanf/v2 v2.1.2 // indirect - github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c // indirect + github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect @@ -180,15 +180,13 @@ require ( github.com/pelletier/go-toml v1.9.5 // indirect 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/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect github.com/prometheus/client_golang v1.20.5 // indirect 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/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 @@ -199,14 +197,14 @@ require ( github.com/tklauser/numcpus v0.8.0 // indirect github.com/twmb/murmur3 v1.1.8 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect - go.opentelemetry.io/collector/config/configretry v1.20.0 // indirect - go.opentelemetry.io/collector/consumer/consumerprofiles v0.114.0 // indirect - go.opentelemetry.io/collector/consumer/consumertest v0.114.0 // indirect - go.opentelemetry.io/collector/exporter/exporterprofiles v0.114.0 // indirect - go.opentelemetry.io/collector/extension/experimental/storage v0.114.0 // indirect - go.opentelemetry.io/collector/pdata/pprofile v0.114.0 // indirect - go.opentelemetry.io/collector/pipeline v0.114.0 // indirect - go.opentelemetry.io/collector/receiver/receiverprofiles v0.114.0 // indirect + go.opentelemetry.io/collector/config/configretry v1.21.0 // indirect + go.opentelemetry.io/collector/consumer/consumerprofiles v0.115.0 // indirect + go.opentelemetry.io/collector/consumer/consumertest v0.115.0 // indirect + go.opentelemetry.io/collector/exporter/exporterprofiles v0.115.0 // indirect + go.opentelemetry.io/collector/extension/experimental/storage v0.115.0 // indirect + go.opentelemetry.io/collector/pdata/pprofile v0.115.0 // indirect + go.opentelemetry.io/collector/pipeline v0.115.0 // indirect + go.opentelemetry.io/collector/receiver/receiverprofiles v0.115.0 // indirect go.opentelemetry.io/otel v1.32.0 // indirect go.opentelemetry.io/otel/metric v1.32.0 // indirect go.opentelemetry.io/otel/sdk v1.32.0 // indirect @@ -216,10 +214,10 @@ require ( go.uber.org/dig v1.18.0 // indirect go.uber.org/fx v1.23.0 // indirect go.uber.org/zap v1.27.0 // indirect - golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f // indirect - golang.org/x/net v0.31.0 // indirect - golang.org/x/sys v0.27.0 // indirect - golang.org/x/text v0.20.0 // indirect + golang.org/x/exp v0.0.0-20241210194714-1829a127f884 // indirect + golang.org/x/net v0.33.0 // indirect + golang.org/x/sys v0.28.0 // indirect + golang.org/x/text v0.21.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect google.golang.org/grpc v1.67.1 // indirect google.golang.org/protobuf v1.35.2 // indirect @@ -228,31 +226,33 @@ require ( ) require ( - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/datadog v0.114.0 - go.opentelemetry.io/collector/component/componenttest v0.114.0 - go.opentelemetry.io/collector/exporter/exportertest v0.114.0 + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/datadog v0.115.0 + go.opentelemetry.io/collector/component/componenttest v0.115.0 + go.opentelemetry.io/collector/exporter/exportertest v0.115.0 ) require ( github.com/hashicorp/go-version v1.7.0 // indirect - go.opentelemetry.io/collector/featuregate v1.20.0 // indirect + go.opentelemetry.io/collector/featuregate v1.21.0 // indirect ) 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.114.0 // indirect github.com/pierrec/lz4/v4 v4.1.21 // indirect - go.opentelemetry.io/collector/client v1.20.0 // indirect - go.opentelemetry.io/collector/config/configauth v0.114.0 // indirect - go.opentelemetry.io/collector/config/configcompression v1.20.0 // indirect - go.opentelemetry.io/collector/config/confighttp v0.114.0 // indirect - go.opentelemetry.io/collector/config/configopaque v1.20.0 // indirect - go.opentelemetry.io/collector/config/configtls v1.20.0 // indirect - go.opentelemetry.io/collector/config/internal v0.114.0 // indirect - go.opentelemetry.io/collector/consumer/consumererror v0.114.0 // indirect - go.opentelemetry.io/collector/extension/auth v0.114.0 // indirect - go.opentelemetry.io/collector/receiver/receivertest v0.114.0 // indirect + github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // 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 + go.opentelemetry.io/collector/config/confighttp v0.115.0 // indirect + go.opentelemetry.io/collector/config/configopaque v1.21.0 // indirect + go.opentelemetry.io/collector/config/configtls v1.21.0 // indirect + go.opentelemetry.io/collector/config/internal v0.115.0 // indirect + go.opentelemetry.io/collector/consumer/consumererror v0.115.0 // indirect + go.opentelemetry.io/collector/extension/auth v0.115.0 // indirect + go.opentelemetry.io/collector/receiver/receivertest v0.115.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.56.0 // indirect ) diff --git a/comp/otelcol/otlp/components/exporter/serializerexporter/go.sum b/comp/otelcol/otlp/components/exporter/serializerexporter/go.sum index a1036423c51c7..60d9ae9322734 100644 --- a/comp/otelcol/otlp/components/exporter/serializerexporter/go.sum +++ b/comp/otelcol/otlp/components/exporter/serializerexporter/go.sum @@ -1,21 +1,21 @@ 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/agent-payload/v5 v5.0.137 h1:nV02RrYj6AwlQBGIEv6yG23CuxGtG0YWoFZAVE6vwxY= -github.com/DataDog/agent-payload/v5 v5.0.137/go.mod h1:lxh9lb5xYrBXjblpIWYUi4deJqVbkIfkjwesi5nskDc= +github.com/DataDog/agent-payload/v5 v5.0.138 h1:Wg7hmWuoLC/o0X3zZ+uGcfRHPyaytljudgSY9O59zjc= +github.com/DataDog/agent-payload/v5 v5.0.138/go.mod h1:lxh9lb5xYrBXjblpIWYUi4deJqVbkIfkjwesi5nskDc= 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/opentelemetry-mapping-go/pkg/internal/sketchtest v0.21.0 h1:VS4NTqwczwezMVvI6A7xYR3ugPmMUJ4FcdFrsdnZI2I= -github.com/DataDog/opentelemetry-mapping-go/pkg/internal/sketchtest v0.21.0/go.mod h1:66XlN7QpQKqIvw8e2UbCXV5X8wGnEw851nT9BjJ75dY= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.21.0 h1:hgbTFS6SkqbzOiWSfP58dZ/Jpjlmv6dpD4+V4LDHm2Q= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.21.0/go.mod h1:dvIWN9pA2zWNTw5rhDWZgzZnhcfpH++d+8d1SWW6xkY= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.21.0 h1:8nW8jfcCIWzxWrpI31C0QYoOjTaUGp6USCwiRbP5Fp4= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.21.0/go.mod h1:wuatEozcLYinJ0WYf0MlVTFtTzEmf+qyJet0H9foVAs= -github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.21.0 h1:/Dp1WBvekdusS9Tw9pLE7RG04eluNktQ29arLS4SpGM= -github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.21.0/go.mod h1:asNuwNy1O2HbadkcZVuqmFGonfEzXS/SBvOo8V1MJvQ= +github.com/DataDog/opentelemetry-mapping-go/pkg/internal/sketchtest v0.22.0 h1:cXcKVEU1D0HlguR7GunnvuI70TghkarCa9DApqzMY94= +github.com/DataDog/opentelemetry-mapping-go/pkg/internal/sketchtest v0.22.0/go.mod h1:ES00EXfyEKgUkjd93tAXCxJA6i0seeOhZoS5Cj2qzzg= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.22.0 h1:yfk2cF8Bx98fSFpGrehEHh1FRqewfxcCTAbUDt5r3F8= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.22.0/go.mod h1:9qzpnBSxSOnKzbF/uHket3SSlQihQHix/ZRC2nZUUYQ= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.22.0 h1:w9+ngZDYUMLW+GSRA8x1DvVbuMR+cwlGb8VLwZfgBGs= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.22.0/go.mod h1:UsfqLgiD6Sjhpjkg+YzAd+TdKUZ2m6ZZ8t+tEkLNTMA= +github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.22.0 h1:63SzQz9Ab8XJj8fQKQz6UZNBhOm8rucwzbDfwTVF6dQ= +github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.22.0/go.mod h1:E/PY/aQ6S/N5hBPHXZRGmovs5b1BSi4RHGNcB4yP/Z0= 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= @@ -110,7 +112,6 @@ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5a github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/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= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -137,8 +138,8 @@ github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09 github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/hcl v1.0.1-vault-5 h1:kI3hhbbyzr4dldA8UdTb7ZlVVlI2DACdCfz31RPDgJM= github.com/hashicorp/hcl v1.0.1-vault-5/go.mod h1:XYhtn6ijBSAj6n4YqAaf7RBPS4I06AItNorpy+MoQNM= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 h1:S4qyfL2sEm5Budr4KVMyEniCy+PbS55651I/a+Kn/NQ= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb h1:PGufWXXDq9yaev6xX1YQauaO1MV90e6Mpoq1I7Lz/VM= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= @@ -175,8 +176,8 @@ github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0 github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/lightstep/go-expohisto v1.0.0 h1:UPtTS1rGdtehbbAF7o/dhkWLTDI73UifG8LbfQI7cA4= github.com/lightstep/go-expohisto v1.0.0/go.mod h1:xDXD0++Mu2FOaItXtdDfksfgxfV0z1TMPa+e/EUd0cs= -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/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a h1:3Bm7EwfUQUvhNeKIkUct/gl9eod1TcXuj8stxvi/GoI= +github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a/go.mod h1:ilwx/Dta8jXAgpFYFvSWEMwxmbWXyiUHkd5FwyKhb5k= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= @@ -206,16 +207,16 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.114.0 h1:d2wCLlENxH4I2axQWaogivx/5ZIjDYgn9MIf6sFxlJ4= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.114.0/go.mod h1:Psyligv8GKL9WI3TraW3BLwkOX4TRxaaa1BBQQyICzA= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/datadog v0.114.0 h1:Wq1iTmd0K1SSOIA43Wy2uAU6SB4f9ogyN3ZmvDgTURg= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/datadog v0.114.0/go.mod h1:VCj9H0QxRBWSgbl1pUo8p0NrqnmcxpPo0QjKLFtWkO0= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.114.0 h1:m8uPYU2rTj0sKiYgzCvIPajD3meiYsu+nX0hplUnlEU= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.114.0/go.mod h1:P0BaP92pXPkTyTmObfLYUoRBfMYU+i0hdS3oM1DpGJo= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.114.0 h1:Qg80zPfNMlub7LO07VMDElOu3M2oxqdZgvvB+X72a4U= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.114.0/go.mod h1:5qsGcjFV3WFI6J2onAlkR7Xd/8VtwJcECaDRZfW4Tb4= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/resourcetotelemetry v0.114.0 h1:PwUMZ6fHMEUV5i9hUly+z3UujDTTdxQtWzL0rWc/lgA= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/resourcetotelemetry v0.114.0/go.mod h1:YEHL6w4vvB9b0/lNwGjz8DyWXTF/7Xw0Hkgc3mGWwa8= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.115.0 h1:a36EJz/mb83f6ieX0v4fNDJ1jXqpeaM6DVQXeFDvdhw= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.115.0/go.mod h1:r5/40YO1eSP5ZreOmRzVOUtDr7YG39ZIUcVjHd+9Izc= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/datadog v0.115.0 h1:WOqt8NpU/JPGYDR4CiWx7g/sHV6Oe9FChzhushwmVdo= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/datadog v0.115.0/go.mod h1:wV/+iU7MyXcyTaY8K5Qx+1Z3yUzrxA40nydPQA476Iw= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.115.0 h1:MerLKMrkM4YoGF6Di0D9yMXO02yCX8mrZAi/+jJVVeI= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.115.0/go.mod h1:R8AkVWe9G5Q0oMOapvm9HNS076E3Min8SVlmhBL3QD0= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.115.0 h1:WEqcnWSy9dNSlGb8pYRBX7zhaz2ReyaeImlenbzNTB4= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.115.0/go.mod h1:6Mk71CakHUA3I6oM9hARDiyQypYyOolvb+4PFYyVEFg= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/resourcetotelemetry v0.115.0 h1:eoapW0JBablApkdv4C1RUuOKfz0U6SwuKMYYSAJH6fE= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/resourcetotelemetry v0.115.0/go.mod h1:hW2AaybTRcwxJySGLC3Fh1vd2VDaQhRBfa7O7w30NS8= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc= github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ= @@ -229,11 +230,13 @@ github.com/pierrec/lz4/v4 v4.1.21/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFu github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 h1:GFCKgmp0tecUJ0sJuv4pzYCqS9+RGSn52M3FUwPs+uo= +github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10/go.mod h1:t/avpk3KcrXxUnYOhZhMXJlSEyie6gQbtLq5NM3loB8= 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-20220216144756-c35f1ee13d7c h1:NRoLoZvkBTKvR5gQLgA3e0hqjkY9u1wm+iOL45VN/qI= -github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 h1:o4JXh1EVt9k/+g42oCprj/FisM4qX9L3sZB3upGN2ZU= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= @@ -271,12 +274,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= @@ -333,72 +332,74 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0= github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.opentelemetry.io/collector/client v1.20.0 h1:o60wPcj5nLtaRenF+1E5p4QXFS3TDL6vHlw+GOon3rg= -go.opentelemetry.io/collector/client v1.20.0/go.mod h1:6aqkszco9FaLWCxyJEVam6PP7cUa8mPRIXeS5eZGj0U= -go.opentelemetry.io/collector/component v0.114.0 h1:SVGbm5LvHGSTEDv7p92oPuBgK5tuiWR82I9+LL4TtBE= -go.opentelemetry.io/collector/component v0.114.0/go.mod h1:MLxtjZ6UVHjDxSdhGLuJfHBHvfl1iT/Y7IaQPD24Eww= -go.opentelemetry.io/collector/component/componenttest v0.114.0 h1:GM4FTTlfeXoVm6sZYBHImwlRN8ayh2oAfUhvaFj7Zo8= -go.opentelemetry.io/collector/component/componenttest v0.114.0/go.mod h1:ZZEJMtbJtoVC/3/9R1HzERq+cYQRxuMFQrPCpfZ4Xos= -go.opentelemetry.io/collector/config/configauth v0.114.0 h1:R2sJ6xpsLYGH0yU0vCxotzBYDKR/Hrjv0A7y9lwMyiw= -go.opentelemetry.io/collector/config/configauth v0.114.0/go.mod h1:3Z24KcCpG+WYCeQYfs/cNp5cP2BDeOqLCtOEgs/rPqM= -go.opentelemetry.io/collector/config/configcompression v1.20.0 h1:H/mvz7J/5z+O74YsO0t2tk+REnO2tzLM8TgIQ4AZ5w0= -go.opentelemetry.io/collector/config/configcompression v1.20.0/go.mod h1:pnxkFCLUZLKWzYJvfSwZnPrnm0twX14CYj2ADth5xiU= -go.opentelemetry.io/collector/config/confighttp v0.114.0 h1:DjGsBvVm+mGK3IpJBaXianWhwcxEC1fF33cpuC1LY/I= -go.opentelemetry.io/collector/config/confighttp v0.114.0/go.mod h1:nrlNLxOZ+4JQaV9j0TiqQV7LOHhrRivPrT8nQRHED3Q= -go.opentelemetry.io/collector/config/confignet v1.20.0 h1:LrM6AuiY8N/woTP4SWhL2V0562JXwJs9MRNFZJFLtRY= -go.opentelemetry.io/collector/config/confignet v1.20.0/go.mod h1:o3v4joAEjvLwntqexg5ixMqRrU1+Vst+jWuCUaBNgOg= -go.opentelemetry.io/collector/config/configopaque v1.20.0 h1:2I48zKiyyyYqjm7y0B9OLp24ku2ZSX3nCHG0r5FdWOQ= -go.opentelemetry.io/collector/config/configopaque v1.20.0/go.mod h1:6zlLIyOoRpJJ+0bEKrlZOZon3rOp5Jrz9fMdR4twOS4= -go.opentelemetry.io/collector/config/configretry v1.20.0 h1:z679mrMlW2a6tOOYPGdrS/QfALxdzWLQUOpH8Uu+D5Y= -go.opentelemetry.io/collector/config/configretry v1.20.0/go.mod h1:KvQF5cfphq1rQm1dKR4eLDNQYw6iI2fY72NMZVa+0N0= -go.opentelemetry.io/collector/config/configtelemetry v0.114.0 h1:kjLeyrumge6wsX6ZIkicdNOlBXaEyW2PI2ZdVXz/rzY= -go.opentelemetry.io/collector/config/configtelemetry v0.114.0/go.mod h1:R0MBUxjSMVMIhljuDHWIygzzJWQyZHXXWIgQNxcFwhc= -go.opentelemetry.io/collector/config/configtls v1.20.0 h1:hNlJdwfyY5Qe54RLJ41lfLqKTn9ypkR7sk7JNCcSe2U= -go.opentelemetry.io/collector/config/configtls v1.20.0/go.mod h1:sav/txSHguadTYlSSK+BJO2ljJeYEtRoBahgzWAguYg= -go.opentelemetry.io/collector/config/internal v0.114.0 h1:uWSDWTJb8T6xRjKD9/XmEARakXnxgYVYKUeId78hErc= -go.opentelemetry.io/collector/config/internal v0.114.0/go.mod h1:yC7E4h1Uj0SubxcFImh6OvBHFTjMh99+A5PuyIgDWqc= -go.opentelemetry.io/collector/confmap v1.20.0 h1:ARfOwmkKxFOud1njl03yAHQ30+uenlzqCO6LBYamDTE= -go.opentelemetry.io/collector/confmap v1.20.0/go.mod h1:DMpd9Ay/ffls3JoQBQ73vWeRsz1rNuLbwjo6WtjSQus= -go.opentelemetry.io/collector/consumer v0.114.0 h1:1zVaHvfIZowGwZRitRBRo3i+RP2StlU+GClYiofSw0Q= -go.opentelemetry.io/collector/consumer v0.114.0/go.mod h1:d+Mrzt9hsH1ub3zmwSlnQVPLeTYir4Mgo7CrWfnncN4= -go.opentelemetry.io/collector/consumer/consumererror v0.114.0 h1:r2YiELfWerb40FHD23V04gNjIkLUcjEKGxI4Vtm2iO4= -go.opentelemetry.io/collector/consumer/consumererror v0.114.0/go.mod h1:MzIrLQ5jptO2egypolhlAbZsWZr29WC4FhSxQjnxcvg= -go.opentelemetry.io/collector/consumer/consumerprofiles v0.114.0 h1:5pXYy3E6UK5Huu3aQbsYL8B6E6MyWx4fvXXDn+oXZaA= -go.opentelemetry.io/collector/consumer/consumerprofiles v0.114.0/go.mod h1:PMq3f54KcJQO4v1tue0QxQScu7REFVADlXxXSAYMiN0= -go.opentelemetry.io/collector/consumer/consumertest v0.114.0 h1:isaTwJK5DOy8Bs7GuLq23ejfgj8gLIo5dOUvkRnLF4g= -go.opentelemetry.io/collector/consumer/consumertest v0.114.0/go.mod h1:GNeLPkfRPdh06n/Rv1UKa/cAtCKjN0a7ADyHjIj4HFE= -go.opentelemetry.io/collector/exporter v0.114.0 h1:5/0BBpXuCJQSQ5SQf31g7j6T4XEKkyx9mZMcA2rS5e8= -go.opentelemetry.io/collector/exporter v0.114.0/go.mod h1:atpd0wWXgh5LAZ0REU/d/Ti/q50HDfnlBIjMjJQlKFg= -go.opentelemetry.io/collector/exporter/exporterprofiles v0.114.0 h1:/wmWOSBHcvtz3Pbv7+rWCqPPQuNvYaoidKKaOqZsLKs= -go.opentelemetry.io/collector/exporter/exporterprofiles v0.114.0/go.mod h1:epRYTkyJZTSQZBJflMGHUyUo2EdLPhsaZEyo5Qm848A= -go.opentelemetry.io/collector/exporter/exportertest v0.114.0 h1:vo0idBJT+QACSM1KpjVLm9VeiXVwO7y4UnMpGxN6EyM= -go.opentelemetry.io/collector/exporter/exportertest v0.114.0/go.mod h1:420ssFrhaphneybstbMeSIiqSRoaBARPgO71O17foaM= -go.opentelemetry.io/collector/extension v0.114.0 h1:9Qb92y8hD2WDC5aMDoj4JNQN+/5BQYJWPUPzLXX+iGw= -go.opentelemetry.io/collector/extension v0.114.0/go.mod h1:Yk2/1ptVgfTr12t+22v93nYJpioP14pURv2YercSzU0= -go.opentelemetry.io/collector/extension/auth v0.114.0 h1:1K2qh4yvG8kKR/sTAobI/rw5VxzPZoKcl3FmC195vvo= -go.opentelemetry.io/collector/extension/auth v0.114.0/go.mod h1:IjtsG+jUVJB0utKF8dAK8pLutRun3aEgASshImzsw/U= -go.opentelemetry.io/collector/extension/experimental/storage v0.114.0 h1:hLyX9UvmY0t6iBnk3CqvyNck2U0QjPACekj7pDRx2hA= -go.opentelemetry.io/collector/extension/experimental/storage v0.114.0/go.mod h1:WqYRQVJjJLE1rm+y/ks1wPdPRGWePEvE1VO07xm2J2k= -go.opentelemetry.io/collector/extension/extensiontest v0.114.0 h1:ibXDms1qrswlvlR6b3d2BeyI8sXUXoFV11yOi9Sop8o= -go.opentelemetry.io/collector/extension/extensiontest v0.114.0/go.mod h1:/bOYmqu5yTDfI1bJZUxFqm8ZtmcodpquebiSxiQxtDY= -go.opentelemetry.io/collector/featuregate v1.20.0 h1:Mi7nMy/q52eruI+6jWnMKUOeM55XvwoPnGcdB1++O8c= -go.opentelemetry.io/collector/featuregate v1.20.0/go.mod h1:47xrISO71vJ83LSMm8+yIDsUbKktUp48Ovt7RR6VbRs= -go.opentelemetry.io/collector/pdata v1.20.0 h1:ePcwt4bdtISP0loHaE+C9xYoU2ZkIvWv89Fob16o9SM= -go.opentelemetry.io/collector/pdata v1.20.0/go.mod h1:Ox1YVLe87cZDB/TL30i4SUz1cA5s6AM6SpFMfY61ICs= -go.opentelemetry.io/collector/pdata/pprofile v0.114.0 h1:pUNfTzsI/JUTiE+DScDM4lsrPoxnVNLI2fbTxR/oapo= -go.opentelemetry.io/collector/pdata/pprofile v0.114.0/go.mod h1:4aNcj6WM1n1uXyFSXlhVs4ibrERgNYsTbzcYI2zGhxA= -go.opentelemetry.io/collector/pdata/testdata v0.114.0 h1:+AzszWSL1i4K6meQ8rU0JDDW55SYCXa6FVqfDixhhTo= -go.opentelemetry.io/collector/pdata/testdata v0.114.0/go.mod h1:bv8XFdCTZxG2MQB5l9dKxSxf5zBrcodwO6JOy1+AxXM= -go.opentelemetry.io/collector/pipeline v0.114.0 h1:v3YOhc5z0tD6QbO5n/pnftpIeroihM2ks9Z2yKPCcwY= -go.opentelemetry.io/collector/pipeline v0.114.0/go.mod h1:4vOvjVsoYTHVGTbfFwqfnQOSV2K3RKUHofh3jNRc2Mg= -go.opentelemetry.io/collector/receiver v0.114.0 h1:90SAnXAjNq7/k52/pFmmb06Cf1YauoPYtbio4aOXafY= -go.opentelemetry.io/collector/receiver v0.114.0/go.mod h1:KUGT0/D953LXbGH/D3lLPU8yrU3HfWnUqpt4W4hSOnE= -go.opentelemetry.io/collector/receiver/receiverprofiles v0.114.0 h1:ibhEfGpvNB3yrtpl2jYFabrunMk1hurxvMYpM0b1Ck4= -go.opentelemetry.io/collector/receiver/receiverprofiles v0.114.0/go.mod h1:UZyRfaasw+NLvN10AN8IQnmj5tQ3BOUH1uP2ctpO9f0= -go.opentelemetry.io/collector/receiver/receivertest v0.114.0 h1:D+Kh9t2n4asTnM+TiSxbrKlUemLZandWntj17BJWWb0= -go.opentelemetry.io/collector/receiver/receivertest v0.114.0/go.mod h1:mNSHQ13vFmqD+VAcRzLjStFBejbcWUn2Mp0pAd7Op+U= -go.opentelemetry.io/collector/semconv v0.114.0 h1:/eKcCJwZepQUtEuFuxa0thx2XIOvhFpaf214ZG1a11k= -go.opentelemetry.io/collector/semconv v0.114.0/go.mod h1:zCJ5njhWpejR+A40kiEoeFm1xq1uzyZwMnRNX6/D82A= +go.opentelemetry.io/collector/client v1.21.0 h1:3Kes8lOFMYVxoxeAmX+DTEAkuS1iTA3NkSfqzGmygJA= +go.opentelemetry.io/collector/client v1.21.0/go.mod h1:jYJGiL0UA975OOyHmjbQSokNWt1OiviI5KjPOMUMGwc= +go.opentelemetry.io/collector/component v0.115.0 h1:iLte1oCiXzjiCnaOBKdsXacfFiECecpWxW3/LeriMoo= +go.opentelemetry.io/collector/component v0.115.0/go.mod h1:oIUFiH7w1eOimdeYhFI+gAIxYSiLDocKVJ0PTvX7d6s= +go.opentelemetry.io/collector/component/componenttest v0.115.0 h1:9URDJ9VyP6tuij+YHjp/kSSMecnZOd7oGvzu+rw9SJY= +go.opentelemetry.io/collector/component/componenttest v0.115.0/go.mod h1:PzXvNqKLCiSADZGZFKH+IOHMkaQ0GTHuzysfVbTPKYY= +go.opentelemetry.io/collector/config/configauth v0.115.0 h1:xa+ALdyPgva3rZnLBh1H2oS5MsHP6JxSqMtQmcELnys= +go.opentelemetry.io/collector/config/configauth v0.115.0/go.mod h1:C7anpb3Rf4KswMT+dgOzkW9UX0z/65PLORpUw3p0VYc= +go.opentelemetry.io/collector/config/configcompression v1.21.0 h1:0zbPdZAgPFMAarwJEC4gaR6f/JBP686A3TYSgb3oa+E= +go.opentelemetry.io/collector/config/configcompression v1.21.0/go.mod h1:LvYG00tbPTv0NOLoZN0wXq1F5thcxvukO8INq7xyfWU= +go.opentelemetry.io/collector/config/confighttp v0.115.0 h1:BIy394oNXnqySJwrCqgAJu4gWgAV5aQUDD6k1hy6C8o= +go.opentelemetry.io/collector/config/confighttp v0.115.0/go.mod h1:Wr50ut12NmCEAl4bWLJryw2EjUmJTtYRg89560Q51wc= +go.opentelemetry.io/collector/config/confignet v1.21.0 h1:PeQ5YrMnfftysFL/WVaSrjPOWjD6DfeABY50pf9CZxU= +go.opentelemetry.io/collector/config/confignet v1.21.0/go.mod h1:ZppUH1hgUJOubawEsxsQ9MzEYFytqo2GnVSS7d4CVxc= +go.opentelemetry.io/collector/config/configopaque v1.21.0 h1:PcvRGkBk4Px8BQM7tX+kw4i3jBsfAHGoGQbtZg6Ox7U= +go.opentelemetry.io/collector/config/configopaque v1.21.0/go.mod h1:sW0t0iI/VfRL9VYX7Ik6XzVgPcR+Y5kejTLsYcMyDWs= +go.opentelemetry.io/collector/config/configretry v1.21.0 h1:ZHoOvAkEcv5BBeaJn8IQ6rQ4GMPZWW4S+W7R4QTEbZU= +go.opentelemetry.io/collector/config/configretry v1.21.0/go.mod h1:cleBc9I0DIWpTiiHfu9v83FUaCTqcPXmebpLxjEIqro= +go.opentelemetry.io/collector/config/configtelemetry v0.115.0 h1:U07FinCDop+r2RjWQ3aP9ZWONC7r7kQIp1GkXQi6nsI= +go.opentelemetry.io/collector/config/configtelemetry v0.115.0/go.mod h1:SlBEwQg0qly75rXZ6W1Ig8jN25KBVBkFIIAUI1GiAAE= +go.opentelemetry.io/collector/config/configtls v1.21.0 h1:ZfrlAYgBD8lzp04W0GxwiDmUbrvKsvDYJi+wkyiXlpA= +go.opentelemetry.io/collector/config/configtls v1.21.0/go.mod h1:5EsNefPfVCMOTlOrr3wyj7LrsOgY7V8iqRl8oFZEqtw= +go.opentelemetry.io/collector/config/internal v0.115.0 h1:eVk57iufZpUXyPJFKTb1Ebx5tmcCyroIlt427r5pxS8= +go.opentelemetry.io/collector/config/internal v0.115.0/go.mod h1:OVkadRWlKAoWjHslqjWtBLAne8ceQm8WYT71ZcBWLFc= +go.opentelemetry.io/collector/confmap v1.21.0 h1:1tIcx2/Suwg8VhuPmQw87ba0ludPmumpFCFRZZa6RXA= +go.opentelemetry.io/collector/confmap v1.21.0/go.mod h1:Rrhs+MWoaP6AswZp+ReQ2VO9dfOfcUjdjiSHBsG+nec= +go.opentelemetry.io/collector/consumer v1.21.0 h1:THKZ2Vbi6GkamjTBI2hFq5Dc4kINZTWGwQNa8d/Ty9g= +go.opentelemetry.io/collector/consumer v1.21.0/go.mod h1:FQcC4ThMtRYY41dv+IPNK8POLLhAFY3r1YR5fuP7iiY= +go.opentelemetry.io/collector/consumer/consumererror v0.115.0 h1:yli//xBCQMPZKXNgNlXemo4dvqhnFrAmCZ11DvQgmcY= +go.opentelemetry.io/collector/consumer/consumererror v0.115.0/go.mod h1:LwVzAvQ6ZVNG7mbOvurbAo+W/rKws0IcjOwriuZXqPE= +go.opentelemetry.io/collector/consumer/consumerprofiles v0.115.0 h1:H3fDuyQW1t2HWHkz96WMBQJKUevypOCjBqnqtaAWyoA= +go.opentelemetry.io/collector/consumer/consumerprofiles v0.115.0/go.mod h1:IzEmZ91Tp7TBxVDq8Cc9xvLsmO7H08njr6Pu9P5d9ns= +go.opentelemetry.io/collector/consumer/consumertest v0.115.0 h1:hru0I2447y0TluCdwlKYFFtgcpyCnlM+LiOK1JZyA70= +go.opentelemetry.io/collector/consumer/consumertest v0.115.0/go.mod h1:ybjALRJWR6aKNOzEMy1T1ruCULVDEjj4omtOJMrH/kU= +go.opentelemetry.io/collector/exporter v0.115.0 h1:JnxfpOnsuqhTPKJXVKJLS1Cv3BiVrVLzpHOjJEQw+xw= +go.opentelemetry.io/collector/exporter v0.115.0/go.mod h1:xof3fHQK8wADhaKLIJcQ7ChZaFLNC+haRdPN0wgl6kY= +go.opentelemetry.io/collector/exporter/exporterprofiles v0.115.0 h1:lSQEleCn/q9eFufcuK61NdFKU70ZlgI9dBjPCO/4CrE= +go.opentelemetry.io/collector/exporter/exporterprofiles v0.115.0/go.mod h1:7l5K2AecimX2kx+nZC1gKG3QkP247CO1+SodmJ4fFkQ= +go.opentelemetry.io/collector/exporter/exportertest v0.115.0 h1:P9SMTUXQOtcaq40bGtnnAe14zRmR4/yUgj/Tb2BEf/k= +go.opentelemetry.io/collector/exporter/exportertest v0.115.0/go.mod h1:1jMZ9gFGXglb8wfNrBZIgd+RvpZhSyFwdfE+Jtf9w4U= +go.opentelemetry.io/collector/extension v0.115.0 h1:/cBb8AUdD0KMWC6V3lvCC16eP9Fg0wd1Upcp5rgvuGI= +go.opentelemetry.io/collector/extension v0.115.0/go.mod h1:HI7Ak6loyi6ZrZPsQJW1OO1wbaAW8OqXLFNQlTZnreQ= +go.opentelemetry.io/collector/extension/auth v0.115.0 h1:TTMokbBsSHZRFH48PvGSJmgSS8F3Rkr9MWGHZn8eJDk= +go.opentelemetry.io/collector/extension/auth v0.115.0/go.mod h1:3w+2mzeb2OYNOO4Bi41TUo4jr32ap2y7AOq64IDpxQo= +go.opentelemetry.io/collector/extension/auth/authtest v0.115.0 h1:OZe7dKbZ01qodSpZU0ZYzI6zpmmzJ3UvfdBSFAbSgDw= +go.opentelemetry.io/collector/extension/auth/authtest v0.115.0/go.mod h1:fk9WCXP0x91Q64Z8HZKWTHh9PWtgoWE1KXe3n2Bff3U= +go.opentelemetry.io/collector/extension/experimental/storage v0.115.0 h1:sZXw0+77092pq24CkUoTRoHQPLQUsDq6HFRNB0g5yR4= +go.opentelemetry.io/collector/extension/experimental/storage v0.115.0/go.mod h1:qjFH7Y3QYYs88By2ZB5GMSUN5k3ul4Brrq2J6lKACA0= +go.opentelemetry.io/collector/extension/extensiontest v0.115.0 h1:GBVFxFEskR8jSdu9uaQh2qpXnN5VNXhXjpJ2UjxtE8I= +go.opentelemetry.io/collector/extension/extensiontest v0.115.0/go.mod h1:eu1ecbz5mT+cHoH2H3GmD/rOO0WsicSJD2RLrYuOmRA= +go.opentelemetry.io/collector/featuregate v1.21.0 h1:+EULHPJDLMipcwAGZVp9Nm8NriRvoBBMxp7MSiIZVMI= +go.opentelemetry.io/collector/featuregate v1.21.0/go.mod h1:3GaXqflNDVwWndNGBJ1+XJFy3Fv/XrFgjMN60N3z7yg= +go.opentelemetry.io/collector/pdata v1.21.0 h1:PG+UbiFMJ35X/WcAR7Rf/PWmWtRdW0aHlOidsR6c5MA= +go.opentelemetry.io/collector/pdata v1.21.0/go.mod h1:GKb1/zocKJMvxKbS+sl0W85lxhYBTFJ6h6I1tphVyDU= +go.opentelemetry.io/collector/pdata/pprofile v0.115.0 h1:NI89hy13vNDw7EOnQf7Jtitks4HJFO0SUWznTssmP94= +go.opentelemetry.io/collector/pdata/pprofile v0.115.0/go.mod h1:jGzdNfO0XTtfLjXCL/uCC1livg1LlfR+ix2WE/z3RpQ= +go.opentelemetry.io/collector/pdata/testdata v0.115.0 h1:Rblz+AKXdo3fG626jS+KSd0OSA4uMXcTQfpwed6P8LI= +go.opentelemetry.io/collector/pdata/testdata v0.115.0/go.mod h1:inNnRt6S2Nn260EfCBEcjesjlKOSsr0jPwkPqpBkt4s= +go.opentelemetry.io/collector/pipeline v0.115.0 h1:bmACBqb0e8U9ag+vGGHUP7kCfAO7HHROdtzIEg8ulus= +go.opentelemetry.io/collector/pipeline v0.115.0/go.mod h1:qE3DmoB05AW0C3lmPvdxZqd/H4po84NPzd5MrqgtL74= +go.opentelemetry.io/collector/receiver v0.115.0 h1:55Q3Jvj6zHCIA1psKqi/3kEMJO4OqUF5tNAEYNdB1U8= +go.opentelemetry.io/collector/receiver v0.115.0/go.mod h1:nBSCh2O/WUcfgpJ+Jpz+B0z0Hn5jHeRvF2WmLij5EIY= +go.opentelemetry.io/collector/receiver/receiverprofiles v0.115.0 h1:R9JLaj2Al93smIPUkbJshAkb/cY0H5JBOxIx+Zu0NG4= +go.opentelemetry.io/collector/receiver/receiverprofiles v0.115.0/go.mod h1:05E5hGujWeeXJmzKZwTdHyZ/+rRyrQlQB5p5Q2XY39M= +go.opentelemetry.io/collector/receiver/receivertest v0.115.0 h1:OiB684SbHQi6/Pd3ZH0cXjYvCpBS9ilQBfTQx0wVXHg= +go.opentelemetry.io/collector/receiver/receivertest v0.115.0/go.mod h1:Y8Z9U/bz9Xpyt8GI8DxZZgryw3mnnIw+AeKVLTD2cP8= +go.opentelemetry.io/collector/semconv v0.115.0 h1:SoqMvg4ZEB3mz2EdAb6XYa+TuMo5Mir5FRBr3nVFUDY= +go.opentelemetry.io/collector/semconv v0.115.0/go.mod h1:N6XE8Q0JKgBN2fAhkUQtqK9LT7rEGR6+Wu/Rtbal1iI= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.56.0 h1:UP6IpuHFkUgOQL9FFQFrZ+5LiwhhYRbi7VZSIx6Nj5s= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.56.0/go.mod h1:qxuZLtbq5QDtdeSHsS7bcf6EH6uO6jUAgk764zd3rhM= go.opentelemetry.io/otel v1.32.0 h1:WnBN+Xjcteh0zdk01SVqV55d/m62NJLJdIyb4y/WO5U= @@ -436,8 +437,8 @@ golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f h1:XdNn9LlyWAhLVp6P/i8QYBW+hlyhrhei9uErw2B5GJo= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f/go.mod h1:D5SMRVC3C2/4+F/DB1wZsLRnSNimn2Sp/NPsCrsv8ak= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884 h1:Y/Mj/94zIQQGHVSv1tTtQBDaQaJe62U9bkDZKKyhPCU= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -458,8 +459,8 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20191002035440-2ec189313ef0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.31.0 h1:68CPQngjLL0r2AlUKiSxtQFKvzRVbnzLwMUn5SzcLHo= -golang.org/x/net v0.31.0/go.mod h1:P4fl1q7dY2hnZFxEk4pPSkDHF+QqjitcnDjUQyMM+pM= +golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= +golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -483,12 +484,12 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220829200755-d48e67d00261/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.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/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= -golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= diff --git a/comp/otelcol/otlp/components/metricsclient/go.mod b/comp/otelcol/otlp/components/metricsclient/go.mod index fd4131fa08ac9..9f3e33feb8bf7 100644 --- a/comp/otelcol/otlp/components/metricsclient/go.mod +++ b/comp/otelcol/otlp/components/metricsclient/go.mod @@ -6,7 +6,7 @@ replace github.com/DataDog/datadog-agent/pkg/trace => ../../../../../pkg/trace require ( github.com/DataDog/datadog-agent/pkg/trace v0.56.0-rc.3 - github.com/DataDog/datadog-go/v5 v5.5.0 + github.com/DataDog/datadog-go/v5 v5.6.0 github.com/stretchr/testify v1.10.0 go.opentelemetry.io/otel v1.32.0 go.opentelemetry.io/otel/metric v1.32.0 @@ -25,7 +25,7 @@ require ( go.opentelemetry.io/otel/sdk v1.32.0 // indirect go.opentelemetry.io/otel/trace v1.32.0 // indirect go.uber.org/atomic v1.11.0 // indirect - golang.org/x/sys v0.27.0 // indirect + golang.org/x/sys v0.28.0 // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/comp/otelcol/otlp/components/metricsclient/go.sum b/comp/otelcol/otlp/components/metricsclient/go.sum index 4f2f48d1ce2f8..a5181f913d8e8 100644 --- a/comp/otelcol/otlp/components/metricsclient/go.sum +++ b/comp/otelcol/otlp/components/metricsclient/go.sum @@ -1,5 +1,5 @@ -github.com/DataDog/datadog-go/v5 v5.5.0 h1:G5KHeB8pWBNXT4Jtw0zAkhdxEAWSpWH00geHI6LDrKU= -github.com/DataDog/datadog-go/v5 v5.5.0/go.mod h1:K9kcYBlxkcPP8tvvjZZKs/m1edNAUFzBbdpTUKfCsuw= +github.com/DataDog/datadog-go/v5 v5.6.0 h1:2oCLxjF/4htd55piM75baflj/KoE6VYS7alEUqFvRDw= +github.com/DataDog/datadog-go/v5 v5.6.0/go.mod h1:K9kcYBlxkcPP8tvvjZZKs/m1edNAUFzBbdpTUKfCsuw= github.com/Microsoft/go-winio v0.5.0/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= @@ -64,8 +64,8 @@ golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.31.0 h1:68CPQngjLL0r2AlUKiSxtQFKvzRVbnzLwMUn5SzcLHo= -golang.org/x/net v0.31.0/go.mod h1:P4fl1q7dY2hnZFxEk4pPSkDHF+QqjitcnDjUQyMM+pM= +golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= +golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -75,8 +75,8 @@ golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.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= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= diff --git a/comp/otelcol/otlp/components/processor/infraattributesprocessor/go.mod b/comp/otelcol/otlp/components/processor/infraattributesprocessor/go.mod index b7b05613e4005..0faa1b34bcd0e 100644 --- a/comp/otelcol/otlp/components/processor/infraattributesprocessor/go.mod +++ b/comp/otelcol/otlp/components/processor/infraattributesprocessor/go.mod @@ -37,15 +37,15 @@ require ( github.com/DataDog/datadog-agent/comp/core/tagger/tags v0.0.0-00010101000000-000000000000 github.com/DataDog/datadog-agent/comp/core/tagger/types v0.59.0 github.com/stretchr/testify v1.10.0 - go.opentelemetry.io/collector/component v0.114.0 - go.opentelemetry.io/collector/component/componenttest v0.114.0 - go.opentelemetry.io/collector/confmap v1.20.0 - go.opentelemetry.io/collector/consumer v0.114.0 - go.opentelemetry.io/collector/consumer/consumertest v0.114.0 - go.opentelemetry.io/collector/pdata v1.20.0 - go.opentelemetry.io/collector/processor v0.114.0 - go.opentelemetry.io/collector/processor/processortest v0.114.0 - go.opentelemetry.io/collector/semconv v0.114.0 + go.opentelemetry.io/collector/component v0.115.0 + go.opentelemetry.io/collector/component/componenttest v0.115.0 + go.opentelemetry.io/collector/confmap v1.21.0 + go.opentelemetry.io/collector/consumer v1.21.0 + go.opentelemetry.io/collector/consumer/consumertest v0.115.0 + go.opentelemetry.io/collector/pdata v1.21.0 + go.opentelemetry.io/collector/processor v0.115.0 + go.opentelemetry.io/collector/processor/processortest v0.115.0 + go.opentelemetry.io/collector/semconv v0.115.0 go.opentelemetry.io/otel/metric v1.32.0 go.opentelemetry.io/otel/trace v1.32.0 go.uber.org/zap v1.27.0 @@ -68,20 +68,20 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect - go.opentelemetry.io/collector/component/componentstatus v0.114.0 // indirect - go.opentelemetry.io/collector/config/configtelemetry v0.114.0 // indirect - go.opentelemetry.io/collector/consumer/consumerprofiles v0.114.0 // indirect - go.opentelemetry.io/collector/pdata/pprofile v0.114.0 // indirect - go.opentelemetry.io/collector/pdata/testdata v0.114.0 // indirect - go.opentelemetry.io/collector/pipeline v0.114.0 // indirect - go.opentelemetry.io/collector/processor/processorprofiles v0.114.0 // indirect + go.opentelemetry.io/collector/component/componentstatus v0.115.0 // indirect + go.opentelemetry.io/collector/config/configtelemetry v0.115.0 // indirect + go.opentelemetry.io/collector/consumer/consumerprofiles v0.115.0 // indirect + go.opentelemetry.io/collector/pdata/pprofile v0.115.0 // indirect + go.opentelemetry.io/collector/pdata/testdata v0.115.0 // indirect + go.opentelemetry.io/collector/pipeline v0.115.0 // indirect + go.opentelemetry.io/collector/processor/processorprofiles v0.115.0 // indirect go.opentelemetry.io/otel v1.32.0 // indirect go.opentelemetry.io/otel/sdk v1.32.0 // indirect go.opentelemetry.io/otel/sdk/metric v1.32.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/net v0.31.0 // indirect - golang.org/x/sys v0.27.0 // indirect - golang.org/x/text v0.20.0 // indirect + golang.org/x/net v0.33.0 // indirect + golang.org/x/sys v0.28.0 // indirect + golang.org/x/text v0.21.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect google.golang.org/grpc v1.67.1 // indirect google.golang.org/protobuf v1.35.2 // indirect diff --git a/comp/otelcol/otlp/components/processor/infraattributesprocessor/go.sum b/comp/otelcol/otlp/components/processor/infraattributesprocessor/go.sum index 0bae72c3d6c8f..05605cfdfae08 100644 --- a/comp/otelcol/otlp/components/processor/infraattributesprocessor/go.sum +++ b/comp/otelcol/otlp/components/processor/infraattributesprocessor/go.sum @@ -50,38 +50,38 @@ github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOf github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -go.opentelemetry.io/collector/component v0.114.0 h1:SVGbm5LvHGSTEDv7p92oPuBgK5tuiWR82I9+LL4TtBE= -go.opentelemetry.io/collector/component v0.114.0/go.mod h1:MLxtjZ6UVHjDxSdhGLuJfHBHvfl1iT/Y7IaQPD24Eww= -go.opentelemetry.io/collector/component/componentstatus v0.114.0 h1:y9my/xink8KB5lK8zFAjgB2+pEh0QYy5TM972fxZY9w= -go.opentelemetry.io/collector/component/componentstatus v0.114.0/go.mod h1:RIoeCYZpPaae7QLE/1RacqzhHuXBmzRAk9H/EwYtIIs= -go.opentelemetry.io/collector/component/componenttest v0.114.0 h1:GM4FTTlfeXoVm6sZYBHImwlRN8ayh2oAfUhvaFj7Zo8= -go.opentelemetry.io/collector/component/componenttest v0.114.0/go.mod h1:ZZEJMtbJtoVC/3/9R1HzERq+cYQRxuMFQrPCpfZ4Xos= -go.opentelemetry.io/collector/config/configtelemetry v0.114.0 h1:kjLeyrumge6wsX6ZIkicdNOlBXaEyW2PI2ZdVXz/rzY= -go.opentelemetry.io/collector/config/configtelemetry v0.114.0/go.mod h1:R0MBUxjSMVMIhljuDHWIygzzJWQyZHXXWIgQNxcFwhc= -go.opentelemetry.io/collector/confmap v1.20.0 h1:ARfOwmkKxFOud1njl03yAHQ30+uenlzqCO6LBYamDTE= -go.opentelemetry.io/collector/confmap v1.20.0/go.mod h1:DMpd9Ay/ffls3JoQBQ73vWeRsz1rNuLbwjo6WtjSQus= -go.opentelemetry.io/collector/consumer v0.114.0 h1:1zVaHvfIZowGwZRitRBRo3i+RP2StlU+GClYiofSw0Q= -go.opentelemetry.io/collector/consumer v0.114.0/go.mod h1:d+Mrzt9hsH1ub3zmwSlnQVPLeTYir4Mgo7CrWfnncN4= -go.opentelemetry.io/collector/consumer/consumerprofiles v0.114.0 h1:5pXYy3E6UK5Huu3aQbsYL8B6E6MyWx4fvXXDn+oXZaA= -go.opentelemetry.io/collector/consumer/consumerprofiles v0.114.0/go.mod h1:PMq3f54KcJQO4v1tue0QxQScu7REFVADlXxXSAYMiN0= -go.opentelemetry.io/collector/consumer/consumertest v0.114.0 h1:isaTwJK5DOy8Bs7GuLq23ejfgj8gLIo5dOUvkRnLF4g= -go.opentelemetry.io/collector/consumer/consumertest v0.114.0/go.mod h1:GNeLPkfRPdh06n/Rv1UKa/cAtCKjN0a7ADyHjIj4HFE= -go.opentelemetry.io/collector/pdata v1.20.0 h1:ePcwt4bdtISP0loHaE+C9xYoU2ZkIvWv89Fob16o9SM= -go.opentelemetry.io/collector/pdata v1.20.0/go.mod h1:Ox1YVLe87cZDB/TL30i4SUz1cA5s6AM6SpFMfY61ICs= -go.opentelemetry.io/collector/pdata/pprofile v0.114.0 h1:pUNfTzsI/JUTiE+DScDM4lsrPoxnVNLI2fbTxR/oapo= -go.opentelemetry.io/collector/pdata/pprofile v0.114.0/go.mod h1:4aNcj6WM1n1uXyFSXlhVs4ibrERgNYsTbzcYI2zGhxA= -go.opentelemetry.io/collector/pdata/testdata v0.114.0 h1:+AzszWSL1i4K6meQ8rU0JDDW55SYCXa6FVqfDixhhTo= -go.opentelemetry.io/collector/pdata/testdata v0.114.0/go.mod h1:bv8XFdCTZxG2MQB5l9dKxSxf5zBrcodwO6JOy1+AxXM= -go.opentelemetry.io/collector/pipeline v0.114.0 h1:v3YOhc5z0tD6QbO5n/pnftpIeroihM2ks9Z2yKPCcwY= -go.opentelemetry.io/collector/pipeline v0.114.0/go.mod h1:4vOvjVsoYTHVGTbfFwqfnQOSV2K3RKUHofh3jNRc2Mg= -go.opentelemetry.io/collector/processor v0.114.0 h1:6bqQgLL7BtKrNv4YkEOGjZfkcfZv/ciJSQx1epGG9Zk= -go.opentelemetry.io/collector/processor v0.114.0/go.mod h1:DV/wa+nAmSHIDeD9NblPwkY9PbgtDQAZJ+PE5biZwPc= -go.opentelemetry.io/collector/processor/processorprofiles v0.114.0 h1:+P/1nLouEXTnN8DVQl+qWwO4BTkQyNPG9t/FrpUqrSI= -go.opentelemetry.io/collector/processor/processorprofiles v0.114.0/go.mod h1:3fuHeNIpINwx3bqFMprmDJyr6y5tWoWbJH599kltO5Y= -go.opentelemetry.io/collector/processor/processortest v0.114.0 h1:3FTaVXAp0LoVmUJn1ewBFckAby7AHa6/Kcdj0xuW14c= -go.opentelemetry.io/collector/processor/processortest v0.114.0/go.mod h1:OgsdOs1Fv5ZGTTJPF5nNIUJh2YkuV1acWd73yWgnti4= -go.opentelemetry.io/collector/semconv v0.114.0 h1:/eKcCJwZepQUtEuFuxa0thx2XIOvhFpaf214ZG1a11k= -go.opentelemetry.io/collector/semconv v0.114.0/go.mod h1:zCJ5njhWpejR+A40kiEoeFm1xq1uzyZwMnRNX6/D82A= +go.opentelemetry.io/collector/component v0.115.0 h1:iLte1oCiXzjiCnaOBKdsXacfFiECecpWxW3/LeriMoo= +go.opentelemetry.io/collector/component v0.115.0/go.mod h1:oIUFiH7w1eOimdeYhFI+gAIxYSiLDocKVJ0PTvX7d6s= +go.opentelemetry.io/collector/component/componentstatus v0.115.0 h1:pbpUIL+uKDfEiSgKK+S5nuSL6MDIIQYsp4b65ZGVb9M= +go.opentelemetry.io/collector/component/componentstatus v0.115.0/go.mod h1:36A+9XSiOz0Cdhq+UwwPRlEr5CYuSkEnVO9om4BH7d0= +go.opentelemetry.io/collector/component/componenttest v0.115.0 h1:9URDJ9VyP6tuij+YHjp/kSSMecnZOd7oGvzu+rw9SJY= +go.opentelemetry.io/collector/component/componenttest v0.115.0/go.mod h1:PzXvNqKLCiSADZGZFKH+IOHMkaQ0GTHuzysfVbTPKYY= +go.opentelemetry.io/collector/config/configtelemetry v0.115.0 h1:U07FinCDop+r2RjWQ3aP9ZWONC7r7kQIp1GkXQi6nsI= +go.opentelemetry.io/collector/config/configtelemetry v0.115.0/go.mod h1:SlBEwQg0qly75rXZ6W1Ig8jN25KBVBkFIIAUI1GiAAE= +go.opentelemetry.io/collector/confmap v1.21.0 h1:1tIcx2/Suwg8VhuPmQw87ba0ludPmumpFCFRZZa6RXA= +go.opentelemetry.io/collector/confmap v1.21.0/go.mod h1:Rrhs+MWoaP6AswZp+ReQ2VO9dfOfcUjdjiSHBsG+nec= +go.opentelemetry.io/collector/consumer v1.21.0 h1:THKZ2Vbi6GkamjTBI2hFq5Dc4kINZTWGwQNa8d/Ty9g= +go.opentelemetry.io/collector/consumer v1.21.0/go.mod h1:FQcC4ThMtRYY41dv+IPNK8POLLhAFY3r1YR5fuP7iiY= +go.opentelemetry.io/collector/consumer/consumerprofiles v0.115.0 h1:H3fDuyQW1t2HWHkz96WMBQJKUevypOCjBqnqtaAWyoA= +go.opentelemetry.io/collector/consumer/consumerprofiles v0.115.0/go.mod h1:IzEmZ91Tp7TBxVDq8Cc9xvLsmO7H08njr6Pu9P5d9ns= +go.opentelemetry.io/collector/consumer/consumertest v0.115.0 h1:hru0I2447y0TluCdwlKYFFtgcpyCnlM+LiOK1JZyA70= +go.opentelemetry.io/collector/consumer/consumertest v0.115.0/go.mod h1:ybjALRJWR6aKNOzEMy1T1ruCULVDEjj4omtOJMrH/kU= +go.opentelemetry.io/collector/pdata v1.21.0 h1:PG+UbiFMJ35X/WcAR7Rf/PWmWtRdW0aHlOidsR6c5MA= +go.opentelemetry.io/collector/pdata v1.21.0/go.mod h1:GKb1/zocKJMvxKbS+sl0W85lxhYBTFJ6h6I1tphVyDU= +go.opentelemetry.io/collector/pdata/pprofile v0.115.0 h1:NI89hy13vNDw7EOnQf7Jtitks4HJFO0SUWznTssmP94= +go.opentelemetry.io/collector/pdata/pprofile v0.115.0/go.mod h1:jGzdNfO0XTtfLjXCL/uCC1livg1LlfR+ix2WE/z3RpQ= +go.opentelemetry.io/collector/pdata/testdata v0.115.0 h1:Rblz+AKXdo3fG626jS+KSd0OSA4uMXcTQfpwed6P8LI= +go.opentelemetry.io/collector/pdata/testdata v0.115.0/go.mod h1:inNnRt6S2Nn260EfCBEcjesjlKOSsr0jPwkPqpBkt4s= +go.opentelemetry.io/collector/pipeline v0.115.0 h1:bmACBqb0e8U9ag+vGGHUP7kCfAO7HHROdtzIEg8ulus= +go.opentelemetry.io/collector/pipeline v0.115.0/go.mod h1:qE3DmoB05AW0C3lmPvdxZqd/H4po84NPzd5MrqgtL74= +go.opentelemetry.io/collector/processor v0.115.0 h1:+fveHGRe24PZPv/F5taahGuZ9HdNW44hgNWEJhIUdyc= +go.opentelemetry.io/collector/processor v0.115.0/go.mod h1:/oLHBlLsm7tFb7zOIrA5C0j14yBtjXKAgxJJ2Bktyk4= +go.opentelemetry.io/collector/processor/processorprofiles v0.115.0 h1:cCZAs+FXaebZPppqAN3m+X3etoSBL6NvyQo8l0hOZoo= +go.opentelemetry.io/collector/processor/processorprofiles v0.115.0/go.mod h1:kMxF0gknlWX4duuAJFi2/HuIRi6C3w95tOenRa0GKOY= +go.opentelemetry.io/collector/processor/processortest v0.115.0 h1:j9HEaYFOeOB6VYl9zGhBnhQbTkqGBa2udUvu5NTh6hc= +go.opentelemetry.io/collector/processor/processortest v0.115.0/go.mod h1:Gws+VEnp/eW3qAqPpqbKsrbnnxxNfyDjqrfUXbZfZic= +go.opentelemetry.io/collector/semconv v0.115.0 h1:SoqMvg4ZEB3mz2EdAb6XYa+TuMo5Mir5FRBr3nVFUDY= +go.opentelemetry.io/collector/semconv v0.115.0/go.mod h1:N6XE8Q0JKgBN2fAhkUQtqK9LT7rEGR6+Wu/Rtbal1iI= go.opentelemetry.io/otel v1.32.0 h1:WnBN+Xjcteh0zdk01SVqV55d/m62NJLJdIyb4y/WO5U= go.opentelemetry.io/otel v1.32.0/go.mod h1:00DCVSB0RQcnzlwyTfqtxSm+DRr9hpYrHjNGiBHVQIg= go.opentelemetry.io/otel/metric v1.32.0 h1:xV2umtmNcThh2/a/aCP+h64Xx5wsj8qqnkYZktzNa0M= @@ -107,20 +107,20 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.31.0 h1:68CPQngjLL0r2AlUKiSxtQFKvzRVbnzLwMUn5SzcLHo= -golang.org/x/net v0.31.0/go.mod h1:P4fl1q7dY2hnZFxEk4pPSkDHF+QqjitcnDjUQyMM+pM= +golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= +golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.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/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= -golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= diff --git a/comp/otelcol/otlp/components/statsprocessor/go.mod b/comp/otelcol/otlp/components/statsprocessor/go.mod index 5d552885f7b36..cff45d337dcd1 100644 --- a/comp/otelcol/otlp/components/statsprocessor/go.mod +++ b/comp/otelcol/otlp/components/statsprocessor/go.mod @@ -3,6 +3,7 @@ module github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/statsproces go 1.22.0 replace ( + github.com/DataDog/datadog-agent/comp/core/tagger/origindetection => ../../../../core/tagger/origindetection github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/metricsclient => ../metricsclient github.com/DataDog/datadog-agent/comp/trace/compression/def => ../../../../../comp/trace/compression/def github.com/DataDog/datadog-agent/comp/trace/compression/impl-gzip => ../../../../../comp/trace/compression/impl-gzip @@ -22,17 +23,18 @@ require ( github.com/DataDog/datadog-agent/comp/trace/compression/impl-gzip v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/proto v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/trace v0.56.0-rc.3 - github.com/DataDog/datadog-go/v5 v5.5.0 - github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.21.0 + github.com/DataDog/datadog-go/v5 v5.6.0 + github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.22.0 github.com/stretchr/testify v1.10.0 - go.opentelemetry.io/collector/component/componenttest v0.114.0 - go.opentelemetry.io/collector/pdata v1.20.0 + go.opentelemetry.io/collector/component/componenttest v0.115.0 + go.opentelemetry.io/collector/pdata v1.21.0 go.opentelemetry.io/otel/sdk/metric v1.32.0 ) -require go.opentelemetry.io/collector/component v0.114.0 // indirect +require go.opentelemetry.io/collector/component v0.115.0 // indirect require ( + github.com/DataDog/datadog-agent/comp/core/tagger/origindetection v0.0.0-20241217122454-175edb6c74f2 // indirect github.com/DataDog/datadog-agent/comp/trace/compression/def v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/pkg/obfuscate v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.56.0-rc.3 // indirect @@ -40,6 +42,7 @@ require ( github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/pointer v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/version v0.59.1 // indirect github.com/DataDog/go-sqllexer v0.0.17 // indirect github.com/DataDog/go-tuf v1.1.0-0.5.2 // indirect github.com/DataDog/sketches-go v1.4.6 // indirect @@ -51,6 +54,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 @@ -69,17 +73,17 @@ require ( github.com/outcaste-io/ristretto v0.2.3 // indirect github.com/philhofer/fwd v1.1.3-0.20240916144458-20a13a1f6b7c // indirect github.com/pkg/errors v0.9.1 // indirect + github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // 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/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 github.com/yusufpapurcu/wmi v1.2.4 // indirect - go.opentelemetry.io/collector/config/configtelemetry v0.114.0 // indirect - go.opentelemetry.io/collector/semconv v0.114.0 // indirect + go.opentelemetry.io/collector/config/configtelemetry v0.115.0 // indirect + go.opentelemetry.io/collector/semconv v0.115.0 // indirect go.opentelemetry.io/otel v1.32.0 // indirect go.opentelemetry.io/otel/metric v1.32.0 // indirect go.opentelemetry.io/otel/sdk v1.32.0 // indirect @@ -87,14 +91,15 @@ require ( go.uber.org/atomic v1.11.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect - golang.org/x/net v0.31.0 // indirect - golang.org/x/sys v0.27.0 // indirect - golang.org/x/text v0.20.0 // indirect + golang.org/x/net v0.33.0 // indirect + golang.org/x/sys v0.28.0 // indirect + golang.org/x/text v0.21.0 // indirect golang.org/x/time v0.8.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect google.golang.org/grpc v1.67.1 // indirect google.golang.org/protobuf v1.35.2 // indirect gopkg.in/ini.v1 v1.67.0 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) + +replace github.com/DataDog/datadog-agent/pkg/version => ../../../../../pkg/version diff --git a/comp/otelcol/otlp/components/statsprocessor/go.sum b/comp/otelcol/otlp/components/statsprocessor/go.sum index 3c983553c9350..abd898f9bed2a 100644 --- a/comp/otelcol/otlp/components/statsprocessor/go.sum +++ b/comp/otelcol/otlp/components/statsprocessor/go.sum @@ -1,11 +1,11 @@ -github.com/DataDog/datadog-go/v5 v5.5.0 h1:G5KHeB8pWBNXT4Jtw0zAkhdxEAWSpWH00geHI6LDrKU= -github.com/DataDog/datadog-go/v5 v5.5.0/go.mod h1:K9kcYBlxkcPP8tvvjZZKs/m1edNAUFzBbdpTUKfCsuw= +github.com/DataDog/datadog-go/v5 v5.6.0 h1:2oCLxjF/4htd55piM75baflj/KoE6VYS7alEUqFvRDw= +github.com/DataDog/datadog-go/v5 v5.6.0/go.mod h1:K9kcYBlxkcPP8tvvjZZKs/m1edNAUFzBbdpTUKfCsuw= github.com/DataDog/go-sqllexer v0.0.17 h1:u47fJAVg/+5DA74ZW3w0Qu+3qXHd3GtnA8ZBYixdPrM= github.com/DataDog/go-sqllexer v0.0.17/go.mod h1:KwkYhpFEVIq+BfobkTC1vfqm4gTi65skV/DpDBXtexc= github.com/DataDog/go-tuf v1.1.0-0.5.2 h1:4CagiIekonLSfL8GMHRHcHudo1fQnxELS9g4tiAupQ4= github.com/DataDog/go-tuf v1.1.0-0.5.2/go.mod h1:zBcq6f654iVqmkk8n2Cx81E1JnNTMOAx1UEO/wZR+P0= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.21.0 h1:hgbTFS6SkqbzOiWSfP58dZ/Jpjlmv6dpD4+V4LDHm2Q= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.21.0/go.mod h1:dvIWN9pA2zWNTw5rhDWZgzZnhcfpH++d+8d1SWW6xkY= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.22.0 h1:yfk2cF8Bx98fSFpGrehEHh1FRqewfxcCTAbUDt5r3F8= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.22.0/go.mod h1:9qzpnBSxSOnKzbF/uHket3SSlQihQHix/ZRC2nZUUYQ= 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/zstd v1.5.6 h1:LbEglqepa/ipmmQJUDnSsfvA8e8IStVcGaFWDuxvGOY= @@ -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= @@ -78,10 +80,10 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/sampling v0.114.0 h1:mtSN/07RGQPi1/zHVSZg4G0qRtOoJpPew5jsQWv9uS0= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/sampling v0.114.0/go.mod h1:C9Zgh/N3j4NR2D+1FGAA1YizhFW9OS51DwLUFJTdXN4= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/probabilisticsamplerprocessor v0.114.0 h1:I4ZYVRYW3Cjb65sPENZ9kHam/JUMXNEp2n/knJ0C0Vc= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/probabilisticsamplerprocessor v0.114.0/go.mod h1:4BhyIaOn2LS48WS+ZNix4TpP0+goq9gDEtGzth5Cr3M= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/sampling v0.115.0 h1:R9MRrO+dSkAHBQLZjuwjv2RHXHQqF2Wtm1Ki0VKD5cs= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/sampling v0.115.0/go.mod h1:rKXLXmwdUVcUHwTilroKSejbg3KSwLeYzNPSpkIEnv4= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/probabilisticsamplerprocessor v0.115.0 h1:vwZQ7k8oqlK0bdZYTsjP/59zjQQfjSD4fNsWIWsTu2w= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/probabilisticsamplerprocessor v0.115.0/go.mod h1:5ObSa9amrbzbYTdAK1Qhv3D/YqCxxnQhP0sk2eWB7Oo= github.com/opencontainers/runtime-spec v1.2.0 h1:z97+pHb3uELt/yiAWD691HNHQIF07bE7dzrbT927iTk= github.com/opencontainers/runtime-spec v1.2.0/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/outcaste-io/ristretto v0.2.3 h1:AK4zt/fJ76kjlYObOeNwh4T3asEuaCmp26pOvUOL9w0= @@ -90,6 +92,8 @@ github.com/philhofer/fwd v1.1.3-0.20240916144458-20a13a1f6b7c h1:dAMKvw0MlJT1Gsh github.com/philhofer/fwd v1.1.3-0.20240916144458-20a13a1f6b7c/go.mod h1:RqIHx9QI14HlwKwm98g9Re5prTQ6LdeRQn+gXJFxsJM= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 h1:GFCKgmp0tecUJ0sJuv4pzYCqS9+RGSn52M3FUwPs+uo= +github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10/go.mod h1:t/avpk3KcrXxUnYOhZhMXJlSEyie6gQbtLq5NM3loB8= 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= @@ -99,12 +103,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= @@ -134,36 +134,36 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0= github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= -go.opentelemetry.io/collector/component v0.114.0 h1:SVGbm5LvHGSTEDv7p92oPuBgK5tuiWR82I9+LL4TtBE= -go.opentelemetry.io/collector/component v0.114.0/go.mod h1:MLxtjZ6UVHjDxSdhGLuJfHBHvfl1iT/Y7IaQPD24Eww= -go.opentelemetry.io/collector/component/componentstatus v0.114.0 h1:y9my/xink8KB5lK8zFAjgB2+pEh0QYy5TM972fxZY9w= -go.opentelemetry.io/collector/component/componentstatus v0.114.0/go.mod h1:RIoeCYZpPaae7QLE/1RacqzhHuXBmzRAk9H/EwYtIIs= -go.opentelemetry.io/collector/component/componenttest v0.114.0 h1:GM4FTTlfeXoVm6sZYBHImwlRN8ayh2oAfUhvaFj7Zo8= -go.opentelemetry.io/collector/component/componenttest v0.114.0/go.mod h1:ZZEJMtbJtoVC/3/9R1HzERq+cYQRxuMFQrPCpfZ4Xos= -go.opentelemetry.io/collector/config/configtelemetry v0.114.0 h1:kjLeyrumge6wsX6ZIkicdNOlBXaEyW2PI2ZdVXz/rzY= -go.opentelemetry.io/collector/config/configtelemetry v0.114.0/go.mod h1:R0MBUxjSMVMIhljuDHWIygzzJWQyZHXXWIgQNxcFwhc= -go.opentelemetry.io/collector/consumer v0.114.0 h1:1zVaHvfIZowGwZRitRBRo3i+RP2StlU+GClYiofSw0Q= -go.opentelemetry.io/collector/consumer v0.114.0/go.mod h1:d+Mrzt9hsH1ub3zmwSlnQVPLeTYir4Mgo7CrWfnncN4= -go.opentelemetry.io/collector/consumer/consumerprofiles v0.114.0 h1:5pXYy3E6UK5Huu3aQbsYL8B6E6MyWx4fvXXDn+oXZaA= -go.opentelemetry.io/collector/consumer/consumerprofiles v0.114.0/go.mod h1:PMq3f54KcJQO4v1tue0QxQScu7REFVADlXxXSAYMiN0= -go.opentelemetry.io/collector/consumer/consumertest v0.114.0 h1:isaTwJK5DOy8Bs7GuLq23ejfgj8gLIo5dOUvkRnLF4g= -go.opentelemetry.io/collector/consumer/consumertest v0.114.0/go.mod h1:GNeLPkfRPdh06n/Rv1UKa/cAtCKjN0a7ADyHjIj4HFE= -go.opentelemetry.io/collector/pdata v1.20.0 h1:ePcwt4bdtISP0loHaE+C9xYoU2ZkIvWv89Fob16o9SM= -go.opentelemetry.io/collector/pdata v1.20.0/go.mod h1:Ox1YVLe87cZDB/TL30i4SUz1cA5s6AM6SpFMfY61ICs= -go.opentelemetry.io/collector/pdata/pprofile v0.114.0 h1:pUNfTzsI/JUTiE+DScDM4lsrPoxnVNLI2fbTxR/oapo= -go.opentelemetry.io/collector/pdata/pprofile v0.114.0/go.mod h1:4aNcj6WM1n1uXyFSXlhVs4ibrERgNYsTbzcYI2zGhxA= -go.opentelemetry.io/collector/pdata/testdata v0.114.0 h1:+AzszWSL1i4K6meQ8rU0JDDW55SYCXa6FVqfDixhhTo= -go.opentelemetry.io/collector/pdata/testdata v0.114.0/go.mod h1:bv8XFdCTZxG2MQB5l9dKxSxf5zBrcodwO6JOy1+AxXM= -go.opentelemetry.io/collector/pipeline v0.114.0 h1:v3YOhc5z0tD6QbO5n/pnftpIeroihM2ks9Z2yKPCcwY= -go.opentelemetry.io/collector/pipeline v0.114.0/go.mod h1:4vOvjVsoYTHVGTbfFwqfnQOSV2K3RKUHofh3jNRc2Mg= -go.opentelemetry.io/collector/processor v0.114.0 h1:6bqQgLL7BtKrNv4YkEOGjZfkcfZv/ciJSQx1epGG9Zk= -go.opentelemetry.io/collector/processor v0.114.0/go.mod h1:DV/wa+nAmSHIDeD9NblPwkY9PbgtDQAZJ+PE5biZwPc= -go.opentelemetry.io/collector/processor/processorprofiles v0.114.0 h1:+P/1nLouEXTnN8DVQl+qWwO4BTkQyNPG9t/FrpUqrSI= -go.opentelemetry.io/collector/processor/processorprofiles v0.114.0/go.mod h1:3fuHeNIpINwx3bqFMprmDJyr6y5tWoWbJH599kltO5Y= -go.opentelemetry.io/collector/processor/processortest v0.114.0 h1:3FTaVXAp0LoVmUJn1ewBFckAby7AHa6/Kcdj0xuW14c= -go.opentelemetry.io/collector/processor/processortest v0.114.0/go.mod h1:OgsdOs1Fv5ZGTTJPF5nNIUJh2YkuV1acWd73yWgnti4= -go.opentelemetry.io/collector/semconv v0.114.0 h1:/eKcCJwZepQUtEuFuxa0thx2XIOvhFpaf214ZG1a11k= -go.opentelemetry.io/collector/semconv v0.114.0/go.mod h1:zCJ5njhWpejR+A40kiEoeFm1xq1uzyZwMnRNX6/D82A= +go.opentelemetry.io/collector/component v0.115.0 h1:iLte1oCiXzjiCnaOBKdsXacfFiECecpWxW3/LeriMoo= +go.opentelemetry.io/collector/component v0.115.0/go.mod h1:oIUFiH7w1eOimdeYhFI+gAIxYSiLDocKVJ0PTvX7d6s= +go.opentelemetry.io/collector/component/componentstatus v0.115.0 h1:pbpUIL+uKDfEiSgKK+S5nuSL6MDIIQYsp4b65ZGVb9M= +go.opentelemetry.io/collector/component/componentstatus v0.115.0/go.mod h1:36A+9XSiOz0Cdhq+UwwPRlEr5CYuSkEnVO9om4BH7d0= +go.opentelemetry.io/collector/component/componenttest v0.115.0 h1:9URDJ9VyP6tuij+YHjp/kSSMecnZOd7oGvzu+rw9SJY= +go.opentelemetry.io/collector/component/componenttest v0.115.0/go.mod h1:PzXvNqKLCiSADZGZFKH+IOHMkaQ0GTHuzysfVbTPKYY= +go.opentelemetry.io/collector/config/configtelemetry v0.115.0 h1:U07FinCDop+r2RjWQ3aP9ZWONC7r7kQIp1GkXQi6nsI= +go.opentelemetry.io/collector/config/configtelemetry v0.115.0/go.mod h1:SlBEwQg0qly75rXZ6W1Ig8jN25KBVBkFIIAUI1GiAAE= +go.opentelemetry.io/collector/consumer v1.21.0 h1:THKZ2Vbi6GkamjTBI2hFq5Dc4kINZTWGwQNa8d/Ty9g= +go.opentelemetry.io/collector/consumer v1.21.0/go.mod h1:FQcC4ThMtRYY41dv+IPNK8POLLhAFY3r1YR5fuP7iiY= +go.opentelemetry.io/collector/consumer/consumerprofiles v0.115.0 h1:H3fDuyQW1t2HWHkz96WMBQJKUevypOCjBqnqtaAWyoA= +go.opentelemetry.io/collector/consumer/consumerprofiles v0.115.0/go.mod h1:IzEmZ91Tp7TBxVDq8Cc9xvLsmO7H08njr6Pu9P5d9ns= +go.opentelemetry.io/collector/consumer/consumertest v0.115.0 h1:hru0I2447y0TluCdwlKYFFtgcpyCnlM+LiOK1JZyA70= +go.opentelemetry.io/collector/consumer/consumertest v0.115.0/go.mod h1:ybjALRJWR6aKNOzEMy1T1ruCULVDEjj4omtOJMrH/kU= +go.opentelemetry.io/collector/pdata v1.21.0 h1:PG+UbiFMJ35X/WcAR7Rf/PWmWtRdW0aHlOidsR6c5MA= +go.opentelemetry.io/collector/pdata v1.21.0/go.mod h1:GKb1/zocKJMvxKbS+sl0W85lxhYBTFJ6h6I1tphVyDU= +go.opentelemetry.io/collector/pdata/pprofile v0.115.0 h1:NI89hy13vNDw7EOnQf7Jtitks4HJFO0SUWznTssmP94= +go.opentelemetry.io/collector/pdata/pprofile v0.115.0/go.mod h1:jGzdNfO0XTtfLjXCL/uCC1livg1LlfR+ix2WE/z3RpQ= +go.opentelemetry.io/collector/pdata/testdata v0.115.0 h1:Rblz+AKXdo3fG626jS+KSd0OSA4uMXcTQfpwed6P8LI= +go.opentelemetry.io/collector/pdata/testdata v0.115.0/go.mod h1:inNnRt6S2Nn260EfCBEcjesjlKOSsr0jPwkPqpBkt4s= +go.opentelemetry.io/collector/pipeline v0.115.0 h1:bmACBqb0e8U9ag+vGGHUP7kCfAO7HHROdtzIEg8ulus= +go.opentelemetry.io/collector/pipeline v0.115.0/go.mod h1:qE3DmoB05AW0C3lmPvdxZqd/H4po84NPzd5MrqgtL74= +go.opentelemetry.io/collector/processor v0.115.0 h1:+fveHGRe24PZPv/F5taahGuZ9HdNW44hgNWEJhIUdyc= +go.opentelemetry.io/collector/processor v0.115.0/go.mod h1:/oLHBlLsm7tFb7zOIrA5C0j14yBtjXKAgxJJ2Bktyk4= +go.opentelemetry.io/collector/processor/processorprofiles v0.115.0 h1:cCZAs+FXaebZPppqAN3m+X3etoSBL6NvyQo8l0hOZoo= +go.opentelemetry.io/collector/processor/processorprofiles v0.115.0/go.mod h1:kMxF0gknlWX4duuAJFi2/HuIRi6C3w95tOenRa0GKOY= +go.opentelemetry.io/collector/processor/processortest v0.115.0 h1:j9HEaYFOeOB6VYl9zGhBnhQbTkqGBa2udUvu5NTh6hc= +go.opentelemetry.io/collector/processor/processortest v0.115.0/go.mod h1:Gws+VEnp/eW3qAqPpqbKsrbnnxxNfyDjqrfUXbZfZic= +go.opentelemetry.io/collector/semconv v0.115.0 h1:SoqMvg4ZEB3mz2EdAb6XYa+TuMo5Mir5FRBr3nVFUDY= +go.opentelemetry.io/collector/semconv v0.115.0/go.mod h1:N6XE8Q0JKgBN2fAhkUQtqK9LT7rEGR6+Wu/Rtbal1iI= go.opentelemetry.io/otel v1.32.0 h1:WnBN+Xjcteh0zdk01SVqV55d/m62NJLJdIyb4y/WO5U= go.opentelemetry.io/otel v1.32.0/go.mod h1:00DCVSB0RQcnzlwyTfqtxSm+DRr9hpYrHjNGiBHVQIg= go.opentelemetry.io/otel/metric v1.32.0 h1:xV2umtmNcThh2/a/aCP+h64Xx5wsj8qqnkYZktzNa0M= @@ -186,8 +186,8 @@ go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.29.0 h1:L5SG1JTTXupVV3n6sUqMTeWbjAyfPwoda2DLX8J8FrQ= -golang.org/x/crypto v0.29.0/go.mod h1:+F4F4N5hv6v38hfeYwTdx20oUvLLc+QfrE9Ax9HtgRg= +golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U= +golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= @@ -196,8 +196,8 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.31.0 h1:68CPQngjLL0r2AlUKiSxtQFKvzRVbnzLwMUn5SzcLHo= -golang.org/x/net v0.31.0/go.mod h1:P4fl1q7dY2hnZFxEk4pPSkDHF+QqjitcnDjUQyMM+pM= +golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= +golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -214,13 +214,13 @@ golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220627191245-f75cf1eec38b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.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= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= -golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.8.0 h1:9i3RxcPv3PZnitoVGMPDKZSq1xW1gK1Xy3ArNOGZfEg= golang.org/x/time v0.8.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -245,8 +245,6 @@ gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntN gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/comp/otelcol/otlp/config.go b/comp/otelcol/otlp/config.go index 82448dbf45a59..ce56626e2f3e8 100644 --- a/comp/otelcol/otlp/config.go +++ b/comp/otelcol/otlp/config.go @@ -14,12 +14,13 @@ import ( "go.uber.org/multierr" + "github.com/go-viper/mapstructure/v2" + "github.com/DataDog/datadog-agent/comp/core/config" "github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/serializerexporter" "github.com/DataDog/datadog-agent/comp/otelcol/otlp/configcheck" coreconfig "github.com/DataDog/datadog-agent/pkg/config/setup" "github.com/DataDog/datadog-agent/pkg/util" - "github.com/go-viper/mapstructure/v2" ) func portToUint(v int) (port uint, err error) { @@ -51,7 +52,7 @@ func FromAgentConfig(cfg config.Reader) (PipelineConfig, error) { metricsConfigMap["apm_stats_receiver_addr"] = fmt.Sprintf("http://localhost:%s/v0.6/stats", coreconfig.Datadog().GetString("apm_config.receiver_port")) } - tags := strings.Join(util.GetStaticTagsSlice(context.TODO()), ",") + tags := strings.Join(util.GetStaticTagsSlice(context.TODO(), cfg), ",") if tags != "" { metricsConfigMap["tags"] = tags } diff --git a/comp/otelcol/otlp/testutil/go.mod b/comp/otelcol/otlp/testutil/go.mod index 023eadca279c9..77252436be1e7 100644 --- a/comp/otelcol/otlp/testutil/go.mod +++ b/comp/otelcol/otlp/testutil/go.mod @@ -37,11 +37,11 @@ require ( github.com/DataDog/datadog-agent/pkg/config/model v0.59.0 github.com/DataDog/datadog-agent/pkg/config/setup v0.59.0 github.com/DataDog/datadog-agent/pkg/proto v0.55.0 - github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.21.0 - github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.21.0 + github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.22.0 + github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.22.0 github.com/DataDog/sketches-go v1.4.6 github.com/stretchr/testify v1.10.0 - go.opentelemetry.io/collector/pdata v1.20.0 + go.opentelemetry.io/collector/pdata v1.21.0 google.golang.org/protobuf v1.35.2 ) @@ -55,25 +55,27 @@ require ( github.com/DataDog/datadog-agent/pkg/util/executable v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/filesystem v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.59.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/log v0.59.1 // indirect github.com/DataDog/datadog-agent/pkg/util/optional v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/pointer v0.59.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.1 // indirect 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.0 // indirect - github.com/DataDog/viper v1.13.5 // 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.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 github.com/hashicorp/hcl v1.0.1-vault-5 // indirect - github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 // indirect + github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 // indirect - github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c // indirect + github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect @@ -81,10 +83,10 @@ require ( github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect github.com/pelletier/go-toml v1.9.5 // indirect github.com/philhofer/fwd v1.1.3-0.20240916144458-20a13a1f6b7c // indirect + github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // 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/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // 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 @@ -95,10 +97,10 @@ require ( github.com/yusufpapurcu/wmi v1.2.4 // indirect go.uber.org/atomic v1.11.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f // indirect - golang.org/x/net v0.31.0 // indirect - golang.org/x/sys v0.27.0 // indirect - golang.org/x/text v0.20.0 // indirect + golang.org/x/exp v0.0.0-20241210194714-1829a127f884 // indirect + golang.org/x/net v0.33.0 // indirect + golang.org/x/sys v0.28.0 // indirect + golang.org/x/text v0.21.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect google.golang.org/grpc v1.67.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect @@ -106,3 +108,5 @@ require ( ) replace github.com/DataDog/datadog-agent/pkg/config/structure => ../../../../pkg/config/structure + +replace github.com/DataDog/datadog-agent/pkg/version => ../../../../pkg/version diff --git a/comp/otelcol/otlp/testutil/go.sum b/comp/otelcol/otlp/testutil/go.sum index b16358f7fcc0e..d2e3db7436254 100644 --- a/comp/otelcol/otlp/testutil/go.sum +++ b/comp/otelcol/otlp/testutil/go.sum @@ -1,13 +1,13 @@ 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/opentelemetry-mapping-go/pkg/inframetadata v0.21.0 h1:U+p1i7+upWb4qOIOOvjS/92iMUGlSzEC1tRxVo0Lg8Y= -github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.21.0/go.mod h1:dOjp1lg4jwYyIbpnqW+DoOV8qD+70C+lgpINFvUqasQ= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.21.0 h1:hgbTFS6SkqbzOiWSfP58dZ/Jpjlmv6dpD4+V4LDHm2Q= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.21.0/go.mod h1:dvIWN9pA2zWNTw5rhDWZgzZnhcfpH++d+8d1SWW6xkY= +github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.22.0 h1:r1Dx2cRHCBWkVluSZA41i4eoI/nOGbcrrZdkqWjoFCc= +github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.22.0/go.mod h1:+/dkO8ZiMa8rfm4SmtTF6qPUdBbBcvsWWKaO4xPKAIk= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.22.0 h1:yfk2cF8Bx98fSFpGrehEHh1FRqewfxcCTAbUDt5r3F8= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.22.0/go.mod h1:9qzpnBSxSOnKzbF/uHket3SSlQihQHix/ZRC2nZUUYQ= 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= @@ -79,7 +81,6 @@ github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/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= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -96,8 +97,8 @@ github.com/grpc-ecosystem/grpc-gateway v1.13.0/go.mod h1:8XEsbTttt/W+VvjtQhLACqC github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/hcl v1.0.1-vault-5 h1:kI3hhbbyzr4dldA8UdTb7ZlVVlI2DACdCfz31RPDgJM= github.com/hashicorp/hcl v1.0.1-vault-5/go.mod h1:XYhtn6ijBSAj6n4YqAaf7RBPS4I06AItNorpy+MoQNM= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 h1:S4qyfL2sEm5Budr4KVMyEniCy+PbS55651I/a+Kn/NQ= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb h1:PGufWXXDq9yaev6xX1YQauaO1MV90e6Mpoq1I7Lz/VM= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= @@ -122,8 +123,8 @@ 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-20220913051719-115f729f3c8c h1:VtwQ41oftZwlMnOEbMWQtSEUgU64U4s+GHk7hZK+jtY= -github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c/go.mod h1:JKx41uQRwqlTZabZc+kILPrO/3jlKnQ2Z8b7YiVw5cE= +github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a h1:3Bm7EwfUQUvhNeKIkUct/gl9eod1TcXuj8stxvi/GoI= +github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a/go.mod h1:ilwx/Dta8jXAgpFYFvSWEMwxmbWXyiUHkd5FwyKhb5k= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= @@ -152,11 +153,13 @@ github.com/philhofer/fwd v1.1.3-0.20240916144458-20a13a1f6b7c h1:dAMKvw0MlJT1Gsh github.com/philhofer/fwd v1.1.3-0.20240916144458-20a13a1f6b7c/go.mod h1:RqIHx9QI14HlwKwm98g9Re5prTQ6LdeRQn+gXJFxsJM= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 h1:GFCKgmp0tecUJ0sJuv4pzYCqS9+RGSn52M3FUwPs+uo= +github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10/go.mod h1:t/avpk3KcrXxUnYOhZhMXJlSEyie6gQbtLq5NM3loB8= 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-20220216144756-c35f1ee13d7c h1:NRoLoZvkBTKvR5gQLgA3e0hqjkY9u1wm+iOL45VN/qI= -github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 h1:o4JXh1EVt9k/+g42oCprj/FisM4qX9L3sZB3upGN2ZU= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= @@ -187,12 +190,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= @@ -244,8 +243,8 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0= github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.opentelemetry.io/collector/pdata v1.20.0 h1:ePcwt4bdtISP0loHaE+C9xYoU2ZkIvWv89Fob16o9SM= -go.opentelemetry.io/collector/pdata v1.20.0/go.mod h1:Ox1YVLe87cZDB/TL30i4SUz1cA5s6AM6SpFMfY61ICs= +go.opentelemetry.io/collector/pdata v1.21.0 h1:PG+UbiFMJ35X/WcAR7Rf/PWmWtRdW0aHlOidsR6c5MA= +go.opentelemetry.io/collector/pdata v1.21.0/go.mod h1:GKb1/zocKJMvxKbS+sl0W85lxhYBTFJ6h6I1tphVyDU= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= @@ -271,8 +270,8 @@ golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f h1:XdNn9LlyWAhLVp6P/i8QYBW+hlyhrhei9uErw2B5GJo= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f/go.mod h1:D5SMRVC3C2/4+F/DB1wZsLRnSNimn2Sp/NPsCrsv8ak= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884 h1:Y/Mj/94zIQQGHVSv1tTtQBDaQaJe62U9bkDZKKyhPCU= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -293,8 +292,8 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20191002035440-2ec189313ef0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.31.0 h1:68CPQngjLL0r2AlUKiSxtQFKvzRVbnzLwMUn5SzcLHo= -golang.org/x/net v0.31.0/go.mod h1:P4fl1q7dY2hnZFxEk4pPSkDHF+QqjitcnDjUQyMM+pM= +golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= +golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -316,12 +315,12 @@ golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20220829200755-d48e67d00261/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.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/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= -golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= diff --git a/comp/process/agent/component.go b/comp/process/agent/component.go index ecf92e3a5dfcc..1ac87a05c2dbc 100644 --- a/comp/process/agent/component.go +++ b/comp/process/agent/component.go @@ -6,7 +6,7 @@ // Package agent contains a process-agent component package agent -// team: processes +// team: container-intake // Component is the process agent component type type Component interface { diff --git a/comp/process/apiserver/apiserver.go b/comp/process/apiserver/apiserver.go index c216b2a93fef4..a7f75cfcbf471 100644 --- a/comp/process/apiserver/apiserver.go +++ b/comp/process/apiserver/apiserver.go @@ -7,7 +7,9 @@ package apiserver import ( "context" + "crypto/tls" "errors" + "net" "net/http" "time" @@ -15,8 +17,11 @@ import ( "go.uber.org/fx" "github.com/DataDog/datadog-agent/cmd/process-agent/api" - log "github.com/DataDog/datadog-agent/comp/core/log/def" + "github.com/DataDog/datadog-agent/comp/api/authtoken" + logComp "github.com/DataDog/datadog-agent/comp/core/log/def" + "github.com/DataDog/datadog-agent/pkg/api/util" pkgconfigsetup "github.com/DataDog/datadog-agent/pkg/config/setup" + "github.com/DataDog/datadog-agent/pkg/util/log" ) var _ Component = (*apiserver)(nil) @@ -30,7 +35,9 @@ type dependencies struct { Lc fx.Lifecycle - Log log.Component + Log logComp.Component + + At authtoken.Component APIServerDeps api.APIServerDeps } @@ -38,6 +45,7 @@ type dependencies struct { //nolint:revive // TODO(PROC) Fix revive linter func newApiServer(deps dependencies) Component { r := mux.NewRouter() + r.Use(validateToken) api.SetupAPIServerHandlers(deps.APIServerDeps, r) // Set up routes addr, err := pkgconfigsetup.GetProcessAPIAddressPort(pkgconfigsetup.Datadog()) @@ -59,8 +67,13 @@ func newApiServer(deps dependencies) Component { deps.Lc.Append(fx.Hook{ OnStart: func(_ context.Context) error { + ln, err := net.Listen("tcp", addr) + if err != nil { + return err + } go func() { - err := apiserver.server.ListenAndServe() + tlsListener := tls.NewListener(ln, deps.At.GetTLSServerConfig()) + err = apiserver.server.Serve(tlsListener) if err != nil && !errors.Is(err, http.ErrServerClosed) { _ = deps.Log.Error(err) } @@ -80,3 +93,13 @@ func newApiServer(deps dependencies) Component { return apiserver } + +func validateToken(next http.Handler) http.Handler { + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + if err := util.Validate(w, r); err != nil { + log.Warnf("invalid auth token for %s request to %s: %s", r.Method, r.RequestURI, err) + return + } + next.ServeHTTP(w, r) + }) +} diff --git a/comp/process/apiserver/apiserver_test.go b/comp/process/apiserver/apiserver_test.go index c9b0f4b96e92d..4f8b7f2cca342 100644 --- a/comp/process/apiserver/apiserver_test.go +++ b/comp/process/apiserver/apiserver_test.go @@ -6,14 +6,19 @@ package apiserver import ( + "fmt" + "net" "net/http" "testing" "time" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" "go.uber.org/fx" + "github.com/DataDog/datadog-agent/comp/api/authtoken/createandfetchimpl" "github.com/DataDog/datadog-agent/comp/core" + "github.com/DataDog/datadog-agent/comp/core/config" "github.com/DataDog/datadog-agent/comp/core/settings/settingsimpl" "github.com/DataDog/datadog-agent/comp/core/status" "github.com/DataDog/datadog-agent/comp/core/status/statusimpl" @@ -21,13 +26,21 @@ import ( taggerfx "github.com/DataDog/datadog-agent/comp/core/tagger/fx" workloadmeta "github.com/DataDog/datadog-agent/comp/core/workloadmeta/def" workloadmetafx "github.com/DataDog/datadog-agent/comp/core/workloadmeta/fx" + "github.com/DataDog/datadog-agent/pkg/api/util" "github.com/DataDog/datadog-agent/pkg/util/fxutil" ) func TestLifecycle(t *testing.T) { + listener, err := net.Listen("tcp", ":0") + require.NoError(t, err) + port := listener.Addr().(*net.TCPAddr).Port + _ = fxutil.Test[Component](t, fx.Options( Module(), core.MockBundle(), + fx.Replace(config.MockParams{Overrides: map[string]interface{}{ + "process_config.cmd_port": port, + }}), workloadmetafx.Module(workloadmeta.NewParams()), fx.Supply( status.Params{ @@ -39,15 +52,61 @@ func TestLifecycle(t *testing.T) { }), statusimpl.Module(), settingsimpl.MockModule(), + createandfetchimpl.Module(), )) - assert.Eventually(t, func() bool { - res, err := http.Get("http://localhost:6162/config") - if err != nil { - return false - } + assert.EventuallyWithT(t, func(c *assert.CollectT) { + url := fmt.Sprintf("https://localhost:%d/agent/status", port) + req, err := http.NewRequest("GET", url, nil) + require.NoError(c, err) + req.Header.Set("Authorization", "Bearer "+util.GetAuthToken()) + res, err := util.GetClient(false).Do(req) + require.NoError(c, err) defer res.Body.Close() + assert.Equal(c, http.StatusOK, res.StatusCode) + }, 5*time.Second, time.Second) +} - return res.StatusCode == http.StatusOK +func TestPostAuthentication(t *testing.T) { + listener, err := net.Listen("tcp", ":0") + require.NoError(t, err) + port := listener.Addr().(*net.TCPAddr).Port + + _ = fxutil.Test[Component](t, fx.Options( + Module(), + core.MockBundle(), + fx.Replace(config.MockParams{Overrides: map[string]interface{}{ + "process_config.cmd_port": port, + }}), + workloadmetafx.Module(workloadmeta.NewParams()), + fx.Supply( + status.Params{ + PythonVersionGetFunc: func() string { return "n/a" }, + }, + ), + taggerfx.Module(tagger.Params{ + UseFakeTagger: true, + }), + statusimpl.Module(), + settingsimpl.MockModule(), + createandfetchimpl.Module(), + )) + + assert.EventuallyWithT(t, func(c *assert.CollectT) { + // No authentication + url := fmt.Sprintf("https://localhost:%d/config/log_level?value=debug", port) + req, err := http.NewRequest("POST", url, nil) + require.NoError(c, err) + res, err := util.GetClient(false).Do(req) + require.NoError(c, err) + defer res.Body.Close() + assert.Equal(c, http.StatusUnauthorized, res.StatusCode) + + // With authentication + req.Header.Set("Authorization", "Bearer "+util.GetAuthToken()) + res, err = util.GetClient(false).Do(req) + require.NoError(c, err) + defer res.Body.Close() + assert.Equal(c, http.StatusOK, res.StatusCode) }, 5*time.Second, time.Second) } diff --git a/comp/process/apiserver/component.go b/comp/process/apiserver/component.go index 112bf88bf9a80..81d857325094f 100644 --- a/comp/process/apiserver/component.go +++ b/comp/process/apiserver/component.go @@ -12,7 +12,7 @@ import ( "github.com/DataDog/datadog-agent/pkg/util/fxutil" ) -// team: processes +// team: container-intake //nolint:revive // TODO(PROC) Fix revive linter type Component interface { diff --git a/comp/process/bundle.go b/comp/process/bundle.go index 73a8d9b7f5e81..96802180c2cce 100644 --- a/comp/process/bundle.go +++ b/comp/process/bundle.go @@ -29,7 +29,7 @@ import ( "github.com/DataDog/datadog-agent/pkg/util/fxutil" ) -// team: processes +// team: container-intake // Bundle defines the fx options for this bundle. // Do not add modules not owned by the processes team here as it breaks fx best practices diff --git a/comp/process/bundle_test.go b/comp/process/bundle_test.go index 591dce9f63cfb..9fb4131e013c0 100644 --- a/comp/process/bundle_test.go +++ b/comp/process/bundle_test.go @@ -12,6 +12,7 @@ import ( "github.com/stretchr/testify/require" "go.uber.org/fx" + "github.com/DataDog/datadog-agent/comp/api/authtoken/fetchonlyimpl" "github.com/DataDog/datadog-agent/comp/core" configComp "github.com/DataDog/datadog-agent/comp/core/config" log "github.com/DataDog/datadog-agent/comp/core/log/def" @@ -60,6 +61,7 @@ func TestBundleDependencies(t *testing.T) { rdnsquerier.MockModule(), npcollectorimpl.MockModule(), statsd.MockModule(), + fetchonlyimpl.MockModule(), ) } diff --git a/comp/process/connectionscheck/component.go b/comp/process/connectionscheck/component.go index 4f55a013d2a26..115312673119c 100644 --- a/comp/process/connectionscheck/component.go +++ b/comp/process/connectionscheck/component.go @@ -10,7 +10,7 @@ import ( "github.com/DataDog/datadog-agent/comp/process/types" ) -// team: processes +// team: container-intake //nolint:revive // TODO(PROC) Fix revive linter type Component interface { diff --git a/comp/process/containercheck/component.go b/comp/process/containercheck/component.go index 1fb5fa971c2df..0ff531c383215 100644 --- a/comp/process/containercheck/component.go +++ b/comp/process/containercheck/component.go @@ -10,7 +10,7 @@ import ( "github.com/DataDog/datadog-agent/comp/process/types" ) -// team: processes +// team: container-intake //nolint:revive // TODO(PROC) Fix revive linter type Component interface { diff --git a/comp/process/expvars/component.go b/comp/process/expvars/component.go index 542185936de3f..5297f4bb1dea2 100644 --- a/comp/process/expvars/component.go +++ b/comp/process/expvars/component.go @@ -6,7 +6,7 @@ // Package expvars initializes the expvar server of the process agent. package expvars -// team: processes +// team: container-intake //nolint:revive // TODO(PROC) Fix revive linter type Component interface { diff --git a/comp/process/forwarders/component.go b/comp/process/forwarders/component.go index 3d4cc9aa693ac..bcfdf5623f87e 100644 --- a/comp/process/forwarders/component.go +++ b/comp/process/forwarders/component.go @@ -10,7 +10,7 @@ import ( "github.com/DataDog/datadog-agent/comp/forwarder/defaultforwarder" ) -// team: processes +// team: container-intake //nolint:revive // TODO(PROC) Fix revive linter type Component interface { diff --git a/comp/process/hostinfo/component.go b/comp/process/hostinfo/component.go index df8e2d309ceb2..9cf8d7aa69b9a 100644 --- a/comp/process/hostinfo/component.go +++ b/comp/process/hostinfo/component.go @@ -10,7 +10,7 @@ import ( "github.com/DataDog/datadog-agent/pkg/process/checks" ) -// team: processes +// team: container-intake //nolint:revive // TODO(PROC) Fix revive linter type Component interface { diff --git a/comp/process/processcheck/component.go b/comp/process/processcheck/component.go index fe7f2b848267f..b80668be29188 100644 --- a/comp/process/processcheck/component.go +++ b/comp/process/processcheck/component.go @@ -10,7 +10,7 @@ import ( "github.com/DataDog/datadog-agent/comp/process/types" ) -// team: processes +// team: container-intake //nolint:revive // TODO(PROC) Fix revive linter type Component interface { diff --git a/comp/process/processdiscoverycheck/component.go b/comp/process/processdiscoverycheck/component.go index 35c275ff7a58c..127c0273b0e2f 100644 --- a/comp/process/processdiscoverycheck/component.go +++ b/comp/process/processdiscoverycheck/component.go @@ -10,7 +10,7 @@ import ( "github.com/DataDog/datadog-agent/comp/process/types" ) -// team: processes +// team: container-intake //nolint:revive // TODO(PROC) Fix revive linter type Component interface { diff --git a/comp/process/processeventscheck/component.go b/comp/process/processeventscheck/component.go index 4b0d127049ca2..9e6835057b513 100644 --- a/comp/process/processeventscheck/component.go +++ b/comp/process/processeventscheck/component.go @@ -10,7 +10,7 @@ import ( "github.com/DataDog/datadog-agent/comp/process/types" ) -// team: processes +// team: container-intake //nolint:revive // TODO(PROC) Fix revive linter type Component interface { diff --git a/comp/process/profiler/component.go b/comp/process/profiler/component.go index 5f920f3f627af..5e89705a1cc80 100644 --- a/comp/process/profiler/component.go +++ b/comp/process/profiler/component.go @@ -6,7 +6,7 @@ // Package profiler implements a component to handle starting and stopping the internal profiler. package profiler -// team: processes +// team: container-intake //nolint:revive // TODO(PROC) Fix revive linter type Component interface { diff --git a/comp/process/rtcontainercheck/component.go b/comp/process/rtcontainercheck/component.go index d313aa8359888..3d3f73c9a2b80 100644 --- a/comp/process/rtcontainercheck/component.go +++ b/comp/process/rtcontainercheck/component.go @@ -10,7 +10,7 @@ import ( "github.com/DataDog/datadog-agent/comp/process/types" ) -// team: processes +// team: container-intake //nolint:revive // TODO(PROC) Fix revive linter type Component interface { diff --git a/comp/process/runner/component.go b/comp/process/runner/component.go index 598ddf3065ce1..e818cfc388267 100644 --- a/comp/process/runner/component.go +++ b/comp/process/runner/component.go @@ -11,7 +11,7 @@ import ( "github.com/DataDog/datadog-agent/pkg/process/checks" ) -// team: processes +// team: container-intake // Component is the component type. type Component interface { diff --git a/comp/process/status/component.go b/comp/process/status/component.go index d08f20625b8ea..45fa3ff571d16 100644 --- a/comp/process/status/component.go +++ b/comp/process/status/component.go @@ -6,7 +6,7 @@ // Package status implements the core status component information provider interface package status -// team: processes +// team: container-intake // Component is the status interface. type Component interface { diff --git a/comp/process/submitter/component.go b/comp/process/submitter/component.go index 07359f6a2c306..26a88c6106017 100644 --- a/comp/process/submitter/component.go +++ b/comp/process/submitter/component.go @@ -11,7 +11,7 @@ import ( processRunner "github.com/DataDog/datadog-agent/pkg/process/runner" ) -// team: processes +// team: container-intake // Component is the component type. type Component interface { diff --git a/comp/rdnsquerier/impl-none/none.go b/comp/rdnsquerier/impl-none/none.go index 0b7f1022f1eb9..014306826c989 100644 --- a/comp/rdnsquerier/impl-none/none.go +++ b/comp/rdnsquerier/impl-none/none.go @@ -3,8 +3,8 @@ // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2024-present Datadog, Inc. -// Package rdnsquerierimpl provides the noop rdnsquerier component -package rdnsquerierimpl +// Package noneimpl provides the noop rdnsquerier component +package noneimpl import ( "context" diff --git a/comp/remote-config/rcclient/rcclientimpl/rcclient.go b/comp/remote-config/rcclient/rcclientimpl/rcclient.go index 4e43c1d99b1aa..374bb41bfe459 100644 --- a/comp/remote-config/rcclient/rcclientimpl/rcclient.go +++ b/comp/remote-config/rcclient/rcclientimpl/rcclient.go @@ -168,6 +168,10 @@ func (rc rcClient) start() { } } +// mrfUpdateCallback is the callback function for the AGENT_FAILOVER configs. +// It fetches all the configs targeting the agent and applies the failover settings +// using an OR strategy. In case of nil the value is not updated, for a false it does not update if +// the setting is already set to true. func (rc rcClient) mrfUpdateCallback(updates map[string]state.RawConfig, applyStateCallback func(string, state.ApplyStatus)) { // If the updates map is empty, we should unset the failover settings if they were set via RC previously if len(updates) == 0 { @@ -188,8 +192,13 @@ func (rc rcClient) mrfUpdateCallback(updates map[string]state.RawConfig, applySt return } - applied := false + var enableLogs, enableMetrics *bool + var enableLogsCfgPth, enableMetricsCfgPth string for cfgPath, update := range updates { + if (enableLogs != nil && *enableLogs) && (enableMetrics != nil && *enableMetrics) { + break + } + mrfUpdate, err := parseMultiRegionFailoverConfig(update.Config) if err != nil { pkglog.Errorf("Multi-Region Failover update unmarshal failed: %s", err) @@ -200,42 +209,55 @@ func (rc rcClient) mrfUpdateCallback(updates map[string]state.RawConfig, applySt continue } - if mrfUpdate != nil && (mrfUpdate.FailoverMetrics != nil || mrfUpdate.FailoverLogs != nil) { - // If we've received multiple config files updating the failover settings, we should disregard all but the first update and log it, as this is unexpected - if applied { - pkglog.Warnf("Multiple Multi-Region Failover updates received, disregarding update of `multi_region_failover.failover_metrics` to %v and `multi_region_failover.failover_logs` to %v", mrfUpdate.FailoverMetrics, mrfUpdate.FailoverLogs) - applyStateCallback(cfgPath, state.ApplyStatus{ - State: state.ApplyStateError, - Error: "Multiple Multi-Region Failover updates received. Only the first was applied.", - }) - continue - } + if mrfUpdate == nil || (mrfUpdate.FailoverMetrics == nil && mrfUpdate.FailoverLogs == nil) { + continue + } - if mrfUpdate.FailoverMetrics != nil { - err = rc.applyMRFRuntimeSetting("multi_region_failover.failover_metrics", *mrfUpdate.FailoverMetrics, cfgPath, applyStateCallback) - if err != nil { - continue - } - change := "disabled" - if *mrfUpdate.FailoverMetrics { - change = "enabled" - } - pkglog.Infof("Received remote update for Multi-Region Failover configuration: %s failover for metrics", change) - } - if mrfUpdate.FailoverLogs != nil { - err = rc.applyMRFRuntimeSetting("multi_region_failover.failover_logs", *mrfUpdate.FailoverLogs, cfgPath, applyStateCallback) - if err != nil { - continue - } - change := "disabled" - if *mrfUpdate.FailoverLogs { - change = "enabled" - } - pkglog.Infof("Received remote update for Multi-Region Failover configuration: %s failover for logs", change) - } - applyStateCallback(cfgPath, state.ApplyStatus{State: state.ApplyStateAcknowledged}) - applied = true + if !(enableMetrics != nil && *enableMetrics) && mrfUpdate.FailoverMetrics != nil { + enableMetrics = mrfUpdate.FailoverMetrics + enableMetricsCfgPth = cfgPath + } + + if !(enableLogs != nil && *enableLogs) && mrfUpdate.FailoverLogs != nil { + enableLogs = mrfUpdate.FailoverLogs + enableLogsCfgPth = cfgPath + } + } + + if enableMetrics != nil { + err := rc.applyMRFRuntimeSetting("multi_region_failover.failover_metrics", *enableMetrics, enableMetricsCfgPth, applyStateCallback) + if err != nil { + pkglog.Errorf("Multi-Region Failover failed to apply new metrics settings : %s", err) + applyStateCallback(enableMetricsCfgPth, state.ApplyStatus{ + State: state.ApplyStateError, + Error: err.Error(), + }) + return + } + change := "disabled" + if *enableMetrics { + change = "enabled" + } + pkglog.Infof("Received remote update for Multi-Region Failover configuration: %s failover for metrics", change) + applyStateCallback(enableMetricsCfgPth, state.ApplyStatus{State: state.ApplyStateAcknowledged}) + } + + if enableLogs != nil { + err := rc.applyMRFRuntimeSetting("multi_region_failover.failover_logs", *enableLogs, enableLogsCfgPth, applyStateCallback) + if err != nil { + pkglog.Errorf("Multi-Region Failover failed to apply new logs settings : %s", err) + applyStateCallback(enableMetricsCfgPth, state.ApplyStatus{ + State: state.ApplyStateError, + Error: err.Error(), + }) + return + } + change := "disabled" + if *enableLogs { + change = "enabled" } + pkglog.Infof("Received remote update for Multi-Region Failover configuration: %s failover for logs", change) + applyStateCallback(enableLogsCfgPth, state.ApplyStatus{State: state.ApplyStateAcknowledged}) } } diff --git a/comp/remote-config/rcclient/rcclientimpl/rcclient_test.go b/comp/remote-config/rcclient/rcclientimpl/rcclient_test.go index cf5a3cb093139..71b8bca9de2f2 100644 --- a/comp/remote-config/rcclient/rcclientimpl/rcclient_test.go +++ b/comp/remote-config/rcclient/rcclientimpl/rcclient_test.go @@ -6,6 +6,7 @@ package rcclientimpl import ( + "fmt" "testing" "time" @@ -25,7 +26,6 @@ import ( "github.com/DataDog/datadog-agent/pkg/util/fxutil" pkglog "github.com/DataDog/datadog-agent/pkg/util/log" - "github.com/cihub/seelog" "github.com/stretchr/testify/assert" "go.uber.org/fx" ) @@ -62,6 +62,39 @@ func (m *mockLogLevelRuntimeSettings) Hidden() bool { func applyEmpty(_ string, _ state.ApplyStatus) {} +type MockComponent interface { + settings.Component + + SetRuntimeSetting(setting string, value interface{}, source model.Source) error +} + +type MockComponentImplMrf struct { + settings.Component + + logs *bool + metrics *bool + traces *bool +} + +func (m *MockComponentImplMrf) SetRuntimeSetting(setting string, value interface{}, _ model.Source) error { + v, ok := value.(bool) + if !ok { + return fmt.Errorf("unexpected value type %T", value) + } + + switch setting { + case "multi_region_failover.failover_metrics": + m.metrics = &v + case "multi_region_failover.failover_logs": + m.logs = &v + case "multi_region_failover.failover_traces": + m.traces = &v + default: + return &settings.SettingNotFoundError{Name: setting} + } + return nil +} + func TestRCClientCreate(t *testing.T) { _, err := newRemoteConfigClient( fxutil.Test[dependencies]( @@ -96,7 +129,7 @@ func TestRCClientCreate(t *testing.T) { } func TestAgentConfigCallback(t *testing.T) { - pkglog.SetupLogger(seelog.Default, "info") + pkglog.SetupLogger(pkglog.Default(), "info") cfg := configmock.New(t) rc := fxutil.Test[rcclient.Component](t, @@ -190,3 +223,61 @@ func TestAgentConfigCallback(t *testing.T) { assert.Equal(t, "debug", cfg.Get("log_level")) assert.Equal(t, model.SourceCLI, cfg.GetSource("log_level")) } + +func TestAgentMRFConfigCallback(t *testing.T) { + pkglog.SetupLogger(pkglog.Default(), "info") + cfg := configmock.New(t) + + rc := fxutil.Test[rcclient.Component](t, + fx.Options( + Module(), + fx.Provide(func() log.Component { return logmock.New(t) }), + fx.Provide(func() config.Component { return cfg }), + sysprobeconfig.NoneModule(), + fx.Supply( + rcclient.Params{ + AgentName: "test-agent", + AgentVersion: "7.0.0", + }, + ), + fx.Supply( + settings.Params{ + Settings: map[string]settings.RuntimeSetting{ + "log_level": &mockLogLevelRuntimeSettings{logLevel: "info"}, + }, + Config: cfg, + }, + ), + settingsimpl.Module(), + ), + ) + + allInactive := state.RawConfig{Config: []byte(`{"name": "none"}`)} + noLogs := state.RawConfig{Config: []byte(`{"name": "nologs", "failover_logs": false}`)} + activeMetrics := state.RawConfig{Config: []byte(`{"name": "yesmetrics", "failover_metrics": true}`)} + + structRC := rc.(rcClient) + + ipcAddress, err := pkgconfigsetup.GetIPCAddress(cfg) + assert.NoError(t, err) + + structRC.client, _ = client.NewUnverifiedGRPCClient( + ipcAddress, pkgconfigsetup.GetIPCPort(), func() (string, error) { return security.FetchAuthToken(cfg) }, + client.WithAgent("test-agent", "9.99.9"), + client.WithProducts(state.ProductAgentConfig), + client.WithPollInterval(time.Hour), + ) + structRC.settingsComponent = &MockComponentImplMrf{} + + // Should enable metrics failover and disable logs failover + structRC.mrfUpdateCallback(map[string]state.RawConfig{ + "datadog/2/AGENT_FAILOVER/none/configname": allInactive, + "datadog/2/AGENT_FAILOVER/nologs/configname": noLogs, + "datadog/2/AGENT_FAILOVER/yesmetrics/configname": activeMetrics, + }, applyEmpty) + + cmpntSettings := structRC.settingsComponent.(*MockComponentImplMrf) + assert.True(t, *cmpntSettings.metrics) + assert.False(t, *cmpntSettings.logs) + assert.Nil(t, cmpntSettings.traces) +} diff --git a/comp/serializer/compression/go.mod b/comp/serializer/compression/go.mod index 9e8574fe77f13..d4d6aa51d7adc 100644 --- a/comp/serializer/compression/go.mod +++ b/comp/serializer/compression/go.mod @@ -36,7 +36,7 @@ replace ( require ( github.com/DataDog/datadog-agent/comp/core/config v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/util/fxutil v0.56.0-rc.3 - github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 + github.com/DataDog/datadog-agent/pkg/util/log v0.59.1 github.com/DataDog/zstd v1.5.6 ) @@ -58,29 +58,30 @@ require ( github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/optional v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/pointer v0.59.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.1 // indirect 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.0 // indirect - github.com/DataDog/viper v1.13.5 // 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.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 - github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 // indirect + github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 // indirect - github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c // indirect + github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c // indirect github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect 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/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // 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 @@ -95,11 +96,13 @@ require ( go.uber.org/fx v1.23.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect - golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f // indirect - golang.org/x/sys v0.27.0 // indirect - golang.org/x/text v0.20.0 // indirect + golang.org/x/exp v0.0.0-20241210194714-1829a127f884 // indirect + golang.org/x/sys v0.28.0 // indirect + golang.org/x/text v0.21.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) replace github.com/DataDog/datadog-agent/pkg/config/structure => ../../../pkg/config/structure + +replace github.com/DataDog/datadog-agent/pkg/version => ../../../pkg/version diff --git a/comp/serializer/compression/go.sum b/comp/serializer/compression/go.sum index b494c71596a4e..0c1d27817ea61 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= @@ -72,7 +74,6 @@ github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/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= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -87,8 +88,8 @@ github.com/grpc-ecosystem/grpc-gateway v1.13.0/go.mod h1:8XEsbTttt/W+VvjtQhLACqC github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/hcl v1.0.1-vault-5 h1:kI3hhbbyzr4dldA8UdTb7ZlVVlI2DACdCfz31RPDgJM= github.com/hashicorp/hcl v1.0.1-vault-5/go.mod h1:XYhtn6ijBSAj6n4YqAaf7RBPS4I06AItNorpy+MoQNM= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 h1:S4qyfL2sEm5Budr4KVMyEniCy+PbS55651I/a+Kn/NQ= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb h1:PGufWXXDq9yaev6xX1YQauaO1MV90e6Mpoq1I7Lz/VM= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= @@ -110,8 +111,8 @@ 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-20220913051719-115f729f3c8c h1:VtwQ41oftZwlMnOEbMWQtSEUgU64U4s+GHk7hZK+jtY= -github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c/go.mod h1:JKx41uQRwqlTZabZc+kILPrO/3jlKnQ2Z8b7YiVw5cE= +github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a h1:3Bm7EwfUQUvhNeKIkUct/gl9eod1TcXuj8stxvi/GoI= +github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a/go.mod h1:ilwx/Dta8jXAgpFYFvSWEMwxmbWXyiUHkd5FwyKhb5k= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= @@ -138,8 +139,8 @@ github.com/pkg/errors v0.8.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-20220216144756-c35f1ee13d7c h1:NRoLoZvkBTKvR5gQLgA3e0hqjkY9u1wm+iOL45VN/qI= -github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 h1:o4JXh1EVt9k/+g42oCprj/FisM4qX9L3sZB3upGN2ZU= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= @@ -171,12 +172,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= @@ -243,8 +240,8 @@ golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnf golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f h1:XdNn9LlyWAhLVp6P/i8QYBW+hlyhrhei9uErw2B5GJo= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f/go.mod h1:D5SMRVC3C2/4+F/DB1wZsLRnSNimn2Sp/NPsCrsv8ak= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884 h1:Y/Mj/94zIQQGHVSv1tTtQBDaQaJe62U9bkDZKKyhPCU= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -281,11 +278,11 @@ golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20220829200755-d48e67d00261/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.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/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= -golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= diff --git a/comp/serializer/compression/impl-noop/no_strategy.go b/comp/serializer/compression/impl-noop/no_strategy.go index 45523952b4ca2..3c092a8a536d4 100644 --- a/comp/serializer/compression/impl-noop/no_strategy.go +++ b/comp/serializer/compression/impl-noop/no_strategy.go @@ -3,8 +3,8 @@ // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2016-present Datadog, Inc. -// Package compressionimpl provides a set of functions for compressing with zlib / zstd -package compressionimpl +// Package noopimpl provides a set of functions for compressing with zlib / zstd +package noopimpl import ( "bytes" diff --git a/comp/serializer/compression/impl-zlib/zlib_strategy.go b/comp/serializer/compression/impl-zlib/zlib_strategy.go index 2bbe1a99d1a09..0bd47af4f91fc 100644 --- a/comp/serializer/compression/impl-zlib/zlib_strategy.go +++ b/comp/serializer/compression/impl-zlib/zlib_strategy.go @@ -3,8 +3,8 @@ // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2016-present Datadog, Inc. -// Package compressionimpl provides a set of functions for compressing with zlib -package compressionimpl +// Package zlibimpl provides a set of functions for compressing with zlib +package zlibimpl import ( "bytes" diff --git a/comp/serializer/compression/impl-zstd/zstd_strategy.go b/comp/serializer/compression/impl-zstd/zstd_strategy.go index 994135a0889cd..3b90737bbfce8 100644 --- a/comp/serializer/compression/impl-zstd/zstd_strategy.go +++ b/comp/serializer/compression/impl-zstd/zstd_strategy.go @@ -3,14 +3,15 @@ // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2016-present Datadog, Inc. -// Package compressionimpl provides a set of functions for compressing with zstd -package compressionimpl +// Package zstdimpl provides a set of functions for compressing with zstd +package zstdimpl import ( "bytes" - compression "github.com/DataDog/datadog-agent/comp/serializer/compression/def" "github.com/DataDog/zstd" + + compression "github.com/DataDog/datadog-agent/comp/serializer/compression/def" ) // Requires contains the compression level for zstd compression diff --git a/comp/snmptraps/listener/listenerimpl/listener.go b/comp/snmptraps/listener/listenerimpl/listener.go index 7571896edc30d..ab3d5c3aa3dea 100644 --- a/comp/snmptraps/listener/listenerimpl/listener.go +++ b/comp/snmptraps/listener/listenerimpl/listener.go @@ -8,6 +8,7 @@ package listenerimpl import ( "context" + "crypto/subtle" "errors" "fmt" "net" @@ -167,7 +168,8 @@ func validatePacket(p *gosnmp.SnmpPacket, c *config.TrapsConfig) error { // At least one of the known community strings must match. for _, community := range c.CommunityStrings { - if community == p.Community { + // Simple string equality check, but in constant time to avoid timing attacks + if subtle.ConstantTimeCompare([]byte(community), []byte(p.Community)) == 1 { return nil } } diff --git a/comp/trace/agent/def/go.mod b/comp/trace/agent/def/go.mod index 3ab74572b71b2..1bfc5a3ba75af 100644 --- a/comp/trace/agent/def/go.mod +++ b/comp/trace/agent/def/go.mod @@ -6,13 +6,8 @@ replace github.com/DataDog/datadog-agent/pkg/proto => ../../../../pkg/proto require ( github.com/DataDog/datadog-agent/pkg/proto v0.56.0-rc.3 - github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.21.0 - go.opentelemetry.io/collector/pdata v1.20.0 -) - -require ( - go.opentelemetry.io/collector/component/componenttest v0.114.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.32.0 // indirect + github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.22.0 + go.opentelemetry.io/collector/pdata v1.21.0 ) require ( @@ -21,18 +16,19 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/philhofer/fwd v1.1.3-0.20240916144458-20a13a1f6b7c // indirect + github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect github.com/tinylib/msgp v1.2.4 // indirect - go.opentelemetry.io/collector/component v0.114.0 // indirect - go.opentelemetry.io/collector/config/configtelemetry v0.114.0 // indirect - go.opentelemetry.io/collector/semconv v0.114.0 // indirect + go.opentelemetry.io/collector/component v0.115.0 // indirect + go.opentelemetry.io/collector/config/configtelemetry v0.115.0 // indirect + go.opentelemetry.io/collector/semconv v0.115.0 // indirect go.opentelemetry.io/otel v1.32.0 // indirect go.opentelemetry.io/otel/metric v1.32.0 // indirect go.opentelemetry.io/otel/trace v1.32.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect - golang.org/x/net v0.31.0 // indirect - golang.org/x/sys v0.27.0 // indirect - golang.org/x/text v0.20.0 // indirect + golang.org/x/net v0.33.0 // indirect + golang.org/x/sys v0.28.0 // indirect + golang.org/x/text v0.21.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect google.golang.org/grpc v1.67.1 // indirect google.golang.org/protobuf v1.35.2 // indirect diff --git a/comp/trace/agent/def/go.sum b/comp/trace/agent/def/go.sum index dd3eb5357b3e6..92539a14a3bd1 100644 --- a/comp/trace/agent/def/go.sum +++ b/comp/trace/agent/def/go.sum @@ -1,5 +1,5 @@ -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.21.0 h1:hgbTFS6SkqbzOiWSfP58dZ/Jpjlmv6dpD4+V4LDHm2Q= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.21.0/go.mod h1:dvIWN9pA2zWNTw5rhDWZgzZnhcfpH++d+8d1SWW6xkY= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.22.0 h1:yfk2cF8Bx98fSFpGrehEHh1FRqewfxcCTAbUDt5r3F8= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.22.0/go.mod h1:9qzpnBSxSOnKzbF/uHket3SSlQihQHix/ZRC2nZUUYQ= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= @@ -30,6 +30,8 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/philhofer/fwd v1.1.3-0.20240916144458-20a13a1f6b7c h1:dAMKvw0MlJT1GshSTtih8C2gDs04w8dReiOGXrGLNoY= github.com/philhofer/fwd v1.1.3-0.20240916144458-20a13a1f6b7c/go.mod h1:RqIHx9QI14HlwKwm98g9Re5prTQ6LdeRQn+gXJFxsJM= +github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 h1:GFCKgmp0tecUJ0sJuv4pzYCqS9+RGSn52M3FUwPs+uo= +github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10/go.mod h1:t/avpk3KcrXxUnYOhZhMXJlSEyie6gQbtLq5NM3loB8= 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= @@ -45,16 +47,16 @@ github.com/vmihailenco/tagparser v0.1.2 h1:gnjoVuB/kljJ5wICEEOpx98oXMWPLj22G67Vb github.com/vmihailenco/tagparser v0.1.2/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -go.opentelemetry.io/collector/component v0.114.0 h1:SVGbm5LvHGSTEDv7p92oPuBgK5tuiWR82I9+LL4TtBE= -go.opentelemetry.io/collector/component v0.114.0/go.mod h1:MLxtjZ6UVHjDxSdhGLuJfHBHvfl1iT/Y7IaQPD24Eww= -go.opentelemetry.io/collector/component/componenttest v0.114.0 h1:GM4FTTlfeXoVm6sZYBHImwlRN8ayh2oAfUhvaFj7Zo8= -go.opentelemetry.io/collector/component/componenttest v0.114.0/go.mod h1:ZZEJMtbJtoVC/3/9R1HzERq+cYQRxuMFQrPCpfZ4Xos= -go.opentelemetry.io/collector/config/configtelemetry v0.114.0 h1:kjLeyrumge6wsX6ZIkicdNOlBXaEyW2PI2ZdVXz/rzY= -go.opentelemetry.io/collector/config/configtelemetry v0.114.0/go.mod h1:R0MBUxjSMVMIhljuDHWIygzzJWQyZHXXWIgQNxcFwhc= -go.opentelemetry.io/collector/pdata v1.20.0 h1:ePcwt4bdtISP0loHaE+C9xYoU2ZkIvWv89Fob16o9SM= -go.opentelemetry.io/collector/pdata v1.20.0/go.mod h1:Ox1YVLe87cZDB/TL30i4SUz1cA5s6AM6SpFMfY61ICs= -go.opentelemetry.io/collector/semconv v0.114.0 h1:/eKcCJwZepQUtEuFuxa0thx2XIOvhFpaf214ZG1a11k= -go.opentelemetry.io/collector/semconv v0.114.0/go.mod h1:zCJ5njhWpejR+A40kiEoeFm1xq1uzyZwMnRNX6/D82A= +go.opentelemetry.io/collector/component v0.115.0 h1:iLte1oCiXzjiCnaOBKdsXacfFiECecpWxW3/LeriMoo= +go.opentelemetry.io/collector/component v0.115.0/go.mod h1:oIUFiH7w1eOimdeYhFI+gAIxYSiLDocKVJ0PTvX7d6s= +go.opentelemetry.io/collector/component/componenttest v0.115.0 h1:9URDJ9VyP6tuij+YHjp/kSSMecnZOd7oGvzu+rw9SJY= +go.opentelemetry.io/collector/component/componenttest v0.115.0/go.mod h1:PzXvNqKLCiSADZGZFKH+IOHMkaQ0GTHuzysfVbTPKYY= +go.opentelemetry.io/collector/config/configtelemetry v0.115.0 h1:U07FinCDop+r2RjWQ3aP9ZWONC7r7kQIp1GkXQi6nsI= +go.opentelemetry.io/collector/config/configtelemetry v0.115.0/go.mod h1:SlBEwQg0qly75rXZ6W1Ig8jN25KBVBkFIIAUI1GiAAE= +go.opentelemetry.io/collector/pdata v1.21.0 h1:PG+UbiFMJ35X/WcAR7Rf/PWmWtRdW0aHlOidsR6c5MA= +go.opentelemetry.io/collector/pdata v1.21.0/go.mod h1:GKb1/zocKJMvxKbS+sl0W85lxhYBTFJ6h6I1tphVyDU= +go.opentelemetry.io/collector/semconv v0.115.0 h1:SoqMvg4ZEB3mz2EdAb6XYa+TuMo5Mir5FRBr3nVFUDY= +go.opentelemetry.io/collector/semconv v0.115.0/go.mod h1:N6XE8Q0JKgBN2fAhkUQtqK9LT7rEGR6+Wu/Rtbal1iI= go.opentelemetry.io/otel v1.32.0 h1:WnBN+Xjcteh0zdk01SVqV55d/m62NJLJdIyb4y/WO5U= go.opentelemetry.io/otel v1.32.0/go.mod h1:00DCVSB0RQcnzlwyTfqtxSm+DRr9hpYrHjNGiBHVQIg= go.opentelemetry.io/otel/metric v1.32.0 h1:xV2umtmNcThh2/a/aCP+h64Xx5wsj8qqnkYZktzNa0M= @@ -80,20 +82,20 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.31.0 h1:68CPQngjLL0r2AlUKiSxtQFKvzRVbnzLwMUn5SzcLHo= -golang.org/x/net v0.31.0/go.mod h1:P4fl1q7dY2hnZFxEk4pPSkDHF+QqjitcnDjUQyMM+pM= +golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= +golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.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/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= -golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= diff --git a/comp/trace/agent/impl/agent.go b/comp/trace/agent/impl/agent.go index b3d783288ceb6..de9237dedeea5 100644 --- a/comp/trace/agent/impl/agent.go +++ b/comp/trace/agent/impl/agent.go @@ -24,6 +24,7 @@ import ( "go.opentelemetry.io/collector/pdata/ptrace" "go.uber.org/fx" + "github.com/DataDog/datadog-agent/comp/api/authtoken" "github.com/DataDog/datadog-agent/comp/core/secrets" tagger "github.com/DataDog/datadog-agent/comp/core/tagger/def" "github.com/DataDog/datadog-agent/comp/dogstatsd/statsd" @@ -68,6 +69,7 @@ type dependencies struct { Statsd statsd.Component Tagger tagger.Component Compressor compression.Component + At authtoken.Component } var _ traceagent.Component = (*component)(nil) @@ -93,6 +95,7 @@ type component struct { params *Params tagger tagger.Component telemetryCollector telemetry.TelemetryCollector + at authtoken.Component wg *sync.WaitGroup } @@ -115,6 +118,7 @@ func NewAgent(deps dependencies) (traceagent.Component, error) { params: deps.Params, telemetryCollector: deps.TelemetryCollector, tagger: deps.Tagger, + at: deps.At, wg: &sync.WaitGroup{}, } statsdCl, err := setupMetrics(deps.Statsd, c.config, c.telemetryCollector) diff --git a/comp/trace/agent/impl/run.go b/comp/trace/agent/impl/run.go index df25106b78755..f40b36e29ae7f 100644 --- a/comp/trace/agent/impl/run.go +++ b/comp/trace/agent/impl/run.go @@ -23,7 +23,7 @@ import ( "github.com/DataDog/datadog-agent/pkg/trace/info" "github.com/DataDog/datadog-agent/pkg/trace/telemetry" "github.com/DataDog/datadog-agent/pkg/trace/watchdog" - "github.com/DataDog/datadog-agent/pkg/util" + "github.com/DataDog/datadog-agent/pkg/util/coredump" "github.com/DataDog/datadog-agent/pkg/util/log" "github.com/DataDog/datadog-agent/pkg/util/profiling" "github.com/DataDog/datadog-agent/pkg/version" @@ -41,7 +41,7 @@ func runAgentSidekicks(ag component) error { defer watchdog.LogOnPanic(ag.Statsd) - if err := util.SetupCoreDump(pkgconfigsetup.Datadog()); err != nil { + if err := coredump.Setup(pkgconfigsetup.Datadog()); err != nil { log.Warnf("Can't setup core dumps: %v, core dumps might not be available after a crash", err) } @@ -98,6 +98,9 @@ func runAgentSidekicks(ag component) error { })) } + // Configure the Trace Agent Debug server to use the IPC certificate + ag.Agent.DebugServer.SetTLSConfig(ag.at.GetTLSServerConfig()) + log.Infof("Trace agent running on host %s", tracecfg.Hostname) if pcfg := profilingConfig(tracecfg); pcfg != nil { if err := profiling.Start(*pcfg); err != nil { diff --git a/comp/trace/bundle_test.go b/comp/trace/bundle_test.go index e9874a4b40077..692e7c255f473 100644 --- a/comp/trace/bundle_test.go +++ b/comp/trace/bundle_test.go @@ -13,6 +13,8 @@ import ( "github.com/stretchr/testify/require" "go.uber.org/fx" + "github.com/DataDog/datadog-agent/comp/api/authtoken/createandfetchimpl" + "github.com/DataDog/datadog-agent/comp/api/authtoken/fetchonlyimpl" "github.com/DataDog/datadog-agent/comp/core" coreconfig "github.com/DataDog/datadog-agent/comp/core/config" log "github.com/DataDog/datadog-agent/comp/core/log/def" @@ -45,6 +47,7 @@ func TestBundleDependencies(t *testing.T) { zstdfx.Module(), taggerfx.Module(tagger.Params{}), fx.Supply(&traceagentimpl.Params{}), + createandfetchimpl.Module(), ) } @@ -75,6 +78,7 @@ func TestMockBundleDependencies(t *testing.T) { fx.Invoke(func(_ traceagent.Component) {}), MockBundle(), taggerfx.Module(tagger.Params{}), + fetchonlyimpl.MockModule(), )) require.NotNil(t, cfg.Object()) diff --git a/comp/trace/compression/impl-gzip/gzip.go b/comp/trace/compression/impl-gzip/gzip.go index eada290dae873..4a7943bde1f03 100644 --- a/comp/trace/compression/impl-gzip/gzip.go +++ b/comp/trace/compression/impl-gzip/gzip.go @@ -3,8 +3,8 @@ // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2024-present Datadog, Inc. -// Package compressionimpl implements the compression component interface -package compressionimpl +// Package gzipimpl implements the compression component interface +package gzipimpl import ( "compress/gzip" diff --git a/comp/trace/compression/impl-zstd/zstd.go b/comp/trace/compression/impl-zstd/zstd.go index d418d4362f8b2..fc43c47cb0886 100644 --- a/comp/trace/compression/impl-zstd/zstd.go +++ b/comp/trace/compression/impl-zstd/zstd.go @@ -3,8 +3,8 @@ // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2024-present Datadog, Inc. -// Package compressionimpl implements the compression component interface -package compressionimpl +// Package zstdimpl implements the compression component interface +package zstdimpl import ( "io" diff --git a/comp/trace/config/config_test.go b/comp/trace/config/config_test.go index f428a7da51bc4..9706e2c784f4c 100644 --- a/comp/trace/config/config_test.go +++ b/comp/trace/config/config_test.go @@ -9,6 +9,7 @@ import ( "bufio" "bytes" "context" + _ "embed" "encoding/json" "errors" "net/http" @@ -23,7 +24,6 @@ import ( "text/template" "time" - "github.com/cihub/seelog" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.uber.org/fx" @@ -136,9 +136,8 @@ func TestSplitTagRegex(t *testing.T) { var b bytes.Buffer w := bufio.NewWriter(&b) - logger, err := seelog.LoggerFromWriterWithMinLevelAndFormat(w, seelog.DebugLvl, "[%LEVEL] %Msg") + logger, err := log.LoggerFromWriterWithMinLevelAndFormat(w, log.DebugLvl, "[%LEVEL] %Msg") assert.Nil(t, err) - seelog.ReplaceLogger(logger) //nolint:errcheck log.SetupLogger(logger, "debug") assert.Nil(t, splitTagRegex(bad.tag)) w.Flush() @@ -247,6 +246,9 @@ func TestTelemetryEndpointsConfig(t *testing.T) { }) } +//go:embed testdata/stringcode.go.tmpl +var stringCodeBody string + func TestConfigHostname(t *testing.T) { t.Run("fail", func(t *testing.T) { overrides := map[string]interface{}{ @@ -362,11 +364,6 @@ func TestConfigHostname(t *testing.T) { }) t.Run("external", func(t *testing.T) { - body, err := os.ReadFile("testdata/stringcode.go.tmpl") - if err != nil { - t.Fatal(err) - } - // makeProgram creates a new binary file which returns the given response and exits to the OS // given the specified code, returning the path of the program. makeProgram := func(t *testing.T, response string, code int) string { @@ -374,7 +371,7 @@ func TestConfigHostname(t *testing.T) { if err != nil { t.Fatal(err) } - tmpl, err := template.New("program").Parse(string(body)) + tmpl, err := template.New("program").Parse(stringCodeBody) if err != nil { t.Fatal(err) } @@ -401,6 +398,7 @@ func TestConfigHostname(t *testing.T) { fallbackHostnameFunc = func() (string, error) { return "fallback.host", nil } t.Run("good", func(t *testing.T) { + t.Skip("Skip flaky test while we explore fixes.") bin := makeProgram(t, "host.name", 0) defer os.Remove(bin) diff --git a/comp/trace/config/setup.go b/comp/trace/config/setup.go index f19c5eeaf8a4f..0eba6a37e8953 100644 --- a/comp/trace/config/setup.go +++ b/comp/trace/config/setup.go @@ -19,13 +19,14 @@ import ( "go.opentelemetry.io/collector/component/componenttest" - apiutil "github.com/DataDog/datadog-agent/pkg/api/util" "github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes" corecompcfg "github.com/DataDog/datadog-agent/comp/core/config" tagger "github.com/DataDog/datadog-agent/comp/core/tagger/def" + "github.com/DataDog/datadog-agent/comp/core/tagger/origindetection" "github.com/DataDog/datadog-agent/comp/core/tagger/types" "github.com/DataDog/datadog-agent/comp/otelcol/otlp/configcheck" + apiutil "github.com/DataDog/datadog-agent/pkg/api/util" "github.com/DataDog/datadog-agent/pkg/config/env" "github.com/DataDog/datadog-agent/pkg/config/model" pkgconfigsetup "github.com/DataDog/datadog-agent/pkg/config/setup" @@ -121,6 +122,9 @@ func prepareConfig(c corecompcfg.Component, tagger tagger.Component) (*config.Ag cfg.ContainerTags = func(cid string) ([]string, error) { return tagger.Tag(types.NewEntityID(types.ContainerID, cid), types.HighCardinality) } + cfg.ContainerIDFromOriginInfo = func(originInfo origindetection.OriginInfo) (string, error) { + return tagger.GenerateContainerIDFromOriginInfo(originInfo) + } cfg.ContainerProcRoot = coreConfigObject.GetString("container_proc_root") cfg.GetAgentAuthToken = apiutil.GetAuthToken return cfg, nil @@ -401,110 +405,37 @@ func applyDatadogConfig(c *config.AgentConfig, core corecompcfg.Component) error c.TelemetryConfig.Endpoints = appendEndpoints(c.TelemetryConfig.Endpoints, "apm_config.telemetry.additional_endpoints") } c.Obfuscation = new(config.ObfuscationConfig) - if core.IsSet("apm_config.obfuscation") { - cfg := pkgconfigsetup.Datadog() - var o config.ObfuscationConfig - err := structure.UnmarshalKey(cfg, "apm_config.obfuscation", &o) - if err == nil { - c.Obfuscation = &o - if o.RemoveStackTraces { - if err = addReplaceRule(c, "error.stack", `(?s).*`, "?"); err != nil { - return err - } - } - } - } - { - // Obfuscation of database statements will be ON by default. Any new obfuscators should likely be - // enabled by default as well. This can be explicitly disabled with the agent config. Any changes - // to obfuscation options or defaults must be reflected in the public docs. - c.Obfuscation.ES.Enabled = true - c.Obfuscation.OpenSearch.Enabled = true - c.Obfuscation.Mongo.Enabled = true - c.Obfuscation.Memcached.Enabled = true - c.Obfuscation.Redis.Enabled = true - c.Obfuscation.CreditCards.Enabled = true - c.Obfuscation.Cache.Enabled = true - - // TODO(x): There is an issue with pkgconfigsetup.Datadog().IsSet("apm_config.obfuscation"), probably coming from Viper, - // where it returns false even is "apm_config.obfuscation.credit_cards.enabled" is set via an environment - // variable, so we need a temporary workaround by specifically setting env. var. accessible fields. - if core.IsSet("apm_config.obfuscation.credit_cards.enabled") { - c.Obfuscation.CreditCards.Enabled = core.GetBool("apm_config.obfuscation.credit_cards.enabled") - } - if core.IsSet("apm_config.obfuscation.credit_cards.luhn") { - c.Obfuscation.CreditCards.Luhn = core.GetBool("apm_config.obfuscation.credit_cards.luhn") - } - if pkgconfigsetup.Datadog().IsSet("apm_config.obfuscation.elasticsearch.enabled") { - c.Obfuscation.ES.Enabled = pkgconfigsetup.Datadog().GetBool("apm_config.obfuscation.elasticsearch.enabled") - } - if pkgconfigsetup.Datadog().IsSet("apm_config.obfuscation.elasticsearch.keep_values") { - c.Obfuscation.ES.KeepValues = pkgconfigsetup.Datadog().GetStringSlice("apm_config.obfuscation.elasticsearch.keep_values") - } - if pkgconfigsetup.Datadog().IsSet("apm_config.obfuscation.elasticsearch.obfuscate_sql_values") { - c.Obfuscation.ES.ObfuscateSQLValues = pkgconfigsetup.Datadog().GetStringSlice("apm_config.obfuscation.elasticsearch.obfuscate_sql_values") - } - if pkgconfigsetup.Datadog().IsSet("apm_config.obfuscation.opensearch.enabled") { - c.Obfuscation.OpenSearch.Enabled = pkgconfigsetup.Datadog().GetBool("apm_config.obfuscation.opensearch.enabled") - } - if pkgconfigsetup.Datadog().IsSet("apm_config.obfuscation.opensearch.keep_values") { - c.Obfuscation.OpenSearch.KeepValues = pkgconfigsetup.Datadog().GetStringSlice("apm_config.obfuscation.opensearch.keep_values") - } - if pkgconfigsetup.Datadog().IsSet("apm_config.obfuscation.opensearch.obfuscate_sql_values") { - c.Obfuscation.OpenSearch.ObfuscateSQLValues = pkgconfigsetup.Datadog().GetStringSlice("apm_config.obfuscation.opensearch.obfuscate_sql_values") - } - if pkgconfigsetup.Datadog().IsSet("apm_config.obfuscation.http.remove_query_string") { - c.Obfuscation.HTTP.RemoveQueryString = pkgconfigsetup.Datadog().GetBool("apm_config.obfuscation.http.remove_query_string") - } - if pkgconfigsetup.Datadog().IsSet("apm_config.obfuscation.http.remove_paths_with_digits") { - c.Obfuscation.HTTP.RemovePathDigits = pkgconfigsetup.Datadog().GetBool("apm_config.obfuscation.http.remove_paths_with_digits") - } - if pkgconfigsetup.Datadog().IsSet("apm_config.obfuscation.memcached.enabled") { - c.Obfuscation.Memcached.Enabled = pkgconfigsetup.Datadog().GetBool("apm_config.obfuscation.memcached.enabled") - } - if pkgconfigsetup.Datadog().IsSet("apm_config.obfuscation.memcached.keep_command") { - c.Obfuscation.Memcached.KeepCommand = pkgconfigsetup.Datadog().GetBool("apm_config.obfuscation.memcached.keep_command") - } - if pkgconfigsetup.Datadog().IsSet("apm_config.obfuscation.mongodb.enabled") { - c.Obfuscation.Mongo.Enabled = pkgconfigsetup.Datadog().GetBool("apm_config.obfuscation.mongodb.enabled") - } - if pkgconfigsetup.Datadog().IsSet("apm_config.obfuscation.mongodb.keep_values") { - c.Obfuscation.Mongo.KeepValues = pkgconfigsetup.Datadog().GetStringSlice("apm_config.obfuscation.mongodb.keep_values") - } - if pkgconfigsetup.Datadog().IsSet("apm_config.obfuscation.mongodb.obfuscate_sql_values") { - c.Obfuscation.Mongo.ObfuscateSQLValues = pkgconfigsetup.Datadog().GetStringSlice("apm_config.obfuscation.mongodb.obfuscate_sql_values") - } - if pkgconfigsetup.Datadog().IsSet("apm_config.obfuscation.redis.enabled") { - c.Obfuscation.Redis.Enabled = pkgconfigsetup.Datadog().GetBool("apm_config.obfuscation.redis.enabled") - } - if pkgconfigsetup.Datadog().IsSet("apm_config.obfuscation.redis.remove_all_args") { - c.Obfuscation.Redis.RemoveAllArgs = pkgconfigsetup.Datadog().GetBool("apm_config.obfuscation.redis.remove_all_args") - } - if pkgconfigsetup.Datadog().IsSet("apm_config.obfuscation.remove_stack_traces") { - c.Obfuscation.RemoveStackTraces = pkgconfigsetup.Datadog().GetBool("apm_config.obfuscation.remove_stack_traces") - } - if pkgconfigsetup.Datadog().IsSet("apm_config.obfuscation.sql_exec_plan.enabled") { - c.Obfuscation.SQLExecPlan.Enabled = pkgconfigsetup.Datadog().GetBool("apm_config.obfuscation.sql_exec_plan.enabled") - } - if pkgconfigsetup.Datadog().IsSet("apm_config.obfuscation.sql_exec_plan.keep_values") { - c.Obfuscation.SQLExecPlan.KeepValues = pkgconfigsetup.Datadog().GetStringSlice("apm_config.obfuscation.sql_exec_plan.keep_values") - } - if pkgconfigsetup.Datadog().IsSet("apm_config.obfuscation.sql_exec_plan.obfuscate_sql_values") { - c.Obfuscation.SQLExecPlan.ObfuscateSQLValues = pkgconfigsetup.Datadog().GetStringSlice("apm_config.obfuscation.sql_exec_plan.obfuscate_sql_values") - } - if pkgconfigsetup.Datadog().IsSet("apm_config.obfuscation.sql_exec_plan_normalize.enabled") { - c.Obfuscation.SQLExecPlanNormalize.Enabled = pkgconfigsetup.Datadog().GetBool("apm_config.obfuscation.sql_exec_plan_normalize.enabled") - } - if pkgconfigsetup.Datadog().IsSet("apm_config.obfuscation.sql_exec_plan_normalize.keep_values") { - c.Obfuscation.SQLExecPlanNormalize.KeepValues = pkgconfigsetup.Datadog().GetStringSlice("apm_config.obfuscation.sql_exec_plan_normalize.keep_values") - } - if pkgconfigsetup.Datadog().IsSet("apm_config.obfuscation.sql_exec_plan_normalize.obfuscate_sql_values") { - c.Obfuscation.SQLExecPlanNormalize.ObfuscateSQLValues = pkgconfigsetup.Datadog().GetStringSlice("apm_config.obfuscation.sql_exec_plan_normalize.obfuscate_sql_values") - } - if pkgconfigsetup.Datadog().IsSet("apm_config.obfuscation.cache.enabled") { - c.Obfuscation.Cache.Enabled = pkgconfigsetup.Datadog().GetBool("apm_config.obfuscation.cache.enabled") + c.Obfuscation.ES.Enabled = pkgconfigsetup.Datadog().GetBool("apm_config.obfuscation.elasticsearch.enabled") + c.Obfuscation.ES.KeepValues = pkgconfigsetup.Datadog().GetStringSlice("apm_config.obfuscation.elasticsearch.keep_values") + c.Obfuscation.ES.ObfuscateSQLValues = pkgconfigsetup.Datadog().GetStringSlice("apm_config.obfuscation.elasticsearch.obfuscate_sql_values") + c.Obfuscation.OpenSearch.Enabled = pkgconfigsetup.Datadog().GetBool("apm_config.obfuscation.opensearch.enabled") + c.Obfuscation.OpenSearch.KeepValues = pkgconfigsetup.Datadog().GetStringSlice("apm_config.obfuscation.opensearch.keep_values") + c.Obfuscation.OpenSearch.ObfuscateSQLValues = pkgconfigsetup.Datadog().GetStringSlice("apm_config.obfuscation.opensearch.obfuscate_sql_values") + c.Obfuscation.Mongo.Enabled = pkgconfigsetup.Datadog().GetBool("apm_config.obfuscation.mongodb.enabled") + c.Obfuscation.Mongo.KeepValues = pkgconfigsetup.Datadog().GetStringSlice("apm_config.obfuscation.mongodb.keep_values") + c.Obfuscation.Mongo.ObfuscateSQLValues = pkgconfigsetup.Datadog().GetStringSlice("apm_config.obfuscation.mongodb.obfuscate_sql_values") + c.Obfuscation.SQLExecPlan.Enabled = pkgconfigsetup.Datadog().GetBool("apm_config.obfuscation.sql_exec_plan.enabled") + c.Obfuscation.SQLExecPlan.KeepValues = pkgconfigsetup.Datadog().GetStringSlice("apm_config.obfuscation.sql_exec_plan.keep_values") + c.Obfuscation.SQLExecPlan.ObfuscateSQLValues = pkgconfigsetup.Datadog().GetStringSlice("apm_config.obfuscation.sql_exec_plan.obfuscate_sql_values") + c.Obfuscation.SQLExecPlanNormalize.Enabled = pkgconfigsetup.Datadog().GetBool("apm_config.obfuscation.sql_exec_plan_normalize.enabled") + c.Obfuscation.SQLExecPlanNormalize.KeepValues = pkgconfigsetup.Datadog().GetStringSlice("apm_config.obfuscation.sql_exec_plan_normalize.keep_values") + c.Obfuscation.SQLExecPlanNormalize.ObfuscateSQLValues = pkgconfigsetup.Datadog().GetStringSlice("apm_config.obfuscation.sql_exec_plan_normalize.obfuscate_sql_values") + c.Obfuscation.HTTP.RemoveQueryString = pkgconfigsetup.Datadog().GetBool("apm_config.obfuscation.http.remove_query_string") + c.Obfuscation.HTTP.RemovePathDigits = pkgconfigsetup.Datadog().GetBool("apm_config.obfuscation.http.remove_paths_with_digits") + c.Obfuscation.RemoveStackTraces = pkgconfigsetup.Datadog().GetBool("apm_config.obfuscation.remove_stack_traces") + if c.Obfuscation.RemoveStackTraces { + if err = addReplaceRule(c, "error.stack", `(?s).*`, "?"); err != nil { + return err } } + c.Obfuscation.Memcached.Enabled = pkgconfigsetup.Datadog().GetBool("apm_config.obfuscation.memcached.enabled") + c.Obfuscation.Memcached.KeepCommand = pkgconfigsetup.Datadog().GetBool("apm_config.obfuscation.memcached.keep_command") + c.Obfuscation.Redis.Enabled = pkgconfigsetup.Datadog().GetBool("apm_config.obfuscation.redis.enabled") + c.Obfuscation.Redis.RemoveAllArgs = pkgconfigsetup.Datadog().GetBool("apm_config.obfuscation.redis.remove_all_args") + c.Obfuscation.CreditCards.Enabled = pkgconfigsetup.Datadog().GetBool("apm_config.obfuscation.credit_cards.enabled") + c.Obfuscation.CreditCards.Luhn = pkgconfigsetup.Datadog().GetBool("apm_config.obfuscation.credit_cards.luhn") + c.Obfuscation.CreditCards.KeepValues = pkgconfigsetup.Datadog().GetStringSlice("apm_config.obfuscation.credit_cards.keep_values") + c.Obfuscation.Cache.Enabled = pkgconfigsetup.Datadog().GetBool("apm_config.obfuscation.cache.enabled") if core.IsSet("apm_config.filter_tags.require") { tags := core.GetStringSlice("apm_config.filter_tags.require") diff --git a/comp/trace/status/statusimpl/status.go b/comp/trace/status/statusimpl/status.go index e476ee0281d7a..00a8730b87da8 100644 --- a/comp/trace/status/statusimpl/status.go +++ b/comp/trace/status/statusimpl/status.go @@ -95,7 +95,7 @@ func (s statusProvider) populateStatus() map[string]interface{} { port := s.Config.GetInt("apm_config.debug.port") c := client() - url := fmt.Sprintf("http://localhost:%d/debug/vars", port) + url := fmt.Sprintf("https://localhost:%d/debug/vars", port) resp, err := apiutil.DoGet(c, url, apiutil.CloseConnection) if err != nil { return map[string]interface{}{ diff --git a/comp/updater/telemetry/telemetryimpl/telemetry.go b/comp/updater/telemetry/telemetryimpl/telemetry.go index d8f961e8398e6..ee1bab4efdd56 100644 --- a/comp/updater/telemetry/telemetryimpl/telemetry.go +++ b/comp/updater/telemetry/telemetryimpl/telemetry.go @@ -7,10 +7,10 @@ package telemetryimpl import ( + "context" "net/http" "go.uber.org/fx" - "gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer" "github.com/DataDog/datadog-agent/comp/core/config" "github.com/DataDog/datadog-agent/comp/updater/telemetry" @@ -38,13 +38,7 @@ func newTelemetry(deps dependencies) (telemetry.Component, error) { client := &http.Client{ Transport: httputils.CreateHTTPTransport(deps.Config), } - telemetry := fleettelemetry.NewTelemetry(client, utils.SanitizeAPIKey(deps.Config.GetString("api_key")), deps.Config.GetString("site"), "datadog-installer-daemon", - fleettelemetry.WithSamplingRules( - tracer.NameServiceRule("cdn.*", "datadog-installer-daemon", 0.1), - tracer.NameServiceRule("*garbage_collect*", "datadog-installer-daemon", 0.05), - tracer.NameServiceRule("HTTPClient.*", "datadog-installer-daemon", 0.05), - ), - ) - deps.Lc.Append(fx.Hook{OnStart: telemetry.Start, OnStop: telemetry.Stop}) + telemetry := fleettelemetry.NewTelemetry(client, utils.SanitizeAPIKey(deps.Config.GetString("api_key")), deps.Config.GetString("site"), "datadog-installer-daemon") + deps.Lc.Append(fx.Hook{OnStop: func(context.Context) error { telemetry.Stop(); return nil }}) return telemetry, nil } diff --git a/docs/cloud-workload-security/backend_linux.md b/docs/cloud-workload-security/backend_linux.md index 7b0794f82fc9d..c13719c22d141 100644 --- a/docs/cloud-workload-security/backend_linux.md +++ b/docs/cloud-workload-security/backend_linux.md @@ -94,6 +94,12 @@ CSM Threats event for Linux systems have the following JSON schema: }, "origin": { "type": "string" + }, + "kernel_version": { + "type": "string" + }, + "distribution": { + "type": "string" } }, "additionalProperties": false, @@ -1718,9 +1724,6 @@ CSM Threats event for Linux systems have the following JSON schema: "container": { "$ref": "#/$defs/ContainerContext" }, - "cgroup": { - "$ref": "#/$defs/CGroupContext" - }, "network": { "$ref": "#/$defs/NetworkContext" }, @@ -1730,6 +1733,9 @@ CSM Threats event for Linux systems have the following JSON schema: "security_profile": { "$ref": "#/$defs/SecurityProfileContext" }, + "cgroup": { + "$ref": "#/$defs/CGroupContext" + }, "selinux": { "$ref": "#/$defs/SELinuxEvent" }, @@ -1802,10 +1808,10 @@ CSM Threats event for Linux systems have the following JSON schema: | `exit` | $ref | Please see [ExitEvent](#exitevent) | | `process` | $ref | Please see [ProcessContext](#processcontext) | | `container` | $ref | Please see [ContainerContext](#containercontext) | -| `cgroup` | $ref | Please see [CGroupContext](#cgroupcontext) | | `network` | $ref | Please see [NetworkContext](#networkcontext) | | `dd` | $ref | Please see [DDContext](#ddcontext) | | `security_profile` | $ref | Please see [SecurityProfileContext](#securityprofilecontext) | +| `cgroup` | $ref | Please see [CGroupContext](#cgroupcontext) | | `selinux` | $ref | Please see [SELinuxEvent](#selinuxevent) | | `bpf` | $ref | Please see [BPFEvent](#bpfevent) | | `mmap` | $ref | Please see [MMapEvent](#mmapevent) | @@ -1941,6 +1947,12 @@ CSM Threats event for Linux systems have the following JSON schema: }, "origin": { "type": "string" + }, + "kernel_version": { + "type": "string" + }, + "distribution": { + "type": "string" } }, "additionalProperties": false, diff --git a/docs/cloud-workload-security/backend_linux.schema.json b/docs/cloud-workload-security/backend_linux.schema.json index b6f9cddc6cbb7..7b9f9b7e3ea60 100644 --- a/docs/cloud-workload-security/backend_linux.schema.json +++ b/docs/cloud-workload-security/backend_linux.schema.json @@ -83,6 +83,12 @@ }, "origin": { "type": "string" + }, + "kernel_version": { + "type": "string" + }, + "distribution": { + "type": "string" } }, "additionalProperties": false, @@ -1707,9 +1713,6 @@ "container": { "$ref": "#/$defs/ContainerContext" }, - "cgroup": { - "$ref": "#/$defs/CGroupContext" - }, "network": { "$ref": "#/$defs/NetworkContext" }, @@ -1719,6 +1722,9 @@ "security_profile": { "$ref": "#/$defs/SecurityProfileContext" }, + "cgroup": { + "$ref": "#/$defs/CGroupContext" + }, "selinux": { "$ref": "#/$defs/SELinuxEvent" }, diff --git a/docs/dev/agent_build.md b/docs/dev/agent_build.md index 26f0126ee1911..1896724f75403 100644 --- a/docs/dev/agent_build.md +++ b/docs/dev/agent_build.md @@ -52,6 +52,30 @@ Also note that the trace agent needs to be built and run separately. For more in We use `pkg-config` to make compilers and linkers aware of Python. The required .pc files are provided automatically when building python through omnibus. +As an option, the Agent can combine multiple functionalities into a single binary to reduce +the space used on disk. The `DD_BUNDLED_AGENT` environment variable is used to select +which functionality to enable. For instance, if set to `process-agent`, it will act as the process Agent. +If the environment variable is not defined, the process name is used as a fallback. +As the last resort meaning, the executable will behave as the 'main' Agent. + +Different combinations can be obtained through the usage of build tags. As an example, +building the Agent with the `bundle_process_agent` and `bundle_security_agent` will produce +a binary that has the process Agent and security Agent capabilities. + +The `--bundle` argument can be used to override the default set of functionalities bundled +into the Agent binary. For instance, to override the defaults and bundle only the process and +and the security Agents: + +``` +deva agent.build --bundle process-agent --bundle security-agent +``` + +To disable bundling entirely: + +``` +deva agent.build --bundle agent +``` + ## Testing Agent changes in containerized environments Building an Agent Docker image from scratch through an embedded build is a slow process. diff --git a/docs/public/components/creating-components.md b/docs/public/components/creating-components.md index aa54f63cb3590..2fe844b7175d4 100644 --- a/docs/public/components/creating-components.md +++ b/docs/public/components/creating-components.md @@ -114,11 +114,11 @@ internally by each component (more on this [here TODO]()). --> ### The impl folders The `impl` folder is where the component implementation is written. The details of component implementation are up to the developer. -The only requirements are that the package name follows the pattern `impl` and that there is a public instantiation function called `NewComponent`. +The only requirements are that the package name follows the pattern `impl` for the regular implementation or `impl` for the alternative implementation, and that there is a public instantiation function called `NewComponent`. === ":octicons-file-code-16: comp/compression/impl-zstd/compressor.go" ```go - package compressionimpl + package zstdimpl // NewComponent returns a new ZSTD implementation for the compression component func NewComponent(reqs Requires) Provides { @@ -134,7 +134,7 @@ In this example, the compression component must access the configuration compone === ":octicons-file-code-16: comp/compression/impl-zstd/compressor.go" ```go - package compressionimpl + package zstdimpl import ( "fmt" @@ -160,7 +160,7 @@ In this example, the compression component must access the configuration compone For the output of the component, populate the `Provides` struct with the return values. === ":octicons-file-code-16: comp/compression/impl-zstd/compressor.go" ```go - package compressionimpl + package zstdimpl import ( // Always import the component def folder, so that you can return a 'compression.Component' type. @@ -180,7 +180,7 @@ All together, the component code looks like the following: === ":octicons-file-code-16: comp/compression/impl-zstd/compressor.go" ```go - package compressionimpl + package zstdimpl import ( "fmt" diff --git a/flakes.yaml b/flakes.yaml index ab2af6b55f3ea..da655d3c2da03 100644 --- a/flakes.yaml +++ b/flakes.yaml @@ -11,3 +11,5 @@ test/new-e2e/tests/containers: - TestECSSuite/TestCPU/metric___container.cpu.usage{^ecs_container_name:stress-ng$} - TestEKSSuite/TestCPU/metric___container.cpu.usage{^kube_deployment:stress-ng$,^kube_namespace:workload-cpustress$} - TestKindSuite/TestCPU/metric___container.cpu.usage{^kube_deployment:stress-ng$,^kube_namespace:workload-cpustress$} + - TestKindSuite/TestAdmissionControllerWithAutoDetectedLanguage + - TestEKSSuite/TestAdmissionControllerWithAutoDetectedLanguage diff --git a/go.mod b/go.mod index 2c8473f077cef..a939a145b37c4 100644 --- a/go.mod +++ b/go.mod @@ -37,6 +37,7 @@ replace ( github.com/DataDog/datadog-agent/comp/core/secrets => ./comp/core/secrets github.com/DataDog/datadog-agent/comp/core/status => ./comp/core/status github.com/DataDog/datadog-agent/comp/core/status/statusimpl => ./comp/core/status/statusimpl + github.com/DataDog/datadog-agent/comp/core/tagger/origindetection => ./comp/core/tagger/origindetection github.com/DataDog/datadog-agent/comp/core/tagger/tags => ./comp/core/tagger/tags github.com/DataDog/datadog-agent/comp/core/tagger/types => ./comp/core/tagger/types github.com/DataDog/datadog-agent/comp/core/tagger/utils => ./comp/core/tagger/utils @@ -154,30 +155,29 @@ require ( github.com/DataDog/datadog-agent/pkg/security/secl v0.56.0 github.com/DataDog/datadog-agent/pkg/trace v0.59.0 github.com/DataDog/datadog-agent/pkg/util/cgroups v0.59.0 - github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 + 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/datadog-agent/pkg/util/scrubber v0.59.0 - github.com/DataDog/datadog-go/v5 v5.5.0 - github.com/DataDog/datadog-operator v0.7.1-0.20241024104907-734366f3c0d1 - github.com/DataDog/ebpf-manager v0.7.4 + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.1 + github.com/DataDog/datadog-go/v5 v5.6.0 + github.com/DataDog/datadog-operator v0.7.1-0.20241219210556-f517775059d1 + github.com/DataDog/ebpf-manager v0.7.6 github.com/DataDog/gopsutil v1.2.2 - github.com/DataDog/nikos v1.12.7 - github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.21.0 - 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/nikos v1.12.9 + github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.22.0 + github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.22.0 + github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.22.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 github.com/Masterminds/semver/v3 v3.3.1 - github.com/Masterminds/sprig/v3 v3.3.0 // indirect github.com/Microsoft/go-winio v0.6.2 github.com/Microsoft/hcsshim v0.12.9 github.com/acobaugh/osrelease v0.1.0 github.com/alecthomas/participle v0.7.1 // indirect github.com/alecthomas/units v0.0.0-20240626203959-61d1e3462e30 - github.com/aquasecurity/trivy-db v0.0.0-20231005141211-4fc651f7ac8d + github.com/aquasecurity/trivy-db v0.0.0-20240910133327-7e0f4d2ed4c1 github.com/avast/retry-go/v4 v4.6.0 github.com/aws/aws-lambda-go v1.37.0 github.com/aws/aws-sdk-go v1.55.5 // indirect @@ -197,7 +197,7 @@ require ( github.com/cri-o/ocicni v0.4.3 github.com/cyphar/filepath-securejoin v0.3.4 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc - github.com/docker/docker v27.3.1+incompatible + github.com/docker/docker v27.4.0+incompatible github.com/docker/go-connections v0.5.0 github.com/dustin/go-humanize v1.0.1 github.com/elastic/go-libaudit/v2 v2.5.0 @@ -227,7 +227,7 @@ require ( github.com/hashicorp/consul/api v1.30.0 github.com/hashicorp/go-multierror v1.1.1 github.com/hashicorp/golang-lru/v2 v2.0.7 - github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 + github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb github.com/iceber/iouring-go v0.0.0-20230403020409-002cfd2e2a90 github.com/imdario/mergo v0.3.16 github.com/invopop/jsonschema v0.12.0 @@ -246,7 +246,7 @@ require ( github.com/olekukonko/tablewriter v0.0.5 github.com/oliveagle/jsonpath v0.0.0-20180606110733-2e52cf6e6852 github.com/open-policy-agent/opa v0.70.0 - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/resourcetotelemetry v0.114.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/resourcetotelemetry v0.115.0 // indirect github.com/opencontainers/go-digest v1.0.0 github.com/opencontainers/image-spec v1.1.0 github.com/opencontainers/runtime-spec v1.2.0 @@ -257,12 +257,11 @@ require ( github.com/prometheus/client_golang v1.20.5 github.com/prometheus/client_model v0.6.1 github.com/prometheus/procfs v0.15.1 - github.com/redis/go-redis/v9 v9.1.0 + github.com/redis/go-redis/v9 v9.5.1 github.com/richardartoul/molecule v1.0.1-0.20240531184615-7ca0df43c0b3 // indirect github.com/robfig/cron/v3 v3.0.1 github.com/samber/lo v1.47.0 github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da - github.com/shirou/gopsutil/v3 v3.24.5 github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4 github.com/sirupsen/logrus v1.9.3 github.com/skydive-project/go-debouncer v1.0.0 @@ -288,16 +287,16 @@ require ( go.etcd.io/bbolt v1.3.11 go.etcd.io/etcd/client/v2 v2.306.0-alpha.0 go.mongodb.org/mongo-driver v1.15.1 - go.opentelemetry.io/collector v0.114.0 // indirect - go.opentelemetry.io/collector/component v0.114.0 - go.opentelemetry.io/collector/confmap v1.20.0 - go.opentelemetry.io/collector/exporter v0.114.0 - go.opentelemetry.io/collector/exporter/debugexporter v0.114.0 - go.opentelemetry.io/collector/exporter/otlpexporter v0.114.0 - go.opentelemetry.io/collector/pdata v1.20.0 - go.opentelemetry.io/collector/processor/batchprocessor v0.114.0 - go.opentelemetry.io/collector/receiver v0.114.0 - go.opentelemetry.io/collector/receiver/otlpreceiver v0.114.0 + go.opentelemetry.io/collector v0.115.0 // indirect + go.opentelemetry.io/collector/component v0.115.0 + go.opentelemetry.io/collector/confmap v1.21.0 + go.opentelemetry.io/collector/exporter v0.115.0 + go.opentelemetry.io/collector/exporter/debugexporter v0.115.0 + go.opentelemetry.io/collector/exporter/otlpexporter v0.115.0 + go.opentelemetry.io/collector/pdata v1.21.0 + go.opentelemetry.io/collector/processor/batchprocessor v0.115.0 + go.opentelemetry.io/collector/receiver v0.115.0 + go.opentelemetry.io/collector/receiver/otlpreceiver v0.115.0 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.56.0 // indirect go.uber.org/atomic v1.11.0 go.uber.org/automaxprocs v1.6.0 @@ -307,13 +306,13 @@ require ( go.uber.org/zap v1.27.0 go4.org/netipx v0.0.0-20220812043211-3cc044ffd68d golang.org/x/arch v0.12.0 - golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f - golang.org/x/net v0.31.0 - golang.org/x/sync v0.9.0 - golang.org/x/sys v0.27.0 - golang.org/x/text v0.20.0 + golang.org/x/exp v0.0.0-20241210194714-1829a127f884 + golang.org/x/net v0.33.0 + golang.org/x/sync v0.10.0 + golang.org/x/sys v0.28.0 + golang.org/x/text v0.21.0 golang.org/x/time v0.8.0 - golang.org/x/tools v0.27.0 + golang.org/x/tools v0.28.0 golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da google.golang.org/genproto v0.0.0-20240903143218-8af14fe29dc1 // indirect google.golang.org/grpc v1.67.1 @@ -323,12 +322,12 @@ require ( gopkg.in/yaml.v2 v2.4.0 gopkg.in/yaml.v3 v3.0.1 gopkg.in/zorkian/go-datadog-api.v2 v2.30.0 - k8s.io/api v0.31.2 + k8s.io/api v0.31.4 k8s.io/apiextensions-apiserver v0.31.2 - k8s.io/apimachinery v0.31.2 + k8s.io/apimachinery v0.31.4 k8s.io/apiserver v0.31.2 // indirect k8s.io/autoscaler/vertical-pod-autoscaler v0.13.0 - k8s.io/client-go v0.31.2 + k8s.io/client-go v0.31.3 k8s.io/cri-api v0.31.2 k8s.io/klog v1.0.1-0.20200310124935-4ad0115ba9e4 // Min version that includes fix for Windows Nano k8s.io/klog/v2 v2.130.1 @@ -359,35 +358,27 @@ require ( github.com/DataDog/gostackparse v0.7.0 // indirect github.com/DataDog/mmh3 v0.0.0-20210722141835-012dc69a9e49 // indirect github.com/DisposaBoy/JsonConfigReader v0.0.0-20201129172854-99cf318d67e7 // indirect - github.com/Masterminds/goutils v1.1.1 // indirect github.com/Masterminds/semver v1.5.0 github.com/NYTimes/gziphandler v1.1.1 // indirect github.com/OneOfOne/xxhash v1.2.8 // indirect - github.com/ProtonMail/go-crypto v1.1.0-alpha.0 + github.com/ProtonMail/go-crypto v1.1.3 github.com/StackExchange/wmi v1.2.1 // indirect github.com/agnivade/levenshtein v1.2.0 // indirect - github.com/aquasecurity/go-gem-version v0.0.0-20201115065557-8eed6fe000ce // indirect - github.com/aquasecurity/go-npm-version v0.0.0-20201110091526-0b796d180798 // indirect - github.com/aquasecurity/go-pep440-version v0.0.0-20210121094942-22b2f8951d46 // indirect - github.com/aquasecurity/go-version v0.0.0-20210121072130-637058cfe492 // indirect - github.com/aquasecurity/table v1.8.0 // indirect - github.com/aquasecurity/tml v0.6.1 // indirect github.com/armon/go-metrics v0.4.1 // indirect github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect github.com/awalterschulze/gographviz v2.0.3+incompatible // indirect - 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/credentials v1.17.46 - github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.20 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.24 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.24 // indirect + github.com/aws/aws-sdk-go-v2 v1.32.6 + github.com/aws/aws-sdk-go-v2/config v1.28.6 + github.com/aws/aws-sdk-go-v2/credentials v1.17.47 + github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.21 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.25 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.25 // indirect github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 // indirect - github.com/aws/aws-sdk-go-v2/service/ebs v1.27.0 // indirect github.com/aws/aws-sdk-go-v2/service/ec2 v1.190.0 - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.5 // indirect - github.com/aws/aws-sdk-go-v2/service/sso v1.24.6 // indirect - github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.5 // indirect - github.com/aws/aws-sdk-go-v2/service/sts v1.33.1 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.6 // indirect + github.com/aws/aws-sdk-go-v2/service/sso v1.24.7 // indirect + github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.6 // indirect + github.com/aws/aws-sdk-go-v2/service/sts v1.33.2 // indirect github.com/aws/smithy-go v1.22.1 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bmizerany/pat v0.0.0-20170815010413-6226ea591a40 // indirect @@ -403,30 +394,23 @@ require ( github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f // indirect github.com/dgryski/go-jump v0.0.0-20211018200510-ba001c3ffce0 // indirect github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect - github.com/docker/cli v27.1.1+incompatible // indirect + github.com/docker/cli v27.4.0+incompatible // indirect github.com/docker/distribution v2.8.3+incompatible // indirect - github.com/docker/docker-credential-helpers v0.8.1 // indirect + github.com/docker/docker-credential-helpers v0.8.2 // indirect github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c // indirect github.com/docker/go-units v0.5.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect github.com/ghodss/yaml v1.0.0 - github.com/go-git/go-billy/v5 v5.5.0 // indirect - github.com/go-git/go-git/v5 v5.12.0 // indirect github.com/go-logfmt/logfmt v0.6.0 // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect - github.com/go-openapi/errors v0.22.0 // indirect - github.com/go-openapi/jsonpointer v0.20.2 // indirect - github.com/go-openapi/jsonreference v0.20.4 // indirect - github.com/go-openapi/runtime v0.27.1 // indirect - github.com/go-openapi/strfmt v0.23.0 // indirect - github.com/go-openapi/swag v0.22.9 // indirect - github.com/go-openapi/validate v0.23.0 // indirect + github.com/go-openapi/jsonpointer v0.21.0 // indirect + github.com/go-openapi/jsonreference v0.21.0 // indirect + github.com/go-openapi/swag v0.23.0 // indirect github.com/go-redis/redis/v8 v8.11.5 // indirect github.com/godbus/dbus/v5 v5.1.0 github.com/golang/glog v1.2.2 // indirect github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect - github.com/google/licenseclassifier/v2 v2.0.0 // indirect github.com/google/uuid v1.6.0 github.com/google/wire v0.6.0 // indirect github.com/googleapis/gax-go/v2 v2.13.0 // indirect @@ -441,8 +425,6 @@ require ( github.com/hashicorp/golang-lru v1.0.2 // indirect github.com/hashicorp/hcl v1.0.1-vault-5 // indirect github.com/hashicorp/serf v0.10.1 // indirect - github.com/huandu/xstrings v1.5.0 // indirect - github.com/in-toto/in-toto-golang v0.9.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/itchyny/timefmt-go v0.1.6 // indirect github.com/jinzhu/inflection v1.0.0 // indirect @@ -455,22 +437,16 @@ require ( github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect github.com/kjk/lzma v0.0.0-20161016003348-3fd93898850d // indirect github.com/klauspost/compress v1.17.11 // indirect - github.com/klauspost/pgzip v1.2.5 // indirect - github.com/knqyf263/go-apk-version v0.0.0-20200609155635-041fdbb8563f // indirect + github.com/klauspost/pgzip v1.2.6 // indirect github.com/knqyf263/go-deb-version v0.0.0-20230223133812-3ed183d23422 // indirect github.com/knqyf263/go-rpm-version v0.0.0-20220614171824-631e686d1075 // indirect github.com/knqyf263/go-rpmdb v0.1.1 - github.com/knqyf263/nested v0.0.1 // indirect - github.com/liamg/jfather v0.0.7 // indirect github.com/libp2p/go-reuseport v0.2.0 // indirect - github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c // indirect + github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a // indirect github.com/magiconair/properties v1.8.7 // indirect - github.com/masahiro331/go-disk v0.0.0-20220919035250-c8da316f91ac // indirect - github.com/masahiro331/go-ebs-file v0.0.0-20240112135404-d5fbb1d46323 // indirect - github.com/masahiro331/go-ext4-filesystem v0.0.0-20231208112839-4339555a0cd4 // indirect - github.com/masahiro331/go-mvn-version v0.0.0-20210429150710-d3157d602a08 // indirect - github.com/masahiro331/go-vmdk-parser v0.0.0-20221225061455-612096e4bbbd // indirect - github.com/masahiro331/go-xfs-filesystem v0.0.0-20230608043311-a335f4599b70 // indirect + github.com/masahiro331/go-disk v0.0.0-20240625071113-56c933208fee // indirect + github.com/masahiro331/go-ext4-filesystem v0.0.0-20240620024024-ca14e6327bbd // indirect + github.com/masahiro331/go-xfs-filesystem v0.0.0-20231205045356-1b22259a6c44 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-runewidth v0.0.15 // indirect @@ -480,9 +456,8 @@ require ( github.com/mitchellh/hashstructure/v2 v2.0.2 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/mkrautz/goar v0.0.0-20150919110319-282caa8bd9da // indirect - github.com/moby/buildkit v0.12.5 // indirect github.com/moby/locker v1.0.1 // indirect - github.com/moby/sys/signal v0.7.0 // indirect + github.com/moby/sys/signal v0.7.1 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/montanaflynn/stats v0.7.0 // indirect @@ -490,32 +465,24 @@ require ( github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d // indirect - github.com/oklog/ulid v1.3.1 // indirect github.com/opencontainers/selinux v1.11.0 // indirect - github.com/opentracing/opentracing-go v1.2.0 // indirect github.com/outcaste-io/ristretto v0.2.3 // indirect - github.com/owenrumney/go-sarif/v2 v2.3.0 // indirect - github.com/package-url/packageurl-go v0.1.2 // indirect + github.com/package-url/packageurl-go v0.1.3 // indirect github.com/pborman/uuid v1.2.1 // indirect github.com/pelletier/go-toml v1.9.5 // indirect github.com/philhofer/fwd v1.1.3-0.20240916144458-20a13a1f6b7c // indirect github.com/pierrec/lz4/v4 v4.1.21 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/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect github.com/prometheus/common v0.60.1 github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect github.com/rivo/uniseg v0.4.7 // indirect github.com/rs/cors v1.11.1 // indirect github.com/safchain/baloum v0.0.0-20241120122234-f22c9bd19f3b - github.com/saracen/walker v0.1.3 // indirect - github.com/sassoftware/go-rpmutils v0.3.0 // indirect + github.com/sassoftware/go-rpmutils v0.4.0 // indirect github.com/secure-systems-lab/go-securesystemslib v0.8.0 // indirect - github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect - github.com/shibumi/go-pathspec v1.3.0 // indirect - github.com/shopspring/decimal v1.4.0 // indirect github.com/smira/go-ftp-protocol v0.0.0-20140829150050-066b75c2b70d // indirect - github.com/spdx/tools-golang v0.5.4-0.20231108154018-0c0f394b5e1a // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/stretchr/objx v0.5.2 // indirect github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect @@ -530,7 +497,7 @@ require ( github.com/twmb/franz-go/pkg/kadm v1.12.0 github.com/twmb/franz-go/pkg/kmsg v1.8.0 github.com/ugorji/go/codec v1.2.11 // indirect - github.com/ulikunitz/xz v0.5.11 // indirect + github.com/ulikunitz/xz v0.5.12 // indirect github.com/vbatts/tar-split v0.11.5 // indirect github.com/vito/go-sse v1.0.0 // indirect github.com/vmihailenco/msgpack/v5 v5.4.1 @@ -542,7 +509,6 @@ require ( github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 - github.com/xlab/treeprint v1.2.0 // indirect github.com/xor-gate/ar v0.0.0-20170530204233-5c72ae81e2b7 // indirect github.com/yashtewari/glob-intersection v0.2.0 // indirect github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d // indirect @@ -552,9 +518,9 @@ require ( go.etcd.io/etcd/client/v3 v3.6.0-alpha.0 // indirect go.etcd.io/etcd/server/v3 v3.6.0-alpha.0.0.20220522111935-c3bc4116dcd1 // indirect go.opencensus.io v0.24.0 // indirect - go.opentelemetry.io/collector/consumer v0.114.0 // indirect - go.opentelemetry.io/collector/featuregate v1.20.0 - go.opentelemetry.io/collector/semconv v0.114.0 // indirect + go.opentelemetry.io/collector/consumer v1.21.0 // indirect + go.opentelemetry.io/collector/featuregate v1.21.0 + go.opentelemetry.io/collector/semconv v0.115.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.56.0 // indirect go.opentelemetry.io/contrib/propagators/b3 v1.31.0 // indirect go.opentelemetry.io/otel v1.32.0 @@ -567,15 +533,14 @@ require ( go.opentelemetry.io/otel/sdk/metric v1.32.0 // indirect go.opentelemetry.io/otel/trace v1.32.0 go.opentelemetry.io/proto/otlp v1.3.1 // indirect - golang.org/x/crypto v0.29.0 // indirect + golang.org/x/crypto v0.31.0 // indirect golang.org/x/mod v0.22.0 golang.org/x/oauth2 v0.23.0 // indirect - golang.org/x/term v0.26.0 // indirect + golang.org/x/term v0.27.0 // indirect gonum.org/v1/gonum v0.15.1 // indirect google.golang.org/api v0.199.0 // indirect google.golang.org/appengine v1.6.8 // indirect gopkg.in/Knetic/govaluate.v3 v3.0.0 // indirect - gopkg.in/cheggaaa/pb.v1 v1.0.28 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect k8s.io/component-base v0.31.2 @@ -611,35 +576,39 @@ require ( github.com/jellydator/ttlcache/v3 v3.3.0 github.com/kouhin/envflag v0.0.0-20150818174321-0e9a86061649 github.com/lorenzosaino/go-sysctl v0.3.1 - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/datadog v0.114.0 - go.opentelemetry.io/collector/config/configtelemetry v0.114.0 + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/datadog v0.115.0 + go.opentelemetry.io/collector/config/configtelemetry v0.115.0 ) -require go.opentelemetry.io/collector/component/componenttest v0.114.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.114.0 // indirect - go.opentelemetry.io/collector/processor/processorhelper/processorhelperprofiles v0.114.0 // indirect + go.opentelemetry.io/collector/extension/extensiontest v0.115.0 // indirect + go.opentelemetry.io/collector/processor/processorhelper/processorhelperprofiles v0.115.0 // indirect + go.opentelemetry.io/collector/scraper v0.115.0 // indirect ) require ( - go.opentelemetry.io/collector/connector/connectortest v0.114.0 // indirect - go.opentelemetry.io/collector/consumer/consumererror v0.114.0 // indirect - go.opentelemetry.io/collector/consumer/consumererror/consumererrorprofiles v0.114.0 // indirect - go.opentelemetry.io/collector/exporter/exporterhelper/exporterhelperprofiles v0.114.0 // indirect - go.opentelemetry.io/collector/exporter/exportertest v0.114.0 // indirect - go.opentelemetry.io/collector/internal/fanoutconsumer v0.114.0 // indirect - go.opentelemetry.io/collector/internal/memorylimiter v0.114.0 // indirect - go.opentelemetry.io/collector/internal/sharedcomponent v0.114.0 // indirect - go.opentelemetry.io/collector/pipeline/pipelineprofiles v0.114.0 // indirect - go.opentelemetry.io/collector/processor/processortest v0.114.0 // indirect - go.opentelemetry.io/collector/receiver/receivertest v0.114.0 // indirect + go.opentelemetry.io/collector/connector/connectortest v0.115.0 // indirect + go.opentelemetry.io/collector/consumer/consumererror v0.115.0 // indirect + go.opentelemetry.io/collector/consumer/consumererror/consumererrorprofiles v0.115.0 // indirect + go.opentelemetry.io/collector/exporter/exporterhelper/exporterhelperprofiles v0.115.0 // indirect + go.opentelemetry.io/collector/exporter/exportertest v0.115.0 // indirect + go.opentelemetry.io/collector/internal/fanoutconsumer v0.115.0 // indirect + go.opentelemetry.io/collector/internal/memorylimiter v0.115.0 // indirect + go.opentelemetry.io/collector/internal/sharedcomponent v0.115.0 // indirect + go.opentelemetry.io/collector/pipeline/pipelineprofiles v0.115.0 // indirect + go.opentelemetry.io/collector/processor/processortest v0.115.0 // indirect + go.opentelemetry.io/collector/receiver/receivertest v0.115.0 // indirect go.opentelemetry.io/contrib/bridges/otelzap v0.6.0 // indirect ) require ( github.com/DATA-DOG/go-sqlmock v1.5.2 - github.com/DataDog/agent-payload/v5 v5.0.137 + github.com/DataDog/agent-payload/v5 v5.0.138 github.com/DataDog/datadog-agent/comp/api/api/def v0.56.0-rc.3 github.com/DataDog/datadog-agent/comp/core/config v0.59.0 github.com/DataDog/datadog-agent/comp/core/flare/types v0.59.0 @@ -651,6 +620,7 @@ require ( github.com/DataDog/datadog-agent/comp/core/secrets v0.59.0 github.com/DataDog/datadog-agent/comp/core/status v0.59.0-rc.6 github.com/DataDog/datadog-agent/comp/core/status/statusimpl v0.56.0-rc.3 + github.com/DataDog/datadog-agent/comp/core/tagger/origindetection v0.0.0-20241217122454-175edb6c74f2 github.com/DataDog/datadog-agent/comp/core/tagger/tags v0.0.0-00010101000000-000000000000 github.com/DataDog/datadog-agent/comp/core/tagger/types v0.59.0 github.com/DataDog/datadog-agent/comp/core/telemetry v0.59.0 @@ -728,8 +698,8 @@ require ( github.com/DataDog/datadog-agent/pkg/util/system v0.59.0 github.com/DataDog/datadog-agent/pkg/util/testutil v0.59.0 github.com/DataDog/datadog-agent/pkg/util/uuid v0.59.0 - github.com/DataDog/datadog-agent/pkg/util/winutil v0.59.0 - github.com/DataDog/datadog-agent/pkg/version v0.59.0 + github.com/DataDog/datadog-agent/pkg/util/winutil v0.59.1 + github.com/DataDog/datadog-agent/pkg/version v0.59.1 github.com/DataDog/go-libddwaf/v3 v3.5.1 github.com/DataDog/go-sqllexer v0.0.17 github.com/Datadog/dublin-traceroute v0.0.2 @@ -737,7 +707,6 @@ require ( github.com/aws/aws-sdk-go-v2/service/kms v1.37.6 github.com/aws/aws-sdk-go-v2/service/rds v1.90.0 github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.34.6 - github.com/awslabs/amazon-ecr-credential-helper/ecr-login v0.0.0-20240409155312-26d1ea377073 github.com/cloudfoundry-community/go-cfclient/v2 v2.0.1-0.20230503155151-3d15366c5820 github.com/containerd/cgroups/v3 v3.0.4 github.com/containerd/typeurl/v2 v2.2.3 @@ -752,7 +721,7 @@ require ( github.com/judwhite/go-svc v1.2.1 github.com/kr/pretty v0.3.1 // todo: update datadog connector with breaking changes from https://github.com/DataDog/datadog-agent/pull/26347. - github.com/open-telemetry/opentelemetry-collector-contrib/connector/datadogconnector v0.114.0 + github.com/open-telemetry/opentelemetry-collector-contrib/connector/datadogconnector v0.115.0 github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 github.com/prometheus-community/pro-bing v0.4.1 github.com/rickar/props v1.0.0 @@ -760,15 +729,15 @@ require ( github.com/swaggest/jsonschema-go v0.3.70 github.com/valyala/fastjson v1.6.4 github.com/vibrantbyte/go-antpath v1.1.1 - go.opentelemetry.io/collector/confmap/provider/envprovider v1.20.0 - go.opentelemetry.io/collector/confmap/provider/fileprovider v1.20.0 - go.opentelemetry.io/collector/confmap/provider/httpprovider v1.20.0 - go.opentelemetry.io/collector/confmap/provider/httpsprovider v1.20.0 - go.opentelemetry.io/collector/confmap/provider/yamlprovider v1.20.0 - go.opentelemetry.io/collector/extension v0.114.0 - go.opentelemetry.io/collector/otelcol v0.114.0 - go.opentelemetry.io/collector/processor v0.114.0 - go.opentelemetry.io/collector/service v0.114.0 + go.opentelemetry.io/collector/confmap/provider/envprovider v1.21.0 + go.opentelemetry.io/collector/confmap/provider/fileprovider v1.21.0 + go.opentelemetry.io/collector/confmap/provider/httpprovider v1.21.0 + go.opentelemetry.io/collector/confmap/provider/httpsprovider v1.21.0 + go.opentelemetry.io/collector/confmap/provider/yamlprovider v1.21.0 + go.opentelemetry.io/collector/extension v0.115.0 + go.opentelemetry.io/collector/otelcol v0.115.0 + go.opentelemetry.io/collector/processor v0.115.0 + go.opentelemetry.io/collector/service v0.115.0 go4.org/intern v0.0.0-20230525184215-6c62f75575cb go4.org/mem v0.0.0-20220726221520-4f986261bf13 k8s.io/cli-runtime v0.31.2 @@ -785,7 +754,7 @@ require ( filippo.io/edwards25519 v1.1.0 // indirect github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 // indirect github.com/AdamKorcz/go-118-fuzz-build v0.0.0-20230306123547-8075edf89bb0 // indirect - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0 // indirect + github.com/Azure/azure-sdk-for-go/sdk/azcore v1.14.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5 v5.7.0 // indirect @@ -799,41 +768,55 @@ require ( github.com/DataDog/datadog-agent/pkg/util/buf v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/pkg/util/statstracker v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/system/socket v0.59.0 // indirect - github.com/DataDog/datadog-api-client-go/v2 v2.31.0 // indirect + github.com/DataDog/datadog-api-client-go/v2 v2.33.0 // indirect github.com/DataDog/dd-sensitive-data-scanner/sds-go/go v0.0.0-20240816154533-f7f9beb53a42 // indirect - github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.21.0 // indirect - github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.21.0 // indirect + github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.22.0 // indirect + github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.22.0 // indirect github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.25.0 // indirect github.com/Intevation/gval v1.3.0 // indirect github.com/Intevation/jsonpath v0.2.1 // indirect + github.com/Masterminds/goutils v1.1.1 // indirect + github.com/Masterminds/sprig/v3 v3.3.0 // indirect github.com/Showmax/go-fqdn v1.0.0 // indirect github.com/VividCortex/ewma v1.2.0 // indirect github.com/agext/levenshtein v1.2.3 // indirect + github.com/alecthomas/assert/v2 v2.6.0 // indirect github.com/alecthomas/participle/v2 v2.1.1 // indirect + github.com/alecthomas/repr v0.4.0 // indirect github.com/anchore/go-struct-converter v0.0.0-20221118182256-c68fdcfa2092 // indirect github.com/antchfx/xmlquery v1.4.2 // indirect github.com/antchfx/xpath v1.3.2 // indirect github.com/antlr4-go/antlr/v4 v4.13.0 // indirect github.com/apache/thrift v0.21.0 // indirect + github.com/aquasecurity/go-gem-version v0.0.0-20201115065557-8eed6fe000ce // indirect + github.com/aquasecurity/go-npm-version v0.0.0-20201110091526-0b796d180798 // indirect + github.com/aquasecurity/go-pep440-version v0.0.0-20210121094942-22b2f8951d46 // indirect + github.com/aquasecurity/go-version v0.0.0-20240603093900-cf8a8d29271d // indirect + github.com/aquasecurity/table v1.8.0 // indirect + github.com/aquasecurity/tml v0.6.1 // indirect github.com/aquasecurity/trivy-java-db v0.0.0-20240109071736-184bd7481d48 // indirect - github.com/aws/aws-sdk-go-v2/service/ecr v1.36.2 // indirect - github.com/aws/aws-sdk-go-v2/service/ecrpublic v1.27.0 // indirect + github.com/aws/aws-sdk-go-v2/service/ebs v1.22.1 // indirect + github.com/aws/aws-sdk-go-v2/service/ecr v1.36.7 // indirect github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.1 // indirect github.com/bahlo/generic-list-go v0.2.0 // indirect github.com/bitnami/go-version v0.0.0-20231130084017-bb00604d650c // indirect + github.com/blang/semver v3.5.1+incompatible // indirect github.com/blang/semver/v4 v4.0.0 // indirect github.com/bmatcuk/doublestar/v4 v4.7.1 // indirect github.com/buger/jsonparser v1.1.1 // indirect - github.com/cheggaaa/pb/v3 v3.1.4 // indirect + github.com/cheggaaa/pb/v3 v3.1.5 // indirect github.com/chrusty/protoc-gen-jsonschema v0.0.0-20240212064413-73d5723042b8 // indirect - github.com/cloudflare/circl v1.3.7 // indirect + github.com/cloudflare/circl v1.3.8 // indirect github.com/cncf/xds/go v0.0.0-20240905190251-b4127c9b8d78 // indirect github.com/containerd/errdefs/pkg v0.3.0 // indirect github.com/containerd/log v0.1.0 // indirect github.com/containerd/platforms v0.2.1 // indirect github.com/csaf-poc/csaf_distribution/v3 v3.0.0 // indirect + github.com/cyberphone/json-canonicalization v0.0.0-20231011164504-785e29786b46 // indirect github.com/dennwc/varint v1.0.0 // indirect github.com/digitalocean/godo v1.118.0 // indirect + github.com/digitorus/pkcs7 v0.0.0-20230818184609-3a137a874352 // indirect + github.com/digitorus/timestamp v0.0.0-20231217203849-220c5c2851b7 // indirect github.com/eapache/queue/v2 v2.0.0-20230407133247-75960ed334e4 // indirect github.com/ebitengine/purego v0.8.1 // indirect github.com/elastic/go-grok v0.3.1 // indirect @@ -845,13 +828,19 @@ require ( github.com/envoyproxy/protoc-gen-validate v1.1.0 // indirect github.com/fxamacker/cbor/v2 v2.7.0 // indirect github.com/glebarez/go-sqlite v1.22.0 // indirect + github.com/go-chi/chi v4.1.2+incompatible // indirect github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect + github.com/go-git/go-billy/v5 v5.5.0 // indirect + github.com/go-git/go-git/v5 v5.12.0 // indirect github.com/go-kit/log v0.2.1 // indirect - github.com/go-openapi/analysis v0.22.2 // indirect - github.com/go-openapi/loads v0.21.5 // indirect - github.com/go-openapi/spec v0.20.14 // indirect + github.com/go-openapi/analysis v0.23.0 // indirect + github.com/go-openapi/errors v0.22.0 // indirect + github.com/go-openapi/loads v0.22.0 // indirect + github.com/go-openapi/runtime v0.28.0 // indirect + github.com/go-openapi/spec v0.21.0 // indirect + github.com/go-openapi/strfmt v0.23.0 // indirect + github.com/go-openapi/validate v0.24.0 // indirect github.com/go-resty/resty/v2 v2.13.1 // indirect - github.com/go-test/deep v1.1.0 // indirect github.com/go-zookeeper/zk v1.0.3 // indirect github.com/goccy/go-json v0.10.3 // indirect github.com/goccy/go-yaml v1.11.0 // indirect @@ -859,8 +848,10 @@ require ( github.com/gogo/googleapis v1.4.1 // indirect github.com/golang-jwt/jwt/v5 v5.2.1 // indirect github.com/google/cel-go v0.20.1 // indirect + github.com/google/certificate-transparency-go v1.1.8 // indirect github.com/google/flatbuffers v24.3.25+incompatible // indirect - github.com/google/gnostic-models v0.6.8 // indirect + github.com/google/gnostic-models v0.6.9-0.20230804172637-c7be7c783f49 // indirect + github.com/google/go-github/v62 v62.0.0 // indirect github.com/google/go-querystring v1.1.0 // indirect github.com/google/s2a-go v0.1.8 // indirect github.com/googleapis/enterprise-certificate-proxy v0.3.4 // indirect @@ -875,30 +866,41 @@ require ( github.com/hashicorp/go-sockaddr v1.0.6 // indirect github.com/hashicorp/nomad/api v0.0.0-20240717122358-3d93bd3778f3 // indirect github.com/hetznercloud/hcloud-go/v2 v2.10.2 // indirect + github.com/huandu/xstrings v1.5.0 // indirect github.com/iancoleman/strcase v0.3.0 // indirect + github.com/in-toto/in-toto-golang v0.9.0 // indirect github.com/ionos-cloud/sdk-go/v6 v6.1.11 // indirect github.com/jackc/pgpassfile v1.0.0 // indirect github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect github.com/jackc/puddle/v2 v2.2.1 // indirect github.com/jaegertracing/jaeger v1.62.0 // indirect github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect + github.com/jedisct1/go-minisign v0.0.0-20230811132847-661be99b8267 // indirect github.com/jonboulle/clockwork v0.4.0 // indirect github.com/jpillora/backoff v1.0.0 // indirect github.com/kevinburke/ssh_config v1.2.0 // indirect github.com/knadh/koanf/maps v0.1.0 // indirect github.com/knadh/koanf/providers/confmap v0.1.0-dev0 // indirect github.com/knadh/koanf/v2 v2.1.2 // indirect + github.com/knqyf263/go-apk-version v0.0.0-20200609155635-041fdbb8563f // indirect + github.com/knqyf263/nested v0.0.1 // indirect github.com/kolo/xmlrpc v0.0.0-20220921171641-a4b6fa1dd06b // indirect github.com/kr/text v0.2.0 // indirect github.com/kylelemons/godebug v1.1.0 // indirect github.com/leodido/go-syslog/v4 v4.2.0 // indirect github.com/leodido/ragel-machinery v0.0.0-20190525184631-5f46317e436b // indirect + github.com/letsencrypt/boulder v0.0.0-20231026200631-000cd05d5491 // indirect + github.com/liamg/jfather v0.0.7 // indirect github.com/lightstep/go-expohisto v1.0.0 // indirect github.com/linode/linodego v1.37.0 // indirect github.com/lunixbochs/struc v0.0.0-20200707160740-784aaebc1d40 // indirect github.com/magefile/mage v1.15.0 // indirect + github.com/masahiro331/go-ebs-file v0.0.0-20240917043618-e6d2bea5c32e // indirect + github.com/masahiro331/go-mvn-version v0.0.0-20210429150710-d3157d602a08 // indirect + github.com/masahiro331/go-vmdk-parser v0.0.0-20221225061455-612096e4bbbd // indirect github.com/mattn/go-shellwords v1.0.12 // indirect github.com/microsoft/go-rustaudit v0.0.0-20220808201409-204dfee52032 // indirect + github.com/moby/buildkit v0.16.0 // indirect github.com/moby/docker-image-spec v1.3.1 // indirect github.com/moby/spdystream v0.4.0 // indirect github.com/moby/sys/sequential v0.5.0 // indirect @@ -906,57 +908,62 @@ require ( github.com/moby/sys/userns v0.1.0 // indirect github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f // indirect github.com/ncruces/go-strftime v0.1.9 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/connector/spanmetricsconnector v0.114.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/exporter/sapmexporter v0.114.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/extension/healthcheckextension v0.114.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer v0.114.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/dockerobserver v0.114.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/ecsobserver v0.114.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/ecstaskobserver v0.114.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/hostobserver v0.114.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/k8sobserver v0.114.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/extension/pprofextension v0.114.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/ecsutil v0.114.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.114.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.114.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/internal/docker v0.114.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter v0.114.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8sconfig v0.114.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/internal/metadataproviders v0.114.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/internal/pdatautil v0.114.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent v0.114.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/internal/splunk v0.114.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/batchperresourceattr v0.114.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/experimentalmetricmetadata v0.114.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl v0.114.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.114.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/sampling v0.114.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza v0.114.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.114.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheus v0.114.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/zipkin v0.114.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/processor/attributesprocessor v0.114.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/processor/cumulativetodeltaprocessor v0.114.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/processor/filterprocessor v0.114.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/processor/groupbyattrsprocessor v0.114.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/processor/k8sattributesprocessor v0.114.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/processor/probabilisticsamplerprocessor v0.114.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.114.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourceprocessor v0.114.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/processor/routingprocessor v0.114.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/processor/tailsamplingprocessor v0.114.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor v0.114.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filelogreceiver v0.114.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/fluentforwardreceiver v0.114.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver v0.114.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/jaegerreceiver v0.114.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusreceiver v0.114.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/receivercreator v0.114.0 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/zipkinreceiver v0.114.0 // indirect + github.com/nozzle/throttler v0.0.0-20180817012639-2ea982251481 // indirect + github.com/oklog/ulid v1.3.1 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/connector/spanmetricsconnector v0.115.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/exporter/sapmexporter v0.115.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/extension/healthcheckextension v0.115.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer v0.115.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/dockerobserver v0.115.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/ecsobserver v0.115.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/ecstaskobserver v0.115.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/hostobserver v0.115.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/k8sobserver v0.115.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/extension/pprofextension v0.115.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/ecsutil v0.115.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.115.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.115.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/internal/docker v0.115.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter v0.115.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8sconfig v0.115.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/internal/metadataproviders v0.115.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/internal/pdatautil v0.115.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent v0.115.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/internal/splunk v0.115.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/batchperresourceattr v0.115.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/experimentalmetricmetadata v0.115.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl v0.115.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.115.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/sampling v0.115.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza v0.115.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.115.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheus v0.115.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/zipkin v0.115.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/processor/attributesprocessor v0.115.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/processor/cumulativetodeltaprocessor v0.115.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/processor/filterprocessor v0.115.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/processor/groupbyattrsprocessor v0.115.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/processor/k8sattributesprocessor v0.115.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/processor/probabilisticsamplerprocessor v0.115.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.115.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourceprocessor v0.115.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/processor/routingprocessor v0.115.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/processor/tailsamplingprocessor v0.115.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor v0.115.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filelogreceiver v0.115.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/receiver/fluentforwardreceiver v0.115.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver v0.115.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/receiver/jaegerreceiver v0.115.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusreceiver v0.115.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/receiver/receivercreator v0.115.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/receiver/zipkinreceiver v0.115.0 // indirect github.com/openshift/client-go v0.0.0-20210521082421-73d9475a9142 // indirect + github.com/opentracing/opentracing-go v1.2.0 // indirect + github.com/openvex/discovery v0.1.1-0.20240802171711-7c54efc57553 // indirect github.com/openvex/go-vex v0.2.5 // indirect github.com/openzipkin/zipkin-go v0.4.3 // indirect github.com/ovh/go-ovh v1.6.0 // indirect + github.com/owenrumney/go-sarif/v2 v2.3.3 // indirect github.com/pelletier/go-toml/v2 v2.2.2 // indirect github.com/pjbgf/sha1cd v0.3.0 // indirect github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect @@ -970,60 +977,71 @@ require ( github.com/sagikazarmark/locafero v0.4.0 // indirect github.com/sagikazarmark/slog-shim v0.1.0 // indirect github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 // indirect + github.com/sassoftware/relic v7.2.1+incompatible // indirect github.com/scaleway/scaleway-sdk-go v1.0.0-beta.29 // indirect - github.com/shirou/gopsutil/v4 v4.24.10 // indirect - github.com/shoenig/go-m1cpu v0.1.6 // indirect - github.com/signalfx/sapm-proto v0.16.0 // indirect - github.com/sigstore/rekor v1.2.2 // indirect + github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect + github.com/shibumi/go-pathspec v1.3.0 // indirect + github.com/shopspring/decimal v1.4.0 // indirect + github.com/signalfx/sapm-proto v0.17.0 // indirect + github.com/sigstore/cosign/v2 v2.2.4 // indirect + github.com/sigstore/rekor v1.3.6 // indirect + github.com/sigstore/sigstore v1.8.3 // indirect + github.com/sigstore/timestamp-authority v1.2.2 // indirect github.com/skeema/knownhosts v1.2.2 // indirect github.com/smartystreets/assertions v1.1.0 // indirect github.com/sourcegraph/conc v0.3.0 // indirect github.com/spaolacci/murmur3 v1.1.0 // indirect + github.com/spdx/tools-golang v0.5.5 // indirect github.com/spf13/viper v1.19.0 // indirect github.com/stoewer/go-strcase v1.3.0 // indirect github.com/stormcat24/protodep v0.1.8 // indirect github.com/subosito/gotenv v1.6.0 // indirect github.com/swaggest/refl v1.3.0 // indirect - github.com/tetratelabs/wazero v1.7.0 // indirect + github.com/tetratelabs/wazero v1.8.0 // indirect + github.com/theupdateframework/go-tuf v0.7.0 // indirect github.com/tidwall/gjson v1.18.0 // indirect github.com/tidwall/match v1.1.1 // indirect github.com/tidwall/pretty v1.2.1 // indirect github.com/tidwall/sjson v1.2.5 // indirect + github.com/titanous/rocacheck v0.0.0-20171023193734-afe73141d399 // indirect + github.com/tonistiigi/go-csvvalue v0.0.0-20240710180619-ddb21b71c0b4 // indirect + github.com/transparency-dev/merkle v0.0.2 // indirect github.com/ua-parser/uap-go v0.0.0-20240611065828-3a4781585db6 // indirect github.com/vultr/govultr/v2 v2.17.2 // indirect github.com/wk8/go-ordered-map/v2 v2.1.8 // indirect github.com/x448/float16 v0.8.4 // indirect github.com/xanzy/ssh-agent v0.3.3 // indirect - go.opentelemetry.io/collector/client v1.20.0 // indirect - go.opentelemetry.io/collector/component/componentstatus v0.114.0 // indirect - go.opentelemetry.io/collector/config/configauth v0.114.0 // indirect - go.opentelemetry.io/collector/config/configcompression v1.20.0 // indirect - go.opentelemetry.io/collector/config/configgrpc v0.114.0 // indirect - go.opentelemetry.io/collector/config/confighttp v0.114.0 // indirect - go.opentelemetry.io/collector/config/confignet v1.20.0 // indirect - go.opentelemetry.io/collector/config/configopaque v1.20.0 // indirect - go.opentelemetry.io/collector/config/configretry v1.20.0 // indirect - go.opentelemetry.io/collector/config/configtls v1.20.0 // indirect - go.opentelemetry.io/collector/config/internal v0.114.0 // indirect - go.opentelemetry.io/collector/connector v0.114.0 // indirect - go.opentelemetry.io/collector/connector/connectorprofiles v0.114.0 // indirect - go.opentelemetry.io/collector/consumer/consumerprofiles v0.114.0 // indirect - go.opentelemetry.io/collector/consumer/consumertest v0.114.0 // indirect - go.opentelemetry.io/collector/exporter/exporterprofiles v0.114.0 // indirect - go.opentelemetry.io/collector/exporter/nopexporter v0.114.0 // indirect - go.opentelemetry.io/collector/exporter/otlphttpexporter v0.114.0 // indirect - go.opentelemetry.io/collector/extension/auth v0.114.0 // indirect - go.opentelemetry.io/collector/extension/experimental/storage v0.114.0 // indirect - go.opentelemetry.io/collector/extension/extensioncapabilities v0.114.0 // indirect - go.opentelemetry.io/collector/extension/zpagesextension v0.114.0 // indirect - go.opentelemetry.io/collector/filter v0.114.0 // indirect - go.opentelemetry.io/collector/pdata/pprofile v0.114.0 // indirect - go.opentelemetry.io/collector/pdata/testdata v0.114.0 // indirect - go.opentelemetry.io/collector/pipeline v0.114.0 // indirect - go.opentelemetry.io/collector/processor/memorylimiterprocessor v0.114.0 // indirect - go.opentelemetry.io/collector/processor/processorprofiles v0.114.0 // indirect - go.opentelemetry.io/collector/receiver/nopreceiver v0.114.0 // indirect - go.opentelemetry.io/collector/receiver/receiverprofiles v0.114.0 // indirect + github.com/xlab/treeprint v1.2.0 // indirect + go.opentelemetry.io/collector/client v1.21.0 // indirect + go.opentelemetry.io/collector/component/componentstatus v0.115.0 // indirect + go.opentelemetry.io/collector/config/configauth v0.115.0 // indirect + go.opentelemetry.io/collector/config/configcompression v1.21.0 // indirect + go.opentelemetry.io/collector/config/configgrpc v0.115.0 // indirect + go.opentelemetry.io/collector/config/confighttp v0.115.0 // indirect + go.opentelemetry.io/collector/config/confignet v1.21.0 // indirect + go.opentelemetry.io/collector/config/configopaque v1.21.0 // indirect + go.opentelemetry.io/collector/config/configretry v1.21.0 // indirect + go.opentelemetry.io/collector/config/configtls v1.21.0 // indirect + go.opentelemetry.io/collector/config/internal v0.115.0 // indirect + go.opentelemetry.io/collector/connector v0.115.0 // indirect + go.opentelemetry.io/collector/connector/connectorprofiles v0.115.0 // indirect + go.opentelemetry.io/collector/consumer/consumerprofiles v0.115.0 // indirect + go.opentelemetry.io/collector/consumer/consumertest v0.115.0 // indirect + go.opentelemetry.io/collector/exporter/exporterprofiles v0.115.0 // indirect + go.opentelemetry.io/collector/exporter/nopexporter v0.115.0 // indirect + go.opentelemetry.io/collector/exporter/otlphttpexporter v0.115.0 // indirect + go.opentelemetry.io/collector/extension/auth v0.115.0 // indirect + go.opentelemetry.io/collector/extension/experimental/storage v0.115.0 // indirect + go.opentelemetry.io/collector/extension/extensioncapabilities v0.115.0 // indirect + go.opentelemetry.io/collector/extension/zpagesextension v0.115.0 // indirect + go.opentelemetry.io/collector/filter v0.115.0 // indirect + go.opentelemetry.io/collector/pdata/pprofile v0.115.0 // indirect + go.opentelemetry.io/collector/pdata/testdata v0.115.0 // indirect + go.opentelemetry.io/collector/pipeline v0.115.0 // indirect + go.opentelemetry.io/collector/processor/memorylimiterprocessor v0.115.0 // indirect + go.opentelemetry.io/collector/processor/processorprofiles v0.115.0 // indirect + go.opentelemetry.io/collector/receiver/nopreceiver v0.115.0 // indirect + go.opentelemetry.io/collector/receiver/receiverprofiles v0.115.0 // indirect go.opentelemetry.io/contrib/config v0.10.0 // indirect go.opentelemetry.io/contrib/zpages v0.56.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.7.0 // indirect @@ -1039,7 +1057,9 @@ require ( golang.org/x/lint v0.0.0-20241112194109-818c5a804067 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20241104194629-dd2ea8efbc28 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect + gopkg.in/cheggaaa/pb.v1 v1.0.28 // indirect gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect + gopkg.in/go-jose/go-jose.v2 v2.6.3 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect honnef.co/go/tools v0.5.1 // indirect @@ -1048,6 +1068,7 @@ require ( modernc.org/gc/v3 v3.0.0-20240107210532-573471604cb6 // indirect modernc.org/strutil v1.2.0 // indirect modernc.org/token v1.1.0 // indirect + rsc.io/binaryregexp v0.2.0 // indirect ) replace github.com/pahanini/go-grpc-bidirectional-streaming-example v0.0.0-20211027164128-cc6111af44be => github.com/DataDog/go-grpc-bidirectional-streaming-example v0.0.0-20221024060302-b9cf785c02fe @@ -1060,24 +1081,14 @@ replace github.com/vishvananda/netlink => github.com/DataDog/netlink v1.0.1-0.20 // Use custom Trivy fork to reduce binary size // Pull in replacements needed by upstream Trivy replace ( - // Maps to Trivy fork https://github.com/DataDog/trivy/commits/use-fs-main-dd/ - github.com/aquasecurity/trivy => github.com/DataDog/trivy v0.0.0-20241126101205-8517f9b946f4 + // Maps to Trivy fork https://github.com/DataDog/trivy/commits/lebauce/container-artifact + github.com/aquasecurity/trivy => github.com/DataDog/trivy v0.0.0-20241223234648-d2ac813bf11b github.com/saracen/walker => github.com/DataDog/walker v0.0.0-20230418153152-7f29bb2dc950 - // testcontainers-go has a bug with versions v0.25.0 and v0.26.0 - // ref: https://github.com/testcontainers/testcontainers-go/issues/1782 - github.com/testcontainers/testcontainers-go => github.com/testcontainers/testcontainers-go v0.23.0 ) -// Temporarely use forks of trivy libraries to use lazy initialization of zap loggers. -// Patch was pushed upstream but maintainers would prefer moving to slog once 1.22 is out -replace github.com/aquasecurity/trivy-db => github.com/datadog/trivy-db v0.0.0-20240228172000-42caffdaee3f - // Fixes CVE-2023-1732, imported by nikos replace github.com/cloudflare/circl => github.com/cloudflare/circl v1.3.7 -// Fixes CVE-2023-26054, imported by trivy -replace github.com/moby/buildkit => github.com/moby/buildkit v0.13.0 - // Exclude specific versions of knadh/koanf to fix building with a `go.work`, following // https://github.com/open-telemetry/opentelemetry-collector/issues/8127 exclude ( diff --git a/go.sum b/go.sum index 25645013fb435..73322e5ed9314 100644 --- a/go.sum +++ b/go.sum @@ -13,6 +13,8 @@ cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKV cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= +cloud.google.com/go v0.115.1 h1:Jo0SM9cQnSkYfp44+v+NQXHpcHqlnRJk2qxh6yvxxxQ= +cloud.google.com/go v0.115.1/go.mod h1:DuujITeaufu3gL68/lOFIirVNJwQeyf5UXyi+Wbgknc= cloud.google.com/go/auth v0.9.5 h1:4CTn43Eynw40aFVr3GpPqsQponx2jv0BQpjvajsbbzw= cloud.google.com/go/auth v0.9.5/go.mod h1:Xo0n7n66eHyOWWCnitop6870Ilwo3PiZyodVkkH1xWM= cloud.google.com/go/auth/oauth2adapt v0.2.4 h1:0GWE/FUsXhf6C+jAkWgYm7X9tK8cuEIfy19DBn6B6bY= @@ -27,6 +29,12 @@ cloud.google.com/go/compute/metadata v0.5.2 h1:UxK4uu/Tn+I3p2dYWTfiX4wva7aYlKixA cloud.google.com/go/compute/metadata v0.5.2/go.mod h1:C66sj2AluDcIqakBq/M8lw8/ybHgOZqin2obFxa/E5k= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= +cloud.google.com/go/iam v1.2.0 h1:kZKMKVNk/IsSSc/udOb83K0hL/Yh/Gcqpz+oAkoIFN8= +cloud.google.com/go/iam v1.2.0/go.mod h1:zITGuWgsLZxd8OwAlX+eMFgZDXzBm7icj1PVTYG766Q= +cloud.google.com/go/kms v1.19.0 h1:x0OVJDl6UH1BSX4THKlMfdcFWoE4ruh90ZHuilZekrU= +cloud.google.com/go/kms v1.19.0/go.mod h1:e4imokuPJUc17Trz2s6lEXFDt8bgDmvpVynH39bdrHM= +cloud.google.com/go/longrunning v0.6.0 h1:mM1ZmaNsQsnb+5n1DNPeL0KwQd9jQRqSqSDEkBZr+aI= +cloud.google.com/go/longrunning v0.6.0/go.mod h1:uHzSZqW89h7/pasCWNYdUpwGz3PcVWhrWupreVPYLts= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= @@ -64,6 +72,10 @@ code.cloudfoundry.org/rfc5424 v0.0.0-20201103192249-000122071b78 h1:mrZQaZmuDIPh code.cloudfoundry.org/rfc5424 v0.0.0-20201103192249-000122071b78/go.mod h1:tkZo8GtzBjySJ7USvxm4E36lNQw1D3xM6oKHGqdaAJ4= code.cloudfoundry.org/tlsconfig v0.0.0-20200131000646-bbe0f8da39b3 h1:2Qal+q+tw/DmDOoJBWwDCPE3lIJNj/1o7oMkkb2c5SI= code.cloudfoundry.org/tlsconfig v0.0.0-20200131000646-bbe0f8da39b3/go.mod h1:eTbFJpyXRGuFVyg5+oaj9B2eIbIc+0/kZjH8ftbtdew= +cuelabs.dev/go/oci/ociregistry v0.0.0-20240314152124-224736b49f2e h1:GwCVItFUPxwdsEYnlUcJ6PJxOjTeFFCKOh6QWg4oAzQ= +cuelabs.dev/go/oci/ociregistry v0.0.0-20240314152124-224736b49f2e/go.mod h1:ApHceQLLwcOkCEXM1+DyCXTHEJhNGDpJ2kmV6axsx24= +cuelang.org/go v0.8.1 h1:VFYsxIFSPY5KgSaH1jQ2GxHOrbu6Ga3kEI70yCZwnOg= +cuelang.org/go v0.8.1/go.mod h1:CoDbYolfMms4BhWUlhD+t5ORnihR7wvjcfgyO9lL5FI= dario.cat/mergo v1.0.1 h1:Ra4+bf83h2ztPIQYNP99R6m+Y7KfnARDfID+a+vLl4s= dario.cat/mergo v1.0.1/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= @@ -73,12 +85,18 @@ github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 h1:bvDV9 github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24/go.mod h1:8o94RPi1/7XTJvwPpRSzSUedZrtlirdB3r9Z20bi2f8= github.com/AdamKorcz/go-118-fuzz-build v0.0.0-20230306123547-8075edf89bb0 h1:59MxjQVfjXsBpLy+dbd2/ELV5ofnUkUZBvWSC85sheA= github.com/AdamKorcz/go-118-fuzz-build v0.0.0-20230306123547-8075edf89bb0/go.mod h1:OahwfttHWG6eJ0clwcfBAHoDI6X/LV/15hx/wlMZSrU= +github.com/AdamKorcz/go-fuzz-headers-1 v0.0.0-20230919221257-8b5d3ce2d11d h1:zjqpY4C7H15HjRPEenkS4SAn3Jy2eRRjkjZbGR30TOg= +github.com/AdamKorcz/go-fuzz-headers-1 v0.0.0-20230919221257-8b5d3ce2d11d/go.mod h1:XNqJ7hv2kY++g8XEHREpi+JqZo3+0l+CH2egBVN4yqM= github.com/AlekSi/pointer v1.0.0/go.mod h1:1kjywbfcPFCmncIxtk6fIEub6LKrfMz3gc5QKVOSOA8= github.com/AlekSi/pointer v1.2.0 h1:glcy/gc4h8HnG2Z3ZECSzZ1IX1x2JxRVuDzaJwQE0+w= github.com/AlekSi/pointer v1.2.0/go.mod h1:gZGfd3dpW4vEc/UlyfKKi1roIqcCgwOIvb0tSNSBle0= +github.com/AliyunContainerService/ack-ram-tool/pkg/credentials/alibabacloudsdkgo/helper v0.2.0 h1:8+4G8JaejP8Xa6W46PzJEwisNgBXMvFcz78N6zG/ARw= +github.com/AliyunContainerService/ack-ram-tool/pkg/credentials/alibabacloudsdkgo/helper v0.2.0/go.mod h1:GgeIE+1be8Ivm7Sh4RgwI42aTtC9qrcj+Y9Y6CjJhJs= github.com/Azure/azure-pipeline-go v0.2.3/go.mod h1:x841ezTBIMG6O3lAcl8ATHnsOPVl2bqk7S3ta6S6u4k= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0 h1:GJHeeA2N7xrG3q30L2UXDyuWRzDM900/65j70wcM4Ww= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0/go.mod h1:l38EPgmsp71HHLq9j7De57JcKOWPyhrsW1Awm1JS6K0= +github.com/Azure/azure-sdk-for-go v68.0.0+incompatible h1:fcYLmCpyNYRnvJbPerq7U0hS+6+I79yEDJBqVNcqUzU= +github.com/Azure/azure-sdk-for-go v68.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.14.0 h1:nyQWyZvwGTvunIMxi1Y9uXkcyr+I7TeNrr/foo4Kpk8= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.14.0/go.mod h1:l38EPgmsp71HHLq9j7De57JcKOWPyhrsW1Awm1JS6K0= github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 h1:tfLQ34V6F7tVSwoTf/4lH5sE0o6eCJuNDTmH09nDpbc= github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0/go.mod h1:9kIvujWAA58nmPmWB1m23fyWic1kYZMxD9CxaWn4Qpg= github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 h1:ywEEhmNahHBihViHepv3xPBn1663uRv2t2q/ESv9seY= @@ -91,17 +109,33 @@ github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4 v4.3 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v4 v4.3.0/go.mod h1:Y/HgrePTmGy9HjdSGTqZNa+apUpTVIEVKXJyARP2lrk= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.1.1 h1:7CBQ+Ei8SP2c6ydQTGCCrS35bDxgTMfoP2miAwK++OU= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.1.1/go.mod h1:c/wcGeGx5FUPbM/JltUYHZcKmigwyVLJlDq+4HdtXaw= +github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azkeys v1.1.0 h1:DRiANoJTiW6obBQe3SqZizkuV1PEgfiiGivmVocDy64= +github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azkeys v1.1.0/go.mod h1:qLIye2hwb/ZouqhpSD9Zn3SJipvpEnz1Ywl3VUk9Y0s= +github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v1.0.0 h1:D3occbWoio4EBLkbkevetNMAVX197GkzbUMtqjGWn80= +github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v1.0.0/go.mod h1:bTSOgj05NGRuHHhQwAdPnYr9TOdNmKlZTgGLL6nyAdI= github.com/Azure/azure-storage-blob-go v0.15.0/go.mod h1:vbjsVbX0dlxnRc4FFMPsS9BsJWPcne7GB7onqlPvz58= github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0= github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= +github.com/Azure/go-autorest v14.2.0+incompatible h1:V5VMDjClD3GiElqLWO7mz2MxNAK/vTfRHdAubSIPRgs= github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= github.com/Azure/go-autorest/autorest v0.11.12/go.mod h1:eipySxLmqSyC5s5k1CLupqet0PSENBEDP93LQ9a8QYw= +github.com/Azure/go-autorest/autorest v0.11.29 h1:I4+HL/JDvErx2LjyzaVxllw2lRDB5/BT2Bm4g20iqYw= +github.com/Azure/go-autorest/autorest v0.11.29/go.mod h1:ZtEzC4Jy2JDrZLxvWs8LrBWEBycl1hbT1eknI8MtfAs= github.com/Azure/go-autorest/autorest/adal v0.9.5/go.mod h1:B7KF7jKIeC9Mct5spmyCB/A8CG/sEz1vwIRGv/bbw7A= github.com/Azure/go-autorest/autorest/adal v0.9.13/go.mod h1:W/MM4U6nLxnIskrw4UwWzlHfGjwUS50aOsc/I3yuU8M= +github.com/Azure/go-autorest/autorest/adal v0.9.23 h1:Yepx8CvFxwNKpH6ja7RZ+sKX+DWYNldbLiALMC3BTz8= +github.com/Azure/go-autorest/autorest/adal v0.9.23/go.mod h1:5pcMqFkdPhviJdlEy3kC/v1ZLnQl0MH6XA5YCcMhy4c= +github.com/Azure/go-autorest/autorest/azure/auth v0.5.12 h1:wkAZRgT/pn8HhFyzfe9UnqOjJYqlembgCTi72Bm/xKk= +github.com/Azure/go-autorest/autorest/azure/auth v0.5.12/go.mod h1:84w/uV8E37feW2NCJ08uT9VBfjfUHpgLVnG2InYD6cg= +github.com/Azure/go-autorest/autorest/azure/cli v0.4.6 h1:w77/uPk80ZET2F+AfQExZyEWtn+0Rk/uw17m9fv5Ajc= +github.com/Azure/go-autorest/autorest/azure/cli v0.4.6/go.mod h1:piCfgPho7BiIDdEQ1+g4VmKyD5y+p/XtSNqE6Hc4QD0= +github.com/Azure/go-autorest/autorest/date v0.3.0 h1:7gUk1U5M/CQbp9WoqinNzJar+8KY+LPI6wiWrP/myHw= github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSYnokU+TrmwEsOqdt8Y6sso74= github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= github.com/Azure/go-autorest/logger v0.2.0/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= +github.com/Azure/go-autorest/logger v0.2.1 h1:IG7i4p/mDa2Ce4TRyAO8IHnVhAVF3RFU+ZtXWSmf4Tg= github.com/Azure/go-autorest/logger v0.2.1/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= +github.com/Azure/go-autorest/tracing v0.6.0 h1:TYi4+3m5t6K48TGI9AUdb+IzbnSxvnvUMfuitfgcfuo= github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 h1:XHOnouVk1mxXfQidrMEnLlPk9UMeRtyBTnEFtxkV0kU= github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= @@ -115,8 +149,8 @@ github.com/CycloneDX/cyclonedx-go v0.9.1 h1:yffaWOZsv77oTJa/SdVZYdgAgFioCeycBUKk github.com/CycloneDX/cyclonedx-go v0.9.1/go.mod h1:NE/EWvzELOFlG6+ljX/QeMlVt9VKcTwu8u0ccsACEsw= github.com/DATA-DOG/go-sqlmock v1.5.2 h1:OcvFkGmslmlZibjAjaHm3L//6LiuBgolP7OputlJIzU= github.com/DATA-DOG/go-sqlmock v1.5.2/go.mod h1:88MAG/4G7SMwSE3CeA0ZKzrT5CiOU3OJ+JlNzwDqpNU= -github.com/DataDog/agent-payload/v5 v5.0.137 h1:nV02RrYj6AwlQBGIEv6yG23CuxGtG0YWoFZAVE6vwxY= -github.com/DataDog/agent-payload/v5 v5.0.137/go.mod h1:lxh9lb5xYrBXjblpIWYUi4deJqVbkIfkjwesi5nskDc= +github.com/DataDog/agent-payload/v5 v5.0.138 h1:Wg7hmWuoLC/o0X3zZ+uGcfRHPyaytljudgSY9O59zjc= +github.com/DataDog/agent-payload/v5 v5.0.138/go.mod h1:lxh9lb5xYrBXjblpIWYUi4deJqVbkIfkjwesi5nskDc= github.com/DataDog/appsec-internal-go v1.9.0 h1:cGOneFsg0JTRzWl5U2+og5dbtyW3N8XaYwc5nXe39Vw= github.com/DataDog/appsec-internal-go v1.9.0/go.mod h1:wW0cRfWBo4C044jHGwYiyh5moQV2x0AhnwqMuiX7O/g= github.com/DataDog/aptly v1.5.3 h1:oLsRvjuXSVM4ia0N83dU3KiQeiJ6BaszYbTZOkSfDlw= @@ -125,19 +159,19 @@ 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/datadog-agent/comp/core/log v0.56.2 h1:qvBT+FfjKGqimyEvmsNHCZKbTfBJAdUZSVy2IZQ8HS4= github.com/DataDog/datadog-agent/comp/core/log v0.56.2/go.mod h1:ivJ/RMZjTNkoPPNDX+v/nnBwABLCiMv1vQA5tk/HCR4= -github.com/DataDog/datadog-api-client-go/v2 v2.31.0 h1:JfJhYlHfLzvauI8u6h23smTooWYe6quNhhg9gpTszWY= -github.com/DataDog/datadog-api-client-go/v2 v2.31.0/go.mod h1:d3tOEgUd2kfsr9uuHQdY+nXrWp4uikgTgVCPdKNK30U= +github.com/DataDog/datadog-api-client-go/v2 v2.33.0 h1:OI6kDnJeQmkjfGzxmP0XUQUxMD4tp6oAPXnnJ4VpgUM= +github.com/DataDog/datadog-api-client-go/v2 v2.33.0/go.mod h1:d3tOEgUd2kfsr9uuHQdY+nXrWp4uikgTgVCPdKNK30U= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= -github.com/DataDog/datadog-go/v5 v5.5.0 h1:G5KHeB8pWBNXT4Jtw0zAkhdxEAWSpWH00geHI6LDrKU= -github.com/DataDog/datadog-go/v5 v5.5.0/go.mod h1:K9kcYBlxkcPP8tvvjZZKs/m1edNAUFzBbdpTUKfCsuw= -github.com/DataDog/datadog-operator v0.7.1-0.20241024104907-734366f3c0d1 h1:17MXCuo1IacLeVzdmwV+92ANVrXkquObm0yxjen1eJ0= -github.com/DataDog/datadog-operator v0.7.1-0.20241024104907-734366f3c0d1/go.mod h1:5Xp66c0HGadP85lOQtb6oVuSvuL5ZSSowQM58hNtTi8= +github.com/DataDog/datadog-go/v5 v5.6.0 h1:2oCLxjF/4htd55piM75baflj/KoE6VYS7alEUqFvRDw= +github.com/DataDog/datadog-go/v5 v5.6.0/go.mod h1:K9kcYBlxkcPP8tvvjZZKs/m1edNAUFzBbdpTUKfCsuw= +github.com/DataDog/datadog-operator v0.7.1-0.20241219210556-f517775059d1 h1:EFGXjo7iSZO1f0ZpLE2H2UIcPH2x4yhxQnKd8UKrs3k= +github.com/DataDog/datadog-operator v0.7.1-0.20241219210556-f517775059d1/go.mod h1:mD+3PWR0wOSVJGaXjkpzsYEK/7PhqjOipx2usgfsxM0= 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/dd-trace-go/v2 v2.0.0-beta.11 h1:6vwU//TjBIghQKMgIP9UyIRhN/LWS1y8tYzvRnu8JZw= github.com/DataDog/dd-trace-go/v2 v2.0.0-beta.11/go.mod h1:woPHoAOfAIM7kl4GauR+qrWui7teNg44Um0verg2rzQ= -github.com/DataDog/ebpf-manager v0.7.4 h1:fI2fJbDpykDiO/hq3IVIi+YLVVrJ97qG6O8LT7mdCnQ= -github.com/DataDog/ebpf-manager v0.7.4/go.mod h1:QlCkGTH3koCMDG7E8o9Si6O9UXjBwQspP6z2YtKlyGU= +github.com/DataDog/ebpf-manager v0.7.6 h1:EPH1VKeK7DuDRGFiOAmtTqTozdi2/SppTyLW0O1Zsa0= +github.com/DataDog/ebpf-manager v0.7.6/go.mod h1:F3ezth0x5IE6hE6p5mhG005TdExhu60fAWiB8cRMsP8= github.com/DataDog/go-grpc-bidirectional-streaming-example v0.0.0-20221024060302-b9cf785c02fe h1:RO40ywnX/vZLi4Pb4jRuFGgQQBYGIIoQ6u+P2MIgFOA= github.com/DataDog/go-grpc-bidirectional-streaming-example v0.0.0-20221024060302-b9cf785c02fe/go.mod h1:90sqV0j7E8wYCyqIp5d9HmYWLTFQttqPFFtNYDyAybQ= github.com/DataDog/go-libddwaf/v3 v3.5.1 h1:GWA4ln4DlLxiXm+X7HA/oj0ZLcdCwOS81KQitegRTyY= @@ -158,28 +192,26 @@ github.com/DataDog/mmh3 v0.0.0-20210722141835-012dc69a9e49 h1:EbzDX8HPk5uE2FsJYx github.com/DataDog/mmh3 v0.0.0-20210722141835-012dc69a9e49/go.mod h1:SvsjzyJlSg0rKsqYgdcFxeEVflx3ZNAyFfkUHP0TxXg= github.com/DataDog/netlink v1.0.1-0.20240223195320-c7a4f832a3d1 h1:HnvrdC79xJ+RPxTQdhDDwxblTNWhJUKeyTPsuyaOnxQ= github.com/DataDog/netlink v1.0.1-0.20240223195320-c7a4f832a3d1/go.mod h1:whJevzBpTrid75eZy99s3DqCmy05NfibNaF2Ol5Ox5A= -github.com/DataDog/nikos v1.12.7 h1:L04tM4ZUD9uqMgLwypQvYq9kq55WV7I09gfooH0G+gY= -github.com/DataDog/nikos v1.12.7/go.mod h1:wqQP+l+pb23yzUhWh+ejcxqlFHLh/pNAEAEU/YKHURU= -github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.21.0 h1:U+p1i7+upWb4qOIOOvjS/92iMUGlSzEC1tRxVo0Lg8Y= -github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.21.0/go.mod h1:dOjp1lg4jwYyIbpnqW+DoOV8qD+70C+lgpINFvUqasQ= -github.com/DataDog/opentelemetry-mapping-go/pkg/internal/sketchtest v0.21.0 h1:VS4NTqwczwezMVvI6A7xYR3ugPmMUJ4FcdFrsdnZI2I= -github.com/DataDog/opentelemetry-mapping-go/pkg/internal/sketchtest v0.21.0/go.mod h1:66XlN7QpQKqIvw8e2UbCXV5X8wGnEw851nT9BjJ75dY= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.21.0 h1:hgbTFS6SkqbzOiWSfP58dZ/Jpjlmv6dpD4+V4LDHm2Q= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.21.0/go.mod h1:dvIWN9pA2zWNTw5rhDWZgzZnhcfpH++d+8d1SWW6xkY= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.21.0 h1:XD9Kd+baO66+tfbdanOFSMGEfwWfnrn/IxG/Dc5bv5I= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.21.0/go.mod h1:9ByLz9jISc176DzjIdaRfRKwaitqF8ie6RTvfP8Aufo= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.21.0 h1:8nW8jfcCIWzxWrpI31C0QYoOjTaUGp6USCwiRbP5Fp4= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.21.0/go.mod h1:wuatEozcLYinJ0WYf0MlVTFtTzEmf+qyJet0H9foVAs= -github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.21.0 h1:/Dp1WBvekdusS9Tw9pLE7RG04eluNktQ29arLS4SpGM= -github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.21.0/go.mod h1:asNuwNy1O2HbadkcZVuqmFGonfEzXS/SBvOo8V1MJvQ= +github.com/DataDog/nikos v1.12.9 h1:mE8UUY+9iWI1+V71xJmRy7X8K8wXkO+UboI4he8sMK4= +github.com/DataDog/nikos v1.12.9/go.mod h1:ZIwrmoyRId2qWpkREwQPWT4cjrui0d4yYM5pbRVizNo= +github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.22.0 h1:r1Dx2cRHCBWkVluSZA41i4eoI/nOGbcrrZdkqWjoFCc= +github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.22.0/go.mod h1:+/dkO8ZiMa8rfm4SmtTF6qPUdBbBcvsWWKaO4xPKAIk= +github.com/DataDog/opentelemetry-mapping-go/pkg/internal/sketchtest v0.22.0 h1:cXcKVEU1D0HlguR7GunnvuI70TghkarCa9DApqzMY94= +github.com/DataDog/opentelemetry-mapping-go/pkg/internal/sketchtest v0.22.0/go.mod h1:ES00EXfyEKgUkjd93tAXCxJA6i0seeOhZoS5Cj2qzzg= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.22.0 h1:yfk2cF8Bx98fSFpGrehEHh1FRqewfxcCTAbUDt5r3F8= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.22.0/go.mod h1:9qzpnBSxSOnKzbF/uHket3SSlQihQHix/ZRC2nZUUYQ= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.22.0 h1:Zqj8YUZ/ualUhM8GDCQX6xKnUJKEiG0eYdFGWmIDG30= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.22.0/go.mod h1:lpr4q6g2TB0BHeLHaz/XleKm8YXQjuxiQEb9Q9HXXE0= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.22.0 h1:w9+ngZDYUMLW+GSRA8x1DvVbuMR+cwlGb8VLwZfgBGs= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.22.0/go.mod h1:UsfqLgiD6Sjhpjkg+YzAd+TdKUZ2m6ZZ8t+tEkLNTMA= +github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.22.0 h1:63SzQz9Ab8XJj8fQKQz6UZNBhOm8rucwzbDfwTVF6dQ= +github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.22.0/go.mod h1:E/PY/aQ6S/N5hBPHXZRGmovs5b1BSi4RHGNcB4yP/Z0= 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/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/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/trivy v0.0.0-20241223234648-d2ac813bf11b h1:wCKboWBVsnpnFnBKGhQ3jeQOVDPQkMRTLWcs2bxRjss= +github.com/DataDog/trivy v0.0.0-20241223234648-d2ac813bf11b/go.mod h1:qJj5iHmlvtSbgmRWJDANpAFmmxcXuKGQfucp9VtJfR8= +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/watermarkpodautoscaler v0.5.3-0.20241023200123-ab786c1724cf h1:nbsZ9srTWTTlHzWDGkVE6R5hnqENXTK9N8doMC2YPps= github.com/DataDog/watermarkpodautoscaler v0.5.3-0.20241023200123-ab786c1724cf/go.mod h1:ay+v2Blaq9nA5YngtqXJe6Z9JOdeSmOEyBkmKs1yyQQ= github.com/DataDog/zstd v1.5.6 h1:LbEglqepa/ipmmQJUDnSsfvA8e8IStVcGaFWDuxvGOY= @@ -233,6 +265,8 @@ github.com/Showmax/go-fqdn v1.0.0/go.mod h1:SfrFBzmDCtCGrnHhoDjuvFnKsWjEQX/Q9ARZ github.com/StackExchange/wmi v0.0.0-20181212234831-e0a55b97c705/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= github.com/StackExchange/wmi v1.2.1 h1:VIkavFPXSjcnS+O8yTq7NI32k0R5Aj+v39y29VYDOSA= github.com/StackExchange/wmi v1.2.1/go.mod h1:rcmrprowKIVzvc+NUiLncP2uuArMWLCbu9SBzvHz7e8= +github.com/ThalesIgnite/crypto11 v1.2.5 h1:1IiIIEqYmBvUYFeMnHqRft4bwf/O36jryEUpY+9ef8E= +github.com/ThalesIgnite/crypto11 v1.2.5/go.mod h1:ILDKtnCKiQ7zRoNxcp36Y1ZR8LBPmR2E23+wTQe/MlE= github.com/VividCortex/ewma v1.2.0 h1:f58SaIzcDXrSy3kWaHNvuJgJ3Nmz59Zji6XoJR/q1ow= github.com/VividCortex/ewma v1.2.0/go.mod h1:nz4BbCtbLyFDeC9SUHbtcT5644juEuWfUAUnGx7j5l4= github.com/acobaugh/osrelease v0.1.0 h1:Yb59HQDGGNhCj4suHaFQQfBps5wyoKLSSX/J/+UifRE= @@ -241,16 +275,16 @@ github.com/agext/levenshtein v1.2.3 h1:YB2fHEn0UJagG8T1rrWknE3ZQzWM06O8AMAatNn7l github.com/agext/levenshtein v1.2.3/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= github.com/agnivade/levenshtein v1.2.0 h1:U9L4IOT0Y3i0TIlUIDJ7rVUziKi/zPbrJGaFrtYH3SY= github.com/agnivade/levenshtein v1.2.0/go.mod h1:QVVI16kDrtSuwcpd0p1+xMC6Z/VfhtCyDIjcwga4/DU= -github.com/alecthomas/assert/v2 v2.3.0 h1:mAsH2wmvjsuvyBvAmCtm7zFsBlb8mIHx5ySLVdDZXL0= -github.com/alecthomas/assert/v2 v2.3.0/go.mod h1:pXcQ2Asjp247dahGEmsZ6ru0UVwnkhktn7S0bBDLxvQ= +github.com/alecthomas/assert/v2 v2.6.0 h1:o3WJwILtexrEUk3cUVal3oiQY2tfgr/FHWiz/v2n4FU= +github.com/alecthomas/assert/v2 v2.6.0/go.mod h1:Bze95FyfUr7x34QZrjL+XP+0qgp/zg8yS+TtBj1WA3k= github.com/alecthomas/jsonschema v0.0.0-20210918223802-a1d3f4b43d7b/go.mod h1:/n6+1/DWPltRLWL/VKyUxg6tzsl5kHUCcraimt4vr60= github.com/alecthomas/participle v0.7.1 h1:2bN7reTw//5f0cugJcTOnY/NYZcWQOaajW+BwZB5xWs= github.com/alecthomas/participle v0.7.1/go.mod h1:HfdmEuwvr12HXQN44HPWXR0lHmVolVYe4dyL6lQ3duY= github.com/alecthomas/participle/v2 v2.1.1 h1:hrjKESvSqGHzRb4yW1ciisFJ4p3MGYih6icjJvbsmV8= github.com/alecthomas/participle/v2 v2.1.1/go.mod h1:Y1+hAs8DHPmc3YUFzqllV+eSQ9ljPTk0ZkPMtEdAx2c= github.com/alecthomas/repr v0.0.0-20181024024818-d37bc2a10ba1/go.mod h1:xTS7Pm1pD1mvyM075QCDSRqH6qRLXylzS24ZTpRiSzQ= -github.com/alecthomas/repr v0.2.0 h1:HAzS41CIzNW5syS8Mf9UwXhNH1J9aix/BvDRf1Ml2Yk= -github.com/alecthomas/repr v0.2.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4= +github.com/alecthomas/repr v0.4.0 h1:GhI2A8MACjfegCPVq9f1FLvIBS+DrQ2KQBFZP1iFzXc= +github.com/alecthomas/repr v0.4.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4= 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= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= @@ -258,10 +292,34 @@ github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRF github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/alecthomas/units v0.0.0-20240626203959-61d1e3462e30 h1:t3eaIm0rUkzbrIewtiFmMK5RXHej2XnoXNhxVsAYUfg= github.com/alecthomas/units v0.0.0-20240626203959-61d1e3462e30/go.mod h1:fvzegU4vN3H1qMT+8wDmzjAcDONcgo2/SZ/TyfdUOFs= +github.com/alessio/shellescape v1.4.1 h1:V7yhSDDn8LP4lc4jS8pFkt0zCnzVJlG5JXy9BVKJUX0= +github.com/alessio/shellescape v1.4.1/go.mod h1:PZAiSCk0LJaZkiCSkPv8qIobYglO3FPpyFjDCtHLS30= +github.com/alibabacloud-go/alibabacloud-gateway-spi v0.0.4 h1:iC9YFYKDGEy3n/FtqJnOkZsene9olVspKmkX5A2YBEo= +github.com/alibabacloud-go/alibabacloud-gateway-spi v0.0.4/go.mod h1:sCavSAvdzOjul4cEqeVtvlSaSScfNsTQ+46HwlTL1hc= +github.com/alibabacloud-go/cr-20160607 v1.0.1 h1:WEnP1iPFKJU74ryUKh/YDPHoxMZawqlPajOymyNAkts= +github.com/alibabacloud-go/cr-20160607 v1.0.1/go.mod h1:QHeKZtZ3F3FOE+/uIXCBAp8POwnUYekpLwr1dtQa5r0= +github.com/alibabacloud-go/cr-20181201 v1.0.10 h1:B60f6S1imsgn2fgC6X6FrVNrONDrbCT0NwYhsJ0C9/c= +github.com/alibabacloud-go/cr-20181201 v1.0.10/go.mod h1:VN9orB/w5G20FjytoSpZROqu9ZqxwycASmGqYUJSoDc= +github.com/alibabacloud-go/darabonba-openapi v0.2.1 h1:WyzxxKvhdVDlwpAMOHgAiCJ+NXa6g5ZWPFEzaK/ewwY= +github.com/alibabacloud-go/darabonba-openapi v0.2.1/go.mod h1:zXOqLbpIqq543oioL9IuuZYOQgHQ5B8/n5OPrnko8aY= +github.com/alibabacloud-go/debug v1.0.0 h1:3eIEQWfay1fB24PQIEzXAswlVJtdQok8f3EVN5VrBnA= +github.com/alibabacloud-go/debug v1.0.0/go.mod h1:8gfgZCCAC3+SCzjWtY053FrOcd4/qlH6IHTI4QyICOc= +github.com/alibabacloud-go/endpoint-util v1.1.1 h1:ZkBv2/jnghxtU0p+upSU0GGzW1VL9GQdZO3mcSUTUy8= +github.com/alibabacloud-go/endpoint-util v1.1.1/go.mod h1:O5FuCALmCKs2Ff7JFJMudHs0I5EBgecXXxZRyswlEjE= +github.com/alibabacloud-go/openapi-util v0.1.0 h1:0z75cIULkDrdEhkLWgi9tnLe+KhAFE/r5Pb3312/eAY= +github.com/alibabacloud-go/openapi-util v0.1.0/go.mod h1:sQuElr4ywwFRlCCberQwKRFhRzIyG4QTP/P4y1CJ6Ws= +github.com/alibabacloud-go/tea v1.2.1 h1:rFF1LnrAdhaiPmKwH5xwYOKlMh66CqRwPUTzIK74ask= +github.com/alibabacloud-go/tea v1.2.1/go.mod h1:qbzof29bM/IFhLMtJPrgTGK3eauV5J2wSyEUo4OEmnA= +github.com/alibabacloud-go/tea-utils v1.4.5 h1:h0/6Xd2f3bPE4XHTvkpjwxowIwRCJAJOqY6Eq8f3zfA= +github.com/alibabacloud-go/tea-utils v1.4.5/go.mod h1:KNcT0oXlZZxOXINnZBs6YvgOd5aYp9U67G+E3R8fcQw= +github.com/alibabacloud-go/tea-xml v1.1.3 h1:7LYnm+JbOq2B+T/B0fHC4Ies4/FofC4zHzYtqw7dgt0= +github.com/alibabacloud-go/tea-xml v1.1.3/go.mod h1:Rq08vgCcCAjHyRi/M7xlHKUykZCEtyBy9+DPF6GgEu8= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a h1:HbKu58rmZpUGpz5+4FfNmIU+FmZg2P3Xaj2v2bfNWmk= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= -github.com/alicebob/miniredis/v2 v2.31.1 h1:7XAt0uUg3DtwEKW5ZAGa+K7FZV2DdKQo5K/6TTnfX8Y= -github.com/alicebob/miniredis/v2 v2.31.1/go.mod h1:UB/T2Uztp7MlFSDakaX1sTXUv5CASoprx0wulRT6HBg= +github.com/alicebob/miniredis/v2 v2.33.0 h1:uvTF0EDeu9RLnUEG27Db5I68ESoIxTiXbNUiji6lZrA= +github.com/alicebob/miniredis/v2 v2.33.0/go.mod h1:MhP4a3EU7aENRi9aO+tHfTBZicLqQevyi/DJpoj6mi0= +github.com/aliyun/credentials-go v1.3.1 h1:uq/0v7kWrxmoLGpqjx7vtQ/s03f0zR//0br/xWDTE28= +github.com/aliyun/credentials-go v1.3.1/go.mod h1:8jKYhQuDawt8x2+fusqa1Y6mPxemTsBEN04dgcAcYz0= github.com/anchore/go-struct-converter v0.0.0-20221118182256-c68fdcfa2092 h1:aM1rlcoLz8y5B2r4tTLMiVTrMtpfY0O8EScKJxaSaEc= github.com/anchore/go-struct-converter v0.0.0-20221118182256-c68fdcfa2092/go.mod h1:rYqSE9HbjzpHTI74vwPvae4ZVYZd1lue2ta6xHPdblA= github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be h1:9AeTilPcZAjCFIImctFaOjnTIavg87rW78vTPkQqLI8= @@ -286,14 +344,17 @@ github.com/aquasecurity/go-npm-version v0.0.0-20201110091526-0b796d180798/go.mod github.com/aquasecurity/go-pep440-version v0.0.0-20210121094942-22b2f8951d46 h1:vmXNl+HDfqqXgr0uY1UgK1GAhps8nbAAtqHNBcgyf+4= github.com/aquasecurity/go-pep440-version v0.0.0-20210121094942-22b2f8951d46/go.mod h1:olhPNdiiAAMiSujemd1O/sc6GcyePr23f/6uGKtthNg= github.com/aquasecurity/go-version v0.0.0-20201107203531-5e48ac5d022a/go.mod h1:9Beu8XsUNNfzml7WBf3QmyPToP1wm1Gj/Vc5UJKqTzU= -github.com/aquasecurity/go-version v0.0.0-20210121072130-637058cfe492 h1:rcEG5HI490FF0a7zuvxOxen52ddygCfNVjP0XOCMl+M= github.com/aquasecurity/go-version v0.0.0-20210121072130-637058cfe492/go.mod h1:9Beu8XsUNNfzml7WBf3QmyPToP1wm1Gj/Vc5UJKqTzU= +github.com/aquasecurity/go-version v0.0.0-20240603093900-cf8a8d29271d h1:4zour5Sh9chOg+IqIinIcJ3qtr3cIf8FdFY6aArlXBw= +github.com/aquasecurity/go-version v0.0.0-20240603093900-cf8a8d29271d/go.mod h1:1cPOp4BaQZ1G2F5fnw4dFz6pkOyXJI9KTuak8ghIl3U= github.com/aquasecurity/table v1.8.0 h1:9ntpSwrUfjrM6/YviArlx/ZBGd6ix8W+MtojQcM7tv0= github.com/aquasecurity/table v1.8.0/go.mod h1:eqOmvjjB7AhXFgFqpJUEE/ietg7RrMSJZXyTN8E/wZw= -github.com/aquasecurity/testdocker v0.0.0-20230111101738-e741bda259da h1:pj/adfN0Wbzc0H8YkI1nX5K92wOU5/1/1TRuuc0y5Nw= -github.com/aquasecurity/testdocker v0.0.0-20230111101738-e741bda259da/go.mod h1:852lbQLpK2nCwlR4ZLYIccxYCfoQao6q9Nl6tjz54v8= +github.com/aquasecurity/testdocker v0.0.0-20240730042311-4642e94c7fc8 h1:b43UVqYjz7qDqK+cVOtF2Lk6CxjytYItP6Pgf3wGsNE= +github.com/aquasecurity/testdocker v0.0.0-20240730042311-4642e94c7fc8/go.mod h1:wXA9k3uuaxY3yu7gxrxZDPo/04FEMJtwyecdAlYrEIo= github.com/aquasecurity/tml v0.6.1 h1:y2ZlGSfrhnn7t4ZJ/0rotuH+v5Jgv6BDDO5jB6A9gwo= github.com/aquasecurity/tml v0.6.1/go.mod h1:OnYMWY5lvI9ejU7yH9LCberWaaTBW7hBFsITiIMY2yY= +github.com/aquasecurity/trivy-db v0.0.0-20240910133327-7e0f4d2ed4c1 h1:G0gnacAORRUqz2Tm5MqivSpldY2GZ74ijhJcMsae+sA= +github.com/aquasecurity/trivy-db v0.0.0-20240910133327-7e0f4d2ed4c1/go.mod h1:PYkSRx4dlgFATEt+okGwibvbxVEtqsOdH+vX/saACYE= github.com/aquasecurity/trivy-java-db v0.0.0-20240109071736-184bd7481d48 h1:JVgBIuIYbwG+ekC5lUHUpGJboPYiCcxiz06RCtz8neI= github.com/aquasecurity/trivy-java-db v0.0.0-20240109071736-184bd7481d48/go.mod h1:Ldya37FLi0e/5Cjq2T5Bty7cFkzUDwTcPeQua+2M8i8= github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0 h1:jfIu9sQUG6Ig+0+Ap1h4unLjW6YQJpKZVmUzxsD4E/Q= @@ -321,43 +382,43 @@ github.com/aws/aws-sdk-go v1.38.35/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2z github.com/aws/aws-sdk-go v1.55.5 h1:KKUZBfBoyqy5d3swXyiC7Q76ic40rYcbqH7qjh59kzU= github.com/aws/aws-sdk-go v1.55.5/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU= github.com/aws/aws-sdk-go-v2 v1.21.2/go.mod h1:ErQhvNuEMhJjweavOYhxVkn2RUx7kQXVATHrjKtxIpM= -github.com/aws/aws-sdk-go-v2 v1.32.5 h1:U8vdWJuY7ruAkzaOdD7guwJjD06YSKmnKCJs7s3IkIo= -github.com/aws/aws-sdk-go-v2 v1.32.5/go.mod h1:P5WJBrYqqbWVaOxgH0X/FYYD47/nooaPOZPlQdmiN2U= +github.com/aws/aws-sdk-go-v2 v1.32.6 h1:7BokKRgRPuGmKkFMhEg/jSul+tB9VvXhcViILtfG8b4= +github.com/aws/aws-sdk-go-v2 v1.32.6/go.mod h1:P5WJBrYqqbWVaOxgH0X/FYYD47/nooaPOZPlQdmiN2U= github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.14/go.mod h1:9NCTOURS8OpxvoAVHq79LK81/zC78hfRWFn+aL0SPcY= github.com/aws/aws-sdk-go-v2/config v1.19.0/go.mod h1:ZwDUgFnQgsazQTnWfeLWk5GjeqTQTL8lMkoE1UXzxdE= -github.com/aws/aws-sdk-go-v2/config v1.28.5 h1:Za41twdCXbuyyWv9LndXxZZv3QhTG1DinqlFsSuvtI0= -github.com/aws/aws-sdk-go-v2/config v1.28.5/go.mod h1:4VsPbHP8JdcdUDmbTVgNL/8w9SqOkM5jyY8ljIxLO3o= +github.com/aws/aws-sdk-go-v2/config v1.28.6 h1:D89IKtGrs/I3QXOLNTH93NJYtDhm8SYa9Q5CsPShmyo= +github.com/aws/aws-sdk-go-v2/config v1.28.6/go.mod h1:GDzxJ5wyyFSCoLkS+UhGB0dArhb9mI+Co4dHtoTxbko= github.com/aws/aws-sdk-go-v2/credentials v1.13.43/go.mod h1:zWJBz1Yf1ZtX5NGax9ZdNjhhI4rgjfgsyk6vTY1yfVg= -github.com/aws/aws-sdk-go-v2/credentials v1.17.46 h1:AU7RcriIo2lXjUfHFnFKYsLCwgbz1E7Mm95ieIRDNUg= -github.com/aws/aws-sdk-go-v2/credentials v1.17.46/go.mod h1:1FmYyLGL08KQXQ6mcTlifyFXfJVCNJTVGuQP4m0d/UA= +github.com/aws/aws-sdk-go-v2/credentials v1.17.47 h1:48bA+3/fCdi2yAwVt+3COvmatZ6jUDNkDTIsqDiMUdw= +github.com/aws/aws-sdk-go-v2/credentials v1.17.47/go.mod h1:+KdckOejLW3Ks3b0E3b5rHsr2f9yuORBum0WPnE5o5w= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.13/go.mod h1:f/Ib/qYjhV2/qdsf79H3QP/eRE4AkVyEf6sk7XfZ1tg= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.20 h1:sDSXIrlsFSFJtWKLQS4PUWRvrT580rrnuLydJrCQ/yA= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.20/go.mod h1:WZ/c+w0ofps+/OUqMwWgnfrgzZH1DZO1RIkktICsqnY= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.21 h1:AmoU1pziydclFT/xRV+xXE/Vb8fttJCLRPv8oAkprc0= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.21/go.mod h1:AjUdLYe4Tgs6kpH4Bv7uMZo7pottoyHMn4eTcIcneaY= github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.43/go.mod h1:auo+PiyLl0n1l8A0e8RIeR8tOzYPfZZH/JNlrJ8igTQ= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.24 h1:4usbeaes3yJnCFC7kfeyhkdkPtoRYPa/hTmCqMpKpLI= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.24/go.mod h1:5CI1JemjVwde8m2WG3cz23qHKPOxbpkq0HaoreEgLIY= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.25 h1:s/fF4+yDQDoElYhfIVvSNyeCydfbuTKzhxSXDXCPasU= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.25/go.mod h1:IgPfDv5jqFIzQSNbUEMoitNooSMXjRSDkhXv8jiROvU= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.37/go.mod h1:Qe+2KtKml+FEsQF/DHmDV+xjtche/hwoF75EG4UlHW8= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.24 h1:N1zsICrQglfzaBnrfM0Ys00860C+QFwu6u/5+LomP+o= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.24/go.mod h1:dCn9HbJ8+K31i8IQ8EWmWj0EiIk0+vKiHNMxTTYveAg= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.25 h1:ZntTCl5EsYnhN/IygQEUugpdwbhdkom9uHcbCftiGgA= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.25/go.mod h1:DBdPrgeocww+CSl1C8cEV8PN1mHMBhuCDLpXezyvWkE= github.com/aws/aws-sdk-go-v2/internal/ini v1.3.45/go.mod h1:lD5M20o09/LCuQ2mE62Mb/iSdSlCNuj6H5ci7tW7OsE= github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 h1:VaRN3TlFdd6KxX1x3ILT5ynH6HvKgqdiXoTxAF4HQcQ= github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1/go.mod h1:FbtygfRFze9usAadmnGJNc8KsP346kEe+y2/oyhGAGc= github.com/aws/aws-sdk-go-v2/internal/v4a v1.1.6/go.mod h1:Q0Hq2X/NuL7z8b1Dww8rmOFl+jzusKEcyvkKspwdpyc= -github.com/aws/aws-sdk-go-v2/service/ebs v1.27.0 h1:4zuGQITyy9O+GlSGcs+aUz3+SmlvnYFc1/o4lRBs5Bw= -github.com/aws/aws-sdk-go-v2/service/ebs v1.27.0/go.mod h1:T0t6q7wBD2P11xwVcc6GvwmuDT3i6ZJgZ+13ziQUUnA= +github.com/aws/aws-sdk-go-v2/service/ebs v1.22.1 h1:SeDJWG4pmye+/aO6k+zt9clPTUy1MXqUmkW8rbAddQg= +github.com/aws/aws-sdk-go-v2/service/ebs v1.22.1/go.mod h1:wRzaW0v9GGQS0h//wpsVDw3Hah5gs5UP+NxoyGeZIGM= github.com/aws/aws-sdk-go-v2/service/ec2 v1.190.0 h1:k97fGog9Tl0woxTiSIHN14Qs5ehqK6GXejUwkhJYyL0= github.com/aws/aws-sdk-go-v2/service/ec2 v1.190.0/go.mod h1:mzj8EEjIHSN2oZRXiw1Dd+uB4HZTl7hC8nBzX9IZMWw= -github.com/aws/aws-sdk-go-v2/service/ecr v1.36.2 h1:VDQaVwGOokbd3VUbHF+wupiffdrbAZPdQnr5XZMJqrs= -github.com/aws/aws-sdk-go-v2/service/ecr v1.36.2/go.mod h1:lvUlMghKYmSxSfv0vU7pdU/8jSY+s0zpG8xXhaGKCw0= -github.com/aws/aws-sdk-go-v2/service/ecrpublic v1.27.0 h1:k4ykVLeoO2JohTC7BIfIqWYvmf8HcirbWHf8Zn0SPpI= -github.com/aws/aws-sdk-go-v2/service/ecrpublic v1.27.0/go.mod h1:vJMqaxbvogPsWZYEInEwK82EBwCfc7cnE/5BEqnvTYI= +github.com/aws/aws-sdk-go-v2/service/ecr v1.36.7 h1:R+5XKIJga2K9Dkj0/iQ6fD/MBGo02oxGGFTc512lK/Q= +github.com/aws/aws-sdk-go-v2/service/ecr v1.36.7/go.mod h1:fDPQV/6ONOQOjvtKhtypIy1wcGLcKYtoK/lvZ9fyDGQ= +github.com/aws/aws-sdk-go-v2/service/ecrpublic v1.18.2 h1:PpbXaecV3sLAS6rjQiaKw4/jyq3Z8gNzmoJupHAoBp0= +github.com/aws/aws-sdk-go-v2/service/ecrpublic v1.18.2/go.mod h1:fUHpGXr4DrXkEDpGAjClPsviWf+Bszeb0daKE0blxv8= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.15/go.mod h1:26SQUPcTNgV1Tapwdt4a1rOsYRsnBsJHLMPoxK2b0d8= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.1 h1:iXtILhvDxB6kPvEXgsDhGaZCSC6LQET5ZHSdJozeI0Y= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.1/go.mod h1:9nu0fVANtYiAePIBh2/pFUSwtJ402hLnp854CNoDOeE= github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.38/go.mod h1:epIZoRSSbRIwLPJU5F+OldHhwZPBdpDeQkRdCeY3+00= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.37/go.mod h1:vBmDnwWXWxNPFRMmG2m/3MKOe+xEcMDo1tanpaWCcck= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.5 h1:wtpJ4zcwrSbwhECWQoI/g6WM9zqCcSpHDJIWSbMLOu4= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.5/go.mod h1:qu/W9HXQbbQ4+1+JcZp0ZNPV31ym537ZJN+fiS7Ti8E= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.6 h1:50+XsN70RS7dwJ2CkVNXzj7U2L1HKP8nqTd3XWEXBN4= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.6/go.mod h1:WqgLmwY7so32kG01zD8CPTJWVWM+TzJoOVHwTg4aPug= github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.15.6/go.mod h1:lnc2taBsR9nTlz9meD+lhFZZ9EWY712QHrRflWpTcOA= github.com/aws/aws-sdk-go-v2/service/kms v1.37.6 h1:CZImQdb1QbU9sGgJ9IswhVkxAcjkkD1eQTMA1KHWk+E= github.com/aws/aws-sdk-go-v2/service/kms v1.37.6/go.mod h1:YJDdlK0zsyxVBxGU48AR/Mi8DMrGdc1E3Yij4fNrONA= @@ -367,19 +428,19 @@ github.com/aws/aws-sdk-go-v2/service/s3 v1.40.2/go.mod h1:Zjfqt7KhQK+PO1bbOsFNzK github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.34.6 h1:1KDMKvOKNrpD667ORbZ/+4OgvUoaok1gg/MLzrHF9fw= github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.34.6/go.mod h1:DmtyfCfONhOyVAJ6ZMTrDSFIeyCBlEO93Qkfhxwbxu0= github.com/aws/aws-sdk-go-v2/service/sso v1.15.2/go.mod h1:gsL4keucRCgW+xA85ALBpRFfdSLH4kHOVSnLMSuBECo= -github.com/aws/aws-sdk-go-v2/service/sso v1.24.6 h1:3zu537oLmsPfDMyjnUS2g+F2vITgy5pB74tHI+JBNoM= -github.com/aws/aws-sdk-go-v2/service/sso v1.24.6/go.mod h1:WJSZH2ZvepM6t6jwu4w/Z45Eoi75lPN7DcydSRtJg6Y= +github.com/aws/aws-sdk-go-v2/service/sso v1.24.7 h1:rLnYAfXQ3YAccocshIH5mzNNwZBkBo+bP6EhIxak6Hw= +github.com/aws/aws-sdk-go-v2/service/sso v1.24.7/go.mod h1:ZHtuQJ6t9A/+YDuxOLnbryAmITtr8UysSny3qcyvJTc= github.com/aws/aws-sdk-go-v2/service/ssooidc v1.17.3/go.mod h1:a7bHA82fyUXOm+ZSWKU6PIoBxrjSprdLoM8xPYvzYVg= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.5 h1:K0OQAsDywb0ltlFrZm0JHPY3yZp/S9OaoLU33S7vPS8= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.5/go.mod h1:ORITg+fyuMoeiQFiVGoqB3OydVTLkClw/ljbblMq6Cc= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.6 h1:JnhTZR3PiYDNKlXy50/pNeix9aGMo6lLpXwJ1mw8MD4= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.6/go.mod h1:URronUEGfXZN1VpdktPSD1EkAL9mfrV+2F4sjH38qOY= github.com/aws/aws-sdk-go-v2/service/sts v1.23.2/go.mod h1:Eows6e1uQEsc4ZaHANmsPRzAKcVDrcmjjWiih2+HUUQ= -github.com/aws/aws-sdk-go-v2/service/sts v1.33.1 h1:6SZUVRQNvExYlMLbHdlKB48x0fLbc2iVROyaNEwBHbU= -github.com/aws/aws-sdk-go-v2/service/sts v1.33.1/go.mod h1:GqWyYCwLXnlUB1lOAXQyNSPqPLQJvmo8J0DWBzp9mtg= +github.com/aws/aws-sdk-go-v2/service/sts v1.33.2 h1:s4074ZO1Hk8qv65GqNXqDjmkf4HSQqJukaLuuW0TpDA= +github.com/aws/aws-sdk-go-v2/service/sts v1.33.2/go.mod h1:mVggCnIWoM09jP71Wh+ea7+5gAp53q+49wDFs1SW5z8= github.com/aws/smithy-go v1.15.0/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= github.com/aws/smithy-go v1.22.1 h1:/HPHZQ0g7f4eUeK6HKglFz8uwVfZKgoI25rb/J+dnro= github.com/aws/smithy-go v1.22.1/go.mod h1:irrKGvNn1InZwb2d7fkIRNucdfwR8R+Ts3wxYa/cJHg= -github.com/awslabs/amazon-ecr-credential-helper/ecr-login v0.0.0-20240409155312-26d1ea377073 h1:9XtHL16FtbSDAedz9AnboTDqfKacYqc5BmwtUxzwwD8= -github.com/awslabs/amazon-ecr-credential-helper/ecr-login v0.0.0-20240409155312-26d1ea377073/go.mod h1:2nlYPkG0rFrODp6R875pk/kOnB8Ivj3+onhzk2mO57g= +github.com/awslabs/amazon-ecr-credential-helper/ecr-login v0.0.0-20231024185945-8841054dbdb8 h1:SoFYaT9UyGkR0+nogNyD/Lj+bsixB+SNuAS4ABlEs6M= +github.com/awslabs/amazon-ecr-credential-helper/ecr-login v0.0.0-20231024185945-8841054dbdb8/go.mod h1:2JF49jcDOrLStIXN/j/K1EKRq8a8R2qRnlZA6/o/c7c= github.com/bahlo/generic-list-go v0.2.0 h1:5sz/EEAK+ls5wF+NeqDpk5+iNdMDXrh3z3nPnH1Wvgk= github.com/bahlo/generic-list-go v0.2.0/go.mod h1:2KvAjgMlE5NNynlg/5iLrrCCZ2+5xWbdbCW3pNTGyYg= github.com/bboreham/go-loser v0.0.0-20230920113527-fcc2c21820a3 h1:6df1vn4bBlDDo4tARvBm7l6KA9iVMnE3NWizDeWSrps= @@ -400,6 +461,8 @@ github.com/bitnami/go-version v0.0.0-20231130084017-bb00604d650c h1:C4UZIaS+HAw+ github.com/bitnami/go-version v0.0.0-20231130084017-bb00604d650c/go.mod h1:9iglf1GG4oNRJ39bZ5AZrjgAFD2RwQbXw6Qf7Cs47wo= github.com/blabber/go-freebsd-sysctl v0.0.0-20201130114544-503969f39d8f h1:gMH+lz/KRpSqdoL+IQjgd91bP1LB8vrVEfNxr47GYC8= github.com/blabber/go-freebsd-sysctl v0.0.0-20201130114544-503969f39d8f/go.mod h1:cTRyHktEaXkKTTEyZ0hAgS7H4V0AVoKhB8Dx0tVr/tY= +github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ= +github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM= github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= github.com/bmatcuk/doublestar/v4 v4.7.1 h1:fdDeAqgT47acgwd9bd9HxJRDmc9UAmPpc+2m0CXv75Q= @@ -414,12 +477,18 @@ github.com/bradleyjkemp/cupaloy/v2 v2.8.0 h1:any4BmKE+jGIaMpnU8YgH/I2LPiLBufr6oM github.com/bradleyjkemp/cupaloy/v2 v2.8.0/go.mod h1:bm7JXdkRd4BHJk9HpwqAI8BoAY1lps46Enkdqw6aRX0= github.com/briandowns/spinner v1.23.0 h1:alDF2guRWqa/FOZZYWjlMIx2L6H0wyewPxo/CH4Pt2A= github.com/briandowns/spinner v1.23.0/go.mod h1:rPG4gmXeN3wQV/TsAY4w8lPdIM6RX3yqeBQJSrbXjuE= -github.com/bsm/ginkgo/v2 v2.9.5 h1:rtVBYPs3+TC5iLUVOis1B9tjLTup7Cj5IfzosKtvTJ0= -github.com/bsm/ginkgo/v2 v2.9.5/go.mod h1:SwYbGRRDovPVboqFv0tPTcG1sN61LM1Z4ARdbAV9g4c= -github.com/bsm/gomega v1.26.0 h1:LhQm+AFcgV2M0WyKroMASzAzCAJVpAxQXv4SaI9a69Y= -github.com/bsm/gomega v1.26.0/go.mod h1:JyEr/xRbxbtgWNi8tIEVPUYZ5Dzef52k01W3YH0H+O0= +github.com/bsm/ginkgo/v2 v2.12.0 h1:Ny8MWAHyOepLGlLKYmXG4IEkioBysk6GpaRTLC8zwWs= +github.com/bsm/ginkgo/v2 v2.12.0/go.mod h1:SwYbGRRDovPVboqFv0tPTcG1sN61LM1Z4ARdbAV9g4c= +github.com/bsm/gomega v1.27.10 h1:yeMWxP2pV2fG3FgAODIY8EiRE3dy0aeFYt4l7wh6yKA= +github.com/bsm/gomega v1.27.10/go.mod h1:JyEr/xRbxbtgWNi8tIEVPUYZ5Dzef52k01W3YH0H+O0= github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMUs= github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= +github.com/buildkite/agent/v3 v3.62.0 h1:yvzSjI8Lgifw883I8m9u8/L/Thxt4cLFd5aWPn3gg70= +github.com/buildkite/agent/v3 v3.62.0/go.mod h1:jN6SokGXrVNNIpI0BGQ+j5aWeI3gin8F+3zwA5Q6gqM= +github.com/buildkite/go-pipeline v0.3.2 h1:SW4EaXNwfjow7xDRPGgX0Rcx+dPj5C1kV9LKCLjWGtM= +github.com/buildkite/go-pipeline v0.3.2/go.mod h1:iY5jzs3Afc8yHg6KDUcu3EJVkfaUkd9x/v/OH98qyUA= +github.com/buildkite/interpolate v0.0.0-20200526001904-07f35b4ae251 h1:k6UDF1uPYOs0iy1HPeotNa155qXRWrzKnqAaGXHLZCE= +github.com/buildkite/interpolate v0.0.0-20200526001904-07f35b4ae251/go.mod h1:gbPR1gPu9dB96mucYIR7T3B7p/78hRVSOuzIWLHK2Y4= github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= github.com/bytecodealliance/wasmtime-go/v3 v3.0.2 h1:3uZCA/BLTIu+DqCfguByNMJa2HVHpXvjfy0Dy7g6fuA= github.com/bytecodealliance/wasmtime-go/v3 v3.0.2/go.mod h1:RnUjnIXxEJcL6BgCvNyzCCRzZcxCgsZCi+RNlvYor5Q= @@ -427,6 +496,8 @@ github.com/cavaliergopher/grab/v3 v3.0.1 h1:4z7TkBfmPjmLAAmkkAZNX/6QJ1nNFdv3SdIH github.com/cavaliergopher/grab/v3 v3.0.1/go.mod h1:1U/KNnD+Ft6JJiYoYBAimKH2XrYptb8Kl3DFGmsjpq4= github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= +github.com/cenkalti/backoff/v3 v3.2.2 h1:cfUAAO3yvKMYKPrvhDuHSwQnhZNk/RMHKdZqKTxfm6M= +github.com/cenkalti/backoff/v3 v3.2.2/go.mod h1:cIeZDE3IrqwwJl6VUwCN6trj1oXrTS4rc0ij+ULvLYs= github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= @@ -439,8 +510,10 @@ github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XL github.com/cheggaaa/pb v1.0.10/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s= github.com/cheggaaa/pb v1.0.29 h1:FckUN5ngEk2LpvuG0fw1GEFx6LtyY2pWI/Z2QgCnEYo= github.com/cheggaaa/pb v1.0.29/go.mod h1:W40334L7FMC5JKWldsTWbdGjLo0RxUKK73K+TuPxX30= -github.com/cheggaaa/pb/v3 v3.1.4 h1:DN8j4TVVdKu3WxVwcRKu0sG00IIU6FewoABZzXbRQeo= -github.com/cheggaaa/pb/v3 v3.1.4/go.mod h1:6wVjILNBaXMs8c21qRiaUM8BR82erfgau1DQ4iUXmSA= +github.com/cheggaaa/pb/v3 v3.1.5 h1:QuuUzeM2WsAqG2gMqtzaWithDJv0i+i6UlnwSCI4QLk= +github.com/cheggaaa/pb/v3 v3.1.5/go.mod h1:CrxkeghYTXi1lQBEI7jSn+3svI3cuc19haAj6jM60XI= +github.com/chrismellard/docker-credential-acr-env v0.0.0-20230304212654-82a0ddb27589 h1:krfRl01rzPzxSxyLyrChD+U+MzsBXbm0OwYYB67uF+4= +github.com/chrismellard/docker-credential-acr-env v0.0.0-20230304212654-82a0ddb27589/go.mod h1:OuDyvmLnMCwa2ep4Jkm6nyA0ocJuZlGyk2gGseVzERM= github.com/chrusty/protoc-gen-jsonschema v0.0.0-20240212064413-73d5723042b8 h1:/Jd/W5vhPuLHSNOzK15RkiVd9zhFHGuxbOV+mRGFYQ0= github.com/chrusty/protoc-gen-jsonschema v0.0.0-20240212064413-73d5723042b8/go.mod h1:VC7bNYA8cg2IWaZDBNfrqUBcUMEuJ/RRkus0frzTQb4= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= @@ -454,6 +527,8 @@ github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6D github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= github.com/clbanning/mxj v1.8.4 h1:HuhwZtbyvyOw+3Z1AowPkU87JkJUSv751ELWaiTpj8I= github.com/clbanning/mxj v1.8.4/go.mod h1:BVjHeAH+rl9rs6f+QIpeRl0tfu10SXn1pUSa5PVGJng= +github.com/clbanning/mxj/v2 v2.7.0 h1:WA/La7UGCanFe5NpHF0Q3DNtnCsVoxbPKuyBNHWRyME= +github.com/clbanning/mxj/v2 v2.7.0/go.mod h1:hNiWqW14h+kc+MdF9C6/YoRfjEJoR3ou6tn/Qo+ve2s= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cloudflare/cbpfc v0.0.0-20240920015331-ff978e94500b h1:EgR1t4Lnq6uP6QxJQ+oIFtENOHUY3/7gMOE76vL0KcA= github.com/cloudflare/cbpfc v0.0.0-20240920015331-ff978e94500b/go.mod h1:X/9cHz8JVzKlvoZyKBgMgrogKZlLf+pWjmm5gSUm5dI= @@ -466,10 +541,14 @@ github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnht github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20240905190251-b4127c9b8d78 h1:QVw89YDxXxEe+l8gU8ETbOasdwEV+avkR75ZzsVV9WI= github.com/cncf/xds/go v0.0.0-20240905190251-b4127c9b8d78/go.mod h1:W+zGtBO5Y1IgJhy4+A9GOqVhqLpfZi+vwmdNXUehLA8= +github.com/cockroachdb/apd/v3 v3.2.1 h1:U+8j7t0axsIgvQUqthuNm82HIrYXodOV2iWLWtEaIwg= +github.com/cockroachdb/apd/v3 v3.2.1/go.mod h1:klXJcjp+FffLTHlhIG69tezTDvdP065naDsHzKhYSqc= github.com/codahale/rfc6979 v0.0.0-20141003034818-6a90f24967eb h1:EDmT6Q9Zs+SbUoc7Ik9EfrFqcylYqgPZ9ANSbTAntnE= github.com/codahale/rfc6979 v0.0.0-20141003034818-6a90f24967eb/go.mod h1:ZjrT6AXHbDs86ZSdt/osfBi5qfexBrKUdONk989Wnk4= github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0 h1:sDMmm+q/3+BukdIpxwO365v/Rbspp2Nt5XntgQRXq8Q= github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcjuz89kmFXt9morQgcfYZAYZ5n8WHjt81YYWIwtTM= +github.com/common-nighthawk/go-figure v0.0.0-20210622060536-734e95fb86be h1:J5BL2kskAlV9ckgEsNQXscjIaLiOYiZ75d4e94E6dcQ= +github.com/common-nighthawk/go-figure v0.0.0-20210622060536-734e95fb86be/go.mod h1:mk5IQ+Y0ZeO87b858TlA645sVcEcbiX6YqP98kt+7+w= github.com/containerd/cgroups/v3 v3.0.4 h1:2fs7l3P0Qxb1nKWuJNFiwhp2CqiKzho71DQkDrHJIo4= github.com/containerd/cgroups/v3 v3.0.4/go.mod h1:SA5DLYnXO8pTGYiAHXz94qvLQTKfVM5GEVisn4jpins= github.com/containerd/containerd v1.7.23 h1:H2CClyUkmpKAGlhQp95g2WXHfLYc7whAuvZGBNYOOwQ= @@ -503,6 +582,9 @@ github.com/coreos/bbolt v1.3.3/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkE github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= +github.com/coreos/go-oidc v2.2.1+incompatible h1:mh48q/BqXqgjVHpy2ZY7WnWAbenxRjsz9N1i1YxjHAk= +github.com/coreos/go-oidc/v3 v3.10.0 h1:tDnXHnLyiTVyT/2zLDGj09pFPkhND8Gl8lnTRhoEaJU= +github.com/coreos/go-oidc/v3 v3.10.0/go.mod h1:5j11xcw0D3+SGxn6Z/WFADsgcWVMyNAlSQupk0KK3ac= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-semver v0.3.1 h1:yi21YpKnrx1gt5R+la8n5WgS0kCrsPp33dmEyHReZr4= github.com/coreos/go-semver v0.3.1/go.mod h1:irMmmIw/7yzSRPWryHsK7EYSg09caPQL03VsM8rvUec= @@ -522,10 +604,12 @@ github.com/cri-o/ocicni v0.4.3 h1:BfnrZrtr/F+o+b+yOguB1o6I4OzjieF3k3dN4MrsCJA= github.com/cri-o/ocicni v0.4.3/go.mod h1:RzIKSln5AT65hyyfGj3/gsfCpjiY1Y6rVK51Uc5YNzk= github.com/csaf-poc/csaf_distribution/v3 v3.0.0 h1:ob9+Fmpff0YWgTP3dYaw7G2hKQ9cegh9l3zksc+q3sM= github.com/csaf-poc/csaf_distribution/v3 v3.0.0/go.mod h1:uilCTiNKivq+6zrDvjtZaUeLk70oe21iwKivo6ILwlQ= +github.com/cyberphone/json-canonicalization v0.0.0-20231011164504-785e29786b46 h1:2Dx4IHfC1yHWI12AxQDJM1QbRCDfk6M+blLzlZCXdrc= +github.com/cyberphone/json-canonicalization v0.0.0-20231011164504-785e29786b46/go.mod h1:uzvlm1mxhHkdfqitSA92i7Se+S9ksOn3a3qmv/kyOCw= github.com/cyphar/filepath-securejoin v0.3.4 h1:VBWugsJh2ZxJmLFSM06/0qzQyiQX2Qs0ViKrUAcqdZ8= github.com/cyphar/filepath-securejoin v0.3.4/go.mod h1:8s/MCNJREmFK0H02MF6Ihv1nakJe4L/w3WZLHNkvlYM= -github.com/datadog/trivy-db v0.0.0-20240228172000-42caffdaee3f h1:IFB3J+f0m2e7nZjPTqvzLrrb6dVU6BQrsGx/7Tmm8Xk= -github.com/datadog/trivy-db v0.0.0-20240228172000-42caffdaee3f/go.mod h1:cj9/QmD9N3OZnKQMp+/DvdV+ym3HyIkd4e+F0ZM3ZGs= +github.com/danieljoos/wincred v1.2.1 h1:dl9cBrupW8+r5250DYkYxocLeZ1Y4vB1kxgtjxw8GQs= +github.com/danieljoos/wincred v1.2.1/go.mod h1:uGaFL9fDn3OLTvzCGulzE+SzjEe5NGlh5FdCcyfPwps= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= @@ -548,18 +632,25 @@ github.com/dgryski/trifles v0.0.0-20230903005119-f50d829f2e54 h1:SG7nF6SRlWhcT7c github.com/dgryski/trifles v0.0.0-20230903005119-f50d829f2e54/go.mod h1:if7Fbed8SFyPtHLHbg49SI7NAdJiC5WIA09pe59rfAA= github.com/digitalocean/godo v1.118.0 h1:lkzGFQmACrVCp7UqH1sAi4JK/PWwlc5aaxubgorKmC4= github.com/digitalocean/godo v1.118.0/go.mod h1:Vk0vpCot2HOAJwc5WE8wljZGtJ3ZtWIc8MQ8rF38sdo= +github.com/digitorus/pkcs7 v0.0.0-20230713084857-e76b763bdc49/go.mod h1:SKVExuS+vpu2l9IoOc0RwqE7NYnb0JlcFHFnEJkVDzc= +github.com/digitorus/pkcs7 v0.0.0-20230818184609-3a137a874352 h1:ge14PCmCvPjpMQMIAH7uKg0lrtNSOdpYsRXlwk3QbaE= +github.com/digitorus/pkcs7 v0.0.0-20230818184609-3a137a874352/go.mod h1:SKVExuS+vpu2l9IoOc0RwqE7NYnb0JlcFHFnEJkVDzc= +github.com/digitorus/timestamp v0.0.0-20231217203849-220c5c2851b7 h1:lxmTCgmHE1GUYL7P0MlNa00M67axePTq+9nBSGddR8I= +github.com/digitorus/timestamp v0.0.0-20231217203849-220c5c2851b7/go.mod h1:GvWntX9qiTlOud0WkQ6ewFm0LPy5JUR1Xo0Ngbd1w6Y= +github.com/dimchansky/utfbom v1.1.1 h1:vV6w1AhK4VMnhBno/TPVCoK9U/LP0PkLCS9tbxHdi/U= +github.com/dimchansky/utfbom v1.1.1/go.mod h1:SxdoEBH5qIqFocHMyGOXVAybYJdr71b1Q/j0mACtrfE= github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk= github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= github.com/dnaeon/go-vcr v1.2.0 h1:zHCHvJYTMh1N7xnV7zf1m1GPBF9Ad0Jk/whtQ1663qI= github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ= -github.com/docker/cli v27.1.1+incompatible h1:goaZxOqs4QKxznZjjBWKONQci/MywhtRv2oNn0GkeZE= -github.com/docker/cli v27.1.1+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= +github.com/docker/cli v27.4.0+incompatible h1:/nJzWkcI1MDMN+U+px/YXnQWJqnu4J+QKGTfD6ptiTc= +github.com/docker/cli v27.4.0+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBirtxJnzDrHLEKxTAYk= github.com/docker/distribution v2.8.3+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker v27.3.1+incompatible h1:KttF0XoteNTicmUtBO0L2tP+J7FGRFTjaEF4k6WdhfI= -github.com/docker/docker v27.3.1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/docker-credential-helpers v0.8.1 h1:j/eKUktUltBtMzKqmfLB0PAgqYyMHOp5vfsD1807oKo= -github.com/docker/docker-credential-helpers v0.8.1/go.mod h1:P3ci7E3lwkZg6XiHdRKft1KckHiO9a2rNtyFbZ/ry9M= +github.com/docker/docker v27.4.0+incompatible h1:I9z7sQ5qyzO0BfAb9IMOawRkAGxhYsidKiTMcm0DU+A= +github.com/docker/docker v27.4.0+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker-credential-helpers v0.8.2 h1:bX3YxiGzFP5sOXWc3bTPEXdEaZSeVMrFgOr3T+zrFAo= +github.com/docker/docker-credential-helpers v0.8.2/go.mod h1:P3ci7E3lwkZg6XiHdRKft1KckHiO9a2rNtyFbZ/ry9M= github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj1Br63c= github.com/docker/go-connections v0.5.0/go.mod h1:ov60Kzw0kKElRwhNs9UlUHAE/F9Fe6GLaXnqyDdmEXc= github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c h1:+pKlWGMw7gf6bQ+oDZB4KHQFypsfjYlq/C4rfL7D3g8= @@ -594,6 +685,8 @@ github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/emicklei/go-restful/v3 v3.12.1 h1:PJMDIM/ak7btuL8Ex0iYET9hxM3CI2sjZtzpL63nKAU= github.com/emicklei/go-restful/v3 v3.12.1/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= +github.com/emicklei/proto v1.12.1 h1:6n/Z2pZAnBwuhU66Gs8160B8rrrYKo7h2F2sCOnNceE= +github.com/emicklei/proto v1.12.1/go.mod h1:rn1FgRS/FANiZdD2djyH7TMA9jdRDcYQ9IEN9yvjX0A= github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= @@ -648,6 +741,8 @@ github.com/glebarez/go-sqlite v1.22.0 h1:uAcMJhaA6r3LHMTFgP0SifzgXg46yJkgxqyuyec github.com/glebarez/go-sqlite v1.22.0/go.mod h1:PlBIdHe0+aUEFn+r2/uthrWq4FxbzugL0L8Li6yQJbc= github.com/gliderlabs/ssh v0.3.7 h1:iV3Bqi942d9huXnzEF2Mt+CY9gLu8DNM4Obd+8bODRE= github.com/gliderlabs/ssh v0.3.7/go.mod h1:zpHEXBstFnQYtGnB8k8kQLol82umzn/2/snG7alWVD8= +github.com/go-chi/chi v4.1.2+incompatible h1:fGFk2Gmi/YKXk0OmGfBh0WgmN3XB8lVnEyNz34tQRec= +github.com/go-chi/chi v4.1.2+incompatible/go.mod h1:eB3wogJHnLi3x/kFX2A+IbTBlXxmMeXJVKy9tTv1XzQ= github.com/go-delve/delve v1.23.1 h1:MtZ13ppptttkqSuvVnwJ5CPhIAzDiOwRrYuCk3ES7fU= github.com/go-delve/delve v1.23.1/go.mod h1:S3SLuEE2mn7wipKilTvk1p9HdTMnXXElcEpiZ+VcuqU= github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI= @@ -663,6 +758,10 @@ github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2 github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-ini/ini v1.67.0 h1:z6ZrTEZqSWOTyH2FlglNbNgARyHG8oLW9gMELqKr06A= github.com/go-ini/ini v1.67.0/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8= +github.com/go-jose/go-jose/v3 v3.0.3 h1:fFKWeig/irsp7XD2zBxvnmA/XaRWp5V3CBsZXJF7G7k= +github.com/go-jose/go-jose/v3 v3.0.3/go.mod h1:5b+7YgP7ZICgJDBdfjZaIt+H/9L9T/YQrVfLAMboGkQ= +github.com/go-jose/go-jose/v4 v4.0.1 h1:QVEPDE3OluqXBQZDcnNvQrInro2h0e4eqNbnZSWqS6U= +github.com/go-jose/go-jose/v4 v4.0.1/go.mod h1:WVf9LFMHh/QVrmqrOfqun0C45tMe3RoiKJMPvgWwLfY= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= @@ -690,34 +789,36 @@ github.com/go-ole/go-ole v1.2.5/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiU 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= -github.com/go-openapi/analysis v0.22.2 h1:ZBmNoP2h5omLKr/srIC9bfqrUGzT6g6gNv03HE9Vpj0= -github.com/go-openapi/analysis v0.22.2/go.mod h1:pDF4UbZsQTo/oNuRfAWWd4dAh4yuYf//LYorPTjrpvo= +github.com/go-openapi/analysis v0.23.0 h1:aGday7OWupfMs+LbmLZG4k0MYXIANxcuBTYUC03zFCU= +github.com/go-openapi/analysis v0.23.0/go.mod h1:9mz9ZWaSlV8TvjQHLl2mUW2PbZtemkE8yA5v22ohupo= github.com/go-openapi/errors v0.22.0 h1:c4xY/OLxUBSTiepAg3j/MHuAv5mJhnf53LLMWFB+u/w= github.com/go-openapi/errors v0.22.0/go.mod h1:J3DmZScxCDufmIMsdOuDHxJbdOGC0xtUynjIx092vXE= github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonpointer v0.20.2 h1:mQc3nmndL8ZBzStEo3JYF8wzmeWffDH4VbXz58sAx6Q= -github.com/go-openapi/jsonpointer v0.20.2/go.mod h1:bHen+N0u1KEO3YlmqOjTT9Adn1RfD91Ar825/PuiRVs= +github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ= +github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY= github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= -github.com/go-openapi/jsonreference v0.20.4 h1:bKlDxQxQJgwpUSgOENiMPzCTBVuc7vTdXSSgNeAhojU= -github.com/go-openapi/jsonreference v0.20.4/go.mod h1:5pZJyJP2MnYCpoeoMAql78cCHauHj0V9Lhc506VOpw4= -github.com/go-openapi/loads v0.21.5 h1:jDzF4dSoHw6ZFADCGltDb2lE4F6De7aWSpe+IcsRzT0= -github.com/go-openapi/loads v0.21.5/go.mod h1:PxTsnFBoBe+z89riT+wYt3prmSBP6GDAQh2l9H1Flz8= -github.com/go-openapi/runtime v0.27.1 h1:ae53yaOoh+fx/X5Eaq8cRmavHgDma65XPZuvBqvJYto= -github.com/go-openapi/runtime v0.27.1/go.mod h1:fijeJEiEclyS8BRurYE1DE5TLb9/KZl6eAdbzjsrlLU= +github.com/go-openapi/jsonreference v0.21.0 h1:Rs+Y7hSXT83Jacb7kFyjn4ijOuVGSvOdF2+tg1TRrwQ= +github.com/go-openapi/jsonreference v0.21.0/go.mod h1:LmZmgsrTkVg9LG4EaHeY8cBDslNPMo06cago5JNLkm4= +github.com/go-openapi/loads v0.22.0 h1:ECPGd4jX1U6NApCGG1We+uEozOAvXvJSF4nnwHZ8Aco= +github.com/go-openapi/loads v0.22.0/go.mod h1:yLsaTCS92mnSAZX5WWoxszLj0u+Ojl+Zs5Stn1oF+rs= +github.com/go-openapi/runtime v0.28.0 h1:gpPPmWSNGo214l6n8hzdXYhPuJcGtziTOgUpvsFWGIQ= +github.com/go-openapi/runtime v0.28.0/go.mod h1:QN7OzcS+XuYmkQLw05akXk0jRH/eZ3kb18+1KwW9gyc= github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= github.com/go-openapi/spec v0.19.5/go.mod h1:Hm2Jr4jv8G1ciIAo+frC/Ft+rR2kQDh8JHKHb3gWUSk= -github.com/go-openapi/spec v0.20.14 h1:7CBlRnw+mtjFGlPDRZmAMnq35cRzI91xj03HVyUi/Do= -github.com/go-openapi/spec v0.20.14/go.mod h1:8EOhTpBoFiask8rrgwbLC3zmJfz4zsCUueRuPM6GNkw= +github.com/go-openapi/spec v0.21.0 h1:LTVzPc3p/RzRnkQqLRndbAzjY0d0BCL72A6j3CdL9ZY= +github.com/go-openapi/spec v0.21.0/go.mod h1:78u6VdPw81XU44qEWGhtr982gJ5BWg2c0I5XwVMotYk= github.com/go-openapi/strfmt v0.23.0 h1:nlUS6BCqcnAk0pyhi9Y+kdDVZdZMHfEKQiS4HaMgO/c= github.com/go-openapi/strfmt v0.23.0/go.mod h1:NrtIpfKtWIygRkKVsxh7XQMDQW5HKQl6S5ik2elW+K4= github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/swag v0.22.9 h1:XX2DssF+mQKM2DHsbgZK74y/zj4mo9I99+89xUmuZCE= -github.com/go-openapi/swag v0.22.9/go.mod h1:3/OXnFfnMAwBD099SwYRk7GD3xOrr1iL7d/XNLXVVwE= -github.com/go-openapi/validate v0.23.0 h1:2l7PJLzCis4YUGEoW6eoQw3WhyM65WSIcjX6SQnlfDw= -github.com/go-openapi/validate v0.23.0/go.mod h1:EeiAZ5bmpSIOJV1WLfyYF9qp/B1ZgSaEpHTJHtN5cbE= +github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE= +github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ= +github.com/go-openapi/validate v0.24.0 h1:LdfDKwNbpB6Vn40xhTdNZAnfLECL81w+VX3BumrGD58= +github.com/go-openapi/validate v0.24.0/go.mod h1:iyeX1sEufmv3nPbBdX3ieNviWnOZaJ1+zquzJEf2BAQ= +github.com/go-piv/piv-go v1.11.0 h1:5vAaCdRTFSIW4PeqMbnsDlUZ7odMYWnHBDGdmtU/Zhg= +github.com/go-piv/piv-go v1.11.0/go.mod h1:NZ2zmjVkfFaL/CF8cVQ/pXdXtuj110zEKGdJM6fJZZM= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs= @@ -821,10 +922,12 @@ github.com/google/btree v1.1.3 h1:CVpQJjYgC4VbzxeGVHfvZrv1ctoYCAI8vbl07Fcxlyg= github.com/google/btree v1.1.3/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= github.com/google/cel-go v0.20.1 h1:nDx9r8S3L4pE61eDdt8igGj8rf5kjYR3ILxWIpWNi84= github.com/google/cel-go v0.20.1/go.mod h1:kWcIzTsPX0zmQ+H3TirHstLLf9ep5QTsZBN9u4dOYLg= +github.com/google/certificate-transparency-go v1.1.8 h1:LGYKkgZF7satzgTak9R4yzfJXEeYVAjV6/EAEJOf1to= +github.com/google/certificate-transparency-go v1.1.8/go.mod h1:bV/o8r0TBKRf1X//iiiSgWrvII4d7/8OiA+3vG26gI8= github.com/google/flatbuffers v24.3.25+incompatible h1:CX395cjN9Kke9mmalRoL3d81AtFUxJM+yDthflgJGkI= github.com/google/flatbuffers v24.3.25+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= -github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I= -github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U= +github.com/google/gnostic-models v0.6.9-0.20230804172637-c7be7c783f49 h1:0VpGH+cDhbDtdcweoyCVsF3fhN8kejK6rFe/2FFX2nU= +github.com/google/gnostic-models v0.6.9-0.20230804172637-c7be7c783f49/go.mod h1:BkkQ4L1KS1xMt2aWSPStnn55ChGC0DPOn2FQYj+f25M= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -842,14 +945,16 @@ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-containerregistry v0.20.2 h1:B1wPJ1SN/S7pB+ZAimcciVD+r+yV/l/DSArMxlbwseo= github.com/google/go-containerregistry v0.20.2/go.mod h1:z38EKdKh4h7IP2gSfUUqEvalZBqs6AoLeWfUy34nQC8= +github.com/google/go-github/v55 v55.0.0 h1:4pp/1tNMB9X/LuAhs5i0KQAE40NmiR/y6prLNb9x9cg= +github.com/google/go-github/v55 v55.0.0/go.mod h1:JLahOTA1DnXzhxEymmFF5PP2tSS9JVNj68mSZNDwskA= +github.com/google/go-github/v62 v62.0.0 h1:/6mGCaRywZz9MuHyw9gD1CwsbmBX8GWsbFkwMmHdhl4= +github.com/google/go-github/v62 v62.0.0/go.mod h1:EMxeUqGJq2xRu9DYBMwel/mr7kZrzUOfQmmpYrZn2a4= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/licenseclassifier/v2 v2.0.0 h1:1Y57HHILNf4m0ABuMVb6xk4vAJYEUO0gDxNpog0pyeA= -github.com/google/licenseclassifier/v2 v2.0.0/go.mod h1:cOjbdH0kyC9R22sdQbYsFkto4NGCAc+ZSwbeThazEtM= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= @@ -866,6 +971,10 @@ github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm4 github.com/google/s2a-go v0.1.8 h1:zZDs9gcbt9ZPLV0ndSyQk6Kacx2g/X+SKYovpnz3SMM= github.com/google/s2a-go v0.1.8/go.mod h1:6iNWHTpQ+nfNRN5E00MSdfDwVesa8hhS32PhPO8deJA= github.com/google/subcommands v1.2.0/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk= +github.com/google/tink/go v1.7.0 h1:6Eox8zONGebBFcCBqkVmt60LaWZa6xg1cl/DwAh/J1w= +github.com/google/tink/go v1.7.0/go.mod h1:GAUOd+QE3pgj9q8VKIGTCP33c/B7eb4NhxLcgTJZStM= +github.com/google/trillian v1.6.0 h1:jMBeDBIkINFvS2n6oV5maDqfRlxREAc6CW9QYWQ0qT4= +github.com/google/trillian v1.6.0/go.mod h1:Yu3nIMITzNhhMJEHjAtp6xKiu+H/iHu2Oq5FjV2mCWI= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -977,13 +1086,17 @@ github.com/hashicorp/nomad/api v0.0.0-20240717122358-3d93bd3778f3 h1:fgVfQ4AC1av github.com/hashicorp/nomad/api v0.0.0-20240717122358-3d93bd3778f3/go.mod h1:svtxn6QnrQ69P23VvIWMR34tg3vmwLz4UdUzm1dSCgE= github.com/hashicorp/serf v0.10.1 h1:Z1H2J60yRKvfDYAOZLd2MU0ND4AH/WDz7xYHDWQsIPY= github.com/hashicorp/serf v0.10.1/go.mod h1:yL2t6BqATOLGc5HF7qbFkTfXoPIY0WZdWHfEvMqbG+4= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 h1:S4qyfL2sEm5Budr4KVMyEniCy+PbS55651I/a+Kn/NQ= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= +github.com/hashicorp/vault/api v1.12.2 h1:7YkCTE5Ni90TcmYHDBExdt4WGJxhpzaHqR6uGbQb/rE= +github.com/hashicorp/vault/api v1.12.2/go.mod h1:LSGf1NGT1BnvFFnKVtnvcaLBM2Lz+gJdpL6HUYed8KE= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb h1:PGufWXXDq9yaev6xX1YQauaO1MV90e6Mpoq1I7Lz/VM= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= github.com/hetznercloud/hcloud-go/v2 v2.10.2 h1:9gyTUPhfNbfbS40Spgij5mV5k37bOZgt8iHKCbfGs5I= github.com/hetznercloud/hcloud-go/v2 v2.10.2/go.mod h1:xQ+8KhIS62W0D78Dpi57jsufWh844gUw1az5OUvaeq8= github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM= github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg= github.com/howeyc/gopass v0.0.0-20170109162249-bf9dde6d0d2c/go.mod h1:lADxMC39cJJqL93Duh1xhAs4I2Zs8mKS89XWXFGp9cs= +github.com/howeyc/gopass v0.0.0-20210920133722-c8aef6fb66ef h1:A9HsByNhogrvm9cWb28sjiS3i7tcKCkflWFEkHfuAgM= +github.com/howeyc/gopass v0.0.0-20210920133722-c8aef6fb66ef/go.mod h1:lADxMC39cJJqL93Duh1xhAs4I2Zs8mKS89XWXFGp9cs= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huandu/xstrings v1.5.0 h1:2ag3IFq9ZDANvthTwTiqSSZLjDc+BedvHPAp5tJy2TI= github.com/huandu/xstrings v1.5.0/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= @@ -1025,6 +1138,8 @@ github.com/jarcoal/httpmock v1.3.1 h1:iUx3whfZWVf3jT01hQTO/Eo5sAYtB2/rqaUuOtpInw github.com/jarcoal/httpmock v1.3.1/go.mod h1:3yb8rc4BI7TCBhFY8ng0gjuLKJNquuDNiPaZjnENuYg= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= +github.com/jedisct1/go-minisign v0.0.0-20230811132847-661be99b8267 h1:TMtDYDHKYY15rFihtRfck/bfFqNfvcabqvXAFQfAUpY= +github.com/jedisct1/go-minisign v0.0.0-20230811132847-661be99b8267/go.mod h1:h1nSAbGFqGVzn6Jyl1R/iCcBUHN4g+gW1u9CoBTrb9E= github.com/jellydator/ttlcache/v3 v3.3.0 h1:BdoC9cE81qXfrxeb9eoJi9dWrdhSuwXMAnHTbnBm4Wc= github.com/jellydator/ttlcache/v3 v3.3.0/go.mod h1:bj2/e0l4jRnQdrnSTaGTsh4GSXvMjQcy41i7th0GVGw= github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= @@ -1036,6 +1151,8 @@ github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9Y github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= +github.com/jmhodges/clock v1.2.0 h1:eq4kys+NI0PLngzaHEe7AmPT90XMGIEySD1JfV1PDIs= +github.com/jmhodges/clock v1.2.0/go.mod h1:qKjhA7x7u/lQpPB1XAqX1b1lCI/w3/fNuYpI/ZjLynI= github.com/jmoiron/sqlx v1.4.0 h1:1PLqN7S1UYp5t4SrVVnt4nUVNemrDAtxlulVe+Qgm3o= github.com/jmoiron/sqlx v1.4.0/go.mod h1:ZrZ7UsYB/weZdl2Bxg6jCRO9c3YHl8r3ahlKmRT4JLY= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= @@ -1083,8 +1200,9 @@ github.com/kjk/lzma v0.0.0-20161016003348-3fd93898850d/go.mod h1:phT/jsRPBAEqjAi github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc= github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0= -github.com/klauspost/pgzip v1.2.5 h1:qnWYvvKqedOF2ulHpMG72XQol4ILEJ8k2wwRl/Km8oE= github.com/klauspost/pgzip v1.2.5/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= +github.com/klauspost/pgzip v1.2.6 h1:8RXeL5crjEUFnR2/Sn6GJNWtSQ3Dk8pq4CL3jvdDyjU= +github.com/klauspost/pgzip v1.2.6/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= github.com/knadh/koanf/maps v0.1.0 h1:fYqBfuNiqSu7xkSJDuRdRCyx/iVjyxVInCIIZS2BrdI= github.com/knadh/koanf/maps v0.1.0/go.mod h1:npD/QZY3V6ghQDdcQzl1W4ICNVTkohC8E73eI2xW4yI= github.com/knadh/koanf/providers/confmap v0.1.0-dev0 h1:ocRN64rGNrgf+UAPeFzFSfpZwdAzWEV5BUvn6i0PyUU= @@ -1129,8 +1247,12 @@ github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgx github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= github.com/leodido/ragel-machinery v0.0.0-20190525184631-5f46317e436b h1:11UHH39z1RhZ5dc4y4r/4koJo6IYFgTRMe/LlwRTEw0= github.com/leodido/ragel-machinery v0.0.0-20190525184631-5f46317e436b/go.mod h1:WZxr2/6a/Ar9bMDc2rN/LJrE/hF6bXE4LPyDSIxwAfg= +github.com/letsencrypt/boulder v0.0.0-20231026200631-000cd05d5491 h1:WGrKdjHtWC67RX96eTkYD2f53NDHhrq/7robWTAfk4s= +github.com/letsencrypt/boulder v0.0.0-20231026200631-000cd05d5491/go.mod h1:o158RFmdEbYyIZmXAbrvmJWesbyxlLKee6X64VPVuOc= github.com/liamg/jfather v0.0.7 h1:Xf78zS263yfT+xr2VSo6+kyAy4ROlCacRqJG7s5jt4k= github.com/liamg/jfather v0.0.7/go.mod h1:xXBGiBoiZ6tmHhfy5Jzw8sugzajwYdi6VosIpB3/cPM= +github.com/liamg/memoryfs v1.6.0 h1:jAFec2HI1PgMTem5gR7UT8zi9u4BfG5jorCRlLH06W8= +github.com/liamg/memoryfs v1.6.0/go.mod h1:z7mfqXFQS8eSeBBsFjYLlxYRMRyiPktytvYCYTb3BSk= github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/libp2p/go-reuseport v0.2.0 h1:18PRvIMlpY6ZK85nIAicSBuXXvrYoSw3dsBAR7zc560= @@ -1141,8 +1263,8 @@ github.com/linode/linodego v1.37.0 h1:B/2Spzv9jYXzKA+p+GD8fVCNJ7Wuw6P91ZDD9eCkks github.com/linode/linodego v1.37.0/go.mod h1:L7GXKFD3PoN2xSEtFc04wIXP5WK65O10jYQx0PQISWQ= github.com/lorenzosaino/go-sysctl v0.3.1 h1:3phX80tdITw2fJjZlwbXQnDWs4S30beNcMbw0cn0HtY= github.com/lorenzosaino/go-sysctl v0.3.1/go.mod h1:5grcsBRpspKknNS1qzt1eIeRDLrhpKZAtz8Fcuvs1Rc= -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/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a h1:3Bm7EwfUQUvhNeKIkUct/gl9eod1TcXuj8stxvi/GoI= +github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a/go.mod h1:ilwx/Dta8jXAgpFYFvSWEMwxmbWXyiUHkd5FwyKhb5k= github.com/lunixbochs/struc v0.0.0-20200707160740-784aaebc1d40 h1:EnfXoSqDfSNJv0VBNqY/88RNnhSGYkrHaO0mmFGbVsc= github.com/lunixbochs/struc v0.0.0-20200707160740-784aaebc1d40/go.mod h1:vy1vK6wD6j7xX6O6hXe621WabdtNkou2h7uRtTfRMyg= github.com/lxn/walk v0.0.0-20210112085537-c389da54e794 h1:NVRJ0Uy0SOFcXSKLsS65OmI1sgCCfiDUPj+cwnH7GZw= @@ -1162,18 +1284,18 @@ github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0 github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/martini-contrib/render v0.0.0-20150707142108-ec18f8345a11 h1:YFh+sjyJTMQSYjKwM4dFKhJPJC/wfo98tPUc17HdoYw= github.com/martini-contrib/render v0.0.0-20150707142108-ec18f8345a11/go.mod h1:Ah2dBMoxZEqk118as2T4u4fjfXarE0pPnMJaArZQZsI= -github.com/masahiro331/go-disk v0.0.0-20220919035250-c8da316f91ac h1:QyRucnGOLHJag1eB9CtuZwZk+/LpvTSYr5mnFLLFlgA= -github.com/masahiro331/go-disk v0.0.0-20220919035250-c8da316f91ac/go.mod h1:J7Vb0sf0JzOhT0uHTeCqO6dqP/ELVcQvQ6yQ/56ZRGw= -github.com/masahiro331/go-ebs-file v0.0.0-20240112135404-d5fbb1d46323 h1:uQubA711SeYStvStohMLrdvRTTohdPHrEPFzerLcY9I= -github.com/masahiro331/go-ebs-file v0.0.0-20240112135404-d5fbb1d46323/go.mod h1:OdtzwqTtu49Gh5RFkNEU1SbcihIuVTtUipwHflqxckE= -github.com/masahiro331/go-ext4-filesystem v0.0.0-20231208112839-4339555a0cd4 h1:uHO44vOunB0oEtk+r8ifBbFOD0mr6+fmoyFNCgLE66k= -github.com/masahiro331/go-ext4-filesystem v0.0.0-20231208112839-4339555a0cd4/go.mod h1:3XMMY1M486mWGTD13WPItg6FsgflQR72ZMAkd+gsyoQ= +github.com/masahiro331/go-disk v0.0.0-20240625071113-56c933208fee h1:cgm8mE25x5XXX2oyvJDlyJ72K+rDu/4ZCYce2worNb8= +github.com/masahiro331/go-disk v0.0.0-20240625071113-56c933208fee/go.mod h1:rojbW5tVhH1cuVYFKZS+QX+VGXK45JVsRO+jW92kkKM= +github.com/masahiro331/go-ebs-file v0.0.0-20240917043618-e6d2bea5c32e h1:nCgF1JEYIS8KNuJtIeUrmjjhktIMKWNmASZqwK2ynu0= +github.com/masahiro331/go-ebs-file v0.0.0-20240917043618-e6d2bea5c32e/go.mod h1:XFWPTlAcEL733RUjbr0QBybdt6oK2DH7LZk8id2qtd4= +github.com/masahiro331/go-ext4-filesystem v0.0.0-20240620024024-ca14e6327bbd h1:JEIW94K3spsvBI5Xb9PGhKSIza9/jxO1lF30tPCAJlA= +github.com/masahiro331/go-ext4-filesystem v0.0.0-20240620024024-ca14e6327bbd/go.mod h1:3XMMY1M486mWGTD13WPItg6FsgflQR72ZMAkd+gsyoQ= github.com/masahiro331/go-mvn-version v0.0.0-20210429150710-d3157d602a08 h1:AevUBW4cc99rAF8q8vmddIP8qd/0J5s/UyltGbp66dg= github.com/masahiro331/go-mvn-version v0.0.0-20210429150710-d3157d602a08/go.mod h1:JOkBRrE1HvgTyjk6diFtNGgr8XJMtIfiBzkL5krqzVk= github.com/masahiro331/go-vmdk-parser v0.0.0-20221225061455-612096e4bbbd h1:Y30EzvuoVp97b0unb/GOFXzBUKRXZXUN2e0wYmvC+ic= github.com/masahiro331/go-vmdk-parser v0.0.0-20221225061455-612096e4bbbd/go.mod h1:5f7mCJGW9cJb8SDn3z8qodGxpMCOo8d/2nls/tiwRrw= -github.com/masahiro331/go-xfs-filesystem v0.0.0-20230608043311-a335f4599b70 h1:X6W6raTo07X0q4pvSI/68Pj/Ic4iIU2CfQU65OH0Zhc= -github.com/masahiro331/go-xfs-filesystem v0.0.0-20230608043311-a335f4599b70/go.mod h1:QKBZqdn6teT0LK3QhAf3K6xakItd1LonOShOEC44idQ= +github.com/masahiro331/go-xfs-filesystem v0.0.0-20231205045356-1b22259a6c44 h1:VmSjn0UCyfXUNdePDr7uM/uZTnGSp+mKD5+cYkEoLx4= +github.com/masahiro331/go-xfs-filesystem v0.0.0-20231205045356-1b22259a6c44/go.mod h1:QKBZqdn6teT0LK3QhAf3K6xakItd1LonOShOEC44idQ= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= @@ -1213,6 +1335,8 @@ github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKju github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= github.com/miekg/dns v1.1.62 h1:cN8OuEF1/x5Rq6Np+h1epln8OiyPWV+lROx9LxcGgIQ= github.com/miekg/dns v1.1.62/go.mod h1:mvDlcItzm+br7MToIKqkglaGhlFMHJ9DTNNWONWXbNQ= +github.com/miekg/pkcs11 v1.1.1 h1:Ugu9pdy6vAYku5DEpVWVFPYnzV+bxB+iRdbuFSu7TvU= +github.com/miekg/pkcs11 v1.1.1/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs= github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= @@ -1220,6 +1344,8 @@ github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJJ2JqpQmpLJOu07cU= github.com/mitchellh/go-testing-interface v1.14.1/go.mod h1:gfgS7OtZj6MA4U1UrDRp04twqAjfvlZyCfX3sDjEym8= +github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0= +github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0= github.com/mitchellh/hashstructure/v2 v2.0.2 h1:vGKWl0YJqUNxE8d+h8f6NJLcCJrgbhC4NcD46KavDd4= github.com/mitchellh/hashstructure/v2 v2.0.2/go.mod h1:MG3aRVU/N29oo/V/IhBX8GR/zz4kQkprJgF2EVszyDE= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= @@ -1230,8 +1356,8 @@ github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zx github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/mkrautz/goar v0.0.0-20150919110319-282caa8bd9da h1:Iu5QFXIMK/YrHJ0NgUnK0rqYTTyb0ldt/rqNenAj39U= github.com/mkrautz/goar v0.0.0-20150919110319-282caa8bd9da/go.mod h1:NfnmoBY0gGkr3/NmI+DP/UXbZvOCurCUYAzOdYJjlOc= -github.com/moby/buildkit v0.13.0 h1:reVR1Y+rbNIUQ9jf0Q1YZVH5a/nhOixZsl+HJ9qQEGI= -github.com/moby/buildkit v0.13.0/go.mod h1:aNmNQKLBFYAOFuzQjR3VA27/FijlvtBD1pjNwTSN37k= +github.com/moby/buildkit v0.16.0 h1:wOVBj1o5YNVad/txPQNXUXdelm7Hs/i0PUFjzbK0VKE= +github.com/moby/buildkit v0.16.0/go.mod h1:Xqx/5GlrqE1yIRORk0NSCVDFpQAU1WjlT6KHYZdisIQ= github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0= github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo= github.com/moby/locker v1.0.1 h1:fOXqR41zeveg4fFODix+1Ch4mj/gT0NE1XJbp/epuBg= @@ -1245,8 +1371,8 @@ github.com/moby/sys/mountinfo v0.7.2 h1:1shs6aH5s4o5H2zQLn796ADW1wMrIwHsyJ2v9Kou github.com/moby/sys/mountinfo v0.7.2/go.mod h1:1YOa8w8Ih7uW0wALDUgT1dTTSBrZ+HiBLGws92L2RU4= github.com/moby/sys/sequential v0.5.0 h1:OPvI35Lzn9K04PBbCLW0g4LcFAJgHsvXsRyewg5lXtc= github.com/moby/sys/sequential v0.5.0/go.mod h1:tH2cOOs5V9MlPiXcQzRC+eEyab644PWKGRYaaV5ZZlo= -github.com/moby/sys/signal v0.7.0 h1:25RW3d5TnQEoKvRbEKUGay6DCQ46IxAVTT9CUMgmsSI= -github.com/moby/sys/signal v0.7.0/go.mod h1:GQ6ObYZfqacOwTtlXvcmh9A26dVRul/hbOZn88Kg8Tg= +github.com/moby/sys/signal v0.7.1 h1:PrQxdvxcGijdo6UXXo/lU/TvHUWyPhj7UOpSo8tuvk0= +github.com/moby/sys/signal v0.7.1/go.mod h1:Se1VGehYokAkrSQwL4tDzHvETwUZlnY7S5XtQ50mQp8= github.com/moby/sys/user v0.3.0 h1:9ni5DlcW5an3SvRSx4MouotOygvzaXbaSrc/wGDFWPo= github.com/moby/sys/user v0.3.0/go.mod h1:bG+tYYYJgaMtRKgEmuueC0hJEAZWwtIbZTB+85uoHjs= github.com/moby/sys/userns v0.1.0 h1:tVLXkFOxVu9A64/yh59slHVv9ahO9UIev4JZusOLG/g= @@ -1268,6 +1394,8 @@ github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= github.com/mostynb/go-grpc-compression v1.2.3 h1:42/BKWMy0KEJGSdWvzqIyOZ95YcR9mLPqKctH7Uo//I= github.com/mostynb/go-grpc-compression v1.2.3/go.mod h1:AghIxF3P57umzqM9yz795+y1Vjs47Km/Y2FE6ouQ7Lg= +github.com/mozillazg/docker-credential-acr-helper v0.3.0 h1:DVWFZ3/O8BP6Ue3iS/Olw+G07u1hCq1EOVCDZZjCIBI= +github.com/mozillazg/docker-credential-acr-helper v0.3.0/go.mod h1:cZlu3tof523ujmLuiNUb6JsjtHcNA70u1jitrrdnuyA= github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= @@ -1282,6 +1410,8 @@ github.com/ncw/swift v1.0.30/go.mod h1:23YIA4yWVnGwv2dQlN4bB7egfYX6YLn0Yo/S6zZO/ github.com/netsampler/goflow2 v1.3.3 h1:uheCMgWwbaHnVdsvc2bqbdQe93E73pVF77WGu/kPE7U= github.com/netsampler/goflow2 v1.3.3/go.mod h1:mUjr4ERDTtNUAVtf2EomWHmr6Xvz2N9DahhFkhNnFkQ= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= +github.com/nozzle/throttler v0.0.0-20180817012639-2ea982251481 h1:Up6+btDp321ZG5/zdSLo48H9Iaq0UQGthrhWC6pCxzE= +github.com/nozzle/throttler v0.0.0-20180817012639-2ea982251481/go.mod h1:yKZQO8QE2bHlgozqWDiRVqTFlLQSj30K/6SAK8EeYFw= github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d h1:VhgPp6v9qf9Agr/56bj7Y/xa04UccTW04VP0Qed4vnQ= github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d/go.mod h1:YUTz3bUH2ZwIWBy3CJBeOBEugqcmXREj14T+iG/4k4U= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= @@ -1292,6 +1422,8 @@ github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/oklog/ulid/v2 v2.0.2 h1:r4fFzBm+bv0wNKNh5eXTwU7i85y5x+uwkxCUTNVQqLc= github.com/oklog/ulid/v2 v2.0.2/go.mod h1:mtBL0Qe/0HAx6/a4Z30qxVIAL1eQDweXq5lxOEiwQ68= +github.com/oleiade/reflections v1.0.1 h1:D1XO3LVEYroYskEsoSiGItp9RUxG6jWnCVvrqH0HHQM= +github.com/oleiade/reflections v1.0.1/go.mod h1:rdFxbxq4QXVZWj0F+e9jqjDkc7dbp97vkRixKo2JR60= github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/oliveagle/jsonpath v0.0.0-20180606110733-2e52cf6e6852 h1:Yl0tPBa8QPjGmesFh1D0rDy+q1Twx6FyU7VWHi8wZbI= @@ -1322,120 +1454,120 @@ github.com/onsi/gomega v1.34.1 h1:EUMJIKUjM8sKjYbtxQI9A4z2o+rruxnzNvpknOXie6k= github.com/onsi/gomega v1.34.1/go.mod h1:kU1QgUvBDLXBJq618Xvm2LUX6rSAfRaFRTcdOeDLwwY= github.com/open-policy-agent/opa v0.70.0 h1:B3cqCN2iQAyKxK6+GI+N40uqkin+wzIrM7YA60t9x1U= github.com/open-policy-agent/opa v0.70.0/go.mod h1:Y/nm5NY0BX0BqjBriKUiV81sCl8XOjjvqQG7dXrggtI= -github.com/open-telemetry/opentelemetry-collector-contrib/connector/datadogconnector v0.114.0 h1:cjiWapRbK28GxsZyKCegQOLJCEiwIWEV+INvxrS8HSA= -github.com/open-telemetry/opentelemetry-collector-contrib/connector/datadogconnector v0.114.0/go.mod h1:1Mx3wOciTCjrN9PgVAB4uFBeoqEfyeZEuvpguOasm4s= -github.com/open-telemetry/opentelemetry-collector-contrib/connector/spanmetricsconnector v0.114.0 h1:oA79wMjQSQBKz+X90LD5edNOyaEsewspJRBYgxliEMA= -github.com/open-telemetry/opentelemetry-collector-contrib/connector/spanmetricsconnector v0.114.0/go.mod h1:uk7Z36vhLtevNy5672jGxgzNJA2LND6wmispTuhHCxI= -github.com/open-telemetry/opentelemetry-collector-contrib/exporter/datadogexporter v0.114.0 h1:K1/5bZ5EbmxHH4cfvPo/3sYrHUVnM6H86C0dVkf+6TM= -github.com/open-telemetry/opentelemetry-collector-contrib/exporter/datadogexporter v0.114.0/go.mod h1:XWnw+AWGoINC/fG4urgmiLVXDaYeqkRVLKUJMPqC3Ls= -github.com/open-telemetry/opentelemetry-collector-contrib/exporter/prometheusremotewriteexporter v0.114.0 h1:quLs6NbDeG2x2eLmncaq/P4yvnCPLAelFqXac2eMRSw= -github.com/open-telemetry/opentelemetry-collector-contrib/exporter/prometheusremotewriteexporter v0.114.0/go.mod h1:xX2v2kixYWZbFvnT5re3BGg2pyLy78KSIiMed7P2c/c= -github.com/open-telemetry/opentelemetry-collector-contrib/exporter/sapmexporter v0.114.0 h1:93/S5dh3snAbC81fuGP7c+nn2OhgP59UTrXqmFtK1Ww= -github.com/open-telemetry/opentelemetry-collector-contrib/exporter/sapmexporter v0.114.0/go.mod h1:fyU1pLPKcXDWkUwO075jt1YOjFS/XIZXDwHEV3xy93g= -github.com/open-telemetry/opentelemetry-collector-contrib/extension/healthcheckextension v0.114.0 h1:G7SHyt5TvFSEsiaxyhZdqkjcRoK2rP5wl4a3Mu31JM4= -github.com/open-telemetry/opentelemetry-collector-contrib/extension/healthcheckextension v0.114.0/go.mod h1:TRsDReUh7ALEUutKVoLlGMRc2QECZAyT/5g/cpAr+aw= -github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer v0.114.0 h1:xZL2FLnVTKqVeZQuTBSMmVLr3FQUN/N8x7VL70Gd07k= -github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer v0.114.0/go.mod h1:betAqGGfDFb8SLyMYBwH9BQyB9wzxWOWXXC/Ht6/kas= -github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/dockerobserver v0.114.0 h1:OwLYURmQGKEo9jyhlMsI3JtFLiYChZIrA2M3MxuomTY= -github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/dockerobserver v0.114.0/go.mod h1:1UZtI+tYvVvvKkPv5NmggvPpxkQEyKaUVg2ygtCjVoQ= -github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/ecsobserver v0.114.0 h1:aAobCSGIhUYohlzbMQdfDDtQoKlofPROL3+WSSPxz+c= -github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/ecsobserver v0.114.0/go.mod h1:4m8sQMLNgHexFom7YEFi2khcsUUqKxEdIWgUOYKcmLI= -github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/ecstaskobserver v0.114.0 h1:t59jxlv7dIF+f6SaG8V5mx/+Hxfoy4S5qlMpJlkcPo0= -github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/ecstaskobserver v0.114.0/go.mod h1:HbUoZclDdXYC7L6lvh44olwDpJBIoTw9fls1bjqyMZY= -github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/hostobserver v0.114.0 h1:1TNrKEIfTHAhQDVzQczhReo2+Rw5q9VNCVZgq5SKq/Y= -github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/hostobserver v0.114.0/go.mod h1:3AzBMlWooaEO8LvLWqYQoOhqxQ+fAaUlC09sCicB91s= -github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/k8sobserver v0.114.0 h1:FetZgJSBHH9xw1JKr3Wetek54bpVYkwJrVJJrO271vU= -github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/k8sobserver v0.114.0/go.mod h1:QWdTwjk67PGv3AyMT+8yEQXU3laW+PMLCFE8PSewWkM= -github.com/open-telemetry/opentelemetry-collector-contrib/extension/pprofextension v0.114.0 h1:6g5EvbygaEBqed0rJotGHcfxgxGV8hSN/4ZoZFfac5M= -github.com/open-telemetry/opentelemetry-collector-contrib/extension/pprofextension v0.114.0/go.mod h1:gU87iMdDAdHrQQCWTURbrlE/dLYgFecJ/+WBHuNMjQI= -github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage v0.114.0 h1:mchuc816TxLpmsGvFbtGA3KBVx91vAXi7vJnlvsQdiU= -github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage v0.114.0/go.mod h1:vgCMUWPVrfjNux9P9G053fRqGFF6BS3xtxNFZZdFTCM= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/ecsutil v0.114.0 h1:4qELD/ZwgvXE5PshGzJ9Eu+JEQdLIok6V1x8rvqL+yk= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/ecsutil v0.114.0/go.mod h1:3U1KoAsmQd9H37t8VkesFfB56tThrPsNVG+ddsMJ2zM= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.114.0 h1:0LbaoE7Aof8J4CVQ5kYv1QbuL3usTxLRSMFisDNBX9U= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.114.0/go.mod h1:ByoGXMLeHE/k5ELO3EITitVmvq3bh4Z/GVwWZZxrQ5s= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.114.0 h1:d2wCLlENxH4I2axQWaogivx/5ZIjDYgn9MIf6sFxlJ4= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.114.0/go.mod h1:Psyligv8GKL9WI3TraW3BLwkOX4TRxaaa1BBQQyICzA= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/docker v0.114.0 h1:AReCF/mzq8+1BORde9m96xAZ+nnv22/B1b+H56hlFIs= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/docker v0.114.0/go.mod h1:dCQeeAQww9++hvoqQ69QzTN6SGbq3DoVs1+Z1wcKAX8= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter v0.114.0 h1:WrVBqO/ps3KvUyEhtdL/uDDHhKoszLEE1ywDbwskNRg= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter v0.114.0/go.mod h1:JYklzR+ZxQaxjzlfJP3bxX6rQFl/Hbo0vd3yNj/1s1s= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8sconfig v0.114.0 h1:dtW9JkkpAm33Y47estFyqEL0CW05DHGmlLQxZUSx78w= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8sconfig v0.114.0/go.mod h1:FcClDm9XVV5tzUDzmH2Mhe6TfYiZ/3GSAQITnuCjZgg= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8stest v0.114.0 h1:Lgk9OkyDQQYWtfZ3DEyfQ+08NM4+dBO3fP0OQN10cXA= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8stest v0.114.0/go.mod h1:2/6/eY8Uvg+NfYDsAbND96A4u5q4UjcDlBJolYcj6jE= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/metadataproviders v0.114.0 h1:cGJRIzB5N3oe1c8vD5HqCuy4dbQE9EDJZ9C7vJn+K8U= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/metadataproviders v0.114.0/go.mod h1:p53t8aSCVoTKXVOsNx62rDLrSdEkBFB4H85yEiTWkyI= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/pdatautil v0.114.0 h1:lt87gwZaUP9Lh0EAgZFTYego0k89NU8K6Qkk82oR/n8= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/pdatautil v0.114.0/go.mod h1:nxxBsX9Z2Q7HQvybUTx8CzUvYCJewKBM1Eys6SiS0eg= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent v0.114.0 h1:TrGpqqMJxh5fTzdu5HZORKvDiIUBK8b9K/3zUCGbjps= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent v0.114.0/go.mod h1:mw+aVzR/3HtuGZE5xM6zEXHFv411QG8MxI8mQFJSd5c= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/splunk v0.114.0 h1:2uThKlp4NoQbIm7k9ZRGCKVJjMcibffb8NLcsPslq9o= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/splunk v0.114.0/go.mod h1:jSpHMXCxgNLBIfselixqXAUn0pXDfE5LEuNkz0WjK68= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/batchperresourceattr v0.114.0 h1:Z+WmSDshEjfNy09A7+opWO01L5LwkZC3Ze9AgfLfuAk= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/batchperresourceattr v0.114.0/go.mod h1:p58MQDR97vRdpY8vh6JuCqjKp0W+kpo5qHmuqhd7L00= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/datadog v0.114.0 h1:Wq1iTmd0K1SSOIA43Wy2uAU6SB4f9ogyN3ZmvDgTURg= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/datadog v0.114.0/go.mod h1:VCj9H0QxRBWSgbl1pUo8p0NrqnmcxpPo0QjKLFtWkO0= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/experimentalmetricmetadata v0.114.0 h1:lvpwitQL0CDKHyExi+Wi0MPXGBjpgK5YbXljRYE6YTU= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/experimentalmetricmetadata v0.114.0/go.mod h1:/peNiVTNFe3osINRwW88WB0v5BC1ifjEmDL5oui+ry0= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden v0.114.0 h1:SXi6JSSs2cWROnC1U2v3XysG3t58ilGUwoLqxpGuwFU= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden v0.114.0/go.mod h1:LSd6sus2Jvpg3M3vM4HgmVh3/dmMtcJmTqELrFOQFRg= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl v0.114.0 h1:G6U2eHR2CGSYb2btot6l05o+mdqsC0ZN7dH8QssXSdk= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl v0.114.0/go.mod h1:kZQvVVzpahX8kFUfEBmzFtDhkKAQW6i8XQCMozDRUlk= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.114.0 h1:m8uPYU2rTj0sKiYgzCvIPajD3meiYsu+nX0hplUnlEU= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.114.0/go.mod h1:P0BaP92pXPkTyTmObfLYUoRBfMYU+i0hdS3oM1DpGJo= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.114.0 h1:Qg80zPfNMlub7LO07VMDElOu3M2oxqdZgvvB+X72a4U= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.114.0/go.mod h1:5qsGcjFV3WFI6J2onAlkR7Xd/8VtwJcECaDRZfW4Tb4= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/resourcetotelemetry v0.114.0 h1:PwUMZ6fHMEUV5i9hUly+z3UujDTTdxQtWzL0rWc/lgA= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/resourcetotelemetry v0.114.0/go.mod h1:YEHL6w4vvB9b0/lNwGjz8DyWXTF/7Xw0Hkgc3mGWwa8= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/sampling v0.114.0 h1:mtSN/07RGQPi1/zHVSZg4G0qRtOoJpPew5jsQWv9uS0= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/sampling v0.114.0/go.mod h1:C9Zgh/N3j4NR2D+1FGAA1YizhFW9OS51DwLUFJTdXN4= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza v0.114.0 h1:Xr3Hvm9cxOSQX94tLX1yX63uvuvtglJICrOz9YcxiuI= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza v0.114.0/go.mod h1:cgIgmEg66RhVtAv4JkIhHdy70kn2EtVhrH8CtyvhfuI= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.114.0 h1:WymtAsFHYen4GTTTXvVqZCoMz6vPADYUf4xIP0Gvm+E= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.114.0/go.mod h1:FcTNci+LpU5x5FkHM0Su3k6/ESDHWQsL30AFISzaIyk= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheus v0.114.0 h1:eJxap/u8Q5wYnBcJTrTS1Tq6wq31SOlIr+FMJX5ZoC8= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheus v0.114.0/go.mod h1:H7uIA2RBaxit2mSwSU8Wc7QXSJX7r8UR66YvdcLmtto= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheusremotewrite v0.114.0 h1:tG98F8g5T7lKYaoxSh9e76agmkauPtXiMbQhuWAeG+I= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheusremotewrite v0.114.0/go.mod h1:eN3xPxPcRZH0wofEQ1Greu1c561qEGeYv5Zt0uedmMM= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/zipkin v0.114.0 h1:xDbTY8zDUP3RKG1kg1tmULnBkLEDMwmSpf9j2H0sIcc= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/zipkin v0.114.0/go.mod h1:t5uoTcckI8kQeW1sZl8A+1UebVJPe47Qi3WQeNZu6w4= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/attributesprocessor v0.114.0 h1:fltPkjMuiVTtIVwoWUzbL0ad2CTCJsWfnCSDJQ9hSxU= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/attributesprocessor v0.114.0/go.mod h1:HcG364Is9u2EDqOUtQX0RwnbHtQqSh5+x2FdcYC+F1M= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/cumulativetodeltaprocessor v0.114.0 h1:rYwgdR8GE7QEtQlkQxXq5f1JQrd3v36g4yXXljicKoM= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/cumulativetodeltaprocessor v0.114.0/go.mod h1:TjEgPVMRxi93SdN0N0qv0hx5L+FF2csgo3YwfzVGJ3g= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/filterprocessor v0.114.0 h1:QBR07Gaw6ePkufQ/AhHgBv4OlwzXlULTdiUnaKIlvLk= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/filterprocessor v0.114.0/go.mod h1:coY0CV/sNj1hltRXKZr2gnrLvr7xUbnW+GhpCQpGR/Y= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/groupbyattrsprocessor v0.114.0 h1:ap7EK1GxLHau1jKJP8tYcZDb+tEntzx2Kj97XdNb7s4= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/groupbyattrsprocessor v0.114.0/go.mod h1:1uyslltGfwWhG7F/t41t43dBzrZpEkFzo2hR0OmyZi4= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/k8sattributesprocessor v0.114.0 h1:nldvWnYvTjIDi1xmZKgS2b0vz0Ja9UMV2m7ffg/HMDk= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/k8sattributesprocessor v0.114.0/go.mod h1:yRuZU0Rd/twuSQFme3WiVB7x9ECgIEwDBs2mPwkqUYY= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/probabilisticsamplerprocessor v0.114.0 h1:I4ZYVRYW3Cjb65sPENZ9kHam/JUMXNEp2n/knJ0C0Vc= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/probabilisticsamplerprocessor v0.114.0/go.mod h1:4BhyIaOn2LS48WS+ZNix4TpP0+goq9gDEtGzth5Cr3M= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.114.0 h1:ttRj/3GIpg+vUTeBI+EBeeWdNuvBT3S/ayoqpvA9B9s= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.114.0/go.mod h1:xoJgFdZUIxlvF8eUHIYiZGmf39zAwditW3sc2SBirAo= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourceprocessor v0.114.0 h1:je7Aiyn5AHAcpCNpTN5Q4l2SIeqJEvtOjoaZhHszGrs= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourceprocessor v0.114.0/go.mod h1:cVG4aXgfQFSdSfhAgoawDmmKixogjlvqQtmjmqVJgb4= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/routingprocessor v0.114.0 h1:AsYYMzt+ZGGQaq3S21REATxZsUI4aOuFAOPq09tSPnI= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/routingprocessor v0.114.0/go.mod h1:ifqisebKudvS+YARMbFRyX8/UgdXitSfCD1JCoGOxlY= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/tailsamplingprocessor v0.114.0 h1:NrD8Qo2CxrHRAlLuOHm75RtO1xEnul6DDkn6tQMsuSg= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/tailsamplingprocessor v0.114.0/go.mod h1:XOlJzIYwicEPMxu6Gv9TL9pS6El+ffjQOAu/wPiL+Jg= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor v0.114.0 h1:lKG7Ghtba2l9P4FFP7I+SbVRqHEpXCGOZs367YTEwGc= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor v0.114.0/go.mod h1:5U/lrnkK5YtIeTFXI8OzDN/d827WtI6pQvu7/59pUVA= -github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filelogreceiver v0.114.0 h1:Ivu3DRhbERboPxMJeyJpmretbKDJ3hsOAGBQXt2yY3U= -github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filelogreceiver v0.114.0/go.mod h1:UrMGrA8bA1VeYhdiam7/Xu/U4joG6JftMULEVWLDbe0= -github.com/open-telemetry/opentelemetry-collector-contrib/receiver/fluentforwardreceiver v0.114.0 h1:Yx0RUwviLdYyozkuqbfpEhSH+ehXlKsW5TtlZbiKm4Q= -github.com/open-telemetry/opentelemetry-collector-contrib/receiver/fluentforwardreceiver v0.114.0/go.mod h1:Bh9h5hYTgr/zQgXUnvihkLvN1IMmVY/OFa8aHc3gMJU= -github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver v0.114.0 h1:kSxkZPWBA6je7xXkpMWycjyc2BIMvLGD+OGTIRtJ0xw= -github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver v0.114.0/go.mod h1:rBegsrFk6WSDU4v9TiOvH3h7xintiOhPq9qd+72SlK8= -github.com/open-telemetry/opentelemetry-collector-contrib/receiver/jaegerreceiver v0.114.0 h1:1NeG/cgiqBMWQJxFvWQmWo9BVj3k4uOvEK0o++BFINY= -github.com/open-telemetry/opentelemetry-collector-contrib/receiver/jaegerreceiver v0.114.0/go.mod h1:skPwfv1xYwB5onG9sj31J4OYUxx6p+wc40aogGy+nVE= -github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusreceiver v0.114.0 h1:gdljk66vBTT3lWfSdP4Hl7FaABdH1YPhUCH6jnG2+qY= -github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusreceiver v0.114.0/go.mod h1:T1p6ShTr8farkE4qUB2TyGUIvRSN3s17D0qY7rMqCRM= -github.com/open-telemetry/opentelemetry-collector-contrib/receiver/receivercreator v0.114.0 h1:PwaceYEl50C1OK5MxpH95hnn58CNRzINP2p5YvluZj4= -github.com/open-telemetry/opentelemetry-collector-contrib/receiver/receivercreator v0.114.0/go.mod h1:FrJqdSI+4QuU/w9XtoW9d1Ywp09u2cYaPUOZFqzDtNY= -github.com/open-telemetry/opentelemetry-collector-contrib/receiver/zipkinreceiver v0.114.0 h1:E686MeQcQ+a3Q47A/xAc3Nk6Qdz8wHcBLMJ3Y8bNKi0= -github.com/open-telemetry/opentelemetry-collector-contrib/receiver/zipkinreceiver v0.114.0/go.mod h1:zkQAapuNRobj7GY8kKRal+2EYkAMWmZ1KMysUrQI48A= +github.com/open-telemetry/opentelemetry-collector-contrib/connector/datadogconnector v0.115.0 h1:Xkfl44ZRgkz1EoCCYgwPomQkV+BrYOPvv9v1Kd1gZE4= +github.com/open-telemetry/opentelemetry-collector-contrib/connector/datadogconnector v0.115.0/go.mod h1:Sr/upBdJeJ7nxDfmCFCl9iHosXiPoQCPHkCJslDyoUA= +github.com/open-telemetry/opentelemetry-collector-contrib/connector/spanmetricsconnector v0.115.0 h1:sO4fPw0NRUibgBVvQVTqPBCBRFh0I+ODIr3HAwcWezI= +github.com/open-telemetry/opentelemetry-collector-contrib/connector/spanmetricsconnector v0.115.0/go.mod h1:HqzCXJ4rxXzWNYaUtCqJzXyTsCGEKSa/d+tHcyeRDY0= +github.com/open-telemetry/opentelemetry-collector-contrib/exporter/datadogexporter v0.115.0 h1:qtct9PsKONY6YOMc+QGBE/uGs8KMBcF6mvYJbyFHFt8= +github.com/open-telemetry/opentelemetry-collector-contrib/exporter/datadogexporter v0.115.0/go.mod h1:OR9DKWrSRpfc3+CxwsL2QTOuHD03S9w0Jubi3EhTcy4= +github.com/open-telemetry/opentelemetry-collector-contrib/exporter/prometheusremotewriteexporter v0.115.0 h1:u7Ht+E1ghQESffcjyaxWrXGsfSWa1VE9LKC4f2PPx84= +github.com/open-telemetry/opentelemetry-collector-contrib/exporter/prometheusremotewriteexporter v0.115.0/go.mod h1:r3iS2mDYu+cnGjgNc8TgvuUUAN6A6/1BvR1e1YJBrqM= +github.com/open-telemetry/opentelemetry-collector-contrib/exporter/sapmexporter v0.115.0 h1:RXYLbv2uTJlJTJcEa5H8/fLdX419XUlbn6mjzEgTWxc= +github.com/open-telemetry/opentelemetry-collector-contrib/exporter/sapmexporter v0.115.0/go.mod h1:ngeyITKu+koaagA/sFpnuT+x0nFVBNdWq60/h5buSr4= +github.com/open-telemetry/opentelemetry-collector-contrib/extension/healthcheckextension v0.115.0 h1:51D/x3xIAnWgVrY0lgdU+b+yb2aWd72uDqu9GhjRcNI= +github.com/open-telemetry/opentelemetry-collector-contrib/extension/healthcheckextension v0.115.0/go.mod h1:nLau1YUdjhtLrk4jXLPb2l9riQ1Ap4xytTLl7MBedBg= +github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer v0.115.0 h1:eJk/gbfWpGKTIGLUN+EWpqM52Zf4LFTfIeMnDji+dqM= +github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer v0.115.0/go.mod h1:+GPzqBFeqV90U4/bntDRPMxo/i/12lxH7GyPJmqz4ls= +github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/dockerobserver v0.115.0 h1:790+/iSYt6bMs/OA3AfLlZl9E/Zpb0pm5X628TCncE4= +github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/dockerobserver v0.115.0/go.mod h1:LtsKKBDZyn02DiqvuOZapGg75P/FqGQNelTI6fO12o0= +github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/ecsobserver v0.115.0 h1:BtYrSkQSYGJufsmbqqrpzb+BJXH2S4CKL14i1bxOFCU= +github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/ecsobserver v0.115.0/go.mod h1:4LQ1S3eBu+MyCNaCkBk0hIoAhvJJS851i/tY45FtDf4= +github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/ecstaskobserver v0.115.0 h1:zi0LLZp26hAycIKNbmOIMGc0ZnkikrciTHl1tiJuo4Y= +github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/ecstaskobserver v0.115.0/go.mod h1:a/UMjV9mrFJ5WIlpaDQ/S5KgCrg0H3kD8nlhfQRxfBI= +github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/hostobserver v0.115.0 h1:5PiDmieivpExBd2LchzSIvEls+cjUeJtPLXvvHxLZoI= +github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/hostobserver v0.115.0/go.mod h1:FIFNtgEoqcI/evvgSL+5qO/cdRUK+6ixFKKUdKpmMeA= +github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/k8sobserver v0.115.0 h1:sMHHN4HrakORqrpsTLQQVGiDjKg4QreBJ+UCx/1OI+I= +github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/k8sobserver v0.115.0/go.mod h1:q1950sX5QqCGDurVOkwatDSc5de4gpGfuPGVtFgNo3I= +github.com/open-telemetry/opentelemetry-collector-contrib/extension/pprofextension v0.115.0 h1:HVGG31WeB6Fn2+il2/ycWj9tDP0fxOeOqD1rKCjsBSc= +github.com/open-telemetry/opentelemetry-collector-contrib/extension/pprofextension v0.115.0/go.mod h1:2hYojHs5daPVWECuZsPViKwty0ojuHUEmk8GEuaFqO0= +github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage v0.115.0 h1:4Ycg73pYVdiF+oq+BmUq7Dkg0WKeKvBSk9AOKvBe4LU= +github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage v0.115.0/go.mod h1:l2Q+MmYk2ZRDSbhX9GlJYvBXC51AqhDJAj2ne290Xik= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/ecsutil v0.115.0 h1:SF3gOOEkfntE3zEhY80yO7BVQ5CkaK8ecic2U2AZPHE= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/ecsutil v0.115.0/go.mod h1:jeBzX5m8O9X0LQxiryV9sJUIrn+QAwOnCBE2wZWIltQ= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.115.0 h1:vRQQFD4YpasQFUAdF030UWtaflSYFXK542bfWMGhOK0= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.115.0/go.mod h1:BZ7DT+0VkKR7P3I9PGEDfVa0GdB0ty41eEcejIUXF9A= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.115.0 h1:a36EJz/mb83f6ieX0v4fNDJ1jXqpeaM6DVQXeFDvdhw= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.115.0/go.mod h1:r5/40YO1eSP5ZreOmRzVOUtDr7YG39ZIUcVjHd+9Izc= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/docker v0.115.0 h1:xITYM8BkEgs2Wf+PczOrVv0b1Fk4N929/xR9YtxLpkw= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/docker v0.115.0/go.mod h1:m+5tYnZKfNDtnZKknOfssYSXBEL5Yqse4CJMpaY5kMk= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter v0.115.0 h1:h6zEsBtuZalQu7lKYf6ZCcj8fTocT+zxdmuOou9515Q= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter v0.115.0/go.mod h1:6QU/K0dGCGYorkOvJmhbDFCspy4RPxRkFjf9I64y6I0= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8sconfig v0.115.0 h1:f/HrZgTf6TF97v67uEZB3v2UtBT9aQojBvnloD3LOm4= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8sconfig v0.115.0/go.mod h1:Hp9uSq3qNJqdxu24u7RWyuPT9x1GgEUSx9US1LLeLi0= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8stest v0.115.0 h1:vXDJE8YHfAoYIAlPRtODchlqb6lWnGhJxPaT2ljvN7I= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8stest v0.115.0/go.mod h1:f3IgMFHIjEUEI/I+5e3KWMPq9h2PSMy9WovmvPdmlb0= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/metadataproviders v0.115.0 h1:4RoU3SlcNe6Dxyxfv8JVsrN8QgjBQ44Pkt9FLKK095I= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/metadataproviders v0.115.0/go.mod h1:jfPlBpZT+hvp52Ldcx+srxaqyYuKxBkxOd3KtxbveCU= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/pdatautil v0.115.0 h1:8A+iBT5G23zvBPqYx32Qh4800jHFo4X9T1fpQKVQ+4E= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/pdatautil v0.115.0/go.mod h1:AhdPvwYKu7G8LKRWzHTNQYBq27RinsMm5qSanwSA/rU= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent v0.115.0 h1:MuyDWyVoCty8HyP2CAYoRZXwINiThHovcC1Bj3+H8lk= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent v0.115.0/go.mod h1:asekVnrdzYsMJBaJtIyXOt8p07l1x0xs8X3h00sZyf0= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/splunk v0.115.0 h1:6GIJOSEIWBt9bprARMtTjRlENrwNsJl2UzbtjOBk7A0= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/splunk v0.115.0/go.mod h1:/Fg/itwlAzDjyM0Sjenup9TbdOT+aVNPSqXsF80M8hw= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/batchperresourceattr v0.115.0 h1:l4NBxl2AELPlyqupLu1IVAjtbGOEovaKEyt0UGMsuq8= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/batchperresourceattr v0.115.0/go.mod h1:j1qF1hE/Qcy2I655yXbf2ItezXok61OW+9AAxbH2ORw= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/datadog v0.115.0 h1:WOqt8NpU/JPGYDR4CiWx7g/sHV6Oe9FChzhushwmVdo= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/datadog v0.115.0/go.mod h1:wV/+iU7MyXcyTaY8K5Qx+1Z3yUzrxA40nydPQA476Iw= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/experimentalmetricmetadata v0.115.0 h1:l9AsnVHr3Sp4lAGFlBJ6Ochl7mlPE0d5MNd70o4qKEM= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/experimentalmetricmetadata v0.115.0/go.mod h1:kARk81QZpcX6L8x4fLo4Nr/z/+jpo5PxXtugBxF2DyE= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden v0.115.0 h1:Z9p78zj9Qblw472mGkPieuX7mqduAp47rzMbFfq5evI= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden v0.115.0/go.mod h1:mtxUxJEIQy27MaGR1yzcn/OK8NoddEgb7fumpEbKYss= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl v0.115.0 h1:qdZ9EqmdM19pWhPoFA7VivBTdzP2HvNwXa3CCMHYoDQ= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl v0.115.0/go.mod h1:mrL1MNrcg0zYAJ+aK9WtOH062dl2wN9DDG7mZk9H8v4= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.115.0 h1:MerLKMrkM4YoGF6Di0D9yMXO02yCX8mrZAi/+jJVVeI= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.115.0/go.mod h1:R8AkVWe9G5Q0oMOapvm9HNS076E3Min8SVlmhBL3QD0= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.115.0 h1:WEqcnWSy9dNSlGb8pYRBX7zhaz2ReyaeImlenbzNTB4= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.115.0/go.mod h1:6Mk71CakHUA3I6oM9hARDiyQypYyOolvb+4PFYyVEFg= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/resourcetotelemetry v0.115.0 h1:eoapW0JBablApkdv4C1RUuOKfz0U6SwuKMYYSAJH6fE= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/resourcetotelemetry v0.115.0/go.mod h1:hW2AaybTRcwxJySGLC3Fh1vd2VDaQhRBfa7O7w30NS8= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/sampling v0.115.0 h1:R9MRrO+dSkAHBQLZjuwjv2RHXHQqF2Wtm1Ki0VKD5cs= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/sampling v0.115.0/go.mod h1:rKXLXmwdUVcUHwTilroKSejbg3KSwLeYzNPSpkIEnv4= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza v0.115.0 h1:7tQ+WjojXhtWDFTJlwCvkjpvdTed5YkVKVQKVAu1alg= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza v0.115.0/go.mod h1:iqgJP7+N03pOIOqYaKjVWYoIKweNdFivsvWJfFw6MTQ= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.115.0 h1:rrIm0dyEdaHmQo6udPK1V3opkzEKa0PrZzSdY5oGqmQ= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.115.0/go.mod h1:AMeisxL/9gs0bzozaymUqI1/EJ9GPvtnLh/BtqtjSF8= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheus v0.115.0 h1:KghgAubxdDqP4eUQ+d2GzHXUAwtFxpSDToqFVnax0XA= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheus v0.115.0/go.mod h1:cW/BaYE6Uo7ZYHbmT0wVBktHP0SfeLqGHMf0qks7rOE= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheusremotewrite v0.115.0 h1:ioGiKiO0WqT3PxkzanuJsPVA24FItH6nTJeDeSMFpYA= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheusremotewrite v0.115.0/go.mod h1:x1W4J+pzK/Bi9jjYBYESTsPq0nRJJLZoN7cPNd0vYSU= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/zipkin v0.115.0 h1:A9zqBtUJZ5J/0VI+B1dxuQhc2iVYpD9c54SgaKtFIN8= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/zipkin v0.115.0/go.mod h1:hG7GOrBBux/cg1fAUzvSlzYY02ekxjF9IvH4ls/nGXA= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/attributesprocessor v0.115.0 h1:hAsK9I081ShnSDSKPVEHB3TLawyOmbR6bPDiQEkgo2Y= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/attributesprocessor v0.115.0/go.mod h1:z8XdvlhXSYVboxS3TPGembE9kfxLAYH2PxPLMvf8wTk= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/cumulativetodeltaprocessor v0.115.0 h1:t3BGnPpmeuxW51vISSu51PrAs49ACBCa1Yl1NfZGE5Y= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/cumulativetodeltaprocessor v0.115.0/go.mod h1:jQLYyroEYEV1kWJApmGBgVuGUd73v+Q6EUJ6Wy7N508= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/filterprocessor v0.115.0 h1:ficXJmB6l6kfiu+R6CmggtnlQWMHUNzu2csDYA4CFSs= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/filterprocessor v0.115.0/go.mod h1:ykraxSeEVCuA43oqlMWnex78+vNQ+1dBTJUeInkqIpA= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/groupbyattrsprocessor v0.115.0 h1:LVe/Oh2un9CFKFYtepB9oZ6j38whFPVYl01RAVsdxHg= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/groupbyattrsprocessor v0.115.0/go.mod h1:mGSGQCX5dT5KUxBkuCO15CNqB+8Cb+qj0edt/oKmA34= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/k8sattributesprocessor v0.115.0 h1:6RGhDlZkekmp12EvK6JV9fiIwrdZBOJID6/Ts9tXzL4= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/k8sattributesprocessor v0.115.0/go.mod h1:qZRQtGr/DAjuBqAuKJMN2cWvc9RI94lB0Oq8UyGAduo= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/probabilisticsamplerprocessor v0.115.0 h1:vwZQ7k8oqlK0bdZYTsjP/59zjQQfjSD4fNsWIWsTu2w= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/probabilisticsamplerprocessor v0.115.0/go.mod h1:5ObSa9amrbzbYTdAK1Qhv3D/YqCxxnQhP0sk2eWB7Oo= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.115.0 h1:jQ6mIXhWqXhl8MPun9soNynsQ0lpOpOYQyAnQ28F014= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.115.0/go.mod h1:oRxNwm6HN7ckp4aJOAFC8BVBPa0UDhB8vNGTFL3QBJg= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourceprocessor v0.115.0 h1:KbfjEsr2d/5TGWHvcaBC3lOpYAnquEraLXcis4IamAs= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourceprocessor v0.115.0/go.mod h1:fmtZPK5RIz+2Lcm9xQZuwiM+M8/juSSeJufSxUT+J9w= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/routingprocessor v0.115.0 h1:Ea5v0Q6VNIMRbXVJjHUsSbdOSkB+80sCOH7Y9yhStnY= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/routingprocessor v0.115.0/go.mod h1:IkiZL9vOU8qNCkrnJP0GOWPoFTED+yhB94wJbcLYcGA= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/tailsamplingprocessor v0.115.0 h1:olyiml73slGYORDjZNViW3nKiysC+K+h5yPsSBjUxQ4= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/tailsamplingprocessor v0.115.0/go.mod h1:N00k1mTxzfS2clqxSP4Dxk7iX8GWbbuCq6LF8/ECk/M= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor v0.115.0 h1:sLRTfXUFiqJ5Qe/NN5MUJxTaFt46E0Y/xjSY+KesCQc= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor v0.115.0/go.mod h1:361IqXD4jnfs6G+Yn7978uv1UNozhZo4yBYy4p6Nqzc= +github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filelogreceiver v0.115.0 h1:JSFnfWwlVGLul8p9DE6Sk6E0zaqCvbys7CqvJQD4MIs= +github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filelogreceiver v0.115.0/go.mod h1:cw0qzwXzKKxM7QyDcNSp9OSDLySVXyaSrgdqWPqlDk8= +github.com/open-telemetry/opentelemetry-collector-contrib/receiver/fluentforwardreceiver v0.115.0 h1:2xlgF/vCUsZx9HDqhDi0XyR1QXBM67YFRyWrEq5Ydos= +github.com/open-telemetry/opentelemetry-collector-contrib/receiver/fluentforwardreceiver v0.115.0/go.mod h1:vWTdohkLm9S+3Ekz4aq1jW0xt8wD2jrdOOSOJNllppo= +github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver v0.115.0 h1:XDlXWa6pdAp02kdfZdzZ0cjeZMNHjI7dj2dNgKdzOfo= +github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver v0.115.0/go.mod h1:Zo6YARAWAMCdlUmyKBq0EcuKmLjxfC2hUNd3jIAFsWE= +github.com/open-telemetry/opentelemetry-collector-contrib/receiver/jaegerreceiver v0.115.0 h1:hYNlyUj3F43cuv1ap19NlEEchQfs91vYeNoQ1+nswLo= +github.com/open-telemetry/opentelemetry-collector-contrib/receiver/jaegerreceiver v0.115.0/go.mod h1:1o6wF5HJdpb2hd2eGMoQhGuTKb4F2+j/IHBJJSPdM2w= +github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusreceiver v0.115.0 h1:GIyMUiud3T8nyCJP9KVhxVKvfcNQRBCde5uTCl6K/i0= +github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusreceiver v0.115.0/go.mod h1:x4hCznyUolxGt5cE/uXWRCckdIDrUYqH5hJddvdKZd4= +github.com/open-telemetry/opentelemetry-collector-contrib/receiver/receivercreator v0.115.0 h1:Di0uc2QvwEVrq1PEReZ34FpPuo1z5QhHmT0bvdTe0DU= +github.com/open-telemetry/opentelemetry-collector-contrib/receiver/receivercreator v0.115.0/go.mod h1:ODvjmz18PDQnX/BruQ8IFOpiz/HdGOpUWMEKq7f3nhA= +github.com/open-telemetry/opentelemetry-collector-contrib/receiver/zipkinreceiver v0.115.0 h1:h/HAHLIZnIyu85l8wOeggOyiI8z8citNAqxQktVKUpk= +github.com/open-telemetry/opentelemetry-collector-contrib/receiver/zipkinreceiver v0.115.0/go.mod h1:iEU0NA/i2sUREqD19JYmjKwrjMUTcddad/h1LGdSMHw= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.1.0 h1:8SG7/vwALn54lVB/0yZ/MMwhFrPYtpEHQb2IpWsCzug= @@ -1453,6 +1585,8 @@ github.com/openshift/client-go v0.0.0-20210521082421-73d9475a9142/go.mod h1:fjS8 github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= +github.com/openvex/discovery v0.1.1-0.20240802171711-7c54efc57553 h1:c4u0GIH0w2Q57Pm2Oldrq6EiHFnLCCnRs98A+ggj/YQ= +github.com/openvex/discovery v0.1.1-0.20240802171711-7c54efc57553/go.mod h1:z4b//Qi7p7zcM/c41ogeTy+/nqfMbbeYnfZ+EMCTCD0= github.com/openvex/go-vex v0.2.5 h1:41utdp2rHgAGCsG+UbjmfMG5CWQxs15nGqir1eRgSrQ= github.com/openvex/go-vex v0.2.5/go.mod h1:j+oadBxSUELkrKh4NfNb+BPo77U3q7gdKME88IO/0Wo= github.com/openzipkin/zipkin-go v0.4.3 h1:9EGwpqkgnwdEIJ+Od7QVSEIH+ocmm5nPat0G7sjsSdg= @@ -1462,12 +1596,12 @@ github.com/outcaste-io/ristretto v0.2.3/go.mod h1:W8HywhmtlopSB1jeMg3JtdIhf+DYkL github.com/ovh/go-ovh v1.6.0 h1:ixLOwxQdzYDx296sXcgS35TOPEahJkpjMGtzPadCjQI= github.com/ovh/go-ovh v1.6.0/go.mod h1:cTVDnl94z4tl8pP1uZ/8jlVxntjSIf09bNcQ5TJSC7c= github.com/owenrumney/go-sarif v1.1.1/go.mod h1:dNDiPlF04ESR/6fHlPyq7gHKmrM0sHUvAGjsoh8ZH0U= -github.com/owenrumney/go-sarif/v2 v2.3.0 h1:wP5yEpI53zr0v5cBmagXzLbHZp9Oylyo3AJDpfLBITs= -github.com/owenrumney/go-sarif/v2 v2.3.0/go.mod h1:MSqMMx9WqlBSY7pXoOZWgEsVB4FDNfhcaXDA1j6Sr+w= +github.com/owenrumney/go-sarif/v2 v2.3.3 h1:ubWDJcF5i3L/EIOER+ZyQ03IfplbSU1BLOE26uKQIIU= +github.com/owenrumney/go-sarif/v2 v2.3.3/go.mod h1:MSqMMx9WqlBSY7pXoOZWgEsVB4FDNfhcaXDA1j6Sr+w= github.com/oxtoacart/bpool v0.0.0-20150712133111-4e1c5567d7c2 h1:CXwSGu/LYmbjEab5aMCs5usQRVBGThelUKBNnoSOuso= github.com/oxtoacart/bpool v0.0.0-20150712133111-4e1c5567d7c2/go.mod h1:L3UMQOThbttwfYRNFOWLLVXMhk5Lkio4GGOtw5UrxS0= -github.com/package-url/packageurl-go v0.1.2 h1:0H2DQt6DHd/NeRlVwW4EZ4oEI6Bn40XlNPRqegcxuo4= -github.com/package-url/packageurl-go v0.1.2/go.mod h1:uQd4a7Rh3ZsVg5j0lNyAfyxIeGde9yrlhjF78GzeW0c= +github.com/package-url/packageurl-go v0.1.3 h1:4juMED3hHiz0set3Vq3KeQ75KD1avthoXLtmE3I0PLs= +github.com/package-url/packageurl-go v0.1.3/go.mod h1:nKAWB8E6uk1MHqiS/lQb9pYBGH2+mdJ2PJc2s50dQY0= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= @@ -1505,8 +1639,8 @@ github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRI github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= -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/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 h1:o4JXh1EVt9k/+g42oCprj/FisM4qX9L3sZB3upGN2ZU= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/prashantv/gostub v1.1.0 h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4g= github.com/prashantv/gostub v1.1.0/go.mod h1:A5zLQHz7ieHGG7is6LLXLz7I8+3LZzsrV0P1IAHhP5U= github.com/prometheus-community/pro-bing v0.4.1 h1:aMaJwyifHZO0y+h8+icUz0xbToHbia0wdmzdVZ+Kl3w= @@ -1555,12 +1689,14 @@ github.com/prometheus/prometheus v0.54.1/go.mod h1:xlLByHhk2g3ycakQGrMaU8K7OySZx github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/protocolbuffers/protoscope v0.0.0-20221109213918-8e7a6aafa2c9 h1:arwj11zP0yJIxIRiDn22E0H8PxfF7TsTrc2wIPFIsf4= github.com/protocolbuffers/protoscope v0.0.0-20221109213918-8e7a6aafa2c9/go.mod h1:SKZx6stCn03JN3BOWTwvVIO2ajMkb/zQdTceXYhKw/4= +github.com/protocolbuffers/txtpbfmt v0.0.0-20231025115547-084445ff1adf h1:014O62zIzQwvoD7Ekj3ePDF5bv9Xxy0w6AZk0qYbjUk= +github.com/protocolbuffers/txtpbfmt v0.0.0-20231025115547-084445ff1adf/go.mod h1:jgxiZysxFPM+iWKwQwPR+y+Jvo54ARd4EisXxKYpB5c= github.com/puzpuzpuz/xsync/v3 v3.4.0 h1:DuVBAdXuGFHv8adVXjWWZ63pJq+NRXOWVXlKDBZ+mJ4= github.com/puzpuzpuz/xsync/v3 v3.4.0/go.mod h1:VjzYrABPabuM4KyBh1Ftq6u8nhwY5tBPKP9jpmh0nnA= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= -github.com/redis/go-redis/v9 v9.1.0 h1:137FnGdk+EQdCbye1FW+qOEcY5S+SpY9T0NiuqvtfMY= -github.com/redis/go-redis/v9 v9.1.0/go.mod h1:urWj3He21Dj5k4TK1y59xH8Uj6ATueP8AH1cY3lZl4c= +github.com/redis/go-redis/v9 v9.5.1 h1:H1X4D3yHPaYrkL5X06Wh6xNVM/pX0Ft4RV0vMGvLBh8= +github.com/redis/go-redis/v9 v9.5.1/go.mod h1:hdY0cQFCN4fnSYT6TkisLufl/4W5UIXyv0b/CLO2V2M= github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE= github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/richardartoul/molecule v1.0.1-0.20240531184615-7ca0df43c0b3 h1:4+LEVOB87y175cLJC/mbsgKmoDOjrBldtXvioEy96WY= @@ -1604,23 +1740,28 @@ github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da h1:p3Vo3i64TCL github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 h1:lZUw3E0/J3roVtGQ+SCrUrg3ON6NgVqpn3+iol9aGu4= github.com/santhosh-tekuri/jsonschema/v5 v5.3.1/go.mod h1:uToXkOrWAZ6/Oc07xWQrPOhJotwFIyu2bBVN41fcDUY= -github.com/sassoftware/go-rpmutils v0.3.0 h1:tE4TZ8KcOXay5iIP64P291s6Qxd9MQCYhI7DU+f3gFA= -github.com/sassoftware/go-rpmutils v0.3.0/go.mod h1:hM9wdxFsjUFR/tJ6SMsLrJuChcucCa0DsCzE9RMfwMo= +github.com/sassoftware/go-rpmutils v0.4.0 h1:ojND82NYBxgwrV+mX1CWsd5QJvvEZTKddtCdFLPWhpg= +github.com/sassoftware/go-rpmutils v0.4.0/go.mod h1:3goNWi7PGAT3/dlql2lv3+MSN5jNYPjT5mVcQcIsYzI= +github.com/sassoftware/relic v7.2.1+incompatible h1:Pwyh1F3I0r4clFJXkSI8bOyJINGqpgjJU3DYAZeI05A= +github.com/sassoftware/relic v7.2.1+incompatible/go.mod h1:CWfAxv73/iLZ17rbyhIEq3K9hs5w6FpNMdUT//qR+zk= +github.com/sassoftware/relic/v7 v7.6.2 h1:rS44Lbv9G9eXsukknS4mSjIAuuX+lMq/FnStgmZlUv4= +github.com/sassoftware/relic/v7 v7.6.2/go.mod h1:kjmP0IBVkJZ6gXeAu35/KCEfca//+PKM6vTAsyDPY+k= github.com/scaleway/scaleway-sdk-go v1.0.0-beta.29 h1:BkTk4gynLjguayxrYxZoMZjBnAOh7ntQvUkOFmkMqPU= github.com/scaleway/scaleway-sdk-go v1.0.0-beta.29/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 h1:nn5Wsu0esKSJiIVhscUtVbo7ada43DJhG55ua/hjS5I= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= 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/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= +github.com/segmentio/ksuid v1.0.4 h1:sBo2BdShXjmcugAMwjugoGUdUV0pcxY5mW4xKRn3v4c= +github.com/segmentio/ksuid v1.0.4/go.mod h1:/XUiZBD3kVx5SmUOl55voK5yeAbBNNIed+2O73XgrPE= github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 h1:n661drycOFuPLCN3Uc8sB6B/s6Z4t2xvBgU1htSHuq8= github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4= github.com/shibumi/go-pathspec v1.3.0 h1:QUyMZhFo0Md5B8zV8x2tesohbb5kfbpTi9rBnKh5dkI= github.com/shibumi/go-pathspec v1.3.0/go.mod h1:Xutfslp817l2I1cZvgcfeMQJG5QnU2lh5tVaaMCl3jE= 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.10 h1:7VOzPtfw/5YDU+jLEoBwXwxJbQetULywoSV4RYY7HkM= -github.com/shirou/gopsutil/v4 v4.24.10/go.mod h1:s4D/wg+ag4rG0WO7AiTj2BeYCRhym0vM7DHbZRxnIT8= +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/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4 h1:udFKJ0aHUL60LboW/A+DfgoHVedieIzIXE8uylPue0U= github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4/go.mod h1:qsXQc7+bwAM3Q1u/4XEfrquwF8Lw7D7y5cD8CuHnfIc= github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= @@ -1631,10 +1772,26 @@ github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFR github.com/shopspring/decimal v1.4.0 h1:bxl37RwXBklmTi0C79JfXCEBD1cqqHt0bbgBAGFp81k= github.com/shopspring/decimal v1.4.0/go.mod h1:gawqmDU56v4yIKSwfBSFip1HdCCXN8/+DMd9qYNcwME= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/signalfx/sapm-proto v0.16.0 h1:E8W+awZBl3nmpDTdbPK8Uwla9FdSCWpZChR3p+7bzw0= -github.com/signalfx/sapm-proto v0.16.0/go.mod h1:7VTAIoYIgkAK+j6w3l4Aici+EYySGAmXCK0rfD2OZkU= -github.com/sigstore/rekor v1.2.2 h1:5JK/zKZvcQpL/jBmHvmFj3YbpDMBQnJQ6ygp8xdF3bY= -github.com/sigstore/rekor v1.2.2/go.mod h1:FGnWBGWzeNceJnp0x9eDFd41mI8aQqCjj+Zp0IEs0Qg= +github.com/signalfx/sapm-proto v0.17.0 h1:KY+9zm/yDOq6uzaguI1RmrJcWxzbkGv0zE6GplA3ytc= +github.com/signalfx/sapm-proto v0.17.0/go.mod h1:c8fGx9DjGP7Hqif7g6Zy6E+BCMXK/dERFU2b3faA0gk= +github.com/sigstore/cosign/v2 v2.2.4 h1:iY4vtEacmu2hkNj1Fh+8EBqBwKs2DHM27/lbNWDFJro= +github.com/sigstore/cosign/v2 v2.2.4/go.mod h1:JZlRD2uaEjVAvZ1XJ3QkkZJhTqSDVtLaet+C/TMR81Y= +github.com/sigstore/fulcio v1.4.5 h1:WWNnrOknD0DbruuZWCbN+86WRROpEl3Xts+WT2Ek1yc= +github.com/sigstore/fulcio v1.4.5/go.mod h1:oz3Qwlma8dWcSS/IENR/6SjbW4ipN0cxpRVfgdsjMU8= +github.com/sigstore/rekor v1.3.6 h1:QvpMMJVWAp69a3CHzdrLelqEqpTM3ByQRt5B5Kspbi8= +github.com/sigstore/rekor v1.3.6/go.mod h1:JDTSNNMdQ/PxdsS49DJkJ+pRJCO/83nbR5p3aZQteXc= +github.com/sigstore/sigstore v1.8.3 h1:G7LVXqL+ekgYtYdksBks9B38dPoIsbscjQJX/MGWkA4= +github.com/sigstore/sigstore v1.8.3/go.mod h1:mqbTEariiGA94cn6G3xnDiV6BD8eSLdL/eA7bvJ0fVs= +github.com/sigstore/sigstore/pkg/signature/kms/aws v1.8.3 h1:LTfPadUAo+PDRUbbdqbeSl2OuoFQwUFTnJ4stu+nwWw= +github.com/sigstore/sigstore/pkg/signature/kms/aws v1.8.3/go.mod h1:QV/Lxlxm0POyhfyBtIbTWxNeF18clMlkkyL9mu45y18= +github.com/sigstore/sigstore/pkg/signature/kms/azure v1.8.3 h1:xgbPRCr2npmmsuVVteJqi/ERw9+I13Wou7kq0Yk4D8g= +github.com/sigstore/sigstore/pkg/signature/kms/azure v1.8.3/go.mod h1:G4+I83FILPX6MtnoaUdmv/bRGEVtR3JdLeJa/kXdk/0= +github.com/sigstore/sigstore/pkg/signature/kms/gcp v1.8.3 h1:vDl2fqPT0h3D/k6NZPlqnKFd1tz3335wm39qjvpZNJc= +github.com/sigstore/sigstore/pkg/signature/kms/gcp v1.8.3/go.mod h1:9uOJXbXEXj+M6QjMKH5PaL5WDMu43rHfbIMgXzA8eKI= +github.com/sigstore/sigstore/pkg/signature/kms/hashivault v1.8.3 h1:h9G8j+Ds21zqqulDbA/R/ft64oQQIyp8S7wJYABYSlg= +github.com/sigstore/sigstore/pkg/signature/kms/hashivault v1.8.3/go.mod h1:zgCeHOuqF6k7A7TTEvftcA9V3FRzB7mrPtHOhXAQBnc= +github.com/sigstore/timestamp-authority v1.2.2 h1:X4qyutnCQqJ0apMewFyx+3t7Tws00JQ/JonBiu3QvLE= +github.com/sigstore/timestamp-authority v1.2.2/go.mod h1:nEah4Eq4wpliDjlY342rXclGSO7Kb9hoRrl9tqLW13A= github.com/sijms/go-ora/v2 v2.8.19 h1:7LoKZatDYGi18mkpQTR/gQvG9yOdtc7hPAex96Bqisc= github.com/sijms/go-ora/v2 v2.8.19/go.mod h1:EHxlY6x7y9HAsdfumurRfTd+v8NrEOTR3Xl4FWlH6xk= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= @@ -1645,6 +1802,8 @@ github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/skeema/knownhosts v1.2.2 h1:Iug2P4fLmDw9f41PB6thxUkNUkJzB5i+1/exaj40L3A= github.com/skeema/knownhosts v1.2.2/go.mod h1:xYbVRSPxqBZFrdmDyMmsOs+uX1UZC3nTN3ThzgDxUwo= +github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966 h1:JIAuq3EEf9cgbU6AtGPK4CTG3Zf6CKMNqf0MHTggAUA= +github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966/go.mod h1:sUM3LWHvSMaG192sy56D9F7CNvL7jUJVXoqM1QKLnog= github.com/skydive-project/go-debouncer v1.0.0 h1:cqU19PyN7WXsnSlMTANvnHws6lGcbVOH2aDQzwe6qbk= github.com/skydive-project/go-debouncer v1.0.0/go.mod h1:7pK+5HBlYCD8W2cXhvMRsMsdWelDEPfpbE6PwSlDX68= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= @@ -1670,8 +1829,8 @@ github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasO github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spdx/gordf v0.0.0-20201111095634-7098f93598fb/go.mod h1:uKWaldnbMnjsSAXRurWqqrdyZen1R7kxl8TkmWk2OyM= -github.com/spdx/tools-golang v0.5.4-0.20231108154018-0c0f394b5e1a h1:uuREJ3I15VLjYZuhxjTQnA2bTqzRQX1HKEphYBzqT9o= -github.com/spdx/tools-golang v0.5.4-0.20231108154018-0c0f394b5e1a/go.mod h1:BHs8QEhK6MbFGdyjxvuBtzJtCLrN5bwUBC9fzQlYBXs= +github.com/spdx/tools-golang v0.5.5 h1:61c0KLfAcNqAjlg6UNMdkwpMernhw3zVRwDZ2x9XOmk= +github.com/spdx/tools-golang v0.5.5/go.mod h1:MVIsXx8ZZzaRWNQpUDhC4Dud34edUYJYecciXgrw5vE= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= github.com/spf13/afero v1.3.3/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY520V4= @@ -1689,6 +1848,8 @@ github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An github.com/spf13/viper v1.6.2/go.mod h1:t3iDnF5Jlj76alVNuyFBk5oUMCvsrkbvZK0WQdfDi5k= github.com/spf13/viper v1.19.0 h1:RWq5SEjt8o25SROyN3z2OrDB9l7RPd3lwTWU8EcEdcI= github.com/spf13/viper v1.19.0/go.mod h1:GQUN9bilAbhU/jgc1bKs99f/suXKeUMct8Adx5+Ntkg= +github.com/spiffe/go-spiffe/v2 v2.2.0 h1:9Vf06UsvsDbLYK/zJ4sYsIsHmMFknUD+feA7IYoWMQY= +github.com/spiffe/go-spiffe/v2 v2.2.0/go.mod h1:Urzb779b3+IwDJD2ZbN8fVl3Aa8G4N/PiUe6iXC0XxU= github.com/square/certstrap v1.2.0 h1:ecgyABrbFLr8jSbOC6oTBmBek0t/HqtgrMUZCPuyfdw= github.com/square/certstrap v1.2.0/go.mod h1:CUHqV+fxJW0Y5UQFnnbYwQ7bpKXO1AKbic9g73799yw= github.com/stoewer/go-strcase v1.3.0 h1:g0eASXYtp+yvN9fK8sH94oCIk0fau9uV1/ZdJ0AVEzs= @@ -1741,10 +1902,16 @@ github.com/tedsuo/rata v1.0.0 h1:Sf9aZrYy6ElSTncjnGkyC2yuVvz5YJetBIUKJ4CmeKE= github.com/tedsuo/rata v1.0.0/go.mod h1:X47ELzhOoLbfFIY0Cql9P6yo3Cdwf2CMX3FVZxRzJPc= github.com/terminalstatic/go-xsd-validate v0.1.5 h1:RqpJnf6HGE2CB/lZB1A8BYguk8uRtcvYAPLCF15qguo= github.com/terminalstatic/go-xsd-validate v0.1.5/go.mod h1:18lsvYFofBflqCrvo1umpABZ99+GneNTw2kEEc8UPJw= -github.com/testcontainers/testcontainers-go v0.23.0 h1:ERYTSikX01QczBLPZpqsETTBO7lInqEP349phDOVJVs= -github.com/testcontainers/testcontainers-go v0.23.0/go.mod h1:3gzuZfb7T9qfcH2pHpV4RLlWrPjeWNQah6XlYQ32c4I= -github.com/tetratelabs/wazero v1.7.0 h1:jg5qPydno59wqjpGrHph81lbtHzTrWzwwtD4cD88+hQ= -github.com/tetratelabs/wazero v1.7.0/go.mod h1:ytl6Zuh20R/eROuyDaGPkp82O9C/DJfXAwJfQ3X6/7Y= +github.com/testcontainers/testcontainers-go v0.34.0 h1:5fbgF0vIN5u+nD3IWabQwRybuB4GY8G2HHgCkbMzMHo= +github.com/testcontainers/testcontainers-go v0.34.0/go.mod h1:6P/kMkQe8yqPHfPWNulFGdFHTD8HB2vLq/231xY2iPQ= +github.com/testcontainers/testcontainers-go/modules/localstack v0.33.0 h1:AhbUGUjneEnMyTV5aTsPYzDiAWrba1duPtiV+Z9CKdY= +github.com/testcontainers/testcontainers-go/modules/localstack v0.33.0/go.mod h1:J5vMq1fXXiTfwcJplMClHhn+j8+MbIMv7Lic4d9E8qU= +github.com/tetratelabs/wazero v1.8.0 h1:iEKu0d4c2Pd+QSRieYbnQC9yiFlMS9D+Jr0LsRmcF4g= +github.com/tetratelabs/wazero v1.8.0/go.mod h1:yAI0XTsMBhREkM/YDAK/zNou3GoiAce1P6+rp/wQhjs= +github.com/thales-e-security/pool v0.0.2 h1:RAPs4q2EbWsTit6tpzuvTFlgFRJ3S8Evf5gtvVDbmPg= +github.com/thales-e-security/pool v0.0.2/go.mod h1:qtpMm2+thHtqhLzTwgDBj/OuNnMpupY8mv0Phz0gjhU= +github.com/theupdateframework/go-tuf v0.7.0 h1:CqbQFrWo1ae3/I0UCblSbczevCCbS31Qvs5LdxRWqRI= +github.com/theupdateframework/go-tuf v0.7.0/go.mod h1:uEB7WSY+7ZIugK6R1hiBMBjQftaFzn7ZCDJcp1tCUug= github.com/tidwall/gjson v1.14.2/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= github.com/tidwall/gjson v1.18.0 h1:FIDeeyB800efLX89e5a8Y0BNH+LOngJyGrIWxG2FKQY= github.com/tidwall/gjson v1.18.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= @@ -1757,10 +1924,14 @@ github.com/tidwall/sjson v1.2.5 h1:kLy8mja+1c9jlljvWTlSazM7cKDRfJuR/bOJhcY5NcY= github.com/tidwall/sjson v1.2.5/go.mod h1:Fvgq9kS/6ociJEDnK0Fk1cpYF4FIW6ZF7LAe+6jwd28= github.com/tidwall/tinylru v1.1.0 h1:XY6IUfzVTU9rpwdhKUF6nQdChgCdGjkMfLzbWyiau6I= github.com/tidwall/tinylru v1.1.0/go.mod h1:3+bX+TJ2baOLMWTnlyNWHh4QMnFyARg2TLTQ6OFbzw8= -github.com/tidwall/wal v1.1.7 h1:emc1TRjIVsdKKSnpwGBAcsAGg0767SvUk8+ygx7Bb+4= -github.com/tidwall/wal v1.1.7/go.mod h1:r6lR1j27W9EPalgHiB7zLJDYu3mzW5BQP5KrzBpYY/E= +github.com/tidwall/wal v1.1.8 h1:2qDSGdAdjaY3PEvHRva+9UFqgk+ef7cOiW1Qn5JH1y0= +github.com/tidwall/wal v1.1.8/go.mod h1:r6lR1j27W9EPalgHiB7zLJDYu3mzW5BQP5KrzBpYY/E= github.com/tinylib/msgp v1.2.4 h1:yLFeUGostXXSGW5vxfT5dXG/qzkn4schv2I7at5+hVU= github.com/tinylib/msgp v1.2.4/go.mod h1:ykjzy2wzgrlvpDCRc4LA8UXy6D8bzMSuAF3WD57Gok0= +github.com/titanous/rocacheck v0.0.0-20171023193734-afe73141d399 h1:e/5i7d4oYZ+C1wj2THlRK+oAhjeS/TRQwMfkIuet3w0= +github.com/titanous/rocacheck v0.0.0-20171023193734-afe73141d399/go.mod h1:LdwHTNJT99C5fTAzDz0ud328OgXz+gierycbcIx2fRs= +github.com/tjfoc/gmsm v1.4.1 h1:aMe1GlZb+0bLjn+cKTPEvvn9oUEBlJitaZiiBwsbgho= +github.com/tjfoc/gmsm v1.4.1/go.mod h1:j4INPkHWMrhJb38G+J6W4Tw0AbuN8Thu3PbdVYhVcTE= 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.8.0 h1:Mx4Wwe/FjZLeQsK/6kt2EOepwwSl7SmJrK5bV/dXYgY= @@ -1771,6 +1942,10 @@ github.com/tmc/grpc-websocket-proxy v0.0.0-20220101234140-673ab2c3ae75 h1:6fotK7 github.com/tmc/grpc-websocket-proxy v0.0.0-20220101234140-673ab2c3ae75/go.mod h1:KO6IkyS8Y3j8OdNO85qEYBsRPuteD+YciPomcXdrMnk= github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc h1:9lRDQMhESg+zvGYmW5DyG0UqvY96Bu5QYsTLvCHdrgo= github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc/go.mod h1:bciPuU6GHm1iF1pBvUfxfsH0Wmnc2VbpgvbI9ZWuIRs= +github.com/tonistiigi/go-csvvalue v0.0.0-20240710180619-ddb21b71c0b4 h1:7I5c2Ig/5FgqkYOh/N87NzoyI9U15qUPXhDD8uCupv8= +github.com/tonistiigi/go-csvvalue v0.0.0-20240710180619-ddb21b71c0b4/go.mod h1:278M4p8WsNh3n4a1eqiFcV2FGk7wE5fwUpUom9mK9lE= +github.com/transparency-dev/merkle v0.0.2 h1:Q9nBoQcZcgPamMkGn7ghV8XiTZ/kRxn1yCG81+twTK4= +github.com/transparency-dev/merkle v0.0.2/go.mod h1:pqSy+OXefQ1EDUVmAJ8MUhHB9TXGuzVAT58PqBoHz1A= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= github.com/twitchtv/twirp v8.1.3+incompatible h1:+F4TdErPgSUbMZMwp13Q/KgDVuI7HJXP61mNV3/7iuU= github.com/twitchtv/twirp v8.1.3+incompatible/go.mod h1:RRJoFSAmTEh2weEqWtpPE3vFK5YBhA6bqp2l1kfCC5A= @@ -1789,8 +1964,8 @@ github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLY github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU= github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= -github.com/ulikunitz/xz v0.5.11 h1:kpFauv27b6ynzBNT/Xy+1k+fK4WswhN/6PN5WhFAGw8= -github.com/ulikunitz/xz v0.5.11/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= +github.com/ulikunitz/xz v0.5.12 h1:37Nm15o69RwBkXM0J6A5OlE67RZTfzUxTj8fB3dfcsc= +github.com/ulikunitz/xz v0.5.12/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/uptrace/bun v1.2.5 h1:gSprL5xiBCp+tzcZHgENzJpXnmQwRM/A6s4HnBF85mc= github.com/uptrace/bun v1.2.5/go.mod h1:vkQMS4NNs4VNZv92y53uBSHXRqYyJp4bGhMHgaNCQpY= github.com/uptrace/bun/dialect/pgdialect v1.2.5 h1:dWLUxpjTdglzfBks2x+U2WIi+nRVjuh7Z3DLYVFswJk= @@ -1833,6 +2008,8 @@ github.com/wsxiaoys/terminal v0.0.0-20160513160801-0940f3fc43a0 h1:3UeQBvD0TFrlV github.com/wsxiaoys/terminal v0.0.0-20160513160801-0940f3fc43a0/go.mod h1:IXCdmsXIht47RaVFLEdVnh1t+pgYtTAhQGj73kz+2DM= github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= +github.com/xanzy/go-gitlab v0.102.0 h1:ExHuJ1OTQ2yt25zBMMj0G96ChBirGYv8U7HyUiYkZ+4= +github.com/xanzy/go-gitlab v0.102.0/go.mod h1:ETg8tcj4OhrB84UEgeE8dSuV/0h4BBL1uOV/qK0vlyI= github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM= github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw= github.com/xdg-go/pbkdf2 v1.0.0 h1:Su7DPu48wXMwC3bs7MCNG+z4FhcyEuz5dlvchbq0B0c= @@ -1851,8 +2028,9 @@ github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17 github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 h1:nIPpBwaJSVYIxUFsDv3M8ofmx9yWTog9BfvIu0q41lo= github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8/go.mod h1:HUYIGzjTL3rfEspMxjDjgmT5uz5wzYJKVo23qUhYTos= -github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 h1:eY9dn8+vbi4tKz5Qo6v2eYzo7kUS51QINcR5jNpbZS8= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= +github.com/xiang90/probing v0.0.0-20221125231312-a49e3df8f510 h1:S2dVYn90KE98chqDkyE9Z4N61UnQd+KOfgp5Iu53llk= +github.com/xiang90/probing v0.0.0-20221125231312-a49e3df8f510/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xlab/treeprint v1.2.0 h1:HzHnuAF1plUN2zGlAFHbSQP2qJ0ZAD3XF5XD7OesXRQ= github.com/xlab/treeprint v1.2.0/go.mod h1:gj5Gd3gPdKtR1ikdDK6fnFLdmIS0X30kTTuNd/WEJu0= github.com/xor-gate/ar v0.0.0-20170530204233-5c72ae81e2b7 h1:Vo3q7h44BfmnLQh5SdF+2xwIoVnHThmZLunx6odjrHI= @@ -1873,11 +2051,15 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -github.com/yuin/gopher-lua v1.1.0 h1:BojcDhfyDWgU2f2TOzYK/g5p2gxMrku8oupLDqlnSqE= -github.com/yuin/gopher-lua v1.1.0/go.mod h1:GBR0iDaNXjAgGg9zfCvksxSRnQx76gclCIb7kdAd1Pw= +github.com/yuin/gopher-lua v1.1.1 h1:kYKnWBjvbNP4XLT3+bPEwAXJx262OhaHDWDVOPjL46M= +github.com/yuin/gopher-lua v1.1.1/go.mod h1:GBR0iDaNXjAgGg9zfCvksxSRnQx76gclCIb7kdAd1Pw= github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0= github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= +github.com/zalando/go-keyring v0.2.3 h1:v9CUu9phlABObO4LPWycf+zwMG7nlbb3t/B5wa97yms= +github.com/zalando/go-keyring v0.2.3/go.mod h1:HL4k+OXQfJUWaMnqyuSOc0drfGPX2b51Du6K+MRgZMk= github.com/zclconf/go-cty v1.10.0/go.mod h1:vVKLxnk3puL4qRAv72AO+W99LUD4da90g3uUAzyuvAk= +github.com/zeebo/errs v1.3.0 h1:hmiaKqgYZzcVgRL1Vkc1Mn2914BbzB0IBxs+ebeutGs= +github.com/zeebo/errs v1.3.0/go.mod h1:sgbWHsvVuTPHcqJJGQ1WhI5KbWlHYz+2+2C/LSEtCw4= github.com/zorkian/go-datadog-api v2.30.0+incompatible h1:R4ryGocppDqZZbnNc5EDR8xGWF/z/MxzWnqTUijDQes= github.com/zorkian/go-datadog-api v2.30.0+incompatible/go.mod h1:PkXwHX9CUQa/FpB9ZwAD45N1uhCW4MT/Wj7m36PbKss= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= @@ -1906,142 +2088,146 @@ go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= -go.opentelemetry.io/collector v0.114.0 h1:XLLLOHns06P9XjVHyp0OdEMdwXvol5MLzugqQMmXYuU= -go.opentelemetry.io/collector v0.114.0/go.mod h1:XbjD4Yw9LunLo3IJu3ZZytNZ0drEVznxw1Z14Ujlw3s= -go.opentelemetry.io/collector/client v1.20.0 h1:o60wPcj5nLtaRenF+1E5p4QXFS3TDL6vHlw+GOon3rg= -go.opentelemetry.io/collector/client v1.20.0/go.mod h1:6aqkszco9FaLWCxyJEVam6PP7cUa8mPRIXeS5eZGj0U= -go.opentelemetry.io/collector/component v0.114.0 h1:SVGbm5LvHGSTEDv7p92oPuBgK5tuiWR82I9+LL4TtBE= -go.opentelemetry.io/collector/component v0.114.0/go.mod h1:MLxtjZ6UVHjDxSdhGLuJfHBHvfl1iT/Y7IaQPD24Eww= -go.opentelemetry.io/collector/component/componentstatus v0.114.0 h1:y9my/xink8KB5lK8zFAjgB2+pEh0QYy5TM972fxZY9w= -go.opentelemetry.io/collector/component/componentstatus v0.114.0/go.mod h1:RIoeCYZpPaae7QLE/1RacqzhHuXBmzRAk9H/EwYtIIs= -go.opentelemetry.io/collector/component/componenttest v0.114.0 h1:GM4FTTlfeXoVm6sZYBHImwlRN8ayh2oAfUhvaFj7Zo8= -go.opentelemetry.io/collector/component/componenttest v0.114.0/go.mod h1:ZZEJMtbJtoVC/3/9R1HzERq+cYQRxuMFQrPCpfZ4Xos= -go.opentelemetry.io/collector/config/configauth v0.114.0 h1:R2sJ6xpsLYGH0yU0vCxotzBYDKR/Hrjv0A7y9lwMyiw= -go.opentelemetry.io/collector/config/configauth v0.114.0/go.mod h1:3Z24KcCpG+WYCeQYfs/cNp5cP2BDeOqLCtOEgs/rPqM= -go.opentelemetry.io/collector/config/configcompression v1.20.0 h1:H/mvz7J/5z+O74YsO0t2tk+REnO2tzLM8TgIQ4AZ5w0= -go.opentelemetry.io/collector/config/configcompression v1.20.0/go.mod h1:pnxkFCLUZLKWzYJvfSwZnPrnm0twX14CYj2ADth5xiU= -go.opentelemetry.io/collector/config/configgrpc v0.114.0 h1:3kGI9CljNtzClF+9sg7NWZ5qUoy4qZvGxv9q3phDn7k= -go.opentelemetry.io/collector/config/configgrpc v0.114.0/go.mod h1:IHSyqSdjPXW34aif/8BhNlXxRcIVV6026jVi0/+ituY= -go.opentelemetry.io/collector/config/confighttp v0.114.0 h1:DjGsBvVm+mGK3IpJBaXianWhwcxEC1fF33cpuC1LY/I= -go.opentelemetry.io/collector/config/confighttp v0.114.0/go.mod h1:nrlNLxOZ+4JQaV9j0TiqQV7LOHhrRivPrT8nQRHED3Q= -go.opentelemetry.io/collector/config/confignet v1.20.0 h1:LrM6AuiY8N/woTP4SWhL2V0562JXwJs9MRNFZJFLtRY= -go.opentelemetry.io/collector/config/confignet v1.20.0/go.mod h1:o3v4joAEjvLwntqexg5ixMqRrU1+Vst+jWuCUaBNgOg= -go.opentelemetry.io/collector/config/configopaque v1.20.0 h1:2I48zKiyyyYqjm7y0B9OLp24ku2ZSX3nCHG0r5FdWOQ= -go.opentelemetry.io/collector/config/configopaque v1.20.0/go.mod h1:6zlLIyOoRpJJ+0bEKrlZOZon3rOp5Jrz9fMdR4twOS4= -go.opentelemetry.io/collector/config/configretry v1.20.0 h1:z679mrMlW2a6tOOYPGdrS/QfALxdzWLQUOpH8Uu+D5Y= -go.opentelemetry.io/collector/config/configretry v1.20.0/go.mod h1:KvQF5cfphq1rQm1dKR4eLDNQYw6iI2fY72NMZVa+0N0= -go.opentelemetry.io/collector/config/configtelemetry v0.114.0 h1:kjLeyrumge6wsX6ZIkicdNOlBXaEyW2PI2ZdVXz/rzY= -go.opentelemetry.io/collector/config/configtelemetry v0.114.0/go.mod h1:R0MBUxjSMVMIhljuDHWIygzzJWQyZHXXWIgQNxcFwhc= -go.opentelemetry.io/collector/config/configtls v1.20.0 h1:hNlJdwfyY5Qe54RLJ41lfLqKTn9ypkR7sk7JNCcSe2U= -go.opentelemetry.io/collector/config/configtls v1.20.0/go.mod h1:sav/txSHguadTYlSSK+BJO2ljJeYEtRoBahgzWAguYg= -go.opentelemetry.io/collector/config/internal v0.114.0 h1:uWSDWTJb8T6xRjKD9/XmEARakXnxgYVYKUeId78hErc= -go.opentelemetry.io/collector/config/internal v0.114.0/go.mod h1:yC7E4h1Uj0SubxcFImh6OvBHFTjMh99+A5PuyIgDWqc= -go.opentelemetry.io/collector/confmap v1.20.0 h1:ARfOwmkKxFOud1njl03yAHQ30+uenlzqCO6LBYamDTE= -go.opentelemetry.io/collector/confmap v1.20.0/go.mod h1:DMpd9Ay/ffls3JoQBQ73vWeRsz1rNuLbwjo6WtjSQus= -go.opentelemetry.io/collector/confmap/provider/envprovider v1.20.0 h1:I3xDecFXJVZBo5zJS7Y5SWBjF22XDWGZJgwotiwA5QM= -go.opentelemetry.io/collector/confmap/provider/envprovider v1.20.0/go.mod h1:CF0l8V8MNv+Wag8UkqObotFnlhMzdTFuk4/6kylKwYU= -go.opentelemetry.io/collector/confmap/provider/fileprovider v1.20.0 h1:wWxvQ7wj+1O9yDGM5m1HPEz8FJewAHAUWadAAi0KVbM= -go.opentelemetry.io/collector/confmap/provider/fileprovider v1.20.0/go.mod h1:/5HWIPjGYk8IUurs1CZUSjGaSsaQyJsfR8+Zs5rGJ6Y= -go.opentelemetry.io/collector/confmap/provider/httpprovider v1.20.0 h1:YS1nB8vDoCS8IlfX5OP3QGS90y/hfflwZ7CoPQcAOlU= -go.opentelemetry.io/collector/confmap/provider/httpprovider v1.20.0/go.mod h1:aV4UfkgcJ3eyXvfd3m694omN++1c96Joitab+YL6Xks= -go.opentelemetry.io/collector/confmap/provider/httpsprovider v1.20.0 h1:0BJHAeKFb46FCT0ehOmmGs0v31cGuAh4DIic07J71NU= -go.opentelemetry.io/collector/confmap/provider/httpsprovider v1.20.0/go.mod h1:gBiweuH4EDuPh9mpLCB/wPZzostdA+gKY8hABwbotQk= -go.opentelemetry.io/collector/confmap/provider/yamlprovider v1.20.0 h1:jSXTojCPI6Xr98m99nF7qbQFnw3INLEOHRcqcHS+lak= -go.opentelemetry.io/collector/confmap/provider/yamlprovider v1.20.0/go.mod h1:Pu95O2JE3R+0BBTbe4gpAC8ms3w6FbICHJw3WvGWrjs= -go.opentelemetry.io/collector/connector v0.114.0 h1:efGAeTCtg8zp5Hyd7Am8kBUgsSxWEFlFtAu4OX4mcEA= -go.opentelemetry.io/collector/connector v0.114.0/go.mod h1:8DhGgD8RhkF0ooELl4NOPPD/wgHuXHmY7g90RwJ2eNo= -go.opentelemetry.io/collector/connector/connectorprofiles v0.114.0 h1:uVs9gy3UfQBmH0636ouIbGIoWis7zmKN+ny4XOGm36U= -go.opentelemetry.io/collector/connector/connectorprofiles v0.114.0/go.mod h1:X681qFEAsEPMDQ0pMsD/3DqePw58sfLew1QbBKvGnmw= -go.opentelemetry.io/collector/connector/connectortest v0.114.0 h1:Fpy1JHyNOLdVzNcmxUY6Jwxdz6JDcTXL1NCfw8k1AOc= -go.opentelemetry.io/collector/connector/connectortest v0.114.0/go.mod h1:1zaAlODuL9iNyfyjHQeGCpbcaUjf5b68t8LqlwHKBNA= -go.opentelemetry.io/collector/consumer v0.114.0 h1:1zVaHvfIZowGwZRitRBRo3i+RP2StlU+GClYiofSw0Q= -go.opentelemetry.io/collector/consumer v0.114.0/go.mod h1:d+Mrzt9hsH1ub3zmwSlnQVPLeTYir4Mgo7CrWfnncN4= -go.opentelemetry.io/collector/consumer/consumererror v0.114.0 h1:r2YiELfWerb40FHD23V04gNjIkLUcjEKGxI4Vtm2iO4= -go.opentelemetry.io/collector/consumer/consumererror v0.114.0/go.mod h1:MzIrLQ5jptO2egypolhlAbZsWZr29WC4FhSxQjnxcvg= -go.opentelemetry.io/collector/consumer/consumererror/consumererrorprofiles v0.114.0 h1:0IpwQXyHDXhIaLA6w2VlD6Ca0iuX4wlfCDiF+BKCwEo= -go.opentelemetry.io/collector/consumer/consumererror/consumererrorprofiles v0.114.0/go.mod h1:9pKeVRcCT92x5/UIULMLAop+J23VYJCWSZcVhmbup5I= -go.opentelemetry.io/collector/consumer/consumerprofiles v0.114.0 h1:5pXYy3E6UK5Huu3aQbsYL8B6E6MyWx4fvXXDn+oXZaA= -go.opentelemetry.io/collector/consumer/consumerprofiles v0.114.0/go.mod h1:PMq3f54KcJQO4v1tue0QxQScu7REFVADlXxXSAYMiN0= -go.opentelemetry.io/collector/consumer/consumertest v0.114.0 h1:isaTwJK5DOy8Bs7GuLq23ejfgj8gLIo5dOUvkRnLF4g= -go.opentelemetry.io/collector/consumer/consumertest v0.114.0/go.mod h1:GNeLPkfRPdh06n/Rv1UKa/cAtCKjN0a7ADyHjIj4HFE= -go.opentelemetry.io/collector/exporter v0.114.0 h1:5/0BBpXuCJQSQ5SQf31g7j6T4XEKkyx9mZMcA2rS5e8= -go.opentelemetry.io/collector/exporter v0.114.0/go.mod h1:atpd0wWXgh5LAZ0REU/d/Ti/q50HDfnlBIjMjJQlKFg= -go.opentelemetry.io/collector/exporter/debugexporter v0.114.0 h1:7t1ij8fuV510SRT+eabgbl4973DaAtGmTx0RuGJy8DU= -go.opentelemetry.io/collector/exporter/debugexporter v0.114.0/go.mod h1:rC8PHnf1MniZN4ryU4i5GsyXKRkMEGwEGF2hxHx/JyU= -go.opentelemetry.io/collector/exporter/exporterhelper/exporterhelperprofiles v0.114.0 h1:W/KsD33oMg/M7Kd5/m2riliWrTg3W9IgQVNeZL3cZjs= -go.opentelemetry.io/collector/exporter/exporterhelper/exporterhelperprofiles v0.114.0/go.mod h1:Fh47qYBjX+jm+mpWBcqmaaQucZ6KiKm5P0drEt+xNRc= -go.opentelemetry.io/collector/exporter/exporterprofiles v0.114.0 h1:/wmWOSBHcvtz3Pbv7+rWCqPPQuNvYaoidKKaOqZsLKs= -go.opentelemetry.io/collector/exporter/exporterprofiles v0.114.0/go.mod h1:epRYTkyJZTSQZBJflMGHUyUo2EdLPhsaZEyo5Qm848A= -go.opentelemetry.io/collector/exporter/exportertest v0.114.0 h1:vo0idBJT+QACSM1KpjVLm9VeiXVwO7y4UnMpGxN6EyM= -go.opentelemetry.io/collector/exporter/exportertest v0.114.0/go.mod h1:420ssFrhaphneybstbMeSIiqSRoaBARPgO71O17foaM= -go.opentelemetry.io/collector/exporter/nopexporter v0.114.0 h1:uMtQQjkAK62tzy2Rs/KCgRofNW7uo0EgU5xn3xmgB2w= -go.opentelemetry.io/collector/exporter/nopexporter v0.114.0/go.mod h1:jV9/E7Twphys1df6m7HgvqgJXpmppxFJb/DYy3XLR94= -go.opentelemetry.io/collector/exporter/otlpexporter v0.114.0 h1:SC/xZNCB/eCVflrhDFX4WtrpvBPsZhmXVuSvgHQBsB8= -go.opentelemetry.io/collector/exporter/otlpexporter v0.114.0/go.mod h1:q1273aUuYewtDUFwizv0AKu5/D+gbQAi8UFLKDv1eMk= -go.opentelemetry.io/collector/exporter/otlphttpexporter v0.114.0 h1:+nPJraioPpLS2Kj3+YIfErDDFHsLX/5oPMSMAYKoggM= -go.opentelemetry.io/collector/exporter/otlphttpexporter v0.114.0/go.mod h1:O+75KYmyJwK61VDsW7LHo2qFFXCTf3kEJH3ZvW1bb4Y= -go.opentelemetry.io/collector/extension v0.114.0 h1:9Qb92y8hD2WDC5aMDoj4JNQN+/5BQYJWPUPzLXX+iGw= -go.opentelemetry.io/collector/extension v0.114.0/go.mod h1:Yk2/1ptVgfTr12t+22v93nYJpioP14pURv2YercSzU0= -go.opentelemetry.io/collector/extension/auth v0.114.0 h1:1K2qh4yvG8kKR/sTAobI/rw5VxzPZoKcl3FmC195vvo= -go.opentelemetry.io/collector/extension/auth v0.114.0/go.mod h1:IjtsG+jUVJB0utKF8dAK8pLutRun3aEgASshImzsw/U= -go.opentelemetry.io/collector/extension/experimental/storage v0.114.0 h1:hLyX9UvmY0t6iBnk3CqvyNck2U0QjPACekj7pDRx2hA= -go.opentelemetry.io/collector/extension/experimental/storage v0.114.0/go.mod h1:WqYRQVJjJLE1rm+y/ks1wPdPRGWePEvE1VO07xm2J2k= -go.opentelemetry.io/collector/extension/extensioncapabilities v0.114.0 h1:3OHll7gp5XIu7FVgon+koShPy797nze6EjCDokFUG7w= -go.opentelemetry.io/collector/extension/extensioncapabilities v0.114.0/go.mod h1:f0KdeLmE2jWVBmJ1U4WmfAtz1/tQUErGPfhPLKCQ49U= -go.opentelemetry.io/collector/extension/extensiontest v0.114.0 h1:ibXDms1qrswlvlR6b3d2BeyI8sXUXoFV11yOi9Sop8o= -go.opentelemetry.io/collector/extension/extensiontest v0.114.0/go.mod h1:/bOYmqu5yTDfI1bJZUxFqm8ZtmcodpquebiSxiQxtDY= -go.opentelemetry.io/collector/extension/zpagesextension v0.114.0 h1:JosqAcdWw7IGsURJNR8f17xmaGCQEtKhQt9tM0T/DEg= -go.opentelemetry.io/collector/extension/zpagesextension v0.114.0/go.mod h1:+VO4p2GZvmIMqCVyIfS/U85Xqg+HIOe+mdl/ya+jVTE= -go.opentelemetry.io/collector/featuregate v1.20.0 h1:Mi7nMy/q52eruI+6jWnMKUOeM55XvwoPnGcdB1++O8c= -go.opentelemetry.io/collector/featuregate v1.20.0/go.mod h1:47xrISO71vJ83LSMm8+yIDsUbKktUp48Ovt7RR6VbRs= -go.opentelemetry.io/collector/filter v0.114.0 h1:5I97yblUxc6rXCYRn542aSrsNQLo/dE+87XROW2b5oU= -go.opentelemetry.io/collector/filter v0.114.0/go.mod h1:Nxwc+RD9AH4y/qYtkTP+Ac19CxgW5GAB+sJU4ACLr6g= -go.opentelemetry.io/collector/internal/fanoutconsumer v0.114.0 h1:JM9huYqy5LTzmuxQmbPST3l5Ez5kJNit28c6WFWls34= -go.opentelemetry.io/collector/internal/fanoutconsumer v0.114.0/go.mod h1:V28tDU4Wvf1PfW1Ty/SBL9tpKul2iYGno/HkCWGDrj0= -go.opentelemetry.io/collector/internal/memorylimiter v0.114.0 h1:UpKQ/GtWw7Mh/PjR03NdgR9PG7uT7mnfbQVxpDQVBgk= -go.opentelemetry.io/collector/internal/memorylimiter v0.114.0/go.mod h1:QUZr3bBguTmgLJUFuqVVsOxKr7Y/2JO49k3I1tUH88U= -go.opentelemetry.io/collector/internal/sharedcomponent v0.114.0 h1:DjX9ubjkKDnioQB03FYc40FTyhR25CdobMfjinKkZ1w= -go.opentelemetry.io/collector/internal/sharedcomponent v0.114.0/go.mod h1:lYlFiGIjPjhwTS/Xc+toJ9o3D8A6cCHuK1JX+ZbujVs= -go.opentelemetry.io/collector/otelcol v0.114.0 h1:d/nmYc+adzZ70g4zBMtgujGHVNulF59ExCpuM/3ZKV4= -go.opentelemetry.io/collector/otelcol v0.114.0/go.mod h1:DGmFFao5jHSwD6G1HjUjs0CYcyrTau+u7GjTRUGKN+4= -go.opentelemetry.io/collector/otelcol/otelcoltest v0.114.0 h1:Em5e1EgrPrS90EWDWLJHCvyFIDl5PIq1DuW9zd8F3pY= -go.opentelemetry.io/collector/otelcol/otelcoltest v0.114.0/go.mod h1:YAs78SaOJsf1HNWrNH+GFTdkS58dpQI98cok6gZP4Lg= -go.opentelemetry.io/collector/pdata v1.20.0 h1:ePcwt4bdtISP0loHaE+C9xYoU2ZkIvWv89Fob16o9SM= -go.opentelemetry.io/collector/pdata v1.20.0/go.mod h1:Ox1YVLe87cZDB/TL30i4SUz1cA5s6AM6SpFMfY61ICs= -go.opentelemetry.io/collector/pdata/pprofile v0.114.0 h1:pUNfTzsI/JUTiE+DScDM4lsrPoxnVNLI2fbTxR/oapo= -go.opentelemetry.io/collector/pdata/pprofile v0.114.0/go.mod h1:4aNcj6WM1n1uXyFSXlhVs4ibrERgNYsTbzcYI2zGhxA= -go.opentelemetry.io/collector/pdata/testdata v0.114.0 h1:+AzszWSL1i4K6meQ8rU0JDDW55SYCXa6FVqfDixhhTo= -go.opentelemetry.io/collector/pdata/testdata v0.114.0/go.mod h1:bv8XFdCTZxG2MQB5l9dKxSxf5zBrcodwO6JOy1+AxXM= -go.opentelemetry.io/collector/pipeline v0.114.0 h1:v3YOhc5z0tD6QbO5n/pnftpIeroihM2ks9Z2yKPCcwY= -go.opentelemetry.io/collector/pipeline v0.114.0/go.mod h1:4vOvjVsoYTHVGTbfFwqfnQOSV2K3RKUHofh3jNRc2Mg= -go.opentelemetry.io/collector/pipeline/pipelineprofiles v0.114.0 h1:LZgxMQ2zXcz8ILBefhxpZBpn/Rx+TJTncIIQy0LgtgY= -go.opentelemetry.io/collector/pipeline/pipelineprofiles v0.114.0/go.mod h1:bmyqQCJWcA53/GtqZJ2ahwmLdFl6UelFH2nR6OJFqpw= -go.opentelemetry.io/collector/processor v0.114.0 h1:6bqQgLL7BtKrNv4YkEOGjZfkcfZv/ciJSQx1epGG9Zk= -go.opentelemetry.io/collector/processor v0.114.0/go.mod h1:DV/wa+nAmSHIDeD9NblPwkY9PbgtDQAZJ+PE5biZwPc= -go.opentelemetry.io/collector/processor/batchprocessor v0.114.0 h1:Xu+pdPGIh6gLqHW5oYJsiim1mbnG85QaaUQy0YPoL+c= -go.opentelemetry.io/collector/processor/batchprocessor v0.114.0/go.mod h1:emnnL5CaliCnWjXNpNixqpvn7uc/kyUTv2939J/reMY= -go.opentelemetry.io/collector/processor/memorylimiterprocessor v0.114.0 h1:gfzShbdzhbA2lsRSx2z9i9QO/FJwAzOSrBW2ObPqf38= -go.opentelemetry.io/collector/processor/memorylimiterprocessor v0.114.0/go.mod h1:leElNJO5dnpOg0o1Gr2Ok59HKADRznbrZ3u2oTfx50Q= -go.opentelemetry.io/collector/processor/processorhelper/processorhelperprofiles v0.114.0 h1:/CQJ0UQRStwBQnM4Z9lTr6D4IqEKH1iuUWVr21fP4To= -go.opentelemetry.io/collector/processor/processorhelper/processorhelperprofiles v0.114.0/go.mod h1:HD2uDr7TIWQ+TsXBLmrHu396EeClj7YNoNzoWJw4jrY= -go.opentelemetry.io/collector/processor/processorprofiles v0.114.0 h1:+P/1nLouEXTnN8DVQl+qWwO4BTkQyNPG9t/FrpUqrSI= -go.opentelemetry.io/collector/processor/processorprofiles v0.114.0/go.mod h1:3fuHeNIpINwx3bqFMprmDJyr6y5tWoWbJH599kltO5Y= -go.opentelemetry.io/collector/processor/processortest v0.114.0 h1:3FTaVXAp0LoVmUJn1ewBFckAby7AHa6/Kcdj0xuW14c= -go.opentelemetry.io/collector/processor/processortest v0.114.0/go.mod h1:OgsdOs1Fv5ZGTTJPF5nNIUJh2YkuV1acWd73yWgnti4= -go.opentelemetry.io/collector/receiver v0.114.0 h1:90SAnXAjNq7/k52/pFmmb06Cf1YauoPYtbio4aOXafY= -go.opentelemetry.io/collector/receiver v0.114.0/go.mod h1:KUGT0/D953LXbGH/D3lLPU8yrU3HfWnUqpt4W4hSOnE= -go.opentelemetry.io/collector/receiver/nopreceiver v0.114.0 h1:CMtfS6fwEwqwTMeC17A3Q2xsSkXfH4gG2SBZDr2txCw= -go.opentelemetry.io/collector/receiver/nopreceiver v0.114.0/go.mod h1:ajp6ok8iSSAcyq58wcOUJVe++1mTQ1isxqlaNUgQNzo= -go.opentelemetry.io/collector/receiver/otlpreceiver v0.114.0 h1:8ASaxRWLe8P0pefOiYbCSZ0aXmwE4K06I8FBGc/n+J0= -go.opentelemetry.io/collector/receiver/otlpreceiver v0.114.0/go.mod h1:3vjOvYBWGUVzuaovoumMbNHEIK3PqDs5rzEyd/nzsLU= -go.opentelemetry.io/collector/receiver/receiverprofiles v0.114.0 h1:ibhEfGpvNB3yrtpl2jYFabrunMk1hurxvMYpM0b1Ck4= -go.opentelemetry.io/collector/receiver/receiverprofiles v0.114.0/go.mod h1:UZyRfaasw+NLvN10AN8IQnmj5tQ3BOUH1uP2ctpO9f0= -go.opentelemetry.io/collector/receiver/receivertest v0.114.0 h1:D+Kh9t2n4asTnM+TiSxbrKlUemLZandWntj17BJWWb0= -go.opentelemetry.io/collector/receiver/receivertest v0.114.0/go.mod h1:mNSHQ13vFmqD+VAcRzLjStFBejbcWUn2Mp0pAd7Op+U= -go.opentelemetry.io/collector/semconv v0.114.0 h1:/eKcCJwZepQUtEuFuxa0thx2XIOvhFpaf214ZG1a11k= -go.opentelemetry.io/collector/semconv v0.114.0/go.mod h1:zCJ5njhWpejR+A40kiEoeFm1xq1uzyZwMnRNX6/D82A= -go.opentelemetry.io/collector/service v0.114.0 h1:MYF/4nH1CgtiLx09503xPAAUZefCzG1kaO+oanwX590= -go.opentelemetry.io/collector/service v0.114.0/go.mod h1:xH5/RapJdf5Ohh8iU8J0ZstfFYciP1oJPesiByteZxo= +go.opentelemetry.io/collector v0.115.0 h1:qUZ0bTeNBudMxNQ7FJKS//TxTjeJ7tfU/z22mcFavWU= +go.opentelemetry.io/collector v0.115.0/go.mod h1:66qx0xKnVvdwq60e1DEfb4e+zmM9szhPsv2hxZ/Mpj4= +go.opentelemetry.io/collector/client v1.21.0 h1:3Kes8lOFMYVxoxeAmX+DTEAkuS1iTA3NkSfqzGmygJA= +go.opentelemetry.io/collector/client v1.21.0/go.mod h1:jYJGiL0UA975OOyHmjbQSokNWt1OiviI5KjPOMUMGwc= +go.opentelemetry.io/collector/component v0.115.0 h1:iLte1oCiXzjiCnaOBKdsXacfFiECecpWxW3/LeriMoo= +go.opentelemetry.io/collector/component v0.115.0/go.mod h1:oIUFiH7w1eOimdeYhFI+gAIxYSiLDocKVJ0PTvX7d6s= +go.opentelemetry.io/collector/component/componentstatus v0.115.0 h1:pbpUIL+uKDfEiSgKK+S5nuSL6MDIIQYsp4b65ZGVb9M= +go.opentelemetry.io/collector/component/componentstatus v0.115.0/go.mod h1:36A+9XSiOz0Cdhq+UwwPRlEr5CYuSkEnVO9om4BH7d0= +go.opentelemetry.io/collector/component/componenttest v0.115.0 h1:9URDJ9VyP6tuij+YHjp/kSSMecnZOd7oGvzu+rw9SJY= +go.opentelemetry.io/collector/component/componenttest v0.115.0/go.mod h1:PzXvNqKLCiSADZGZFKH+IOHMkaQ0GTHuzysfVbTPKYY= +go.opentelemetry.io/collector/config/configauth v0.115.0 h1:xa+ALdyPgva3rZnLBh1H2oS5MsHP6JxSqMtQmcELnys= +go.opentelemetry.io/collector/config/configauth v0.115.0/go.mod h1:C7anpb3Rf4KswMT+dgOzkW9UX0z/65PLORpUw3p0VYc= +go.opentelemetry.io/collector/config/configcompression v1.21.0 h1:0zbPdZAgPFMAarwJEC4gaR6f/JBP686A3TYSgb3oa+E= +go.opentelemetry.io/collector/config/configcompression v1.21.0/go.mod h1:LvYG00tbPTv0NOLoZN0wXq1F5thcxvukO8INq7xyfWU= +go.opentelemetry.io/collector/config/configgrpc v0.115.0 h1:gZzXSFe6hB3RUcEeAYqk1yT+TBa+X9tp6/1x29Yg2yk= +go.opentelemetry.io/collector/config/configgrpc v0.115.0/go.mod h1:107lRZ5LdQPMdGJGd4m1GhyKxyH0az2cUOqrJgTEN8E= +go.opentelemetry.io/collector/config/confighttp v0.115.0 h1:BIy394oNXnqySJwrCqgAJu4gWgAV5aQUDD6k1hy6C8o= +go.opentelemetry.io/collector/config/confighttp v0.115.0/go.mod h1:Wr50ut12NmCEAl4bWLJryw2EjUmJTtYRg89560Q51wc= +go.opentelemetry.io/collector/config/confignet v1.21.0 h1:PeQ5YrMnfftysFL/WVaSrjPOWjD6DfeABY50pf9CZxU= +go.opentelemetry.io/collector/config/confignet v1.21.0/go.mod h1:ZppUH1hgUJOubawEsxsQ9MzEYFytqo2GnVSS7d4CVxc= +go.opentelemetry.io/collector/config/configopaque v1.21.0 h1:PcvRGkBk4Px8BQM7tX+kw4i3jBsfAHGoGQbtZg6Ox7U= +go.opentelemetry.io/collector/config/configopaque v1.21.0/go.mod h1:sW0t0iI/VfRL9VYX7Ik6XzVgPcR+Y5kejTLsYcMyDWs= +go.opentelemetry.io/collector/config/configretry v1.21.0 h1:ZHoOvAkEcv5BBeaJn8IQ6rQ4GMPZWW4S+W7R4QTEbZU= +go.opentelemetry.io/collector/config/configretry v1.21.0/go.mod h1:cleBc9I0DIWpTiiHfu9v83FUaCTqcPXmebpLxjEIqro= +go.opentelemetry.io/collector/config/configtelemetry v0.115.0 h1:U07FinCDop+r2RjWQ3aP9ZWONC7r7kQIp1GkXQi6nsI= +go.opentelemetry.io/collector/config/configtelemetry v0.115.0/go.mod h1:SlBEwQg0qly75rXZ6W1Ig8jN25KBVBkFIIAUI1GiAAE= +go.opentelemetry.io/collector/config/configtls v1.21.0 h1:ZfrlAYgBD8lzp04W0GxwiDmUbrvKsvDYJi+wkyiXlpA= +go.opentelemetry.io/collector/config/configtls v1.21.0/go.mod h1:5EsNefPfVCMOTlOrr3wyj7LrsOgY7V8iqRl8oFZEqtw= +go.opentelemetry.io/collector/config/internal v0.115.0 h1:eVk57iufZpUXyPJFKTb1Ebx5tmcCyroIlt427r5pxS8= +go.opentelemetry.io/collector/config/internal v0.115.0/go.mod h1:OVkadRWlKAoWjHslqjWtBLAne8ceQm8WYT71ZcBWLFc= +go.opentelemetry.io/collector/confmap v1.21.0 h1:1tIcx2/Suwg8VhuPmQw87ba0ludPmumpFCFRZZa6RXA= +go.opentelemetry.io/collector/confmap v1.21.0/go.mod h1:Rrhs+MWoaP6AswZp+ReQ2VO9dfOfcUjdjiSHBsG+nec= +go.opentelemetry.io/collector/confmap/provider/envprovider v1.21.0 h1:YLf++Z8CMp86AanfOCWUiE7vKbb1kSjgC3a9VJoxbD4= +go.opentelemetry.io/collector/confmap/provider/envprovider v1.21.0/go.mod h1:aSWLYcmgZZJDNtWN1M8JKQuehoGgOxibl1KuvKTar4M= +go.opentelemetry.io/collector/confmap/provider/fileprovider v1.21.0 h1:+zukkM+3l426iGoJkXTpLB2Z8QnZFu26TkGPjh5Rn/4= +go.opentelemetry.io/collector/confmap/provider/fileprovider v1.21.0/go.mod h1:BXBpQhF3n4CNLYO2n/mWZPd2U9ekpbLXLRGZrun1VfI= +go.opentelemetry.io/collector/confmap/provider/httpprovider v1.21.0 h1:NYYGM+SgIlTuNGjd8eGzDr8DkvOe4q7cXon8djF9yyI= +go.opentelemetry.io/collector/confmap/provider/httpprovider v1.21.0/go.mod h1:XRYbuwqq1awFuNhLDUv4aSvn6MzqX+abcevx1O+APJI= +go.opentelemetry.io/collector/confmap/provider/httpsprovider v1.21.0 h1:2EEUI2DzA2DvrvCImMWRSNqIHdRJ6+qbgvZL44Zb2ac= +go.opentelemetry.io/collector/confmap/provider/httpsprovider v1.21.0/go.mod h1:axezjjQWY4kZc5pr/+wOKAuqSYMhea/tWzP5S30h+dc= +go.opentelemetry.io/collector/confmap/provider/yamlprovider v1.21.0 h1:P3Q9RytCMY76ORPCnkkjOa4fkuFqmZiQRor+F/nPlYE= +go.opentelemetry.io/collector/confmap/provider/yamlprovider v1.21.0/go.mod h1:xhYhHK3yLQ78tsoaKPIGUfFulgy961ImOe2gATH3RQc= +go.opentelemetry.io/collector/connector v0.115.0 h1:4Kkm3HQFzNT1eliMOB8FbIn+PLMRJ2qQku5Vmy3V8Ko= +go.opentelemetry.io/collector/connector v0.115.0/go.mod h1:+ByuAmYLrYHoKh9B+LGqUc0N2kXcN2l8Dea8Mp6brZ8= +go.opentelemetry.io/collector/connector/connectorprofiles v0.115.0 h1:aW1f4Az0I+QJyImFccNWAXqik80bnNu27aQqi2hFfD8= +go.opentelemetry.io/collector/connector/connectorprofiles v0.115.0/go.mod h1:lmynB1CucydOsHa8RSSBh5roUZPfuiv65imXhtNzClM= +go.opentelemetry.io/collector/connector/connectortest v0.115.0 h1:GjtourFr0MJmlbtEPAZ/1BZCxkNAeJ0aMTlrxwftJ0k= +go.opentelemetry.io/collector/connector/connectortest v0.115.0/go.mod h1:f3KQXXNlh/XuV8elmnuVVyfY92dJCAovz10gD72OH0k= +go.opentelemetry.io/collector/consumer v1.21.0 h1:THKZ2Vbi6GkamjTBI2hFq5Dc4kINZTWGwQNa8d/Ty9g= +go.opentelemetry.io/collector/consumer v1.21.0/go.mod h1:FQcC4ThMtRYY41dv+IPNK8POLLhAFY3r1YR5fuP7iiY= +go.opentelemetry.io/collector/consumer/consumererror v0.115.0 h1:yli//xBCQMPZKXNgNlXemo4dvqhnFrAmCZ11DvQgmcY= +go.opentelemetry.io/collector/consumer/consumererror v0.115.0/go.mod h1:LwVzAvQ6ZVNG7mbOvurbAo+W/rKws0IcjOwriuZXqPE= +go.opentelemetry.io/collector/consumer/consumererror/consumererrorprofiles v0.115.0 h1:gaIhzpaGFWauiyznrQ3f++TbcdXxA5rpsX3L9uGjMM8= +go.opentelemetry.io/collector/consumer/consumererror/consumererrorprofiles v0.115.0/go.mod h1:7oXvuGBSawS5bc413lh1KEMcXkqBcrCqZQahOdnE24U= +go.opentelemetry.io/collector/consumer/consumerprofiles v0.115.0 h1:H3fDuyQW1t2HWHkz96WMBQJKUevypOCjBqnqtaAWyoA= +go.opentelemetry.io/collector/consumer/consumerprofiles v0.115.0/go.mod h1:IzEmZ91Tp7TBxVDq8Cc9xvLsmO7H08njr6Pu9P5d9ns= +go.opentelemetry.io/collector/consumer/consumertest v0.115.0 h1:hru0I2447y0TluCdwlKYFFtgcpyCnlM+LiOK1JZyA70= +go.opentelemetry.io/collector/consumer/consumertest v0.115.0/go.mod h1:ybjALRJWR6aKNOzEMy1T1ruCULVDEjj4omtOJMrH/kU= +go.opentelemetry.io/collector/exporter v0.115.0 h1:JnxfpOnsuqhTPKJXVKJLS1Cv3BiVrVLzpHOjJEQw+xw= +go.opentelemetry.io/collector/exporter v0.115.0/go.mod h1:xof3fHQK8wADhaKLIJcQ7ChZaFLNC+haRdPN0wgl6kY= +go.opentelemetry.io/collector/exporter/debugexporter v0.115.0 h1:gb9VMQhcbvYqp0SJ4Hp8R9XqOLNLsoTgNJCPKpNEaVc= +go.opentelemetry.io/collector/exporter/debugexporter v0.115.0/go.mod h1:H/HS1UJlcZPNBbOcrsGZc2sPdQDHtbOjHOxMtJkmlcU= +go.opentelemetry.io/collector/exporter/exporterhelper/exporterhelperprofiles v0.115.0 h1:fetbc740pODH6JW+H49SW0hiAJwQE+/B0SbuIlaY2rg= +go.opentelemetry.io/collector/exporter/exporterhelper/exporterhelperprofiles v0.115.0/go.mod h1:oEKZ/d5BeaCK6Made9iwaeqmlT4lRbJSlW9nhIn/TwM= +go.opentelemetry.io/collector/exporter/exporterprofiles v0.115.0 h1:lSQEleCn/q9eFufcuK61NdFKU70ZlgI9dBjPCO/4CrE= +go.opentelemetry.io/collector/exporter/exporterprofiles v0.115.0/go.mod h1:7l5K2AecimX2kx+nZC1gKG3QkP247CO1+SodmJ4fFkQ= +go.opentelemetry.io/collector/exporter/exportertest v0.115.0 h1:P9SMTUXQOtcaq40bGtnnAe14zRmR4/yUgj/Tb2BEf/k= +go.opentelemetry.io/collector/exporter/exportertest v0.115.0/go.mod h1:1jMZ9gFGXglb8wfNrBZIgd+RvpZhSyFwdfE+Jtf9w4U= +go.opentelemetry.io/collector/exporter/nopexporter v0.115.0 h1:ufwLbNp7mfoSxWJcoded3D9f/nIVvCwNa/0+ZqxzkzU= +go.opentelemetry.io/collector/exporter/nopexporter v0.115.0/go.mod h1:iIJgru1t+VJVVCE5KMAKjXbq9RkK4/5FCClnWnAlGtc= +go.opentelemetry.io/collector/exporter/otlpexporter v0.115.0 h1:Kqr31VFrQvgEMzeg8T1JSXWacjUQoZph39efKN8jBpY= +go.opentelemetry.io/collector/exporter/otlpexporter v0.115.0/go.mod h1:5uy/gduFx2mH0GxJ84sY75NfzQJb9xYmgiL9Pf0dKF8= +go.opentelemetry.io/collector/exporter/otlphttpexporter v0.115.0 h1:I0qzSWGbgph+iva5/jU8tkeUTkkqqcj8+UzMxg5ubF8= +go.opentelemetry.io/collector/exporter/otlphttpexporter v0.115.0/go.mod h1:cUrv5EG12iOs5MXaecfi9K+ZATEELefpyZY6Hj4NlUo= +go.opentelemetry.io/collector/extension v0.115.0 h1:/cBb8AUdD0KMWC6V3lvCC16eP9Fg0wd1Upcp5rgvuGI= +go.opentelemetry.io/collector/extension v0.115.0/go.mod h1:HI7Ak6loyi6ZrZPsQJW1OO1wbaAW8OqXLFNQlTZnreQ= +go.opentelemetry.io/collector/extension/auth v0.115.0 h1:TTMokbBsSHZRFH48PvGSJmgSS8F3Rkr9MWGHZn8eJDk= +go.opentelemetry.io/collector/extension/auth v0.115.0/go.mod h1:3w+2mzeb2OYNOO4Bi41TUo4jr32ap2y7AOq64IDpxQo= +go.opentelemetry.io/collector/extension/auth/authtest v0.115.0 h1:OZe7dKbZ01qodSpZU0ZYzI6zpmmzJ3UvfdBSFAbSgDw= +go.opentelemetry.io/collector/extension/auth/authtest v0.115.0/go.mod h1:fk9WCXP0x91Q64Z8HZKWTHh9PWtgoWE1KXe3n2Bff3U= +go.opentelemetry.io/collector/extension/experimental/storage v0.115.0 h1:sZXw0+77092pq24CkUoTRoHQPLQUsDq6HFRNB0g5yR4= +go.opentelemetry.io/collector/extension/experimental/storage v0.115.0/go.mod h1:qjFH7Y3QYYs88By2ZB5GMSUN5k3ul4Brrq2J6lKACA0= +go.opentelemetry.io/collector/extension/extensioncapabilities v0.115.0 h1:/g25Hp5aoCNKdDjIb3Fc7XRglO8yaBRFLO/IUNPnqNI= +go.opentelemetry.io/collector/extension/extensioncapabilities v0.115.0/go.mod h1:EQx7ETiy330O6q05S2KRZsRNDg0aQEeJmVl7Ipx+Fcw= +go.opentelemetry.io/collector/extension/extensiontest v0.115.0 h1:GBVFxFEskR8jSdu9uaQh2qpXnN5VNXhXjpJ2UjxtE8I= +go.opentelemetry.io/collector/extension/extensiontest v0.115.0/go.mod h1:eu1ecbz5mT+cHoH2H3GmD/rOO0WsicSJD2RLrYuOmRA= +go.opentelemetry.io/collector/extension/zpagesextension v0.115.0 h1:zYrZZocc7n0ZuDyXNkIaX0P0qk2fjMQj7NegwBJZA4k= +go.opentelemetry.io/collector/extension/zpagesextension v0.115.0/go.mod h1:OaXwNHF3MAcInBzCXrhXbTNHfIi9b7YGhXjtCFZqxNY= +go.opentelemetry.io/collector/featuregate v1.21.0 h1:+EULHPJDLMipcwAGZVp9Nm8NriRvoBBMxp7MSiIZVMI= +go.opentelemetry.io/collector/featuregate v1.21.0/go.mod h1:3GaXqflNDVwWndNGBJ1+XJFy3Fv/XrFgjMN60N3z7yg= +go.opentelemetry.io/collector/filter v0.115.0 h1:pYnHUFDSHSjEIFZit+CU09itVkDXgV+WcV2HOkjvQcE= +go.opentelemetry.io/collector/filter v0.115.0/go.mod h1:aewQ+jmvpH88gPVWpNXiWSm+wwJVxTK4f23ex2NMd2c= +go.opentelemetry.io/collector/internal/fanoutconsumer v0.115.0 h1:6DRiSECeApFq6Jj5ug77rG53R6FzJEZBfygkyMEXdpg= +go.opentelemetry.io/collector/internal/fanoutconsumer v0.115.0/go.mod h1:vgQf5HQdmLQqpDHpDq2S3nTRoUuKtRcZpRTsy+UiwYw= +go.opentelemetry.io/collector/internal/memorylimiter v0.115.0 h1:U07IJxyHZXM6eLn8cOq/Lycx6DhQZhpDOuYtIRw/d6I= +go.opentelemetry.io/collector/internal/memorylimiter v0.115.0/go.mod h1:KNcU8WVpW5y7Ij6CGnsefb7q1UZT7VvrTDhe5FKNOA4= +go.opentelemetry.io/collector/internal/sharedcomponent v0.115.0 h1:9TL6T6ALqDpumUJ0tYIuPIg5LGo4r6eoqlNArYX116o= +go.opentelemetry.io/collector/internal/sharedcomponent v0.115.0/go.mod h1:SgBLKMh11bOTPR1bdDZbi5MlqsoDBBFI3uBIwnei+0k= +go.opentelemetry.io/collector/otelcol v0.115.0 h1:wZhFGrSCZcTQ4qw4ePjI2PaSrOCejoQKAjprKD/xavs= +go.opentelemetry.io/collector/otelcol v0.115.0/go.mod h1:iK8DPvaizirIYKDl1zZG7DDYUj6GkkH4KHifVVM88vk= +go.opentelemetry.io/collector/otelcol/otelcoltest v0.115.0 h1:HNlFpQujlnvawBk8nvMGxzjDHWDCfSprxem/EpQn4u8= +go.opentelemetry.io/collector/otelcol/otelcoltest v0.115.0/go.mod h1:WsMbqYl2rm3nPFbdxQqyLXf4iu97nYLeuQ1seZIpV3Y= +go.opentelemetry.io/collector/pdata v1.21.0 h1:PG+UbiFMJ35X/WcAR7Rf/PWmWtRdW0aHlOidsR6c5MA= +go.opentelemetry.io/collector/pdata v1.21.0/go.mod h1:GKb1/zocKJMvxKbS+sl0W85lxhYBTFJ6h6I1tphVyDU= +go.opentelemetry.io/collector/pdata/pprofile v0.115.0 h1:NI89hy13vNDw7EOnQf7Jtitks4HJFO0SUWznTssmP94= +go.opentelemetry.io/collector/pdata/pprofile v0.115.0/go.mod h1:jGzdNfO0XTtfLjXCL/uCC1livg1LlfR+ix2WE/z3RpQ= +go.opentelemetry.io/collector/pdata/testdata v0.115.0 h1:Rblz+AKXdo3fG626jS+KSd0OSA4uMXcTQfpwed6P8LI= +go.opentelemetry.io/collector/pdata/testdata v0.115.0/go.mod h1:inNnRt6S2Nn260EfCBEcjesjlKOSsr0jPwkPqpBkt4s= +go.opentelemetry.io/collector/pipeline v0.115.0 h1:bmACBqb0e8U9ag+vGGHUP7kCfAO7HHROdtzIEg8ulus= +go.opentelemetry.io/collector/pipeline v0.115.0/go.mod h1:qE3DmoB05AW0C3lmPvdxZqd/H4po84NPzd5MrqgtL74= +go.opentelemetry.io/collector/pipeline/pipelineprofiles v0.115.0 h1:3l9ruCAOrssTUDnyChKNzHWOdTtfThnYaoPZ1/+5sD0= +go.opentelemetry.io/collector/pipeline/pipelineprofiles v0.115.0/go.mod h1:2Myg+law/5lcezo9PhhZ0wjCaLYdGK24s1jDWbSW9VY= +go.opentelemetry.io/collector/processor v0.115.0 h1:+fveHGRe24PZPv/F5taahGuZ9HdNW44hgNWEJhIUdyc= +go.opentelemetry.io/collector/processor v0.115.0/go.mod h1:/oLHBlLsm7tFb7zOIrA5C0j14yBtjXKAgxJJ2Bktyk4= +go.opentelemetry.io/collector/processor/batchprocessor v0.115.0 h1:dgw1jcE/YVFTs41b3Y7SerU3BBSyMEE93AYV+BAxR8E= +go.opentelemetry.io/collector/processor/batchprocessor v0.115.0/go.mod h1:imG1kDEq14UGlxyCjSCf1TUEFdSWRvF7tLoYX9nixEQ= +go.opentelemetry.io/collector/processor/memorylimiterprocessor v0.115.0 h1:LCA2jwxy1PRc7X/AtRJfMdOANh5rVLdwo5PAM+gAuyo= +go.opentelemetry.io/collector/processor/memorylimiterprocessor v0.115.0/go.mod h1:gPcHyza7Rek3jfrQFxw99fcWBDkkRqBaMHcUz9yYv5I= +go.opentelemetry.io/collector/processor/processorhelper/processorhelperprofiles v0.115.0 h1:r1UF8LPICTRXBL0685zV/CC8J4sWg/qm1g+sHOYMq2Y= +go.opentelemetry.io/collector/processor/processorhelper/processorhelperprofiles v0.115.0/go.mod h1:3erq5umu5a7DKXo4PBm4I5yJjc6r0aJNvBV2nVSPDuE= +go.opentelemetry.io/collector/processor/processorprofiles v0.115.0 h1:cCZAs+FXaebZPppqAN3m+X3etoSBL6NvyQo8l0hOZoo= +go.opentelemetry.io/collector/processor/processorprofiles v0.115.0/go.mod h1:kMxF0gknlWX4duuAJFi2/HuIRi6C3w95tOenRa0GKOY= +go.opentelemetry.io/collector/processor/processortest v0.115.0 h1:j9HEaYFOeOB6VYl9zGhBnhQbTkqGBa2udUvu5NTh6hc= +go.opentelemetry.io/collector/processor/processortest v0.115.0/go.mod h1:Gws+VEnp/eW3qAqPpqbKsrbnnxxNfyDjqrfUXbZfZic= +go.opentelemetry.io/collector/receiver v0.115.0 h1:55Q3Jvj6zHCIA1psKqi/3kEMJO4OqUF5tNAEYNdB1U8= +go.opentelemetry.io/collector/receiver v0.115.0/go.mod h1:nBSCh2O/WUcfgpJ+Jpz+B0z0Hn5jHeRvF2WmLij5EIY= +go.opentelemetry.io/collector/receiver/nopreceiver v0.115.0 h1:87dxAcHekbXqLtjcQjnK1An2PWkWAhTly+EXzPEgYOE= +go.opentelemetry.io/collector/receiver/nopreceiver v0.115.0/go.mod h1:Llu88KNSNwvmYPRr2PMDDbVY9zHfHEbPPB4yTjjQQe0= +go.opentelemetry.io/collector/receiver/otlpreceiver v0.115.0 h1:NqMWsGuVy6y6VKTaPeJS7NZ9KAxhE/xyGUC7GaLYm/o= +go.opentelemetry.io/collector/receiver/otlpreceiver v0.115.0/go.mod h1:9ituzngnjsh/YvO+Phayq9BTk/nw0rgK5ZVvX1oxULk= +go.opentelemetry.io/collector/receiver/receiverprofiles v0.115.0 h1:R9JLaj2Al93smIPUkbJshAkb/cY0H5JBOxIx+Zu0NG4= +go.opentelemetry.io/collector/receiver/receiverprofiles v0.115.0/go.mod h1:05E5hGujWeeXJmzKZwTdHyZ/+rRyrQlQB5p5Q2XY39M= +go.opentelemetry.io/collector/receiver/receivertest v0.115.0 h1:OiB684SbHQi6/Pd3ZH0cXjYvCpBS9ilQBfTQx0wVXHg= +go.opentelemetry.io/collector/receiver/receivertest v0.115.0/go.mod h1:Y8Z9U/bz9Xpyt8GI8DxZZgryw3mnnIw+AeKVLTD2cP8= +go.opentelemetry.io/collector/scraper v0.115.0 h1:hbfebO7x1Xm96OwqeuLz5w7QAaB3ZMlwOkUo0XzPadc= +go.opentelemetry.io/collector/scraper v0.115.0/go.mod h1:7YoCO6/4PeExLiX1FokcydJGCQUa7lUqZsqXokJ5VZ4= +go.opentelemetry.io/collector/semconv v0.115.0 h1:SoqMvg4ZEB3mz2EdAb6XYa+TuMo5Mir5FRBr3nVFUDY= +go.opentelemetry.io/collector/semconv v0.115.0/go.mod h1:N6XE8Q0JKgBN2fAhkUQtqK9LT7rEGR6+Wu/Rtbal1iI= +go.opentelemetry.io/collector/service v0.115.0 h1:k4GAOiI5tZgB2QKgwA6c3TeAVr7QL/ft5cOQbzUr8Iw= +go.opentelemetry.io/collector/service v0.115.0/go.mod h1:DKde9LMhNebdREecDSsqiTFLI2wRc+IoV4/wGxU6goY= go.opentelemetry.io/contrib/bridges/otelzap v0.6.0 h1:j8icMXyyqNf6HGuwlYhniPnVsbJIq7n+WirDu3VAJdQ= go.opentelemetry.io/contrib/bridges/otelzap v0.6.0/go.mod h1:evIOZpl+kAlU5IsaYX2Siw+IbpacAZvXemVsgt70uvw= go.opentelemetry.io/contrib/config v0.10.0 h1:2JknAzMaYjxrHkTnZh3eOme/Y2P5eHE2SWfhfV6Xd6c= @@ -2091,6 +2277,8 @@ go.opentelemetry.io/otel/trace v1.32.0/go.mod h1:+i4rkvCraA+tG6AzwloGaCtkx53Fa+L go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.opentelemetry.io/proto/otlp v1.3.1 h1:TrMUixzpM0yuc/znrFTP9MMRh8trP93mkCiDVeXrui0= go.opentelemetry.io/proto/otlp v1.3.1/go.mod h1:0X1WI4de4ZsLrrJNLAQbFeLCm3T7yBkR0XqQ7niQU+8= +go.step.sm/crypto v0.44.2 h1:t3p3uQ7raP2jp2ha9P6xkQF85TJZh+87xmjSLaib+jk= +go.step.sm/crypto v0.44.2/go.mod h1:x1439EnFhadzhkuaGX7sz03LEMQ+jV4gRamf5LCZJQQ= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= @@ -2152,8 +2340,8 @@ golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= -golang.org/x/crypto v0.29.0 h1:L5SG1JTTXupVV3n6sUqMTeWbjAyfPwoda2DLX8J8FrQ= -golang.org/x/crypto v0.29.0/go.mod h1:+F4F4N5hv6v38hfeYwTdx20oUvLLc+QfrE9Ax9HtgRg= +golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U= +golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -2164,8 +2352,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f h1:XdNn9LlyWAhLVp6P/i8QYBW+hlyhrhei9uErw2B5GJo= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f/go.mod h1:D5SMRVC3C2/4+F/DB1wZsLRnSNimn2Sp/NPsCrsv8ak= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884 h1:Y/Mj/94zIQQGHVSv1tTtQBDaQaJe62U9bkDZKKyhPCU= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c= golang.org/x/exp/typeparams v0.0.0-20240314144324-c7f7c6466f7f h1:phY1HzDcf18Aq9A8KkmRtY9WvOFIxN8wgfvy6Zm1DV8= golang.org/x/exp/typeparams v0.0.0-20240314144324-c7f7c6466f7f/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= @@ -2262,8 +2450,8 @@ golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= -golang.org/x/net v0.31.0 h1:68CPQngjLL0r2AlUKiSxtQFKvzRVbnzLwMUn5SzcLHo= -golang.org/x/net v0.31.0/go.mod h1:P4fl1q7dY2hnZFxEk4pPSkDHF+QqjitcnDjUQyMM+pM= +golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= +golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190130055435-99b60b757ec1/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -2288,8 +2476,8 @@ golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sync v0.9.0 h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ= -golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= +golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -2383,8 +2571,8 @@ golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.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-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= @@ -2397,8 +2585,8 @@ golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= golang.org/x/term v0.16.0/go.mod h1:yn7UURbUtPyrVJPGPq404EukNFxcm/foM+bV/bfcDsY= golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= -golang.org/x/term v0.26.0 h1:WEQa6V3Gja/BhNxg540hBip/kkaYtRg3cxg4oXSw4AU= -golang.org/x/term v0.26.0/go.mod h1:Si5m1o57C5nBNQo5z1iq+XDijt21BDBDp2bK0QI8e3E= +golang.org/x/term v0.27.0 h1:WP60Sv1nlK1T6SupCHbXzSaN0b9wUmsPoRS9b61A23Q= +golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -2415,8 +2603,8 @@ golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= -golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -2485,8 +2673,8 @@ golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s= golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= golang.org/x/tools v0.17.0/go.mod h1:xsh6VxdV005rRVaS6SSAf9oiAqljS7UZUacMZ8Bnsps= -golang.org/x/tools v0.27.0 h1:qEKojBykQkQ4EynWy4S8Weg69NumxKdn40Fce3uc/8o= -golang.org/x/tools v0.27.0/go.mod h1:sUi0ZgbwW9ZPAq26Ekut+weQPR5eIM6GQLQ1Yjm1H0Q= +golang.org/x/tools v0.28.0 h1:WuB6qZ4RPCQo5aP3WdKZS7i595EdWqWR8vqJTlwTVK8= +golang.org/x/tools v0.28.0/go.mod h1:dcIOrVd3mfQKTgrDVQHqCPMWy6lnhfhtX3hLXYVLfRw= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -2619,6 +2807,8 @@ gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/evanphx/json-patch.v4 v4.12.0 h1:n6jtcsulIzXPJaxegRbvFNNrZDjbij7ny3gmSPG+6V4= gopkg.in/evanphx/json-patch.v4 v4.12.0/go.mod h1:p8EYWUEYMpynmqDbY58zCKCFZw8pRWMG4EsWvDvM72M= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/go-jose/go-jose.v2 v2.6.3 h1:nt80fvSDlhKWQgSWyHyy5CfmlQr+asih51R8PTWNKKs= +gopkg.in/go-jose/go-jose.v2 v2.6.3/go.mod h1:zzZDPkNNw/c9IE7Z9jr11mBZQhKQTMzoEEIoEdZlFBI= gopkg.in/h2non/filetype.v1 v1.0.1/go.mod h1:M0yem4rwSX5lLVrkEuRRp2/NinFMD5vgJ4DlAhZcfNo= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= @@ -2662,13 +2852,13 @@ honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9 honnef.co/go/tools v0.5.1 h1:4bH5o3b5ZULQ4UrBmP+63W9r7qIkqJClEA9ko5YKx+I= honnef.co/go/tools v0.5.1/go.mod h1:e9irvo83WDG9/irijV44wr3tbhcFeRnfpVlRqVwpzMs= k8s.io/api v0.21.1/go.mod h1:FstGROTmsSHBarKc8bylzXih8BLNYTiS3TZcsoEDg2s= -k8s.io/api v0.31.2 h1:3wLBbL5Uom/8Zy98GRPXpJ254nEFpl+hwndmk9RwmL0= -k8s.io/api v0.31.2/go.mod h1:bWmGvrGPssSK1ljmLzd3pwCQ9MgoTsRCuK35u6SygUk= +k8s.io/api v0.31.4 h1:I2QNzitPVsPeLQvexMEsj945QumYraqv9m74isPDKhM= +k8s.io/api v0.31.4/go.mod h1:d+7vgXLvmcdT1BCo79VEgJxHHryww3V5np2OYTr6jdw= k8s.io/apiextensions-apiserver v0.31.2 h1:W8EwUb8+WXBLu56ser5IudT2cOho0gAKeTOnywBLxd0= k8s.io/apiextensions-apiserver v0.31.2/go.mod h1:i+Geh+nGCJEGiCGR3MlBDkS7koHIIKWVfWeRFiOsUcM= k8s.io/apimachinery v0.21.1/go.mod h1:jbreFvJo3ov9rj7eWT7+sYiRx+qZuCYXwWT1bcDswPY= -k8s.io/apimachinery v0.31.2 h1:i4vUt2hPK56W6mlT7Ry+AO8eEsyxMD1U44NR22CLTYw= -k8s.io/apimachinery v0.31.2/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo= +k8s.io/apimachinery v0.31.4 h1:8xjE2C4CzhYVm9DGf60yohpNUh5AEBnPxCryPBECmlM= +k8s.io/apimachinery v0.31.4/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo= k8s.io/apiserver v0.31.2 h1:VUzOEUGRCDi6kX1OyQ801m4A7AUPglpsmGvdsekmcI4= k8s.io/apiserver v0.31.2/go.mod h1:o3nKZR7lPlJqkU5I3Ove+Zx3JuoFjQobGX1Gctw6XuE= k8s.io/autoscaler/vertical-pod-autoscaler v0.13.0 h1:pH6AsxeBZcyX6KBqcnl7SPIJqbN1d59RrEBuIE6Rq6c= @@ -2676,8 +2866,8 @@ k8s.io/autoscaler/vertical-pod-autoscaler v0.13.0/go.mod h1:LraL5kR2xX7jb4VMCG6/ k8s.io/cli-runtime v0.31.2 h1:7FQt4C4Xnqx8V1GJqymInK0FFsoC+fAZtbLqgXYVOLQ= k8s.io/cli-runtime v0.31.2/go.mod h1:XROyicf+G7rQ6FQJMbeDV9jqxzkWXTYD6Uxd15noe0Q= k8s.io/client-go v0.21.1/go.mod h1:/kEw4RgW+3xnBGzvp9IWxKSNA+lXn3A7AuH3gdOAzLs= -k8s.io/client-go v0.31.2 h1:Y2F4dxU5d3AQj+ybwSMqQnpZH9F30//1ObxOKlTI9yc= -k8s.io/client-go v0.31.2/go.mod h1:NPa74jSVR/+eez2dFsEIHNa+3o09vtNaWwWwb1qSxSs= +k8s.io/client-go v0.31.3 h1:CAlZuM+PH2cm+86LOBemaJI/lQ5linJ6UFxKX/SoG+4= +k8s.io/client-go v0.31.3/go.mod h1:2CgjPUTpv3fE5dNygAr2NcM8nhHzXvxB8KL5gYc3kJs= k8s.io/code-generator v0.21.1/go.mod h1:hUlps5+9QaTrKx+jiM4rmq7YmH8wPOIko64uZCHDh6Q= k8s.io/component-base v0.31.2 h1:Z1J1LIaC0AV+nzcPRFqfK09af6bZ4D1nAOpWsy9owlA= k8s.io/component-base v0.31.2/go.mod h1:9PeyyFN/drHjtJZMCTkSpQJS3U9OXORnHQqMLDz0sUQ= @@ -2738,6 +2928,7 @@ modernc.org/strutil v1.2.0 h1:agBi9dp1I+eOnxXeiZawM8F4LawKv4NzGWSaLfyeNZA= modernc.org/strutil v1.2.0/go.mod h1:/mdcBmfOibveCTBxUl5B5l6W+TTH1FXPLHZE6bTosX0= modernc.org/token v1.1.0 h1:Xl7Ap9dKaEs5kLoOQeQmPWevfnk/DM5qcLcYlA8ys6Y= modernc.org/token v1.1.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= +rsc.io/binaryregexp v0.2.0 h1:HfqmD5MEmC0zvwBuF187nq9mdnXjXsSivRiXN7SmRkE= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= @@ -2749,11 +2940,14 @@ sigs.k8s.io/custom-metrics-apiserver v1.30.1-0.20241105195130-84dc8cfe2555 h1:GY sigs.k8s.io/custom-metrics-apiserver v1.30.1-0.20241105195130-84dc8cfe2555/go.mod h1:JL2q3g2QCWnIDvo73jpkksZOVd3ee3FWzZs4EHvx5NE= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= +sigs.k8s.io/release-utils v0.7.7 h1:JKDOvhCk6zW8ipEOkpTGDH/mW3TI+XqtPp16aaQ79FU= +sigs.k8s.io/release-utils v0.7.7/go.mod h1:iU7DGVNi3umZJ8q6aHyUFzsDUIaYwNnNKGHo3YE5E3s= sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= sigs.k8s.io/structured-merge-diff/v4 v4.1.0/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4= sigs.k8s.io/structured-merge-diff/v4 v4.4.1/go.mod h1:N8hJocpFajUSSeSJ9bOZ77VzejKZaXsTtZo4/u7Io08= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= -sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= +software.sslmate.com/src/go-pkcs12 v0.4.0 h1:H2g08FrTvSFKUj+D309j1DPfk5APnIdAQAB8aEykJ5k= +software.sslmate.com/src/go-pkcs12 v0.4.0/go.mod h1:Qiz0EyvDRJjjxGyUQa2cCNZn/wMyzrRJ/qcDXOQazLI= diff --git a/go.work b/go.work index 880b236237204..c7c6ebf27d3ff 100644 --- a/go.work +++ b/go.work @@ -17,6 +17,7 @@ use ( comp/core/secrets comp/core/status comp/core/status/statusimpl + comp/core/tagger/origindetection comp/core/tagger/tags comp/core/tagger/types comp/core/tagger/utils diff --git a/internal/tools/go.mod b/internal/tools/go.mod index 64be9555db011..62a9752009b0f 100644 --- a/internal/tools/go.mod +++ b/internal/tools/go.mod @@ -31,8 +31,8 @@ require ( github.com/Masterminds/semver/v3 v3.3.1 // indirect github.com/Microsoft/go-winio v0.6.2 // indirect github.com/OpenPeeDeeP/depguard/v2 v2.2.0 // indirect - github.com/ProtonMail/go-crypto v1.1.0-alpha.0 // indirect - github.com/alecthomas/assert/v2 v2.3.0 // indirect + github.com/ProtonMail/go-crypto v1.1.3 // indirect + github.com/alecthomas/assert/v2 v2.6.0 // indirect github.com/alecthomas/go-check-sumtype v0.1.4 // indirect github.com/alexkohler/nakedret/v2 v2.0.4 // indirect github.com/alexkohler/prealloc v1.0.0 // indirect @@ -56,7 +56,7 @@ require ( github.com/chavacava/garif v0.1.0 // indirect github.com/chigopher/pathlib v0.19.1 // indirect github.com/ckaznocha/intrange v0.1.2 // indirect - github.com/cloudflare/circl v1.3.7 // indirect + github.com/cloudflare/circl v1.3.8 // indirect github.com/curioswitch/go-reassign v0.2.0 // indirect github.com/cyphar/filepath-securejoin v0.3.4 // indirect github.com/daixiang0/gci v0.13.4 // indirect @@ -223,16 +223,16 @@ require ( go.uber.org/automaxprocs v1.6.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect - golang.org/x/crypto v0.29.0 // indirect - golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f // indirect + golang.org/x/crypto v0.31.0 // indirect + golang.org/x/exp v0.0.0-20241210194714-1829a127f884 // indirect golang.org/x/exp/typeparams v0.0.0-20240314144324-c7f7c6466f7f // indirect golang.org/x/mod v0.22.0 // indirect - golang.org/x/net v0.31.0 // indirect - golang.org/x/sync v0.9.0 // indirect - golang.org/x/sys v0.27.0 // indirect - golang.org/x/term v0.26.0 // indirect - golang.org/x/text v0.20.0 // indirect - golang.org/x/tools v0.27.0 // indirect + golang.org/x/net v0.33.0 // indirect + golang.org/x/sync v0.10.0 // indirect + golang.org/x/sys v0.28.0 // indirect + golang.org/x/term v0.27.0 // indirect + golang.org/x/text v0.21.0 // indirect + golang.org/x/tools v0.28.0 // indirect gonum.org/v1/gonum v0.15.1 // indirect google.golang.org/protobuf v1.35.2 // indirect gopkg.in/ini.v1 v1.67.0 // indirect diff --git a/internal/tools/go.sum b/internal/tools/go.sum index 92b0781179c08..832b2df4aa05e 100644 --- a/internal/tools/go.sum +++ b/internal/tools/go.sum @@ -32,18 +32,18 @@ github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERo github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/OpenPeeDeeP/depguard/v2 v2.2.0 h1:vDfG60vDtIuf0MEOhmLlLLSzqaRM8EMcgJPdp74zmpA= github.com/OpenPeeDeeP/depguard/v2 v2.2.0/go.mod h1:CIzddKRvLBC4Au5aYP/i3nyaWQ+ClszLIuVocRiCYFQ= -github.com/ProtonMail/go-crypto v1.1.0-alpha.0 h1:nHGfwXmFvJrSR9xu8qL7BkO4DqTHXE9N5vPhgY2I+j0= -github.com/ProtonMail/go-crypto v1.1.0-alpha.0/go.mod h1:rA3QumHc/FZ8pAHreoekgiAbzpNsfQAosU5td4SnOrE= +github.com/ProtonMail/go-crypto v1.1.3 h1:nRBOetoydLeUb4nHajyO2bKqMLfWQ/ZPwkXqXxPxCFk= +github.com/ProtonMail/go-crypto v1.1.3/go.mod h1:rA3QumHc/FZ8pAHreoekgiAbzpNsfQAosU5td4SnOrE= github.com/aclements/go-gg v0.0.0-20170118225347-6dbb4e4fefb0/go.mod h1:55qNq4vcpkIuHowELi5C8e+1yUHtoLoOUR9QU5j7Tes= github.com/aclements/go-moremath v0.0.0-20161014184102-0ff62e0875ff/go.mod h1:idZL3yvz4kzx1dsBOAC+oYv6L92P1oFEhUXUB1A/lwQ= github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7/go.mod h1:6zEj6s6u/ghQa61ZWa/C2Aw3RkjiTBOix7dkqa1VLIs= -github.com/alecthomas/assert/v2 v2.3.0 h1:mAsH2wmvjsuvyBvAmCtm7zFsBlb8mIHx5ySLVdDZXL0= -github.com/alecthomas/assert/v2 v2.3.0/go.mod h1:pXcQ2Asjp247dahGEmsZ6ru0UVwnkhktn7S0bBDLxvQ= +github.com/alecthomas/assert/v2 v2.6.0 h1:o3WJwILtexrEUk3cUVal3oiQY2tfgr/FHWiz/v2n4FU= +github.com/alecthomas/assert/v2 v2.6.0/go.mod h1:Bze95FyfUr7x34QZrjL+XP+0qgp/zg8yS+TtBj1WA3k= github.com/alecthomas/go-check-sumtype v0.1.4 h1:WCvlB3l5Vq5dZQTFmodqL2g68uHiSwwlWcT5a2FGK0c= github.com/alecthomas/go-check-sumtype v0.1.4/go.mod h1:WyYPfhfkdhyrdaligV6svFopZV8Lqdzn5pyVBaV6jhQ= -github.com/alecthomas/repr v0.2.0 h1:HAzS41CIzNW5syS8Mf9UwXhNH1J9aix/BvDRf1Ml2Yk= -github.com/alecthomas/repr v0.2.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4= +github.com/alecthomas/repr v0.4.0 h1:GhI2A8MACjfegCPVq9f1FLvIBS+DrQ2KQBFZP1iFzXc= +github.com/alecthomas/repr v0.4.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4= github.com/alexkohler/nakedret/v2 v2.0.4 h1:yZuKmjqGi0pSmjGpOC016LtPJysIL0WEUiaXW5SUnNg= github.com/alexkohler/nakedret/v2 v2.0.4/go.mod h1:bF5i0zF2Wo2o4X4USt9ntUWve6JbFv02Ff4vlkmS/VU= github.com/alexkohler/prealloc v1.0.0 h1:Hbq0/3fJPQhNkN0dR95AVrr6R7tou91y0uHG5pOcUuw= @@ -93,8 +93,8 @@ github.com/chigopher/pathlib v0.19.1 h1:RoLlUJc0CqBGwq239cilyhxPNLXTK+HXoASGyGzn github.com/chigopher/pathlib v0.19.1/go.mod h1:tzC1dZLW8o33UQpWkNkhvPwL5n4yyFRFm/jL1YGWFvY= github.com/ckaznocha/intrange v0.1.2 h1:3Y4JAxcMntgb/wABQ6e8Q8leMd26JbX2790lIss9MTI= github.com/ckaznocha/intrange v0.1.2/go.mod h1:RWffCw/vKBwHeOEwWdCikAtY0q4gGt8VhJZEEA5n+RE= -github.com/cloudflare/circl v1.3.7 h1:qlCDlTPz2n9fu58M0Nh1J/JzcFpfgkFHHX3O35r5vcU= -github.com/cloudflare/circl v1.3.7/go.mod h1:sRTcRWXGLrKw6yIGJ+l7amYJFfAXbZG0kBSc8r4zxgA= +github.com/cloudflare/circl v1.3.8 h1:j+V8jJt09PoeMFIu2uh5JUyEaIHTXVOHslFoLNAKqwI= +github.com/cloudflare/circl v1.3.8/go.mod h1:PDRU+oXvdD7KCtgKxW95M5Z8BpSCJXQORiZFnBQS5QU= github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= @@ -589,14 +589,14 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= golang.org/x/crypto v0.11.0/go.mod h1:xgJhtzW8F9jGdVFWZESrid1U1bjeNy4zgy5cRr/CIio= -golang.org/x/crypto v0.29.0 h1:L5SG1JTTXupVV3n6sUqMTeWbjAyfPwoda2DLX8J8FrQ= -golang.org/x/crypto v0.29.0/go.mod h1:+F4F4N5hv6v38hfeYwTdx20oUvLLc+QfrE9Ax9HtgRg= +golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U= +golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190731235908-ec7cb31e5a56/go.mod h1:JhuoJpWY28nO4Vef9tZUw9qufEGTyX1+7lmHxV5q5G4= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f h1:XdNn9LlyWAhLVp6P/i8QYBW+hlyhrhei9uErw2B5GJo= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f/go.mod h1:D5SMRVC3C2/4+F/DB1wZsLRnSNimn2Sp/NPsCrsv8ak= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884 h1:Y/Mj/94zIQQGHVSv1tTtQBDaQaJe62U9bkDZKKyhPCU= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c= golang.org/x/exp/typeparams v0.0.0-20220428152302-39d4317da171/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= golang.org/x/exp/typeparams v0.0.0-20230203172020-98cc5a0785f9/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= golang.org/x/exp/typeparams v0.0.0-20240314144324-c7f7c6466f7f h1:phY1HzDcf18Aq9A8KkmRtY9WvOFIxN8wgfvy6Zm1DV8= @@ -643,8 +643,8 @@ golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.12.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA= -golang.org/x/net v0.31.0 h1:68CPQngjLL0r2AlUKiSxtQFKvzRVbnzLwMUn5SzcLHo= -golang.org/x/net v0.31.0/go.mod h1:P4fl1q7dY2hnZFxEk4pPSkDHF+QqjitcnDjUQyMM+pM= +golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= +golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= golang.org/x/oauth2 v0.0.0-20170207211851-4464e7848382/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/perf v0.0.0-20210220033136-40a54f11e909 h1:rWw0Gj4DMl/2otJ8CnfTcwOWkpROAc6qhXXoMrYOCgo= golang.org/x/perf v0.0.0-20210220033136-40a54f11e909/go.mod h1:KRSrLY7jerMEa0Ih7gBheQ3FYDiSx6liMnniX1o3j2g= @@ -657,8 +657,8 @@ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= -golang.org/x/sync v0.9.0 h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ= -golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= +golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190221075227-b4e8571b14e0/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -689,8 +689,8 @@ golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.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= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -699,8 +699,8 @@ golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.10.0/go.mod h1:lpqdcUyK/oCiQxvxVrppt5ggO2KCZ5QblwqPnfZ6d5o= -golang.org/x/term v0.26.0 h1:WEQa6V3Gja/BhNxg540hBip/kkaYtRg3cxg4oXSw4AU= -golang.org/x/term v0.26.0/go.mod h1:Si5m1o57C5nBNQo5z1iq+XDijt21BDBDp2bK0QI8e3E= +golang.org/x/term v0.27.0 h1:WP60Sv1nlK1T6SupCHbXzSaN0b9wUmsPoRS9b61A23Q= +golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -711,8 +711,8 @@ golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= -golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= -golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -740,8 +740,8 @@ golang.org/x/tools v0.3.0/go.mod h1:/rWhSS2+zyEVwoJf8YAX6L2f0ntZ7Kn/mGgAWcipA5k= golang.org/x/tools v0.5.0/go.mod h1:N+Kgy78s5I24c24dU8OfWNEotWjutIs8SnJvn5IDq+k= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.11.0/go.mod h1:anzJrxPjNtfgiYQYirP2CPGzGLxrH2u2QBhn6Bf3qY8= -golang.org/x/tools v0.27.0 h1:qEKojBykQkQ4EynWy4S8Weg69NumxKdn40Fce3uc/8o= -golang.org/x/tools v0.27.0/go.mod h1:sUi0ZgbwW9ZPAq26Ekut+weQPR5eIM6GQLQ1Yjm1H0Q= +golang.org/x/tools v0.28.0 h1:WuB6qZ4RPCQo5aP3WdKZS7i595EdWqWR8vqJTlwTVK8= +golang.org/x/tools v0.28.0/go.mod h1:dcIOrVd3mfQKTgrDVQHqCPMWy6lnhfhtX3hLXYVLfRw= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/internal/tools/proto/go.mod b/internal/tools/proto/go.mod index e59f2dde50aa8..4c81cd0d2261a 100644 --- a/internal/tools/proto/go.mod +++ b/internal/tools/proto/go.mod @@ -19,11 +19,11 @@ require ( github.com/philhofer/fwd v1.1.3-0.20240916144458-20a13a1f6b7c // indirect github.com/rogpeppe/go-internal v1.13.1 // indirect golang.org/x/mod v0.22.0 // indirect - golang.org/x/net v0.31.0 // indirect - golang.org/x/sync v0.9.0 // indirect - golang.org/x/sys v0.27.0 // indirect - golang.org/x/text v0.20.0 // indirect - golang.org/x/tools v0.27.0 // indirect + golang.org/x/net v0.33.0 // indirect + golang.org/x/sync v0.10.0 // indirect + golang.org/x/sys v0.28.0 // indirect + golang.org/x/text v0.21.0 // indirect + golang.org/x/tools v0.28.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20241104194629-dd2ea8efbc28 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect google.golang.org/protobuf v1.35.2 // indirect diff --git a/internal/tools/proto/go.sum b/internal/tools/proto/go.sum index b4f392a410b6f..43d99cf5a50b1 100644 --- a/internal/tools/proto/go.sum +++ b/internal/tools/proto/go.sum @@ -71,8 +71,8 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.31.0 h1:68CPQngjLL0r2AlUKiSxtQFKvzRVbnzLwMUn5SzcLHo= -golang.org/x/net v0.31.0/go.mod h1:P4fl1q7dY2hnZFxEk4pPSkDHF+QqjitcnDjUQyMM+pM= +golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= +golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -80,8 +80,8 @@ golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.9.0 h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ= -golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= +golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -89,13 +89,13 @@ golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.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= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= -golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= @@ -103,8 +103,8 @@ golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3 golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.27.0 h1:qEKojBykQkQ4EynWy4S8Weg69NumxKdn40Fce3uc/8o= -golang.org/x/tools v0.27.0/go.mod h1:sUi0ZgbwW9ZPAq26Ekut+weQPR5eIM6GQLQ1Yjm1H0Q= +golang.org/x/tools v0.28.0 h1:WuB6qZ4RPCQo5aP3WdKZS7i595EdWqWR8vqJTlwTVK8= +golang.org/x/tools v0.28.0/go.mod h1:dcIOrVd3mfQKTgrDVQHqCPMWy6lnhfhtX3hLXYVLfRw= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/modules.yml b/modules.yml index a84b452117db1..5d5e5cb2057ff 100644 --- a/modules.yml +++ b/modules.yml @@ -35,6 +35,8 @@ modules: comp/core/status: used_by_otel: true comp/core/status/statusimpl: default + comp/core/tagger/origindetection: + used_by_otel: true comp/core/tagger/tags: used_by_otel: true comp/core/tagger/types: @@ -144,8 +146,7 @@ modules: pkg/config/utils: used_by_otel: true pkg/errors: default - pkg/gohai: - importable: false + pkg/gohai: default pkg/linters/components/pkgconfigusage: independent: false should_tag: false diff --git a/omnibus/config/projects/agent.rb b/omnibus/config/projects/agent.rb index b3ab9c10ae1ad..51bacc89a45d0 100644 --- a/omnibus/config/projects/agent.rb +++ b/omnibus/config/projects/agent.rb @@ -221,9 +221,6 @@ # ------------------------------------ if do_build - # Include traps db file in snmp.d/traps_db/ - dependency 'snmp-traps' - # Datadog agent dependency 'datadog-agent' diff --git a/omnibus/config/software/datadog-agent-dependencies.rb b/omnibus/config/software/datadog-agent-dependencies.rb index fd6712983b10b..fc34796e2fa4b 100644 --- a/omnibus/config/software/datadog-agent-dependencies.rb +++ b/omnibus/config/software/datadog-agent-dependencies.rb @@ -33,6 +33,9 @@ dependency 'libpcap' if linux_target? and !heroku_target? # system-probe dependency +# Include traps db file in snmp.d/traps_db/ +dependency 'snmp-traps' + # Additional software if windows_target? if ENV['WINDOWS_DDNPM_DRIVER'] and not ENV['WINDOWS_DDNPM_DRIVER'].empty? diff --git a/omnibus/config/software/datadog-agent.rb b/omnibus/config/software/datadog-agent.rb index 8f24178d2c07e..12b916c14fd83 100644 --- a/omnibus/config/software/datadog-agent.rb +++ b/omnibus/config/software/datadog-agent.rb @@ -30,6 +30,11 @@ build do license :project_license + bundled_agents = [] + if heroku_target? + bundled_agents = ["process-agent"] + end + # set GOPATH on the omnibus source dir for this software gopath = Pathname.new(project_dir) + '../../../..' flavor_arg = ENV['AGENT_FLAVOR'] @@ -94,15 +99,16 @@ command "inv -e rtloader.clean" command "inv -e rtloader.make --install-prefix \"#{install_dir}/embedded\" --cmake-options '-DCMAKE_CXX_FLAGS:=\"-D_GLIBCXX_USE_CXX11_ABI=0\" -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_FIND_FRAMEWORK:STRING=NEVER -DPython3_EXECUTABLE=#{install_dir}/embedded/bin/python3'", :env => env command "inv -e rtloader.install" + bundle_arg = bundled_agents ? bundled_agents.map { |k| "--bundle #{k}" }.join(" ") : "--bundle agent" include_sds = "" if linux_target? include_sds = "--include-sds" # we only support SDS on Linux targets for now end - command "inv -e agent.build --exclude-rtloader #{include_sds} --major-version #{major_version_arg} --no-development --install-path=#{install_dir} --embedded-path=#{install_dir}/embedded --flavor #{flavor_arg}", env: env + command "inv -e agent.build --exclude-rtloader #{include_sds} --major-version #{major_version_arg} --no-development --install-path=#{install_dir} --embedded-path=#{install_dir}/embedded --flavor #{flavor_arg} #{bundle_arg}", env: env if heroku_target? - command "inv -e agent.build --exclude-rtloader --major-version #{major_version_arg} --no-development --install-path=#{install_dir} --embedded-path=#{install_dir}/embedded --flavor #{flavor_arg} --agent-bin=bin/agent/core-agent", env: env + command "inv -e agent.build --exclude-rtloader --major-version #{major_version_arg} --no-development --install-path=#{install_dir} --embedded-path=#{install_dir}/embedded --flavor #{flavor_arg} --agent-bin=bin/agent/core-agent --bundle agent", env: env end end @@ -120,7 +126,8 @@ # move around bin and config files move 'bin/agent/dist/datadog.yaml', "#{conf_dir}/datadog.yaml.example" - move 'bin/agent/dist/conf.d', "#{conf_dir}/" + copy 'bin/agent/dist/conf.d/.', "#{conf_dir}" + delete 'bin/agent/dist/conf.d' unless windows_target? copy 'bin/agent', "#{install_dir}/bin/" @@ -131,8 +138,10 @@ mkdir Omnibus::Config.package_dir() unless Dir.exists?(Omnibus::Config.package_dir()) end - platform = windows_arch_i386? ? "x86" : "x64" - command "invoke trace-agent.build --install-path=#{install_dir} --major-version #{major_version_arg} --flavor #{flavor_arg}", :env => env + if not bundled_agents.include? "trace-agent" + platform = windows_arch_i386? ? "x86" : "x64" + command "invoke trace-agent.build --install-path=#{install_dir} --major-version #{major_version_arg} --flavor #{flavor_arg}", :env => env + end if windows_target? copy 'bin/trace-agent/trace-agent.exe', "#{install_dir}/bin/agent" @@ -141,7 +150,9 @@ end # Process agent - command "invoke -e process-agent.build --install-path=#{install_dir} --major-version #{major_version_arg} --flavor #{flavor_arg}", :env => env + if not bundled_agents.include? "process-agent" + command "invoke -e process-agent.build --install-path=#{install_dir} --major-version #{major_version_arg} --flavor #{flavor_arg}", :env => env + end if windows_target? copy 'bin/process-agent/process-agent.exe', "#{install_dir}/bin/agent" @@ -191,7 +202,7 @@ copy 'bin/cws-instrumentation/cws-instrumentation', "#{install_dir}/embedded/bin" end - # OTel agent + # OTel agent - can never be bundled if ot_target? unless windows_target? command "invoke -e otel-agent.build", :env => env diff --git a/omnibus/config/software/gstatus.rb b/omnibus/config/software/gstatus.rb index 8eb469763dc8c..fc96d2ba84044 100644 --- a/omnibus/config/software/gstatus.rb +++ b/omnibus/config/software/gstatus.rb @@ -16,10 +16,10 @@ # name "gstatus" -default_version "1.0.5" +default_version "1.0.9" source :url => "https://github.com/gluster/gstatus/releases/download/v#{version}/gstatus", - :sha256 => "485b79c42d5623e2593374be3b8d8cde8a00f080ab2fe417c84a2dc3d2a49719", + :sha256 => "4731a515ce1b75c7d9f378588be5be369ca0130fb51802de853527310724b0f8", :target_filename => "gstatus" diff --git a/omnibus/config/software/openscap.rb b/omnibus/config/software/openscap.rb index e97250467e2a2..3e8e08d71990d 100644 --- a/omnibus/config/software/openscap.rb +++ b/omnibus/config/software/openscap.rb @@ -4,12 +4,12 @@ # Copyright 2016-present Datadog, Inc. name 'openscap' -default_version '1.3.10' +default_version '1.4.0' license "LGPL-3.0-or-later" license_file "COPYING" -version("1.3.10") { source sha256: "0d023ff3fbdec617768ea5977fd3bb6702dfef4ae595da9a5bbc6ecc6ac9e575" } +version("1.4.0") { source sha256: "b64f3709f0e072262708212d56897c419abdd2dc618273a363bc0497c6b4ba0b" } ship_source_offer true diff --git a/omnibus/config/software/openssl-fips-provider.rb b/omnibus/config/software/openssl-fips-provider.rb index 776d7e81531b3..7d9584b2e3767 100644 --- a/omnibus/config/software/openssl-fips-provider.rb +++ b/omnibus/config/software/openssl-fips-provider.rb @@ -22,14 +22,16 @@ relative_path "openssl-#{OPENSSL_FIPS_MODULE_VERSION}" build do + env = with_standard_compiler_flags() + env["MAKEFLAGS"] = "-j#{workers}" # Exact build steps from security policy: # https://csrc.nist.gov/CSRC/media/projects/cryptographic-module-validation-program/documents/security-policies/140sp4282.pdf # # ---------------- DO NOT MODIFY LINES BELOW HERE ---------------- - command "./Configure enable-fips" + command "./Configure enable-fips", env: env - command "make" - command "make install" + command "make", env: env + command "make install", env: env # ---------------- DO NOT MODIFY LINES ABOVE HERE ---------------- mkdir "#{install_dir}/embedded/ssl" diff --git a/omnibus/config/software/python3.rb b/omnibus/config/software/python3.rb index 7f8fd8e8f4219..1cd3c096363f2 100644 --- a/omnibus/config/software/python3.rb +++ b/omnibus/config/software/python3.rb @@ -54,10 +54,12 @@ # Don't forward CC and CXX to python extensions Makefile, it's quite unlikely that any non default # compiler we use would end up being available in the system/docker image used by customers - if linux_target? + if linux_target? && env["CC"] command "sed -i \"s/^CC=[[:space:]]*${CC}/CC=gcc/\" #{install_dir}/embedded/lib/python#{major}.#{minor}/config-3.12-*-linux-gnu/Makefile", :env => env - command "sed -i \"s/^CXX=[[:space:]]*${CXX}/CC=g++/\" #{install_dir}/embedded/lib/python#{major}.#{minor}/config-3.12-*-linux-gnu/Makefile", :env => env command "sed -i \"s/${CC}/gcc/g\" #{install_dir}/embedded/lib/python#{major}.#{minor}/_sysconfigdata__linux_*-linux-gnu.py", :env => env + end + if linux_target? && env["CXX"] + command "sed -i \"s/^CXX=[[:space:]]*${CXX}/CC=g++/\" #{install_dir}/embedded/lib/python#{major}.#{minor}/config-3.12-*-linux-gnu/Makefile", :env => env command "sed -i \"s/${CXX}/g++/g\" #{install_dir}/embedded/lib/python#{major}.#{minor}/_sysconfigdata__linux_*-linux-gnu.py", :env => env end delete "#{install_dir}/embedded/lib/python#{major}.#{minor}/test" @@ -79,7 +81,6 @@ license "Python-2.0" command "XCOPY /YEHIR *.* \"#{windows_safe_path(python_3_embedded)}\"" - command "copy /y \"#{windows_safe_path(vcrt140_root)}\\*.dll\" \"#{windows_safe_path(python_3_embedded)}\"" # Install pip python = "#{windows_safe_path(python_3_embedded)}\\python.exe" diff --git a/omnibus/config/software/snmp-traps.rb b/omnibus/config/software/snmp-traps.rb index 5a021b01ed8d4..bb13fc542fd3b 100644 --- a/omnibus/config/software/snmp-traps.rb +++ b/omnibus/config/software/snmp-traps.rb @@ -1,9 +1,6 @@ name "snmp-traps" default_version "0.4.0" -# Needs the configuration folder as created in datadog-agent -dependency 'datadog-agent' - source :url => "https://s3.amazonaws.com/dd-agent-omnibus/snmp_traps_db/dd_traps_db-#{version}.json.gz", :sha256 => "04fb9d43754c2656edf35f08fbad11ba8dc20d52654962933f3dd8f4d463b42c", :target_filename => "dd_traps_db.json.gz" diff --git a/omnibus/config/software/vc_redist_14.rb b/omnibus/config/software/vc_redist_14.rb index ecc8067943f96..226a1145bb993 100644 --- a/omnibus/config/software/vc_redist_14.rb +++ b/omnibus/config/software/vc_redist_14.rb @@ -23,5 +23,5 @@ else source_msm = "Microsoft_VC141_CRT_x64.msm" end - command "powershell -C \"#{windows_safe_path(script_root)} -file #{source_msm} -targetDir .\\expanded\"" + command "powershell -C \"#{windows_safe_path(script_root)} -file #{source_msm} -targetDir \"#{windows_safe_path(python_3_embedded)}\"\"" end diff --git a/omnibus/config/templates/openssl-fips-provider/openssl.cnf.erb b/omnibus/config/templates/openssl-fips-provider/openssl.cnf.erb index 1304d1021b08d..23b1637b9c017 100644 --- a/omnibus/config/templates/openssl-fips-provider/openssl.cnf.erb +++ b/omnibus/config/templates/openssl-fips-provider/openssl.cnf.erb @@ -5,6 +5,7 @@ openssl_conf = openssl_init [openssl_init] providers = provider_sect +alg_section = algorithm_sect [provider_sect] fips = fips_sect @@ -12,3 +13,6 @@ base = base_sect [base_sect] activate = 1 + +[algorithm_sect] +default_properties = fips=yes diff --git a/pkg/aggregator/aggregator.go b/pkg/aggregator/aggregator.go index 653a031194819..0423f9871c65d 100644 --- a/pkg/aggregator/aggregator.go +++ b/pkg/aggregator/aggregator.go @@ -877,9 +877,6 @@ func (agg *BufferedAggregator) tags(withVersion bool) []string { tags = append(tags, "package_version:"+version.AgentPackageVersion) } } - if agg.haAgent.Enabled() { - tags = append(tags, "agent_group:"+agg.haAgent.GetGroup()) - } // nil to empty string // This is expected by other components/tests if tags == nil { diff --git a/pkg/aggregator/aggregator_test.go b/pkg/aggregator/aggregator_test.go index 5a0676cbcb507..2b447281eea77 100644 --- a/pkg/aggregator/aggregator_test.go +++ b/pkg/aggregator/aggregator_test.go @@ -294,7 +294,7 @@ func TestDefaultSeries(t *testing.T) { require.Equal(t, 1, len(m)) require.Equal(t, "datadog.agent.up", m[0].CheckName) require.Equal(t, servicecheck.ServiceCheckOK, m[0].Status) - require.Equal(t, []string{"agent_group:group01"}, m[0].Tags) + require.Equal(t, []string{}, m[0].Tags) require.Equal(t, agg.hostname, m[0].Host) return true @@ -304,14 +304,14 @@ func TestDefaultSeries(t *testing.T) { expectedSeries := metrics.Series{&metrics.Serie{ Name: fmt.Sprintf("datadog.%s.running", flavor.GetFlavor()), Points: []metrics.Point{{Value: 1, Ts: float64(start.Unix())}}, - Tags: tagset.CompositeTagsFromSlice([]string{"version:" + version.AgentVersion, "agent_group:group01"}), + Tags: tagset.CompositeTagsFromSlice([]string{"version:" + version.AgentVersion}), Host: agg.hostname, MType: metrics.APIGaugeType, SourceTypeName: "System", }, &metrics.Serie{ Name: fmt.Sprintf("datadog.%s.ha_agent.running", agg.agentName), Points: []metrics.Point{{Value: float64(1), Ts: float64(start.Unix())}}, - Tags: tagset.CompositeTagsFromSlice([]string{"agent_group:group01", "agent_state:standby"}), + Tags: tagset.CompositeTagsFromSlice([]string{"agent_state:standby"}), Host: agg.hostname, MType: metrics.APIGaugeType, SourceTypeName: "System", @@ -319,7 +319,7 @@ func TestDefaultSeries(t *testing.T) { Name: fmt.Sprintf("n_o_i_n_d_e_x.datadog.%s.payload.dropped", flavor.GetFlavor()), Points: []metrics.Point{{Value: 0, Ts: float64(start.Unix())}}, Host: agg.hostname, - Tags: tagset.CompositeTagsFromSlice([]string{"agent_group:group01"}), + Tags: tagset.CompositeTagsFromSlice([]string{}), MType: metrics.APIGaugeType, SourceTypeName: "System", NoIndex: true, @@ -643,16 +643,6 @@ func TestTags(t *testing.T) { withVersion: true, want: []string{"container_name:agent", "version:" + version.AgentVersion, "kube_cluster_name:foo"}, }, - { - name: "tags disabled, without version, ha agent enabled", - hostname: "hostname", - tlmContainerTagsEnabled: false, - agentTags: func(types.TagCardinality) ([]string, error) { return nil, errors.New("disabled") }, - globalTags: func(types.TagCardinality) ([]string, error) { return nil, errors.New("disabled") }, - withVersion: false, - haAgentEnabled: true, - want: []string{"agent_group:group01"}, - }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { diff --git a/pkg/aggregator/sender_test.go b/pkg/aggregator/sender_test.go index ef7173f8a1bcc..4479842cc18da 100644 --- a/pkg/aggregator/sender_test.go +++ b/pkg/aggregator/sender_test.go @@ -359,9 +359,9 @@ func TestSenderPopulatingMetricSampleSource(t *testing.T) { expectedMetricSource: metrics.MetricSourceCPU, }, { - name: "checkid ntp:1 should have MetricSourceNtp", + name: "checkid ntp:1 should have MetricSourceNTP", checkID: "ntp:1", - expectedMetricSource: metrics.MetricSourceNtp, + expectedMetricSource: metrics.MetricSourceNTP, }, { name: "checkid memory:1 should have MetricSourceMemory", diff --git a/pkg/api/go.mod b/pkg/api/go.mod index b30cc5d081999..dbc260bd86444 100644 --- a/pkg/api/go.mod +++ b/pkg/api/go.mod @@ -43,7 +43,7 @@ require ( github.com/DataDog/datadog-agent/pkg/config/model v0.59.0 github.com/DataDog/datadog-agent/pkg/config/utils v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/util/filesystem v0.59.0 - github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 + github.com/DataDog/datadog-agent/pkg/util/log v0.59.1 github.com/DataDog/datadog-agent/pkg/util/system v0.59.0 github.com/stretchr/testify v1.10.0 ) @@ -64,29 +64,29 @@ require ( github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/optional v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/pointer v0.59.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.1 // indirect github.com/DataDog/datadog-agent/pkg/util/system/socket v0.59.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/winutil v0.59.0 // indirect - github.com/DataDog/datadog-agent/pkg/version v0.56.0-rc.3 // indirect - github.com/DataDog/viper v1.13.5 // 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.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 - github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 // indirect + github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 // indirect - github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c // indirect + github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c // indirect github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect 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/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // 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 @@ -100,9 +100,9 @@ require ( go.uber.org/fx v1.23.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect - golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f // indirect - golang.org/x/sys v0.27.0 // indirect - golang.org/x/text v0.20.0 // indirect + golang.org/x/exp v0.0.0-20241210194714-1829a127f884 // indirect + golang.org/x/sys v0.28.0 // indirect + golang.org/x/text v0.21.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/pkg/api/go.sum b/pkg/api/go.sum index 324945ccfacf2..6ffaa516a7a51 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= @@ -70,7 +72,6 @@ github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/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= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -85,8 +86,8 @@ github.com/grpc-ecosystem/grpc-gateway v1.13.0/go.mod h1:8XEsbTttt/W+VvjtQhLACqC github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/hcl v1.0.1-vault-5 h1:kI3hhbbyzr4dldA8UdTb7ZlVVlI2DACdCfz31RPDgJM= github.com/hashicorp/hcl v1.0.1-vault-5/go.mod h1:XYhtn6ijBSAj6n4YqAaf7RBPS4I06AItNorpy+MoQNM= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 h1:S4qyfL2sEm5Budr4KVMyEniCy+PbS55651I/a+Kn/NQ= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb h1:PGufWXXDq9yaev6xX1YQauaO1MV90e6Mpoq1I7Lz/VM= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= @@ -108,8 +109,8 @@ 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-20220913051719-115f729f3c8c h1:VtwQ41oftZwlMnOEbMWQtSEUgU64U4s+GHk7hZK+jtY= -github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c/go.mod h1:JKx41uQRwqlTZabZc+kILPrO/3jlKnQ2Z8b7YiVw5cE= +github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a h1:3Bm7EwfUQUvhNeKIkUct/gl9eod1TcXuj8stxvi/GoI= +github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a/go.mod h1:ilwx/Dta8jXAgpFYFvSWEMwxmbWXyiUHkd5FwyKhb5k= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= @@ -136,8 +137,8 @@ github.com/pkg/errors v0.8.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-20220216144756-c35f1ee13d7c h1:NRoLoZvkBTKvR5gQLgA3e0hqjkY9u1wm+iOL45VN/qI= -github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 h1:o4JXh1EVt9k/+g42oCprj/FisM4qX9L3sZB3upGN2ZU= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= @@ -169,12 +170,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= @@ -241,8 +238,8 @@ golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnf golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f h1:XdNn9LlyWAhLVp6P/i8QYBW+hlyhrhei9uErw2B5GJo= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f/go.mod h1:D5SMRVC3C2/4+F/DB1wZsLRnSNimn2Sp/NPsCrsv8ak= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884 h1:Y/Mj/94zIQQGHVSv1tTtQBDaQaJe62U9bkDZKKyhPCU= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -279,11 +276,11 @@ golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20220829200755-d48e67d00261/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.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/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= -golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= diff --git a/pkg/api/security/cert/cert_generator.go b/pkg/api/security/cert/cert_generator.go new file mode 100644 index 0000000000000..46b9c1076c611 --- /dev/null +++ b/pkg/api/security/cert/cert_generator.go @@ -0,0 +1,75 @@ +// 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 cert provide useful functions to generate certificates +package cert + +import ( + "crypto/ecdsa" + "crypto/elliptic" + "crypto/rand" + "crypto/x509" + "crypto/x509/pkix" + "encoding/pem" + "fmt" + "math/big" + "net" + "time" +) + +func certTemplate() (*x509.Certificate, error) { + serialNumberLimit := new(big.Int).Lsh(big.NewInt(1), 128) + serialNumber, err := rand.Int(rand.Reader, serialNumberLimit) + if err != nil { + return nil, fmt.Errorf("failed to generate serial number: %s", err) + } + + notBefore := time.Now() + // 50 years duration + notAfter := notBefore.Add(50 * 365 * 24 * time.Hour) + template := x509.Certificate{ + SerialNumber: serialNumber, + Subject: pkix.Name{ + Organization: []string{"Datadog, Inc."}, + }, + NotBefore: notBefore, + NotAfter: notAfter, + BasicConstraintsValid: true, + KeyUsage: x509.KeyUsageCertSign | x509.KeyUsageDigitalSignature | x509.KeyUsageCRLSign, + ExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageServerAuth, x509.ExtKeyUsageClientAuth}, + IsCA: true, + IPAddresses: []net.IP{net.ParseIP("127.0.0.1"), net.ParseIP("::1")}, + DNSNames: []string{"localhost"}, + } + + return &template, nil +} + +func generateCertKeyPair() ([]byte, []byte, error) { + rootCertTmpl, err := certTemplate() + if err != nil { + return nil, nil, err + } + + rootKey, err := ecdsa.GenerateKey(elliptic.P256(), rand.Reader) + if err != nil { + return nil, nil, fmt.Errorf("Unable to generate IPC private key: %v", err) + } + + certDER, err := x509.CreateCertificate(rand.Reader, rootCertTmpl, rootCertTmpl, &rootKey.PublicKey, rootKey) + if err != nil { + return nil, nil, err + } + + certPEM := pem.EncodeToMemory(&pem.Block{Type: "CERTIFICATE", Bytes: certDER}) + rawKey, err := x509.MarshalECPrivateKey(rootKey) + if err != nil { + return nil, nil, fmt.Errorf("Unable to marshall private key: %v", err) + } + + keyPEM := pem.EncodeToMemory(&pem.Block{Type: "EC PRIVATE KEY", Bytes: rawKey}) + + return certPEM, keyPEM, nil +} diff --git a/pkg/api/security/cert/cert_generator_test.go b/pkg/api/security/cert/cert_generator_test.go new file mode 100644 index 0000000000000..888eb28240a84 --- /dev/null +++ b/pkg/api/security/cert/cert_generator_test.go @@ -0,0 +1,71 @@ +// 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 cert + +import ( + "crypto/tls" + "crypto/x509" + "io" + "net/http" + "net/http/httptest" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestCertCommunication(t *testing.T) { + certPEM, keyPEM, err := generateCertKeyPair() + assert.NoError(t, err) + + // Load server certificate + serverCert, err := tls.X509KeyPair(certPEM, keyPEM) + assert.NoError(t, err) + + // Create a certificate pool with the generated certificate + certPool := x509.NewCertPool() + ok := certPool.AppendCertsFromPEM(certPEM) + assert.True(t, ok) + + // Create a TLS config for the server + serverTLSConfig := &tls.Config{ + Certificates: []tls.Certificate{serverCert}, + } + + // Create a TLS config for the client + clientTLSConfig := &tls.Config{ + RootCAs: certPool, + } + + expectedResult := []byte("hello word") + + // Create a HTTPS Server + s := httptest.NewUnstartedServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { + w.Write(expectedResult) + })) + + s.TLS = serverTLSConfig + s.StartTLS() + t.Cleanup(func() { + s.Close() + }) + + // Create a HTTPS Client + client := http.Client{ + Transport: &http.Transport{ + TLSClientConfig: clientTLSConfig, + }, + } + + // Try to communicate together + resp, err := client.Get(s.URL) + require.NoError(t, err) + defer resp.Body.Close() + + body, err := io.ReadAll(resp.Body) + require.NoError(t, err) + require.Equal(t, body, expectedResult) +} diff --git a/pkg/api/security/cert/cert_getter.go b/pkg/api/security/cert/cert_getter.go new file mode 100644 index 0000000000000..09edb10e1cf5e --- /dev/null +++ b/pkg/api/security/cert/cert_getter.go @@ -0,0 +1,128 @@ +// 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 cert provide useful functions to generate certificates +package cert + +import ( + "bytes" + "encoding/pem" + "fmt" + "os" + "path/filepath" + "runtime" + + configModel "github.com/DataDog/datadog-agent/pkg/config/model" + "github.com/DataDog/datadog-agent/pkg/util/filesystem" + "github.com/DataDog/datadog-agent/pkg/util/log" +) + +// defaultCertFileName represent the default IPC certificate root name (without .cert or .key) +const defaultCertFileName = "ipc_cert.pem" + +// GetCertFilepath returns the path to the IPC cert file. +func GetCertFilepath(config configModel.Reader) string { + if configPath := config.GetString("ipc_cert_file_path"); configPath != "" { + return configPath + } + // Since customers who set the "auth_token_file_path" configuration likely prefer to avoid writing it next to the configuration file, + // we should follow this behavior for the cert/key generation as well to minimize the risk of disrupting IPC functionality. + if config.GetString("auth_token_file_path") != "" { + dest := filepath.Join(filepath.Dir(config.GetString("auth_token_file_path")), defaultCertFileName) + log.Warnf("IPC cert/key created or retrieved next to auth_token_file_path location: %v", dest) + return dest + } + return filepath.Join(filepath.Dir(config.ConfigFileUsed()), defaultCertFileName) +} + +// FetchAgentIPCCert return the IPC certificate and key from the path set in the configuration +// Requires that the config has been set up before calling +func FetchAgentIPCCert(config configModel.Reader) ([]byte, []byte, error) { + return fetchAgentIPCCert(config, false) +} + +// CreateOrFetchAgentIPCCert return the IPC certificate and key from the path set in the configuration or create if not present +// Requires that the config has been set up before calling +func CreateOrFetchAgentIPCCert(config configModel.Reader) ([]byte, []byte, error) { + return fetchAgentIPCCert(config, true) +} + +func fetchAgentIPCCert(config configModel.Reader, certCreationAllowed bool) ([]byte, []byte, error) { + certPath := GetCertFilepath(config) + + // Create cert&key if it doesn't exist and if permitted by calling func + if _, e := os.Stat(certPath); os.IsNotExist(e) && certCreationAllowed { + // print the caller to identify what is calling this function + if _, file, line, ok := runtime.Caller(2); ok { + log.Infof("[%s:%d] Creating a new IPC certificate", file, line) + } + + cert, key, err := generateCertKeyPair() + + if err != nil { + return nil, nil, err + } + + // Write the IPC cert/key in the FS (platform-specific) + e = saveIPCCertKey(cert, key, certPath) + if e != nil { + return nil, nil, fmt.Errorf("error writing IPC cert/key file on fs: %s", e) + } + log.Infof("Saved a new IPC certificate/key pair to %s", certPath) + + return cert, key, nil + } + + // Read the IPC certAndKey/key + certAndKey, e := os.ReadFile(certPath) + if e != nil { + return nil, nil, fmt.Errorf("unable to read authentication IPC cert/key files: %s", e.Error()) + } + + // Demultiplexing cert and key from file + var block *pem.Block + + block, rest := pem.Decode(certAndKey) + + if block == nil || block.Type != "CERTIFICATE" { + return nil, nil, log.Error("failed to decode PEM block containing certificate") + } + cert := pem.EncodeToMemory(block) + + block, _ = pem.Decode(rest) + + if block == nil || block.Type != "EC PRIVATE KEY" { + return nil, nil, log.Error("failed to decode PEM block containing key") + } + + key := pem.EncodeToMemory(block) + + return cert, key, nil +} + +// writes IPC cert/key files to a file with the same permissions as datadog.yaml +func saveIPCCertKey(cert, key []byte, dest string) (err error) { + log.Infof("Saving a new IPC certificate/key pair in %s", dest) + + perms, err := filesystem.NewPermission() + if err != nil { + return err + } + + // Concatenating cert and key together + certAndKey := bytes.Join([][]byte{cert, key}, []byte{}) + + if err = os.WriteFile(dest, certAndKey, 0o600); err != nil { + return err + } + + if err := perms.RestrictAccessToUser(dest); err != nil { + log.Errorf("Failed to set IPC cert permissions: %s", err) + return err + } + + log.Infof("Wrote IPC certificate/key pair in %s", dest) + return nil +} diff --git a/pkg/api/security/cert/cert_getter_test.go b/pkg/api/security/cert/cert_getter_test.go new file mode 100644 index 0000000000000..4915d2cb5d8b5 --- /dev/null +++ b/pkg/api/security/cert/cert_getter_test.go @@ -0,0 +1,139 @@ +// 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 cert + +import ( + "crypto/tls" + "crypto/x509" + "os" + "path/filepath" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + configmock "github.com/DataDog/datadog-agent/pkg/config/mock" + "github.com/DataDog/datadog-agent/pkg/config/model" +) + +func initMockConf(t *testing.T) (model.Config, string) { + testDir := t.TempDir() + + f, err := os.CreateTemp(testDir, "fake-datadog-yaml-") + require.NoError(t, err) + t.Cleanup(func() { + f.Close() + }) + + mockConfig := configmock.New(t) + mockConfig.SetConfigFile(f.Name()) + mockConfig.SetWithoutSource("auth_token", "") + + return mockConfig, filepath.Join(testDir, "auth_token") +} + +func TestCreateOrFetchAuthTokenValidGen(t *testing.T) { + config, _ := initMockConf(t) + ipccert, ipckey, err := CreateOrFetchAgentIPCCert(config) + require.NoError(t, err) + + certPool := x509.NewCertPool() + ok := certPool.AppendCertsFromPEM(ipccert) + assert.True(t, ok) + + _, err = tls.X509KeyPair(ipccert, ipckey) + assert.NoError(t, err) +} + +func TestFetchAuthToken(t *testing.T) { + config, _ := initMockConf(t) + + // Trying to fetch before create cert: must fail + _, _, err := FetchAgentIPCCert(config) + require.Error(t, err) + + // Creating a cert + ipcCert, ipcKey, err := CreateOrFetchAgentIPCCert(config) + require.NoError(t, err) + + certPool := x509.NewCertPool() + ok := certPool.AppendCertsFromPEM(ipcCert) + assert.True(t, ok) + + _, err = tls.X509KeyPair(ipcCert, ipcKey) + assert.NoError(t, err) + + // Trying to fetch after creating cert: must succeed + fetchedCert, fetchedKey, err := FetchAgentIPCCert(config) + require.NoError(t, err) + require.Equal(t, string(ipcCert), string(fetchedCert)) + require.Equal(t, string(ipcKey), string(fetchedKey)) +} + +func TestFetchAuthTokenWithAuthTokenFilePath(t *testing.T) { + config, _ := initMockConf(t) + + // Setting custom auth_token filepath + dname, err := os.MkdirTemp("", "auth_token_dir") + require.NoError(t, err) + config.SetWithoutSource("auth_token_file_path", filepath.Join(dname, "auth_token")) + + // Creating a cert + ipcCert, ipcKey, err := CreateOrFetchAgentIPCCert(config) + require.NoError(t, err) + + certPool := x509.NewCertPool() + ok := certPool.AppendCertsFromPEM(ipcCert) + assert.True(t, ok) + + _, err = tls.X509KeyPair(ipcCert, ipcKey) + assert.NoError(t, err) + + // Checking that the cert have been created next to the auth_token_file path + _, err = os.Stat(filepath.Join(dname, defaultCertFileName)) + require.NoError(t, err) + + // Trying to fetch after creating cert: must succeed + fetchedCert, fetchedKey, err := FetchAgentIPCCert(config) + require.NoError(t, err) + require.Equal(t, string(ipcCert), string(fetchedCert)) + require.Equal(t, string(ipcKey), string(fetchedKey)) +} + +func TestFetchAuthTokenWithIPCCertFilePath(t *testing.T) { + config, _ := initMockConf(t) + + // Setting custom auth_token filepath + authTokenDirName, err := os.MkdirTemp("", "auth_token_dir") + require.NoError(t, err) + config.SetWithoutSource("auth_token_file_path", filepath.Join(authTokenDirName, "custom_auth_token")) + + // Setting custom IPC cert filepath + ipcDirName, err := os.MkdirTemp("", "ipc_cert_dir") + require.NoError(t, err) + config.SetWithoutSource("ipc_cert_file_path", filepath.Join(ipcDirName, "custom_ipc_cert")) + + // Creating a cert + ipcCert, ipcKey, err := CreateOrFetchAgentIPCCert(config) + require.NoError(t, err) + + certPool := x509.NewCertPool() + ok := certPool.AppendCertsFromPEM(ipcCert) + assert.True(t, ok) + + _, err = tls.X509KeyPair(ipcCert, ipcKey) + assert.NoError(t, err) + + // Checking that the cert have been created at the custom IPC cert filepath + _, err = os.Stat(filepath.Join(ipcDirName, "custom_ipc_cert")) + require.NoError(t, err) + + // Trying to fetch after creating cert: must succeed + fetchedCert, fetchedKey, err := FetchAgentIPCCert(config) + require.NoError(t, err) + require.Equal(t, string(ipcCert), string(fetchedCert)) + require.Equal(t, string(ipcKey), string(fetchedKey)) +} diff --git a/pkg/api/security/security.go b/pkg/api/security/security.go index 40b1310c2f79c..93867572572d0 100644 --- a/pkg/api/security/security.go +++ b/pkg/api/security/security.go @@ -239,7 +239,7 @@ func validateAuthToken(authToken string) error { // writes auth token(s) to a file with the same permissions as datadog.yaml func saveAuthToken(token, tokenPath string) error { log.Infof("Saving a new authentication token in %s", tokenPath) - if err := os.WriteFile(tokenPath, []byte(token), 0o600); err != nil { + if err := writeFileAndSync(tokenPath, []byte(token), 0o600); err != nil { return err } @@ -256,3 +256,21 @@ func saveAuthToken(token, tokenPath string) error { log.Infof("Wrote auth token in %s", tokenPath) return nil } + +// call the file.Sync method to flush the file to disk and catch potential I/O errors +func writeFileAndSync(name string, data []byte, perm os.FileMode) error { + f, err := os.OpenFile(name, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, perm) + if err != nil { + return err + } + _, err = f.Write(data) + // only sync data if the write was successful + if err == nil { + err = f.Sync() + } + // but always close the file and report the first error that occurred + if err1 := f.Close(); err1 != nil && err == nil { + err = err1 + } + return err +} diff --git a/pkg/api/util/ipc_endpoint_test.go b/pkg/api/util/ipc_endpoint_test.go index 26df3f8ce7205..2329b3033ef96 100644 --- a/pkg/api/util/ipc_endpoint_test.go +++ b/pkg/api/util/ipc_endpoint_test.go @@ -14,99 +14,112 @@ import ( "net/http/httptest" "net/url" "os" + "path/filepath" "testing" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/stretchr/testify/suite" configmock "github.com/DataDog/datadog-agent/pkg/config/mock" pkgconfigmodel "github.com/DataDog/datadog-agent/pkg/config/model" ) -func createConfig(t *testing.T, ts *httptest.Server) pkgconfigmodel.Config { - conf := configmock.New(t) +type IPCEndpointTestSuite struct { + suite.Suite + conf pkgconfigmodel.Config +} - // create a fake auth token - authTokenFile, err := os.CreateTemp("", "") - assert.NoError(t, err) - authTokenPath := authTokenFile.Name() - os.WriteFile(authTokenPath, []byte("0123456789abcdef0123456789abcdef"), 0640) +func TestIPCEndpointTestSuite(t *testing.T) { + // cleaning auth_token and cert globals to be able initialize again the authToken and IPC cert + token = "" + dcaToken = "" + clientTLSConfig = nil + serverTLSConfig = nil - addr, err := url.Parse(ts.URL) - assert.NoError(t, err) - localHost, localPort, _ := net.SplitHostPort(addr.Host) + // creating test suite + testSuite := new(IPCEndpointTestSuite) - // set minimal configuration that IPCEndpoint needs - conf.Set("auth_token_file_path", authTokenPath, pkgconfigmodel.SourceAgentRuntime) - conf.Set("cmd_host", localHost, pkgconfigmodel.SourceAgentRuntime) - conf.Set("cmd_port", localPort, pkgconfigmodel.SourceAgentRuntime) + // simulating a normal startup of Agent with auth_token and cert generation + testSuite.conf = configmock.New(t) - return conf + // create a fake auth token + dir := t.TempDir() + authTokenPath := filepath.Join(dir, "auth_token") + err := os.WriteFile(authTokenPath, []byte("0123456789abcdef0123456789abcdef"), 0640) + require.NoError(t, err) + testSuite.conf.Set("auth_token_file_path", authTokenPath, pkgconfigmodel.SourceAgentRuntime) + + // use the cert in the httptest server + CreateAndSetAuthToken(testSuite.conf) + + suite.Run(t, testSuite) } -func TestNewIPCEndpoint(t *testing.T) { - conf := configmock.New(t) +func (suite *IPCEndpointTestSuite) setTestServerAndConfig(t *testing.T, ts *httptest.Server, isHTTPS bool) { + if isHTTPS { + ts.TLS = GetTLSServerConfig() + ts.StartTLS() + } else { + ts.Start() + } - // create a fake auth token - authTokenFile, err := os.CreateTemp("", "") - assert.NoError(t, err) - authTokenPath := authTokenFile.Name() - os.WriteFile(authTokenPath, []byte("0123456789abcdef0123456789abcdef"), 0640) + // use the httptest server as the CMD_API + addr, err := url.Parse(ts.URL) + require.NoError(t, err) + localHost, localPort, _ := net.SplitHostPort(addr.Host) + suite.conf.Set("cmd_host", localHost, pkgconfigmodel.SourceAgentRuntime) + suite.conf.Set("cmd_port", localPort, pkgconfigmodel.SourceAgentRuntime) +} + +func (suite *IPCEndpointTestSuite) TestNewIPCEndpoint() { + t := suite.T() // set minimal configuration that IPCEndpoint needs - conf.Set("auth_token_file_path", authTokenPath, pkgconfigmodel.SourceAgentRuntime) - conf.Set("cmd_host", "localhost", pkgconfigmodel.SourceAgentRuntime) - conf.Set("cmd_port", "6789", pkgconfigmodel.SourceAgentRuntime) + suite.conf.Set("cmd_host", "localhost", pkgconfigmodel.SourceAgentRuntime) + suite.conf.Set("cmd_port", "6789", pkgconfigmodel.SourceAgentRuntime) // test the endpoint construction - end, err := NewIPCEndpoint(conf, "test/api") + end, err := NewIPCEndpoint(suite.conf, "test/api") assert.NoError(t, err) assert.Equal(t, end.target.String(), "https://localhost:6789/test/api") } -func TestNewIPCEndpointWithCloseConnection(t *testing.T) { - conf := configmock.New(t) - - // create a fake auth token - authTokenFile, err := os.CreateTemp("", "") - assert.NoError(t, err) - authTokenPath := authTokenFile.Name() - os.WriteFile(authTokenPath, []byte("0123456789abcdef0123456789abcdef"), 0640) - - // set minimal configuration that IPCEndpoint needs - conf.Set("auth_token_file_path", authTokenPath, pkgconfigmodel.SourceAgentRuntime) - conf.Set("cmd_host", "localhost", pkgconfigmodel.SourceAgentRuntime) - conf.Set("cmd_port", "6789", pkgconfigmodel.SourceAgentRuntime) +func (suite *IPCEndpointTestSuite) TestNewIPCEndpointWithCloseConnection() { + t := suite.T() // test constructing with the CloseConnection option - end, err := NewIPCEndpoint(conf, "test/api", WithCloseConnection(true)) - assert.NoError(t, err) + end, err := NewIPCEndpoint(suite.conf, "test/api", WithCloseConnection(true)) + require.NoError(t, err) assert.True(t, end.closeConn) } -func TestIPCEndpointDoGet(t *testing.T) { +func (suite *IPCEndpointTestSuite) TestIPCEndpointDoGet() { + t := suite.T() gotURL := "" - ts := httptest.NewTLSServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + ts := httptest.NewUnstartedServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { gotURL = r.URL.String() _, _ = io.ReadAll(r.Body) w.Write([]byte("ok")) })) defer ts.Close() - conf := createConfig(t, ts) - end, err := NewIPCEndpoint(conf, "test/api") + suite.setTestServerAndConfig(t, ts, true) + end, err := NewIPCEndpoint(suite.conf, "test/api") assert.NoError(t, err) // test that DoGet will hit the endpoint url res, err := end.DoGet() - assert.NoError(t, err) + require.NoError(t, err) assert.Equal(t, res, []byte("ok")) assert.Equal(t, gotURL, "/test/api") } -func TestIPCEndpointGetWithHTTPClientAndNonTLS(t *testing.T) { +func (suite *IPCEndpointTestSuite) TestIPCEndpointGetWithHTTPClientAndNonTLS() { + t := suite.T() // non-http server gotURL := "" - ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + ts := httptest.NewUnstartedServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { gotURL = r.URL.String() _, _ = io.ReadAll(r.Body) w.Write([]byte("ok")) @@ -114,106 +127,112 @@ func TestIPCEndpointGetWithHTTPClientAndNonTLS(t *testing.T) { defer ts.Close() // create non-TLS client and use the "http" protocol + suite.setTestServerAndConfig(t, ts, false) client := http.Client{} - conf := createConfig(t, ts) - end, err := NewIPCEndpoint(conf, "test/api", WithHTTPClient(&client), WithURLScheme("http")) + end, err := NewIPCEndpoint(suite.conf, "test/api", WithHTTPClient(&client), WithURLScheme("http")) assert.NoError(t, err) // test that DoGet will hit the endpoint url res, err := end.DoGet() - assert.NoError(t, err) + require.NoError(t, err) assert.Equal(t, res, []byte("ok")) assert.Equal(t, gotURL, "/test/api") } -func TestIPCEndpointGetWithValues(t *testing.T) { +func (suite *IPCEndpointTestSuite) TestIPCEndpointGetWithValues() { + t := suite.T() gotURL := "" - ts := httptest.NewTLSServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + ts := httptest.NewUnstartedServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { gotURL = r.URL.String() _, _ = io.ReadAll(r.Body) w.Write([]byte("ok")) })) defer ts.Close() - conf := createConfig(t, ts) + suite.setTestServerAndConfig(t, ts, true) // set url values for GET request v := url.Values{} v.Set("verbose", "true") // test construction with option for url.Values - end, err := NewIPCEndpoint(conf, "test/api") + end, err := NewIPCEndpoint(suite.conf, "test/api") assert.NoError(t, err) // test that DoGet will use query parameters from the url.Values res, err := end.DoGet(WithValues(v)) - assert.NoError(t, err) + require.NoError(t, err) assert.Equal(t, res, []byte("ok")) assert.Equal(t, gotURL, "/test/api?verbose=true") } -func TestIPCEndpointGetWithHostAndPort(t *testing.T) { - ts := httptest.NewTLSServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { +func (suite *IPCEndpointTestSuite) TestIPCEndpointGetWithHostAndPort() { + t := suite.T() + ts := httptest.NewUnstartedServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { _, _ = io.ReadAll(r.Body) w.Write([]byte("ok")) })) defer ts.Close() - conf := createConfig(t, ts) + suite.setTestServerAndConfig(t, ts, true) // modify the config so that it uses a different setting for the cmd_host - conf.Set("process_config.cmd_host", "127.0.0.1", pkgconfigmodel.SourceAgentRuntime) + suite.conf.Set("process_config.cmd_host", "127.0.0.1", pkgconfigmodel.SourceAgentRuntime) // test construction with alternate values for the host and port - end, err := NewIPCEndpoint(conf, "test/api", WithHostAndPort(conf.GetString("process_config.cmd_host"), conf.GetInt("cmd_port"))) + end, err := NewIPCEndpoint(suite.conf, "test/api", WithHostAndPort(suite.conf.GetString("process_config.cmd_host"), suite.conf.GetInt("cmd_port"))) assert.NoError(t, err) // test that host provided by WithHostAndPort is used for the endpoint res, err := end.DoGet() - assert.NoError(t, err) + require.NoError(t, err) assert.Equal(t, res, []byte("ok")) - assert.Equal(t, end.target.Host, fmt.Sprintf("127.0.0.1:%d", conf.GetInt("cmd_port"))) + assert.Equal(t, end.target.Host, fmt.Sprintf("127.0.0.1:%d", suite.conf.GetInt("cmd_port"))) } -func TestIPCEndpointDeprecatedIPCAddress(t *testing.T) { - ts := httptest.NewTLSServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { +func (suite *IPCEndpointTestSuite) TestIPCEndpointDeprecatedIPCAddress() { + t := suite.T() + ts := httptest.NewUnstartedServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { _, _ = io.ReadAll(r.Body) w.Write([]byte("ok")) })) defer ts.Close() - conf := createConfig(t, ts) + suite.setTestServerAndConfig(t, ts, true) // Use the deprecated (but still supported) option "ipc_address" - conf.UnsetForSource("cmd_host", pkgconfigmodel.SourceAgentRuntime) - conf.Set("ipc_address", "127.0.0.1", pkgconfigmodel.SourceAgentRuntime) + suite.conf.UnsetForSource("cmd_host", pkgconfigmodel.SourceAgentRuntime) + suite.conf.Set("ipc_address", "127.0.0.1", pkgconfigmodel.SourceAgentRuntime) + defer suite.conf.UnsetForSource("ipc_address", pkgconfigmodel.SourceAgentRuntime) // test construction, uses ipc_address instead of cmd_host - end, err := NewIPCEndpoint(conf, "test/api") + end, err := NewIPCEndpoint(suite.conf, "test/api") assert.NoError(t, err) // test that host provided by "ipc_address" is used for the endpoint res, err := end.DoGet() - assert.NoError(t, err) + require.NoError(t, err) assert.Equal(t, res, []byte("ok")) - assert.Equal(t, end.target.Host, fmt.Sprintf("127.0.0.1:%d", conf.GetInt("cmd_port"))) + assert.Equal(t, end.target.Host, fmt.Sprintf("127.0.0.1:%d", suite.conf.GetInt("cmd_port"))) } -func TestIPCEndpointErrorText(t *testing.T) { - ts := httptest.NewTLSServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { +func (suite *IPCEndpointTestSuite) TestIPCEndpointErrorText() { + t := suite.T() + ts := httptest.NewUnstartedServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { w.WriteHeader(400) w.Write([]byte("bad request")) })) defer ts.Close() - conf := createConfig(t, ts) - end, err := NewIPCEndpoint(conf, "test/api") - assert.NoError(t, err) + suite.setTestServerAndConfig(t, ts, true) + end, err := NewIPCEndpoint(suite.conf, "test/api") + require.NoError(t, err) // test that error is returned by the endpoint _, err = end.DoGet() - assert.Error(t, err) + require.Error(t, err) } -func TestIPCEndpointErrorMap(t *testing.T) { - ts := httptest.NewTLSServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { +func (suite *IPCEndpointTestSuite) TestIPCEndpointErrorMap() { + t := suite.T() + ts := httptest.NewUnstartedServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { w.WriteHeader(400) data, _ := json.Marshal(map[string]string{ "error": "something went wrong", @@ -222,12 +241,12 @@ func TestIPCEndpointErrorMap(t *testing.T) { })) defer ts.Close() - conf := createConfig(t, ts) - end, err := NewIPCEndpoint(conf, "test/api") - assert.NoError(t, err) + suite.setTestServerAndConfig(t, ts, true) + end, err := NewIPCEndpoint(suite.conf, "test/api") + require.NoError(t, err) // test that error gets unwrapped from the errmap _, err = end.DoGet() - assert.Error(t, err) + require.Error(t, err) assert.Equal(t, err.Error(), "something went wrong") } diff --git a/pkg/api/util/util.go b/pkg/api/util/util.go index 6aece9c03c648..b22c2e7b04ad0 100644 --- a/pkg/api/util/util.go +++ b/pkg/api/util/util.go @@ -8,52 +8,138 @@ package util import ( "crypto/subtle" + "crypto/tls" + "crypto/x509" "fmt" "net" "net/http" "strings" "sync" - "github.com/DataDog/datadog-agent/pkg/api/security" + pkgtoken "github.com/DataDog/datadog-agent/pkg/api/security" + "github.com/DataDog/datadog-agent/pkg/api/security/cert" "github.com/DataDog/datadog-agent/pkg/config/model" + "github.com/DataDog/datadog-agent/pkg/util/log" +) + +type source int + +const ( + uninitialized source = iota + setAuthToken + createAndSetAuthToken ) var ( tokenLock sync.RWMutex token string dcaToken string + // The clientTLSConfig is set by default with `InsecureSkipVerify: true`. + // This is intentionally done to allow the Agent to local Agent APIs when the clientTLSConfig is not yet initialized. + // However, this default value should be removed in the future. + // TODO: Monitor and fix the logs printed by GetTLSClientConfig and GetTLSServerConfig. + clientTLSConfig = &tls.Config{ + InsecureSkipVerify: true, + } + serverTLSConfig *tls.Config + initSource source ) -// SetAuthToken sets the session token +// SetAuthToken sets the session token and IPC certificate // Requires that the config has been set up before calling func SetAuthToken(config model.Reader) error { tokenLock.Lock() defer tokenLock.Unlock() // Noop if token is already set - if token != "" { + if initSource != uninitialized { return nil } var err error - token, err = security.FetchAuthToken(config) - return err + token, err = pkgtoken.FetchAuthToken(config) + if err != nil { + return err + } + ipccert, ipckey, err := cert.FetchAgentIPCCert(config) + if err != nil { + return err + } + + certPool := x509.NewCertPool() + if ok := certPool.AppendCertsFromPEM(ipccert); !ok { + return fmt.Errorf("unable to use cert for creating CertPool") + } + + clientTLSConfig = &tls.Config{ + RootCAs: certPool, + } + + tlsCert, err := tls.X509KeyPair(ipccert, ipckey) + if err != nil { + return err + } + serverTLSConfig = &tls.Config{ + Certificates: []tls.Certificate{tlsCert}, + } + + initSource = setAuthToken + + return nil } -// CreateAndSetAuthToken creates and sets the authorization token +// CreateAndSetAuthToken creates and sets the authorization token and IPC certificate // Requires that the config has been set up before calling func CreateAndSetAuthToken(config model.Reader) error { tokenLock.Lock() defer tokenLock.Unlock() // Noop if token is already set - if token != "" { + switch initSource { + case setAuthToken: + log.Infof("function CreateAndSetAuthToken was called after SetAuthToken was called") + return nil + case createAndSetAuthToken: return nil } var err error - token, err = security.CreateOrFetchToken(config) - return err + token, err = pkgtoken.CreateOrFetchToken(config) + if err != nil { + return err + } + ipccert, ipckey, err := cert.CreateOrFetchAgentIPCCert(config) + if err != nil { + return err + } + + certPool := x509.NewCertPool() + if ok := certPool.AppendCertsFromPEM(ipccert); !ok { + return fmt.Errorf("Unable to generate certPool from PERM IPC cert") + } + + clientTLSConfig = &tls.Config{ + RootCAs: certPool, + } + + tlsCert, err := tls.X509KeyPair(ipccert, ipckey) + if err != nil { + return fmt.Errorf("Unable to generate x509 cert from PERM IPC cert and key") + } + serverTLSConfig = &tls.Config{ + Certificates: []tls.Certificate{tlsCert}, + } + + initSource = createAndSetAuthToken + + return nil +} + +// IsInitialized return true if the auth_token and IPC cert/key pair have been initialized with SetAuthToken or CreateAndSetAuthToken functions +func IsInitialized() bool { + tokenLock.RLock() + defer tokenLock.Unlock() + return initSource != uninitialized } // GetAuthToken gets the session token @@ -63,6 +149,26 @@ func GetAuthToken() string { return token } +// GetTLSClientConfig gets the certificate and key used for IPC +func GetTLSClientConfig() *tls.Config { + tokenLock.RLock() + defer tokenLock.RUnlock() + if initSource == uninitialized { + log.Errorf("GetTLSClientConfig was called before being initialized (through SetAuthToken or CreateAndSetAuthToken function)") + } + return clientTLSConfig.Clone() +} + +// GetTLSServerConfig gets the certificate and key used for IPC +func GetTLSServerConfig() *tls.Config { + tokenLock.RLock() + defer tokenLock.RUnlock() + if initSource == uninitialized { + log.Errorf("GetTLSServerConfig was called before being initialized (through SetAuthToken or CreateAndSetAuthToken function)") + } + return serverTLSConfig.Clone() +} + // InitDCAAuthToken initialize the session token for the Cluster Agent based on config options // Requires that the config has been set up before calling func InitDCAAuthToken(config model.Reader) error { @@ -75,7 +181,7 @@ func InitDCAAuthToken(config model.Reader) error { } var err error - dcaToken, err = security.CreateOrGetClusterAgentAuthToken(config) + dcaToken, err = pkgtoken.CreateOrGetClusterAgentAuthToken(config) return err } diff --git a/pkg/clusteragent/admission/controllers/secret/controller.go b/pkg/clusteragent/admission/controllers/secret/controller.go index fccdce4aebc6b..38e80e0851d12 100644 --- a/pkg/clusteragent/admission/controllers/secret/controller.go +++ b/pkg/clusteragent/admission/controllers/secret/controller.go @@ -34,19 +34,19 @@ import ( // Controller is responsible for creating and refreshing the Secret object // that contains the certificate of the Admission Webhook. type Controller struct { - clientSet kubernetes.Interface - secretsLister corelisters.SecretLister - secretsSynced cache.InformerSynced - config Config - dnsNames []string - dnsNamesDigest uint64 - queue workqueue.TypedRateLimitingInterface[string] - isLeaderFunc func() bool - isLeaderNotif <-chan struct{} + clientSet kubernetes.Interface + secretsLister corelisters.SecretLister + secretsSynced cache.InformerSynced + config Config + dnsNames []string + dnsNamesDigest uint64 + queue workqueue.TypedRateLimitingInterface[string] + isLeaderFunc func() bool + leadershipStateNotif <-chan struct{} } // NewController returns a new Secret Controller. -func NewController(client kubernetes.Interface, secretInformer coreinformers.SecretInformer, isLeaderFunc func() bool, isLeaderNotif <-chan struct{}, config Config) *Controller { +func NewController(client kubernetes.Interface, secretInformer coreinformers.SecretInformer, isLeaderFunc func() bool, leadershipStateNotif <-chan struct{}, config Config) *Controller { dnsNames := generateDNSNames(config.GetNs(), config.GetSvc()) controller := &Controller{ clientSet: client, @@ -59,8 +59,8 @@ func NewController(client kubernetes.Interface, secretInformer coreinformers.Sec workqueue.DefaultTypedControllerRateLimiter[string](), workqueue.TypedRateLimitingQueueConfig[string]{Name: "secrets"}, ), - isLeaderFunc: isLeaderFunc, - isLeaderNotif: isLeaderNotif, + isLeaderFunc: isLeaderFunc, + leadershipStateNotif: leadershipStateNotif, } if _, err := secretInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{ AddFunc: controller.handleObject, @@ -101,9 +101,11 @@ func (c *Controller) Run(stopCh <-chan struct{}) { func (c *Controller) enqueueOnLeaderNotif(stop <-chan struct{}) { for { select { - case <-c.isLeaderNotif: - log.Infof("Got a leader notification, enqueuing a reconciliation for %s/%s", c.config.GetNs(), c.config.GetName()) - c.triggerReconciliation() + case <-c.leadershipStateNotif: + if c.isLeaderFunc() { + log.Infof("Got a leader notification, enqueuing a reconciliation for %s/%s", c.config.GetNs(), c.config.GetName()) + c.triggerReconciliation() + } case <-stop: return } diff --git a/pkg/clusteragent/admission/controllers/secret/controller_test.go b/pkg/clusteragent/admission/controllers/secret/controller_test.go index 650c354a6d013..41b9adffae80f 100644 --- a/pkg/clusteragent/admission/controllers/secret/controller_test.go +++ b/pkg/clusteragent/admission/controllers/secret/controller_test.go @@ -175,7 +175,7 @@ func (f *fixture) run(stopCh <-chan struct{}) *Controller { f.client, factory.Core().V1().Secrets(), func() bool { return true }, - make(chan struct{}), + make(<-chan struct{}), cfg, ) diff --git a/pkg/clusteragent/admission/controllers/webhook/config.go b/pkg/clusteragent/admission/controllers/webhook/config.go index 90cec93a8d8db..4f5e549434557 100644 --- a/pkg/clusteragent/admission/controllers/webhook/config.go +++ b/pkg/clusteragent/admission/controllers/webhook/config.go @@ -13,7 +13,7 @@ import ( "fmt" "strings" - pkgconfigsetup "github.com/DataDog/datadog-agent/pkg/config/setup" + "github.com/DataDog/datadog-agent/comp/core/config" "github.com/DataDog/datadog-agent/pkg/util/kubernetes/apiserver/common" ) @@ -36,21 +36,21 @@ type Config struct { } // NewConfig creates a webhook controller configuration -func NewConfig(admissionV1Enabled, namespaceSelectorEnabled, matchConditionsSupported bool) Config { +func NewConfig(admissionV1Enabled, namespaceSelectorEnabled, matchConditionsSupported bool, datadogConfig config.Component) Config { return Config{ - webhookName: pkgconfigsetup.Datadog().GetString("admission_controller.webhook_name"), - secretName: pkgconfigsetup.Datadog().GetString("admission_controller.certificate.secret_name"), - validationEnabled: pkgconfigsetup.Datadog().GetBool("admission_controller.validation.enabled"), - mutationEnabled: pkgconfigsetup.Datadog().GetBool("admission_controller.mutation.enabled"), + webhookName: datadogConfig.GetString("admission_controller.webhook_name"), + secretName: datadogConfig.GetString("admission_controller.certificate.secret_name"), + validationEnabled: datadogConfig.GetBool("admission_controller.validation.enabled"), + mutationEnabled: datadogConfig.GetBool("admission_controller.mutation.enabled"), namespace: common.GetResourcesNamespace(), admissionV1Enabled: admissionV1Enabled, namespaceSelectorEnabled: namespaceSelectorEnabled, matchConditionsSupported: matchConditionsSupported, - svcName: pkgconfigsetup.Datadog().GetString("admission_controller.service_name"), + svcName: datadogConfig.GetString("admission_controller.service_name"), svcPort: int32(443), - timeout: pkgconfigsetup.Datadog().GetInt32("admission_controller.timeout_seconds"), - failurePolicy: pkgconfigsetup.Datadog().GetString("admission_controller.failure_policy"), - reinvocationPolicy: pkgconfigsetup.Datadog().GetString("admission_controller.reinvocation_policy"), + timeout: datadogConfig.GetInt32("admission_controller.timeout_seconds"), + failurePolicy: datadogConfig.GetString("admission_controller.failure_policy"), + reinvocationPolicy: datadogConfig.GetString("admission_controller.reinvocation_policy"), } } diff --git a/pkg/clusteragent/admission/controllers/webhook/controller_base.go b/pkg/clusteragent/admission/controllers/webhook/controller_base.go index 79114dac7397f..68c1b9fd3f120 100644 --- a/pkg/clusteragent/admission/controllers/webhook/controller_base.go +++ b/pkg/clusteragent/admission/controllers/webhook/controller_base.go @@ -35,7 +35,6 @@ import ( "github.com/DataDog/datadog-agent/pkg/clusteragent/admission/mutate/tagsfromlabels" "github.com/DataDog/datadog-agent/pkg/clusteragent/admission/validate/kubernetesadmissionevents" "github.com/DataDog/datadog-agent/pkg/clusteragent/autoscaling/workload" - pkgconfigsetup "github.com/DataDog/datadog-agent/pkg/config/setup" "github.com/DataDog/datadog-agent/pkg/util/log" ) @@ -52,7 +51,7 @@ func NewController( validatingInformers admissionregistration.Interface, mutatingInformers admissionregistration.Interface, isLeaderFunc func() bool, - isLeaderNotif <-chan struct{}, + leadershipStateNotif <-chan struct{}, config Config, wmeta workloadmeta.Component, pa workload.PodPatcher, @@ -60,9 +59,9 @@ func NewController( demultiplexer demultiplexer.Component, ) Controller { if config.useAdmissionV1() { - return NewControllerV1(client, secretInformer, validatingInformers.V1().ValidatingWebhookConfigurations(), mutatingInformers.V1().MutatingWebhookConfigurations(), isLeaderFunc, isLeaderNotif, config, wmeta, pa, datadogConfig, demultiplexer) + return NewControllerV1(client, secretInformer, validatingInformers.V1().ValidatingWebhookConfigurations(), mutatingInformers.V1().MutatingWebhookConfigurations(), isLeaderFunc, leadershipStateNotif, config, wmeta, pa, datadogConfig, demultiplexer) } - return NewControllerV1beta1(client, secretInformer, validatingInformers.V1beta1().ValidatingWebhookConfigurations(), mutatingInformers.V1beta1().MutatingWebhookConfigurations(), isLeaderFunc, isLeaderNotif, config, wmeta, pa, datadogConfig, demultiplexer) + return NewControllerV1beta1(client, secretInformer, validatingInformers.V1beta1().ValidatingWebhookConfigurations(), mutatingInformers.V1beta1().MutatingWebhookConfigurations(), isLeaderFunc, leadershipStateNotif, config, wmeta, pa, datadogConfig, demultiplexer) } // Webhook represents an admission webhook @@ -125,7 +124,7 @@ func (c *controllerBase) generateWebhooks(wmeta workloadmeta.Component, pa workl configWebhook.NewWebhook(wmeta, injectionFilter, datadogConfig), tagsfromlabels.NewWebhook(wmeta, datadogConfig, injectionFilter), agentsidecar.NewWebhook(datadogConfig), - autoscaling.NewWebhook(pa), + autoscaling.NewWebhook(pa, datadogConfig), } webhooks = append(webhooks, mutatingWebhooks...) @@ -137,7 +136,7 @@ func (c *controllerBase) generateWebhooks(wmeta workloadmeta.Component, pa workl log.Errorf("failed to register APM Instrumentation webhook: %v", err) } - isCWSInstrumentationEnabled := pkgconfigsetup.Datadog().GetBool("admission_controller.cws_instrumentation.enabled") + isCWSInstrumentationEnabled := datadogConfig.GetBool("admission_controller.cws_instrumentation.enabled") if isCWSInstrumentationEnabled { cws, err := cwsinstrumentation.NewCWSInstrumentation(wmeta, datadogConfig) if err == nil { @@ -163,7 +162,7 @@ type controllerBase struct { mutatingWebhooksSynced cache.InformerSynced //nolint:structcheck queue workqueue.TypedRateLimitingInterface[string] isLeaderFunc func() bool - isLeaderNotif <-chan struct{} + leadershipStateNotif <-chan struct{} webhooks []Webhook } @@ -187,9 +186,11 @@ func (c *controllerBase) EnabledWebhooks() []Webhook { func (c *controllerBase) enqueueOnLeaderNotif(stop <-chan struct{}) { for { select { - case <-c.isLeaderNotif: - log.Infof("Got a leader notification, enqueuing a reconciliation for %q", c.config.getWebhookName()) - c.triggerReconciliation() + case <-c.leadershipStateNotif: + if c.isLeaderFunc() { + log.Infof("Got a leader notification, enqueuing a reconciliation for %q", c.config.getWebhookName()) + c.triggerReconciliation() + } case <-stop: return } diff --git a/pkg/clusteragent/admission/controllers/webhook/controller_base_test.go b/pkg/clusteragent/admission/controllers/webhook/controller_base_test.go index c202f1ab38f25..67281c628dd92 100644 --- a/pkg/clusteragent/admission/controllers/webhook/controller_base_test.go +++ b/pkg/clusteragent/admission/controllers/webhook/controller_base_test.go @@ -35,8 +35,8 @@ func TestNewController(t *testing.T) { factory.Admissionregistration(), factory.Admissionregistration(), func() bool { return true }, - make(chan struct{}), - v1Cfg, + make(<-chan struct{}), + getV1Cfg(t), wmeta, nil, datadogConfig, @@ -52,8 +52,8 @@ func TestNewController(t *testing.T) { factory.Admissionregistration(), factory.Admissionregistration(), func() bool { return true }, - make(chan struct{}), - v1beta1Cfg, + make(<-chan struct{}), + getV1beta1Cfg(t), wmeta, nil, datadogConfig, diff --git a/pkg/clusteragent/admission/controllers/webhook/controller_v1.go b/pkg/clusteragent/admission/controllers/webhook/controller_v1.go index 003ccbe10986a..b65ea3d7b6fd3 100644 --- a/pkg/clusteragent/admission/controllers/webhook/controller_v1.go +++ b/pkg/clusteragent/admission/controllers/webhook/controller_v1.go @@ -53,7 +53,7 @@ func NewControllerV1( validatingWebhookInformer admissioninformers.ValidatingWebhookConfigurationInformer, mutatingWebhookInformer admissioninformers.MutatingWebhookConfigurationInformer, isLeaderFunc func() bool, - isLeaderNotif <-chan struct{}, + leadershipStateNotif <-chan struct{}, config Config, wmeta workloadmeta.Component, pa workload.PodPatcher, @@ -75,7 +75,7 @@ func NewControllerV1( workqueue.TypedRateLimitingQueueConfig[string]{Name: "webhooks"}, ) controller.isLeaderFunc = isLeaderFunc - controller.isLeaderNotif = isLeaderNotif + controller.leadershipStateNotif = leadershipStateNotif controller.webhooks = controller.generateWebhooks(wmeta, pa, datadogConfig, demultiplexer) controller.generateTemplates() @@ -212,6 +212,19 @@ func (c *ControllerV1) reconcile() error { log.Errorf("Failed to update Mutating Webhook %s: %v", c.config.getWebhookName(), err) } } + } else { + mutatingWebhook, err := c.mutatingWebhooksLister.Get(c.config.getWebhookName()) + if err != nil { + if !errors.IsNotFound(err) { + log.Errorf("Failed to get Mutating Webhook %s: %v", c.config.getWebhookName(), err) + } + } else { + log.Infof("Mutating Webhook %s was found, deleting it", c.config.getWebhookName()) + err := c.deleteMutatingWebhook(mutatingWebhook) + if err != nil { + log.Errorf("Failed to delete Mutating Webhook %s: %v", c.config.getWebhookName(), err) + } + } } if c.config.validationEnabled { @@ -231,6 +244,19 @@ func (c *ControllerV1) reconcile() error { log.Errorf("Failed to update Validating Webhook %s: %v", c.config.getWebhookName(), err) } } + } else { + validatingWebhook, err := c.validatingWebhooksLister.Get(c.config.getWebhookName()) + if err != nil { + if !errors.IsNotFound(err) { + log.Errorf("Failed to get Validating Webhook %s: %v", c.config.getWebhookName(), err) + } + } else { + log.Infof("Validating Webhook %s was found, deleting it", c.config.getWebhookName()) + err := c.deleteValidatingWebhook(validatingWebhook) + if err != nil { + log.Errorf("Failed to delete Validating Webhook %s: %v", c.config.getWebhookName(), err) + } + } } return err @@ -273,6 +299,12 @@ func (c *ControllerV1) newValidatingWebhooks(secret *corev1.Secret) []admiv1.Val return webhooks } +// deleteValidatingWebhook deletes the ValidatingWebhookConfiguration object. +func (c *ControllerV1) deleteValidatingWebhook(webhook *admiv1.ValidatingWebhookConfiguration) error { + err := c.clientSet.AdmissionregistrationV1().ValidatingWebhookConfigurations().Delete(context.TODO(), webhook.Name, metav1.DeleteOptions{}) + return err +} + // createMutatingWebhook creates a new MutatingWebhookConfiguration object. func (c *ControllerV1) createMutatingWebhook(secret *corev1.Secret) error { webhook := &admiv1.MutatingWebhookConfiguration{ @@ -310,6 +342,12 @@ func (c *ControllerV1) newMutatingWebhooks(secret *corev1.Secret) []admiv1.Mutat return webhooks } +// deleteMutatingWebhook deletes the MutatingWebhookConfiguration object. +func (c *ControllerV1) deleteMutatingWebhook(webhook *admiv1.MutatingWebhookConfiguration) error { + err := c.clientSet.AdmissionregistrationV1().MutatingWebhookConfigurations().Delete(context.TODO(), webhook.Name, metav1.DeleteOptions{}) + return err +} + // generateTemplates generates the webhook templates from the configuration. func (c *ControllerV1) generateTemplates() { // Generate validating webhook templates diff --git a/pkg/clusteragent/admission/controllers/webhook/controller_v1_test.go b/pkg/clusteragent/admission/controllers/webhook/controller_v1_test.go index aa2a3efc4e68e..3c0bbb81bd5f3 100644 --- a/pkg/clusteragent/admission/controllers/webhook/controller_v1_test.go +++ b/pkg/clusteragent/admission/controllers/webhook/controller_v1_test.go @@ -41,10 +41,11 @@ const ( tick = 50 * time.Millisecond ) -var v1Cfg = NewConfig(true, false, false) +func getV1Cfg(t *testing.T) Config { return NewConfig(true, false, false, configComp.NewMock(t)) } func TestSecretNotFoundV1(t *testing.T) { f := newFixtureV1(t) + v1Cfg := getV1Cfg(t) stopCh := make(chan struct{}) defer close(stopCh) @@ -63,6 +64,7 @@ func TestSecretNotFoundV1(t *testing.T) { func TestCreateWebhookV1(t *testing.T) { f := newFixtureV1(t) + v1Cfg := getV1Cfg(t) data, err := certificate.GenerateSecretData(time.Now(), time.Now().Add(365*24*time.Hour), []string{"my.svc.dns"}) if err != nil { @@ -97,6 +99,7 @@ func TestCreateWebhookV1(t *testing.T) { func TestUpdateOutdatedWebhookV1(t *testing.T) { f := newFixtureV1(t) + v1Cfg := getV1Cfg(t) data, err := certificate.GenerateSecretData(time.Now(), time.Now().Add(365*24*time.Hour), []string{"my.svc.dns"}) if err != nil { @@ -166,7 +169,7 @@ func TestAdmissionControllerFailureModeV1(t *testing.T) { for _, value := range []string{"Ignore", "ignore", "BadVal", ""} { mockConfig.SetWithoutSource("admission_controller.failure_policy", value) - c.config = NewConfig(true, false, false) + c.config = NewConfig(true, false, false, mockConfig) validatingWebhookSkeleton := c.getValidatingWebhookSkeleton("foo", "/bar", []admiv1.OperationType{admiv1.Create}, map[string][]string{"": {"pods"}}, nil, nil, nil) assert.Equal(t, admiv1.Ignore, *validatingWebhookSkeleton.FailurePolicy) @@ -176,7 +179,7 @@ func TestAdmissionControllerFailureModeV1(t *testing.T) { for _, value := range []string{"Fail", "fail"} { mockConfig.SetWithoutSource("admission_controller.failure_policy", value) - c.config = NewConfig(true, false, false) + c.config = NewConfig(true, false, false, mockConfig) validatingWebhookSkeleton := c.getValidatingWebhookSkeleton("foo", "/bar", []admiv1.OperationType{admiv1.Create}, map[string][]string{"": {"pods"}}, nil, nil, nil) assert.Equal(t, admiv1.Fail, *validatingWebhookSkeleton.FailurePolicy) @@ -192,7 +195,7 @@ func TestAdmissionControllerReinvocationPolicyV1(t *testing.T) { for _, value := range []string{"IfNeeded", "ifneeded", "Never", "never", "wrong", ""} { mockConfig.SetWithoutSource("admission_controller.reinvocationpolicy", value) - c.config = NewConfig(true, false, false) + c.config = NewConfig(true, false, false, mockConfig) mutatingWebhookSkeleton := c.getMutatingWebhookSkeleton("foo", "/bar", []admiv1.OperationType{admiv1.Create}, map[string][]string{"": {"pods"}}, nil, nil, nil) assert.Equal(t, admiv1.IfNeededReinvocationPolicy, *mutatingWebhookSkeleton.ReinvocationPolicy) @@ -241,7 +244,7 @@ func TestGenerateTemplatesV1(t *testing.T) { tests := []struct { name string setupConfig func(model.Config) - configFunc func() Config + configFunc func(model.Config) Config want func() []admiv1.MutatingWebhook }{ { @@ -253,7 +256,7 @@ func TestGenerateTemplatesV1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.auto_instrumentation.enabled", false) mockConfig.SetWithoutSource("admission_controller.cws_instrumentation.enabled", false) }, - configFunc: func() Config { return NewConfig(false, false, false) }, + configFunc: func(mockConfig model.Config) Config { return NewConfig(false, false, false, mockConfig) }, want: func() []admiv1.MutatingWebhook { webhook := webhook("datadog.webhook.agent.config", "/injectconfig", &metav1.LabelSelector{ MatchExpressions: []metav1.LabelSelectorRequirement{ @@ -276,7 +279,7 @@ func TestGenerateTemplatesV1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.auto_instrumentation.enabled", false) mockConfig.SetWithoutSource("admission_controller.cws_instrumentation.enabled", false) }, - configFunc: func() Config { return NewConfig(false, false, false) }, + configFunc: func(mockConfig model.Config) Config { return NewConfig(false, false, false, mockConfig) }, want: func() []admiv1.MutatingWebhook { webhook := webhook("datadog.webhook.agent.config", "/injectconfig", &metav1.LabelSelector{ MatchLabels: map[string]string{ @@ -295,7 +298,7 @@ func TestGenerateTemplatesV1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.auto_instrumentation.enabled", false) mockConfig.SetWithoutSource("admission_controller.cws_instrumentation.enabled", false) }, - configFunc: func() Config { return NewConfig(false, false, false) }, + configFunc: func(mockConfig model.Config) Config { return NewConfig(false, false, false, mockConfig) }, want: func() []admiv1.MutatingWebhook { webhook := webhook("datadog.webhook.standard.tags", "/injecttags", &metav1.LabelSelector{ MatchExpressions: []metav1.LabelSelectorRequirement{ @@ -318,7 +321,7 @@ func TestGenerateTemplatesV1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.auto_instrumentation.enabled", false) mockConfig.SetWithoutSource("admission_controller.cws_instrumentation.enabled", false) }, - configFunc: func() Config { return NewConfig(false, false, false) }, + configFunc: func(mockConfig model.Config) Config { return NewConfig(false, false, false, mockConfig) }, want: func() []admiv1.MutatingWebhook { webhook := webhook("datadog.webhook.standard.tags", "/injecttags", &metav1.LabelSelector{ MatchLabels: map[string]string{ @@ -337,7 +340,7 @@ func TestGenerateTemplatesV1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.auto_instrumentation.enabled", true) mockConfig.SetWithoutSource("admission_controller.cws_instrumentation.enabled", false) }, - configFunc: func() Config { return NewConfig(false, false, false) }, + configFunc: func(mockConfig model.Config) Config { return NewConfig(false, false, false, mockConfig) }, want: func() []admiv1.MutatingWebhook { webhook := webhook("datadog.webhook.lib.injection", "/injectlib", &metav1.LabelSelector{ MatchExpressions: []metav1.LabelSelectorRequirement{ @@ -360,7 +363,7 @@ func TestGenerateTemplatesV1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.auto_instrumentation.enabled", true) mockConfig.SetWithoutSource("admission_controller.cws_instrumentation.enabled", false) }, - configFunc: func() Config { return NewConfig(false, false, false) }, + configFunc: func(mockConfig model.Config) Config { return NewConfig(false, false, false, mockConfig) }, want: func() []admiv1.MutatingWebhook { webhook := webhook("datadog.webhook.lib.injection", "/injectlib", &metav1.LabelSelector{ MatchLabels: map[string]string{ @@ -378,7 +381,7 @@ func TestGenerateTemplatesV1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.auto_instrumentation.enabled", false) mockConfig.SetWithoutSource("admission_controller.cws_instrumentation.enabled", false) }, - configFunc: func() Config { return NewConfig(false, false, false) }, + configFunc: func(mockConfig model.Config) Config { return NewConfig(false, false, false, mockConfig) }, want: func() []admiv1.MutatingWebhook { webhookConfig := webhook("datadog.webhook.agent.config", "/injectconfig", &metav1.LabelSelector{ MatchLabels: map[string]string{ @@ -402,7 +405,7 @@ func TestGenerateTemplatesV1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.auto_instrumentation.enabled", false) mockConfig.SetWithoutSource("admission_controller.cws_instrumentation.enabled", false) }, - configFunc: func() Config { return NewConfig(false, false, false) }, + configFunc: func(mockConfig model.Config) Config { return NewConfig(false, false, false, mockConfig) }, want: func() []admiv1.MutatingWebhook { webhookConfig := webhook("datadog.webhook.agent.config", "/injectconfig", &metav1.LabelSelector{ MatchExpressions: []metav1.LabelSelectorRequirement{ @@ -435,7 +438,7 @@ func TestGenerateTemplatesV1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.namespace_selector_fallback", true) mockConfig.SetWithoutSource("admission_controller.cws_instrumentation.enabled", false) }, - configFunc: func() Config { return NewConfig(false, true, false) }, + configFunc: func(mockConfig model.Config) Config { return NewConfig(false, true, false, mockConfig) }, want: func() []admiv1.MutatingWebhook { webhookConfig := webhook("datadog.webhook.agent.config", "/injectconfig", nil, &metav1.LabelSelector{ MatchLabels: map[string]string{ @@ -461,7 +464,7 @@ func TestGenerateTemplatesV1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.inject_tags.enabled", false) mockConfig.SetWithoutSource("admission_controller.cws_instrumentation.enabled", false) }, - configFunc: func() Config { return NewConfig(false, false, false) }, + configFunc: func(mockConfig model.Config) Config { return NewConfig(false, false, false, mockConfig) }, want: func() []admiv1.MutatingWebhook { webhook := webhook( "datadog.webhook.agent.config", @@ -511,7 +514,7 @@ func TestGenerateTemplatesV1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.auto_instrumentation.enabled", false) mockConfig.SetWithoutSource("admission_controller.cws_instrumentation.enabled", false) }, - configFunc: func() Config { return NewConfig(false, true, false) }, + configFunc: func(mockConfig model.Config) Config { return NewConfig(false, true, false, mockConfig) }, want: func() []admiv1.MutatingWebhook { webhook := webhook( "datadog.webhook.agent.config", @@ -559,7 +562,7 @@ func TestGenerateTemplatesV1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.cws_instrumentation.mutate_unlabelled", true) mockConfig.SetWithoutSource("cluster_agent.service_account_name", "datadog-cluster-agent") }, - configFunc: func() Config { return NewConfig(true, false, false) }, + configFunc: func(mockConfig model.Config) Config { return NewConfig(true, false, false, mockConfig) }, want: func() []admiv1.MutatingWebhook { podWebhook := webhook( "datadog.webhook.cws.pod.instrumentation", @@ -602,7 +605,7 @@ func TestGenerateTemplatesV1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.cws_instrumentation.mutate_unlabelled", false) mockConfig.SetWithoutSource("cluster_agent.service_account_name", "datadog-cluster-agent") }, - configFunc: func() Config { return NewConfig(true, false, false) }, + configFunc: func(mockConfig model.Config) Config { return NewConfig(true, false, false, mockConfig) }, want: func() []admiv1.MutatingWebhook { podWebhook := webhook( "datadog.webhook.cws.pod.instrumentation", @@ -641,7 +644,7 @@ func TestGenerateTemplatesV1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.cws_instrumentation.mutate_unlabelled", true) mockConfig.SetWithoutSource("cluster_agent.service_account_name", "datadog-cluster-agent") }, - configFunc: func() Config { return NewConfig(true, true, false) }, + configFunc: func(mockConfig model.Config) Config { return NewConfig(true, true, false, mockConfig) }, want: func() []admiv1.MutatingWebhook { podWebhook := webhook( "datadog.webhook.cws.pod.instrumentation", @@ -684,7 +687,7 @@ func TestGenerateTemplatesV1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.cws_instrumentation.mutate_unlabelled", false) mockConfig.SetWithoutSource("cluster_agent.service_account_name", "datadog-cluster-agent") }, - configFunc: func() Config { return NewConfig(true, true, false) }, + configFunc: func(mockConfig model.Config) Config { return NewConfig(true, true, false, mockConfig) }, want: func() []admiv1.MutatingWebhook { podWebhook := webhook( "datadog.webhook.cws.pod.instrumentation", @@ -726,7 +729,7 @@ func TestGenerateTemplatesV1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.agent_sidecar.selectors", "[]") mockConfig.SetWithoutSource("admission_controller.agent_sidecar.profiles", "misconfigured") }, - configFunc: func() Config { return NewConfig(true, true, false) }, + configFunc: func(mockConfig model.Config) Config { return NewConfig(true, true, false, mockConfig) }, want: func() []admiv1.MutatingWebhook { return []admiv1.MutatingWebhook{} }, @@ -746,7 +749,7 @@ func TestGenerateTemplatesV1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.agent_sidecar.selectors", "[]") mockConfig.SetWithoutSource("admission_controller.agent_sidecar.profiles", "[]") }, - configFunc: func() Config { return NewConfig(true, true, false) }, + configFunc: func(mockConfig model.Config) Config { return NewConfig(true, true, false, mockConfig) }, want: func() []admiv1.MutatingWebhook { podWebhook := webhook( "datadog.webhook.agent.sidecar", @@ -779,7 +782,7 @@ func TestGenerateTemplatesV1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.agent_sidecar.selectors", "[]") mockConfig.SetWithoutSource("admission_controller.agent_sidecar.profiles", "[]") }, - configFunc: func() Config { return NewConfig(true, true, false) }, + configFunc: func(mockConfig model.Config) Config { return NewConfig(true, true, false, mockConfig) }, want: func() []admiv1.MutatingWebhook { return []admiv1.MutatingWebhook{} }, @@ -799,7 +802,7 @@ func TestGenerateTemplatesV1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.agent_sidecar.selectors", "[]") mockConfig.SetWithoutSource("admission_controller.agent_sidecar.profiles", "[]") }, - configFunc: func() Config { return NewConfig(true, true, false) }, + configFunc: func(mockConfig model.Config) Config { return NewConfig(true, true, false, mockConfig) }, want: func() []admiv1.MutatingWebhook { return []admiv1.MutatingWebhook{} }, @@ -819,7 +822,7 @@ func TestGenerateTemplatesV1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.agent_sidecar.selectors", "[{\"NamespaceSelector\": {\"MatchLabels\": {\"labelKey\": \"labelVal\"}}}]") mockConfig.SetWithoutSource("admission_controller.agent_sidecar.profiles", "[]") }, - configFunc: func() Config { return NewConfig(true, true, false) }, + configFunc: func(mockConfig model.Config) Config { return NewConfig(true, true, false, mockConfig) }, want: func() []admiv1.MutatingWebhook { podWebhook := webhook( "datadog.webhook.agent.sidecar", @@ -850,7 +853,7 @@ func TestGenerateTemplatesV1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.agent_sidecar.selectors", "[{\"ObjectSelector\": {\"MatchLabels\": {\"labelKey\": \"labelVal\"}}}]") mockConfig.SetWithoutSource("admission_controller.agent_sidecar.profiles", "[]") }, - configFunc: func() Config { return NewConfig(true, true, false) }, + configFunc: func(mockConfig model.Config) Config { return NewConfig(true, true, false, mockConfig) }, want: func() []admiv1.MutatingWebhook { return []admiv1.MutatingWebhook{} }, @@ -870,7 +873,7 @@ func TestGenerateTemplatesV1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.agent_sidecar.selectors", "[{\"ObjectSelector\": {\"MatchLabels\": {\"labelKey\": \"labelVal\"}}}]") mockConfig.SetWithoutSource("admission_controller.agent_sidecar.profiles", "[]") }, - configFunc: func() Config { return NewConfig(true, true, false) }, + configFunc: func(mockConfig model.Config) Config { return NewConfig(true, true, false, mockConfig) }, want: func() []admiv1.MutatingWebhook { podWebhook := webhook( "datadog.webhook.agent.sidecar", @@ -899,7 +902,7 @@ func TestGenerateTemplatesV1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.agent_sidecar.selectors", "[{\"ObjectSelector\": {\"MatchLabels\": {\"labelKey1\": \"labelVal1\"}}, \"NamespaceSelector\": {\"MatchLabels\": {\"labelKey2\": \"labelVal2\"}}}]") mockConfig.SetWithoutSource("admission_controller.agent_sidecar.profiles", "[]") }, - configFunc: func() Config { return NewConfig(true, true, false) }, + configFunc: func(mockConfig model.Config) Config { return NewConfig(true, true, false, mockConfig) }, want: func() []admiv1.MutatingWebhook { podWebhook := webhook( "datadog.webhook.agent.sidecar", @@ -928,7 +931,7 @@ func TestGenerateTemplatesV1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.agent_sidecar.selectors", "[{\"NamespaceSelector\": {\"MatchLabels\":{\"labelKey1\": \"labelVal1\"}}} , {\"ObjectSelector\": {\"MatchLabels\": {\"labelKey2\": \"labelVal2\"}}}]") mockConfig.SetWithoutSource("admission_controller.agent_sidecar.profiles", "[]") }, - configFunc: func() Config { return NewConfig(true, true, false) }, + configFunc: func(mockConfig model.Config) Config { return NewConfig(true, true, false, mockConfig) }, want: func() []admiv1.MutatingWebhook { return []admiv1.MutatingWebhook{} }, @@ -947,7 +950,7 @@ func TestGenerateTemplatesV1(t *testing.T) { tt.setupConfig(mockConfig) c := &ControllerV1{} - c.config = tt.configFunc() + c.config = tt.configFunc(mockConfig) c.webhooks = c.generateWebhooks(wmeta, nil, mockConfig, nil) c.generateTemplates() @@ -1051,7 +1054,7 @@ func TestGetValidatingWebhookSkeletonV1(t *testing.T) { } c := &ControllerV1{} - c.config = NewConfig(false, tt.namespaceSelector, false) + c.config = NewConfig(false, tt.namespaceSelector, false, mockConfig) nsSelector, objSelector := common.DefaultLabelSelectors(tt.namespaceSelector) @@ -1157,7 +1160,7 @@ func TestGetMutatingWebhookSkeletonV1(t *testing.T) { } c := &ControllerV1{} - c.config = NewConfig(false, tt.namespaceSelector, false) + c.config = NewConfig(false, tt.namespaceSelector, false, mockConfig) nsSelector, objSelector := common.DefaultLabelSelectors(tt.namespaceSelector) @@ -1187,8 +1190,8 @@ func (f *fixtureV1) createController() (*ControllerV1, informers.SharedInformerF factory.Admissionregistration().V1().ValidatingWebhookConfigurations(), factory.Admissionregistration().V1().MutatingWebhookConfigurations(), func() bool { return true }, - make(chan struct{}), - v1Cfg, + make(<-chan struct{}), + getV1Cfg(f.t), wmeta, nil, datadogConfig, diff --git a/pkg/clusteragent/admission/controllers/webhook/controller_v1beta1.go b/pkg/clusteragent/admission/controllers/webhook/controller_v1beta1.go index dad86838eff33..fbcf7bee4135d 100644 --- a/pkg/clusteragent/admission/controllers/webhook/controller_v1beta1.go +++ b/pkg/clusteragent/admission/controllers/webhook/controller_v1beta1.go @@ -54,7 +54,7 @@ func NewControllerV1beta1( validatingWebhookInformer admissioninformers.ValidatingWebhookConfigurationInformer, mutatingWebhookInformer admissioninformers.MutatingWebhookConfigurationInformer, isLeaderFunc func() bool, - isLeaderNotif <-chan struct{}, + leadershipStateNotif <-chan struct{}, config Config, wmeta workloadmeta.Component, pa workload.PodPatcher, @@ -76,7 +76,7 @@ func NewControllerV1beta1( workqueue.TypedRateLimitingQueueConfig[string]{Name: "webhooks"}, ) controller.isLeaderFunc = isLeaderFunc - controller.isLeaderNotif = isLeaderNotif + controller.leadershipStateNotif = leadershipStateNotif controller.webhooks = controller.generateWebhooks(wmeta, pa, datadogConfig, demultiplexer) controller.generateTemplates() @@ -213,6 +213,19 @@ func (c *ControllerV1beta1) reconcile() error { log.Errorf("Failed to update Mutating Webhook %s: %v", c.config.getWebhookName(), err) } } + } else { + mutatingWebhook, err := c.mutatingWebhooksLister.Get(c.config.getWebhookName()) + if err != nil { + if !errors.IsNotFound(err) { + log.Errorf("Failed to get Mutating Webhook %s: %v", c.config.getWebhookName(), err) + } + } else { + log.Infof("Mutating Webhook %s was found, deleting it", c.config.getWebhookName()) + err := c.deleteMutatingWebhook(mutatingWebhook) + if err != nil { + log.Errorf("Failed to delete Mutating Webhook %s: %v", c.config.getWebhookName(), err) + } + } } if c.config.validationEnabled { @@ -232,6 +245,19 @@ func (c *ControllerV1beta1) reconcile() error { log.Errorf("Failed to update Validating Webhook %s: %v", c.config.getWebhookName(), err) } } + } else { + validatingWebhook, err := c.validatingWebhooksLister.Get(c.config.getWebhookName()) + if err != nil { + if !errors.IsNotFound(err) { + log.Errorf("Failed to get Validating Webhook %s: %v", c.config.getWebhookName(), err) + } + } else { + log.Infof("Validating Webhook %s was found, deleting it", c.config.getWebhookName()) + err := c.deleteValidatingWebhook(validatingWebhook) + if err != nil { + log.Errorf("Failed to delete Validating Webhook %s: %v", c.config.getWebhookName(), err) + } + } } return err @@ -274,6 +300,12 @@ func (c *ControllerV1beta1) newValidatingWebhooks(secret *corev1.Secret) []admiv return webhooks } +// deleteValidatingWebhook deletes the ValidatingWebhookConfiguration object. +func (c *ControllerV1beta1) deleteValidatingWebhook(webhook *admiv1beta1.ValidatingWebhookConfiguration) error { + err := c.clientSet.AdmissionregistrationV1beta1().ValidatingWebhookConfigurations().Delete(context.TODO(), webhook.Name, metav1.DeleteOptions{}) + return err +} + // createMutatingWebhook creates a new MutatingWebhookConfiguration object. func (c *ControllerV1beta1) createMutatingWebhook(secret *corev1.Secret) error { webhook := &admiv1beta1.MutatingWebhookConfiguration{ @@ -312,6 +344,12 @@ func (c *ControllerV1beta1) newMutatingWebhooks(secret *corev1.Secret) []admiv1b return webhooks } +// deleteMutatingWebhook deletes the MutatingWebhookConfiguration object. +func (c *ControllerV1beta1) deleteMutatingWebhook(webhook *admiv1beta1.MutatingWebhookConfiguration) error { + err := c.clientSet.AdmissionregistrationV1beta1().MutatingWebhookConfigurations().Delete(context.TODO(), webhook.Name, metav1.DeleteOptions{}) + return err +} + func (c *ControllerV1beta1) generateTemplates() { validatingWebhooks := []admiv1beta1.ValidatingWebhook{} for _, webhook := range c.webhooks { diff --git a/pkg/clusteragent/admission/controllers/webhook/controller_v1beta1_test.go b/pkg/clusteragent/admission/controllers/webhook/controller_v1beta1_test.go index bd5daf906a2fb..ef20ff4343a97 100644 --- a/pkg/clusteragent/admission/controllers/webhook/controller_v1beta1_test.go +++ b/pkg/clusteragent/admission/controllers/webhook/controller_v1beta1_test.go @@ -36,10 +36,11 @@ import ( "github.com/DataDog/datadog-agent/pkg/util/kubernetes/certificate" ) -var v1beta1Cfg = NewConfig(false, false, false) +func getV1beta1Cfg(t *testing.T) Config { return NewConfig(false, false, false, configComp.NewMock(t)) } func TestSecretNotFoundV1beta1(t *testing.T) { f := newFixtureV1beta1(t) + v1beta1Cfg := getV1beta1Cfg(t) stopCh := make(chan struct{}) defer close(stopCh) @@ -58,6 +59,7 @@ func TestSecretNotFoundV1beta1(t *testing.T) { func TestCreateWebhookV1beta1(t *testing.T) { f := newFixtureV1beta1(t) + v1beta1Cfg := getV1beta1Cfg(t) data, err := certificate.GenerateSecretData(time.Now(), time.Now().Add(365*24*time.Hour), []string{"my.svc.dns"}) if err != nil { @@ -92,6 +94,8 @@ func TestCreateWebhookV1beta1(t *testing.T) { func TestUpdateOutdatedWebhookV1beta1(t *testing.T) { f := newFixtureV1beta1(t) + v1Cfg := getV1Cfg(t) + v1beta1Cfg := getV1beta1Cfg(t) data, err := certificate.GenerateSecretData(time.Now(), time.Now().Add(365*24*time.Hour), []string{"my.svc.dns"}) if err != nil { @@ -161,7 +165,7 @@ func TestAdmissionControllerFailureModeV1beta1(t *testing.T) { for _, value := range []string{"Ignore", "ignore", "BadVal", ""} { mockConfig.SetWithoutSource("admission_controller.failure_policy", value) - c.config = NewConfig(true, false, false) + c.config = NewConfig(true, false, false, mockConfig) validatingWebhookSkeleton := c.getValidatingWebhookSkeleton("foo", "/bar", []admiv1beta1.OperationType{admiv1beta1.Create}, map[string][]string{"": {"pods"}}, nil, nil, nil) assert.Equal(t, admiv1beta1.Ignore, *validatingWebhookSkeleton.FailurePolicy) @@ -171,7 +175,7 @@ func TestAdmissionControllerFailureModeV1beta1(t *testing.T) { for _, value := range []string{"Fail", "fail"} { mockConfig.SetWithoutSource("admission_controller.failure_policy", value) - c.config = NewConfig(true, false, false) + c.config = NewConfig(true, false, false, mockConfig) validatingWebhookSkeleton := c.getValidatingWebhookSkeleton("foo", "/bar", []admiv1beta1.OperationType{admiv1beta1.Create}, map[string][]string{"": {"pods"}}, nil, nil, nil) assert.Equal(t, admiv1beta1.Fail, *validatingWebhookSkeleton.FailurePolicy) @@ -187,7 +191,7 @@ func TestAdmissionControllerReinvocationPolicyV1beta1(t *testing.T) { for _, value := range []string{"IfNeeded", "ifneeded", "Never", "never", "wrong", ""} { mockConfig.SetWithoutSource("admission_controller.reinvocationpolicy", value) - c.config = NewConfig(true, false, false) + c.config = NewConfig(true, false, false, mockConfig) mutatingWebhookSkeleton := c.getMutatingWebhookSkeleton("foo", "/bar", []admiv1beta1.OperationType{admiv1beta1.Create}, map[string][]string{"": {"pods"}}, nil, nil, nil) assert.Equal(t, admiv1beta1.IfNeededReinvocationPolicy, *mutatingWebhookSkeleton.ReinvocationPolicy) @@ -236,7 +240,7 @@ func TestGenerateTemplatesV1beta1(t *testing.T) { tests := []struct { name string setupConfig func(model.Config) - configFunc func() Config + configFunc func(model.Config) Config want func() []admiv1beta1.MutatingWebhook }{ { @@ -248,7 +252,7 @@ func TestGenerateTemplatesV1beta1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.auto_instrumentation.enabled", false) mockConfig.SetWithoutSource("admission_controller.cws_instrumentation.enabled", false) }, - configFunc: func() Config { return NewConfig(false, false, false) }, + configFunc: func(mockConfig model.Config) Config { return NewConfig(false, false, false, mockConfig) }, want: func() []admiv1beta1.MutatingWebhook { webhook := webhook("datadog.webhook.agent.config", "/injectconfig", &metav1.LabelSelector{ MatchExpressions: []metav1.LabelSelectorRequirement{ @@ -271,7 +275,7 @@ func TestGenerateTemplatesV1beta1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.auto_instrumentation.enabled", false) mockConfig.SetWithoutSource("admission_controller.cws_instrumentation.enabled", false) }, - configFunc: func() Config { return NewConfig(false, false, false) }, + configFunc: func(mockConfig model.Config) Config { return NewConfig(false, false, false, mockConfig) }, want: func() []admiv1beta1.MutatingWebhook { webhook := webhook("datadog.webhook.agent.config", "/injectconfig", &metav1.LabelSelector{ MatchLabels: map[string]string{ @@ -290,7 +294,7 @@ func TestGenerateTemplatesV1beta1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.auto_instrumentation.enabled", false) mockConfig.SetWithoutSource("admission_controller.cws_instrumentation.enabled", false) }, - configFunc: func() Config { return NewConfig(false, false, false) }, + configFunc: func(mockConfig model.Config) Config { return NewConfig(false, false, false, mockConfig) }, want: func() []admiv1beta1.MutatingWebhook { webhook := webhook("datadog.webhook.standard.tags", "/injecttags", &metav1.LabelSelector{ MatchExpressions: []metav1.LabelSelectorRequirement{ @@ -313,7 +317,7 @@ func TestGenerateTemplatesV1beta1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.auto_instrumentation.enabled", false) mockConfig.SetWithoutSource("admission_controller.cws_instrumentation.enabled", false) }, - configFunc: func() Config { return NewConfig(false, false, false) }, + configFunc: func(mockConfig model.Config) Config { return NewConfig(false, false, false, mockConfig) }, want: func() []admiv1beta1.MutatingWebhook { webhook := webhook("datadog.webhook.standard.tags", "/injecttags", &metav1.LabelSelector{ MatchLabels: map[string]string{ @@ -332,7 +336,7 @@ func TestGenerateTemplatesV1beta1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.auto_instrumentation.enabled", true) mockConfig.SetWithoutSource("admission_controller.cws_instrumentation.enabled", false) }, - configFunc: func() Config { return NewConfig(false, false, false) }, + configFunc: func(mockConfig model.Config) Config { return NewConfig(false, false, false, mockConfig) }, want: func() []admiv1beta1.MutatingWebhook { webhook := webhook("datadog.webhook.lib.injection", "/injectlib", &metav1.LabelSelector{ MatchExpressions: []metav1.LabelSelectorRequirement{ @@ -355,7 +359,7 @@ func TestGenerateTemplatesV1beta1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.auto_instrumentation.enabled", true) mockConfig.SetWithoutSource("admission_controller.cws_instrumentation.enabled", false) }, - configFunc: func() Config { return NewConfig(false, false, false) }, + configFunc: func(mockConfig model.Config) Config { return NewConfig(false, false, false, mockConfig) }, want: func() []admiv1beta1.MutatingWebhook { webhook := webhook("datadog.webhook.lib.injection", "/injectlib", &metav1.LabelSelector{ MatchLabels: map[string]string{ @@ -373,7 +377,7 @@ func TestGenerateTemplatesV1beta1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.auto_instrumentation.enabled", false) mockConfig.SetWithoutSource("admission_controller.cws_instrumentation.enabled", false) }, - configFunc: func() Config { return NewConfig(false, false, false) }, + configFunc: func(mockConfig model.Config) Config { return NewConfig(false, false, false, mockConfig) }, want: func() []admiv1beta1.MutatingWebhook { webhookConfig := webhook("datadog.webhook.agent.config", "/injectconfig", &metav1.LabelSelector{ MatchLabels: map[string]string{ @@ -397,7 +401,7 @@ func TestGenerateTemplatesV1beta1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.auto_instrumentation.enabled", false) mockConfig.SetWithoutSource("admission_controller.cws_instrumentation.enabled", false) }, - configFunc: func() Config { return NewConfig(false, false, false) }, + configFunc: func(mockConfig model.Config) Config { return NewConfig(false, false, false, mockConfig) }, want: func() []admiv1beta1.MutatingWebhook { webhookConfig := webhook("datadog.webhook.agent.config", "/injectconfig", &metav1.LabelSelector{ MatchExpressions: []metav1.LabelSelectorRequirement{ @@ -430,7 +434,7 @@ func TestGenerateTemplatesV1beta1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.auto_instrumentation.enabled", false) mockConfig.SetWithoutSource("admission_controller.cws_instrumentation.enabled", false) }, - configFunc: func() Config { return NewConfig(false, true, false) }, + configFunc: func(mockConfig model.Config) Config { return NewConfig(false, true, false, mockConfig) }, want: func() []admiv1beta1.MutatingWebhook { webhookConfig := webhook("datadog.webhook.agent.config", "/injectconfig", nil, &metav1.LabelSelector{ MatchLabels: map[string]string{ @@ -456,7 +460,7 @@ func TestGenerateTemplatesV1beta1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.auto_instrumentation.enabled", false) mockConfig.SetWithoutSource("admission_controller.cws_instrumentation.enabled", false) }, - configFunc: func() Config { return NewConfig(false, false, false) }, + configFunc: func(mockConfig model.Config) Config { return NewConfig(false, false, false, mockConfig) }, want: func() []admiv1beta1.MutatingWebhook { webhook := webhook( "datadog.webhook.agent.config", @@ -505,7 +509,7 @@ func TestGenerateTemplatesV1beta1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.auto_instrumentation.enabled", false) mockConfig.SetWithoutSource("admission_controller.cws_instrumentation.enabled", false) }, - configFunc: func() Config { return NewConfig(false, true, false) }, + configFunc: func(mockConfig model.Config) Config { return NewConfig(false, true, false, mockConfig) }, want: func() []admiv1beta1.MutatingWebhook { webhook := webhook( "datadog.webhook.agent.config", @@ -552,7 +556,7 @@ func TestGenerateTemplatesV1beta1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.cws_instrumentation.mutate_unlabelled", true) mockConfig.SetWithoutSource("cluster_agent.service_account_name", "datadog-cluster-agent") }, - configFunc: func() Config { return NewConfig(false, false, false) }, + configFunc: func(mockConfig model.Config) Config { return NewConfig(false, false, false, mockConfig) }, want: func() []admiv1beta1.MutatingWebhook { podWebhook := webhook( "datadog.webhook.cws.pod.instrumentation", @@ -595,7 +599,7 @@ func TestGenerateTemplatesV1beta1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.cws_instrumentation.mutate_unlabelled", false) mockConfig.SetWithoutSource("cluster_agent.service_account_name", "datadog-cluster-agent") }, - configFunc: func() Config { return NewConfig(false, false, false) }, + configFunc: func(mockConfig model.Config) Config { return NewConfig(false, false, false, mockConfig) }, want: func() []admiv1beta1.MutatingWebhook { podWebhook := webhook( "datadog.webhook.cws.pod.instrumentation", @@ -634,7 +638,7 @@ func TestGenerateTemplatesV1beta1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.cws_instrumentation.mutate_unlabelled", true) mockConfig.SetWithoutSource("cluster_agent.service_account_name", "datadog-cluster-agent") }, - configFunc: func() Config { return NewConfig(false, true, false) }, + configFunc: func(mockConfig model.Config) Config { return NewConfig(false, true, false, mockConfig) }, want: func() []admiv1beta1.MutatingWebhook { podWebhook := webhook( "datadog.webhook.cws.pod.instrumentation", @@ -677,7 +681,7 @@ func TestGenerateTemplatesV1beta1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.cws_instrumentation.mutate_unlabelled", false) mockConfig.SetWithoutSource("cluster_agent.service_account_name", "datadog-cluster-agent") }, - configFunc: func() Config { return NewConfig(false, true, false) }, + configFunc: func(mockConfig model.Config) Config { return NewConfig(false, true, false, mockConfig) }, want: func() []admiv1beta1.MutatingWebhook { podWebhook := webhook( "datadog.webhook.cws.pod.instrumentation", @@ -719,7 +723,7 @@ func TestGenerateTemplatesV1beta1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.agent_sidecar.selectors", "[]") mockConfig.SetWithoutSource("admission_controller.agent_sidecar.profiles", "misconfigured") }, - configFunc: func() Config { return NewConfig(true, true, false) }, + configFunc: func(mockConfig model.Config) Config { return NewConfig(true, true, false, mockConfig) }, want: func() []admiv1beta1.MutatingWebhook { return []admiv1beta1.MutatingWebhook{} }, @@ -739,7 +743,7 @@ func TestGenerateTemplatesV1beta1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.agent_sidecar.selectors", "[]") mockConfig.SetWithoutSource("admission_controller.agent_sidecar.profiles", "[]") }, - configFunc: func() Config { return NewConfig(true, true, false) }, + configFunc: func(mockConfig model.Config) Config { return NewConfig(true, true, false, mockConfig) }, want: func() []admiv1beta1.MutatingWebhook { podWebhook := webhook( "datadog.webhook.agent.sidecar", @@ -772,7 +776,7 @@ func TestGenerateTemplatesV1beta1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.agent_sidecar.selectors", "[]") mockConfig.SetWithoutSource("admission_controller.agent_sidecar.profiles", "[]") }, - configFunc: func() Config { return NewConfig(true, true, false) }, + configFunc: func(mockConfig model.Config) Config { return NewConfig(true, true, false, mockConfig) }, want: func() []admiv1beta1.MutatingWebhook { return []admiv1beta1.MutatingWebhook{} }, @@ -792,7 +796,7 @@ func TestGenerateTemplatesV1beta1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.agent_sidecar.selectors", "[]") mockConfig.SetWithoutSource("admission_controller.agent_sidecar.profiles", "[]") }, - configFunc: func() Config { return NewConfig(true, true, false) }, + configFunc: func(mockConfig model.Config) Config { return NewConfig(true, true, false, mockConfig) }, want: func() []admiv1beta1.MutatingWebhook { return []admiv1beta1.MutatingWebhook{} }, @@ -812,7 +816,7 @@ func TestGenerateTemplatesV1beta1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.agent_sidecar.selectors", "[{\"NamespaceSelector\": {\"MatchLabels\": {\"labelKey\": \"labelVal\"}}}]") mockConfig.SetWithoutSource("admission_controller.agent_sidecar.profiles", "[]") }, - configFunc: func() Config { return NewConfig(true, true, false) }, + configFunc: func(mockConfig model.Config) Config { return NewConfig(true, true, false, mockConfig) }, want: func() []admiv1beta1.MutatingWebhook { podWebhook := webhook( "datadog.webhook.agent.sidecar", @@ -843,7 +847,7 @@ func TestGenerateTemplatesV1beta1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.agent_sidecar.selectors", "[{\"ObjectSelector\": {\"MatchLabels\": {\"labelKey\": \"labelVal\"}}}]") mockConfig.SetWithoutSource("admission_controller.agent_sidecar.profiles", "[]") }, - configFunc: func() Config { return NewConfig(true, true, false) }, + configFunc: func(mockConfig model.Config) Config { return NewConfig(true, true, false, mockConfig) }, want: func() []admiv1beta1.MutatingWebhook { return []admiv1beta1.MutatingWebhook{} }, @@ -863,7 +867,7 @@ func TestGenerateTemplatesV1beta1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.agent_sidecar.selectors", "[{\"ObjectSelector\": {\"MatchLabels\": {\"labelKey\": \"labelVal\"}}}]") mockConfig.SetWithoutSource("admission_controller.agent_sidecar.profiles", "[]") }, - configFunc: func() Config { return NewConfig(true, true, false) }, + configFunc: func(mockConfig model.Config) Config { return NewConfig(true, true, false, mockConfig) }, want: func() []admiv1beta1.MutatingWebhook { podWebhook := webhook( "datadog.webhook.agent.sidecar", @@ -892,7 +896,7 @@ func TestGenerateTemplatesV1beta1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.agent_sidecar.selectors", "[{\"ObjectSelector\": {\"MatchLabels\": {\"labelKey1\": \"labelVal1\"}}, \"NamespaceSelector\": {\"MatchLabels\": {\"labelKey2\": \"labelVal2\"}}}]") mockConfig.SetWithoutSource("admission_controller.agent_sidecar.profiles", "[]") }, - configFunc: func() Config { return NewConfig(true, true, false) }, + configFunc: func(mockConfig model.Config) Config { return NewConfig(true, true, false, mockConfig) }, want: func() []admiv1beta1.MutatingWebhook { podWebhook := webhook( "datadog.webhook.agent.sidecar", @@ -921,7 +925,7 @@ func TestGenerateTemplatesV1beta1(t *testing.T) { mockConfig.SetWithoutSource("admission_controller.agent_sidecar.selectors", "[{\"NamespaceSelector\": {\"MatchLabels\":{\"labelKey1\": \"labelVal1\"}}} , {\"ObjectSelector\": {\"MatchLabels\": {\"labelKey2\": \"labelVal2\"}}}]") mockConfig.SetWithoutSource("admission_controller.agent_sidecar.profiles", "[]") }, - configFunc: func() Config { return NewConfig(true, true, false) }, + configFunc: func(mockConfig model.Config) Config { return NewConfig(true, true, false, mockConfig) }, want: func() []admiv1beta1.MutatingWebhook { return []admiv1beta1.MutatingWebhook{} }, @@ -940,7 +944,7 @@ func TestGenerateTemplatesV1beta1(t *testing.T) { tt.setupConfig(mockConfig) c := &ControllerV1beta1{} - c.config = tt.configFunc() + c.config = tt.configFunc(mockConfig) c.webhooks = c.generateWebhooks(wmeta, nil, mockConfig, nil) c.generateTemplates() @@ -1044,7 +1048,7 @@ func TestGetValidatingWebhookSkeletonV1beta1(t *testing.T) { } c := &ControllerV1beta1{} - c.config = NewConfig(false, tt.namespaceSelector, false) + c.config = NewConfig(false, tt.namespaceSelector, false, mockConfig) nsSelector, objSelector := common.DefaultLabelSelectors(tt.namespaceSelector) @@ -1150,7 +1154,7 @@ func TestGetMutatingWebhookSkeletonV1beta1(t *testing.T) { } c := &ControllerV1beta1{} - c.config = NewConfig(false, tt.namespaceSelector, false) + c.config = NewConfig(false, tt.namespaceSelector, false, mockConfig) nsSelector, objSelector := common.DefaultLabelSelectors(tt.namespaceSelector) @@ -1180,8 +1184,8 @@ func (f *fixtureV1beta1) createController() (*ControllerV1beta1, informers.Share factory.Admissionregistration().V1beta1().ValidatingWebhookConfigurations(), factory.Admissionregistration().V1beta1().MutatingWebhookConfigurations(), func() bool { return true }, - make(chan struct{}), - v1beta1Cfg, + make(<-chan struct{}), + getV1beta1Cfg(f.t), wmeta, nil, datadogConfig, diff --git a/pkg/clusteragent/admission/mutate/agent_sidecar/agent_sidecar.go b/pkg/clusteragent/admission/mutate/agent_sidecar/agent_sidecar.go index 06c936d6d0684..302fa2f36b0e0 100644 --- a/pkg/clusteragent/admission/mutate/agent_sidecar/agent_sidecar.go +++ b/pkg/clusteragent/admission/mutate/agent_sidecar/agent_sidecar.go @@ -34,6 +34,7 @@ import ( apiCommon "github.com/DataDog/datadog-agent/pkg/util/kubernetes/apiserver/common" "github.com/DataDog/datadog-agent/pkg/util/kubernetes/clustername" "github.com/DataDog/datadog-agent/pkg/util/log" + "github.com/DataDog/datadog-agent/pkg/util/pointer" ) const webhookName = "agent_sidecar" @@ -59,7 +60,7 @@ type Webhook struct { // These fields store datadog agent config parameters // to avoid calling the config resolution each time the webhook // receives requests because the resolution is CPU expensive. - profilesJSON string + profileOverrides []ProfileOverride provider string imageName string imageTag string @@ -72,7 +73,12 @@ type Webhook struct { // NewWebhook returns a new Webhook func NewWebhook(datadogConfig config.Component) *Webhook { - nsSelector, objSelector := labelSelectors(datadogConfig) + profileOverrides, err := loadSidecarProfiles(datadogConfig.GetString("admission_controller.agent_sidecar.profiles")) + if err != nil { + log.Errorf("encountered issue when loading sidecar profiles: %s", err) + } + + nsSelector, objSelector := labelSelectors(datadogConfig, profileOverrides) containerRegistry := mutatecommon.ContainerRegistry(datadogConfig, "admission_controller.agent_sidecar.container_registry") @@ -86,8 +92,8 @@ func NewWebhook(datadogConfig config.Component) *Webhook { namespaceSelector: nsSelector, objectSelector: objSelector, containerRegistry: containerRegistry, + profileOverrides: profileOverrides, - profilesJSON: datadogConfig.GetString("admission_controller.agent_sidecar.profiles"), provider: datadogConfig.GetString("admission_controller.agent_sidecar.provider"), imageName: datadogConfig.GetString("admission_controller.agent_sidecar.image_name"), imageTag: datadogConfig.GetString("admission_controller.agent_sidecar.image_tag"), @@ -150,6 +156,18 @@ func (w *Webhook) WebhookFunc() admission.WebhookFunc { } } +// isReadOnlyRootFilesystem returns whether the agent sidecar should have the readOnlyRootFilesystem security setup +func (w *Webhook) isReadOnlyRootFilesystem() bool { + if len(w.profileOverrides) == 0 { + return false + } + securityContext := w.profileOverrides[0].SecurityContext + if securityContext != nil && securityContext.ReadOnlyRootFilesystem != nil { + return *securityContext.ReadOnlyRootFilesystem + } + return false // default to false (temp) +} + func (w *Webhook) injectAgentSidecar(pod *corev1.Pod, _ string, _ dynamic.Interface) (bool, error) { if pod == nil { return false, errors.New(metrics.InvalidInput) @@ -163,6 +181,16 @@ func (w *Webhook) injectAgentSidecar(pod *corev1.Pod, _ string, _ dynamic.Interf if !agentSidecarExists { agentSidecarContainer := w.getDefaultSidecarTemplate() + if w.isReadOnlyRootFilesystem() { + volumes := w.getSecurityVolumeTemplates() + pod.Spec.Volumes = append(pod.Spec.Volumes, *volumes...) + w.addSecurityConfigToAgent(agentSidecarContainer) + // Don't want to apply any overrides to the agent sidecar init container + defer func() { + initContainer := w.getSecurityInitTemplate() + pod.Spec.InitContainers = append(pod.Spec.InitContainers, *initContainer) + }() + } pod.Spec.Containers = append(pod.Spec.Containers, *agentSidecarContainer) podUpdated = true } @@ -190,7 +218,7 @@ func (w *Webhook) injectAgentSidecar(pod *corev1.Pod, _ string, _ dynamic.Interf } podUpdated = podUpdated || updated - updated, err = applyProfileOverrides(&pod.Spec.Containers[i], w.profilesJSON) + updated, err = applyProfileOverrides(&pod.Spec.Containers[i], w.profileOverrides) if err != nil { log.Errorf("Failed to apply profile overrides: %v", err) return podUpdated, errors.New(metrics.InvalidInput) @@ -204,6 +232,77 @@ func (w *Webhook) injectAgentSidecar(pod *corev1.Pod, _ string, _ dynamic.Interf return podUpdated, nil } +func (w *Webhook) getSecurityInitTemplate() *corev1.Container { + return &corev1.Container{ + Image: fmt.Sprintf("%s/%s:%s", w.containerRegistry, w.imageName, w.imageTag), + ImagePullPolicy: corev1.PullIfNotPresent, + Name: "init-copy-agent-config", + Command: []string{"sh", "-c", "cp -R /etc/datadog-agent/* /agent-config/"}, + VolumeMounts: []corev1.VolumeMount{ + { + Name: agentConfigVolumeName, + MountPath: "/agent-config", + }, + }, + } +} + +func (w *Webhook) getSecurityVolumeTemplates() *[]corev1.Volume { + return &[]corev1.Volume{ + { + Name: agentConfigVolumeName, + VolumeSource: corev1.VolumeSource{ + EmptyDir: &corev1.EmptyDirVolumeSource{}, + }, + }, + { + Name: agentOptionsVolumeName, + VolumeSource: corev1.VolumeSource{ + EmptyDir: &corev1.EmptyDirVolumeSource{}, + }, + }, + { + Name: agentTmpVolumeName, + VolumeSource: corev1.VolumeSource{ + EmptyDir: &corev1.EmptyDirVolumeSource{}, + }, + }, + { + Name: agentLogsVolumeName, + VolumeSource: corev1.VolumeSource{ + EmptyDir: &corev1.EmptyDirVolumeSource{}, + }, + }, + } +} + +func (w *Webhook) addSecurityConfigToAgent(agentContainer *corev1.Container) { + volumeMounts := []corev1.VolumeMount{ + { + Name: agentConfigVolumeName, + MountPath: "/etc/datadog-agent", + }, + { + Name: agentOptionsVolumeName, + MountPath: "/opt/datadog-agent/run", + }, + { + Name: agentTmpVolumeName, + MountPath: "/tmp", + }, + { + Name: agentLogsVolumeName, + MountPath: "/var/log/datadog", + }, + } + agentContainer.VolumeMounts = append(agentContainer.VolumeMounts, volumeMounts...) + + if agentContainer.SecurityContext == nil { + agentContainer.SecurityContext = &corev1.SecurityContext{} + } + agentContainer.SecurityContext.ReadOnlyRootFilesystem = pointer.Ptr(true) +} + func (w *Webhook) getDefaultSidecarTemplate() *corev1.Container { ddSite := os.Getenv("DD_SITE") if ddSite == "" { @@ -288,21 +387,19 @@ func (w *Webhook) getDefaultSidecarTemplate() *corev1.Container { } // labelSelectors returns the mutating webhooks object selectors based on the configuration -func labelSelectors(datadogConfig config.Component) (namespaceSelector, objectSelector *metav1.LabelSelector) { +func labelSelectors(datadogConfig config.Component, profileOverrides []ProfileOverride) (namespaceSelector, objectSelector *metav1.LabelSelector) { // Read and parse selectors selectorsJSON := datadogConfig.GetString("admission_controller.agent_sidecar.selectors") - profilesJSON := datadogConfig.GetString("admission_controller.agent_sidecar.profiles") // Get sidecar profiles - _, err := loadSidecarProfiles(profilesJSON) - if err != nil { - log.Errorf("encountered issue when loading sidecar profiles: %s", err) + if profileOverrides == nil { + log.Error("sidecar profiles are not loaded") return nil, nil } var selectors []Selector - err = json.Unmarshal([]byte(selectorsJSON), &selectors) + err := json.Unmarshal([]byte(selectorsJSON), &selectors) if err != nil { log.Errorf("failed to parse selectors for admission controller agent sidecar injection webhook: %s", err) return nil, nil diff --git a/pkg/clusteragent/admission/mutate/agent_sidecar/agent_sidecar_test.go b/pkg/clusteragent/admission/mutate/agent_sidecar/agent_sidecar_test.go index aac87fce23cba..9d6dd44be2d90 100644 --- a/pkg/clusteragent/admission/mutate/agent_sidecar/agent_sidecar_test.go +++ b/pkg/clusteragent/admission/mutate/agent_sidecar/agent_sidecar_test.go @@ -59,19 +59,67 @@ func TestInjectAgentSidecar(t *testing.T) { }, }, }, - provider: "", - profilesJSON: "[]", + provider: "", + profilesJSON: `[{ + "securityContext": { + "readOnlyRootFilesystem": true + } + }]`, ExpectError: false, ExpectInjection: true, ExpectedPodAfterInjection: func() *corev1.Pod { + webhook := NewWebhook(mockConfig) + sidecar := webhook.getDefaultSidecarTemplate() + webhook.addSecurityConfigToAgent(sidecar) return &corev1.Pod{ ObjectMeta: metav1.ObjectMeta{ Name: "pod-name", }, Spec: corev1.PodSpec{ + InitContainers: []corev1.Container{*webhook.getSecurityInitTemplate()}, Containers: []corev1.Container{ {Name: "container-name"}, - *NewWebhook(mockConfig).getDefaultSidecarTemplate(), + *sidecar, + }, + Volumes: *webhook.getSecurityVolumeTemplates(), + }, + } + }, + }, + { + Name: "should inject sidecar, no security features if default overridden to false", + Pod: &corev1.Pod{ + ObjectMeta: metav1.ObjectMeta{ + Name: "pod-name", + }, + Spec: corev1.PodSpec{ + Containers: []corev1.Container{ + {Name: "container-name"}, + }, + }, + }, + provider: "", + profilesJSON: `[{ + "securityContext": { + "readOnlyRootFilesystem": false + } + }]`, + ExpectError: false, + ExpectInjection: true, + ExpectedPodAfterInjection: func() *corev1.Pod { + sidecar := *NewWebhook(mockConfig).getDefaultSidecarTemplate() + // Records the false readOnlyRootFilesystem but doesn't add the initContainers, volumes and mounts + sidecar.SecurityContext = &corev1.SecurityContext{ + ReadOnlyRootFilesystem: pointer.Ptr(false), + } + return &corev1.Pod{ + ObjectMeta: metav1.ObjectMeta{ + Name: "pod-name", + }, + Spec: corev1.PodSpec{ + Containers: []corev1.Container{ + {Name: "container-name"}, + sidecar, }, }, } @@ -157,8 +205,12 @@ func TestInjectAgentSidecar(t *testing.T) { }, }, }, - provider: "", - profilesJSON: "[]", + provider: "", + profilesJSON: `[{ + "securityContext": { + "readOnlyRootFilesystem": false + } + }]`, ExpectError: false, ExpectInjection: true, ExpectedPodAfterInjection: func() *corev1.Pod { @@ -168,6 +220,9 @@ func TestInjectAgentSidecar(t *testing.T) { Name: "DD_AUTO_EXIT_NOPROCESS_ENABLED", Value: "true", }) + defaultContainer.SecurityContext = &corev1.SecurityContext{ + ReadOnlyRootFilesystem: pointer.Ptr(false), + } return &corev1.Pod{ ObjectMeta: metav1.ObjectMeta{ Name: "pod-name", @@ -199,14 +254,20 @@ func TestInjectAgentSidecar(t *testing.T) { }, }, }, - provider: "fargate", - profilesJSON: "[]", + provider: "fargate", + profilesJSON: `[{ + "securityContext": { + "readOnlyRootFilesystem": true + } + }]`, ExpectError: false, ExpectInjection: true, ExpectedPodAfterInjection: func() *corev1.Pod { - sidecar := *NewWebhook(mockConfig).getDefaultSidecarTemplate() + webhook := NewWebhook(mockConfig) + sidecar := webhook.getDefaultSidecarTemplate() + webhook.addSecurityConfigToAgent(sidecar) _, _ = withEnvOverrides( - &sidecar, + sidecar, corev1.EnvVar{ Name: "DD_EKS_FARGATE", Value: "true", @@ -221,13 +282,13 @@ func TestInjectAgentSidecar(t *testing.T) { }, ) - sidecar.VolumeMounts = []corev1.VolumeMount{ + sidecar.VolumeMounts = append(sidecar.VolumeMounts, []corev1.VolumeMount{ { Name: "ddsockets", MountPath: "/var/run/datadog", ReadOnly: false, }, - } + }...) return &corev1.Pod{ ObjectMeta: metav1.ObjectMeta{ @@ -238,6 +299,7 @@ func TestInjectAgentSidecar(t *testing.T) { }, Spec: corev1.PodSpec{ ShareProcessNamespace: pointer.Ptr(true), + InitContainers: []corev1.Container{*webhook.getSecurityInitTemplate()}, Containers: []corev1.Container{ { Name: "container-name", @@ -259,16 +321,16 @@ func TestInjectAgentSidecar(t *testing.T) { }, }, }, - sidecar, + *sidecar, }, - Volumes: []corev1.Volume{ - { + Volumes: append(*webhook.getSecurityVolumeTemplates(), + corev1.Volume{ Name: "ddsockets", VolumeSource: corev1.VolumeSource{ EmptyDir: &corev1.EmptyDirVolumeSource{}, }, }, - }, + ), }, } }, @@ -287,28 +349,33 @@ func TestInjectAgentSidecar(t *testing.T) { }, provider: "fargate", profilesJSON: `[{ - "env": [ - {"name": "ENV_VAR_1", "valueFrom": {"secretKeyRef": {"name": "my-secret", "key": "secret-key"}}}, - {"name": "ENV_VAR_2", "value": "value2"} - ], - "resources": { - "limits": { - "cpu": "1", - "memory": "512Mi" - }, - "requests": { - "cpu": "0.5", - "memory": "256Mi" - } - } - }]`, + "env": [ + {"name": "ENV_VAR_1", "valueFrom": {"secretKeyRef": {"name": "my-secret", "key": "secret-key"}}}, + {"name": "ENV_VAR_2", "value": "value2"} + ], + "resources": { + "limits": { + "cpu": "1", + "memory": "512Mi" + }, + "requests": { + "cpu": "0.5", + "memory": "256Mi" + } + }, + "securityContext": { + "readOnlyRootFilesystem": true + } + }]`, ExpectError: false, ExpectInjection: true, ExpectedPodAfterInjection: func() *corev1.Pod { - sidecar := *NewWebhook(mockConfig).getDefaultSidecarTemplate() + webhook := NewWebhook(mockConfig) + sidecar := webhook.getDefaultSidecarTemplate() + webhook.addSecurityConfigToAgent(sidecar) _, _ = withEnvOverrides( - &sidecar, + sidecar, corev1.EnvVar{ Name: "DD_EKS_FARGATE", Value: "true", @@ -336,18 +403,18 @@ func TestInjectAgentSidecar(t *testing.T) { }, ) - _ = withResourceLimits(&sidecar, corev1.ResourceRequirements{ + _ = withResourceLimits(sidecar, corev1.ResourceRequirements{ Limits: corev1.ResourceList{"cpu": resource.MustParse("1"), "memory": resource.MustParse("512Mi")}, Requests: corev1.ResourceList{"cpu": resource.MustParse("0.5"), "memory": resource.MustParse("256Mi")}, }) - sidecar.VolumeMounts = []corev1.VolumeMount{ + sidecar.VolumeMounts = append(sidecar.VolumeMounts, []corev1.VolumeMount{ { Name: "ddsockets", MountPath: "/var/run/datadog", ReadOnly: false, }, - } + }...) return &corev1.Pod{ ObjectMeta: metav1.ObjectMeta{ @@ -358,6 +425,7 @@ func TestInjectAgentSidecar(t *testing.T) { }, Spec: corev1.PodSpec{ ShareProcessNamespace: pointer.Ptr(true), + InitContainers: []corev1.Container{*webhook.getSecurityInitTemplate()}, Containers: []corev1.Container{ { Name: "container-name", @@ -379,16 +447,16 @@ func TestInjectAgentSidecar(t *testing.T) { }, }, }, - sidecar, + *sidecar, }, - Volumes: []corev1.Volume{ - { + Volumes: append(*webhook.getSecurityVolumeTemplates(), + corev1.Volume{ Name: "ddsockets", VolumeSource: corev1.VolumeSource{ EmptyDir: &corev1.EmptyDirVolumeSource{}, }, }, - }, + ), }, } }, @@ -644,3 +712,80 @@ func TestDefaultSidecarTemplateClusterAgentEnvVars(t *testing.T) { }) } } + +func TestIsReadOnlyRootFilesystem(t *testing.T) { + tests := []struct { + name string + profile string + expected bool + }{ + { + name: "no profile", + profile: "", + expected: false, + }, + { + name: "empty or default profile", + profile: "[]", + expected: false, + }, + { + name: "profile without security context", + profile: `[{ + "env": [ + {"name": "ENV_VAR_2", "value": "value2"} + ], + }]`, + expected: false, + }, + { + name: "profile with security context, readOnlyRootFilesystem empty", + profile: `[{ + "securityContext": {} + }]`, + expected: false, + }, + { + name: "profile with security context, readOnlyRootFilesystem true", + profile: `[{ + "securityContext": { + "readOnlyRootFilesystem": true + } + }]`, + expected: true, + }, + { + name: "profile with security context, readOnlyRootFilesystem false", + profile: `[{ + "securityContext": { + "readOnlyRootFilesystem": false + } + }]`, + expected: false, + }, + } + + for _, test := range tests { + t.Run(test.name, func(tt *testing.T) { + mockConfig := configmock.New(t) + mockConfig.SetWithoutSource("admission_controller.agent_sidecar.profiles", test.profile) + webhook := NewWebhook(mockConfig) + sidecar := webhook.getDefaultSidecarTemplate() + + // Webhook properly parses profile config + assert.Equal(tt, test.expected, webhook.isReadOnlyRootFilesystem()) + + if test.expected { + // Webhook properly applies the security context to the sidecar + webhook.addSecurityConfigToAgent(sidecar) + assert.NotNil(t, sidecar.SecurityContext) + assert.NotNil(t, sidecar.SecurityContext.ReadOnlyRootFilesystem) + assert.Equal(t, test.expected, *sidecar.SecurityContext.ReadOnlyRootFilesystem) + } else { + assert.Nil(t, sidecar.SecurityContext) + profile, _ := loadSidecarProfiles(test.profile) + applyProfileOverrides(sidecar, profile) + } + }) + } +} diff --git a/pkg/clusteragent/admission/mutate/agent_sidecar/constants.go b/pkg/clusteragent/admission/mutate/agent_sidecar/constants.go index fd73e16272e54..dfd44618d3206 100644 --- a/pkg/clusteragent/admission/mutate/agent_sidecar/constants.go +++ b/pkg/clusteragent/admission/mutate/agent_sidecar/constants.go @@ -11,3 +11,10 @@ const ( agentSidecarContainerName = "datadog-agent-injected" providerFargate = "fargate" ) + +const ( + agentConfigVolumeName = "agent-config" + agentOptionsVolumeName = "agent-option" + agentTmpVolumeName = "agent-tmp" + agentLogsVolumeName = "agent-log" +) diff --git a/pkg/clusteragent/admission/mutate/agent_sidecar/overrides.go b/pkg/clusteragent/admission/mutate/agent_sidecar/overrides.go index 2a42c1d8947f1..9389d381a6c01 100644 --- a/pkg/clusteragent/admission/mutate/agent_sidecar/overrides.go +++ b/pkg/clusteragent/admission/mutate/agent_sidecar/overrides.go @@ -54,3 +54,19 @@ func withResourceLimits(container *corev1.Container, resourceLimits corev1.Resou container.Resources = resourceLimits return nil } + +// withSecurityContextOverrides applies the security context overrides to the container +func withSecurityContextOverrides(container *corev1.Container, securityContext *corev1.SecurityContext) (bool, error) { + if container == nil { + return false, fmt.Errorf("can't apply security context overrides to nil container") + } + + mutated := false + + if securityContext != nil { + container.SecurityContext = securityContext + mutated = true + } + + return mutated, nil +} diff --git a/pkg/clusteragent/admission/mutate/agent_sidecar/overrides_test.go b/pkg/clusteragent/admission/mutate/agent_sidecar/overrides_test.go index bde80aea94ab2..13ab63c9fd77e 100644 --- a/pkg/clusteragent/admission/mutate/agent_sidecar/overrides_test.go +++ b/pkg/clusteragent/admission/mutate/agent_sidecar/overrides_test.go @@ -13,6 +13,8 @@ import ( "github.com/stretchr/testify/assert" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" + + "github.com/DataDog/datadog-agent/pkg/util/pointer" ) func TestWithEnvOverrides(t *testing.T) { @@ -144,3 +146,92 @@ func TestWithResourceLimits(t *testing.T) { }) } } + +func TestWithSecurityContextOverrides(t *testing.T) { + tests := []struct { + name string + baseContainer *corev1.Container + securityOverride *corev1.SecurityContext + expectError bool + expectMutated bool + containerAfterOverride *corev1.Container + }{ + { + name: "nil container", + baseContainer: nil, + securityOverride: &corev1.SecurityContext{}, + expectError: true, + expectMutated: false, + containerAfterOverride: nil, + }, + { + name: "no overrides", + baseContainer: &corev1.Container{ + SecurityContext: &corev1.SecurityContext{ + RunAsUser: pointer.Ptr(int64(1000)), + ReadOnlyRootFilesystem: pointer.Ptr(true), + }, + }, + securityOverride: nil, + expectError: false, + expectMutated: false, + containerAfterOverride: &corev1.Container{ + SecurityContext: &corev1.SecurityContext{ + RunAsUser: pointer.Ptr(int64(1000)), + ReadOnlyRootFilesystem: pointer.Ptr(true), + }, + }, + }, + { + name: "apply overrides", + baseContainer: &corev1.Container{ + SecurityContext: &corev1.SecurityContext{ + ReadOnlyRootFilesystem: pointer.Ptr(true), + }, + }, + securityOverride: &corev1.SecurityContext{ + RunAsUser: pointer.Ptr(int64(1000)), + ReadOnlyRootFilesystem: pointer.Ptr(false), + }, + expectError: false, + expectMutated: true, + containerAfterOverride: &corev1.Container{ + SecurityContext: &corev1.SecurityContext{ + RunAsUser: pointer.Ptr(int64(1000)), + ReadOnlyRootFilesystem: pointer.Ptr(false), + }, + }, + }, + { + name: "apply blank overrides", + baseContainer: &corev1.Container{ + SecurityContext: &corev1.SecurityContext{ + RunAsUser: pointer.Ptr(int64(1000)), + ReadOnlyRootFilesystem: pointer.Ptr(true), + }, + }, + securityOverride: &corev1.SecurityContext{}, + expectError: false, + expectMutated: true, + containerAfterOverride: &corev1.Container{ + SecurityContext: &corev1.SecurityContext{}, + }, + }, + } + + for _, test := range tests { + t.Run(test.name, func(tt *testing.T) { + mutated, err := withSecurityContextOverrides(test.baseContainer, test.securityOverride) + + assert.Equal(tt, test.expectMutated, mutated) + assert.Equal(tt, test.containerAfterOverride, test.baseContainer) + + if test.expectError { + assert.Error(tt, err) + } else { + assert.NoError(tt, err) + } + + }) + } +} diff --git a/pkg/clusteragent/admission/mutate/agent_sidecar/profiles.go b/pkg/clusteragent/admission/mutate/agent_sidecar/profiles.go index 101f54bd059eb..79430f8d8cbca 100644 --- a/pkg/clusteragent/admission/mutate/agent_sidecar/profiles.go +++ b/pkg/clusteragent/admission/mutate/agent_sidecar/profiles.go @@ -25,6 +25,7 @@ import ( type ProfileOverride struct { EnvVars []corev1.EnvVar `json:"env,omitempty"` ResourceRequirements corev1.ResourceRequirements `json:"resources,omitempty"` + SecurityContext *corev1.SecurityContext `json:"securityContext,omitempty"` } // loadSidecarProfiles returns the profile overrides provided by the user @@ -48,16 +49,15 @@ func loadSidecarProfiles(profilesJSON string) ([]ProfileOverride, error) { // applyProfileOverrides applies the profile overrides to the container. It // returns a boolean that indicates if the container was mutated -func applyProfileOverrides(container *corev1.Container, profilesJSON string) (bool, error) { +func applyProfileOverrides(container *corev1.Container, profiles []ProfileOverride) (bool, error) { if container == nil { return false, fmt.Errorf("can't apply profile overrides to nil containers") } - profiles, err := loadSidecarProfiles(profilesJSON) - - if err != nil { - return false, err + if profiles == nil { + return false, fmt.Errorf("can't apply nil profiles") } + if len(profiles) == 0 { return false, nil } @@ -82,5 +82,12 @@ func applyProfileOverrides(container *corev1.Container, profilesJSON string) (bo mutated = true } + // Apply security context overrides + overridden, err = withSecurityContextOverrides(container, overrides.SecurityContext) + if err != nil { + return false, err + } + mutated = mutated || overridden + return mutated, nil } diff --git a/pkg/clusteragent/admission/mutate/agent_sidecar/profiles_test.go b/pkg/clusteragent/admission/mutate/agent_sidecar/profiles_test.go index 772e8b784a78d..4b8c007d47fe5 100644 --- a/pkg/clusteragent/admission/mutate/agent_sidecar/profiles_test.go +++ b/pkg/clusteragent/admission/mutate/agent_sidecar/profiles_test.go @@ -14,6 +14,8 @@ import ( "github.com/stretchr/testify/assert" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" + + "github.com/DataDog/datadog-agent/pkg/util/pointer" ) func TestLoadSidecarProfiles(t *testing.T) { @@ -29,6 +31,12 @@ func TestLoadSidecarProfiles(t *testing.T) { expectedProfiles: nil, expectError: true, }, + { + name: "default profile", + profilesJSON: "[]", + expectedProfiles: []ProfileOverride{}, + expectError: false, + }, { name: "single valid profile", profilesJSON: `[ @@ -46,6 +54,9 @@ func TestLoadSidecarProfiles(t *testing.T) { "cpu": "0.5", "memory": "256Mi" } + }, + "securityContext": { + "readOnlyRootFilesystem": true } } ]`, @@ -65,6 +76,7 @@ func TestLoadSidecarProfiles(t *testing.T) { "memory": resource.MustParse("256Mi"), }, }, + SecurityContext: &corev1.SecurityContext{ReadOnlyRootFilesystem: pointer.Ptr(true)}, }, }, expectError: false, @@ -166,6 +178,11 @@ func TestApplyProfileOverrides(t *testing.T) { "cpu": "0.5", "memory": "256Mi" } + }, + "securityContext": { + "readOnlyRootFilesystem": true, + "runAsNonRoot": false, + "runAsUser": 1000 } } ]`, @@ -185,6 +202,7 @@ func TestApplyProfileOverrides(t *testing.T) { "memory": resource.MustParse("256Mi"), }, }, + SecurityContext: &corev1.SecurityContext{ReadOnlyRootFilesystem: pointer.Ptr(true), RunAsNonRoot: pointer.Ptr(false), RunAsUser: pointer.Ptr(int64(1000))}, }, expectError: false, expectMutated: true, @@ -247,7 +265,10 @@ func TestApplyProfileOverrides(t *testing.T) { "cpu": "0.5", "memory": "256Mi" } - } + }, + "securityContext": { + "readOnlyRootFilesystem": true + } }]`, baseContainer: &corev1.Container{}, expectedContainer: &corev1.Container{ @@ -261,6 +282,7 @@ func TestApplyProfileOverrides(t *testing.T) { Limits: corev1.ResourceList{"cpu": resource.MustParse("1"), "memory": resource.MustParse("512Mi")}, Requests: corev1.ResourceList{"cpu": resource.MustParse("0.5"), "memory": resource.MustParse("256Mi")}, }, + SecurityContext: &corev1.SecurityContext{ReadOnlyRootFilesystem: pointer.Ptr(true)}, }, expectError: false, expectMutated: true, @@ -326,7 +348,10 @@ func TestApplyProfileOverrides(t *testing.T) { "cpu": "0.5", "memory": "256Mi" } - } + }, + "securityContext": { + "readOnlyRootFilesystem": true + } }, { "env": [ @@ -341,7 +366,10 @@ func TestApplyProfileOverrides(t *testing.T) { "cpu": "1", "memory": "512Mi" } - } + }, + "securityContext": { + "readOnlyRootFilesystem": false + } } ]`, baseContainer: &corev1.Container{}, @@ -353,7 +381,8 @@ func TestApplyProfileOverrides(t *testing.T) { for _, test := range tests { t.Run(test.name, func(tt *testing.T) { - mutated, err := applyProfileOverrides(test.baseContainer, test.profilesJSON) + profiles, _ := loadSidecarProfiles(test.profilesJSON) + mutated, err := applyProfileOverrides(test.baseContainer, profiles) assert.Equal(tt, test.expectMutated, mutated) diff --git a/pkg/clusteragent/admission/mutate/autoscaling/autoscaling.go b/pkg/clusteragent/admission/mutate/autoscaling/autoscaling.go index b4e7225ef710e..4ac5396506357 100644 --- a/pkg/clusteragent/admission/mutate/autoscaling/autoscaling.go +++ b/pkg/clusteragent/admission/mutate/autoscaling/autoscaling.go @@ -16,10 +16,10 @@ import ( "k8s.io/client-go/dynamic" "github.com/DataDog/datadog-agent/cmd/cluster-agent/admission" + "github.com/DataDog/datadog-agent/comp/core/config" "github.com/DataDog/datadog-agent/pkg/clusteragent/admission/common" mutatecommon "github.com/DataDog/datadog-agent/pkg/clusteragent/admission/mutate/common" "github.com/DataDog/datadog-agent/pkg/clusteragent/autoscaling/workload" - pkgconfigsetup "github.com/DataDog/datadog-agent/pkg/config/setup" ) const ( @@ -39,10 +39,10 @@ type Webhook struct { } // NewWebhook returns a new Webhook -func NewWebhook(patcher workload.PodPatcher) *Webhook { +func NewWebhook(patcher workload.PodPatcher, datadogConfig config.Component) *Webhook { return &Webhook{ name: webhookName, - isEnabled: pkgconfigsetup.Datadog().GetBool("autoscaling.workload.enabled"), + isEnabled: datadogConfig.GetBool("autoscaling.workload.enabled"), endpoint: webhookEndpoint, resources: map[string][]string{"": {"pods"}}, operations: []admissionregistrationv1.OperationType{admissionregistrationv1.Create}, diff --git a/pkg/clusteragent/admission/patch/file_provider.go b/pkg/clusteragent/admission/patch/file_provider.go index 71df716b951ba..7dce3050a7f39 100644 --- a/pkg/clusteragent/admission/patch/file_provider.go +++ b/pkg/clusteragent/admission/patch/file_provider.go @@ -18,7 +18,8 @@ import ( // filePatchProvider this is a stub and will be used for e2e testing only type filePatchProvider struct { file string - isLeaderNotif <-chan struct{} + leadershipStateNotif <-chan struct{} + isLeaderFunc func() bool pollInterval time.Duration subscribers map[TargetObjKind]chan Request lastSuccessfulRefresh time.Time @@ -27,13 +28,14 @@ type filePatchProvider struct { var _ patchProvider = &filePatchProvider{} -func newfileProvider(file string, isLeaderNotif <-chan struct{}, clusterName string) *filePatchProvider { +func newfileProvider(file string, isLeaderFunc func() bool, leadershipStateNotif <-chan struct{}, clusterName string) *filePatchProvider { return &filePatchProvider{ - file: file, - isLeaderNotif: isLeaderNotif, - pollInterval: 15 * time.Second, - subscribers: make(map[TargetObjKind]chan Request), - clusterName: clusterName, + file: file, + leadershipStateNotif: leadershipStateNotif, + pollInterval: 15 * time.Second, + subscribers: make(map[TargetObjKind]chan Request), + clusterName: clusterName, + isLeaderFunc: isLeaderFunc, } } @@ -49,9 +51,11 @@ func (fpp *filePatchProvider) start(stopCh <-chan struct{}) { defer ticker.Stop() for { select { - case <-fpp.isLeaderNotif: - log.Info("Got a leader notification, polling from file") - fpp.process(true) + case <-fpp.leadershipStateNotif: + if fpp.isLeaderFunc() { + log.Info("Got a leader notification, polling from file") + fpp.process(true) + } case <-ticker.C: fpp.process(false) case <-stopCh: diff --git a/pkg/clusteragent/admission/patch/file_provider_test.go b/pkg/clusteragent/admission/patch/file_provider_test.go index 5916cbce5dbc6..63068a8ac836f 100644 --- a/pkg/clusteragent/admission/patch/file_provider_test.go +++ b/pkg/clusteragent/admission/patch/file_provider_test.go @@ -14,7 +14,7 @@ import ( ) func TestFileProviderProcess(t *testing.T) { - fpp := newfileProvider("testdata/auto-instru.json", make(chan struct{}), "dev") + fpp := newfileProvider("testdata/auto-instru.json", func() bool { return true }, make(<-chan struct{}), "dev") notifs := fpp.subscribe(KindDeployment) fpp.process(false) require.Len(t, notifs, 1) diff --git a/pkg/clusteragent/admission/patch/provider.go b/pkg/clusteragent/admission/patch/provider.go index 2b1469533c38a..3f4ea77b5fa12 100644 --- a/pkg/clusteragent/admission/patch/provider.go +++ b/pkg/clusteragent/admission/patch/provider.go @@ -20,14 +20,14 @@ type patchProvider interface { subscribe(kind TargetObjKind) chan Request } -func newPatchProvider(rcClient *rcclient.Client, isLeaderNotif <-chan struct{}, telemetryCollector telemetry.TelemetryCollector, clusterName string) (patchProvider, error) { +func newPatchProvider(rcClient *rcclient.Client, isLeaderFunc func() bool, leadershipStateNotif <-chan struct{}, telemetryCollector telemetry.TelemetryCollector, clusterName string) (patchProvider, error) { if pkgconfigsetup.IsRemoteConfigEnabled(pkgconfigsetup.Datadog()) { - return newRemoteConfigProvider(rcClient, isLeaderNotif, telemetryCollector, clusterName) + return newRemoteConfigProvider(rcClient, isLeaderFunc, leadershipStateNotif, telemetryCollector, clusterName) } if pkgconfigsetup.Datadog().GetBool("admission_controller.auto_instrumentation.patcher.fallback_to_file_provider") { // Use the file config provider for e2e testing only (it replaces RC as a source of configs) file := pkgconfigsetup.Datadog().GetString("admission_controller.auto_instrumentation.patcher.file_provider_path") - return newfileProvider(file, isLeaderNotif, clusterName), nil + return newfileProvider(file, isLeaderFunc, leadershipStateNotif, clusterName), nil } return nil, errors.New("remote config is disabled") } diff --git a/pkg/clusteragent/admission/patch/rc_provider.go b/pkg/clusteragent/admission/patch/rc_provider.go index e64525b03a845..8cc1580937ec1 100644 --- a/pkg/clusteragent/admission/patch/rc_provider.go +++ b/pkg/clusteragent/admission/patch/rc_provider.go @@ -20,25 +20,27 @@ import ( // remoteConfigProvider consumes tracing configs from RC and delivers them to the patcher type remoteConfigProvider struct { - client *rcclient.Client - isLeaderNotif <-chan struct{} - subscribers map[TargetObjKind]chan Request - clusterName string - telemetryCollector telemetry.TelemetryCollector + client *rcclient.Client + leadershipStateNotif <-chan struct{} + isLeaderFunc func() bool + subscribers map[TargetObjKind]chan Request + clusterName string + telemetryCollector telemetry.TelemetryCollector } var _ patchProvider = &remoteConfigProvider{} -func newRemoteConfigProvider(client *rcclient.Client, isLeaderNotif <-chan struct{}, telemetryCollector telemetry.TelemetryCollector, clusterName string) (*remoteConfigProvider, error) { +func newRemoteConfigProvider(client *rcclient.Client, isLeaderFunc func() bool, leadershipStateNotif <-chan struct{}, telemetryCollector telemetry.TelemetryCollector, clusterName string) (*remoteConfigProvider, error) { if client == nil { return nil, errors.New("remote config client not initialized") } return &remoteConfigProvider{ - client: client, - isLeaderNotif: isLeaderNotif, - subscribers: make(map[TargetObjKind]chan Request), - clusterName: clusterName, - telemetryCollector: telemetryCollector, + client: client, + leadershipStateNotif: leadershipStateNotif, + subscribers: make(map[TargetObjKind]chan Request), + clusterName: clusterName, + telemetryCollector: telemetryCollector, + isLeaderFunc: isLeaderFunc, }, nil } @@ -48,9 +50,11 @@ func (rcp *remoteConfigProvider) start(stopCh <-chan struct{}) { rcp.client.Start() for { select { - case <-rcp.isLeaderNotif: - log.Info("Got a leader notification, polling from remote-config") - rcp.process(rcp.client.GetConfigs(state.ProductAPMTracing), rcp.client.UpdateApplyStatus) + case <-rcp.leadershipStateNotif: + if rcp.isLeaderFunc() { + log.Info("Got a leader notification, polling from remote-config") + rcp.process(rcp.client.GetConfigs(state.ProductAPMTracing), rcp.client.UpdateApplyStatus) + } case <-stopCh: log.Info("Shutting down remote-config patch provider") rcp.client.Close() diff --git a/pkg/clusteragent/admission/patch/rc_provider_test.go b/pkg/clusteragent/admission/patch/rc_provider_test.go index 7f709bcb81622..0d04e551c7d3e 100644 --- a/pkg/clusteragent/admission/patch/rc_provider_test.go +++ b/pkg/clusteragent/admission/patch/rc_provider_test.go @@ -12,9 +12,9 @@ import ( "testing" "github.com/DataDog/datadog-agent/pkg/clusteragent/telemetry" - rcclient "github.com/DataDog/datadog-agent/pkg/config/remote/client" "github.com/DataDog/datadog-agent/pkg/remoteconfig/state" + "github.com/stretchr/testify/require" ) @@ -40,7 +40,7 @@ func TestProcess(t *testing.T) { ` return []byte(fmt.Sprintf(base, cluster, kind)) } - rcp, err := newRemoteConfigProvider(&rcclient.Client{}, make(chan struct{}), telemetry.NewNoopCollector(), "dev") + rcp, err := newRemoteConfigProvider(&rcclient.Client{}, func() bool { return true }, make(<-chan struct{}), telemetry.NewNoopCollector(), "dev") require.NoError(t, err) notifs := rcp.subscribe(KindDeployment) in := map[string]state.RawConfig{ diff --git a/pkg/clusteragent/admission/patch/start.go b/pkg/clusteragent/admission/patch/start.go index 5d0cd02e27ac5..d05b1158f6158 100644 --- a/pkg/clusteragent/admission/patch/start.go +++ b/pkg/clusteragent/admission/patch/start.go @@ -17,13 +17,12 @@ import ( // ControllerContext holds necessary context for the patch controller type ControllerContext struct { - IsLeaderFunc func() bool - LeaderSubscribeFunc func() <-chan struct{} - K8sClient kubernetes.Interface - RcClient *rcclient.Client - ClusterName string - ClusterID string - StopCh chan struct{} + LeadershipStateSubscribeFunc func() (notifChan <-chan struct{}, isLeader func() bool) + K8sClient kubernetes.Interface + RcClient *rcclient.Client + ClusterName string + ClusterID string + StopCh chan struct{} } // StartControllers starts the patch controllers @@ -33,11 +32,12 @@ func StartControllers(ctx ControllerContext) error { if ctx.RcClient != nil { telemetryCollector = telemetry.NewCollector(ctx.RcClient.ID, ctx.ClusterID) } - provider, err := newPatchProvider(ctx.RcClient, ctx.LeaderSubscribeFunc(), telemetryCollector, ctx.ClusterName) + leadershipStateNotif, isLeaderFunc := ctx.LeadershipStateSubscribeFunc() + provider, err := newPatchProvider(ctx.RcClient, isLeaderFunc, leadershipStateNotif, telemetryCollector, ctx.ClusterName) if err != nil { return err } - patcher := newPatcher(ctx.K8sClient, ctx.IsLeaderFunc, telemetryCollector, provider) + patcher := newPatcher(ctx.K8sClient, isLeaderFunc, telemetryCollector, provider) go provider.start(ctx.StopCh) go patcher.start(ctx.StopCh) return nil diff --git a/pkg/clusteragent/admission/start.go b/pkg/clusteragent/admission/start.go index aee1183a3133d..9b26f699246d0 100644 --- a/pkg/clusteragent/admission/start.go +++ b/pkg/clusteragent/admission/start.go @@ -28,15 +28,14 @@ import ( // ControllerContext holds necessary context for the admission controllers type ControllerContext struct { - IsLeaderFunc func() bool - LeaderSubscribeFunc func() <-chan struct{} - SecretInformers informers.SharedInformerFactory - ValidatingInformers informers.SharedInformerFactory - MutatingInformers informers.SharedInformerFactory - Client kubernetes.Interface - StopCh chan struct{} - ValidatingStopCh chan struct{} - Demultiplexer demultiplexer.Component + LeadershipStateSubscribeFunc func() (notifChan <-chan struct{}, isLeaderFunc func() bool) + SecretInformers informers.SharedInformerFactory + ValidatingInformers informers.SharedInformerFactory + MutatingInformers informers.SharedInformerFactory + Client kubernetes.Interface + StopCh chan struct{} + ValidatingStopCh chan struct{} + Demultiplexer demultiplexer.Component } // StartControllers starts the secret and webhook controllers @@ -48,6 +47,8 @@ func StartControllers(ctx ControllerContext, wmeta workloadmeta.Component, pa wo return webhooks, nil } + notifChan, isLeaderFunc := ctx.LeadershipStateSubscribeFunc() + certConfig := secret.NewCertConfig( datadogConfig.GetDuration("admission_controller.certificate.expiration_threshold")*time.Hour, datadogConfig.GetDuration("admission_controller.certificate.validity_bound")*time.Hour) @@ -59,8 +60,8 @@ func StartControllers(ctx ControllerContext, wmeta workloadmeta.Component, pa wo secretController := secret.NewController( ctx.Client, ctx.SecretInformers.Core().V1().Secrets(), - ctx.IsLeaderFunc, - ctx.LeaderSubscribeFunc(), + isLeaderFunc, + notifChan, secretConfig, ) @@ -79,14 +80,14 @@ func StartControllers(ctx ControllerContext, wmeta workloadmeta.Component, pa wo return webhooks, err } - webhookConfig := webhook.NewConfig(v1Enabled, nsSelectorEnabled, matchConditionsSupported) + webhookConfig := webhook.NewConfig(v1Enabled, nsSelectorEnabled, matchConditionsSupported, datadogConfig) webhookController := webhook.NewController( ctx.Client, ctx.SecretInformers.Core().V1().Secrets(), ctx.ValidatingInformers.Admissionregistration(), ctx.MutatingInformers.Admissionregistration(), - ctx.IsLeaderFunc, - ctx.LeaderSubscribeFunc(), + isLeaderFunc, + notifChan, webhookConfig, wmeta, pa, diff --git a/pkg/clusteragent/admission/validate/kubernetesadmissionevents/kubernetesadmissionevents_test.go b/pkg/clusteragent/admission/validate/kubernetesadmissionevents/kubernetesadmissionevents_test.go index 954d338bae5e3..8f63153a2bc1f 100644 --- a/pkg/clusteragent/admission/validate/kubernetesadmissionevents/kubernetesadmissionevents_test.go +++ b/pkg/clusteragent/admission/validate/kubernetesadmissionevents/kubernetesadmissionevents_test.go @@ -249,8 +249,11 @@ func TestKubernetesAdmissionEvents(t *testing.T) { assert.Equal(t, eventType, kubernetesAuditWebhook.name) // Emit the event + start := time.Now() mockSender.On("Event", mock.AnythingOfType("event.Event")).Return().Once() validated, err := kubernetesAuditWebhook.emitEvent(&tt.request, "", nil) + // Force flush to serializer to ensure the event is emitted and received. + demultiplexerMock.ForceFlushToSerializer(start, true) assert.NoError(t, err) assert.True(t, validated) if tt.expectedEmitted { diff --git a/pkg/clusteragent/api/leader_forwarder.go b/pkg/clusteragent/api/leader_forwarder.go index a5989f62d112b..94d054d6508b5 100644 --- a/pkg/clusteragent/api/leader_forwarder.go +++ b/pkg/clusteragent/api/leader_forwarder.go @@ -18,8 +18,7 @@ import ( "sync" "time" - "github.com/cihub/seelog" - + "github.com/DataDog/datadog-agent/pkg/util/log" pkglogsetup "github.com/DataDog/datadog-agent/pkg/util/log/setup" ) @@ -43,7 +42,7 @@ type LeaderForwarder struct { // NewLeaderForwarder initializes a new LeaderForwarder instance and is used for test purposes func NewLeaderForwarder(apiPort, maxConnections int) *LeaderForwarder { // Use a stack depth of 4 on top of the default one to get a relevant filename in the stdlib - logWriter, _ := pkglogsetup.NewLogWriter(4, seelog.DebugLvl) + logWriter, _ := pkglogsetup.NewLogWriter(4, log.DebugLvl) return &LeaderForwarder{ apiPort: strconv.Itoa(apiPort), transport: &http.Transport{ diff --git a/pkg/clusteragent/autoscaling/workload/controller_horizontal.go b/pkg/clusteragent/autoscaling/workload/controller_horizontal.go index 555cf50b181d3..5bd044a18885c 100644 --- a/pkg/clusteragent/autoscaling/workload/controller_horizontal.go +++ b/pkg/clusteragent/autoscaling/workload/controller_horizontal.go @@ -246,6 +246,27 @@ func (hr *horizontalController) computeScaleAction( evalAfter = rulesNextEvalAfter.Truncate(time.Second) + time.Second } + // Stabilize recommendation + var stabilizationLimitReason string + var stabilizationLimitedReplicas int32 + upscaleStabilizationSeconds := int32(0) + downscaleStabilizationSeconds := int32(0) + + if policy := autoscalerInternal.Spec().Policy; policy != nil { + if upscalePolicy := policy.Upscale; upscalePolicy != nil { + upscaleStabilizationSeconds = int32(upscalePolicy.StabilizationWindowSeconds) + } + if downscalePolicy := policy.Downscale; downscalePolicy != nil { + downscaleStabilizationSeconds = int32(downscalePolicy.StabilizationWindowSeconds) + } + } + + stabilizationLimitedReplicas, stabilizationLimitReason = stabilizeRecommendations(scalingTimestamp, autoscalerInternal.HorizontalLastActions(), currentDesiredReplicas, targetDesiredReplicas, upscaleStabilizationSeconds, downscaleStabilizationSeconds, scaleDirection) + if stabilizationLimitReason != "" { + limitReason = stabilizationLimitReason + targetDesiredReplicas = stabilizationLimitedReplicas + } + horizontalAction := &datadoghq.DatadogPodAutoscalerHorizontalAction{ FromReplicas: currentDesiredReplicas, ToReplicas: targetDesiredReplicas, @@ -457,3 +478,44 @@ func accumulateReplicasChange(currentTime time.Time, events []datadoghq.DatadogP } return } + +func stabilizeRecommendations(currentTime time.Time, pastActions []datadoghq.DatadogPodAutoscalerHorizontalAction, currentReplicas int32, originalTargetDesiredReplicas int32, stabilizationWindowUpscaleSeconds int32, stabilizationWindowDownscaleSeconds int32, scaleDirection scaleDirection) (int32, string) { + limitReason := "" + + if len(pastActions) == 0 { + return originalTargetDesiredReplicas, limitReason + } + + upRecommendation := originalTargetDesiredReplicas + upCutoff := currentTime.Add(-time.Duration(stabilizationWindowUpscaleSeconds) * time.Second) + + downRecommendation := originalTargetDesiredReplicas + downCutoff := currentTime.Add(-time.Duration(stabilizationWindowDownscaleSeconds) * time.Second) + + for _, a := range pastActions { + if scaleDirection == scaleUp && a.Time.Time.After(upCutoff) { + upRecommendation = min(upRecommendation, *a.RecommendedReplicas) + } + + if scaleDirection == scaleDown && a.Time.Time.After(downCutoff) { + downRecommendation = max(downRecommendation, *a.RecommendedReplicas) + } + + if (scaleDirection == scaleUp && a.Time.Time.Before(upCutoff)) || (scaleDirection == scaleDown && a.Time.Time.Before(downCutoff)) { + break + } + } + + recommendation := currentReplicas + if recommendation < upRecommendation { + recommendation = upRecommendation + } + if recommendation > downRecommendation { + recommendation = downRecommendation + } + if recommendation != originalTargetDesiredReplicas { + limitReason = fmt.Sprintf("desired replica count limited to %d (originally %d) due to stabilization window", recommendation, originalTargetDesiredReplicas) + } + + return recommendation, limitReason +} diff --git a/pkg/clusteragent/autoscaling/workload/controller_horizontal_test.go b/pkg/clusteragent/autoscaling/workload/controller_horizontal_test.go index fc2eb1b1fe88c..89014b196a066 100644 --- a/pkg/clusteragent/autoscaling/workload/controller_horizontal_test.go +++ b/pkg/clusteragent/autoscaling/workload/controller_horizontal_test.go @@ -77,6 +77,15 @@ func (f *horizontalControllerFixture) runSync(fakePai *model.FakePodAutoscalerIn return autoscalerInternal, res, err } +func newHorizontalAction(time time.Time, fromReplicas, toReplicas, recommendedReplicas int32) datadoghq.DatadogPodAutoscalerHorizontalAction { + return datadoghq.DatadogPodAutoscalerHorizontalAction{ + Time: metav1.NewTime(time), + FromReplicas: fromReplicas, + ToReplicas: toReplicas, + RecommendedReplicas: pointer.Ptr[int32](recommendedReplicas), + } +} + type horizontalScalingTestArgs struct { fakePai *model.FakePodAutoscalerInternal dataSource datadoghq.DatadogPodAutoscalerValueSource @@ -181,6 +190,14 @@ func TestHorizontalControllerSyncPrerequisites(t *testing.T) { Kind: expectedGVK.Kind, APIVersion: expectedGVK.Group + "/" + expectedGVK.Version, }, + Policy: &datadoghq.DatadogPodAutoscalerPolicy{ + Upscale: &datadoghq.DatadogPodAutoscalerScalingPolicy{ + StabilizationWindowSeconds: 0, + }, + Downscale: &datadoghq.DatadogPodAutoscalerScalingPolicy{ + StabilizationWindowSeconds: 0, + }, + }, } fakePai.Error = nil f.scaler.On("get", mock.Anything, autoscalerNamespace, autoscalerName, expectedGVK).Return( @@ -1119,3 +1136,352 @@ func TestHorizontalControllerSyncScaleDecisionsWithRules(t *testing.T) { assert.Equal(t, autoscaling.NoRequeue, result) assert.NoError(t, err) } + +func TestStabilizeRecommendations(t *testing.T) { + currentTime := time.Now() + + tests := []struct { + name string + actions []datadoghq.DatadogPodAutoscalerHorizontalAction + currentReplicas int32 + recReplicas int32 + expected int32 + expectedReason string + upscaleWindow int32 + downscaleWindow int32 + scaleDirection scaleDirection + }{ + { + name: "no downscale stabilization - constant upscale", + actions: []datadoghq.DatadogPodAutoscalerHorizontalAction{ + newHorizontalAction(currentTime.Add(-60*time.Second), 4, 5, 6), + newHorizontalAction(currentTime.Add(-30*time.Second), 6, 4, 4), + }, + currentReplicas: 4, + recReplicas: 8, + expected: 8, + expectedReason: "", + upscaleWindow: 0, + downscaleWindow: 300, + scaleDirection: scaleUp, + }, + { + name: "downscale stabilization", + actions: []datadoghq.DatadogPodAutoscalerHorizontalAction{ + newHorizontalAction(currentTime.Add(-60*time.Second), 8, 6, 6), + newHorizontalAction(currentTime.Add(-30*time.Second), 6, 5, 5), + }, + currentReplicas: 5, + recReplicas: 4, + expected: 5, + expectedReason: "desired replica count limited to 5 (originally 4) due to stabilization window", + upscaleWindow: 0, + downscaleWindow: 300, + scaleDirection: scaleDown, + }, + { + name: "downscale stabilization, recommendation flapping", + actions: []datadoghq.DatadogPodAutoscalerHorizontalAction{ + newHorizontalAction(currentTime.Add(-90*time.Second), 8, 6, 6), + newHorizontalAction(currentTime.Add(-60*time.Second), 6, 9, 9), + newHorizontalAction(currentTime.Add(-30*time.Second), 9, 7, 7), + }, + currentReplicas: 7, + recReplicas: 5, + expected: 7, + expectedReason: "desired replica count limited to 7 (originally 5) due to stabilization window", + upscaleWindow: 0, + downscaleWindow: 300, + scaleDirection: scaleDown, + }, + { + name: "upscale stabilization", + actions: []datadoghq.DatadogPodAutoscalerHorizontalAction{ + newHorizontalAction(currentTime.Add(-60*time.Second), 5, 6, 6), + newHorizontalAction(currentTime.Add(-30*time.Second), 6, 8, 8), + }, + currentReplicas: 8, + recReplicas: 12, + expected: 8, + expectedReason: "desired replica count limited to 8 (originally 12) due to stabilization window", + upscaleWindow: 300, + downscaleWindow: 0, + scaleDirection: scaleUp, + }, + { + name: "upscale stabilization, recommendation flapping", + actions: []datadoghq.DatadogPodAutoscalerHorizontalAction{ + newHorizontalAction(currentTime.Add(-90*time.Second), 6, 8, 8), + newHorizontalAction(currentTime.Add(-60*time.Second), 8, 7, 7), + newHorizontalAction(currentTime.Add(-30*time.Second), 7, 9, 9), + }, + currentReplicas: 9, + recReplicas: 12, + expected: 9, + expectedReason: "desired replica count limited to 9 (originally 12) due to stabilization window", + upscaleWindow: 300, + downscaleWindow: 0, + scaleDirection: scaleUp, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + recommendedReplicas, limitReason := stabilizeRecommendations(currentTime, tt.actions, tt.currentReplicas, tt.recReplicas, tt.upscaleWindow, tt.downscaleWindow, tt.scaleDirection) + assert.Equal(t, tt.expected, recommendedReplicas) + assert.Equal(t, tt.expectedReason, limitReason) + }) + } +} + +func TestHorizontalControllerSyncDownscaleWithStabilization(t *testing.T) { + testTime := time.Now() + startTime := testTime.Add(-time.Hour) + defaultStepDuration := 30 * time.Second + + f := newHorizontalControllerFixture(t, startTime) + autoscalerNamespace := "default" + autoscalerName := "test" + + expectedGVK := schema.GroupVersionKind{ + Group: "apps", + Version: "v1", + Kind: "Deployment", + } + + fakePai := &model.FakePodAutoscalerInternal{ + Namespace: autoscalerNamespace, + Name: autoscalerName, + Spec: &datadoghq.DatadogPodAutoscalerSpec{ + TargetRef: v2.CrossVersionObjectReference{ + Name: autoscalerName, + Kind: expectedGVK.Kind, + APIVersion: expectedGVK.Group + "/" + expectedGVK.Version, + }, + Constraints: &datadoghq.DatadogPodAutoscalerConstraints{ + MinReplicas: pointer.Ptr[int32](90), + MaxReplicas: 120, + }, + Policy: &datadoghq.DatadogPodAutoscalerPolicy{ + Upscale: &datadoghq.DatadogPodAutoscalerScalingPolicy{ + StabilizationWindowSeconds: 0, + }, + Downscale: &datadoghq.DatadogPodAutoscalerScalingPolicy{ + StabilizationWindowSeconds: 300, + }, + }, + }, + HorizontalLastActions: []datadoghq.DatadogPodAutoscalerHorizontalAction{ + newHorizontalAction(f.clock.Now().Add(-60*time.Second), 90, 94, 94), + newHorizontalAction(f.clock.Now().Add(-30*time.Second), 94, 97, 97), + }, + ScalingValues: model.ScalingValues{ + Horizontal: &model.HorizontalScalingValues{ + Source: datadoghq.DatadogPodAutoscalerAutoscalingValueSource, + Timestamp: f.clock.Now().Add(-defaultStepDuration), + Replicas: 100, + }, + }, + TargetGVK: expectedGVK, + HorizontalEventsRetention: 5 * time.Minute, + } + + // Test upscale to 100 replicas (not limited) + f.clock.Step(defaultStepDuration) + result, err := f.testScalingDecision(horizontalScalingTestArgs{ + fakePai: fakePai, + dataSource: datadoghq.DatadogPodAutoscalerAutoscalingValueSource, + dataOffset: defaultStepDuration, + currentReplicas: 97, + statusReplicas: 97, + recReplicas: 100, + scaleReplicas: 100, + }) + assert.Equal(t, autoscaling.NoRequeue, result) + assert.NoError(t, err) + + // Test downscale to 97 replicas, limited to 100 + f.clock.Step(defaultStepDuration) + result, err = f.testScalingDecision(horizontalScalingTestArgs{ + fakePai: fakePai, + dataSource: datadoghq.DatadogPodAutoscalerAutoscalingValueSource, + dataOffset: defaultStepDuration, + currentReplicas: 100, + statusReplicas: 100, + recReplicas: 97, + scaleReplicas: 100, + scaleLimitReason: "desired replica count limited to 100 (originally 97) due to stabilization window", + }) + assert.Equal(t, autoscaling.NoRequeue, result) + assert.NoError(t, err) + + // Test downscale to 95 replicas, still limited to 100 + f.clock.Step(defaultStepDuration) + result, err = f.testScalingDecision(horizontalScalingTestArgs{ + fakePai: fakePai, + dataSource: datadoghq.DatadogPodAutoscalerAutoscalingValueSource, + dataOffset: defaultStepDuration, + currentReplicas: 100, + statusReplicas: 100, + recReplicas: 95, + scaleReplicas: 100, + scaleLimitReason: "desired replica count limited to 100 (originally 95) due to stabilization window", + }) + assert.Equal(t, autoscaling.NoRequeue, result) + assert.NoError(t, err) + + // Test downscale to 92 replicas (not limited) + // Moving clock 4 minutes forward to get past stabilization window + f.clock.Step(4 * time.Minute) + result, err = f.testScalingDecision(horizontalScalingTestArgs{ + fakePai: fakePai, + dataSource: datadoghq.DatadogPodAutoscalerAutoscalingValueSource, + dataOffset: defaultStepDuration, + currentReplicas: 100, + statusReplicas: 100, + recReplicas: 92, + scaleReplicas: 92, + }) + assert.Equal(t, autoscaling.NoRequeue, result) + assert.NoError(t, err) + + // Test upscale to 100 replicas (not limited) + f.clock.Step(defaultStepDuration) + result, err = f.testScalingDecision(horizontalScalingTestArgs{ + fakePai: fakePai, + dataSource: datadoghq.DatadogPodAutoscalerAutoscalingValueSource, + dataOffset: defaultStepDuration, + currentReplicas: 92, + statusReplicas: 92, + recReplicas: 100, + scaleReplicas: 100, + }) + assert.Equal(t, autoscaling.NoRequeue, result) + assert.NoError(t, err) +} + +func TestHorizontalControllerSyncUpscaleWithStabilization(t *testing.T) { + testTime := time.Now() + startTime := testTime.Add(-time.Hour) + defaultStepDuration := 30 * time.Second + + f := newHorizontalControllerFixture(t, startTime) + autoscalerNamespace := "default" + autoscalerName := "test" + + expectedGVK := schema.GroupVersionKind{ + Group: "apps", + Version: "v1", + Kind: "Deployment", + } + + fakePai := &model.FakePodAutoscalerInternal{ + Namespace: autoscalerNamespace, + Name: autoscalerName, + Spec: &datadoghq.DatadogPodAutoscalerSpec{ + TargetRef: v2.CrossVersionObjectReference{ + Name: autoscalerName, + Kind: expectedGVK.Kind, + APIVersion: expectedGVK.Group + "/" + expectedGVK.Version, + }, + Constraints: &datadoghq.DatadogPodAutoscalerConstraints{ + MinReplicas: pointer.Ptr[int32](90), + MaxReplicas: 120, + }, + Policy: &datadoghq.DatadogPodAutoscalerPolicy{ + Upscale: &datadoghq.DatadogPodAutoscalerScalingPolicy{ + StabilizationWindowSeconds: 300, + }, + Downscale: &datadoghq.DatadogPodAutoscalerScalingPolicy{ + StabilizationWindowSeconds: 0, + }, + }, + }, + HorizontalLastActions: []datadoghq.DatadogPodAutoscalerHorizontalAction{ + newHorizontalAction(f.clock.Now().Add(-60*time.Second), 120, 110, 110), + newHorizontalAction(f.clock.Now().Add(-30*time.Second), 110, 104, 104), + }, + ScalingValues: model.ScalingValues{ + Horizontal: &model.HorizontalScalingValues{ + Source: datadoghq.DatadogPodAutoscalerAutoscalingValueSource, + Timestamp: f.clock.Now().Add(-defaultStepDuration), + Replicas: 100, + }, + }, + TargetGVK: expectedGVK, + HorizontalEventsRetention: 5 * time.Minute, + } + + // Test downscale to 100 replicas (not limited) + f.clock.Step(defaultStepDuration) + result, err := f.testScalingDecision(horizontalScalingTestArgs{ + fakePai: fakePai, + dataSource: datadoghq.DatadogPodAutoscalerAutoscalingValueSource, + dataOffset: defaultStepDuration, + currentReplicas: 104, + statusReplicas: 104, + recReplicas: 100, + scaleReplicas: 100, + }) + assert.Equal(t, autoscaling.NoRequeue, result) + assert.NoError(t, err) + + // Test upscale to 102 replicas, limited to 100 + f.clock.Step(defaultStepDuration) + result, err = f.testScalingDecision(horizontalScalingTestArgs{ + fakePai: fakePai, + dataSource: datadoghq.DatadogPodAutoscalerAutoscalingValueSource, + dataOffset: defaultStepDuration, + currentReplicas: 100, + statusReplicas: 100, + recReplicas: 102, + scaleReplicas: 100, + scaleLimitReason: "desired replica count limited to 100 (originally 102) due to stabilization window", + }) + assert.Equal(t, autoscaling.NoRequeue, result) + assert.NoError(t, err) + + // Test upscale to 105 replicas, still limited to 100 + f.clock.Step(defaultStepDuration) + result, err = f.testScalingDecision(horizontalScalingTestArgs{ + fakePai: fakePai, + dataSource: datadoghq.DatadogPodAutoscalerAutoscalingValueSource, + dataOffset: defaultStepDuration, + currentReplicas: 100, + statusReplicas: 100, + recReplicas: 105, + scaleReplicas: 100, + scaleLimitReason: "desired replica count limited to 100 (originally 105) due to stabilization window", + }) + assert.Equal(t, autoscaling.NoRequeue, result) + assert.NoError(t, err) + + // Test upscale to 102 replicas (not limited) + // Moving clock 4 minutes forward to get past stabilization window + f.clock.Step(4 * time.Minute) + result, err = f.testScalingDecision(horizontalScalingTestArgs{ + fakePai: fakePai, + dataSource: datadoghq.DatadogPodAutoscalerAutoscalingValueSource, + dataOffset: defaultStepDuration, + currentReplicas: 100, + statusReplicas: 100, + recReplicas: 102, + scaleReplicas: 102, + }) + assert.Equal(t, autoscaling.NoRequeue, result) + assert.NoError(t, err) + + // Test downscale to 100 replicas (not limited) + f.clock.Step(defaultStepDuration) + result, err = f.testScalingDecision(horizontalScalingTestArgs{ + fakePai: fakePai, + dataSource: datadoghq.DatadogPodAutoscalerAutoscalingValueSource, + dataOffset: defaultStepDuration, + currentReplicas: 102, + statusReplicas: 102, + recReplicas: 100, + scaleReplicas: 100, + }) + assert.Equal(t, autoscaling.NoRequeue, result) + assert.NoError(t, err) +} diff --git a/pkg/clusteragent/autoscaling/workload/controller_test.go b/pkg/clusteragent/autoscaling/workload/controller_test.go index e07be01363cb5..c31b6c8c646aa 100755 --- a/pkg/clusteragent/autoscaling/workload/controller_test.go +++ b/pkg/clusteragent/autoscaling/workload/controller_test.go @@ -121,10 +121,11 @@ func TestLeaderCreateDeleteLocal(t *testing.T) { // Check internal store content expectedDPAInternal := model.FakePodAutoscalerInternal{ - Namespace: "default", - Name: "dpa-0", - Generation: 1, - Spec: &dpaSpec, + Namespace: "default", + Name: "dpa-0", + Generation: 1, + Spec: &dpaSpec, + CustomRecommenderConfiguration: nil, } dpaInternal, found := f.store.Get("default/dpa-0") assert.True(t, found) diff --git a/pkg/clusteragent/autoscaling/workload/model/pod_autoscaler.go b/pkg/clusteragent/autoscaling/workload/model/pod_autoscaler.go index a1dc2f722beb1..fa2b27cb97f12 100644 --- a/pkg/clusteragent/autoscaling/workload/model/pod_autoscaler.go +++ b/pkg/clusteragent/autoscaling/workload/model/pod_autoscaler.go @@ -8,14 +8,16 @@ package model import ( + "encoding/json" "errors" "fmt" "slices" "time" - "github.com/DataDog/datadog-agent/pkg/util/pointer" datadoghq "github.com/DataDog/datadog-operator/api/datadoghq/v1alpha1" + "github.com/DataDog/datadog-agent/pkg/util/pointer" + corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" @@ -28,6 +30,9 @@ const ( // statusRetainedActions is the number of horizontal actions kept in status statusRetainedActions = 5 + + // CustomRecommenderAnnotationKey is the key used to store custom recommender configuration in annotations + CustomRecommenderAnnotationKey = "autoscaling.datadoghq.com/custom-recommender" ) // PodAutoscalerInternal holds the necessary data to work with the `DatadogPodAutoscaler` CRD. @@ -53,9 +58,15 @@ type PodAutoscalerInternal struct { // (only if owner == remote) settingsTimestamp time.Time - // scalingValues represents the current target scaling values (retrieved from RC) + // scalingValues represents the active scaling values that should be used scalingValues ScalingValues + // mainScalingValues represents the scaling values retrieved from the main recommender (product, optionally a custom endpoint) + mainScalingValues ScalingValues + + // fallbackScalingValues represents the scaling values retrieved from the fallback + fallbackScalingValues ScalingValues + // horizontalLastActions is the last horizontal action successfully taken horizontalLastActions []datadoghq.DatadogPodAutoscalerHorizontalAction @@ -95,6 +106,10 @@ type PodAutoscalerInternal struct { // horizontalEventsRetention is the time to keep horizontal events in memory // based on scale policies horizontalEventsRetention time.Duration + + // customRecommenderConfiguration holds the configuration for custom recommenders, + // Parsed from annotations on the autoscaler + customRecommenderConfiguration *RecommenderConfiguration } // NewPodAutoscalerInternal creates a new PodAutoscalerInternal from a Kubernetes CR @@ -134,6 +149,8 @@ func (p *PodAutoscalerInternal) UpdateFromPodAutoscaler(podAutoscaler *datadoghq p.targetGVK = schema.GroupVersionKind{} // Compute the horizontal events retention again in case .Spec.Policy has changed p.horizontalEventsRetention = getHorizontalEventsRetention(podAutoscaler.Spec.Policy, longestScalingRulePeriodAllowed) + // Compute recommender configuration again in case .Annotations has changed + p.updateCustomRecommenderConfiguration(podAutoscaler.Annotations) } // UpdateFromSettings updates the PodAutoscalerInternal from a new settings @@ -148,16 +165,36 @@ func (p *PodAutoscalerInternal) UpdateFromSettings(podAutoscalerSpec *datadoghq. p.horizontalEventsRetention = getHorizontalEventsRetention(podAutoscalerSpec.Policy, longestScalingRulePeriodAllowed) } -// UpdateFromValues updates the PodAutoscalerInternal from a new scaling values +// UpdateFromValues updates the PodAutoscalerInternal scaling values func (p *PodAutoscalerInternal) UpdateFromValues(scalingValues ScalingValues) { p.scalingValues = scalingValues } +// UpdateFromMainValues updates the PodAutoscalerInternal from new main scaling values +func (p *PodAutoscalerInternal) UpdateFromMainValues(mainScalingValues ScalingValues) { + p.mainScalingValues = mainScalingValues +} + +// UpdateFromLocalValues updates the PodAutoscalerInternal from new local scaling values +func (p *PodAutoscalerInternal) UpdateFromLocalValues(fallbackScalingValues ScalingValues) { + p.fallbackScalingValues = fallbackScalingValues +} + // RemoveValues clears autoscaling values data from the PodAutoscalerInternal as we stopped autoscaling func (p *PodAutoscalerInternal) RemoveValues() { p.scalingValues = ScalingValues{} } +// RemoveMainValues clears main autoscaling values data from the PodAutoscalerInternal as we stopped autoscaling +func (p *PodAutoscalerInternal) RemoveMainValues() { + p.mainScalingValues = ScalingValues{} +} + +// RemoveLocalValues clears local autoscaling values data from the PodAutoscalerInternal as we stopped autoscaling +func (p *PodAutoscalerInternal) RemoveLocalValues() { + p.fallbackScalingValues = ScalingValues{} +} + // UpdateFromHorizontalAction updates the PodAutoscalerInternal from a new horizontal action func (p *PodAutoscalerInternal) UpdateFromHorizontalAction(action *datadoghq.DatadogPodAutoscalerHorizontalAction, err error) { if err != nil { @@ -325,6 +362,16 @@ func (p *PodAutoscalerInternal) ScalingValues() ScalingValues { return p.scalingValues } +// MainScalingValues returns the main scaling values of the PodAutoscaler +func (p *PodAutoscalerInternal) MainScalingValues() ScalingValues { + return p.mainScalingValues +} + +// FallbackScalingValues returns the fallback scaling values of the PodAutoscaler +func (p *PodAutoscalerInternal) FallbackScalingValues() ScalingValues { + return p.fallbackScalingValues +} + // HorizontalLastActions returns the last horizontal actions taken func (p *PodAutoscalerInternal) HorizontalLastActions() []datadoghq.DatadogPodAutoscalerHorizontalAction { return p.horizontalLastActions @@ -384,6 +431,11 @@ func (p *PodAutoscalerInternal) TargetGVK() (schema.GroupVersionKind, error) { return p.targetGVK, nil } +// CustomRecommenderConfiguration returns the configuration set on the autoscaler for a customer recommender +func (p *PodAutoscalerInternal) CustomRecommenderConfiguration() *RecommenderConfiguration { + return p.customRecommenderConfiguration +} + // // Helpers // @@ -518,6 +570,15 @@ func (p *PodAutoscalerInternal) BuildStatus(currentTime metav1.Time, currentStat } // Private helpers +func (p *PodAutoscalerInternal) updateCustomRecommenderConfiguration(annotations map[string]string) { + annotation, err := parseCustomConfigurationAnnotation(annotations) + if err != nil { + p.error = err + return + } + p.customRecommenderConfiguration = annotation +} + func addHorizontalAction(currentTime time.Time, retention time.Duration, actions []datadoghq.DatadogPodAutoscalerHorizontalAction, action *datadoghq.DatadogPodAutoscalerHorizontalAction) []datadoghq.DatadogPodAutoscalerHorizontalAction { if retention == 0 { actions = actions[:0] @@ -589,16 +650,14 @@ func getHorizontalEventsRetention(policy *datadoghq.DatadogPodAutoscalerPolicy, if policy.Upscale != nil { upscaleRetention := getLongestScalingRulesPeriod(policy.Upscale.Rules) - if upscaleRetention > longestRetention { - longestRetention = upscaleRetention - } + upscaleStabilizationWindow := time.Second * time.Duration(policy.Upscale.StabilizationWindowSeconds) + longestRetention = max(longestRetention, upscaleRetention, upscaleStabilizationWindow) } if policy.Downscale != nil { downscaleRetention := getLongestScalingRulesPeriod(policy.Downscale.Rules) - if downscaleRetention > longestRetention { - longestRetention = downscaleRetention - } + downscaleStabilizationWindow := time.Second * time.Duration(policy.Downscale.StabilizationWindowSeconds) + longestRetention = max(longestRetention, downscaleRetention, downscaleStabilizationWindow) } if longestRetention > longestLookbackAllowed { @@ -618,3 +677,19 @@ func getLongestScalingRulesPeriod(rules []datadoghq.DatadogPodAutoscalerScalingR return longest } + +func parseCustomConfigurationAnnotation(annotations map[string]string) (*RecommenderConfiguration, error) { + annotation, ok := annotations[CustomRecommenderAnnotationKey] + + if !ok { // No annotation set + return nil, nil + } + + customConfiguration := RecommenderConfiguration{} + + if err := json.Unmarshal([]byte(annotation), &customConfiguration); err != nil { + return nil, fmt.Errorf("Failed to parse annotations for custom recommender configuration: %v", err) + } + + return &customConfiguration, nil +} diff --git a/pkg/clusteragent/autoscaling/workload/model/pod_autoscaler_test.go b/pkg/clusteragent/autoscaling/workload/model/pod_autoscaler_test.go index 15dc2a99bea8d..908c5b8259523 100644 --- a/pkg/clusteragent/autoscaling/workload/model/pod_autoscaler_test.go +++ b/pkg/clusteragent/autoscaling/workload/model/pod_autoscaler_test.go @@ -8,6 +8,7 @@ package model import ( + "fmt" "testing" "time" @@ -76,3 +77,256 @@ func TestAddHorizontalAction(t *testing.T) { *addedAction2, }, horizontalLastActions) } + +func TestGetHorizontalEventsRetention(t *testing.T) { + tests := []struct { + name string + policy *datadoghq.DatadogPodAutoscalerPolicy + longestLookbackAllowed time.Duration + expectedRetention time.Duration + }{ + { + name: "No policy, no retention", + policy: nil, + longestLookbackAllowed: 0, + expectedRetention: 0, + }, + { + name: "No policy, 15 minutes retention", + policy: nil, + longestLookbackAllowed: 15 * time.Minute, + expectedRetention: 0, + }, + { + name: "Upscale policy with rules, 30 minutes retention", + policy: &datadoghq.DatadogPodAutoscalerPolicy{ + Upscale: &datadoghq.DatadogPodAutoscalerScalingPolicy{ + Rules: []datadoghq.DatadogPodAutoscalerScalingRule{ + { + Type: "Pods", + PeriodSeconds: 900, + Value: 2, + }, + }, + }, + }, + longestLookbackAllowed: 30 * time.Minute, + expectedRetention: 15 * time.Minute, + }, + { + name: "Upscale policy with rules, 10 minutes max retention", + policy: &datadoghq.DatadogPodAutoscalerPolicy{ + Upscale: &datadoghq.DatadogPodAutoscalerScalingPolicy{ + Rules: []datadoghq.DatadogPodAutoscalerScalingRule{ + { + Type: "Pods", + PeriodSeconds: 900, + Value: 2, + }, + }, + }, + }, + longestLookbackAllowed: 10 * time.Minute, + expectedRetention: 10 * time.Minute, + }, + { + name: "Upscale and downscale policy with rules, 30 minutes retention", + policy: &datadoghq.DatadogPodAutoscalerPolicy{ + Upscale: &datadoghq.DatadogPodAutoscalerScalingPolicy{ + Rules: []datadoghq.DatadogPodAutoscalerScalingRule{ + { + Type: "Pods", + PeriodSeconds: 900, + Value: 2, + }, + }, + }, + Downscale: &datadoghq.DatadogPodAutoscalerScalingPolicy{ + Rules: []datadoghq.DatadogPodAutoscalerScalingRule{ + { + Type: "Pods", + PeriodSeconds: 960, + Value: 2, + }, + }, + }, + }, + longestLookbackAllowed: 30 * time.Minute, + expectedRetention: 16 * time.Minute, + }, + { + name: "Upscale and downscale policy with rules, 10 minutes max retention", + policy: &datadoghq.DatadogPodAutoscalerPolicy{ + Upscale: &datadoghq.DatadogPodAutoscalerScalingPolicy{ + Rules: []datadoghq.DatadogPodAutoscalerScalingRule{ + { + Type: "Pods", + PeriodSeconds: 900, + Value: 2, + }, + }, + }, + Downscale: &datadoghq.DatadogPodAutoscalerScalingPolicy{ + Rules: []datadoghq.DatadogPodAutoscalerScalingRule{ + { + Type: "Pods", + PeriodSeconds: 960, + Value: 2, + }, + }, + }, + }, + longestLookbackAllowed: 10 * time.Minute, + expectedRetention: 10 * time.Minute, + }, + { + name: "Upscale stabilization window 5 minutes", + policy: &datadoghq.DatadogPodAutoscalerPolicy{ + Upscale: &datadoghq.DatadogPodAutoscalerScalingPolicy{ + Rules: []datadoghq.DatadogPodAutoscalerScalingRule{ + { + Type: "Pods", + PeriodSeconds: 180, + Value: 2, + }, + }, + StabilizationWindowSeconds: 300, + }, + Downscale: &datadoghq.DatadogPodAutoscalerScalingPolicy{ + Rules: []datadoghq.DatadogPodAutoscalerScalingRule{ + { + Type: "Pods", + PeriodSeconds: 180, + Value: 2, + }, + }, + }, + }, + longestLookbackAllowed: 30 * time.Minute, + expectedRetention: 5 * time.Minute, + }, + { + name: "Downscale stabilization window 5 minutes", + policy: &datadoghq.DatadogPodAutoscalerPolicy{ + Upscale: &datadoghq.DatadogPodAutoscalerScalingPolicy{ + Rules: []datadoghq.DatadogPodAutoscalerScalingRule{ + { + Type: "Pods", + PeriodSeconds: 180, + Value: 2, + }, + }, + }, + Downscale: &datadoghq.DatadogPodAutoscalerScalingPolicy{ + Rules: []datadoghq.DatadogPodAutoscalerScalingRule{ + { + Type: "Pods", + PeriodSeconds: 180, + Value: 2, + }, + }, + StabilizationWindowSeconds: 300, + }, + }, + longestLookbackAllowed: 30 * time.Minute, + expectedRetention: 5 * time.Minute, + }, + { + name: "Stabilization, rules, max retention", + policy: &datadoghq.DatadogPodAutoscalerPolicy{ + Upscale: &datadoghq.DatadogPodAutoscalerScalingPolicy{ + Rules: []datadoghq.DatadogPodAutoscalerScalingRule{ + { + Type: "Pods", + PeriodSeconds: 360, + Value: 2, + }, + }, + StabilizationWindowSeconds: 300, + }, + Downscale: &datadoghq.DatadogPodAutoscalerScalingPolicy{ + Rules: []datadoghq.DatadogPodAutoscalerScalingRule{ + { + Type: "Pods", + PeriodSeconds: 420, + Value: 2, + }, + }, + StabilizationWindowSeconds: 180, + }, + }, + longestLookbackAllowed: 30 * time.Minute, + expectedRetention: 7 * time.Minute, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + horizontalEventsRetention := getHorizontalEventsRetention(tt.policy, tt.longestLookbackAllowed) + assert.Equal(t, tt.expectedRetention, horizontalEventsRetention) + }) + } +} + +func TestParseCustomConfigurationAnnotation(t *testing.T) { + tests := []struct { + name string + annotations map[string]string + expected *RecommenderConfiguration + err error + }{ + { + name: "Empty annotations", + annotations: map[string]string{}, + expected: nil, + err: nil, + }, + { + name: "URL annotation", + annotations: map[string]string{ + CustomRecommenderAnnotationKey: "{\"endpoint\": \"localhost:8080/test\"}", + }, + expected: &RecommenderConfiguration{ + Endpoint: "localhost:8080/test", + }, + err: nil, + }, + { + name: "Settings annotation", + annotations: map[string]string{ + CustomRecommenderAnnotationKey: "{\"endpoint\": \"localhost:8080/test\", \"settings\": {\"key\": \"value\", \"number\": 1, \"bool\": true, \"array\": [1, 2, 3], \"object\": {\"key\": \"value\"}}}", + }, + expected: &RecommenderConfiguration{ + Endpoint: "localhost:8080/test", + Settings: map[string]any{ + "key": "value", + "number": 1.0, + "bool": true, + "array": []interface{}{1.0, 2.0, 3.0}, + "object": map[string]interface{}{"key": "value"}, + }, + }, + err: nil, + }, + { + name: "Unmarshalable annotations", + annotations: map[string]string{ + CustomRecommenderAnnotationKey: "{\"endpoint: \"localhost:8080/test\",}", + }, + expected: nil, + err: fmt.Errorf("Failed to parse annotations for custom recommender configuration: invalid character 'l' after object key"), + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + customConfiguration, err := parseCustomConfigurationAnnotation(tt.annotations) + if tt.err == nil { + assert.NoError(t, err) + assert.Equal(t, tt.expected, customConfiguration) + } else { + assert.EqualError(t, err, tt.err.Error()) + } + }) + } +} diff --git a/pkg/clusteragent/autoscaling/workload/model/pod_autoscaler_test_utils.go b/pkg/clusteragent/autoscaling/workload/model/pod_autoscaler_test_utils.go index c05b15b20a9cc..5649d62cdd93d 100644 --- a/pkg/clusteragent/autoscaling/workload/model/pod_autoscaler_test_utils.go +++ b/pkg/clusteragent/autoscaling/workload/model/pod_autoscaler_test_utils.go @@ -24,47 +24,49 @@ import ( // FakePodAutoscalerInternal is a fake PodAutoscalerInternal object. type FakePodAutoscalerInternal struct { - Namespace string - Name string - Generation int64 - Spec *datadoghq.DatadogPodAutoscalerSpec - SettingsTimestamp time.Time - CreationTimestamp time.Time - ScalingValues ScalingValues - HorizontalLastActions []datadoghq.DatadogPodAutoscalerHorizontalAction - HorizontalLastLimitReason string - HorizontalLastActionError error - HorizontalEventsRetention time.Duration - VerticalLastAction *datadoghq.DatadogPodAutoscalerVerticalAction - VerticalLastActionError error - CurrentReplicas *int32 - ScaledReplicas *int32 - Error error - Deleted bool - TargetGVK schema.GroupVersionKind + Namespace string + Name string + Generation int64 + Spec *datadoghq.DatadogPodAutoscalerSpec + SettingsTimestamp time.Time + CreationTimestamp time.Time + ScalingValues ScalingValues + HorizontalLastActions []datadoghq.DatadogPodAutoscalerHorizontalAction + HorizontalLastLimitReason string + HorizontalLastActionError error + HorizontalEventsRetention time.Duration + VerticalLastAction *datadoghq.DatadogPodAutoscalerVerticalAction + VerticalLastActionError error + CurrentReplicas *int32 + ScaledReplicas *int32 + Error error + Deleted bool + TargetGVK schema.GroupVersionKind + CustomRecommenderConfiguration *RecommenderConfiguration } // Build creates a PodAutoscalerInternal object from the FakePodAutoscalerInternal. func (f FakePodAutoscalerInternal) Build() PodAutoscalerInternal { return PodAutoscalerInternal{ - namespace: f.Namespace, - name: f.Name, - generation: f.Generation, - spec: f.Spec, - settingsTimestamp: f.SettingsTimestamp, - creationTimestamp: f.CreationTimestamp, - scalingValues: f.ScalingValues, - horizontalLastActions: f.HorizontalLastActions, - horizontalLastLimitReason: f.HorizontalLastLimitReason, - horizontalLastActionError: f.HorizontalLastActionError, - horizontalEventsRetention: f.HorizontalEventsRetention, - verticalLastAction: f.VerticalLastAction, - verticalLastActionError: f.VerticalLastActionError, - currentReplicas: f.CurrentReplicas, - scaledReplicas: f.ScaledReplicas, - error: f.Error, - deleted: f.Deleted, - targetGVK: f.TargetGVK, + namespace: f.Namespace, + name: f.Name, + generation: f.Generation, + spec: f.Spec, + settingsTimestamp: f.SettingsTimestamp, + creationTimestamp: f.CreationTimestamp, + scalingValues: f.ScalingValues, + horizontalLastActions: f.HorizontalLastActions, + horizontalLastLimitReason: f.HorizontalLastLimitReason, + horizontalLastActionError: f.HorizontalLastActionError, + horizontalEventsRetention: f.HorizontalEventsRetention, + verticalLastAction: f.VerticalLastAction, + verticalLastActionError: f.VerticalLastActionError, + currentReplicas: f.CurrentReplicas, + scaledReplicas: f.ScaledReplicas, + error: f.Error, + deleted: f.Deleted, + targetGVK: f.TargetGVK, + customRecommenderConfiguration: f.CustomRecommenderConfiguration, } } @@ -110,7 +112,7 @@ func ComparePodAutoscalers(expected any, actual any) string { if fake, ok := x.(FakePodAutoscalerInternal); ok { return fake.Build() } - panic("filer failed - unexpected type") + panic("filter failed - unexpected type") }), ), cmp.FilterValues( diff --git a/pkg/clusteragent/autoscaling/workload/model/rc_schema.go b/pkg/clusteragent/autoscaling/workload/model/rc_schema.go index ee19c3339f590..1d219717c8a2d 100644 --- a/pkg/clusteragent/autoscaling/workload/model/rc_schema.go +++ b/pkg/clusteragent/autoscaling/workload/model/rc_schema.go @@ -8,10 +8,6 @@ package model import ( - "time" - - "k8s.io/apimachinery/pkg/api/resource" - kubeAutoscaling "github.com/DataDog/agent-payload/v5/autoscaling/kubernetes" datadoghq "github.com/DataDog/datadog-operator/api/datadoghq/v1alpha1" ) @@ -41,61 +37,3 @@ type AutoscalingSettings struct { // Spec is the full spec of the PodAutoscaler Spec *datadoghq.DatadogPodAutoscalerSpec `json:"spec"` } - -// ScalingValues represents the scaling values (horizontal and vertical) for a target -type ScalingValues struct { - // HorizontalError refers to an error encountered by Datadog while computing the horizontal scaling values - HorizontalError error - Horizontal *HorizontalScalingValues - - // VerticalError refers to an error encountered by Datadog while computing the vertical scaling values - VerticalError error - Vertical *VerticalScalingValues - - // Error refers to a general error encountered by Datadog while computing the scaling values - Error error -} - -// HorizontalScalingValues holds the horizontal scaling values for a target -type HorizontalScalingValues struct { - // Source is the source of the value - Source datadoghq.DatadogPodAutoscalerValueSource - - // Timestamp is the time at which the data was generated - Timestamp time.Time - - // Replicas is the desired number of replicas for the target - Replicas int32 -} - -// VerticalScalingValues holds the vertical scaling values for a target -type VerticalScalingValues struct { - // Source is the source of the value - Source datadoghq.DatadogPodAutoscalerValueSource - - // Timestamp is the time at which the data was generated - Timestamp time.Time - - // ResourcesHash is the hash of containerResources - ResourcesHash string - - // ContainerResources holds the resources for a container - ContainerResources []datadoghq.DatadogPodAutoscalerContainerResources -} - -// SumCPUMemoryRequests sums the CPU and memory requests of all containers -func (v *VerticalScalingValues) SumCPUMemoryRequests() (cpu, memory resource.Quantity) { - for _, container := range v.ContainerResources { - cpuReq := container.Requests.Cpu() - if cpuReq != nil { - cpu.Add(*cpuReq) - } - - memoryReq := container.Requests.Memory() - if memoryReq != nil { - memory.Add(*memoryReq) - } - } - - return -} diff --git a/pkg/clusteragent/autoscaling/workload/model/recommendations.go b/pkg/clusteragent/autoscaling/workload/model/recommendations.go new file mode 100644 index 0000000000000..5ab1057e93488 --- /dev/null +++ b/pkg/clusteragent/autoscaling/workload/model/recommendations.go @@ -0,0 +1,80 @@ +// 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 kubeapiserver + +package model + +import ( + "time" + + "k8s.io/apimachinery/pkg/api/resource" + + datadoghq "github.com/DataDog/datadog-operator/api/datadoghq/v1alpha1" +) + +// ScalingValues represents the scaling values (horizontal and vertical) for a target +type ScalingValues struct { + // HorizontalError refers to an error encountered by Datadog while computing the horizontal scaling values + HorizontalError error + Horizontal *HorizontalScalingValues + + // VerticalError refers to an error encountered by Datadog while computing the vertical scaling values + VerticalError error + Vertical *VerticalScalingValues + + // Error refers to a general error encountered by Datadog while computing the scaling values + Error error +} + +// HorizontalScalingValues holds the horizontal scaling values for a target +type HorizontalScalingValues struct { + // Source is the source of the value + Source datadoghq.DatadogPodAutoscalerValueSource + + // Timestamp is the time at which the data was generated + Timestamp time.Time + + // Replicas is the desired number of replicas for the target + Replicas int32 +} + +// VerticalScalingValues holds the vertical scaling values for a target +type VerticalScalingValues struct { + // Source is the source of the value + Source datadoghq.DatadogPodAutoscalerValueSource + + // Timestamp is the time at which the data was generated + Timestamp time.Time + + // ResourcesHash is the hash of containerResources + ResourcesHash string + + // ContainerResources holds the resources for a container + ContainerResources []datadoghq.DatadogPodAutoscalerContainerResources +} + +// RecommenderConfiguration holds the configuration for a custom recommender +type RecommenderConfiguration struct { + Endpoint string + Settings map[string]any +} + +// SumCPUMemoryRequests sums the CPU and memory requests of all containers +func (v *VerticalScalingValues) SumCPUMemoryRequests() (cpu, memory resource.Quantity) { + for _, container := range v.ContainerResources { + cpuReq := container.Requests.Cpu() + if cpuReq != nil { + cpu.Add(*cpuReq) + } + + memoryReq := container.Requests.Memory() + if memoryReq != nil { + memory.Add(*memoryReq) + } + } + + return +} diff --git a/pkg/collector/corechecks/cluster/orchestrator/processors/common/base.go b/pkg/collector/corechecks/cluster/orchestrator/processors/common/base.go index e8c0b5db8d9ff..c825586135bf5 100644 --- a/pkg/collector/corechecks/cluster/orchestrator/processors/common/base.go +++ b/pkg/collector/corechecks/cluster/orchestrator/processors/common/base.go @@ -34,6 +34,11 @@ func (BaseHandlers) BuildManifestMessageBody(ctx processors.ProcessorContext, re return ExtractModelManifests(ctx, resourceManifests, groupSize) } +//nolint:revive // TODO(CAPP) Fix revive linter +func (BaseHandlers) ResourceTaggerTags(ctx processors.ProcessorContext, resource interface{}) []string { + return nil +} + // ExtractModelManifests creates the model manifest from the given manifests func ExtractModelManifests(ctx processors.ProcessorContext, resourceManifests []interface{}, groupSize int) *model.CollectorManifest { pctx := ctx.(*processors.K8sProcessorContext) diff --git a/pkg/collector/corechecks/cluster/orchestrator/processors/k8s/pod.go b/pkg/collector/corechecks/cluster/orchestrator/processors/k8s/pod.go index 6f3a62dda8848..db54519fbc90b 100644 --- a/pkg/collector/corechecks/cluster/orchestrator/processors/k8s/pod.go +++ b/pkg/collector/corechecks/cluster/orchestrator/processors/k8s/pod.go @@ -164,6 +164,23 @@ func (h *PodHandlers) ResourceVersion(ctx processors.ProcessorContext, resource, return resourceModel.(*model.Pod).Metadata.ResourceVersion } +// ResourceTaggerTags is a handler called to retrieve tags for a resource from the tagger. +// +//nolint:revive // TODO(CAPP) Fix revive linter +func (h *PodHandlers) ResourceTaggerTags(ctx processors.ProcessorContext, resource interface{}) []string { + r, ok := resource.(*corev1.Pod) + if !ok { + log.Debugf("Could not cast resource to pod") + return nil + } + tags, err := h.tagProvider.GetTags(r, taggertypes.HighCardinality) + if err != nil { + log.Debugf("Could not retrieve tags for pod: %s", err.Error()) + return nil + } + return tags +} + // ScrubBeforeExtraction is a handler called to redact the raw resource before // it is extracted as an internal resource model. // diff --git a/pkg/collector/corechecks/cluster/orchestrator/processors/processor.go b/pkg/collector/corechecks/cluster/orchestrator/processors/processor.go index bd53e21cb7df5..65e5619fef47a 100644 --- a/pkg/collector/corechecks/cluster/orchestrator/processors/processor.go +++ b/pkg/collector/corechecks/cluster/orchestrator/processors/processor.go @@ -129,6 +129,9 @@ type Handlers interface { // ResourceVersion returns the resource Version. ResourceVersion(ctx ProcessorContext, resource, resourceModel interface{}) string + // ResourceTaggerTags returns the resource tags. + ResourceTaggerTags(ctx ProcessorContext, resource interface{}) []string + // ScrubBeforeExtraction replaces sensitive information in the resource // before resource extraction. ScrubBeforeExtraction(ctx ProcessorContext, resource interface{}) @@ -231,6 +234,7 @@ func (p *Processor) Process(ctx ProcessorContext, list interface{}) (processResu Content: yaml, Version: "v1", ContentType: "json", + Tags: p.h.ResourceTaggerTags(ctx, resource), }) } diff --git a/pkg/collector/corechecks/containers/generic/filters.go b/pkg/collector/corechecks/containers/generic/filters.go index 788a88664bcb5..fbf0fb544e25a 100644 --- a/pkg/collector/corechecks/containers/generic/filters.go +++ b/pkg/collector/corechecks/containers/generic/filters.go @@ -56,7 +56,7 @@ func (f LegacyContainerFilter) IsExcluded(container *workloadmeta.Container) boo annotations = pod.Annotations } - return f.OldFilter.IsExcluded(annotations, container.Name, container.Image.Name, container.Labels[kubernetes.CriContainerNamespaceLabel]) + return f.OldFilter.IsExcluded(annotations, container.Name, container.Image.RawName, container.Labels[kubernetes.CriContainerNamespaceLabel]) } // RuntimeContainerFilter filters containers by runtime diff --git a/pkg/collector/corechecks/containers/kubelet/common/pod.go b/pkg/collector/corechecks/containers/kubelet/common/pod.go index f0689b2c852d1..da2706b143de5 100644 --- a/pkg/collector/corechecks/containers/kubelet/common/pod.go +++ b/pkg/collector/corechecks/containers/kubelet/common/pod.go @@ -190,7 +190,7 @@ func GetContainerID(store workloadmeta.Component, metric model.Metric, filter *c return "", ErrContainerNotFound } - if filter.IsExcluded(pod.EntityMeta.Annotations, container.Name, container.Image.Name, pod.Namespace) { + if filter.IsExcluded(pod.EntityMeta.Annotations, container.Name, container.Image.RawName, pod.Namespace) { return "", ErrContainerExcluded } diff --git a/pkg/collector/corechecks/ebpf/ebpf.go b/pkg/collector/corechecks/ebpf/ebpf.go index 934cb5bab4f12..1638f60cef9d4 100644 --- a/pkg/collector/corechecks/ebpf/ebpf.go +++ b/pkg/collector/corechecks/ebpf/ebpf.go @@ -13,7 +13,6 @@ import ( "net/http" "strings" - "github.com/cihub/seelog" "gopkg.in/yaml.v2" sysprobeclient "github.com/DataDog/datadog-agent/cmd/system-probe/api/client" @@ -152,7 +151,7 @@ func (m *EBPFCheck) Run() error { "module:" + progInfo.Module, } var debuglogs []string - if log.ShouldLog(seelog.TraceLvl) { + if log.ShouldLog(log.TraceLvl) { debuglogs = []string{"program=" + progInfo.Name, "type=" + progInfo.Type.String()} } @@ -166,7 +165,7 @@ func (m *EBPFCheck) Run() error { continue } sender.Gauge("ebpf.programs."+k, v, "", tags) - if log.ShouldLog(seelog.TraceLvl) { + if log.ShouldLog(log.TraceLvl) { debuglogs = append(debuglogs, fmt.Sprintf("%s=%.0f", k, v)) } } @@ -184,12 +183,12 @@ func (m *EBPFCheck) Run() error { continue } sender.MonotonicCountWithFlushFirstValue("ebpf.programs."+k, v, "", tags, true) - if log.ShouldLog(seelog.TraceLvl) { + if log.ShouldLog(log.TraceLvl) { debuglogs = append(debuglogs, fmt.Sprintf("%s=%.0f", k, v)) } } - if log.ShouldLog(seelog.TraceLvl) { + if log.ShouldLog(log.TraceLvl) { log.Tracef("ebpf check: %s", strings.Join(debuglogs, " ")) } } diff --git a/pkg/collector/corechecks/ebpf/probe/ebpfcheck/probe.go b/pkg/collector/corechecks/ebpf/probe/ebpfcheck/probe.go index a25d5d49db2da..d09baa968c0a5 100644 --- a/pkg/collector/corechecks/ebpf/probe/ebpfcheck/probe.go +++ b/pkg/collector/corechecks/ebpf/probe/ebpfcheck/probe.go @@ -20,7 +20,6 @@ import ( "unsafe" manager "github.com/DataDog/ebpf-manager" - "github.com/cihub/seelog" "github.com/cilium/ebpf" "github.com/cilium/ebpf/asm" "github.com/cilium/ebpf/features" @@ -318,7 +317,7 @@ func (k *Probe) getProgramStats(stats *model.EBPFStats) error { stats.Programs = append(stats.Programs, ps) } - if log.ShouldLog(seelog.TraceLvl) { + if log.ShouldLog(log.TraceLvl) { log.Tracef("found %d programs", len(stats.Programs)) for _, ps := range stats.Programs { log.Tracef("name=%s prog_id=%d type=%s", ps.Name, ps.ID, ps.Type.String()) diff --git a/pkg/collector/corechecks/ebpf/probe/oomkill/oom_kill.go b/pkg/collector/corechecks/ebpf/probe/oomkill/oom_kill.go index e277b3f48381b..db83de192f457 100644 --- a/pkg/collector/corechecks/ebpf/probe/oomkill/oom_kill.go +++ b/pkg/collector/corechecks/ebpf/probe/oomkill/oom_kill.go @@ -13,8 +13,6 @@ package oomkill import ( "fmt" - "math" - "golang.org/x/sys/unix" manager "github.com/DataDog/ebpf-manager" @@ -104,10 +102,7 @@ func startOOMKillProbe(buf bytecode.AssetReader, managerOptions manager.Options) }, } - managerOptions.RLimit = &unix.Rlimit{ - Cur: math.MaxUint64, - Max: math.MaxUint64, - } + managerOptions.RemoveRlimit = true if err := m.InitWithOptions(buf, managerOptions); err != nil { return nil, fmt.Errorf("failed to init manager: %w", err) diff --git a/pkg/collector/corechecks/ebpf/probe/tcpqueuelength/tcp_queue_length.go b/pkg/collector/corechecks/ebpf/probe/tcpqueuelength/tcp_queue_length.go index 1e40a292aee03..34167ffb415dd 100644 --- a/pkg/collector/corechecks/ebpf/probe/tcpqueuelength/tcp_queue_length.go +++ b/pkg/collector/corechecks/ebpf/probe/tcpqueuelength/tcp_queue_length.go @@ -13,8 +13,6 @@ package tcpqueuelength import ( "fmt" - "math" - "golang.org/x/sys/unix" manager "github.com/DataDog/ebpf-manager" @@ -75,10 +73,7 @@ func startTCPQueueLengthProbe(buf bytecode.AssetReader, managerOptions manager.O Maps: maps, } - managerOptions.RLimit = &unix.Rlimit{ - Cur: math.MaxUint64, - Max: math.MaxUint64, - } + managerOptions.RemoveRlimit = true if err := m.InitWithOptions(buf, managerOptions); err != nil { return nil, fmt.Errorf("failed to init manager: %w", err) diff --git a/pkg/collector/corechecks/embed/apm/apm.go b/pkg/collector/corechecks/embed/apm/apm.go index 28162165eee6d..b724e77720b63 100644 --- a/pkg/collector/corechecks/embed/apm/apm.go +++ b/pkg/collector/corechecks/embed/apm/apm.go @@ -3,7 +3,7 @@ // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2016-present Datadog, Inc. -//go:build apm && !windows && !linux +//go:build darwin // Package apm contains the APM check package apm diff --git a/pkg/collector/corechecks/embed/apm/apm_nix.go b/pkg/collector/corechecks/embed/apm/apm_nix.go index a024e45a11844..3dd1535ce8432 100644 --- a/pkg/collector/corechecks/embed/apm/apm_nix.go +++ b/pkg/collector/corechecks/embed/apm/apm_nix.go @@ -3,9 +3,7 @@ // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2016-present Datadog, Inc. -//go:build apm && !windows && !linux - -// linux handled by systemd/upstart +//go:build darwin package apm diff --git a/pkg/collector/corechecks/embed/apm/stub.go b/pkg/collector/corechecks/embed/apm/stub.go index b4c5ea584872b..5ed387c9a2d8f 100644 --- a/pkg/collector/corechecks/embed/apm/stub.go +++ b/pkg/collector/corechecks/embed/apm/stub.go @@ -3,7 +3,7 @@ // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2016-present Datadog, Inc. -//go:build !apm || windows || linux +//go:build !darwin // Package apm provides a stub for the APM check package apm diff --git a/pkg/collector/corechecks/embed/process/process_agent.go b/pkg/collector/corechecks/embed/process/process_agent.go index c27d5a4b8f975..0c4f971467a9e 100644 --- a/pkg/collector/corechecks/embed/process/process_agent.go +++ b/pkg/collector/corechecks/embed/process/process_agent.go @@ -3,7 +3,7 @@ // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2016-present Datadog, Inc. -//go:build process && (darwin || freebsd) +//go:build darwin //nolint:revive // TODO(PLINT) Fix revive linter package process diff --git a/pkg/collector/corechecks/embed/process/stub.go b/pkg/collector/corechecks/embed/process/stub.go index 1faeaac1b12a6..2279f0ea3c370 100644 --- a/pkg/collector/corechecks/embed/process/stub.go +++ b/pkg/collector/corechecks/embed/process/stub.go @@ -3,7 +3,7 @@ // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2016-present Datadog, Inc. -//go:build !process || (!darwin && !freebsd) +//go:build !darwin //nolint:revive // TODO(Process) Fix revive linter package process diff --git a/pkg/collector/corechecks/net/network/network.go b/pkg/collector/corechecks/net/network/network.go index c3505185203aa..d4a1e5cd6ebe7 100644 --- a/pkg/collector/corechecks/net/network/network.go +++ b/pkg/collector/corechecks/net/network/network.go @@ -17,7 +17,7 @@ import ( "strconv" "strings" - "github.com/shirou/gopsutil/v3/net" + "github.com/shirou/gopsutil/v4/net" yaml "gopkg.in/yaml.v2" "github.com/DataDog/datadog-agent/comp/core/autodiscovery/integration" diff --git a/pkg/collector/corechecks/net/network/network_test.go b/pkg/collector/corechecks/net/network/network_test.go index b2476ca3d734c..4a033f97dbe86 100644 --- a/pkg/collector/corechecks/net/network/network_test.go +++ b/pkg/collector/corechecks/net/network/network_test.go @@ -10,7 +10,7 @@ package network import ( "testing" - "github.com/shirou/gopsutil/v3/net" + "github.com/shirou/gopsutil/v4/net" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" diff --git a/pkg/collector/corechecks/oracle/oracle.go b/pkg/collector/corechecks/oracle/oracle.go index a36830ceb39bb..224555ba85bd6 100644 --- a/pkg/collector/corechecks/oracle/oracle.go +++ b/pkg/collector/corechecks/oracle/oracle.go @@ -137,7 +137,7 @@ func handleServiceCheck(c *Check, err error) { status = servicecheck.ServiceCheckCritical log.Errorf("%s failed to connect: %s", c.logPrompt, err) } - sender.ServiceCheck("oracle.can_connect", status, "", c.tags, message) + sendServiceCheck(c, "oracle.can_connect", status, message) sender.Commit() } diff --git a/pkg/collector/corechecks/oracle/oracle_integration_test.go b/pkg/collector/corechecks/oracle/oracle_integration_test.go index c0df585ca2065..0d37c3d66ec50 100644 --- a/pkg/collector/corechecks/oracle/oracle_integration_test.go +++ b/pkg/collector/corechecks/oracle/oracle_integration_test.go @@ -424,6 +424,14 @@ func buildConnectionString(connectionConfig config.ConnectionConfig) string { return connStr } +func TestCanConnectTags(t *testing.T) { + chk, sender := newDefaultCheck(t, "", "") + err := chk.Run() + require.NoError(t, err) + + sender.AssertServiceCheck(t, "oracle.can_connect", servicecheck.ServiceCheckOK, chk.dbHostname, nil, "") +} + func TestLargeUint64Binding(t *testing.T) { var err error c, _ := newDefaultCheck(t, "", "") diff --git a/pkg/collector/corechecks/servicediscovery/events.go b/pkg/collector/corechecks/servicediscovery/events.go index fba57253ad552..f1d040dacefcb 100644 --- a/pkg/collector/corechecks/servicediscovery/events.go +++ b/pkg/collector/corechecks/servicediscovery/events.go @@ -30,6 +30,8 @@ type eventPayload struct { ServiceName string `json:"service_name"` GeneratedServiceName string `json:"generated_service_name"` GeneratedServiceNameSource string `json:"generated_service_name_source,omitempty"` + ContainerServiceName string `json:"container_service_name,omitempty"` + ContainerServiceNameSource string `json:"container_service_name_source,omitempty"` DDService string `json:"dd_service,omitempty"` HostName string `json:"host_name"` Env string `json:"env"` @@ -79,6 +81,8 @@ func (ts *telemetrySender) newEvent(t eventType, svc serviceInfo) *event { ServiceName: svc.meta.Name, GeneratedServiceName: svc.service.GeneratedName, GeneratedServiceNameSource: svc.service.GeneratedNameSource, + ContainerServiceName: svc.service.ContainerServiceName, + ContainerServiceNameSource: svc.service.ContainerServiceNameSource, DDService: svc.service.DDService, HostName: host, Env: env, diff --git a/pkg/collector/corechecks/servicediscovery/events_test.go b/pkg/collector/corechecks/servicediscovery/events_test.go index f8b7fc92bcfb3..b38dc5ddf084f 100644 --- a/pkg/collector/corechecks/servicediscovery/events_test.go +++ b/pkg/collector/corechecks/servicediscovery/events_test.go @@ -56,17 +56,19 @@ func Test_telemetrySender(t *testing.T) { svc := serviceInfo{ service: model.Service{ - PID: 99, - CommandLine: []string{"test-service", "--args"}, - Ports: []uint16{80, 8080}, - StartTimeMilli: uint64(now.Add(-20 * time.Minute).UnixMilli()), - RSS: 500 * 1024 * 1024, - GeneratedName: "generated-name", - GeneratedNameSource: "generated-name-source", - DDService: "dd-service", - DDServiceInjected: true, - CPUCores: 1.5, - ContainerID: "abcd", + PID: 99, + CommandLine: []string{"test-service", "--args"}, + Ports: []uint16{80, 8080}, + StartTimeMilli: uint64(now.Add(-20 * time.Minute).UnixMilli()), + RSS: 500 * 1024 * 1024, + GeneratedName: "generated-name", + GeneratedNameSource: "generated-name-source", + ContainerServiceName: "container-service-name", + ContainerServiceNameSource: "service", + DDService: "dd-service", + DDServiceInjected: true, + CPUCores: 1.5, + ContainerID: "abcd", }, meta: ServiceMetadata{ Name: "test-service", @@ -90,6 +92,8 @@ func Test_telemetrySender(t *testing.T) { ServiceName: "test-service", GeneratedServiceName: "generated-name", GeneratedServiceNameSource: "generated-name-source", + ContainerServiceName: "container-service-name", + ContainerServiceNameSource: "service", DDService: "dd-service", ServiceNameSource: "injected", HostName: "test-host", @@ -116,6 +120,8 @@ func Test_telemetrySender(t *testing.T) { ServiceName: "test-service", GeneratedServiceName: "generated-name", GeneratedServiceNameSource: "generated-name-source", + ContainerServiceName: "container-service-name", + ContainerServiceNameSource: "service", DDService: "dd-service", ServiceNameSource: "injected", HostName: "test-host", @@ -142,6 +148,8 @@ func Test_telemetrySender(t *testing.T) { ServiceName: "test-service", GeneratedServiceName: "generated-name", GeneratedServiceNameSource: "generated-name-source", + ContainerServiceName: "container-service-name", + ContainerServiceNameSource: "service", DDService: "dd-service", ServiceNameSource: "injected", HostName: "test-host", @@ -188,13 +196,15 @@ func Test_telemetrySender_name_provided(t *testing.T) { svc := serviceInfo{ service: model.Service{ - PID: 55, - CommandLine: []string{"foo", "--option"}, - StartTimeMilli: uint64(now.Add(-20 * time.Minute).UnixMilli()), - GeneratedName: "generated-name2", - GeneratedNameSource: "generated-name-source2", - DDService: "dd-service-provided", - ContainerID: "abcd", + PID: 55, + CommandLine: []string{"foo", "--option"}, + StartTimeMilli: uint64(now.Add(-20 * time.Minute).UnixMilli()), + GeneratedName: "generated-name2", + GeneratedNameSource: "generated-name-source2", + ContainerServiceName: "container-service-name2", + ContainerServiceNameSource: "service", + DDService: "dd-service-provided", + ContainerID: "abcd", }, meta: ServiceMetadata{ Name: "test-service", @@ -218,6 +228,8 @@ func Test_telemetrySender_name_provided(t *testing.T) { ServiceName: "test-service", GeneratedServiceName: "generated-name2", GeneratedServiceNameSource: "generated-name-source2", + ContainerServiceName: "container-service-name2", + ContainerServiceNameSource: "service", DDService: "dd-service-provided", ServiceNameSource: "provided", HostName: "test-host", @@ -241,6 +253,8 @@ func Test_telemetrySender_name_provided(t *testing.T) { ServiceName: "test-service", GeneratedServiceName: "generated-name2", GeneratedServiceNameSource: "generated-name-source2", + ContainerServiceName: "container-service-name2", + ContainerServiceNameSource: "service", DDService: "dd-service-provided", ServiceNameSource: "provided", HostName: "test-host", @@ -264,6 +278,8 @@ func Test_telemetrySender_name_provided(t *testing.T) { ServiceName: "test-service", GeneratedServiceName: "generated-name2", GeneratedServiceNameSource: "generated-name-source2", + ContainerServiceName: "container-service-name2", + ContainerServiceNameSource: "service", DDService: "dd-service-provided", ServiceNameSource: "provided", HostName: "test-host", diff --git a/pkg/collector/corechecks/servicediscovery/impl_linux.go b/pkg/collector/corechecks/servicediscovery/impl_linux.go index 617b740990922..2f0b3df61d63f 100644 --- a/pkg/collector/corechecks/servicediscovery/impl_linux.go +++ b/pkg/collector/corechecks/servicediscovery/impl_linux.go @@ -128,6 +128,8 @@ func (li *linuxImpl) DiscoverServices() (*discoveredServices, error) { svc.service.CPUCores = service.CPUCores svc.service.ContainerID = service.ContainerID svc.service.GeneratedName = service.GeneratedName + svc.service.ContainerServiceName = service.ContainerServiceName + svc.service.ContainerServiceNameSource = service.ContainerServiceNameSource svc.service.Name = service.Name svc.meta.Name = service.Name events.heartbeat = append(events.heartbeat, *svc) @@ -167,6 +169,8 @@ func (li *linuxImpl) handlePotentialServices(events *serviceEvents, now time.Tim svc.service.CPUCores = service.CPUCores svc.service.ContainerID = service.ContainerID svc.service.GeneratedName = service.GeneratedName + svc.service.ContainerServiceName = service.ContainerServiceName + svc.service.ContainerServiceNameSource = service.ContainerServiceNameSource svc.service.Name = service.Name svc.meta.Name = service.Name diff --git a/pkg/collector/corechecks/servicediscovery/impl_linux_test.go b/pkg/collector/corechecks/servicediscovery/impl_linux_test.go index e6da859352596..ba5e0e5a1caad 100644 --- a/pkg/collector/corechecks/servicediscovery/impl_linux_test.go +++ b/pkg/collector/corechecks/servicediscovery/impl_linux_test.go @@ -71,47 +71,53 @@ var ( var ( portTCP8080 = model.Service{ - PID: procTestService1.pid, - Name: "test-service-1", - GeneratedName: "test-service-1-generated", - GeneratedNameSource: "test-service-1-generated-source", - DDService: "test-service-1", - DDServiceInjected: true, - Ports: []uint16{8080}, - APMInstrumentation: string(apm.None), - RSS: 100 * 1024 * 1024, - CPUCores: 1.5, - CommandLine: []string{"test-service-1"}, - StartTimeMilli: procLaunchedMilli, - ContainerID: dummyContainerID, + PID: procTestService1.pid, + Name: "test-service-1", + GeneratedName: "test-service-1-generated", + GeneratedNameSource: "test-service-1-generated-source", + ContainerServiceName: "test-service-1-container", + ContainerServiceNameSource: "service", + DDService: "test-service-1", + DDServiceInjected: true, + Ports: []uint16{8080}, + APMInstrumentation: string(apm.None), + RSS: 100 * 1024 * 1024, + CPUCores: 1.5, + CommandLine: []string{"test-service-1"}, + StartTimeMilli: procLaunchedMilli, + ContainerID: dummyContainerID, } portTCP8080UpdatedRSS = model.Service{ - PID: procTestService1.pid, - Name: "test-service-1", - GeneratedName: "test-service-1-generated", - GeneratedNameSource: "test-service-1-generated-source", - DDService: "test-service-1", - DDServiceInjected: true, - Ports: []uint16{8080}, - APMInstrumentation: string(apm.None), - RSS: 200 * 1024 * 1024, - CPUCores: 1.5, - CommandLine: []string{"test-service-1"}, - StartTimeMilli: procLaunchedMilli, - ContainerID: dummyContainerID, + PID: procTestService1.pid, + Name: "test-service-1", + GeneratedName: "test-service-1-generated", + GeneratedNameSource: "test-service-1-generated-source", + ContainerServiceName: "test-service-1-container", + ContainerServiceNameSource: "service", + DDService: "test-service-1", + DDServiceInjected: true, + Ports: []uint16{8080}, + APMInstrumentation: string(apm.None), + RSS: 200 * 1024 * 1024, + CPUCores: 1.5, + CommandLine: []string{"test-service-1"}, + StartTimeMilli: procLaunchedMilli, + ContainerID: dummyContainerID, } portTCP8080DifferentPID = model.Service{ - PID: procTestService1DifferentPID.pid, - Name: "test-service-1", - GeneratedName: "test-service-1-generated", - GeneratedNameSource: "test-service-1-generated-source", - DDService: "test-service-1", - DDServiceInjected: true, - Ports: []uint16{8080}, - APMInstrumentation: string(apm.Injected), - CommandLine: []string{"test-service-1"}, - StartTimeMilli: procLaunchedMilli, - ContainerID: dummyContainerID, + PID: procTestService1DifferentPID.pid, + Name: "test-service-1", + GeneratedName: "test-service-1-generated", + GeneratedNameSource: "test-service-1-generated-source", + ContainerServiceName: "test-service-1-container", + ContainerServiceNameSource: "service", + DDService: "test-service-1", + DDServiceInjected: true, + Ports: []uint16{8080}, + APMInstrumentation: string(apm.Injected), + CommandLine: []string{"test-service-1"}, + StartTimeMilli: procLaunchedMilli, + ContainerID: dummyContainerID, } portTCP8081 = model.Service{ PID: procIgnoreService1.pid, @@ -122,25 +128,29 @@ var ( ContainerID: dummyContainerID, } portTCP5000 = model.Service{ - PID: procPythonService.pid, - Name: "python-service", - GeneratedName: "python-service", - GeneratedNameSource: "python-service-source", - Language: "python", - Ports: []uint16{5000}, - CommandLine: pythonCommandLine, - StartTimeMilli: procLaunchedMilli, - ContainerID: dummyContainerID, + PID: procPythonService.pid, + Name: "python-service", + GeneratedName: "python-service", + GeneratedNameSource: "python-service-source", + ContainerServiceName: "test-service-1-container", + ContainerServiceNameSource: "app", + Language: "python", + Ports: []uint16{5000}, + CommandLine: pythonCommandLine, + StartTimeMilli: procLaunchedMilli, + ContainerID: dummyContainerID, } portTCP5432 = model.Service{ - PID: procTestService1Repeat.pid, - Name: "test-service-1", - GeneratedName: "test-service-1", - GeneratedNameSource: "test-service-1-generated-source", - Ports: []uint16{5432}, - CommandLine: []string{"test-service-1"}, - StartTimeMilli: procLaunchedMilli, - ContainerID: dummyContainerID, + PID: procTestService1Repeat.pid, + Name: "test-service-1", + GeneratedName: "test-service-1", + GeneratedNameSource: "test-service-1-generated-source", + ContainerServiceName: "test-service-1-container", + ContainerServiceNameSource: "service", + Ports: []uint16{5432}, + CommandLine: []string{"test-service-1"}, + StartTimeMilli: procLaunchedMilli, + ContainerID: dummyContainerID, } ) @@ -235,6 +245,8 @@ func Test_linuxImpl(t *testing.T) { ServiceName: "test-service-1", GeneratedServiceName: "test-service-1-generated", GeneratedServiceNameSource: "test-service-1-generated-source", + ContainerServiceName: "test-service-1-container", + ContainerServiceNameSource: "service", DDService: "test-service-1", ServiceNameSource: "injected", ServiceType: "web_service", @@ -260,6 +272,8 @@ func Test_linuxImpl(t *testing.T) { ServiceName: "test-service-1", GeneratedServiceName: "test-service-1-generated", GeneratedServiceNameSource: "test-service-1-generated-source", + ContainerServiceName: "test-service-1-container", + ContainerServiceNameSource: "service", DDService: "test-service-1", ServiceNameSource: "injected", ServiceType: "web_service", @@ -285,6 +299,8 @@ func Test_linuxImpl(t *testing.T) { ServiceName: "test-service-1", GeneratedServiceName: "test-service-1-generated", GeneratedServiceNameSource: "test-service-1-generated-source", + ContainerServiceName: "test-service-1-container", + ContainerServiceNameSource: "service", DDService: "test-service-1", ServiceNameSource: "injected", ServiceType: "web_service", @@ -310,6 +326,8 @@ func Test_linuxImpl(t *testing.T) { ServiceName: "python-service", GeneratedServiceName: "python-service", GeneratedServiceNameSource: "python-service-source", + ContainerServiceName: "test-service-1-container", + ContainerServiceNameSource: "app", ServiceType: "web_service", HostName: host, Env: "", @@ -331,6 +349,8 @@ func Test_linuxImpl(t *testing.T) { ServiceName: "python-service", GeneratedServiceName: "python-service", GeneratedServiceNameSource: "python-service-source", + ContainerServiceName: "test-service-1-container", + ContainerServiceNameSource: "app", ServiceType: "web_service", HostName: host, Env: "", @@ -389,6 +409,8 @@ func Test_linuxImpl(t *testing.T) { ServiceName: "test-service-1", GeneratedServiceName: "test-service-1", GeneratedServiceNameSource: "test-service-1-generated-source", + ContainerServiceName: "test-service-1-container", + ContainerServiceNameSource: "service", ServiceType: "db", HostName: host, Env: "", @@ -409,6 +431,8 @@ func Test_linuxImpl(t *testing.T) { ServiceName: "test-service-1", GeneratedServiceName: "test-service-1-generated", GeneratedServiceNameSource: "test-service-1-generated-source", + ContainerServiceName: "test-service-1-container", + ContainerServiceNameSource: "service", DDService: "test-service-1", ServiceNameSource: "injected", ServiceType: "web_service", @@ -434,6 +458,8 @@ func Test_linuxImpl(t *testing.T) { ServiceName: "test-service-1", GeneratedServiceName: "test-service-1", GeneratedServiceNameSource: "test-service-1-generated-source", + ContainerServiceName: "test-service-1-container", + ContainerServiceNameSource: "service", ServiceType: "db", HostName: host, Env: "", @@ -454,6 +480,8 @@ func Test_linuxImpl(t *testing.T) { ServiceName: "test-service-1", GeneratedServiceName: "test-service-1", GeneratedServiceNameSource: "test-service-1-generated-source", + ContainerServiceName: "test-service-1-container", + ContainerServiceNameSource: "service", ServiceType: "db", HostName: host, Env: "", @@ -474,6 +502,8 @@ func Test_linuxImpl(t *testing.T) { ServiceName: "test-service-1", GeneratedServiceName: "test-service-1-generated", GeneratedServiceNameSource: "test-service-1-generated-source", + ContainerServiceName: "test-service-1-container", + ContainerServiceNameSource: "service", DDService: "test-service-1", ServiceNameSource: "injected", ServiceType: "web_service", @@ -534,6 +564,8 @@ func Test_linuxImpl(t *testing.T) { ServiceName: "test-service-1", GeneratedServiceName: "test-service-1-generated", GeneratedServiceNameSource: "test-service-1-generated-source", + ContainerServiceName: "test-service-1-container", + ContainerServiceNameSource: "service", DDService: "test-service-1", ServiceNameSource: "injected", ServiceType: "web_service", @@ -559,6 +591,8 @@ func Test_linuxImpl(t *testing.T) { ServiceName: "test-service-1", GeneratedServiceName: "test-service-1-generated", GeneratedServiceNameSource: "test-service-1-generated-source", + ContainerServiceName: "test-service-1-container", + ContainerServiceNameSource: "service", DDService: "test-service-1", ServiceNameSource: "injected", ServiceType: "web_service", diff --git a/pkg/collector/corechecks/servicediscovery/model/model.go b/pkg/collector/corechecks/servicediscovery/model/model.go index ccaa3fc2a961c..9a99681fe6cfc 100644 --- a/pkg/collector/corechecks/servicediscovery/model/model.go +++ b/pkg/collector/corechecks/servicediscovery/model/model.go @@ -8,21 +8,23 @@ package model // Service represents a listening process. type Service struct { - PID int `json:"pid"` - Name string `json:"name"` - GeneratedName string `json:"generated_name"` - GeneratedNameSource string `json:"generated_name_source"` - DDService string `json:"dd_service"` - DDServiceInjected bool `json:"dd_service_injected"` - CheckedContainerData bool `json:"checked_container_data"` - Ports []uint16 `json:"ports"` - APMInstrumentation string `json:"apm_instrumentation"` - Language string `json:"language"` - RSS uint64 `json:"rss"` - CommandLine []string `json:"cmdline"` - StartTimeMilli uint64 `json:"start_time"` - CPUCores float64 `json:"cpu_cores"` - ContainerID string `json:"container_id"` + PID int `json:"pid"` + Name string `json:"name"` + GeneratedName string `json:"generated_name"` + GeneratedNameSource string `json:"generated_name_source"` + ContainerServiceName string `json:"container_service_name"` + ContainerServiceNameSource string `json:"container_service_name_source"` + DDService string `json:"dd_service"` + DDServiceInjected bool `json:"dd_service_injected"` + CheckedContainerData bool `json:"checked_container_data"` + Ports []uint16 `json:"ports"` + APMInstrumentation string `json:"apm_instrumentation"` + Language string `json:"language"` + RSS uint64 `json:"rss"` + CommandLine []string `json:"cmdline"` + StartTimeMilli uint64 `json:"start_time"` + CPUCores float64 `json:"cpu_cores"` + ContainerID string `json:"container_id"` } // ServicesResponse is the response for the system-probe /discovery/services endpoint. diff --git a/pkg/collector/corechecks/servicediscovery/module/comm.go b/pkg/collector/corechecks/servicediscovery/module/comm.go index 7b513080aef18..675eac0d2f246 100644 --- a/pkg/collector/corechecks/servicediscovery/module/comm.go +++ b/pkg/collector/corechecks/servicediscovery/module/comm.go @@ -13,8 +13,6 @@ import ( "strconv" "strings" - "github.com/shirou/gopsutil/v3/process" - "github.com/DataDog/datadog-agent/pkg/util/kernel" ddsync "github.com/DataDog/datadog-agent/pkg/util/sync" ) @@ -41,11 +39,11 @@ var ( ) // shouldIgnoreComm returns true if process should be ignored -func (s *discovery) shouldIgnoreComm(proc *process.Process) bool { +func (s *discovery) shouldIgnoreComm(pid int32) bool { if s.config.ignoreComms == nil { return false } - commPath := kernel.HostProc(strconv.Itoa(int(proc.Pid)), "comm") + commPath := kernel.HostProc(strconv.Itoa(int(pid)), "comm") file, err := os.Open(commPath) if err != nil { return true diff --git a/pkg/collector/corechecks/servicediscovery/module/comm_test.go b/pkg/collector/corechecks/servicediscovery/module/comm_test.go index 1bc296913ecf3..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" @@ -137,16 +137,10 @@ func TestShouldIgnoreComm(t *testing.T) { _ = cmd.Process.Kill() }) - var proc *process.Process require.EventuallyWithT(t, func(collect *assert.CollectT) { - proc, err = customNewProcess(int32(cmd.Process.Pid)) - assert.NoError(collect, err) - }, 2*time.Second, 100*time.Millisecond) - - require.EventuallyWithT(t, func(collect *assert.CollectT) { - ignore := discovery.shouldIgnoreComm(proc) + ignore := discovery.shouldIgnoreComm(int32(cmd.Process.Pid)) assert.Equal(collect, test.ignore, ignore) - }, 500*time.Millisecond, 100*time.Millisecond) + }, 2*time.Second, 100*time.Millisecond) }) } } @@ -193,9 +187,8 @@ func BenchmarkProcName(b *testing.B) { for i := 0; i < b.N; i++ { // create a new process on each iteration to eliminate name caching from the calculation - proc, err := customNewProcess(int32(cmd.Process.Pid)) - if err != nil { - b.Fatal(err) + proc := &process.Process{ + Pid: int32(cmd.Process.Pid), } comm, err := proc.Name() if err != nil { @@ -216,11 +209,7 @@ func BenchmarkShouldIgnoreComm(b *testing.B) { b.ReportAllocs() for i := 0; i < b.N; i++ { - proc, err := customNewProcess(int32(cmd.Process.Pid)) - if err != nil { - b.Fatal(err) - } - ok := discovery.shouldIgnoreComm(proc) + ok := discovery.shouldIgnoreComm(int32(cmd.Process.Pid)) if ok { b.Fatalf("process should not have been ignored") } 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 31cb3c8816fe7..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" @@ -151,15 +151,12 @@ func TestTargetEnvs(t *testing.T) { // BenchmarkGetEnvs benchmarks reading of all environment variables from /proc//environ. func BenchmarkGetEnvs(b *testing.B) { - proc, err := customNewProcess(int32(os.Getpid())) - if err != nil { - return - } + proc := &process.Process{Pid: int32(os.Getpid())} + b.ResetTimer() b.ReportAllocs() for i := 0; i < b.N; i++ { - _, err = getEnvs(proc) - if err != nil { + if _, err := getEnvs(proc); err != nil { return } } @@ -167,16 +164,12 @@ func BenchmarkGetEnvs(b *testing.B) { // BenchmarkGetEnvsTarget benchmarks reading of target environment variables only from /proc//environ. func BenchmarkGetEnvsTarget(b *testing.B) { - proc, err := customNewProcess(int32(os.Getpid())) - if err != nil { - return - } + proc := &process.Process{Pid: int32(os.Getpid())} b.ResetTimer() b.ReportAllocs() for i := 0; i < b.N; i++ { - _, err = getTargetEnvs(proc) - if err != nil { + if _, err := getTargetEnvs(proc); err != nil { return } } diff --git a/pkg/collector/corechecks/servicediscovery/module/ignore_proc_test.go b/pkg/collector/corechecks/servicediscovery/module/ignore_proc_test.go index 90d0dc9d8dcb3..317455f84fbbe 100644 --- a/pkg/collector/corechecks/servicediscovery/module/ignore_proc_test.go +++ b/pkg/collector/corechecks/servicediscovery/module/ignore_proc_test.go @@ -69,12 +69,9 @@ func TestShouldIgnorePid(t *testing.T) { discovery := newDiscovery(nil) require.NotEmpty(t, discovery) - proc, err := customNewProcess(int32(cmd.Process.Pid)) - require.NoError(t, err) - require.EventuallyWithT(t, func(collect *assert.CollectT) { // wait until the service name becomes available - info, err := discovery.getServiceInfo(proc) + info, err := discovery.getServiceInfo(int32(cmd.Process.Pid)) assert.NoError(collect, err) assert.Equal(collect, test.service, info.ddServiceName) }, 3*time.Second, 100*time.Millisecond) @@ -92,7 +89,7 @@ func TestShouldIgnorePid(t *testing.T) { } // check saved pid to ignore - ignore := discovery.shouldIgnorePid(proc.Pid) + ignore := discovery.shouldIgnorePid(int32(cmd.Process.Pid)) require.Equal(t, test.ignore, ignore) }) } diff --git a/pkg/collector/corechecks/servicediscovery/module/impl_linux.go b/pkg/collector/corechecks/servicediscovery/module/impl_linux.go index 8c2b276d8f56b..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" @@ -51,6 +51,7 @@ var _ module.Module = &discovery{} type serviceInfo struct { generatedName string generatedNameSource string + containerServiceName string ddServiceName string ddServiceInjected bool checkedContainerData bool @@ -383,7 +384,11 @@ func (s *discovery) cleanIgnoredPids(alivePids map[int32]struct{}) { // getServiceInfo gets the service information for a process using the // servicedetector module. -func (s *discovery) getServiceInfo(proc *process.Process) (*serviceInfo, error) { +func (s *discovery) getServiceInfo(pid int32) (*serviceInfo, error) { + proc := &process.Process{ + Pid: pid, + } + cmdline, err := proc.CmdlineSlice() if err != nil { return nil, err @@ -432,39 +437,17 @@ func (s *discovery) getServiceInfo(proc *process.Process) (*serviceInfo, error) }, nil } -// customNewProcess is the same implementation as process.NewProcess but without calling CreateTimeWithContext, which -// is not needed and costly for the discovery module. -func customNewProcess(pid int32) (*process.Process, error) { - p := &process.Process{ - Pid: pid, - } - - exists, err := process.PidExists(pid) - if err != nil { - return p, err - } - if !exists { - return p, process.ErrorProcessNotRunning - } - return p, nil -} - // maxNumberOfPorts is the maximum number of listening ports which we report per // service. const maxNumberOfPorts = 50 // getService gets information for a single service. func (s *discovery) getService(context parsingContext, pid int32) *model.Service { - proc, err := customNewProcess(pid) - if err != nil { - return nil - } - - if s.shouldIgnorePid(proc.Pid) { + if s.shouldIgnorePid(pid) { return nil } - if s.shouldIgnoreComm(proc) { - s.addIgnoredPid(proc.Pid) + if s.shouldIgnoreComm(pid) { + s.addIgnoredPid(pid) return nil } @@ -523,7 +506,7 @@ func (s *discovery) getService(context parsingContext, pid int32) *model.Service ports = ports[:maxNumberOfPorts] } - rss, err := getRSS(proc) + rss, err := getRSS(pid) if err != nil { return nil } @@ -535,7 +518,7 @@ func (s *discovery) getService(context parsingContext, pid int32) *model.Service if ok { info = cached } else { - info, err = s.getServiceInfo(proc) + info, err = s.getServiceInfo(pid) if err != nil { return nil } @@ -550,7 +533,7 @@ func (s *discovery) getService(context parsingContext, pid int32) *model.Service name = info.generatedName } if s.shouldIgnoreService(name) { - s.addIgnoredPid(proc.Pid) + s.addIgnoredPid(pid) return nil } @@ -618,7 +601,7 @@ func (s *discovery) updateServicesCPUStats(services []model.Service) error { return nil } -func getServiceNameFromContainerTags(tags []string) string { +func getServiceNameFromContainerTags(tags []string) (string, string) { // The tags we look for service name generation, in their priority order. // The map entries will be filled as we go through the containers tags. tagsPriority := []struct { @@ -659,10 +642,10 @@ func getServiceNameFromContainerTags(tags []string) string { } log.Debugf("Using %v:%v tag for service name", tag.tagName, *tag.tagValue) - return *tag.tagValue + return tag.tagName, *tag.tagValue } - return "" + return "", "" } func (s *discovery) enrichContainerData(service *model.Service, containers map[string]*agentPayload.Container, pidToCid map[int]string) { @@ -673,7 +656,7 @@ func (s *discovery) enrichContainerData(service *model.Service, containers map[s service.ContainerID = id - // We got the service name from container tags before, no need to do it again. + // We checked the container tags before, no need to do it again. if service.CheckedContainerData { return } @@ -683,25 +666,15 @@ func (s *discovery) enrichContainerData(service *model.Service, containers map[s return } - serviceName := getServiceNameFromContainerTags(container.Tags) - - if serviceName != "" { - service.GeneratedName = serviceName - // Update the legacy name field as well - if service.DDService == "" { - service.Name = serviceName - } - service.GeneratedNameSource = string(usm.Container) - } + tagName, serviceName := getServiceNameFromContainerTags(container.Tags) + service.ContainerServiceName = serviceName + service.ContainerServiceNameSource = tagName service.CheckedContainerData = true s.mux.Lock() serviceInfo, ok := s.cache[int32(service.PID)] if ok { - if serviceName != "" { - serviceInfo.generatedName = serviceName - serviceInfo.generatedNameSource = string(usm.Container) - } + serviceInfo.containerServiceName = serviceName serviceInfo.checkedContainerData = true } s.mux.Unlock() diff --git a/pkg/collector/corechecks/servicediscovery/module/impl_linux_test.go b/pkg/collector/corechecks/servicediscovery/module/impl_linux_test.go index e584b9816c474..357409b59712c 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" @@ -288,13 +288,23 @@ func TestPorts(t *testing.T) { startUDP("udp4") startUDP("udp6") + expectedPortsMap := make(map[uint16]struct{}, len(expectedPorts)) + serviceMap := getServicesMap(t, url) pid := os.Getpid() require.Contains(t, serviceMap, pid) for _, port := range expectedPorts { + expectedPortsMap[port] = struct{}{} assert.Contains(t, serviceMap[pid].Ports, port) } for _, port := range unexpectedPorts { + // An unexpected port number can also be expected since UDP and TCP and + // v4 and v6 are all in the same list. Just skip the extra check in that + // case since it should be rare. + if _, alsoExpected := expectedPortsMap[port]; alsoExpected { + continue + } + assert.NotContains(t, serviceMap[pid].Ports, port) } } @@ -847,9 +857,11 @@ func TestDocker(t *testing.T) { require.Contains(t, portMap, pid1111) require.Contains(t, portMap[pid1111].Ports, uint16(1234)) require.Contains(t, portMap[pid1111].ContainerID, "dummyCID") - require.Contains(t, portMap[pid1111].Name, "foo_from_app_tag") - require.Contains(t, portMap[pid1111].GeneratedName, "foo_from_app_tag") - require.Contains(t, portMap[pid1111].GeneratedNameSource, string(usm.Container)) + require.Contains(t, portMap[pid1111].Name, "http.server") + require.Contains(t, portMap[pid1111].GeneratedName, "http.server") + require.Contains(t, portMap[pid1111].GeneratedNameSource, string(usm.CommandLine)) + require.Contains(t, portMap[pid1111].ContainerServiceName, "foo_from_app_tag") + require.Contains(t, portMap[pid1111].ContainerServiceNameSource, "app") } // Check that the cache is cleaned when procceses die. @@ -922,56 +934,67 @@ func TestTagsPriority(t *testing.T) { cases := []struct { name string tags []string + expectedTagName string expectedServiceName string }{ { "nil tag list", nil, "", + "", }, { "empty tag list", []string{}, "", + "", }, { "no useful tags", []string{"foo:bar"}, "", + "", }, { "malformed tag", []string{"foobar"}, "", + "", }, { "service tag", []string{"service:foo"}, + "service", "foo", }, { "app tag", []string{"app:foo"}, + "app", "foo", }, { "short_image tag", []string{"short_image:foo"}, + "short_image", "foo", }, { "kube_container_name tag", []string{"kube_container_name:foo"}, + "kube_container_name", "foo", }, { "kube_deployment tag", []string{"kube_deployment:foo"}, + "kube_deployment", "foo", }, { "kube_service tag", []string{"kube_service:foo"}, + "kube_service", "foo", }, { @@ -982,6 +1005,7 @@ func TestTagsPriority(t *testing.T) { "service:my_service", "malformed", }, + "service", "my_service", }, { @@ -990,6 +1014,7 @@ func TestTagsPriority(t *testing.T) { "service:", "app:foo", }, + "app", "foo", }, { @@ -1001,6 +1026,7 @@ func TestTagsPriority(t *testing.T) { "service:my_service", "malformed", }, + "service", "my_service", }, { @@ -1013,34 +1039,20 @@ func TestTagsPriority(t *testing.T) { "app:my_app", "service:my_service", }, + "service", "my_service", }, } for _, c := range cases { t.Run(c.name, func(t *testing.T) { - name := getServiceNameFromContainerTags(c.tags) + tagName, name := getServiceNameFromContainerTags(c.tags) require.Equalf(t, c.expectedServiceName, name, "got wrong service name from container tags") + require.Equalf(t, c.expectedTagName, tagName, "got wrong tag name for service naming") }) } } -func BenchmarkOldProcess(b *testing.B) { - b.ResetTimer() - b.ReportAllocs() - for i := 0; i < b.N; i++ { - process.NewProcess(int32(os.Getpid())) - } -} - -func BenchmarkNewProcess(b *testing.B) { - b.ResetTimer() - b.ReportAllocs() - for i := 0; i < b.N; i++ { - customNewProcess(int32(os.Getpid())) - } -} - func getSocketsOld(p *process.Process) ([]uint64, error) { FDs, err := p.OpenFiles() if err != nil { diff --git a/pkg/collector/corechecks/servicediscovery/module/stat.go b/pkg/collector/corechecks/servicediscovery/module/stat.go index ca894aaf0e727..9ea526f7f829d 100644 --- a/pkg/collector/corechecks/servicediscovery/module/stat.go +++ b/pkg/collector/corechecks/servicediscovery/module/stat.go @@ -16,8 +16,6 @@ import ( "strconv" "strings" - "github.com/shirou/gopsutil/v3/process" - "github.com/DataDog/datadog-agent/pkg/util/kernel" ) @@ -28,8 +26,8 @@ var pageSize = uint64(os.Getpagesize()) // getRSS returns the RSS for the process, in bytes. Compare MemoryInfo() in // gopsutil which does the same thing but which parses several other fields // which we're not interested in. -func getRSS(proc *process.Process) (uint64, error) { - statmPath := kernel.HostProc(strconv.Itoa(int(proc.Pid)), "statm") +func getRSS(pid int32) (uint64, error) { + statmPath := kernel.HostProc(strconv.Itoa(int(pid)), "statm") // This file is very small so just read it fully. contents, err := os.ReadFile(statmPath) diff --git a/pkg/collector/corechecks/servicediscovery/module/testutil/fake_server/.gitignore b/pkg/collector/corechecks/servicediscovery/module/testutil/fake_server/.gitignore index eaaf842eef4d4..6882d79c431d0 100644 --- a/pkg/collector/corechecks/servicediscovery/module/testutil/fake_server/.gitignore +++ b/pkg/collector/corechecks/servicediscovery/module/testutil/fake_server/.gitignore @@ -1,6 +1,2 @@ -fake_server -dotnet -python -java -node -sshd +* +! *.go 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/servicediscovery/usm/service.go b/pkg/collector/corechecks/servicediscovery/usm/service.go index 407b77179dfb7..89bfd3cfb6003 100644 --- a/pkg/collector/corechecks/servicediscovery/usm/service.go +++ b/pkg/collector/corechecks/servicediscovery/usm/service.go @@ -64,8 +64,6 @@ type ServiceNameSource string const ( // CommandLine indicates that the name comes from the command line CommandLine ServiceNameSource = "command-line" - // Container indicates the name comes from the container tags - Container ServiceNameSource = "container" // Laravel indicates that the name comes from the Laravel application name Laravel ServiceNameSource = "laravel" // Python indicates that the name comes from the Python package name 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/integration_topology_test.go b/pkg/collector/corechecks/snmp/integration_topology_test.go index b4f0f42ceb6d0..c9298738ccf56 100644 --- a/pkg/collector/corechecks/snmp/integration_topology_test.go +++ b/pkg/collector/corechecks/snmp/integration_topology_test.go @@ -661,6 +661,7 @@ profiles: { "id": "profile-metadata:1.2.3.4:101.1", "source_type": "lldp", + "integration": "snmp", "local": { "device": { "dd_id": "profile-metadata:1.2.3.4" @@ -689,6 +690,7 @@ profiles: { "id": "profile-metadata:1.2.3.4:102.2", "source_type": "lldp", + "integration": "snmp", "local": { "device": { "dd_id": "profile-metadata:1.2.3.4" @@ -1363,6 +1365,7 @@ profiles: { "id": "profile-metadata:1.2.3.4:1.5", "source_type": "cdp", + "integration": "snmp", "local": { "device": { "dd_id": "profile-metadata:1.2.3.4" @@ -1386,6 +1389,7 @@ profiles: { "id": "profile-metadata:1.2.3.4:2.3", "source_type": "cdp", + "integration": "snmp", "local": { "device": { "dd_id": "profile-metadata:1.2.3.4" @@ -2056,6 +2060,7 @@ profiles: { "id": "profile-metadata:1.2.3.4:101.1", "source_type": "lldp", + "integration": "snmp", "local": { "device": { "dd_id": "profile-metadata:1.2.3.4" @@ -2084,6 +2089,7 @@ profiles: { "id": "profile-metadata:1.2.3.4:102.2", "source_type": "lldp", + "integration": "snmp", "local": { "device": { "dd_id": "profile-metadata:1.2.3.4" diff --git a/pkg/collector/corechecks/snmp/internal/checkconfig/config.go b/pkg/collector/corechecks/snmp/internal/checkconfig/config.go index 1dc318f384825..688b2cd9350e2 100644 --- a/pkg/collector/corechecks/snmp/internal/checkconfig/config.go +++ b/pkg/collector/corechecks/snmp/internal/checkconfig/config.go @@ -17,7 +17,6 @@ import ( "strings" "time" - "github.com/cihub/seelog" "gopkg.in/yaml.v2" "github.com/DataDog/datadog-agent/comp/core/autodiscovery/integration" @@ -49,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" @@ -81,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 @@ -148,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"` @@ -185,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 @@ -201,9 +191,6 @@ type CheckConfig struct { AutodetectProfile bool MinCollectionInterval time.Duration - DetectMetricsEnabled bool - DetectMetricsRefreshInterval int - Network string DiscoveryWorkers int Workers int @@ -217,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) - } - log.Debugf("Refreshing with profile `%s`", profile) - tags := []string{"snmp_profile:" + profile} - definition := c.Profiles[profile].Definition - c.ProfileDef = &definition - c.Profile = profile - - if log.ShouldLog(seelog.DebugLvl) { - profileDefJSON, _ := json.Marshal(definition) - log.Debugf("Profile content `%s`: %s", profile, string(profileDefJSON)) +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`", profileName) + c.ProfileName = profileName - if definition.Device.Vendor != "" { - tags = append(tags, "device_vendor:"+definition.Device.Vendor) + if log.ShouldLog(log.DebugLvl) { + 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, @@ -260,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) } @@ -395,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 { @@ -520,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 @@ -553,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() @@ -689,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 @@ -704,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/configvalidation/config_validate_enrich.go b/pkg/collector/corechecks/snmp/internal/configvalidation/config_validate_enrich.go index 5268345d8744e..499b93287d9d1 100644 --- a/pkg/collector/corechecks/snmp/internal/configvalidation/config_validate_enrich.go +++ b/pkg/collector/corechecks/snmp/internal/configvalidation/config_validate_enrich.go @@ -10,8 +10,6 @@ import ( "fmt" "regexp" - "github.com/DataDog/datadog-agent/pkg/util/log" - "github.com/DataDog/datadog-agent/pkg/networkdevice/profile/profiledefinition" ) @@ -174,6 +172,7 @@ func validateEnrichSymbol(symbol *profiledefinition.SymbolConfig, symbolContext } return errors } + func validateEnrichMetricTag(metricTag *profiledefinition.MetricTagConfig) []string { var errors []string if (metricTag.Column.OID != "" || metricTag.Column.Name != "") && (metricTag.Symbol.OID != "" || metricTag.Symbol.Name != "") { @@ -217,7 +216,7 @@ func validateEnrichMetricTag(metricTag *profiledefinition.MetricTagConfig) []str } } if len(metricTag.Mapping) > 0 && metricTag.Tag == "" { - log.Warnf("``tag` must be provided if `mapping` (`%s`) is defined", metricTag.Mapping) + errors = append(errors, fmt.Sprintf("``tag` must be provided if `mapping` (`%s`) is defined", metricTag.Mapping)) } for _, transform := range metricTag.IndexTransform { if transform.Start > transform.End { diff --git a/pkg/collector/corechecks/snmp/internal/configvalidation/config_validate_enrich_test.go b/pkg/collector/corechecks/snmp/internal/configvalidation/config_validate_enrich_test.go index 0047af78cc366..1e966e743614b 100644 --- a/pkg/collector/corechecks/snmp/internal/configvalidation/config_validate_enrich_test.go +++ b/pkg/collector/corechecks/snmp/internal/configvalidation/config_validate_enrich_test.go @@ -6,33 +6,21 @@ package configvalidation import ( - "bufio" - "bytes" "fmt" "regexp" - "strings" "testing" - "github.com/cihub/seelog" "github.com/stretchr/testify/assert" - "github.com/DataDog/datadog-agent/pkg/util/log" - "github.com/DataDog/datadog-agent/pkg/networkdevice/profile/profiledefinition" ) func Test_ValidateEnrichMetrics(t *testing.T) { - type logCount struct { - log string - count int - } - tests := []struct { name string metrics []profiledefinition.MetricsConfig expectedErrors []string expectedMetrics []profiledefinition.MetricsConfig - expectedLogs []logCount }{ { name: "either table symbol or scalar symbol must be provided", @@ -551,7 +539,7 @@ func Test_ValidateEnrichMetrics(t *testing.T) { }, }, { - name: "mapping used without tag should raise a warning", + name: "mapping used without tag", metrics: []profiledefinition.MetricsConfig{ { Symbols: []profiledefinition.SymbolConfig{ @@ -574,23 +562,11 @@ func Test_ValidateEnrichMetrics(t *testing.T) { }, }, }, - expectedErrors: []string{}, - expectedLogs: []logCount{ - { - "[WARN] validateEnrichMetricTag: ``tag` must be provided if `mapping` (`map[1:abc 2:def]`) is defined", - 1, - }, - }, + expectedErrors: []string{"``tag` must be provided if `mapping` (`map[1:abc 2:def]`) is defined"}, }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - var b bytes.Buffer - w := bufio.NewWriter(&b) - l, err := seelog.LoggerFromWriterWithMinLevelAndFormat(w, seelog.DebugLvl, "[%LEVEL] %FuncShort: %Msg") - assert.Nil(t, err) - log.SetupLogger(l, "debug") - errors := ValidateEnrichMetrics(tt.metrics) assert.Equal(t, len(tt.expectedErrors), len(errors), fmt.Sprintf("ERRORS: %v", errors)) for i := range errors { @@ -599,29 +575,16 @@ func Test_ValidateEnrichMetrics(t *testing.T) { if tt.expectedMetrics != nil { assert.Equal(t, tt.expectedMetrics, tt.metrics) } - - w.Flush() - logs := b.String() - - for _, aLogCount := range tt.expectedLogs { - assert.Equal(t, aLogCount.count, strings.Count(logs, aLogCount.log), logs) - } }) } } func Test_ValidateEnrichMetricTags(t *testing.T) { - type logCount struct { - log string - count int - } - tests := []struct { name string metrics []profiledefinition.MetricTagConfig expectedErrors []string expectedMetrics []profiledefinition.MetricTagConfig - expectedLogs []logCount }{ { name: "Move OID to Symbol", @@ -691,12 +654,6 @@ func Test_ValidateEnrichMetricTags(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - var b bytes.Buffer - w := bufio.NewWriter(&b) - l, err := seelog.LoggerFromWriterWithMinLevelAndFormat(w, seelog.DebugLvl, "[%LEVEL] %FuncShort: %Msg") - assert.Nil(t, err) - log.SetupLogger(l, "debug") - errors := ValidateEnrichMetricTags(tt.metrics) assert.Equal(t, len(tt.expectedErrors), len(errors), fmt.Sprintf("ERRORS: %v", errors)) for i := range errors { @@ -705,13 +662,6 @@ func Test_ValidateEnrichMetricTags(t *testing.T) { if tt.expectedMetrics != nil { assert.Equal(t, tt.expectedMetrics, tt.metrics) } - - w.Flush() - logs := b.String() - - for _, aLogCount := range tt.expectedLogs { - assert.Equal(t, aLogCount.count, strings.Count(logs, aLogCount.log), logs) - } }) } } diff --git a/pkg/collector/corechecks/snmp/internal/devicecheck/devicecheck.go b/pkg/collector/corechecks/snmp/internal/devicecheck/devicecheck.go index 8737e5845378f..d23d5642a2470 100644 --- a/pkg/collector/corechecks/snmp/internal/devicecheck/devicecheck.go +++ b/pkg/collector/corechecks/snmp/internal/devicecheck/devicecheck.go @@ -15,11 +15,11 @@ import ( "strings" "time" - "github.com/cihub/seelog" "go.uber.org/atomic" + "github.com/DataDog/datadog-agent/comp/core/config" + haagenthelpers "github.com/DataDog/datadog-agent/comp/haagent/helpers" "github.com/DataDog/datadog-agent/pkg/collector/externalhost" - pkgconfigsetup "github.com/DataDog/datadog-agent/pkg/config/setup" configUtils "github.com/DataDog/datadog-agent/pkg/config/utils" "github.com/DataDog/datadog-agent/pkg/metrics/servicecheck" "github.com/DataDog/datadog-agent/pkg/util/hostname/validate" @@ -27,14 +27,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" @@ -57,9 +55,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 @@ -69,16 +64,16 @@ type DeviceCheck struct { devicePinger pinger.Pinger sessionCloseErrorCount *atomic.Uint64 savedDynamicTags []string - nextAutodetectMetrics time.Time diagnoses *diagnoses.Diagnoses interfaceBandwidthState report.InterfaceBandwidthState cacheKey string + agentConfig config.Component } const cacheKeyPrefix = "snmp-tags" // NewDeviceCheck returns a new DeviceCheck -func NewDeviceCheck(config *checkconfig.CheckConfig, ipAddress string, sessionFactory session.Factory) (*DeviceCheck, error) { +func NewDeviceCheck(config *checkconfig.CheckConfig, ipAddress string, sessionFactory session.Factory, agentConfig config.Component) (*DeviceCheck, error) { newConfig := config.CopyWithNewIP(ipAddress) var devicePinger pinger.Pinger @@ -98,10 +93,10 @@ 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, + agentConfig: agentConfig, } d.readTagsFromCache() @@ -252,11 +247,19 @@ func (d *DeviceCheck) setDeviceHostExternalTags() { if deviceHostname == "" || err != nil { return } - agentTags := configUtils.GetConfiguredTags(pkgconfigsetup.Datadog(), false) + agentTags := d.buildExternalTags() log.Debugf("Set external tags for device host, host=`%s`, agentTags=`%v`", deviceHostname, agentTags) externalhost.SetExternalTags(deviceHostname, common.SnmpExternalTagsSourceType, agentTags) } +func (d *DeviceCheck) buildExternalTags() []string { + agentTags := configUtils.GetConfiguredTags(d.agentConfig, false) + if haagenthelpers.IsEnabled(d.agentConfig) { + agentTags = append(agentTags, haagenthelpers.GetHaAgentTags(d.agentConfig)...) + } + return agentTags +} + func (d *DeviceCheck) getValuesAndTags() (bool, []string, *valuestore.ResultValueStore, error) { var deviceReachable bool var checkErrors []string @@ -284,7 +287,7 @@ func (d *DeviceCheck) getValuesAndTags() (bool, []string, *valuestore.ResultValu checkErrors = append(checkErrors, fmt.Sprintf("check device reachable: failed: %s", err)) } else { deviceReachable = true - if log.ShouldLog(seelog.DebugLvl) { + if log.ShouldLog(log.DebugLvl) { log.Debugf("check device reachable: success: %v", gosnmplib.PacketAsString(getNextValue)) } } @@ -298,7 +301,7 @@ func (d *DeviceCheck) getValuesAndTags() (bool, []string, *valuestore.ResultValu tags = append(tags, d.config.ProfileTags...) valuesStore, err := fetch.Fetch(d.session, d.config) - if log.ShouldLog(seelog.DebugLvl) { + if log.ShouldLog(log.DebugLvl) { log.Debugf("fetched values: %v", valuestore.ResultValueStoreAsString(valuesStore)) } @@ -316,30 +319,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) } } @@ -347,77 +341,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(seelog.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..1e7ad7fc7a001 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" @@ -18,19 +17,16 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" + agentconfig "github.com/DataDog/datadog-agent/comp/core/config" "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" @@ -62,7 +58,7 @@ profiles: config, err := checkconfig.NewCheckConfig(rawInstanceConfig, rawInitConfig) assert.Nil(t, err) - deviceCk, err := NewDeviceCheck(config, "1.2.3.4", sessionFactory) + deviceCk, err := NewDeviceCheck(config, "1.2.3.4", sessionFactory, agentconfig.NewMock(t)) assert.Nil(t, err) sender := mocksender.NewMockSender("123") // required to initiate aggregator @@ -202,7 +198,7 @@ global_metrics: config, err := checkconfig.NewCheckConfig(rawInstanceConfig, rawInitConfig) assert.Nil(t, err) - deviceCk, err := NewDeviceCheck(config, "1.2.3.4", sessionFactory) + deviceCk, err := NewDeviceCheck(config, "1.2.3.4", sessionFactory, agentconfig.NewMock(t)) assert.Nil(t, err) sender := mocksender.NewMockSender("123") // required to initiate aggregator @@ -237,225 +233,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 @@ -470,7 +247,7 @@ community_string: public config, err := checkconfig.NewCheckConfig(rawInstanceConfig, rawInitConfig) assert.Nil(t, err) - deviceCk, err := NewDeviceCheck(config, "1.2.3.4", session.NewMockSession) + deviceCk, err := NewDeviceCheck(config, "1.2.3.4", session.NewMockSession, agentconfig.NewMock(t)) assert.Nil(t, err) sender := mocksender.NewMockSender("123") // required to initiate aggregator @@ -501,7 +278,7 @@ community_string: public config, err := checkconfig.NewCheckConfig(rawInstanceConfig, rawInitConfig) assert.Nil(t, err) - deviceCk, err := NewDeviceCheck(config, "1.2.3.4", session.NewMockSession) + deviceCk, err := NewDeviceCheck(config, "1.2.3.4", session.NewMockSession, agentconfig.NewMock(t)) assert.Nil(t, err) hostname, err := deviceCk.GetDeviceHostname() @@ -567,7 +344,7 @@ profiles: config, err := checkconfig.NewCheckConfig(rawInstanceConfig, rawInitConfig) assert.Nil(t, err) - deviceCk, err := NewDeviceCheck(config, "1.2.3.4", sessionFactory) + deviceCk, err := NewDeviceCheck(config, "1.2.3.4", sessionFactory, agentconfig.NewMock(t)) 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", "snmp_profile:f5-big-ip", "device_vendor:f5", "snmp_host:foo_sys_name", @@ -872,7 +649,7 @@ profiles: config, err := checkconfig.NewCheckConfig(rawInstanceConfig, rawInitConfig) assert.Nil(t, err) - deviceCk, err := NewDeviceCheck(config, "1.2.3.4", sessionFactory) + deviceCk, err := NewDeviceCheck(config, "1.2.3.4", sessionFactory, agentconfig.NewMock(t)) assert.Nil(t, err) sender := mocksender.NewMockSender("123") // required to initiate aggregator @@ -892,93 +669,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() @@ -1006,7 +696,7 @@ profiles: config, err := checkconfig.NewCheckConfig(rawInstanceConfig, rawInitConfig) assert.Nil(t, err) - deviceCk, err := NewDeviceCheck(config, "1.2.3.4", sessionFactory) + deviceCk, err := NewDeviceCheck(config, "1.2.3.4", sessionFactory, agentconfig.NewMock(t)) assert.Nil(t, err) // override pinger with mock pinger @@ -1157,7 +847,7 @@ profiles: config, err := checkconfig.NewCheckConfig(rawInstanceConfig, rawInitConfig) assert.Nil(t, err) - deviceCk, err := NewDeviceCheck(config, "1.2.3.4", sessionFactory) + deviceCk, err := NewDeviceCheck(config, "1.2.3.4", sessionFactory, agentconfig.NewMock(t)) assert.Nil(t, err) // override pinger with mock pinger @@ -1278,3 +968,37 @@ profiles: sender.AssertNotCalled(t, "Gauge", pingAvgRttMetric, mock.Anything, mock.Anything, mock.Anything) sender.AssertNotCalled(t, "Gauge", pingPacketLoss, mock.Anything, mock.Anything, mock.Anything) } + +func TestDeviceCheck_buildExternalTags(t *testing.T) { + // GIVEN + profile.SetConfdPathAndCleanProfiles() + 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 +collect_topology: false +`) + // language=yaml + rawInitConfig := []byte(``) + + config, err := checkconfig.NewCheckConfig(rawInstanceConfig, rawInitConfig) + assert.Nil(t, err) + + cfg := agentconfig.NewMock(t) + cfg.SetWithoutSource("ha_agent.enabled", true) + cfg.SetWithoutSource("ha_agent.group", "my-group") + + deviceCk, err := NewDeviceCheck(config, "1.2.3.4", sessionFactory, cfg) + assert.Nil(t, err) + + // WHEN + externalTags := deviceCk.buildExternalTags() + + // THEN + assert.Equal(t, []string{"agent_group:my-group"}, externalTags) +} diff --git a/pkg/collector/corechecks/snmp/internal/discovery/discovery.go b/pkg/collector/corechecks/snmp/internal/discovery/discovery.go index b7fb91915209a..860f3cb781991 100644 --- a/pkg/collector/corechecks/snmp/internal/discovery/discovery.go +++ b/pkg/collector/corechecks/snmp/internal/discovery/discovery.go @@ -14,6 +14,7 @@ import ( "sync" "time" + "github.com/DataDog/datadog-agent/comp/core/config" "github.com/DataDog/datadog-agent/pkg/persistentcache" "github.com/DataDog/datadog-agent/pkg/util/log" "go.uber.org/atomic" @@ -43,6 +44,7 @@ type Discovery struct { discoveredDevices map[checkconfig.DeviceDigest]Device sessionFactory session.Factory + agentConfig config.Component } // Device implements and store results from the Service interface for the SNMP listener @@ -237,7 +239,7 @@ func (d *Discovery) getDevicesFound() []string { } func (d *Discovery) createDevice(deviceDigest checkconfig.DeviceDigest, subnet *snmpSubnet, deviceIP string, writeCache bool) { - deviceCk, err := devicecheck.NewDeviceCheck(subnet.config, deviceIP, d.sessionFactory) + deviceCk, err := devicecheck.NewDeviceCheck(subnet.config, deviceIP, d.sessionFactory, d.agentConfig) if err != nil { // should not happen since the deviceCheck is expected to be valid at this point // and are only changing the device ip @@ -335,11 +337,12 @@ func (d *Discovery) writeCache(subnet *snmpSubnet) { } // NewDiscovery return a new Discovery instance -func NewDiscovery(config *checkconfig.CheckConfig, sessionFactory session.Factory) *Discovery { +func NewDiscovery(config *checkconfig.CheckConfig, sessionFactory session.Factory, agentConfig config.Component) *Discovery { return &Discovery{ discoveredDevices: make(map[checkconfig.DeviceDigest]Device), stop: make(chan struct{}), config: config, sessionFactory: sessionFactory, + agentConfig: agentConfig, } } diff --git a/pkg/collector/corechecks/snmp/internal/discovery/discovery_test.go b/pkg/collector/corechecks/snmp/internal/discovery/discovery_test.go index 9d59def5890d0..4ca8ccc302bf2 100644 --- a/pkg/collector/corechecks/snmp/internal/discovery/discovery_test.go +++ b/pkg/collector/corechecks/snmp/internal/discovery/discovery_test.go @@ -8,16 +8,15 @@ package discovery import ( "fmt" "net" - "path/filepath" "testing" "time" "github.com/gosnmp/gosnmp" "github.com/stretchr/testify/assert" + agentconfig "github.com/DataDog/datadog-agent/comp/core/config" "github.com/DataDog/datadog-agent/pkg/collector/corechecks/snmp/internal/checkconfig" "github.com/DataDog/datadog-agent/pkg/collector/corechecks/snmp/internal/session" - pkgconfigsetup "github.com/DataDog/datadog-agent/pkg/config/setup" ) func waitForDiscoveredDevices(discovery *Discovery, expectedDeviceCount int, timeout time.Duration) error { @@ -33,8 +32,8 @@ func waitForDiscoveredDevices(discovery *Discovery, expectedDeviceCount int, tim } func TestDiscovery(t *testing.T) { - path, _ := filepath.Abs(filepath.Join(".", "test", "run_path", "TestDiscovery")) - pkgconfigsetup.Datadog().SetWithoutSource("run_path", path) + config := agentconfig.NewMock(t) + config.SetWithoutSource("run_path", t.TempDir()) sess := session.CreateMockSession() sessionFactory := func(*checkconfig.CheckConfig) (session.Session, error) { @@ -59,7 +58,7 @@ func TestDiscovery(t *testing.T) { DiscoveryWorkers: 1, IgnoredIPAddresses: map[string]bool{"192.168.0.5": true}, } - discovery := NewDiscovery(checkConfig, sessionFactory) + discovery := NewDiscovery(checkConfig, sessionFactory, config) discovery.Start() assert.NoError(t, waitForDiscoveredDevices(discovery, 7, 2*time.Second)) discovery.Stop() @@ -84,8 +83,8 @@ func TestDiscovery(t *testing.T) { } func TestDiscoveryCache(t *testing.T) { - path, _ := filepath.Abs(filepath.Join(".", "test", "run_path", "TestDiscoveryCache")) - pkgconfigsetup.Datadog().SetWithoutSource("run_path", path) + config := agentconfig.NewMock(t) + config.SetWithoutSource("run_path", t.TempDir()) sess := session.CreateMockSession() sessionFactory := func(*checkconfig.CheckConfig) (session.Session, error) { @@ -109,7 +108,7 @@ func TestDiscoveryCache(t *testing.T) { DiscoveryInterval: 3600, DiscoveryWorkers: 1, } - discovery := NewDiscovery(checkConfig, sessionFactory) + discovery := NewDiscovery(checkConfig, sessionFactory, config) discovery.Start() assert.NoError(t, waitForDiscoveredDevices(discovery, 4, 2*time.Second)) discovery.Stop() @@ -141,7 +140,7 @@ func TestDiscoveryCache(t *testing.T) { DiscoveryInterval: 3600, DiscoveryWorkers: 0, // no workers, the devices will be loaded from cache } - discovery2 := NewDiscovery(checkConfig, sessionFactory) + discovery2 := NewDiscovery(checkConfig, sessionFactory, config) discovery2.Start() assert.NoError(t, waitForDiscoveredDevices(discovery2, 4, 2*time.Second)) discovery2.Stop() @@ -158,6 +157,9 @@ func TestDiscoveryCache(t *testing.T) { func TestDiscoveryTicker(t *testing.T) { t.Skip() // TODO: FIX ME, currently this test is leading to data race when ran with other tests + config := agentconfig.NewMock(t) + config.SetWithoutSource("run_path", t.TempDir()) + sess := session.CreateMockSession() sessionFactory := func(*checkconfig.CheckConfig) (session.Session, error) { return sess, nil @@ -180,7 +182,7 @@ func TestDiscoveryTicker(t *testing.T) { DiscoveryInterval: 1, DiscoveryWorkers: 1, } - discovery := NewDiscovery(checkConfig, sessionFactory) + discovery := NewDiscovery(checkConfig, sessionFactory, config) discovery.Start() time.Sleep(1500 * time.Millisecond) discovery.Stop() @@ -191,7 +193,8 @@ func TestDiscoveryTicker(t *testing.T) { } func TestDiscovery_checkDevice(t *testing.T) { - SetTestRunPath() + config := agentconfig.NewMock(t) + config.SetWithoutSource("run_path", t.TempDir()) checkConfig := &checkconfig.CheckConfig{ Network: "192.168.0.0/32", CommunityString: "public", @@ -227,7 +230,7 @@ func TestDiscovery_checkDevice(t *testing.T) { } var sess *session.MockSession - discovery := NewDiscovery(checkConfig, session.NewMockSession) + discovery := NewDiscovery(checkConfig, session.NewMockSession, config) checkDeviceOnce := func() { sess = session.CreateMockSession() @@ -306,7 +309,9 @@ func TestDiscovery_checkDevice(t *testing.T) { } func TestDiscovery_createDevice(t *testing.T) { - SetTestRunPath() + config := agentconfig.NewMock(t) + config.SetWithoutSource("run_path", t.TempDir()) + checkConfig := &checkconfig.CheckConfig{ Network: "192.168.0.0/32", CommunityString: "public", @@ -315,7 +320,7 @@ func TestDiscovery_createDevice(t *testing.T) { DiscoveryAllowedFailures: 3, Namespace: "default", } - discovery := NewDiscovery(checkConfig, session.NewMockSession) + discovery := NewDiscovery(checkConfig, session.NewMockSession, config) ipAddr, ipNet, err := net.ParseCIDR(checkConfig.Network) assert.Nil(t, err) startingIP := ipAddr.Mask(ipNet.Mask) diff --git a/pkg/collector/corechecks/snmp/internal/discovery/testing.go b/pkg/collector/corechecks/snmp/internal/discovery/testing.go deleted file mode 100644 index 820bc1747acd7..0000000000000 --- a/pkg/collector/corechecks/snmp/internal/discovery/testing.go +++ /dev/null @@ -1,20 +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 test - -package discovery - -import ( - "path/filepath" - - pkgconfigsetup "github.com/DataDog/datadog-agent/pkg/config/setup" -) - -// SetTestRunPath sets run_path for testing -func SetTestRunPath() { - path, _ := filepath.Abs(filepath.Join(".", "test", "run_path")) - pkgconfigsetup.Datadog().SetWithoutSource("run_path", path) -} diff --git a/pkg/collector/corechecks/snmp/internal/fetch/fetch_column.go b/pkg/collector/corechecks/snmp/internal/fetch/fetch_column.go index 9d06254d86156..2ebfce8c4acd5 100644 --- a/pkg/collector/corechecks/snmp/internal/fetch/fetch_column.go +++ b/pkg/collector/corechecks/snmp/internal/fetch/fetch_column.go @@ -9,7 +9,6 @@ import ( "fmt" "sort" - "github.com/cihub/seelog" "github.com/gosnmp/gosnmp" "github.com/DataDog/datadog-agent/pkg/util/log" @@ -105,7 +104,7 @@ func getResults(sess session.Session, requestOids []string, bulkMaxRepetitions u return nil, fmt.Errorf("fetch column: failed getting oids `%v` using GetNext: %s", requestOids, err) } results = getNextResults - if log.ShouldLog(seelog.DebugLvl) { + if log.ShouldLog(log.DebugLvl) { log.Debugf("fetch column: GetNext results: %v", gosnmplib.PacketAsString(results)) } } else { @@ -115,7 +114,7 @@ func getResults(sess session.Session, requestOids []string, bulkMaxRepetitions u return nil, fmt.Errorf("fetch column: failed getting oids `%v` using GetBulk: %s", requestOids, err) } results = getBulkResults - if log.ShouldLog(seelog.DebugLvl) { + if log.ShouldLog(log.DebugLvl) { log.Debugf("fetch column: GetBulk results: %v", gosnmplib.PacketAsString(results)) } } diff --git a/pkg/collector/corechecks/snmp/internal/fetch/fetch_scalar.go b/pkg/collector/corechecks/snmp/internal/fetch/fetch_scalar.go index 0fc948b17a061..d7b219ad72c53 100644 --- a/pkg/collector/corechecks/snmp/internal/fetch/fetch_scalar.go +++ b/pkg/collector/corechecks/snmp/internal/fetch/fetch_scalar.go @@ -10,7 +10,6 @@ import ( "sort" "strings" - "github.com/cihub/seelog" "github.com/gosnmp/gosnmp" "github.com/DataDog/datadog-agent/pkg/util/log" @@ -127,7 +126,7 @@ func doDoFetchScalarOids(session session.Session, oids []string) (*gosnmp.SnmpPa log.Debugf("fetch scalar: error getting oids `%v`: %v", oids, err) return nil, fmt.Errorf("fetch scalar: error getting oids `%v`: %v", oids, err) } - if log.ShouldLog(seelog.DebugLvl) { + if log.ShouldLog(log.DebugLvl) { log.Debugf("fetch scalar: results: %s", gosnmplib.PacketAsString(results)) } return results, nil diff --git a/pkg/collector/corechecks/snmp/internal/fetch/fetch_test.go b/pkg/collector/corechecks/snmp/internal/fetch/fetch_test.go index b615d40681dc0..c0bf331b2f7e5 100644 --- a/pkg/collector/corechecks/snmp/internal/fetch/fetch_test.go +++ b/pkg/collector/corechecks/snmp/internal/fetch/fetch_test.go @@ -12,7 +12,6 @@ import ( "strings" "testing" - "github.com/cihub/seelog" "github.com/gosnmp/gosnmp" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -775,7 +774,7 @@ func Test_fetchValues_errors(t *testing.T) { func Test_fetchColumnOids_alreadyProcessed(t *testing.T) { var b bytes.Buffer w := bufio.NewWriter(&b) - l, err := seelog.LoggerFromWriterWithMinLevelAndFormat(w, seelog.DebugLvl, "[%LEVEL] %FuncShort: %Msg") + l, err := log.LoggerFromWriterWithMinLevelAndFormat(w, log.DebugLvl, "[%LEVEL] %FuncShort: %Msg") require.NoError(t, err) log.SetupLogger(l, "debug") 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 d0e03a880b928..d95c902a7cc3b 100644 --- a/pkg/collector/corechecks/snmp/internal/profile/profile_resolver_test.go +++ b/pkg/collector/corechecks/snmp/internal/profile/profile_resolver_test.go @@ -13,7 +13,6 @@ import ( "strings" "testing" - "github.com/cihub/seelog" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -147,7 +146,7 @@ func Test_resolveProfiles(t *testing.T) { t.Run(tt.name, func(t *testing.T) { var b bytes.Buffer w := bufio.NewWriter(&b) - l, err := seelog.LoggerFromWriterWithMinLevelAndFormat(w, seelog.DebugLvl, "[%LEVEL] %FuncShort: %Msg") + l, err := log.LoggerFromWriterWithMinLevelAndFormat(w, log.DebugLvl, "[%LEVEL] %FuncShort: %Msg") assert.Nil(t, err) log.SetupLogger(l, "debug") @@ -156,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/profile/profile_yaml_test.go b/pkg/collector/corechecks/snmp/internal/profile/profile_yaml_test.go index 81d7513ab9fa7..b617764b44cb2 100644 --- a/pkg/collector/corechecks/snmp/internal/profile/profile_yaml_test.go +++ b/pkg/collector/corechecks/snmp/internal/profile/profile_yaml_test.go @@ -13,13 +13,11 @@ import ( "strings" "testing" - "github.com/cihub/seelog" assert "github.com/stretchr/testify/require" pkgconfigsetup "github.com/DataDog/datadog-agent/pkg/config/setup" - "github.com/DataDog/datadog-agent/pkg/util/log" - "github.com/DataDog/datadog-agent/pkg/networkdevice/profile/profiledefinition" + "github.com/DataDog/datadog-agent/pkg/util/log" ) func getMetricFromProfile(p profiledefinition.ProfileDefinition, metricName string) *profiledefinition.MetricsConfig { @@ -124,7 +122,7 @@ func Test_loadYamlProfiles_invalidDir(t *testing.T) { func Test_loadYamlProfiles_invalidExtendProfile(t *testing.T) { var b bytes.Buffer w := bufio.NewWriter(&b) - l, err := seelog.LoggerFromWriterWithMinLevelAndFormat(w, seelog.DebugLvl, "[%LEVEL] %FuncShort: %Msg") + l, err := log.LoggerFromWriterWithMinLevelAndFormat(w, log.DebugLvl, "[%LEVEL] %FuncShort: %Msg") assert.Nil(t, err) log.SetupLogger(l, "debug") @@ -145,7 +143,7 @@ func Test_loadYamlProfiles_invalidExtendProfile(t *testing.T) { func Test_loadYamlProfiles_userAndDefaultProfileFolderDoesNotExist(t *testing.T) { var b bytes.Buffer w := bufio.NewWriter(&b) - l, err := seelog.LoggerFromWriterWithMinLevelAndFormat(w, seelog.DebugLvl, "[%LEVEL] %FuncShort: %Msg") + l, err := log.LoggerFromWriterWithMinLevelAndFormat(w, log.DebugLvl, "[%LEVEL] %FuncShort: %Msg") assert.Nil(t, err) log.SetupLogger(l, "debug") @@ -168,7 +166,7 @@ func Test_loadYamlProfiles_validAndInvalidProfiles(t *testing.T) { // Valid profiles should be returned even if some profiles are invalid var b bytes.Buffer w := bufio.NewWriter(&b) - l, err := seelog.LoggerFromWriterWithMinLevelAndFormat(w, seelog.DebugLvl, "[%LEVEL] %FuncShort: %Msg") + l, err := log.LoggerFromWriterWithMinLevelAndFormat(w, log.DebugLvl, "[%LEVEL] %FuncShort: %Msg") assert.Nil(t, err) log.SetupLogger(l, "debug") 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..6bdcec852a1d8 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 } @@ -383,8 +385,9 @@ func buildNetworkTopologyMetadataWithLLDP(deviceID string, store *metadata.Store remEntryUniqueID := localPortNum + "." + lldpRemIndex newLink := devicemetadata.TopologyLinkMetadata{ - ID: deviceID + ":" + remEntryUniqueID, - SourceType: topologyLinkSourceTypeLLDP, + ID: deviceID + ":" + remEntryUniqueID, + SourceType: topologyLinkSourceTypeLLDP, + Integration: common.SnmpIntegrationName, Remote: &devicemetadata.TopologyLinkSide{ Device: &devicemetadata.TopologyLinkDevice{ Name: store.GetColumnAsString("lldp_remote.device_name", strIndex), @@ -444,8 +447,9 @@ func buildNetworkTopologyMetadataWithCDP(deviceID string, store *metadata.Store, remEntryUniqueID := cdpCacheIfIndex + "." + cdpCacheDeviceIndex newLink := devicemetadata.TopologyLinkMetadata{ - ID: deviceID + ":" + remEntryUniqueID, - SourceType: topologyLinkSourceTypeCDP, + ID: deviceID + ":" + remEntryUniqueID, + SourceType: topologyLinkSourceTypeCDP, + Integration: common.SnmpIntegrationName, Remote: &devicemetadata.TopologyLinkSide{ Device: &devicemetadata.TopologyLinkDevice{ Name: store.GetColumnAsString("cdp_remote.device_name", strIndex), 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 92b745060bb59..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 @@ -12,7 +12,6 @@ import ( "testing" "time" - "github.com/cihub/seelog" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" @@ -31,7 +30,7 @@ import ( func Test_metricSender_reportNetworkDeviceMetadata_withoutInterfaces(t *testing.T) { var b bytes.Buffer w := bufio.NewWriter(&b) - l, err := seelog.LoggerFromWriterWithMinLevelAndFormat(w, seelog.TraceLvl, "[%LEVEL] %FuncShort: %Msg") + l, err := log.LoggerFromWriterWithMinLevelAndFormat(w, log.TraceLvl, "[%LEVEL] %FuncShort: %Msg") assert.Nil(t, err) log.SetupLogger(l, "debug") @@ -62,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{ @@ -971,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/report/report_metrics_test.go b/pkg/collector/corechecks/snmp/internal/report/report_metrics_test.go index bf5ea9de7a72e..8d11ffc5e08a4 100644 --- a/pkg/collector/corechecks/snmp/internal/report/report_metrics_test.go +++ b/pkg/collector/corechecks/snmp/internal/report/report_metrics_test.go @@ -11,7 +11,6 @@ import ( "strings" "testing" - "github.com/cihub/seelog" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" @@ -316,7 +315,7 @@ func TestSendMetric(t *testing.T) { var b bytes.Buffer w := bufio.NewWriter(&b) - l, err := seelog.LoggerFromWriterWithMinLevelAndFormat(w, seelog.DebugLvl, "[%LEVEL] %FuncShort: %Msg") + l, err := log.LoggerFromWriterWithMinLevelAndFormat(w, log.DebugLvl, "[%LEVEL] %FuncShort: %Msg") assert.Nil(t, err) log.SetupLogger(l, "debug") @@ -453,7 +452,7 @@ func Test_metricSender_reportMetrics(t *testing.T) { var b bytes.Buffer w := bufio.NewWriter(&b) - l, err := seelog.LoggerFromWriterWithMinLevelAndFormat(w, seelog.DebugLvl, "[%LEVEL] %FuncShort: %Msg") + l, err := log.LoggerFromWriterWithMinLevelAndFormat(w, log.DebugLvl, "[%LEVEL] %FuncShort: %Msg") assert.Nil(t, err) log.SetupLogger(l, "debug") @@ -640,7 +639,7 @@ func Test_metricSender_getCheckInstanceMetricTags(t *testing.T) { var b bytes.Buffer w := bufio.NewWriter(&b) - l, err := seelog.LoggerFromWriterWithMinLevelAndFormat(w, seelog.DebugLvl, "[%LEVEL] %FuncShort: %Msg") + l, err := log.LoggerFromWriterWithMinLevelAndFormat(w, log.DebugLvl, "[%LEVEL] %FuncShort: %Msg") assert.Nil(t, err) log.SetupLogger(l, "debug") diff --git a/pkg/collector/corechecks/snmp/internal/report/report_utils_test.go b/pkg/collector/corechecks/snmp/internal/report/report_utils_test.go index de9fefb130581..6b530f3f7d763 100644 --- a/pkg/collector/corechecks/snmp/internal/report/report_utils_test.go +++ b/pkg/collector/corechecks/snmp/internal/report/report_utils_test.go @@ -12,7 +12,6 @@ import ( "strings" "testing" - "github.com/cihub/seelog" "github.com/stretchr/testify/assert" "gopkg.in/yaml.v2" @@ -772,7 +771,7 @@ metric_tags: var b bytes.Buffer w := bufio.NewWriter(&b) - l, err := seelog.LoggerFromWriterWithMinLevelAndFormat(w, seelog.DebugLvl, "[%LEVEL] %FuncShort: %Msg") + l, err := log.LoggerFromWriterWithMinLevelAndFormat(w, log.DebugLvl, "[%LEVEL] %FuncShort: %Msg") assert.Nil(t, err) log.SetupLogger(l, "debug") @@ -1091,7 +1090,7 @@ func Test_getContantMetricValues(t *testing.T) { var b bytes.Buffer w := bufio.NewWriter(&b) - l, err := seelog.LoggerFromWriterWithMinLevelAndFormat(w, seelog.DebugLvl, "[%LEVEL] %FuncShort: %Msg") + l, err := log.LoggerFromWriterWithMinLevelAndFormat(w, log.DebugLvl, "[%LEVEL] %FuncShort: %Msg") assert.Nil(t, err) log.SetupLogger(l, "debug") diff --git a/pkg/collector/corechecks/snmp/internal/session/session.go b/pkg/collector/corechecks/snmp/internal/session/session.go index c39518d0a3f0a..1d0995c1ed3c1 100644 --- a/pkg/collector/corechecks/snmp/internal/session/session.go +++ b/pkg/collector/corechecks/snmp/internal/session/session.go @@ -11,7 +11,6 @@ import ( "strings" "time" - "github.com/cihub/seelog" "github.com/gosnmp/gosnmp" "github.com/DataDog/datadog-agent/pkg/snmp/gosnmplib" @@ -137,7 +136,7 @@ func NewGosnmpSession(config *checkconfig.CheckConfig) (Session, error) { if err != nil { log.Warnf("failed to get logger: %s", err) } else { - if lvl == seelog.TraceLvl { + if lvl == log.TraceLvl { TraceLevelLogWriter := gosnmplib.TraceLevelLogWriter{} s.gosnmpInst.Logger = gosnmp.NewLogger(stdlog.New(&TraceLevelLogWriter, "", stdlog.Lshortfile)) } diff --git a/pkg/collector/corechecks/snmp/internal/session/session_test.go b/pkg/collector/corechecks/snmp/internal/session/session_test.go index 1042bc7b5de28..3986365f01e59 100644 --- a/pkg/collector/corechecks/snmp/internal/session/session_test.go +++ b/pkg/collector/corechecks/snmp/internal/session/session_test.go @@ -14,7 +14,6 @@ import ( "testing" "time" - "github.com/cihub/seelog" "github.com/gosnmp/gosnmp" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -289,7 +288,7 @@ func Test_snmpSession_traceLog_disabled(t *testing.T) { } var b bytes.Buffer w := bufio.NewWriter(&b) - l, err := seelog.LoggerFromWriterWithMinLevelAndFormat(w, seelog.InfoLvl, "[%LEVEL] %FuncShort: %Msg") + l, err := log.LoggerFromWriterWithMinLevelAndFormat(w, log.InfoLvl, "[%LEVEL] %FuncShort: %Msg") assert.Nil(t, err) log.SetupLogger(l, "info") @@ -306,7 +305,7 @@ func Test_snmpSession_traceLog_enabled(t *testing.T) { } var b bytes.Buffer w := bufio.NewWriter(&b) - l, err := seelog.LoggerFromWriterWithMinLevelAndFormat(w, seelog.TraceLvl, "[%LEVEL] %FuncShort: %Msg") + l, err := log.LoggerFromWriterWithMinLevelAndFormat(w, log.TraceLvl, "[%LEVEL] %FuncShort: %Msg") assert.Nil(t, err) log.SetupLogger(l, "trace") 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/collector/corechecks/snmp/snmp.go b/pkg/collector/corechecks/snmp/snmp.go index 6b59932b057c6..29e2ae2327c5b 100644 --- a/pkg/collector/corechecks/snmp/snmp.go +++ b/pkg/collector/corechecks/snmp/snmp.go @@ -11,6 +11,7 @@ import ( "sync" "time" + "github.com/DataDog/datadog-agent/comp/core/config" "go.uber.org/atomic" "github.com/DataDog/datadog-agent/comp/core/autodiscovery/integration" @@ -44,6 +45,7 @@ type Check struct { discovery *discovery.Discovery sessionFactory session.Factory workerRunDeviceCheckErrors *atomic.Uint64 + agentConfig config.Component } // Run executes the check @@ -155,10 +157,10 @@ func (c *Check) Configure(senderManager sender.SenderManager, integrationConfigD } if c.config.IsDiscovery() { - c.discovery = discovery.NewDiscovery(c.config, c.sessionFactory) + c.discovery = discovery.NewDiscovery(c.config, c.sessionFactory, c.agentConfig) c.discovery.Start() } else { - c.singleDeviceCk, err = devicecheck.NewDeviceCheck(c.config, c.config.IPAddress, c.sessionFactory) + c.singleDeviceCk, err = devicecheck.NewDeviceCheck(c.config, c.config.IPAddress, c.sessionFactory, c.agentConfig) if err != nil { return fmt.Errorf("failed to create device check: %s", err) } @@ -196,14 +198,17 @@ func (c *Check) GetDiagnoses() ([]diagnosis.Diagnosis, error) { } // Factory creates a new check factory -func Factory() optional.Option[func() check.Check] { - return optional.NewOption(newCheck) +func Factory(agentConfig config.Component) optional.Option[func() check.Check] { + return optional.NewOption(func() check.Check { + return newCheck(agentConfig) + }) } -func newCheck() check.Check { +func newCheck(agentConfig config.Component) check.Check { return &Check{ CheckBase: core.NewCheckBase(common.SnmpIntegrationName), sessionFactory: session.NewGosnmpSession, workerRunDeviceCheckErrors: atomic.NewUint64(0), + agentConfig: agentConfig, } } diff --git a/pkg/collector/corechecks/snmp/snmp_test.go b/pkg/collector/corechecks/snmp/snmp_test.go index 88513ca8ce0d3..2f1095dc52027 100644 --- a/pkg/collector/corechecks/snmp/snmp_test.go +++ b/pkg/collector/corechecks/snmp/snmp_test.go @@ -25,6 +25,7 @@ import ( "github.com/DataDog/datadog-agent/comp/aggregator/demultiplexer/demultiplexerimpl" "github.com/DataDog/datadog-agent/comp/core" "github.com/DataDog/datadog-agent/comp/core/autodiscovery/integration" + agentconfig "github.com/DataDog/datadog-agent/comp/core/config" "github.com/DataDog/datadog-agent/comp/forwarder/defaultforwarder" "github.com/DataDog/datadog-agent/pkg/aggregator/mocksender" "github.com/DataDog/datadog-agent/pkg/collector/externalhost" @@ -996,10 +997,10 @@ community_string: public func TestCheckID(t *testing.T) { profile.SetConfdPathAndCleanProfiles() - check1 := newCheck() - check2 := newCheck() - check3 := newCheck() - checkSubnet := newCheck() + check1 := newCheck(agentconfig.NewMock(t)) + check2 := newCheck(agentconfig.NewMock(t)) + check3 := newCheck(agentconfig.NewMock(t)) + checkSubnet := newCheck(agentconfig.NewMock(t)) // language=yaml rawInstanceConfig1 := []byte(` ip_address: 1.1.1.1 @@ -2165,7 +2166,7 @@ func TestDeviceIDAsHostname(t *testing.T) { sessionFactory := func(*checkconfig.CheckConfig) (session.Session, error) { return sess, nil } - chk := Check{sessionFactory: sessionFactory} + chk := Check{sessionFactory: sessionFactory, agentConfig: agentconfig.NewMock(t)} pkgconfigsetup.Datadog().SetWithoutSource("hostname", "test-hostname") pkgconfigsetup.Datadog().SetWithoutSource("tags", []string{"agent_tag1:val1", "agent_tag2:val2"}) senderManager := deps.Demultiplexer @@ -2358,7 +2359,7 @@ func TestDiscoveryDeviceIDAsHostname(t *testing.T) { sessionFactory := func(*checkconfig.CheckConfig) (session.Session, error) { return sess, nil } - chk := Check{sessionFactory: sessionFactory} + chk := Check{sessionFactory: sessionFactory, agentConfig: agentconfig.NewMock(t)} pkgconfigsetup.Datadog().SetWithoutSource("hostname", "my-hostname") senderManager := deps.Demultiplexer diff --git a/pkg/collector/corechecks/system/cpu/cpu/context_switches.go b/pkg/collector/corechecks/system/cpu/cpu/context_switches.go new file mode 100644 index 0000000000000..ca83b826dd331 --- /dev/null +++ b/pkg/collector/corechecks/system/cpu/cpu/context_switches.go @@ -0,0 +1,15 @@ +// 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 && !windows + +package cpu + +import "fmt" + +// GetContextSwitches retrieves the number of context switches for the current process. +// It returns an integer representing the count and an error if the retrieval fails. +func GetContextSwitches() (int64, error) { + return 0, fmt.Errorf("context switches not supported on macOS") +} diff --git a/pkg/collector/corechecks/system/cpu/cpu/cpu_ctx_switches_linux.go b/pkg/collector/corechecks/system/cpu/cpu/context_switches_linux.go similarity index 64% rename from pkg/collector/corechecks/system/cpu/cpu/cpu_ctx_switches_linux.go rename to pkg/collector/corechecks/system/cpu/cpu/context_switches_linux.go index 97dd5eab205e5..b1442821092c4 100644 --- a/pkg/collector/corechecks/system/cpu/cpu/cpu_ctx_switches_linux.go +++ b/pkg/collector/corechecks/system/cpu/cpu/context_switches_linux.go @@ -9,17 +9,23 @@ package cpu import ( "bufio" "fmt" + pkgconfigsetup "github.com/DataDog/datadog-agent/pkg/config/setup" + "github.com/DataDog/datadog-agent/pkg/util/log" "os" - "path/filepath" "strconv" "strings" - - "github.com/DataDog/datadog-agent/pkg/aggregator/sender" - pkgconfigsetup "github.com/DataDog/datadog-agent/pkg/config/setup" ) -func readCtxSwitches(procStatPath string) (ctxSwitches int64, err error) { - file, err := os.Open(procStatPath) +// GetContextSwitches retrieves the number of context switches for the current process. +// It returns an integer representing the count and an error if the retrieval fails. +func GetContextSwitches() (ctxSwitches int64, err error) { + log.Debug("collecting ctx switches") + procfsPath := "/proc" + if pkgconfigsetup.Datadog().IsSet("procfs_path") { + procfsPath = pkgconfigsetup.Datadog().GetString("procfs_path") + } + filePath := procfsPath + "/stat" + file, err := os.Open(filePath) if err != nil { return 0, err } @@ -32,24 +38,10 @@ func readCtxSwitches(procStatPath string) (ctxSwitches int64, err error) { elemts := strings.Split(txt, " ") ctxSwitches, err = strconv.ParseInt(elemts[1], 10, 64) if err != nil { - return 0, fmt.Errorf("%s in '%s' at line %d", err, procStatPath, i) + return 0, fmt.Errorf("%s in '%s' at line %d", err, filePath, i) } return ctxSwitches, nil } } - return 0, fmt.Errorf("could not find the context switches in stat file") } - -func collectCtxSwitches(sender sender.Sender) error { - procfsPath := "/proc" - if pkgconfigsetup.Datadog().IsSet("procfs_path") { - procfsPath = pkgconfigsetup.Datadog().GetString("procfs_path") - } - ctxSwitches, err := readCtxSwitches(filepath.Join(procfsPath, "/stat")) - if err != nil { - return err - } - sender.MonotonicCount("system.cpu.context_switches", float64(ctxSwitches), "", nil) - return nil -} diff --git a/pkg/collector/corechecks/system/cpu/cpu/cpu.go b/pkg/collector/corechecks/system/cpu/cpu/cpu.go index 8ca44f462bd61..827f032bba9e5 100644 --- a/pkg/collector/corechecks/system/cpu/cpu/cpu.go +++ b/pkg/collector/corechecks/system/cpu/cpu/cpu.go @@ -10,7 +10,8 @@ package cpu import ( "fmt" - "github.com/shirou/gopsutil/v3/cpu" + "github.com/shirou/gopsutil/v4/cpu" + "gopkg.in/yaml.v2" "github.com/DataDog/datadog-agent/comp/core/autodiscovery/integration" "github.com/DataDog/datadog-agent/pkg/aggregator/sender" @@ -23,15 +24,20 @@ import ( const CheckName = "cpu" // For testing purpose -var cpuTimesFunc = cpu.Times -var cpuInfoFunc = cpu.Info +var getCpuTimes = cpu.Times +var getCpuInfo = cpu.Info +var getContextSwitches = GetContextSwitches // Check doesn't need additional fields type Check struct { core.CheckBase - nbCPU float64 - lastNbCycle float64 - lastTimes cpu.TimesStat + instanceConfig cpuInstanceConfig + lastNbCycle float64 + lastTimes cpu.TimesStat +} + +type cpuInstanceConfig struct { + ReportTotalPerCPU bool `yaml:"report_total_percpu"` } // Run executes the check @@ -40,40 +46,81 @@ func (c *Check) Run() error { if err != nil { return err } + c.reportContextSwitches(sender) + numCores, err := c.reportCpuInfo(sender) + if err != nil { + return err + } + err = c.reportCpuMetricsPercent(sender, numCores) + if err != nil { + return err + } + err = c.reportCpuMetricsTotal(sender) + if err != nil { + return err + } + sender.Commit() + return nil +} - err = collectCtxSwitches(sender) +func (c *Check) reportContextSwitches(sender sender.Sender) { + ctxSwitches, err := getContextSwitches() if err != nil { - log.Debugf("cpu.Check could not read context switches: %s", err.Error()) - // Don't return here, we still want to collect the CPU metrics even if we could not + log.Debugf("could not read context switches: %s", err.Error()) + // Don't return error here, we still want to collect the CPU metrics even if we could not // read the context switches + } else { + log.Debugf("getContextSwitches: %d", ctxSwitches) + sender.MonotonicCount("system.cpu.context_switches", float64(ctxSwitches), "", nil) + } +} + +func (c *Check) reportCpuInfo(sender sender.Sender) (numCores int32, err error) { + cpuInfo, err := getCpuInfo() + if err != nil { + log.Errorf("could not retrieve cpu info: %s", err.Error()) + return 0, err + } + log.Debugf("getCpuInfo: %s", cpuInfo) + numCores = 0 + for _, i := range cpuInfo { + numCores += i.Cores } + sender.Gauge("system.cpu.num_cores", float64(numCores), "", nil) + return numCores, nil +} - cpuTimes, err := cpuTimesFunc(false) +func (c *Check) reportCpuMetricsPercent(sender sender.Sender, numCores int32) (err error) { + cpuTimes, err := getCpuTimes(false) if err != nil { - log.Errorf("cpu.Check: could not retrieve cpu stats: %s", err) + log.Errorf("could not retrieve cpu times: %s", err.Error()) + return err + } + log.Debugf("getCpuTimes(false): %s", cpuTimes) + if len(cpuTimes) == 0 { + err = fmt.Errorf("no cpu stats retrieve (empty results)") + log.Errorf("%s", err.Error()) return err - } else if len(cpuTimes) < 1 { - errEmpty := fmt.Errorf("no cpu stats retrieve (empty results)") - log.Errorf("cpu.Check: %s", errEmpty) - return errEmpty } t := cpuTimes[0] - total := t.User + t.System + t.Idle + t.Nice + t.Iowait + t.Irq + t.Softirq + t.Steal - nbCycle := total / c.nbCPU - + log.Debugf("total: %f", total) + nbCycle := total / float64(numCores) + log.Debugf("nbCycle: %f", nbCycle) if c.lastNbCycle != 0 { // gopsutil return the sum of every CPU + log.Debugf("c.lastNbCycle: %f", c.lastNbCycle) toPercent := 100 / (nbCycle - c.lastNbCycle) + log.Debugf("toPercent: %f", toPercent) - user := ((t.User + t.Nice) - (c.lastTimes.User + c.lastTimes.Nice)) / c.nbCPU - system := ((t.System + t.Irq + t.Softirq) - (c.lastTimes.System + c.lastTimes.Irq + c.lastTimes.Softirq)) / c.nbCPU - interrupt := ((t.Irq + t.Softirq) - (c.lastTimes.Irq + c.lastTimes.Softirq)) / c.nbCPU - iowait := (t.Iowait - c.lastTimes.Iowait) / c.nbCPU - idle := (t.Idle - c.lastTimes.Idle) / c.nbCPU - stolen := (t.Steal - c.lastTimes.Steal) / c.nbCPU - guest := (t.Guest - c.lastTimes.Guest) / c.nbCPU + user := ((t.User + t.Nice) - (c.lastTimes.User + c.lastTimes.Nice)) / float64(numCores) + system := ((t.System + t.Irq + t.Softirq) - (c.lastTimes.System + c.lastTimes.Irq + c.lastTimes.Softirq)) / float64(numCores) + interrupt := ((t.Irq + t.Softirq) - (c.lastTimes.Irq + c.lastTimes.Softirq)) / float64(numCores) + iowait := (t.Iowait - c.lastTimes.Iowait) / float64(numCores) + idle := (t.Idle - c.lastTimes.Idle) / float64(numCores) + stolen := (t.Steal - c.lastTimes.Steal) / float64(numCores) + guest := (t.Guest - c.lastTimes.Guest) / float64(numCores) sender.Gauge("system.cpu.user", user*toPercent, "", nil) sender.Gauge("system.cpu.system", system*toPercent, "", nil) @@ -83,32 +130,43 @@ func (c *Check) Run() error { sender.Gauge("system.cpu.stolen", stolen*toPercent, "", nil) sender.Gauge("system.cpu.guest", guest*toPercent, "", nil) } - - sender.Gauge("system.cpu.num_cores", c.nbCPU, "", nil) - sender.Commit() - c.lastNbCycle = nbCycle c.lastTimes = t return nil } -// Configure the CPU check -func (c *Check) Configure(senderManager sender.SenderManager, _ uint64, data integration.Data, initConfig integration.Data, source string) error { - err := c.CommonConfigure(senderManager, initConfig, data, source) +func (c *Check) reportCpuMetricsTotal(sender sender.Sender) (err error) { + cpuTimes, err := getCpuTimes(c.instanceConfig.ReportTotalPerCPU) if err != nil { + log.Errorf("could not retrieve cpu times: %s", err.Error()) return err } - // NOTE: This runs before the python checks, so we should be good, but cpuInfo() - // on windows initializes COM to the multithreaded model. Therefore, - // if a python check has run on this native windows thread prior and - // CoInitialized() the thread to a different model (ie. single-threaded) - // This will cause cpuInfo() to fail. - info, err := cpuInfoFunc() + log.Debugf("getCpuTimes(%t): %s", c.instanceConfig.ReportTotalPerCPU, cpuTimes) + for _, t := range cpuTimes { + tags := []string{fmt.Sprintf("core:%s", t.CPU)} + sender.Gauge("system.cpu.user.total", t.User, "", tags) + sender.Gauge("system.cpu.nice.total", t.Nice, "", tags) + sender.Gauge("system.cpu.system.total", t.System, "", tags) + sender.Gauge("system.cpu.idle.total", t.Idle, "", tags) + sender.Gauge("system.cpu.iowait.total", t.Iowait, "", tags) + sender.Gauge("system.cpu.irq.total", t.Irq, "", tags) + sender.Gauge("system.cpu.softirq.total", t.Softirq, "", tags) + sender.Gauge("system.cpu.steal.total", t.Steal, "", tags) + sender.Gauge("system.cpu.guest.total", t.Guest, "", tags) + sender.Gauge("system.cpu.guestnice.total", t.GuestNice, "", tags) + } + return nil +} + +// Configure configures the network checks +func (c *Check) Configure(senderManager sender.SenderManager, _ uint64, rawInstance integration.Data, rawInitConfig integration.Data, source string) error { + err := c.CommonConfigure(senderManager, rawInitConfig, rawInstance, source) if err != nil { - return fmt.Errorf("cpu.Check: could not query CPU info") + return err } - for _, i := range info { - c.nbCPU += float64(i.Cores) + err = yaml.Unmarshal(rawInstance, &c.instanceConfig) + if err != nil { + return err } return nil } diff --git a/pkg/collector/corechecks/system/cpu/cpu/cpu_test.go b/pkg/collector/corechecks/system/cpu/cpu/cpu_test.go index d5124637d6c4a..c656765354022 100644 --- a/pkg/collector/corechecks/system/cpu/cpu/cpu_test.go +++ b/pkg/collector/corechecks/system/cpu/cpu/cpu_test.go @@ -8,52 +8,70 @@ package cpu import ( "errors" - "os" - "path/filepath" - "runtime" "testing" "github.com/DataDog/datadog-agent/comp/core/autodiscovery/integration" "github.com/DataDog/datadog-agent/pkg/aggregator" "github.com/DataDog/datadog-agent/pkg/aggregator/mocksender" "github.com/DataDog/datadog-agent/pkg/collector/check" - pkgconfigsetup "github.com/DataDog/datadog-agent/pkg/config/setup" - "github.com/DataDog/datadog-agent/pkg/metrics" - - "github.com/shirou/gopsutil/v3/cpu" + "github.com/shirou/gopsutil/v4/cpu" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" ) var ( - firstSample = []cpu.TimesStat{ + firstTotalSample = cpu.TimesStat{ + CPU: "cpu-total", + User: 29386, + Nice: 623, + System: 63584, + Idle: 96761, + Iowait: 12113, + Irq: 10, + Softirq: 1151, + Steal: 0, + Guest: 0, + GuestNice: 0, + } + secondTotalSample = cpu.TimesStat{ + CPU: "cpu-total", + User: 29586, + Nice: 625, + System: 68584, + Idle: 96761, + Iowait: 12153, + Irq: 15, + Softirq: 1451, + Steal: 2, + Guest: 0, + GuestNice: 0, + } + perCPUSamples = []cpu.TimesStat{ { - CPU: "cpu-total", - User: 1229386, - Nice: 623, - System: 263584, - Idle: 25496761, - Iowait: 12113, - Irq: 10, - Softirq: 1151, - Steal: 0, - Guest: 0, - GuestNice: 0, + CPU: "cpu0", + User: 83970.9, + Nice: 0.0, + System: 64060.9, + Idle: 208877.4, + Iowait: 12.1, + Irq: 43.5, + Softirq: 8.6, + Steal: 65.9, + Guest: 2.4, + GuestNice: 5.1, }, - } - secondSample = []cpu.TimesStat{ { - CPU: "cpu-total", - User: 1229586, - Nice: 625, - System: 268584, - Idle: 25596761, - Iowait: 12153, - Irq: 15, - Softirq: 1451, - Steal: 2, - Guest: 0, - GuestNice: 0, + CPU: "cpu1", + User: 82638.9, + Nice: 50.0, + System: 61564.1, + Idle: 212758.8, + Iowait: 1.2, + Irq: 2.3, + Softirq: 3.4, + Steal: 4.5, + Guest: 5.6, + GuestNice: 6.7, }, } cpuInfo = []cpu.InfoStat{ @@ -81,207 +99,328 @@ func createCheck() check.Check { return cpuCheck } -func TestCPUCheckLinuxFirstRunOk(t *testing.T) { - cpuInfoFunc = func() ([]cpu.InfoStat, error) { +func setupDefaultMocks() { + getContextSwitches = func() (int64, error) { + return 4, nil + } + getCpuInfo = func() ([]cpu.InfoStat, error) { return cpuInfo, nil } + getCpuTimes = func(perCpu bool) ([]cpu.TimesStat, error) { + if perCpu { + return perCPUSamples, nil + } + return []cpu.TimesStat{firstTotalSample}, nil + } +} + +func TestCPUCheckLinuxErrorInInstanceConfig(t *testing.T) { + cpuCheck := createCheck() + m := mocksender.NewMockSender(cpuCheck.ID()) + + err := cpuCheck.Configure(m.GetSenderManager(), integration.FakeConfigHash, []byte(`min_collection_interval: "string_value"`), nil, "test") + + assert.NotNil(t, err) +} + +func TestCPUCheckLinuxErrorReportTotalPerCPUConfigNotBoolean(t *testing.T) { cpuCheck := createCheck() m := mocksender.NewMockSender(cpuCheck.ID()) - if runtime.GOOS == "linux" { - m.On(metrics.MonotonicCountType.String(), "system.cpu.context_switches", mock.AnythingOfType("float64"), mock.AnythingOfType("string"), mock.AnythingOfType("[]string")).Return().Times(1) + + err := cpuCheck.Configure(m.GetSenderManager(), integration.FakeConfigHash, []byte(`report_total_percpu: "string_value"`), nil, "test") + + assert.NotNil(t, err) +} + +func TestCPUCheckLinuxErrorStoppedSender(t *testing.T) { + stoppedSenderError := errors.New("demultiplexer is stopped") + getCpuInfo = func() ([]cpu.InfoStat, error) { + return cpuInfo, nil } - m.On(metrics.GaugeType.String(), "system.cpu.num_cores", float64(1), mock.AnythingOfType("string"), mock.AnythingOfType("[]string")).Return().Times(1) - m.On("Commit").Return().Times(1) + cpuCheck := createCheck() + m := mocksender.NewMockSender(cpuCheck.ID()) + m.SetupAcceptAll() cpuCheck.Configure(m.GetSenderManager(), integration.FakeConfigHash, nil, nil, "test") - cpuTimesFunc = func(bool) ([]cpu.TimesStat, error) { - return firstSample, nil - } + m.GetSenderManager().(*aggregator.AgentDemultiplexer).Stop(false) err := cpuCheck.Run() - assert.Nil(t, err) - m.AssertExpectations(t) + assert.Equal(t, stoppedSenderError, err) } -func TestCPUCheckLinuxTwoRunsOk(t *testing.T) { - cpuInfoFunc = func() ([]cpu.InfoStat, error) { - return cpuInfo, nil +func TestContextSwitchesError(t *testing.T) { + setupDefaultMocks() + getContextSwitches = func() (int64, error) { + return 0, errors.New("GetContextSwitches error") } cpuCheck := createCheck() m := mocksender.NewMockSender(cpuCheck.ID()) - if runtime.GOOS == "linux" { - m.On(metrics.MonotonicCountType.String(), "system.cpu.context_switches", mock.AnythingOfType("float64"), mock.AnythingOfType("string"), mock.AnythingOfType("[]string")).Return().Times(2) - } - m.On(metrics.GaugeType.String(), "system.cpu.user", 0.1913803067769472, "", []string(nil)).Return().Times(1) - m.On(metrics.GaugeType.String(), "system.cpu.system", 5.026101621048045, "", []string(nil)).Return().Times(1) - m.On(metrics.GaugeType.String(), "system.cpu.interrupt", 0.2889653146879648, "", []string(nil)).Return().Times(1) - m.On(metrics.GaugeType.String(), "system.cpu.iowait", 0.03789709045088063, "", []string(nil)).Return().Times(1) - m.On(metrics.GaugeType.String(), "system.cpu.idle", 94.74272612720159, "", []string(nil)).Return().Times(1) - m.On(metrics.GaugeType.String(), "system.cpu.stolen", 0.0018948545225440318, "", []string(nil)).Return().Times(1) - m.On(metrics.GaugeType.String(), "system.cpu.guest", 0.0, "", []string(nil)).Return().Times(1) - m.On(metrics.GaugeType.String(), "system.cpu.num_cores", 1.0, "", []string(nil)).Return().Times(2) - m.On("Commit").Return().Times(2) + m.SetupAcceptAll() cpuCheck.Configure(m.GetSenderManager(), integration.FakeConfigHash, nil, nil, "test") - cpuTimesFunc = func(bool) ([]cpu.TimesStat, error) { - return firstSample, nil - } - cpuCheck.Run() - cpuTimesFunc = func(bool) ([]cpu.TimesStat, error) { - return secondSample, nil - } err := cpuCheck.Run() assert.Nil(t, err) - m.AssertExpectations(t) + m.AssertNotCalled(t, "MonotonicCount", "system.cpu.context_switches", mock.AnythingOfType("float64"), mock.AnythingOfType("string"), mock.AnythingOfType("[]string")) } -func TestCPUCheckLinuxErrorInInstanceConfig(t *testing.T) { +func TestContextSwitchesOk(t *testing.T) { + setupDefaultMocks() cpuCheck := createCheck() m := mocksender.NewMockSender(cpuCheck.ID()) + m.SetupAcceptAll() - err := cpuCheck.Configure(m.GetSenderManager(), integration.FakeConfigHash, []byte(`min_collection_interval: "string_value"`), nil, "test") + cpuCheck.Configure(m.GetSenderManager(), integration.FakeConfigHash, nil, nil, "test") + err := cpuCheck.Run() - assert.NotNil(t, err) + assert.Nil(t, err) + m.AssertMetric(t, "MonotonicCount", "system.cpu.context_switches", 4, "", []string(nil)) } -func TestCPUCheckLinuxErrorInCpuInfo(t *testing.T) { +func TestNumCoresError(t *testing.T) { + setupDefaultMocks() cpuInfoError := errors.New("cpu.Check: could not query CPU info") - cpuInfoFunc = func() ([]cpu.InfoStat, error) { + getCpuInfo = func() ([]cpu.InfoStat, error) { return nil, cpuInfoError } cpuCheck := createCheck() m := mocksender.NewMockSender(cpuCheck.ID()) + m.SetupAcceptAll() - err := cpuCheck.Configure(m.GetSenderManager(), integration.FakeConfigHash, nil, nil, "test") + cpuCheck.Configure(m.GetSenderManager(), integration.FakeConfigHash, nil, nil, "test") + err := cpuCheck.Run() assert.Equal(t, cpuInfoError, err) + m.AssertNotCalled(t, "Gauge", "system.cpu.num_cores", mock.AnythingOfType("float64"), mock.AnythingOfType("string"), mock.AnythingOfType("[]string")) } -func TestCPUCheckLinuxErrorStoppedSender(t *testing.T) { - stoppedSenderError := errors.New("demultiplexer is stopped") - cpuInfoFunc = func() ([]cpu.InfoStat, error) { - return cpuInfo, nil - } +func TestNumCoresOk(t *testing.T) { + setupDefaultMocks() cpuCheck := createCheck() m := mocksender.NewMockSender(cpuCheck.ID()) + m.SetupAcceptAll() cpuCheck.Configure(m.GetSenderManager(), integration.FakeConfigHash, nil, nil, "test") - m.GetSenderManager().(*aggregator.AgentDemultiplexer).Stop(false) err := cpuCheck.Run() - assert.Equal(t, stoppedSenderError, err) + assert.Equal(t, nil, err) + m.AssertMetric(t, "Gauge", "system.cpu.num_cores", 1, "", nil) } -func TestCPUCheckLinuxErrorProcFsPathNoExists(t *testing.T) { - pkgconfigsetup.Datadog().SetDefault("procfs_path", "/tmp") - cpuInfoFunc = func() ([]cpu.InfoStat, error) { - return cpuInfo, nil - } - cpuTimesFunc = func(bool) ([]cpu.TimesStat, error) { - return firstSample, nil +func TestSystemCpuMetricsError(t *testing.T) { + setupDefaultMocks() + cpuTimesError := errors.New("cpu.Check: could not query CPU times") + getCpuTimes = func(bool) ([]cpu.TimesStat, error) { + return nil, cpuTimesError } cpuCheck := createCheck() m := mocksender.NewMockSender(cpuCheck.ID()) - m.On(metrics.GaugeType.String(), "system.cpu.num_cores", float64(1), mock.AnythingOfType("string"), mock.AnythingOfType("[]string")).Return().Times(1) - m.On("Commit").Return().Times(1) + m.SetupAcceptAll() cpuCheck.Configure(m.GetSenderManager(), integration.FakeConfigHash, nil, nil, "test") err := cpuCheck.Run() - assert.Nil(t, err) - m.AssertExpectations(t) - m.AssertNumberOfCalls(t, metrics.MonotonicCountType.String(), 0) + assert.Equal(t, cpuTimesError, err) + m.AssertNotCalled(t, "Gauge", "system.cpu.user", mock.AnythingOfType("float64"), mock.AnythingOfType("string"), mock.AnythingOfType("[]string")) + m.AssertNotCalled(t, "Gauge", "system.cpu.system", mock.AnythingOfType("float64"), mock.AnythingOfType("string"), mock.AnythingOfType("[]string")) + m.AssertNotCalled(t, "Gauge", "system.cpu.interrupt", mock.AnythingOfType("float64"), mock.AnythingOfType("string"), mock.AnythingOfType("[]string")) + m.AssertNotCalled(t, "Gauge", "system.cpu.iowait", mock.AnythingOfType("float64"), mock.AnythingOfType("string"), mock.AnythingOfType("[]string")) + m.AssertNotCalled(t, "Gauge", "system.cpu.idle", mock.AnythingOfType("float64"), mock.AnythingOfType("string"), mock.AnythingOfType("[]string")) + m.AssertNotCalled(t, "Gauge", "system.cpu.stolen", mock.AnythingOfType("float64"), mock.AnythingOfType("string"), mock.AnythingOfType("[]string")) + m.AssertNotCalled(t, "Gauge", "system.cpu.guest", mock.AnythingOfType("float64"), mock.AnythingOfType("string"), mock.AnythingOfType("[]string")) } -func TestCPUCheckLinuxErrorProcFsPathEmptyFile(t *testing.T) { - tempFilePath := filepath.Join(os.TempDir(), "stat") - tempFile, err := os.Create(tempFilePath) - if err != nil { - t.Fatal("Error creating temporary file:", err) - } - defer os.Remove(tempFile.Name()) - pkgconfigsetup.Datadog().SetDefault("procfs_path", os.TempDir()) - cpuInfoFunc = func() ([]cpu.InfoStat, error) { - return cpuInfo, nil - } - cpuTimesFunc = func(bool) ([]cpu.TimesStat, error) { - return firstSample, nil +func TestSystemCpuMetricsEmpty(t *testing.T) { + setupDefaultMocks() + expectedError := errors.New("no cpu stats retrieve (empty results)") + getCpuTimes = func(bool) ([]cpu.TimesStat, error) { + return []cpu.TimesStat{}, nil } cpuCheck := createCheck() m := mocksender.NewMockSender(cpuCheck.ID()) - m.On(metrics.GaugeType.String(), "system.cpu.num_cores", float64(1), mock.AnythingOfType("string"), mock.AnythingOfType("[]string")).Return().Times(1) - m.On("Commit").Return().Times(1) + m.SetupAcceptAll() cpuCheck.Configure(m.GetSenderManager(), integration.FakeConfigHash, nil, nil, "test") - err = cpuCheck.Run() + err := cpuCheck.Run() - assert.Nil(t, err) - m.AssertExpectations(t) - m.AssertNumberOfCalls(t, metrics.MonotonicCountType.String(), 0) + assert.Equal(t, expectedError, err) + m.AssertNotCalled(t, "Gauge", "system.cpu.user", mock.AnythingOfType("float64"), mock.AnythingOfType("string"), mock.AnythingOfType("[]string")) + m.AssertNotCalled(t, "Gauge", "system.cpu.system", mock.AnythingOfType("float64"), mock.AnythingOfType("string"), mock.AnythingOfType("[]string")) + m.AssertNotCalled(t, "Gauge", "system.cpu.interrupt", mock.AnythingOfType("float64"), mock.AnythingOfType("string"), mock.AnythingOfType("[]string")) + m.AssertNotCalled(t, "Gauge", "system.cpu.iowait", mock.AnythingOfType("float64"), mock.AnythingOfType("string"), mock.AnythingOfType("[]string")) + m.AssertNotCalled(t, "Gauge", "system.cpu.idle", mock.AnythingOfType("float64"), mock.AnythingOfType("string"), mock.AnythingOfType("[]string")) + m.AssertNotCalled(t, "Gauge", "system.cpu.stolen", mock.AnythingOfType("float64"), mock.AnythingOfType("string"), mock.AnythingOfType("[]string")) + m.AssertNotCalled(t, "Gauge", "system.cpu.guest", mock.AnythingOfType("float64"), mock.AnythingOfType("string"), mock.AnythingOfType("[]string")) } -func TestCPUCheckLinuxErrorProcFsPathWrongFormat(t *testing.T) { - tempFilePath := filepath.Join(os.TempDir(), "stat") - tempFile, err := os.Create(tempFilePath) - if err != nil { - t.Fatal("Error creating temporary file:", err) - } - defer os.Remove(tempFile.Name()) - _, err = tempFile.WriteString("ctxt string_value\n") - if err != nil { - t.Fatal("Error writing to temporary file:", err) - } - pkgconfigsetup.Datadog().SetDefault("procfs_path", os.TempDir()) - cpuInfoFunc = func() ([]cpu.InfoStat, error) { - return cpuInfo, nil - } - cpuTimesFunc = func(bool) ([]cpu.TimesStat, error) { - return firstSample, nil - } +func TestSystemCpuMetricsNotReportedOnFirstCheck(t *testing.T) { + setupDefaultMocks() cpuCheck := createCheck() m := mocksender.NewMockSender(cpuCheck.ID()) - m.On(metrics.GaugeType.String(), "system.cpu.num_cores", float64(1), mock.AnythingOfType("string"), mock.AnythingOfType("[]string")).Return().Times(1) - m.On("Commit").Return().Times(1) + m.SetupAcceptAll() cpuCheck.Configure(m.GetSenderManager(), integration.FakeConfigHash, nil, nil, "test") - err = cpuCheck.Run() + err := cpuCheck.Run() - assert.Nil(t, err) - m.AssertExpectations(t) - m.AssertNumberOfCalls(t, metrics.MonotonicCountType.String(), 0) + assert.Equal(t, nil, err) + m.AssertNotCalled(t, "Gauge", "system.cpu.user", mock.AnythingOfType("float64"), mock.AnythingOfType("string"), mock.AnythingOfType("[]string")) + m.AssertNotCalled(t, "Gauge", "system.cpu.system", mock.AnythingOfType("float64"), mock.AnythingOfType("string"), mock.AnythingOfType("[]string")) + m.AssertNotCalled(t, "Gauge", "system.cpu.interrupt", mock.AnythingOfType("float64"), mock.AnythingOfType("string"), mock.AnythingOfType("[]string")) + m.AssertNotCalled(t, "Gauge", "system.cpu.iowait", mock.AnythingOfType("float64"), mock.AnythingOfType("string"), mock.AnythingOfType("[]string")) + m.AssertNotCalled(t, "Gauge", "system.cpu.idle", mock.AnythingOfType("float64"), mock.AnythingOfType("string"), mock.AnythingOfType("[]string")) + m.AssertNotCalled(t, "Gauge", "system.cpu.stolen", mock.AnythingOfType("float64"), mock.AnythingOfType("string"), mock.AnythingOfType("[]string")) + m.AssertNotCalled(t, "Gauge", "system.cpu.guest", mock.AnythingOfType("float64"), mock.AnythingOfType("string"), mock.AnythingOfType("[]string")) } -func TestCPUCheckLinuxErrorInCpuTimes(t *testing.T) { - cpuTimesError := errors.New("cpu Times error") - cpuInfoFunc = func() ([]cpu.InfoStat, error) { - return cpuInfo, nil - } - cpuTimesFunc = func(bool) ([]cpu.TimesStat, error) { - return nil, cpuTimesError +func TestSystemCpuMetricsReportedOnSecondCheck(t *testing.T) { + setupDefaultMocks() + firstCall := true + getCpuTimes = func(perCpu bool) ([]cpu.TimesStat, error) { + if perCpu { + return perCPUSamples, nil + } + if firstCall { + firstCall = false + return []cpu.TimesStat{firstTotalSample}, nil + } + return []cpu.TimesStat{secondTotalSample}, nil } cpuCheck := createCheck() m := mocksender.NewMockSender(cpuCheck.ID()) + m.SetupAcceptAll() cpuCheck.Configure(m.GetSenderManager(), integration.FakeConfigHash, nil, nil, "test") + cpuCheck.Run() err := cpuCheck.Run() - assert.Equal(t, cpuTimesError, err) + assert.Equal(t, nil, err) + m.AssertMetric(t, "Gauge", "system.cpu.user", 3.640295548747522, "", []string(nil)) + m.AssertMetric(t, "Gauge", "system.cpu.system", 95.60281131735448, "", []string(nil)) + m.AssertMetric(t, "Gauge", "system.cpu.interrupt", 5.496485853306902, "", []string(nil)) + m.AssertMetric(t, "Gauge", "system.cpu.iowait", 0.7208506037123806, "", []string(nil)) + m.AssertMetric(t, "Gauge", "system.cpu.idle", 0.0, "", []string(nil)) + m.AssertMetric(t, "Gauge", "system.cpu.stolen", 0.03604253018561903, "", []string(nil)) + m.AssertMetric(t, "Gauge", "system.cpu.guest", 0.0, "", []string(nil)) } -func TestCPUCheckLinuxEmptyCpuTimes(t *testing.T) { - expectedError := errors.New("no cpu stats retrieve (empty results)") - cpuInfoFunc = func() ([]cpu.InfoStat, error) { - return cpuInfo, nil +func TestSystemCpuMetricsPerCpuError(t *testing.T) { + setupDefaultMocks() + cpuTimesError := errors.New("cpu.Check: could not query CPU times") + getCpuTimes = func(perCpu bool) ([]cpu.TimesStat, error) { + if perCpu { + return nil, cpuTimesError + } + return []cpu.TimesStat{firstTotalSample}, nil } - cpuTimesFunc = func(bool) ([]cpu.TimesStat, error) { - return []cpu.TimesStat{}, nil + cpuCheck := createCheck() + m := mocksender.NewMockSender(cpuCheck.ID()) + m.SetupAcceptAll() + + cpuCheck.Configure(m.GetSenderManager(), integration.FakeConfigHash, []byte(`report_total_percpu: true`), nil, "test") + err := cpuCheck.Run() + + assert.Equal(t, cpuTimesError, err) + m.AssertNotCalled(t, "Gauge", "system.cpu.user.total", mock.AnythingOfType("float64"), mock.AnythingOfType("string"), mock.AnythingOfType("[]string")) + m.AssertNotCalled(t, "Gauge", "system.cpu.nice.total", mock.AnythingOfType("float64"), mock.AnythingOfType("string"), mock.AnythingOfType("[]string")) + m.AssertNotCalled(t, "Gauge", "system.cpu.system.total", mock.AnythingOfType("float64"), mock.AnythingOfType("string"), mock.AnythingOfType("[]string")) + m.AssertNotCalled(t, "Gauge", "system.cpu.idle.total", mock.AnythingOfType("float64"), mock.AnythingOfType("string"), mock.AnythingOfType("[]string")) + m.AssertNotCalled(t, "Gauge", "system.cpu.iowait.total", mock.AnythingOfType("float64"), mock.AnythingOfType("string"), mock.AnythingOfType("[]string")) + m.AssertNotCalled(t, "Gauge", "system.cpu.irq.total", mock.AnythingOfType("float64"), mock.AnythingOfType("string"), mock.AnythingOfType("[]string")) + m.AssertNotCalled(t, "Gauge", "system.cpu.softirq.total", mock.AnythingOfType("float64"), mock.AnythingOfType("string"), mock.AnythingOfType("[]string")) + m.AssertNotCalled(t, "Gauge", "system.cpu.steal.total", mock.AnythingOfType("float64"), mock.AnythingOfType("string"), mock.AnythingOfType("[]string")) + m.AssertNotCalled(t, "Gauge", "system.cpu.guest.total", mock.AnythingOfType("float64"), mock.AnythingOfType("string"), mock.AnythingOfType("[]string")) + m.AssertNotCalled(t, "Gauge", "system.cpu.guestnice.total", mock.AnythingOfType("float64"), mock.AnythingOfType("string"), mock.AnythingOfType("[]string")) + +} + +func TestSystemCpuMetricsPerCpuDefault(t *testing.T) { + setupDefaultMocks() + getCpuTimes = func(perCpu bool) ([]cpu.TimesStat, error) { + if perCpu { + return perCPUSamples, nil + } + return []cpu.TimesStat{firstTotalSample}, nil } cpuCheck := createCheck() m := mocksender.NewMockSender(cpuCheck.ID()) + m.SetupAcceptAll() cpuCheck.Configure(m.GetSenderManager(), integration.FakeConfigHash, nil, nil, "test") err := cpuCheck.Run() - assert.Equal(t, expectedError, err) + assert.Equal(t, nil, err) + m.AssertMetric(t, "Gauge", "system.cpu.user.total", 29386, "", []string{"core:cpu-total"}) + m.AssertMetric(t, "Gauge", "system.cpu.nice.total", 623, "", []string{"core:cpu-total"}) + m.AssertMetric(t, "Gauge", "system.cpu.system.total", 63584, "", []string{"core:cpu-total"}) + m.AssertMetric(t, "Gauge", "system.cpu.idle.total", 96761, "", []string{"core:cpu-total"}) + m.AssertMetric(t, "Gauge", "system.cpu.iowait.total", 12113, "", []string{"core:cpu-total"}) + m.AssertMetric(t, "Gauge", "system.cpu.irq.total", 10, "", []string{"core:cpu-total"}) + m.AssertMetric(t, "Gauge", "system.cpu.softirq.total", 1151, "", []string{"core:cpu-total"}) + m.AssertMetric(t, "Gauge", "system.cpu.steal.total", 0.0, "", []string{"core:cpu-total"}) + m.AssertMetric(t, "Gauge", "system.cpu.guest.total", 0.0, "", []string{"core:cpu-total"}) + m.AssertMetric(t, "Gauge", "system.cpu.guestnice.total", 0.0, "", []string{"core:cpu-total"}) +} +func TestSystemCpuMetricsPerCpuFalse(t *testing.T) { + setupDefaultMocks() + getCpuTimes = func(perCpu bool) ([]cpu.TimesStat, error) { + if perCpu { + return perCPUSamples, nil + } + return []cpu.TimesStat{firstTotalSample}, nil + } + cpuCheck := createCheck() + m := mocksender.NewMockSender(cpuCheck.ID()) + m.SetupAcceptAll() + + cpuCheck.Configure(m.GetSenderManager(), integration.FakeConfigHash, []byte(`report_total_percpu: false`), nil, "test") + err := cpuCheck.Run() + + assert.Equal(t, nil, err) + m.AssertMetric(t, "Gauge", "system.cpu.user.total", 29386, "", []string{"core:cpu-total"}) + m.AssertMetric(t, "Gauge", "system.cpu.nice.total", 623, "", []string{"core:cpu-total"}) + m.AssertMetric(t, "Gauge", "system.cpu.system.total", 63584, "", []string{"core:cpu-total"}) + m.AssertMetric(t, "Gauge", "system.cpu.idle.total", 96761, "", []string{"core:cpu-total"}) + m.AssertMetric(t, "Gauge", "system.cpu.iowait.total", 12113, "", []string{"core:cpu-total"}) + m.AssertMetric(t, "Gauge", "system.cpu.irq.total", 10, "", []string{"core:cpu-total"}) + m.AssertMetric(t, "Gauge", "system.cpu.softirq.total", 1151, "", []string{"core:cpu-total"}) + m.AssertMetric(t, "Gauge", "system.cpu.steal.total", 0.0, "", []string{"core:cpu-total"}) + m.AssertMetric(t, "Gauge", "system.cpu.guest.total", 0.0, "", []string{"core:cpu-total"}) + m.AssertMetric(t, "Gauge", "system.cpu.guestnice.total", 0.0, "", []string{"core:cpu-total"}) +} +func TestSystemCpuMetricsPerCpuTrue(t *testing.T) { + setupDefaultMocks() + getCpuTimes = func(perCpu bool) ([]cpu.TimesStat, error) { + if perCpu { + return perCPUSamples, nil + } + return []cpu.TimesStat{firstTotalSample}, nil + } + cpuCheck := createCheck() + m := mocksender.NewMockSender(cpuCheck.ID()) + m.SetupAcceptAll() + + cpuCheck.Configure(m.GetSenderManager(), integration.FakeConfigHash, []byte(`report_total_percpu: true`), nil, "test") + err := cpuCheck.Run() + + assert.Equal(t, nil, err) + m.AssertMetric(t, "Gauge", "system.cpu.user.total", 83970.9, "", []string{"core:cpu0"}) + m.AssertMetric(t, "Gauge", "system.cpu.user.total", 82638.9, "", []string{"core:cpu1"}) + m.AssertMetric(t, "Gauge", "system.cpu.nice.total", 0.0, "", []string{"core:cpu0"}) + m.AssertMetric(t, "Gauge", "system.cpu.nice.total", 50.0, "", []string{"core:cpu1"}) + m.AssertMetric(t, "Gauge", "system.cpu.system.total", 64060.9, "", []string{"core:cpu0"}) + m.AssertMetric(t, "Gauge", "system.cpu.system.total", 61564.1, "", []string{"core:cpu1"}) + m.AssertMetric(t, "Gauge", "system.cpu.idle.total", 208877.4, "", []string{"core:cpu0"}) + m.AssertMetric(t, "Gauge", "system.cpu.idle.total", 212758.8, "", []string{"core:cpu1"}) + m.AssertMetric(t, "Gauge", "system.cpu.iowait.total", 12.1, "", []string{"core:cpu0"}) + m.AssertMetric(t, "Gauge", "system.cpu.iowait.total", 1.2, "", []string{"core:cpu1"}) + m.AssertMetric(t, "Gauge", "system.cpu.irq.total", 43.5, "", []string{"core:cpu0"}) + m.AssertMetric(t, "Gauge", "system.cpu.irq.total", 2.3, "", []string{"core:cpu1"}) + m.AssertMetric(t, "Gauge", "system.cpu.softirq.total", 8.6, "", []string{"core:cpu0"}) + m.AssertMetric(t, "Gauge", "system.cpu.softirq.total", 3.4, "", []string{"core:cpu1"}) + m.AssertMetric(t, "Gauge", "system.cpu.steal.total", 65.9, "", []string{"core:cpu0"}) + m.AssertMetric(t, "Gauge", "system.cpu.steal.total", 4.5, "", []string{"core:cpu1"}) + m.AssertMetric(t, "Gauge", "system.cpu.guest.total", 2.4, "", []string{"core:cpu0"}) + m.AssertMetric(t, "Gauge", "system.cpu.guest.total", 5.6, "", []string{"core:cpu1"}) + m.AssertMetric(t, "Gauge", "system.cpu.guestnice.total", 5.1, "", []string{"core:cpu0"}) + m.AssertMetric(t, "Gauge", "system.cpu.guestnice.total", 6.7, "", []string{"core:cpu1"}) } diff --git a/pkg/collector/corechecks/system/cpu/load/load.go b/pkg/collector/corechecks/system/cpu/load/load.go index 6d6aa1833dedb..52be3ea30e08a 100644 --- a/pkg/collector/corechecks/system/cpu/load/load.go +++ b/pkg/collector/corechecks/system/cpu/load/load.go @@ -10,8 +10,8 @@ package load import ( "fmt" - "github.com/shirou/gopsutil/v3/cpu" - "github.com/shirou/gopsutil/v3/load" + "github.com/shirou/gopsutil/v4/cpu" + "github.com/shirou/gopsutil/v4/load" "github.com/DataDog/datadog-agent/comp/core/autodiscovery/integration" "github.com/DataDog/datadog-agent/pkg/aggregator/sender" diff --git a/pkg/collector/corechecks/system/cpu/load/load_test.go b/pkg/collector/corechecks/system/cpu/load/load_test.go index af820e8fc21fa..fd140edd86ffd 100644 --- a/pkg/collector/corechecks/system/cpu/load/load_test.go +++ b/pkg/collector/corechecks/system/cpu/load/load_test.go @@ -9,9 +9,9 @@ package load import ( "testing" - "github.com/shirou/gopsutil/v3/load" + "github.com/shirou/gopsutil/v4/load" - "github.com/shirou/gopsutil/v3/cpu" + "github.com/shirou/gopsutil/v4/cpu" "github.com/DataDog/datadog-agent/comp/core/autodiscovery/integration" "github.com/DataDog/datadog-agent/pkg/aggregator/mocksender" diff --git a/pkg/collector/corechecks/system/disk/disk/disk_nix.go b/pkg/collector/corechecks/system/disk/disk/disk_nix.go index 23a03601724a1..7a384f377056c 100644 --- a/pkg/collector/corechecks/system/disk/disk/disk_nix.go +++ b/pkg/collector/corechecks/system/disk/disk/disk_nix.go @@ -11,7 +11,7 @@ import ( "fmt" "path/filepath" - "github.com/shirou/gopsutil/v3/disk" + "github.com/shirou/gopsutil/v4/disk" "github.com/DataDog/datadog-agent/comp/core/autodiscovery/integration" "github.com/DataDog/datadog-agent/pkg/aggregator/sender" diff --git a/pkg/collector/corechecks/system/disk/disk/disk_test.go b/pkg/collector/corechecks/system/disk/disk/disk_test.go index 76aae7d0cfc36..2934b7fe9ed11 100644 --- a/pkg/collector/corechecks/system/disk/disk/disk_test.go +++ b/pkg/collector/corechecks/system/disk/disk/disk_test.go @@ -10,7 +10,7 @@ import ( "regexp" "testing" - "github.com/shirou/gopsutil/v3/disk" + "github.com/shirou/gopsutil/v4/disk" "github.com/DataDog/datadog-agent/comp/core/autodiscovery/integration" "github.com/DataDog/datadog-agent/pkg/aggregator/mocksender" diff --git a/pkg/collector/corechecks/system/disk/io/iostats.go b/pkg/collector/corechecks/system/disk/io/iostats.go index 2cdf7647bf14a..b40315ebff0af 100644 --- a/pkg/collector/corechecks/system/disk/io/iostats.go +++ b/pkg/collector/corechecks/system/disk/io/iostats.go @@ -20,7 +20,7 @@ import ( ) const ( - // SectorSize is used here to substitute non-exporeted from github.com/shirou/gopsutil/v3/disk package constant named "sectorSize" + // SectorSize is used here to substitute non-exporeted from github.com/shirou/gopsutil/v4/disk package constant named "sectorSize" SectorSize = 512 kB = (1 << 10) CheckName = "io" diff --git a/pkg/collector/corechecks/system/disk/io/iostats_nix.go b/pkg/collector/corechecks/system/disk/io/iostats_nix.go index 8fe5b1e66da5e..e3813f162da9e 100644 --- a/pkg/collector/corechecks/system/disk/io/iostats_nix.go +++ b/pkg/collector/corechecks/system/disk/io/iostats_nix.go @@ -13,8 +13,8 @@ import ( "regexp" "time" - "github.com/shirou/gopsutil/v3/disk" - "github.com/shirou/gopsutil/v3/mem" // for system.io.block_{in,out} + "github.com/shirou/gopsutil/v4/disk" + "github.com/shirou/gopsutil/v4/mem" // for system.io.block_{in,out} "github.com/DataDog/datadog-agent/comp/core/autodiscovery/integration" "github.com/DataDog/datadog-agent/pkg/aggregator/sender" diff --git a/pkg/collector/corechecks/system/disk/io/iostats_nix_test.go b/pkg/collector/corechecks/system/disk/io/iostats_nix_test.go index 21bfbef4109da..61a60ccab654d 100644 --- a/pkg/collector/corechecks/system/disk/io/iostats_nix_test.go +++ b/pkg/collector/corechecks/system/disk/io/iostats_nix_test.go @@ -12,7 +12,7 @@ import ( "testing" "time" - "github.com/shirou/gopsutil/v3/disk" + "github.com/shirou/gopsutil/v4/disk" "github.com/stretchr/testify/assert" "github.com/DataDog/datadog-agent/comp/core/autodiscovery/integration" diff --git a/pkg/collector/corechecks/system/disk/io/iostats_test.go b/pkg/collector/corechecks/system/disk/io/iostats_test.go index 005b4aad3ebda..bb7d3eaef18b7 100644 --- a/pkg/collector/corechecks/system/disk/io/iostats_test.go +++ b/pkg/collector/corechecks/system/disk/io/iostats_test.go @@ -12,8 +12,8 @@ import ( "testing" "time" - "github.com/shirou/gopsutil/v3/disk" - "github.com/shirou/gopsutil/v3/mem" + "github.com/shirou/gopsutil/v4/disk" + "github.com/shirou/gopsutil/v4/mem" "github.com/DataDog/datadog-agent/comp/core/autodiscovery/integration" "github.com/DataDog/datadog-agent/pkg/aggregator" diff --git a/pkg/collector/corechecks/system/memory/memory_nix.go b/pkg/collector/corechecks/system/memory/memory_nix.go index 190a4c7e02b41..577fb222bb97b 100644 --- a/pkg/collector/corechecks/system/memory/memory_nix.go +++ b/pkg/collector/corechecks/system/memory/memory_nix.go @@ -11,7 +11,7 @@ import ( "fmt" "runtime" - "github.com/shirou/gopsutil/v3/mem" + "github.com/shirou/gopsutil/v4/mem" "github.com/DataDog/datadog-agent/pkg/util/log" diff --git a/pkg/collector/corechecks/system/memory/memory_nix_test.go b/pkg/collector/corechecks/system/memory/memory_nix_test.go index b7cfd2e55a3f9..e8be54dbb93a9 100644 --- a/pkg/collector/corechecks/system/memory/memory_nix_test.go +++ b/pkg/collector/corechecks/system/memory/memory_nix_test.go @@ -11,7 +11,7 @@ import ( "fmt" "testing" - "github.com/shirou/gopsutil/v3/mem" + "github.com/shirou/gopsutil/v4/mem" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/pkg/collector/corechecks/system/uptime/uptime_nix.go b/pkg/collector/corechecks/system/uptime/uptime_nix.go index cc121ac42de61..41c8421153e3b 100644 --- a/pkg/collector/corechecks/system/uptime/uptime_nix.go +++ b/pkg/collector/corechecks/system/uptime/uptime_nix.go @@ -7,7 +7,7 @@ package uptime import ( - "github.com/shirou/gopsutil/v3/host" + "github.com/shirou/gopsutil/v4/host" ) // For testing purpose diff --git a/pkg/collector/python/datadog_agent.go b/pkg/collector/python/datadog_agent.go index 95a0b2f69f19d..0db3427d340c2 100644 --- a/pkg/collector/python/datadog_agent.go +++ b/pkg/collector/python/datadog_agent.go @@ -245,6 +245,7 @@ var ( // the GIL is always locked when calling c code from python which means that the exported functions in this file // will only ever be called by one goroutine at a time obfuscator *obfuscate.Obfuscator + obfuscaterConfig obfuscate.Config // For testing purposes obfuscatorLoader sync.Once ) @@ -253,21 +254,23 @@ var ( // will definitely be initialized by the time one of the python checks runs func lazyInitObfuscator() *obfuscate.Obfuscator { obfuscatorLoader.Do(func() { - var cfg obfuscate.Config - if err := structure.UnmarshalKey(pkgconfigsetup.Datadog(), "apm_config.obfuscation", &cfg); err != nil { + if err := structure.UnmarshalKey(pkgconfigsetup.Datadog(), "apm_config.obfuscation", &obfuscaterConfig); err != nil { log.Errorf("Failed to unmarshal apm_config.obfuscation: %s", err.Error()) - cfg = obfuscate.Config{} + obfuscaterConfig = obfuscate.Config{} } - if !cfg.SQLExecPlan.Enabled { - cfg.SQLExecPlan = defaultSQLPlanObfuscateSettings + if !obfuscaterConfig.SQLExecPlan.Enabled { + obfuscaterConfig.SQLExecPlan = defaultSQLPlanObfuscateSettings } - if !cfg.SQLExecPlanNormalize.Enabled { - cfg.SQLExecPlanNormalize = defaultSQLPlanNormalizeSettings + if !obfuscaterConfig.SQLExecPlanNormalize.Enabled { + obfuscaterConfig.SQLExecPlanNormalize = defaultSQLPlanNormalizeSettings } - if !cfg.Mongo.Enabled { - cfg.Mongo = defaultMongoObfuscateSettings + if len(obfuscaterConfig.Mongo.KeepValues) == 0 { + obfuscaterConfig.Mongo.KeepValues = defaultMongoObfuscateSettings.KeepValues } - obfuscator = obfuscate.NewObfuscator(cfg) + if len(obfuscaterConfig.Mongo.ObfuscateSQLValues) == 0 { + obfuscaterConfig.Mongo.ObfuscateSQLValues = defaultMongoObfuscateSettings.ObfuscateSQLValues + } + obfuscator = obfuscate.NewObfuscator(obfuscaterConfig) }) return obfuscator } diff --git a/pkg/collector/python/datadog_agent_test.go b/pkg/collector/python/datadog_agent_test.go index 5a73902e55911..d98a23fefdc7c 100644 --- a/pkg/collector/python/datadog_agent_test.go +++ b/pkg/collector/python/datadog_agent_test.go @@ -38,3 +38,7 @@ func TestSetExternalTags(t *testing.T) { func TestEmitAgentTelemetry(t *testing.T) { testEmitAgentTelemetry(t) } + +func TestObfuscaterConfig(t *testing.T) { + testObfuscaterConfig(t) +} diff --git a/pkg/collector/python/init_windows.go b/pkg/collector/python/init_windows.go index 04d18175df1f7..3de1ba7a459b0 100644 --- a/pkg/collector/python/init_windows.go +++ b/pkg/collector/python/init_windows.go @@ -9,8 +9,10 @@ package python import ( "os" + "path/filepath" pkgconfigsetup "github.com/DataDog/datadog-agent/pkg/config/setup" + "github.com/DataDog/datadog-agent/pkg/util/winutil" ) // Any platform-specific initialization belongs here. @@ -21,5 +23,41 @@ func initializePlatform() error { os.Unsetenv("PYTHONPATH") } + // only use cache file when not admin + admin, _ := winutil.IsUserAnAdmin() + if !admin { + err := enableSeparatePythonCacheDir() + if err != nil { + return err + } + } + return nil } + +// enableSeparatePythonCacheDir configures Python to use a separate directory for its pycache. +// +// Creates a python-cache subdir in the configuration directory and configures Python to use it via the PYTHONPYCACHEPREFIX env var. +// +// https://docs.python.org/3/using/cmdline.html#envvar-PYTHONPYCACHEPREFIX +func enableSeparatePythonCacheDir() error { + pd, err := winutil.GetProgramDataDir() + if err != nil { + return err + } + pycache := filepath.Join(pd, "python-cache") + + // check if path exists and create directory if it doesn't + if _, err := os.Stat(pycache); os.IsNotExist(err) { + if err := os.MkdirAll(pycache, 0755); err != nil { + return err + } + } else if err != nil { + return err + } + + os.Setenv("PYTHONPYCACHEPREFIX", pycache) + + return nil + +} diff --git a/pkg/collector/python/memory.go b/pkg/collector/python/memory.go index 38060ef37b462..3d77d1bdd31bb 100644 --- a/pkg/collector/python/memory.go +++ b/pkg/collector/python/memory.go @@ -14,8 +14,6 @@ import ( "sync" "unsafe" - "github.com/cihub/seelog" - pkgconfigsetup "github.com/DataDog/datadog-agent/pkg/config/setup" "github.com/DataDog/datadog-agent/pkg/telemetry" "github.com/DataDog/datadog-agent/pkg/util/log" @@ -76,7 +74,7 @@ func MemoryTracker(ptr unsafe.Pointer, sz C.size_t, op C.rtloader_mem_ops_t) { // but from profiling, even passing these vars through as arguments allocates to the heap. // This is an optimization to avoid even evaluating the `Tracef` call if the trace log // level is not enabled. - if log.ShouldLog(seelog.TraceLvl) { + if log.ShouldLog(log.TraceLvl) { log.Tracef("Memory Tracker - ptr: %v, sz: %v, op: %v", ptr, sz, op) } switch op { @@ -94,7 +92,7 @@ func MemoryTracker(ptr unsafe.Pointer, sz C.size_t, op C.rtloader_mem_ops_t) { if !ok { log.Debugf("untracked memory was attempted to be freed - set trace level for details") lvl, err := log.GetLogLevel() - if err == nil && lvl == seelog.TraceLvl { + if err == nil && lvl == log.TraceLvl { stack := string(debug.Stack()) log.Tracef("Memory Tracker - stacktrace: \n%s", stack) } diff --git a/pkg/collector/python/test_datadog_agent.go b/pkg/collector/python/test_datadog_agent.go index df436c43ab697..19bf1e24f04d4 100644 --- a/pkg/collector/python/test_datadog_agent.go +++ b/pkg/collector/python/test_datadog_agent.go @@ -10,6 +10,7 @@ package python import ( "context" "math/rand/v2" + "strings" "sync" "testing" "time" @@ -19,6 +20,9 @@ import ( yaml "gopkg.in/yaml.v2" "github.com/DataDog/datadog-agent/pkg/collector/externalhost" + pkgconfigmodel "github.com/DataDog/datadog-agent/pkg/config/model" + pkgconfigsetup "github.com/DataDog/datadog-agent/pkg/config/setup" + "github.com/DataDog/datadog-agent/pkg/obfuscate" "github.com/DataDog/datadog-agent/pkg/util" "github.com/DataDog/datadog-agent/pkg/util/hostname" "github.com/DataDog/datadog-agent/pkg/util/kubernetes/clustername" @@ -122,3 +126,47 @@ func testEmitAgentTelemetry(t *testing.T) { assert.True(t, true) } + +func testObfuscaterConfig(t *testing.T) { + pkgconfigmodel.CleanOverride(t) + conf := pkgconfigmodel.NewConfig("datadog", "DD", strings.NewReplacer(".", "_")) // nolint: forbidigo // legit use case + pkgconfigsetup.InitConfig(conf) + o := lazyInitObfuscator() + o.Stop() + expected := obfuscate.Config{ + ES: obfuscate.JSONConfig{ + Enabled: true, + KeepValues: []string{}, + ObfuscateSQLValues: []string{}, + }, + OpenSearch: obfuscate.JSONConfig{ + Enabled: true, + KeepValues: []string{}, + ObfuscateSQLValues: []string{}, + }, + Mongo: defaultMongoObfuscateSettings, + SQLExecPlan: defaultSQLPlanObfuscateSettings, + SQLExecPlanNormalize: defaultSQLPlanNormalizeSettings, + HTTP: obfuscate.HTTPConfig{ + RemoveQueryString: false, + RemovePathDigits: false, + }, + Redis: obfuscate.RedisConfig{ + Enabled: true, + RemoveAllArgs: false, + }, + Memcached: obfuscate.MemcachedConfig{ + Enabled: true, + KeepCommand: false, + }, + CreditCard: obfuscate.CreditCardsConfig{ + Enabled: true, + Luhn: false, + KeepValues: []string{}, + }, + Cache: obfuscate.CacheConfig{ + Enabled: true, + }, + } + assert.Equal(t, expected, obfuscaterConfig) +} diff --git a/pkg/commonchecks/corechecks.go b/pkg/commonchecks/corechecks.go index 9af1e7f9833c8..cb20f9412ab2a 100644 --- a/pkg/commonchecks/corechecks.go +++ b/pkg/commonchecks/corechecks.go @@ -62,7 +62,7 @@ func RegisterChecks(store workloadmeta.Component, tagger tagger.Component, cfg c corecheckLoader.RegisterCheck(uptime.CheckName, uptime.Factory()) corecheckLoader.RegisterCheck(telemetryCheck.CheckName, telemetryCheck.Factory(telemetry)) corecheckLoader.RegisterCheck(ntp.CheckName, ntp.Factory()) - corecheckLoader.RegisterCheck(snmp.CheckName, snmp.Factory()) + corecheckLoader.RegisterCheck(snmp.CheckName, snmp.Factory(cfg)) corecheckLoader.RegisterCheck(networkpath.CheckName, networkpath.Factory(telemetry)) corecheckLoader.RegisterCheck(io.CheckName, io.Factory()) corecheckLoader.RegisterCheck(filehandles.CheckName, filehandles.Factory()) 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/reporter.go b/pkg/compliance/reporter.go index 501ca6f10bc43..cf59ee9043489 100644 --- a/pkg/compliance/reporter.go +++ b/pkg/compliance/reporter.go @@ -44,7 +44,7 @@ func NewLogReporter(hostname string, sourceName, sourceType string, endpoints *c auditor.Start() // setup the pipeline provider that provides pairs of processor and sender - pipelineProvider := pipeline.NewProvider(config.NumberOfPipelines, auditor, &diagnostic.NoopMessageReceiver{}, nil, endpoints, dstcontext, agentimpl.NewStatusProvider(), hostnameimpl.NewHostnameService(), pkgconfigsetup.Datadog()) + pipelineProvider := pipeline.NewProvider(4, auditor, &diagnostic.NoopMessageReceiver{}, nil, endpoints, dstcontext, agentimpl.NewStatusProvider(), hostnameimpl.NewHostnameService(), pkgconfigsetup.Datadog()) pipelineProvider.Start() logSource := sources.NewLogSource( 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/autodiscovery/autodiscovery.go b/pkg/config/autodiscovery/autodiscovery.go index c1fab80232a55..e0feabf9968ff 100644 --- a/pkg/config/autodiscovery/autodiscovery.go +++ b/pkg/config/autodiscovery/autodiscovery.go @@ -9,6 +9,8 @@ package autodiscovery import ( + "errors" + "github.com/DataDog/datadog-agent/comp/core/autodiscovery/providers" "github.com/DataDog/datadog-agent/comp/core/autodiscovery/providers/names" "github.com/DataDog/datadog-agent/pkg/config/env" @@ -77,7 +79,7 @@ func DiscoverComponentsFromConfig() ([]pkgconfigsetup.ConfigurationProviders, [] // Auto-activate autodiscovery without listeners: - snmp snmpConfig, err := snmplistener.NewListenerConfig() - if err != nil { + if err != nil && !errors.Is(err, snmplistener.ErrNoConfigGiven) { log.Errorf("Error unmarshalling snmp listener config. Error: %v", err) } else if len(snmpConfig.Configs) > 0 { detectedListeners = append(detectedListeners, pkgconfigsetup.Listeners{Name: "snmp"}) diff --git a/pkg/config/config_template.yaml b/pkg/config/config_template.yaml index a858e50ce8b7f..95efa801eb565 100644 --- a/pkg/config/config_template.yaml +++ b/pkg/config/config_template.yaml @@ -1024,13 +1024,13 @@ api_key: ## @env DD_LOGS_CONFIG_INTEGRATIONS_LOGS_FILES_MAX_SIZE - integer - optional - default: 10 ## The max size in MB that an integration logs file is allowed to use # - # integrations_logs_files_max_size + # integrations_logs_files_max_size: 10 ## @param integrations_logs_total_usage - integer - optional - default: 100 ## @env DD_LOGS_CONFIG_INTEGRATIONS_LOGS_TOTAL_USAGE - integer - optional - default: 100 ## The total combined usage all integrations logs files can use # - # integrations_logs_total_usage + # integrations_logs_total_usage: 100 {{ end -}} {{- if .TraceAgent }} @@ -1197,7 +1197,7 @@ api_key: # remove_query_string: false ## @param DD_APM_OBFUSCATION_HTTP_REMOVE_PATHS_WITH_DIGITS - boolean - optional ## If enabled, path segments in URLs containing digits are replaced by "?" - # remove_path_with_digits: false + # remove_paths_with_digits: false # # memcached: ## @param DD_APM_OBFUSCATION_MEMCACHED_ENABLED - boolean - optional @@ -1235,33 +1235,33 @@ api_key: # remove_stack_traces: false # # sql_exec_plan: - ## @param DD_APM_SQL_EXEC_PLAN_ENABLED - boolean - optional + ## @param DD_APM_OBFUSCATION_SQL_EXEC_PLAN_ENABLED - boolean - optional ## Enables obfuscation rules for JSON query execution plans. Disabled by default. # enabled: false - ## @param DD_APM_SQL_EXEC_PLAN_KEEP_VALUES - object - optional + ## @param DD_APM_OBFUSCATION_SQL_EXEC_PLAN_KEEP_VALUES - object - optional ## List of keys that should not be obfuscated. # keep_values: # - id1 - ## @param DD_APM_SQL_EXEC_PLAN_OBFUSCATE_SQL_VALUES - boolean - optional + ## @param DD_APM_OBFUSCATION_SQL_EXEC_PLAN_OBFUSCATE_SQL_VALUES - boolean - optional ## The set of keys for which their values will be passed through SQL obfuscation # obfuscate_sql_values: # - val1 # # sql_exec_plan_normalize: - ## @param DD_APM_SQL_EXEC_PLAN_NORMALIZE_ENABLED - boolean - optional + ## @param DD_APM_OBFUSCATION_SQL_EXEC_PLAN_NORMALIZE_ENABLED - boolean - optional ## Enables obfuscation rules for JSON query execution plans, including cost and row estimates. ## Produces a normalized execution plan. Disabled by default. # enabled: false - ## @param DD_APM_SQL_EXEC_PLAN_NORMALIZE_KEEP_VALUES - object - optional + ## @param DD_APM_OBFUSCATION_SQL_EXEC_PLAN_NORMALIZE_KEEP_VALUES - object - optional ## List of keys that should not be obfuscated. # keep_values: # - id1 - ## @param DD_APM_SQL_EXEC_PLAN_NORMALIZE_OBFUSCATE_SQL_VALUES - boolean - optional + ## @param DD_APM_OBFUSCATION_SQL_EXEC_PLAN_NORMALIZE_OBFUSCATE_SQL_VALUES - boolean - optional ## The set of keys for which their values will be passed through SQL obfuscation # obfuscate_sql_values: # - val1 - # cache: - ## @param DD_APM_CACHE_ENABLED - boolean - optional + # cache: + ## @param DD_APM_OBFUSCATION_CACHE_ENABLED - boolean - optional ## Enables caching obfuscated statements. Currently supported for SQL and MongoDB queries. ## Enabled by default. # enabled: true @@ -1404,29 +1404,34 @@ api_key: # # port: 5012 - ## @param instrumentation_enabled - boolean - default: false - ## @env DD_APM_INSTRUMENTATION_ENABLED - boolean - default: false - ## Enables Single Step Instrumentation in the cluster (in beta) + ## @param instrumentation - custom object - optional + ## Specifies settings for Single Step Instrumentation. # - # instrumentation_enabled: false + # instrumentation: - ## @param instrumentation_enabled_namespaces - list of strings - optional - ## @env DD_APM_INSTRUMENTATION_ENABLED_NAMESPACES - space separated list of strings - optional - ## Enables Single Step Instrumentation in specific namespaces, while Single Step Instrumentation is off in the whole cluster (in beta) - ## Can only be set if DD_APM_INSTRUMENTATION_ENABLED is false. Cannot be set together with DD_APM_INSTRUMENTATION_DISABLED_NAMESPACES. - # - # instrumentation_enabled_namespaces: - # - ns1 - # - apps + ## @param enabled - boolean - default: false + ## @env DD_APM_INSTRUMENTATION_ENABLED - boolean - default: false + ## Enables Single Step Instrumentation in the cluster (in beta) + # + # enabled: false - ## @param instrumentation_disabled_namespaces - list of strings - optional - ## @env DD_APM_INSTRUMENTATION_DISABLED_NAMESPACES - space separated list of strings - optional - ## Disables Single Step Instrumentation in specific namespaces, while Single Step Instrumentation is enabled in the whole cluster (in beta) - ## Can only be set if DD_APM_INSTRUMENTATION_ENABLED is true. Cannot be set together with DD_APM_INSTRUMENTATION_ENABLED_NAMESPACES. - # - # instrumentation_disabled_namespaces: - # - ns2 - # - system-ns + ## @param enabled_namespaces - list of strings - optional + ## @env DD_APM_INSTRUMENTATION_ENABLED_NAMESPACES - space separated list of strings - optional + ## Enables Single Step Instrumentation in specific namespaces, while Single Step Instrumentation is off in the whole cluster (in beta) + ## Can only be set if DD_APM_INSTRUMENTATION_ENABLED is false. Cannot be set together with DD_APM_INSTRUMENTATION_DISABLED_NAMESPACES. + # + # enabled_namespaces: + # - ns1 + # - apps + + ## @param disabled_namespaces - list of strings - optional + ## @env DD_APM_INSTRUMENTATION_DISABLED_NAMESPACES - space separated list of strings - optional + ## Disables Single Step Instrumentation in specific namespaces, while Single Step Instrumentation is enabled in the whole cluster (in beta) + ## Can only be set if DD_APM_INSTRUMENTATION_ENABLED is true. Cannot be set together with DD_APM_INSTRUMENTATION_ENABLED_NAMESPACES. + # + # disabled_namespaces: + # - ns2 + # - system-ns ## @param trace_buffer - integer - optional - default: 0 ## @env DD_APM_TRACE_BUFFER - integer - optional - default: 0 @@ -1448,25 +1453,26 @@ api_key: ## Enables and configures the Probabilistic Sampler, compatible with the ## OTel Probabilistic Sampler Processor ( https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/probabilisticsamplerprocessor#probabilistic-sampling-processor ) ## - #probabilistic_sampler: - ## @env DD_APM_PROBABILISTIC_SAMPLER_ENABLED - boolean - optional - default: false - ## Enables or disables the probabilistic sampler - # enabled: false - # - ## @env DD_APM_PROBABILISTIC_SAMPLER_SAMPLING_PERCENTAGE - float - optional - default: 0 - ## Samples this percentage (0-100) of traffic - # sampling_percentage: 0 - # - ## @env DD_APM_PROBABILISTIC_SAMPLER_HASH_SEED - integer - optional - default: 0 - ## hash_seed: A seed used for the hash algorithm. This must match other agents and OTel - ## collectors using the probabilistic sampler to ensure consistent sampling. - # hash_seed: 0 + # probabilistic_sampler: + + ## @env DD_APM_PROBABILISTIC_SAMPLER_ENABLED - boolean - optional - default: false + ## Enables or disables the probabilistic sampler + # enabled: false + # + ## @env DD_APM_PROBABILISTIC_SAMPLER_SAMPLING_PERCENTAGE - float - optional - default: 0 + ## Samples this percentage (0-100) of traffic + # sampling_percentage: 0 + # + ## @env DD_APM_PROBABILISTIC_SAMPLER_HASH_SEED - integer - optional - default: 0 + ## hash_seed: A seed used for the hash algorithm. This must match other agents and OTel + ## collectors using the probabilistic sampler to ensure consistent sampling. + # hash_seed: 0 ## @param error_tracking_standalone - object - optional ## Enables Error Tracking Standalone ## - #error_tracking_standalone: - # + # error_tracking_standalone: + ## @param enabled - boolean - optional - default: false ## @env DD_APM_ERROR_TRACKING_STANDALONE_ENABLED - boolean - optional - default: false ## Enables or disables Error Tracking Standalone @@ -3613,7 +3619,7 @@ api_key: ## @param prometheus_scrape - custom object - optional ## This section configures the Autodiscovery based on the Prometheus annotations # -# prometheus: +# prometheus_scrape: ## @param enabled - boolean - optional - default: false ## Enables the prometheus config provider @@ -3864,50 +3870,50 @@ api_key: ## @param ignored_ip_addresses - list of strings - optional ## A list of IP addresses to ignore when scanning the network. # - # ignored_ip_addresses: - # - - # - + # ignored_ip_addresses: + # - + # - ## @param port - integer - optional - default: 161 ## The UDP port to use when connecting to SNMP devices. # - # port: 161 + # port: 161 ## @param snmp_version - integer - optional - default: ## Set the version of the SNMP protocol. Available options are: `1`, `2` or `3`. ## If unset, the Agent tries to guess the correct version based on other configuration ## parameters, for example: if `user` is set, the Agent uses SNMP v3. # - # snmp_version: + # snmp_version: ## @param timeout - integer - optional - default: 5 ## The number of seconds before timing out. # - # timeout: 5 + # timeout: 5 ## @param retries - integer - optional - default: 3 ## The number of retries before failure. # - # retries: 3 + # retries: 3 ## @param community_string - string - optional ## Required for SNMP v1 & v2. ## Enclose the community string with single quote like below (to avoid special characters being interpreted). ## Ex: 'public' # - # community_string: '' + # community_string: '' ## @param user - string - optional ## The username to connect to your SNMP devices. ## SNMPv3 only. # - # user: + # user: ## @param authKey - string - optional ## The passphrase to use with your Authentication type. ## SNMPv3 only. # - # authKey: + # authKey: ## @param authProtocol - string - optional ## The authentication protocol to use when connecting to your SNMP devices. @@ -3915,13 +3921,13 @@ api_key: ## Defaults to MD5 when `authentication_key` is specified. ## SNMPv3 only. # - # authProtocol: + # authProtocol: ## @param privKey - string - optional ## The passphrase to use with your privacy protocol. ## SNMPv3 only. # - # privKey: + # privKey: ## @param privProtocol - string - optional ## The privacy protocol to use when connecting to your SNMP devices. @@ -3929,35 +3935,35 @@ api_key: ## Defaults to DES when `privacy_key` is specified. ## SNMPv3 only. # - # privProtocol: + # privProtocol: ## @param context_name - string - optional ## The name of your context (optional SNMP v3-only parameter). # - # context_name: + # context_name: ## @param tags - list of strings - optional ## A list of tags to attach to every metric and service check of all devices discovered in the subnet. ## ## Learn more about tagging at https://docs.datadoghq.com/tagging # - # tags: - # - : - # - : + # tags: + # - : + # - : ## @param ad_identifier - string - optional - default: snmp ## A unique identifier to attach to devices from that subnetwork. ## When configuring the SNMP integration in snmp.d/auto_conf.yaml, ## specify the corresponding ad_identifier at the top of the file. # - # ad_identifier: snmp + # ad_identifier: snmp ## @param loader - string - optional - default: python ## Check loader to use. Available loaders: ## - core: will use corecheck SNMP integration ## - python: will use python SNMP integration # - # loader: core + # loader: core ## @param min_collection_interval - number - optional - default: 15 ## This changes the collection interval for the check instances created from @@ -3966,7 +3972,7 @@ api_key: ## For more information, see: ## https://docs.datadoghq.com/developers/write_agent_check/#collection-interval # - # min_collection_interval: 15 + # min_collection_interval: 15 ## @param use_device_id_as_hostname - boolean - optional - default: false ## Use `device:` (device_id is composed of `:`) as `hostname` @@ -3974,12 +3980,12 @@ api_key: ## `host:device:` as tag). ## This option is needed for custom tags. # - # use_device_id_as_hostname: true + # use_device_id_as_hostname: true ## @param oid_batch_size - integer - optional - default: 5 ## The number of OIDs handled by each batch. # - # oid_batch_size: 5 + # oid_batch_size: 5 ## @param interface_configs - map - optional ## This option is used to override interface inbound/outbound speed and add interface tags @@ -3994,27 +4000,27 @@ api_key: ## - "testTagKey:testTagValue" ## - "tagKey2:tagValue2" # - # interface_config: - # "10.0.0.1": - # - match_field: name - # match_value: eth0 - # in_speed: 50 - # out_speed: 25 - # - match_field: index - # match_value: '10' - # in_speed: 50 - # out_speed: 25 - # "10.0.0.2": - # - match_field: name - # match_value: eth3 - # in_speed: 50 - # out_speed: 25 - # "10.0.0.3": - # - match_field: name - # match_value: eth4 - # tags: - # - "monitored:true" - # - "customKey:customValue" + # interface_config: + # "10.0.0.1": + # - match_field: name + # match_value: eth0 + # in_speed: 50 + # out_speed: 25 + # - match_field: index + # match_value: '10' + # in_speed: 50 + # out_speed: 25 + # "10.0.0.2": + # - match_field: name + # match_value: eth3 + # in_speed: 50 + # out_speed: 25 + # "10.0.0.3": + # - match_field: name + # match_value: eth4 + # tags: + # - "monitored:true" + # - "customKey:customValue" ## @param ping - custom object - optional ## Configure ICMP pings for all hosts in SNMP autodiscovery @@ -4028,17 +4034,17 @@ api_key: ## of system-probe for elevated privileges. See ## system-probe.yaml.example for details. # - # ping: - # enabled: true # Disabled by default - # timeout: 3000 # Timeout in milliseconds - # count: 2 # Number of ping packets to send per check run - # interval: 10 # Time between sending pings (up to `count` packets) in milliseconds - # linux: # Linux-specific configuration - # use_raw_socket: true # Send pings in a privileged fashion using a raw socket. - # # This may be required if your system doesn't support - # # sending pings in an unprivileged fashion (using a UDP socket). - # # If `use_raw_socket` is set to true, you MUST also enable - # # system-probe which has elevated privileges. To enable it, see system-probe.yaml.example. + # ping: + # enabled: true # Disabled by default + # timeout: 3000 # Timeout in milliseconds + # count: 2 # Number of ping packets to send per check run + # interval: 10 # Time between sending pings (up to `count` packets) in milliseconds + # linux: # Linux-specific configuration + # use_raw_socket: true # Send pings in a privileged fashion using a raw socket. + # # This may be required if your system doesn't support + # # sending pings in an unprivileged fashion (using a UDP socket). + # # If `use_raw_socket` is set to true, you MUST also enable + # # system-probe which has elevated privileges. To enable it, see system-probe.yaml.example. ## @param snmp_traps - custom object - optional diff --git a/pkg/config/env/go.mod b/pkg/config/env/go.mod index 7188be93ca23d..7459e9817ef4f 100644 --- a/pkg/config/env/go.mod +++ b/pkg/config/env/go.mod @@ -8,42 +8,48 @@ replace ( github.com/DataDog/datadog-agent/pkg/util/log => ../../util/log/ github.com/DataDog/datadog-agent/pkg/util/scrubber => ../../util/scrubber/ github.com/DataDog/datadog-agent/pkg/util/system/socket => ../../util/system/socket/ + github.com/DataDog/datadog-agent/pkg/util/winutil => ../../util/winutil ) require ( github.com/DataDog/datadog-agent/pkg/config/model v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/util/filesystem v0.56.0-rc.3 - github.com/DataDog/datadog-agent/pkg/util/log v0.56.0-rc.3 + github.com/DataDog/datadog-agent/pkg/util/log v0.59.1 github.com/DataDog/datadog-agent/pkg/util/system/socket v0.56.0-rc.3 github.com/stretchr/testify v1.10.0 ) require ( - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.56.0-rc.3 // indirect - github.com/DataDog/viper v1.13.5 // indirect + 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.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 - github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 // indirect + github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c // indirect github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect 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/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // 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 github.com/spf13/pflag v1.0.5 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect go.uber.org/atomic v1.11.0 // indirect - golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f // indirect - golang.org/x/sys v0.27.0 // indirect - golang.org/x/text v0.20.0 // indirect + golang.org/x/exp v0.0.0-20241210194714-1829a127f884 // indirect + golang.org/x/sys v0.28.0 // indirect + golang.org/x/text v0.21.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) + +replace github.com/DataDog/datadog-agent/pkg/version => ../../version diff --git a/pkg/config/env/go.sum b/pkg/config/env/go.sum index 2e74083b10f1d..4444cb2abca5d 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= @@ -79,8 +81,8 @@ github.com/grpc-ecosystem/grpc-gateway v1.13.0/go.mod h1:8XEsbTttt/W+VvjtQhLACqC github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/hcl v1.0.1-vault-5 h1:kI3hhbbyzr4dldA8UdTb7ZlVVlI2DACdCfz31RPDgJM= github.com/hashicorp/hcl v1.0.1-vault-5/go.mod h1:XYhtn6ijBSAj6n4YqAaf7RBPS4I06AItNorpy+MoQNM= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 h1:S4qyfL2sEm5Budr4KVMyEniCy+PbS55651I/a+Kn/NQ= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb h1:PGufWXXDq9yaev6xX1YQauaO1MV90e6Mpoq1I7Lz/VM= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= @@ -122,8 +124,8 @@ github.com/pkg/errors v0.8.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-20220216144756-c35f1ee13d7c h1:NRoLoZvkBTKvR5gQLgA3e0hqjkY9u1wm+iOL45VN/qI= -github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 h1:o4JXh1EVt9k/+g42oCprj/FisM4qX9L3sZB3upGN2ZU= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= @@ -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= @@ -198,8 +200,8 @@ golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnf golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f h1:XdNn9LlyWAhLVp6P/i8QYBW+hlyhrhei9uErw2B5GJo= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f/go.mod h1:D5SMRVC3C2/4+F/DB1wZsLRnSNimn2Sp/NPsCrsv8ak= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884 h1:Y/Mj/94zIQQGHVSv1tTtQBDaQaJe62U9bkDZKKyhPCU= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -236,11 +238,11 @@ golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20220829200755-d48e67d00261/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.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/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= -golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= diff --git a/pkg/config/fetcher/from_processes.go b/pkg/config/fetcher/from_processes.go index 5b8088f41d970..e6f86f6c44e19 100644 --- a/pkg/config/fetcher/from_processes.go +++ b/pkg/config/fetcher/from_processes.go @@ -71,7 +71,7 @@ func TraceAgentConfig(config config.Reader) (string, error) { c := util.GetClient(false) c.Timeout = config.GetDuration("server_timeout") * time.Second - ipcAddressWithPort := fmt.Sprintf("http://127.0.0.1:%d/config", port) + ipcAddressWithPort := fmt.Sprintf("https://127.0.0.1:%d/config", port) client := settingshttp.NewClient(c, ipcAddressWithPort, "trace-agent", settingshttp.NewHTTPClientOptions(util.CloseConnection)) return client.FullConfig() @@ -94,7 +94,7 @@ func ProcessAgentConfig(config config.Reader, getEntireConfig bool) (string, err return "", fmt.Errorf("invalid process_config.cmd_port -- %d", port) } - ipcAddressWithPort := fmt.Sprintf("http://%s:%d/config", ipcAddress, port) + ipcAddressWithPort := fmt.Sprintf("https://%s:%d/config", ipcAddress, port) if getEntireConfig { ipcAddressWithPort += "/all" } diff --git a/pkg/config/mock/go.mod b/pkg/config/mock/go.mod index 041266bf69dff..ef7bc019049be 100644 --- a/pkg/config/mock/go.mod +++ b/pkg/config/mock/go.mod @@ -45,31 +45,32 @@ require ( github.com/DataDog/datadog-agent/pkg/util/executable v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/filesystem v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.59.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/log v0.59.1 // indirect github.com/DataDog/datadog-agent/pkg/util/optional v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/pointer v0.59.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.1 // indirect 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.0 // indirect - github.com/DataDog/viper v1.13.5 // 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.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 - github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 // indirect + github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb // indirect github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 // indirect - github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c // indirect + github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c // indirect github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect 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/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // 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 @@ -78,11 +79,13 @@ require ( github.com/tklauser/numcpus v0.8.0 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect go.uber.org/atomic v1.11.0 // indirect - golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f // indirect - golang.org/x/sys v0.27.0 // indirect - golang.org/x/text v0.20.0 // indirect + golang.org/x/exp v0.0.0-20241210194714-1829a127f884 // indirect + golang.org/x/sys v0.28.0 // indirect + golang.org/x/text v0.21.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) replace github.com/DataDog/datadog-agent/pkg/config/structure => ../structure + +replace github.com/DataDog/datadog-agent/pkg/version => ../../version diff --git a/pkg/config/mock/go.sum b/pkg/config/mock/go.sum index b70b04e70aa56..e78672416b092 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= @@ -69,7 +71,6 @@ github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/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= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -84,8 +85,8 @@ github.com/grpc-ecosystem/grpc-gateway v1.13.0/go.mod h1:8XEsbTttt/W+VvjtQhLACqC github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/hcl v1.0.1-vault-5 h1:kI3hhbbyzr4dldA8UdTb7ZlVVlI2DACdCfz31RPDgJM= github.com/hashicorp/hcl v1.0.1-vault-5/go.mod h1:XYhtn6ijBSAj6n4YqAaf7RBPS4I06AItNorpy+MoQNM= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 h1:S4qyfL2sEm5Budr4KVMyEniCy+PbS55651I/a+Kn/NQ= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb h1:PGufWXXDq9yaev6xX1YQauaO1MV90e6Mpoq1I7Lz/VM= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= @@ -107,8 +108,8 @@ 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-20220913051719-115f729f3c8c h1:VtwQ41oftZwlMnOEbMWQtSEUgU64U4s+GHk7hZK+jtY= -github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c/go.mod h1:JKx41uQRwqlTZabZc+kILPrO/3jlKnQ2Z8b7YiVw5cE= +github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a h1:3Bm7EwfUQUvhNeKIkUct/gl9eod1TcXuj8stxvi/GoI= +github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a/go.mod h1:ilwx/Dta8jXAgpFYFvSWEMwxmbWXyiUHkd5FwyKhb5k= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= @@ -135,8 +136,8 @@ github.com/pkg/errors v0.8.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-20220216144756-c35f1ee13d7c h1:NRoLoZvkBTKvR5gQLgA3e0hqjkY9u1wm+iOL45VN/qI= -github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 h1:o4JXh1EVt9k/+g42oCprj/FisM4qX9L3sZB3upGN2ZU= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= @@ -167,12 +168,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= @@ -237,8 +234,8 @@ golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnf golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f h1:XdNn9LlyWAhLVp6P/i8QYBW+hlyhrhei9uErw2B5GJo= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f/go.mod h1:D5SMRVC3C2/4+F/DB1wZsLRnSNimn2Sp/NPsCrsv8ak= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884 h1:Y/Mj/94zIQQGHVSv1tTtQBDaQaJe62U9bkDZKKyhPCU= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -275,11 +272,11 @@ golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20220829200755-d48e67d00261/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.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/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= -golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= diff --git a/pkg/config/model/go.mod b/pkg/config/model/go.mod index 27acfdc300362..c77134c93ba10 100644 --- a/pkg/config/model/go.mod +++ b/pkg/config/model/go.mod @@ -11,14 +11,15 @@ 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 + golang.org/x/exp v0.0.0-20241210194714-1829a127f884 ) 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/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/fsnotify/fsnotify v1.8.0 // indirect @@ -32,8 +33,10 @@ require ( github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect go.uber.org/atomic v1.11.0 // indirect - golang.org/x/sys v0.27.0 // indirect - golang.org/x/text v0.20.0 // indirect + golang.org/x/sys v0.28.0 // indirect + golang.org/x/text v0.21.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) + +replace github.com/DataDog/datadog-agent/pkg/version => ../../version diff --git a/pkg/config/model/go.sum b/pkg/config/model/go.sum index ef76baba5c97d..4ffd1e9d2ce0a 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= @@ -185,8 +185,8 @@ golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnf golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f h1:XdNn9LlyWAhLVp6P/i8QYBW+hlyhrhei9uErw2B5GJo= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f/go.mod h1:D5SMRVC3C2/4+F/DB1wZsLRnSNimn2Sp/NPsCrsv8ak= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884 h1:Y/Mj/94zIQQGHVSv1tTtQBDaQaJe62U9bkDZKKyhPCU= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -219,11 +219,11 @@ golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20220829200755-d48e67d00261/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.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/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= -golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 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 89e820fbd8172..e0f87c66cb372 100644 --- a/pkg/config/nodetreemodel/go.mod +++ b/pkg/config/nodetreemodel/go.mod @@ -14,17 +14,18 @@ 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 go.uber.org/atomic v1.11.0 - golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f + golang.org/x/exp v0.0.0-20241210194714-1829a127f884 gopkg.in/yaml.v2 v2.4.0 ) 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/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/fsnotify/fsnotify v1.8.0 // indirect @@ -36,7 +37,9 @@ require ( github.com/spf13/afero v1.11.0 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect - golang.org/x/sys v0.27.0 // indirect - golang.org/x/text v0.20.0 // indirect + golang.org/x/sys v0.28.0 // indirect + golang.org/x/text v0.21.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) + +replace github.com/DataDog/datadog-agent/pkg/version => ../../version diff --git a/pkg/config/nodetreemodel/go.sum b/pkg/config/nodetreemodel/go.sum index 594839f68ca17..c5a94912c5617 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= @@ -188,8 +188,8 @@ golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnf golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f h1:XdNn9LlyWAhLVp6P/i8QYBW+hlyhrhei9uErw2B5GJo= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f/go.mod h1:D5SMRVC3C2/4+F/DB1wZsLRnSNimn2Sp/NPsCrsv8ak= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884 h1:Y/Mj/94zIQQGHVSv1tTtQBDaQaJe62U9bkDZKKyhPCU= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -222,11 +222,11 @@ golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20220829200755-d48e67d00261/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.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/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= -golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 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/api/http.go b/pkg/config/remote/api/http.go index 62f7872a2e671..bdf13e5acd0ea 100644 --- a/pkg/config/remote/api/http.go +++ b/pkg/config/remote/api/http.go @@ -13,6 +13,7 @@ import ( "io" "net/http" "net/url" + "sync" "time" "google.golang.org/protobuf/proto" @@ -46,11 +47,13 @@ type API interface { Fetch(context.Context, *pbgo.LatestConfigsRequest) (*pbgo.LatestConfigsResponse, error) FetchOrgData(context.Context) (*pbgo.OrgDataResponse, error) FetchOrgStatus(context.Context) (*pbgo.OrgStatusResponse, error) + UpdatePARJWT(string) } // Auth defines the possible Authentication data to access the RC backend type Auth struct { APIKey string + PARJWT string AppKey string UseAppKey bool } @@ -59,18 +62,26 @@ type Auth struct { type HTTPClient struct { baseURL string client *http.Client - header http.Header + + headerLock sync.RWMutex + header http.Header } // NewHTTPClient returns a new HTTP configuration client func NewHTTPClient(auth Auth, cfg model.Reader, baseURL *url.URL) (*HTTPClient, error) { header := http.Header{ "Content-Type": []string{"application/x-protobuf"}, - "DD-Api-Key": []string{auth.APIKey}, + } + if auth.PARJWT != "" { + header["DD-PAR-JWT"] = []string{auth.PARJWT} + } + if auth.APIKey != "" { + header["DD-Api-Key"] = []string{auth.APIKey} } if auth.UseAppKey { header["DD-Application-Key"] = []string{auth.AppKey} } + transport := httputils.CreateHTTPTransport(cfg) // Set the keep-alive timeout to 30s instead of the default 90s, so the http RC client is not closed by the backend transport.IdleConnTimeout = 30 * time.Second @@ -104,7 +115,8 @@ func (c *HTTPClient) Fetch(ctx context.Context, request *pbgo.LatestConfigsReque if err != nil { return nil, fmt.Errorf("failed to create org data request: %w", err) } - req.Header = c.header + + c.addHeaders(req) resp, err := c.client.Do(req) if err != nil { @@ -150,7 +162,8 @@ func (c *HTTPClient) FetchOrgData(ctx context.Context) (*pbgo.OrgDataResponse, e if err != nil { return nil, fmt.Errorf("failed to create org data request: %w", err) } - req.Header = c.header + + c.addHeaders(req) resp, err := c.client.Do(req) if err != nil { @@ -187,7 +200,8 @@ func (c *HTTPClient) FetchOrgStatus(ctx context.Context) (*pbgo.OrgStatusRespons if err != nil { return nil, fmt.Errorf("failed to create org data request: %w", err) } - req.Header = c.header + + c.addHeaders(req) resp, err := c.client.Do(req) if err != nil { @@ -216,6 +230,22 @@ func (c *HTTPClient) FetchOrgStatus(ctx context.Context) (*pbgo.OrgStatusRespons return response, err } +// UpdatePARJWT allows for dynamic setting of a Private Action Runners JWT +// Token for authentication to the RC backend. +func (c *HTTPClient) UpdatePARJWT(jwt string) { + c.headerLock.Lock() + c.header.Set("DD-PAR-JWT", jwt) + c.headerLock.Unlock() +} + +func (c *HTTPClient) addHeaders(req *http.Request) { + c.headerLock.RLock() + for k, v := range c.header { + req.Header[k] = v + } + c.headerLock.RUnlock() +} + func checkStatusCode(resp *http.Response) error { // Specific case: authentication method is wrong // we want to be descriptive about what can be done diff --git a/pkg/config/remote/go.mod b/pkg/config/remote/go.mod index 5a00e0b18ab42..0111c7bab2727 100644 --- a/pkg/config/remote/go.mod +++ b/pkg/config/remote/go.mod @@ -50,7 +50,7 @@ require ( github.com/DataDog/datadog-agent/pkg/util/backoff v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/util/grpc v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/util/http v0.56.0-rc.3 - github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 + github.com/DataDog/datadog-agent/pkg/util/log v0.59.1 github.com/DataDog/datadog-agent/pkg/util/uuid v0.56.0-rc.3 github.com/Masterminds/semver v1.5.0 github.com/benbjohnson/clock v1.3.5 @@ -83,9 +83,9 @@ require ( github.com/DataDog/datadog-agent/pkg/util/pointer v0.59.0 // indirect 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.0 // indirect - github.com/DataDog/datadog-agent/pkg/version v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-go/v5 v5.5.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/datadog-go/v5 v5.6.0 // indirect github.com/DataDog/go-libddwaf/v3 v3.5.1 // indirect github.com/DataDog/go-sqllexer v0.0.17 // indirect github.com/DataDog/sketches-go v1.4.6 // indirect @@ -100,20 +100,19 @@ require ( github.com/hashicorp/go-secure-stdlib/parseutil v0.1.8 // indirect github.com/hashicorp/go-secure-stdlib/strutil v0.1.2 // indirect github.com/hashicorp/go-sockaddr v1.0.6 // indirect - github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 // indirect + github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb // indirect github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 // indirect - github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c // indirect + github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a // indirect github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect github.com/outcaste-io/ristretto v0.2.3 // indirect github.com/patrickmn/go-cache v2.1.0+incompatible // indirect - github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c // indirect + github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // 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 - golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f // indirect + golang.org/x/exp v0.0.0-20241210194714-1829a127f884 // indirect golang.org/x/mod v0.22.0 // indirect golang.org/x/time v0.8.0 // indirect golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da // indirect @@ -121,9 +120,9 @@ require ( ) require ( - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.0 // indirect + 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 @@ -142,9 +141,9 @@ require ( github.com/spf13/pflag v1.0.5 // indirect github.com/stretchr/objx v0.5.2 // indirect github.com/tinylib/msgp v1.2.4 // indirect - golang.org/x/net v0.31.0 // indirect - golang.org/x/sys v0.27.0 // indirect - golang.org/x/text v0.20.0 // indirect + golang.org/x/net v0.33.0 // indirect + golang.org/x/sys v0.28.0 // indirect + golang.org/x/text v0.21.0 // indirect google.golang.org/genproto v0.0.0-20240903143218-8af14fe29dc1 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20241104194629-dd2ea8efbc28 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect diff --git a/pkg/config/remote/go.sum b/pkg/config/remote/go.sum index dcb57dbfe438b..4954ea5cccfe4 100644 --- a/pkg/config/remote/go.sum +++ b/pkg/config/remote/go.sum @@ -7,8 +7,8 @@ cloud.google.com/go/compute/metadata v0.5.2/go.mod h1:C66sj2AluDcIqakBq/M8lw8/yb github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/DataDog/appsec-internal-go v1.9.0 h1:cGOneFsg0JTRzWl5U2+og5dbtyW3N8XaYwc5nXe39Vw= github.com/DataDog/appsec-internal-go v1.9.0/go.mod h1:wW0cRfWBo4C044jHGwYiyh5moQV2x0AhnwqMuiX7O/g= -github.com/DataDog/datadog-go/v5 v5.5.0 h1:G5KHeB8pWBNXT4Jtw0zAkhdxEAWSpWH00geHI6LDrKU= -github.com/DataDog/datadog-go/v5 v5.5.0/go.mod h1:K9kcYBlxkcPP8tvvjZZKs/m1edNAUFzBbdpTUKfCsuw= +github.com/DataDog/datadog-go/v5 v5.6.0 h1:2oCLxjF/4htd55piM75baflj/KoE6VYS7alEUqFvRDw= +github.com/DataDog/datadog-go/v5 v5.6.0/go.mod h1:K9kcYBlxkcPP8tvvjZZKs/m1edNAUFzBbdpTUKfCsuw= github.com/DataDog/go-libddwaf/v3 v3.5.1 h1:GWA4ln4DlLxiXm+X7HA/oj0ZLcdCwOS81KQitegRTyY= github.com/DataDog/go-libddwaf/v3 v3.5.1/go.mod h1:n98d9nZ1gzenRSk53wz8l6d34ikxS+hs62A31Fqmyi4= github.com/DataDog/go-sqllexer v0.0.17 h1:u47fJAVg/+5DA74ZW3w0Qu+3qXHd3GtnA8ZBYixdPrM= @@ -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= @@ -114,7 +114,6 @@ github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/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= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -149,8 +148,8 @@ github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyf github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/hcl v1.0.1-vault-5 h1:kI3hhbbyzr4dldA8UdTb7ZlVVlI2DACdCfz31RPDgJM= github.com/hashicorp/hcl v1.0.1-vault-5/go.mod h1:XYhtn6ijBSAj6n4YqAaf7RBPS4I06AItNorpy+MoQNM= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 h1:S4qyfL2sEm5Budr4KVMyEniCy+PbS55651I/a+Kn/NQ= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb h1:PGufWXXDq9yaev6xX1YQauaO1MV90e6Mpoq1I7Lz/VM= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= @@ -173,8 +172,8 @@ 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-20220913051719-115f729f3c8c h1:VtwQ41oftZwlMnOEbMWQtSEUgU64U4s+GHk7hZK+jtY= -github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c/go.mod h1:JKx41uQRwqlTZabZc+kILPrO/3jlKnQ2Z8b7YiVw5cE= +github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a h1:3Bm7EwfUQUvhNeKIkUct/gl9eod1TcXuj8stxvi/GoI= +github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a/go.mod h1:ilwx/Dta8jXAgpFYFvSWEMwxmbWXyiUHkd5FwyKhb5k= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= @@ -215,8 +214,8 @@ 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-20220216144756-c35f1ee13d7c h1:NRoLoZvkBTKvR5gQLgA3e0hqjkY9u1wm+iOL45VN/qI= -github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 h1:o4JXh1EVt9k/+g42oCprj/FisM4qX9L3sZB3upGN2ZU= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= @@ -255,12 +254,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= @@ -351,11 +346,11 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.29.0 h1:L5SG1JTTXupVV3n6sUqMTeWbjAyfPwoda2DLX8J8FrQ= -golang.org/x/crypto v0.29.0/go.mod h1:+F4F4N5hv6v38hfeYwTdx20oUvLLc+QfrE9Ax9HtgRg= +golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U= +golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f h1:XdNn9LlyWAhLVp6P/i8QYBW+hlyhrhei9uErw2B5GJo= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f/go.mod h1:D5SMRVC3C2/4+F/DB1wZsLRnSNimn2Sp/NPsCrsv8ak= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884 h1:Y/Mj/94zIQQGHVSv1tTtQBDaQaJe62U9bkDZKKyhPCU= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -382,8 +377,8 @@ golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.31.0 h1:68CPQngjLL0r2AlUKiSxtQFKvzRVbnzLwMUn5SzcLHo= -golang.org/x/net v0.31.0/go.mod h1:P4fl1q7dY2hnZFxEk4pPSkDHF+QqjitcnDjUQyMM+pM= +golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= +golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.23.0 h1:PbgcYx2W7i4LvjJWEbf0ngHV6qJYr86PkAV3bXdLEbs= @@ -395,8 +390,8 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.9.0 h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ= -golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= +golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -419,13 +414,13 @@ golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/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-20220829200755-d48e67d00261/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.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= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= -golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.8.0 h1:9i3RxcPv3PZnitoVGMPDKZSq1xW1gK1Xy3ArNOGZfEg= diff --git a/pkg/config/remote/service/service.go b/pkg/config/remote/service/service.go index a379ac5b387ec..33d5cd4b67ee5 100644 --- a/pkg/config/remote/service/service.go +++ b/pkg/config/remote/service/service.go @@ -111,50 +111,21 @@ func (s *Service) getNewDirectorRoots(uptane uptaneClient, currentVersion uint64 return roots, nil } -func (s *Service) getTargetFiles(uptane uptaneClient, products []rdata.Product, cachedTargetFiles []*pbgo.TargetFileMeta) ([]*pbgo.File, error) { - productSet := make(map[rdata.Product]struct{}) - for _, product := range products { - productSet[product] = struct{}{} - } - targets, err := uptane.Targets() +func (s *Service) getTargetFiles(uptaneClient uptaneClient, targetFilePaths []string) ([]*pbgo.File, error) { + files, err := uptaneClient.TargetFiles(targetFilePaths) if err != nil { return nil, err } - cachedTargets := make(map[string]data.FileMeta) - for _, cachedTarget := range cachedTargetFiles { - hashes := make(data.Hashes) - for _, hash := range cachedTarget.Hashes { - h, err := hex.DecodeString(hash.Hash) - if err != nil { - return nil, err - } - hashes[hash.Algorithm] = h - } - cachedTargets[cachedTarget.Path] = data.FileMeta{ - Hashes: hashes, - Length: cachedTarget.Length, - } - } + var configFiles []*pbgo.File - for targetPath, targetMeta := range targets { - configPathMeta, err := rdata.ParseConfigPath(targetPath) - if err != nil { - return nil, err - } - if _, inClientProducts := productSet[rdata.Product(configPathMeta.Product)]; inClientProducts { - if notEqualErr := tufutil.FileMetaEqual(cachedTargets[targetPath], targetMeta.FileMeta); notEqualErr == nil { - continue - } - fileContents, err := uptane.TargetFile(targetPath) - if err != nil { - return nil, err - } - configFiles = append(configFiles, &pbgo.File{ - Path: targetPath, - Raw: fileContents, - }) - } + for path, contents := range files { + // Note: This unconditionally succeeds as long as we don't change bufferDestination earlier + configFiles = append(configFiles, &pbgo.File{ + Path: path, + Raw: contents, + }) } + return configFiles, nil } @@ -211,6 +182,7 @@ type uptaneClient interface { StoredOrgUUID() (string, error) Targets() (data.TargetFiles, error) TargetFile(path string) ([]byte, error) + TargetFiles(files []string) (map[string][]byte, error) TargetsMeta() ([]byte, error) TargetsCustom() ([]byte, error) TUFVersionState() (uptane.TUFVersions, error) @@ -248,6 +220,7 @@ type options struct { site string rcKey string apiKey string + parJWT string traceAgentEnv string databaseFileName string databaseFilePath string @@ -264,6 +237,7 @@ type options struct { var defaultOptions = options{ rcKey: "", apiKey: "", + parJWT: "", traceAgentEnv: "", databaseFileName: "remote-config.db", databaseFilePath: "", @@ -355,6 +329,11 @@ func WithAPIKey(apiKey string) func(s *options) { return func(s *options) { s.apiKey = apiKey } } +// WithPARJWT sets the JWT for the private action runner +func WithPARJWT(jwt string) func(s *options) { + return func(s *options) { s.parJWT = jwt } +} + // WithClientCacheBypassLimit validates and sets the service client cache bypass limit func WithClientCacheBypassLimit(limit int, cfgPath string) func(s *options) { if limit < minCacheBypassLimit || limit > maxCacheBypassLimit { @@ -415,7 +394,7 @@ func NewService(cfg model.Reader, rcType, baseRawURL, hostname string, tagsGette backoffPolicy := backoff.NewExpBackoffPolicy(minBackoffFactor, baseBackoffTime, options.maxBackoff.Seconds(), recoveryInterval, recoveryReset) - authKeys, err := getRemoteConfigAuthKeys(options.apiKey, options.rcKey) + authKeys, err := getRemoteConfigAuthKeys(options.apiKey, options.rcKey, options.parJWT) if err != nil { return nil, err } @@ -532,6 +511,12 @@ func (s *CoreAgentService) Start() { }() } +// UpdatePARJWT updates the stored JWT for Private Action Runners +// for authentication to the remote config backend. +func (s *CoreAgentService) UpdatePARJWT(jwt string) { + s.api.UpdatePARJWT(jwt) +} + func startWithAgentPollLoop(s *CoreAgentService) { err := s.refresh() if err != nil { @@ -828,36 +813,30 @@ func (s *CoreAgentService) ClientGetConfigs(_ context.Context, request *pbgo.Cli if err != nil { return nil, err } - targetsRaw, err := s.uptane.TargetsMeta() + + directorTargets, err := s.uptane.Targets() if err != nil { return nil, err } - targetFiles, err := s.getTargetFiles(s.uptane, rdata.StringListToProduct(request.Client.Products), request.CachedTargetFiles) + matchedClientConfigs, err := executeTracerPredicates(request.Client, directorTargets) if err != nil { return nil, err } - directorTargets, err := s.uptane.Targets() + neededFiles, err := filterNeededTargetFiles(matchedClientConfigs, request.CachedTargetFiles, directorTargets) if err != nil { return nil, err } - matchedClientConfigs, err := executeTracerPredicates(request.Client, directorTargets) + + targetFiles, err := s.getTargetFiles(s.uptane, neededFiles) if err != nil { return nil, err } - // filter files to only return the ones that predicates marked for this client - matchedConfigsMap := make(map[string]interface{}) - for _, configPointer := range matchedClientConfigs { - matchedConfigsMap[configPointer] = struct{}{} - } - filteredFiles := make([]*pbgo.File, 0, len(matchedClientConfigs)) - for _, targetFile := range targetFiles { - if _, ok := matchedConfigsMap[targetFile.Path]; ok { - filteredFiles = append(filteredFiles, targetFile) - } + targetsRaw, err := s.uptane.TargetsMeta() + if err != nil { + return nil, err } - canonicalTargets, err := enforceCanonicalJSON(targetsRaw) if err != nil { return nil, err @@ -866,11 +845,42 @@ func (s *CoreAgentService) ClientGetConfigs(_ context.Context, request *pbgo.Cli return &pbgo.ClientGetConfigsResponse{ Roots: roots, Targets: canonicalTargets, - TargetFiles: filteredFiles, + TargetFiles: targetFiles, ClientConfigs: matchedClientConfigs, }, nil } +func filterNeededTargetFiles(neededConfigs []string, cachedTargetFiles []*pbgo.TargetFileMeta, tufTargets data.TargetFiles) ([]string, error) { + // Build an O(1) lookup of cached target files + cachedTargetsMap := make(map[string]data.FileMeta) + for _, cachedTarget := range cachedTargetFiles { + hashes := make(data.Hashes) + for _, hash := range cachedTarget.Hashes { + h, err := hex.DecodeString(hash.Hash) + if err != nil { + return nil, err + } + hashes[hash.Algorithm] = h + } + cachedTargetsMap[cachedTarget.Path] = data.FileMeta{ + Hashes: hashes, + Length: cachedTarget.Length, + } + } + + // We don't need to pull the raw contents if the client already has the exact version of the file cached + filteredList := make([]string, 0, len(neededConfigs)) + for _, path := range neededConfigs { + if notEqualErr := tufutil.FileMetaEqual(cachedTargetsMap[path], tufTargets[path].FileMeta); notEqualErr == nil { + continue + } + + filteredList = append(filteredList, path) + } + + return filteredList, nil +} + // ConfigGetState returns the state of the configuration and the director repos in the local store func (s *CoreAgentService) ConfigGetState() (*pbgo.GetStateConfigResponse, error) { state, err := s.uptane.State() @@ -1117,29 +1127,14 @@ func (c *HTTPClient) getUpdate( if tufVersions.DirectorTargets == currentTargetsVersion { return nil, nil } - roots, err := c.getNewDirectorRoots(c.uptane, currentRootVersion, tufVersions.DirectorRoot) - if err != nil { - return nil, err - } - targetsRaw, err := c.uptane.TargetsMeta() - if err != nil { - return nil, err - } - targetFiles, err := c.getTargetFiles(c.uptane, rdata.StringListToProduct(products), cachedTargetFiles) - if err != nil { - return nil, err - } - - canonicalTargets, err := enforceCanonicalJSON(targetsRaw) - if err != nil { - return nil, err - } + // Filter out files that either: + // - don't correspond to the product list the client is requesting + // - have expired directorTargets, err := c.uptane.Targets() if err != nil { return nil, err } - productsMap := make(map[string]struct{}) for _, product := range products { productsMap[product] = struct{}{} @@ -1165,14 +1160,33 @@ func (c *HTTPClient) getUpdate( configs = append(configs, path) } + span.SetTag("configs.returned", configs) + span.SetTag("configs.expired", expiredConfigs) + // Gather the files and map-ify them for the state data structure + targetFiles, err := c.getTargetFiles(c.uptane, configs) + if err != nil { + return nil, err + } fileMap := make(map[string][]byte, len(targetFiles)) for _, f := range targetFiles { fileMap[f.Path] = f.Raw } - span.SetTag("configs.returned", configs) - span.SetTag("configs.expired", expiredConfigs) + // Gather some TUF metadata files we need to send down + roots, err := c.getNewDirectorRoots(c.uptane, currentRootVersion, tufVersions.DirectorRoot) + if err != nil { + return nil, err + } + targetsRaw, err := c.uptane.TargetsMeta() + if err != nil { + return nil, err + } + canonicalTargets, err := enforceCanonicalJSON(targetsRaw) + if err != nil { + return nil, err + } + return &state.Update{ TUFRoots: roots, TUFTargets: canonicalTargets, diff --git a/pkg/config/remote/service/service_test.go b/pkg/config/remote/service/service_test.go index 40d8302db3192..6f35c3a4b7b40 100644 --- a/pkg/config/remote/service/service_test.go +++ b/pkg/config/remote/service/service_test.go @@ -69,6 +69,10 @@ func (m *mockAPI) FetchOrgStatus(ctx context.Context) (*pbgo.OrgStatusResponse, return args.Get(0).(*pbgo.OrgStatusResponse), args.Error(1) } +func (m *mockAPI) UpdatePARJWT(jwt string) { + m.Called(jwt) +} + type mockUptane struct { mock.Mock } @@ -116,6 +120,11 @@ func (m *mockUptane) TargetFile(path string) ([]byte, error) { return args.Get(0).([]byte), args.Error(1) } +func (m *mockUptane) TargetFiles(files []string) (map[string][]byte, error) { + args := m.Called(files) + return args.Get(0).(map[string][]byte), args.Error(1) +} + func (m *mockUptane) TargetsMeta() ([]byte, error) { args := m.Called() return args.Get(0).([]byte), args.Error(1) @@ -486,8 +495,8 @@ func TestService(t *testing.T) { }, nil) uptaneClient.On("DirectorRoot", uint64(3)).Return(root3, nil) uptaneClient.On("DirectorRoot", uint64(4)).Return(root4, nil) - uptaneClient.On("TargetFile", "datadog/2/APM_SAMPLING/id/1").Return(fileAPM1, nil) - uptaneClient.On("TargetFile", "datadog/2/APM_SAMPLING/id/2").Return(fileAPM2, nil) + + uptaneClient.On("TargetFiles", mock.MatchedBy(listsEqual([]string{"datadog/2/APM_SAMPLING/id/1", "datadog/2/APM_SAMPLING/id/2"}))).Return(map[string][]byte{"datadog/2/APM_SAMPLING/id/1": fileAPM1, "datadog/2/APM_SAMPLING/id/2": fileAPM2}, nil) uptaneClient.On("Update", lastConfigResponse).Return(nil) api.On("Fetch", mock.Anything, &pbgo.LatestConfigsRequest{ Hostname: service.hostname, @@ -513,7 +522,7 @@ func TestService(t *testing.T) { configResponse, err := service.ClientGetConfigs(context.Background(), &pbgo.ClientGetConfigsRequest{Client: client}) assert.NoError(t, err) assert.ElementsMatch(t, [][]byte{canonicalRoot3, canonicalRoot4}, configResponse.Roots) - assert.ElementsMatch(t, []*pbgo.File{{Path: "datadog/2/APM_SAMPLING/id/1", Raw: fileAPM1}, {Path: "datadog/2/APM_SAMPLING/id/2", Raw: fileAPM2}}, configResponse.TargetFiles) + assert.ElementsMatch(t, []*pbgo.File{{Path: "datadog/2/APM_SAMPLING/id/1", Raw: fileAPM1}, {Path: "datadog/2/APM_SAMPLING/id/2", Raw: fileAPM2}}, configResponse.TargetFiles, nil) assert.Equal(t, canonicalTargets, configResponse.Targets) assert.ElementsMatch(t, configResponse.ClientConfigs, @@ -597,8 +606,7 @@ func TestServiceClientPredicates(t *testing.T) { DirectorRoot: 1, DirectorTargets: 5, }, nil) - uptaneClient.On("TargetFile", "datadog/2/APM_SAMPLING/id/1").Return([]byte(``), nil) - uptaneClient.On("TargetFile", "datadog/2/APM_SAMPLING/id/2").Return([]byte(``), nil) + uptaneClient.On("TargetFiles", mock.MatchedBy(listsEqual([]string{"datadog/2/APM_SAMPLING/id/1", "datadog/2/APM_SAMPLING/id/2"}))).Return(map[string][]byte{"datadog/2/APM_SAMPLING/id/1": []byte(``), "datadog/2/APM_SAMPLING/id/2": []byte(``)}, nil) uptaneClient.On("Update", lastConfigResponse).Return(nil) api.On("Fetch", mock.Anything, &pbgo.LatestConfigsRequest{ Hostname: service.hostname, @@ -887,8 +895,7 @@ func TestConfigExpiration(t *testing.T) { DirectorRoot: 1, DirectorTargets: 5, }, nil) - uptaneClient.On("TargetFile", "datadog/2/APM_SAMPLING/id/1").Return([]byte(``), nil) - uptaneClient.On("TargetFile", "datadog/2/APM_SAMPLING/id/2").Return([]byte(``), nil) + uptaneClient.On("TargetFiles", []string{"datadog/2/APM_SAMPLING/id/1"}).Return(map[string][]byte{"datadog/2/APM_SAMPLING/id/1": []byte(``), "datadog/2/APM_SAMPLING/id/2": []byte(``)}, nil) uptaneClient.On("Update", lastConfigResponse).Return(nil) api.On("Fetch", mock.Anything, &pbgo.LatestConfigsRequest{ Hostname: service.hostname, @@ -1190,7 +1197,7 @@ func TestHTTPClientRecentUpdate(t *testing.T) { }, nil, ) - uptaneClient.On("TargetFile", "datadog/2/TESTING1/id/1").Return([]byte(`testing_1`), nil) + uptaneClient.On("TargetFiles", []string{"datadog/2/TESTING1/id/1"}).Return(map[string][]byte{"datadog/2/TESTING1/id/1": []byte(`testing_1`)}, nil) client := setupCDNClient(t, uptaneClient) defer client.Close() @@ -1236,7 +1243,7 @@ func TestHTTPClientUpdateSuccess(t *testing.T) { }, nil, ) - uptaneClient.On("TargetFile", "datadog/2/TESTING1/id/1").Return([]byte(`testing_1`), nil) + uptaneClient.On("TargetFiles", []string{"datadog/2/TESTING1/id/1"}).Return(map[string][]byte{"datadog/2/TESTING1/id/1": []byte(`testing_1`)}, nil) updateErr := fmt.Errorf("uh oh") if tt.updateSucceeds { @@ -1261,3 +1268,24 @@ func TestHTTPClientUpdateSuccess(t *testing.T) { }) } } + +func listsEqual(mustMatch []string) func(candidate []string) bool { + return func(candidate []string) bool { + if len(candidate) != len(mustMatch) { + return false + } + + candidateSet := make(map[string]struct{}) + for _, item := range candidate { + candidateSet[item] = struct{}{} + } + + for _, item := range mustMatch { + if _, ok := candidateSet[item]; !ok { + return false + } + } + + return true + } +} diff --git a/pkg/config/remote/service/util.go b/pkg/config/remote/service/util.go index b0d541e964f54..4f91ed6ceb48b 100644 --- a/pkg/config/remote/service/util.go +++ b/pkg/config/remote/service/util.go @@ -139,6 +139,8 @@ func openCacheDB(path string, agentVersion string, apiKey string) (*bbolt.DB, er type remoteConfigAuthKeys struct { apiKey string + parJWT string + rcKeySet bool rcKey *msgpgo.RemoteConfigKey } @@ -146,6 +148,7 @@ type remoteConfigAuthKeys struct { func (k *remoteConfigAuthKeys) apiAuth() api.Auth { auth := api.Auth{ APIKey: k.apiKey, + PARJWT: k.parJWT, } if k.rcKeySet { auth.UseAppKey = true @@ -154,12 +157,15 @@ func (k *remoteConfigAuthKeys) apiAuth() api.Auth { return auth } -func getRemoteConfigAuthKeys(apiKey string, rcKey string) (remoteConfigAuthKeys, error) { +func getRemoteConfigAuthKeys(apiKey string, rcKey string, parJWT string) (remoteConfigAuthKeys, error) { if rcKey == "" { return remoteConfigAuthKeys{ apiKey: apiKey, + parJWT: parJWT, }, nil } + + // Legacy auth with RC specific keys rcKey = strings.TrimPrefix(rcKey, "DDRCM_") encoding := base32.StdEncoding.WithPadding(base32.NoPadding) rawKey, err := encoding.DecodeString(rcKey) @@ -176,6 +182,7 @@ func getRemoteConfigAuthKeys(apiKey string, rcKey string) (remoteConfigAuthKeys, } return remoteConfigAuthKeys{ apiKey: apiKey, + parJWT: parJWT, rcKeySet: true, rcKey: &key, }, nil diff --git a/pkg/config/remote/service/util_test.go b/pkg/config/remote/service/util_test.go index ba4b8eaff1f89..7b2883f134974 100644 --- a/pkg/config/remote/service/util_test.go +++ b/pkg/config/remote/service/util_test.go @@ -27,6 +27,7 @@ func TestAuthKeys(t *testing.T) { tests := []struct { rcKey string apiKey string + parJWT string err bool output remoteConfigAuthKeys }{ @@ -42,10 +43,17 @@ func TestAuthKeys(t *testing.T) { {rcKey: generateKey(t, 2, "datadoghq.com", ""), err: true}, {rcKey: generateKey(t, 2, "", "app_Key"), err: true}, {rcKey: generateKey(t, 0, "datadoghq.com", "app_Key"), err: true}, + {parJWT: "myJWT", err: false, output: remoteConfigAuthKeys{ + parJWT: "myJWT", + }}, + {parJWT: "myJWT", apiKey: "myAPIKey", err: false, output: remoteConfigAuthKeys{ + parJWT: "myJWT", + apiKey: "myAPIKey", + }}, } for _, test := range tests { t.Run(fmt.Sprintf("%s|%s", test.apiKey, test.rcKey), func(tt *testing.T) { - output, err := getRemoteConfigAuthKeys(test.apiKey, test.rcKey) + output, err := getRemoteConfigAuthKeys(test.apiKey, test.rcKey, test.parJWT) if test.err { assert.Error(tt, err) } else { diff --git a/pkg/config/remote/uptane/client.go b/pkg/config/remote/uptane/client.go index b4da1c675b296..fcd1d3834b478 100644 --- a/pkg/config/remote/uptane/client.go +++ b/pkg/config/remote/uptane/client.go @@ -342,6 +342,37 @@ func (c *Client) TargetFile(path string) ([]byte, error) { return c.unsafeTargetFile(path) } +// TargetFiles returns the content of various multiple target files if the repository is in a +// verified state. +func (c *Client) TargetFiles(targetFiles []string) (map[string][]byte, error) { + c.Lock() + defer c.Unlock() + + err := c.verify() + if err != nil { + return nil, err + } + + // Build the storage space + destinations := make(map[string]client.Destination) + for _, path := range targetFiles { + destinations[path] = &bufferDestination{} + } + + err = c.directorTUFClient.DownloadBatch(destinations) + if err != nil { + return nil, err + } + + // Build the return type + files := make(map[string][]byte) + for path, contents := range destinations { + files[path] = contents.(*bufferDestination).Bytes() + } + + return files, nil +} + // TargetsMeta returns the current raw targets.json meta of this uptane client func (c *Client) TargetsMeta() ([]byte, error) { c.Lock() diff --git a/pkg/config/setup/apm.go b/pkg/config/setup/apm.go index f792f9c57dd81..8472267c255ec 100644 --- a/pkg/config/setup/apm.go +++ b/pkg/config/setup/apm.go @@ -21,29 +21,29 @@ import ( const Traces DataType = "traces" func setupAPM(config pkgconfigmodel.Setup) { - config.BindEnv("apm_config.obfuscation.elasticsearch.enabled", "DD_APM_OBFUSCATION_ELASTICSEARCH_ENABLED") - config.BindEnv("apm_config.obfuscation.elasticsearch.keep_values", "DD_APM_OBFUSCATION_ELASTICSEARCH_KEEP_VALUES") - config.BindEnv("apm_config.obfuscation.elasticsearch.obfuscate_sql_values", "DD_APM_OBFUSCATION_ELASTICSEARCH_OBFUSCATE_SQL_VALUES") - config.BindEnv("apm_config.obfuscation.opensearch.enabled", "DD_APM_OBFUSCATION_OPENSEARCH_ENABLED") - config.BindEnv("apm_config.obfuscation.opensearch.keep_values", "DD_APM_OBFUSCATION_OPENSEARCH_KEEP_VALUES") - config.BindEnv("apm_config.obfuscation.opensearch.obfuscate_sql_values", "DD_APM_OBFUSCATION_OPENSEARCH_OBFUSCATE_SQL_VALUES") - config.BindEnv("apm_config.obfuscation.mongodb.enabled", "DD_APM_OBFUSCATION_MONGODB_ENABLED") - config.BindEnv("apm_config.obfuscation.mongodb.keep_values", "DD_APM_OBFUSCATION_MONGODB_KEEP_VALUES") - config.BindEnv("apm_config.obfuscation.mongodb.obfuscate_sql_values", "DD_APM_OBFUSCATION_MONGODB_OBFUSCATE_SQL_VALUES") - config.BindEnv("apm_config.obfuscation.sql_exec_plan.enabled", "DD_APM_OBFUSCATION_SQL_EXEC_PLAN_ENABLED") - config.BindEnv("apm_config.obfuscation.sql_exec_plan.keep_values", "DD_APM_OBFUSCATION_SQL_EXEC_PLAN_KEEP_VALUES") - config.BindEnv("apm_config.obfuscation.sql_exec_plan.obfuscate_sql_values", "DD_APM_OBFUSCATION_SQL_EXEC_PLAN_OBFUSCATE_SQL_VALUES") - config.BindEnv("apm_config.obfuscation.sql_exec_plan_normalize.enabled", "DD_APM_OBFUSCATION_SQL_EXEC_PLAN_NORMALIZE_ENABLED") - config.BindEnv("apm_config.obfuscation.sql_exec_plan_normalize.keep_values", "DD_APM_OBFUSCATION_SQL_EXEC_PLAN_NORMALIZE_KEEP_VALUES") - config.BindEnv("apm_config.obfuscation.sql_exec_plan_normalize.obfuscate_sql_values", "DD_APM_OBFUSCATION_SQL_EXEC_PLAN_NORMALIZE_OBFUSCATE_SQL_VALUES") - config.BindEnv("apm_config.obfuscation.http.remove_query_string", "DD_APM_OBFUSCATION_HTTP_REMOVE_QUERY_STRING") - config.BindEnv("apm_config.obfuscation.http.remove_paths_with_digits", "DD_APM_OBFUSCATION_HTTP_REMOVE_PATHS_WITH_DIGITS") - config.BindEnv("apm_config.obfuscation.remove_stack_traces", "DD_APM_OBFUSCATION_REMOVE_STACK_TRACES") - config.BindEnv("apm_config.obfuscation.redis.enabled", "DD_APM_OBFUSCATION_REDIS_ENABLED") - config.BindEnv("apm_config.obfuscation.redis.remove_all_args", "DD_APM_OBFUSCATION_REDIS_REMOVE_ALL_ARGS") - config.BindEnv("apm_config.obfuscation.memcached.enabled", "DD_APM_OBFUSCATION_MEMCACHED_ENABLED") - config.BindEnv("apm_config.obfuscation.memcached.keep_command", "DD_APM_OBFUSCATION_MEMCACHED_KEEP_COMMAND") - config.BindEnv("apm_config.obfuscation.cache.enabled", "DD_APM_OBFUSCATION_CACHE_ENABLED") + config.BindEnvAndSetDefault("apm_config.obfuscation.elasticsearch.enabled", true, "DD_APM_OBFUSCATION_ELASTICSEARCH_ENABLED") + config.BindEnvAndSetDefault("apm_config.obfuscation.elasticsearch.keep_values", []string{}, "DD_APM_OBFUSCATION_ELASTICSEARCH_KEEP_VALUES") + config.BindEnvAndSetDefault("apm_config.obfuscation.elasticsearch.obfuscate_sql_values", []string{}, "DD_APM_OBFUSCATION_ELASTICSEARCH_OBFUSCATE_SQL_VALUES") + config.BindEnvAndSetDefault("apm_config.obfuscation.opensearch.enabled", true, "DD_APM_OBFUSCATION_OPENSEARCH_ENABLED") + config.BindEnvAndSetDefault("apm_config.obfuscation.opensearch.keep_values", []string{}, "DD_APM_OBFUSCATION_OPENSEARCH_KEEP_VALUES") + config.BindEnvAndSetDefault("apm_config.obfuscation.opensearch.obfuscate_sql_values", []string{}, "DD_APM_OBFUSCATION_OPENSEARCH_OBFUSCATE_SQL_VALUES") + config.BindEnvAndSetDefault("apm_config.obfuscation.mongodb.enabled", true, "DD_APM_OBFUSCATION_MONGODB_ENABLED") + config.BindEnvAndSetDefault("apm_config.obfuscation.mongodb.keep_values", []string{}, "DD_APM_OBFUSCATION_MONGODB_KEEP_VALUES") + config.BindEnvAndSetDefault("apm_config.obfuscation.mongodb.obfuscate_sql_values", []string{}, "DD_APM_OBFUSCATION_MONGODB_OBFUSCATE_SQL_VALUES") + config.BindEnvAndSetDefault("apm_config.obfuscation.sql_exec_plan.enabled", false, "DD_APM_OBFUSCATION_SQL_EXEC_PLAN_ENABLED") + config.BindEnvAndSetDefault("apm_config.obfuscation.sql_exec_plan.keep_values", []string{}, "DD_APM_OBFUSCATION_SQL_EXEC_PLAN_KEEP_VALUES") + config.BindEnvAndSetDefault("apm_config.obfuscation.sql_exec_plan.obfuscate_sql_values", []string{}, "DD_APM_OBFUSCATION_SQL_EXEC_PLAN_OBFUSCATE_SQL_VALUES") + config.BindEnvAndSetDefault("apm_config.obfuscation.sql_exec_plan_normalize.enabled", false, "DD_APM_OBFUSCATION_SQL_EXEC_PLAN_NORMALIZE_ENABLED") + config.BindEnvAndSetDefault("apm_config.obfuscation.sql_exec_plan_normalize.keep_values", []string{}, "DD_APM_OBFUSCATION_SQL_EXEC_PLAN_NORMALIZE_KEEP_VALUES") + config.BindEnvAndSetDefault("apm_config.obfuscation.sql_exec_plan_normalize.obfuscate_sql_values", []string{}, "DD_APM_OBFUSCATION_SQL_EXEC_PLAN_NORMALIZE_OBFUSCATE_SQL_VALUES") + config.BindEnvAndSetDefault("apm_config.obfuscation.http.remove_query_string", false, "DD_APM_OBFUSCATION_HTTP_REMOVE_QUERY_STRING") + config.BindEnvAndSetDefault("apm_config.obfuscation.http.remove_paths_with_digits", false, "DD_APM_OBFUSCATION_HTTP_REMOVE_PATHS_WITH_DIGITS") + config.BindEnvAndSetDefault("apm_config.obfuscation.remove_stack_traces", false, "DD_APM_OBFUSCATION_REMOVE_STACK_TRACES") + config.BindEnvAndSetDefault("apm_config.obfuscation.redis.enabled", true, "DD_APM_OBFUSCATION_REDIS_ENABLED") + config.BindEnvAndSetDefault("apm_config.obfuscation.redis.remove_all_args", false, "DD_APM_OBFUSCATION_REDIS_REMOVE_ALL_ARGS") + config.BindEnvAndSetDefault("apm_config.obfuscation.memcached.enabled", true, "DD_APM_OBFUSCATION_MEMCACHED_ENABLED") + config.BindEnvAndSetDefault("apm_config.obfuscation.memcached.keep_command", false, "DD_APM_OBFUSCATION_MEMCACHED_KEEP_COMMAND") + config.BindEnvAndSetDefault("apm_config.obfuscation.cache.enabled", true, "DD_APM_OBFUSCATION_CACHE_ENABLED") config.SetKnown("apm_config.filter_tags.require") config.SetKnown("apm_config.filter_tags.reject") config.SetKnown("apm_config.filter_tags_regex.require") @@ -56,7 +56,7 @@ func setupAPM(config pkgconfigmodel.Setup) { config.SetKnown("apm_config.service_writer.queue_size") config.SetKnown("apm_config.stats_writer.connection_limit") config.SetKnown("apm_config.stats_writer.queue_size") - config.SetKnown("apm_config.analyzed_rate_by_service.*") + config.SetKnown("apm_config.analyzed_rate_by_service") config.SetKnown("apm_config.bucket_size_seconds") config.SetKnown("apm_config.watchdog_check_delay") config.SetKnown("apm_config.sync_flushing") @@ -151,9 +151,9 @@ func setupAPM(config pkgconfigmodel.Setup) { config.BindEnv("apm_config.install_id", "DD_INSTRUMENTATION_INSTALL_ID") config.BindEnv("apm_config.install_type", "DD_INSTRUMENTATION_INSTALL_TYPE") config.BindEnv("apm_config.install_time", "DD_INSTRUMENTATION_INSTALL_TIME") - config.BindEnv("apm_config.obfuscation.credit_cards.enabled", "DD_APM_OBFUSCATION_CREDIT_CARDS_ENABLED") - config.BindEnv("apm_config.obfuscation.credit_cards.luhn", "DD_APM_OBFUSCATION_CREDIT_CARDS_LUHN") - config.BindEnv("apm_config.obfuscation.credit_cards.keep_values", "DD_APM_OBFUSCATION_CREDIT_CARDS_KEEP_VALUES") + config.BindEnvAndSetDefault("apm_config.obfuscation.credit_cards.enabled", true, "DD_APM_OBFUSCATION_CREDIT_CARDS_ENABLED") + config.BindEnvAndSetDefault("apm_config.obfuscation.credit_cards.luhn", false, "DD_APM_OBFUSCATION_CREDIT_CARDS_LUHN") + config.BindEnvAndSetDefault("apm_config.obfuscation.credit_cards.keep_values", []string{}, "DD_APM_OBFUSCATION_CREDIT_CARDS_KEEP_VALUES") config.BindEnvAndSetDefault("apm_config.debug.port", 5012, "DD_APM_DEBUG_PORT") config.BindEnv("apm_config.features", "DD_APM_FEATURES") config.ParseEnvAsStringSlice("apm_config.features", func(s string) []string { diff --git a/pkg/config/setup/config.go b/pkg/config/setup/config.go index a9c74bb2765fa..53ef845aa8fac 100644 --- a/pkg/config/setup/config.go +++ b/pkg/config/setup/config.go @@ -79,7 +79,7 @@ const ( DefaultRuntimePoliciesDir = "/etc/datadog-agent/runtime-security.d" // DefaultCompressorKind is the default compressor. Options available are 'zlib' and 'zstd' - DefaultCompressorKind = "zlib" + DefaultCompressorKind = "zstd" // DefaultZstdCompressionLevel is the default compression level for `zstd`. // Compression level 1 provides the lowest compression ratio, but uses much less RSS especially @@ -490,7 +490,7 @@ func InitConfig(config pkgconfigmodel.Setup) { config.BindEnvAndSetDefault("leader_election_default_resource", "configmap") config.BindEnvAndSetDefault("leader_election_release_on_shutdown", true) config.BindEnvAndSetDefault("kube_resources_namespace", "") - config.BindEnvAndSetDefault("kube_cache_sync_timeout_seconds", 5) + config.BindEnvAndSetDefault("kube_cache_sync_timeout_seconds", 10) // Datadog cluster agent config.BindEnvAndSetDefault("cluster_agent.enabled", false) @@ -868,8 +868,7 @@ func InitConfig(config pkgconfigmodel.Setup) { // DEPRECATED in favor of `orchestrator_explorer.orchestrator_dd_url` setting. If both are set `orchestrator_explorer.orchestrator_dd_url` will take precedence. config.BindEnv("process_config.orchestrator_dd_url", "DD_PROCESS_CONFIG_ORCHESTRATOR_DD_URL", "DD_PROCESS_AGENT_ORCHESTRATOR_DD_URL") // DEPRECATED in favor of `orchestrator_explorer.orchestrator_additional_endpoints` setting. If both are set `orchestrator_explorer.orchestrator_additional_endpoints` will take precedence. - config.SetKnown("process_config.orchestrator_additional_endpoints.*") - config.SetKnown("orchestrator_explorer.orchestrator_additional_endpoints.*") + config.SetKnown("process_config.orchestrator_additional_endpoints") config.BindEnvAndSetDefault("orchestrator_explorer.extra_tags", []string{}) // Network @@ -898,7 +897,6 @@ func InitConfig(config pkgconfigmodel.Setup) { config.BindEnvAndSetDefault("security_agent.cmd_port", DefaultSecurityAgentCmdPort) config.BindEnvAndSetDefault("security_agent.expvar_port", 5011) config.BindEnvAndSetDefault("security_agent.log_file", DefaultSecurityAgentLogFile) - config.BindEnvAndSetDefault("security_agent.remote_workloadmeta", true) // debug config to enable a remote client to receive data from the workloadmeta agent without a timeout config.BindEnvAndSetDefault("workloadmeta.remote.recv_without_timeout", true) @@ -1094,6 +1092,8 @@ func agent(config pkgconfigmodel.Setup) { config.BindEnvAndSetDefault("check_runners", int64(4)) config.BindEnvAndSetDefault("check_cancel_timeout", 500*time.Millisecond) config.BindEnvAndSetDefault("auth_token_file_path", "") + // used to override the path where the IPC cert/key files are stored/retrieved + config.BindEnvAndSetDefault("ipc_cert_file_path", "") config.BindEnv("bind_host") config.BindEnvAndSetDefault("health_port", int64(0)) config.BindEnvAndSetDefault("disable_py3_validation", false) @@ -1282,7 +1282,6 @@ func telemetry(config pkgconfigmodel.Setup) { // Agent Telemetry config.BindEnvAndSetDefault("agent_telemetry.enabled", true) - config.SetKnown("agent_telemetry.additional_endpoints.*") bindEnvAndSetLogsConfigKeys(config, "agent_telemetry.") } @@ -1572,6 +1571,10 @@ func logsagent(config pkgconfigmodel.Setup) { // Add a tag to logs that are truncated by the agent config.BindEnvAndSetDefault("logs_config.tag_truncated_logs", false) + // Number of logs pipeline instances. Defaults to number of logical CPU cores as defined by GOMAXPROCS or 4, whichever is lower. + logsPipelines := min(4, runtime.GOMAXPROCS(0)) + config.BindEnvAndSetDefault("logs_config.pipelines", logsPipelines) + // If true, the agent looks for container logs in the location used by podman, rather // than docker. This is a temporary configuration parameter to support podman logs until // a more substantial refactor of autodiscovery is made to determine this automatically. @@ -1670,6 +1673,7 @@ func kubernetes(config pkgconfigmodel.Setup) { config.BindEnvAndSetDefault("kubelet_cache_pods_duration", 5) // Polling frequency in seconds of the agent to the kubelet "/pods" endpoint config.BindEnvAndSetDefault("kubelet_listener_polling_interval", 5) // Polling frequency in seconds of the pod watcher to detect new pods/containers (affected by kubelet_cache_pods_duration setting) config.BindEnvAndSetDefault("kubernetes_collect_metadata_tags", true) + config.BindEnvAndSetDefault("kubernetes_use_endpoint_slices", false) config.BindEnvAndSetDefault("kubernetes_metadata_tag_update_freq", 60) // Polling frequency of the Agent to the DCA in seconds (gets the local cache if the DCA is disabled) config.BindEnvAndSetDefault("kubernetes_apiserver_client_timeout", 10) config.BindEnvAndSetDefault("kubernetes_apiserver_informer_client_timeout", 0) @@ -1814,19 +1818,18 @@ func findUnknownKeys(config pkgconfigmodel.Config) []string { var unknownKeys []string knownKeys := config.GetKnownKeysLowercased() loadedKeys := config.AllKeysLowercased() - for _, key := range loadedKeys { - if _, found := knownKeys[key]; !found { - // Check if any subkey terminated with a '.*' wildcard is marked as known - // e.g.: apm_config.* would match all sub-keys of apm_config - splitPath := strings.Split(key, ".") - for j := range splitPath { - subKey := strings.Join(splitPath[:j+1], ".") + ".*" - if _, found = knownKeys[subKey]; found { + for _, loadedKey := range loadedKeys { + if _, found := knownKeys[loadedKey]; !found { + nestedValue := false + // If a value is within a known key it is considered known. + for knownKey := range knownKeys { + if strings.HasPrefix(loadedKey, knownKey+".") { + nestedValue = true break } } - if !found { - unknownKeys = append(unknownKeys, key) + if !nestedValue { + unknownKeys = append(unknownKeys, loadedKey) } } } diff --git a/pkg/config/setup/config_test.go b/pkg/config/setup/config_test.go index c9713b2fccd9c..a9c7a787689c4 100644 --- a/pkg/config/setup/config_test.go +++ b/pkg/config/setup/config_test.go @@ -6,11 +6,11 @@ package setup import ( - "bytes" "fmt" "os" "path" "path/filepath" + "slices" "strings" "testing" "time" @@ -45,7 +45,7 @@ func unsetEnvForTest(t *testing.T, env string) { func confFromYAML(t *testing.T, yamlConfig string) pkgconfigmodel.Config { conf := newTestConf() conf.SetConfigType("yaml") - err := conf.ReadConfig(bytes.NewBuffer([]byte(yamlConfig))) + err := conf.ReadConfig(strings.NewReader(yamlConfig)) require.NoError(t, err) return conf } @@ -133,15 +133,39 @@ func TestUnexpectedWhitespace(t *testing.T) { } func TestUnknownKeysWarning(t *testing.T) { - conf := newTestConf() - conf.SetWithoutSource("site", "datadoghq.eu") - assert.Len(t, findUnknownKeys(conf), 0) + yaml := ` +a: 21 +aa: 21 +b: + c: + d: "test" +` + conf := confFromYAML(t, yaml) - conf.SetWithoutSource("unknown_key.unknown_subkey", "true") - assert.Len(t, findUnknownKeys(conf), 1) + res := findUnknownKeys(conf) + slices.Sort(res) + assert.Equal(t, []string{"a", "aa", "b.c.d"}, res) + + conf.SetDefault("a", 0) + res = findUnknownKeys(conf) + slices.Sort(res) + assert.Equal(t, []string{"aa", "b.c.d"}, res) - conf.SetKnown("unknown_key.*") - assert.Len(t, findUnknownKeys(conf), 0) + conf.SetWithoutSource("a", 12) + res = findUnknownKeys(conf) + slices.Sort(res) + assert.Equal(t, []string{"aa", "b.c.d"}, res) + + // testing that nested value are correctly detected + conf.SetDefault("b.c", map[string]string{}) + res = findUnknownKeys(conf) + slices.Sort(res) + assert.Equal(t, []string{"aa"}, res) + + conf.SetWithoutSource("unknown_key.unknown_subkey", "true") + res = findUnknownKeys(conf) + slices.Sort(res) + assert.Equal(t, []string{"aa", "unknown_key.unknown_subkey"}, res) } func TestUnknownVarsWarning(t *testing.T) { @@ -1447,6 +1471,38 @@ func TestDisableCoreAgent(t *testing.T) { assert.False(t, conf.GetBool("enable_payloads.sketches")) } +func TestAPMObfuscationDefaultValue(t *testing.T) { + pkgconfigmodel.CleanOverride(t) + conf := pkgconfigmodel.NewConfig("datadog", "DD", strings.NewReplacer(".", "_")) // nolint: forbidigo // legit use case + + InitConfig(conf) + assert.True(t, conf.GetBool("apm_config.obfuscation.elasticsearch.enabled")) + assert.Len(t, conf.GetStringSlice("apm_config.obfuscation.elasticsearch.keep_values"), 0) + assert.Len(t, conf.GetStringSlice("apm_config.obfuscation.elasticsearch.obfuscate_sql_values"), 0) + assert.True(t, conf.GetBool("apm_config.obfuscation.opensearch.enabled")) + assert.Len(t, conf.GetStringSlice("apm_config.obfuscation.opensearch.keep_values"), 0) + assert.Len(t, conf.GetStringSlice("apm_config.obfuscation.opensearch.obfuscate_sql_values"), 0) + assert.True(t, conf.GetBool("apm_config.obfuscation.mongodb.enabled")) + assert.Len(t, conf.GetStringSlice("apm_config.obfuscation.mongodb.keep_values"), 0) + assert.Len(t, conf.GetStringSlice("apm_config.obfuscation.mongodb.obfuscate_sql_values"), 0) + assert.False(t, conf.GetBool("apm_config.obfuscation.sql_exec_plan.enabled")) + assert.Len(t, conf.GetStringSlice("apm_config.obfuscation.sql_exec_plan.keep_values"), 0) + assert.Len(t, conf.GetStringSlice("apm_config.obfuscation.sql_exec_plan.obfuscate_sql_values"), 0) + assert.False(t, conf.GetBool("apm_config.obfuscation.sql_exec_plan_normalize.enabled")) + assert.Len(t, conf.GetStringSlice("apm_config.obfuscation.sql_exec_plan_normalize.keep_values"), 0) + assert.Len(t, conf.GetStringSlice("apm_config.obfuscation.sql_exec_plan_normalize.obfuscate_sql_values"), 0) + assert.False(t, conf.GetBool("apm_config.obfuscation.http.remove_query_string")) + assert.False(t, conf.GetBool("apm_config.obfuscation.http.remove_paths_with_digits")) + assert.True(t, conf.GetBool("apm_config.obfuscation.redis.enabled")) + assert.False(t, conf.GetBool("apm_config.obfuscation.redis.remove_all_args")) + assert.True(t, conf.GetBool("apm_config.obfuscation.memcached.enabled")) + assert.False(t, conf.GetBool("apm_config.obfuscation.memcached.keep_command")) + assert.True(t, conf.GetBool("apm_config.obfuscation.credit_cards.enabled")) + assert.False(t, conf.GetBool("apm_config.obfuscation.credit_cards.luhn")) + assert.Len(t, conf.GetStringSlice("apm_config.obfuscation.credit_cards.keep_values"), 0) + assert.True(t, conf.GetBool("apm_config.obfuscation.cache.enabled")) +} + func TestAgentConfigInit(t *testing.T) { conf := newTestConf() diff --git a/pkg/config/setup/go.mod b/pkg/config/setup/go.mod index c6855f5379f0f..efce2878f53ec 100644 --- a/pkg/config/setup/go.mod +++ b/pkg/config/setup/go.mod @@ -44,11 +44,11 @@ require ( github.com/DataDog/datadog-agent/pkg/util/executable v0.59.0 github.com/DataDog/datadog-agent/pkg/util/fxutil v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.59.0 - github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 + github.com/DataDog/datadog-agent/pkg/util/log v0.59.1 github.com/DataDog/datadog-agent/pkg/util/optional v0.59.0 - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.0 + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.1 github.com/DataDog/datadog-agent/pkg/util/system v0.59.0 - github.com/DataDog/datadog-agent/pkg/util/winutil v0.59.0 + github.com/DataDog/datadog-agent/pkg/util/winutil v0.59.1 github.com/stretchr/testify v1.10.0 go.uber.org/fx v1.23.0 gopkg.in/yaml.v2 v2.4.0 @@ -62,32 +62,33 @@ require ( github.com/DataDog/datadog-agent/pkg/util/filesystem v0.59.0 // indirect 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/viper v1.13.5 // indirect + github.com/DataDog/datadog-agent/pkg/version v0.59.1 // 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 - github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 // indirect + github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 // indirect - github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c // indirect + github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c // indirect github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect 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/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect github.com/prometheus/client_golang v1.20.5 // indirect 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 @@ -100,9 +101,9 @@ require ( go.uber.org/dig v1.18.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect - golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f // indirect - golang.org/x/sys v0.27.0 // indirect - golang.org/x/text v0.20.0 // indirect + golang.org/x/exp v0.0.0-20241210194714-1829a127f884 // indirect + golang.org/x/sys v0.28.0 // indirect + golang.org/x/text v0.21.0 // indirect google.golang.org/protobuf v1.35.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) @@ -110,3 +111,5 @@ require ( replace github.com/DataDog/datadog-agent/pkg/config/mock => ../mock replace github.com/DataDog/datadog-agent/pkg/config/structure => ../structure + +replace github.com/DataDog/datadog-agent/pkg/version => ../../version diff --git a/pkg/config/setup/go.sum b/pkg/config/setup/go.sum index 3308d693c3968..a7d0de6fe2cdf 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= @@ -89,8 +91,8 @@ github.com/grpc-ecosystem/grpc-gateway v1.13.0/go.mod h1:8XEsbTttt/W+VvjtQhLACqC github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/hcl v1.0.1-vault-5 h1:kI3hhbbyzr4dldA8UdTb7ZlVVlI2DACdCfz31RPDgJM= github.com/hashicorp/hcl v1.0.1-vault-5/go.mod h1:XYhtn6ijBSAj6n4YqAaf7RBPS4I06AItNorpy+MoQNM= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 h1:S4qyfL2sEm5Budr4KVMyEniCy+PbS55651I/a+Kn/NQ= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb h1:PGufWXXDq9yaev6xX1YQauaO1MV90e6Mpoq1I7Lz/VM= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= @@ -114,8 +116,8 @@ 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-20220913051719-115f729f3c8c h1:VtwQ41oftZwlMnOEbMWQtSEUgU64U4s+GHk7hZK+jtY= -github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c/go.mod h1:JKx41uQRwqlTZabZc+kILPrO/3jlKnQ2Z8b7YiVw5cE= +github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a h1:3Bm7EwfUQUvhNeKIkUct/gl9eod1TcXuj8stxvi/GoI= +github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a/go.mod h1:ilwx/Dta8jXAgpFYFvSWEMwxmbWXyiUHkd5FwyKhb5k= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= @@ -143,8 +145,8 @@ github.com/pkg/errors v0.8.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-20220216144756-c35f1ee13d7c h1:NRoLoZvkBTKvR5gQLgA3e0hqjkY9u1wm+iOL45VN/qI= -github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 h1:o4JXh1EVt9k/+g42oCprj/FisM4qX9L3sZB3upGN2ZU= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= @@ -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= @@ -246,8 +244,8 @@ golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnf golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f h1:XdNn9LlyWAhLVp6P/i8QYBW+hlyhrhei9uErw2B5GJo= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f/go.mod h1:D5SMRVC3C2/4+F/DB1wZsLRnSNimn2Sp/NPsCrsv8ak= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884 h1:Y/Mj/94zIQQGHVSv1tTtQBDaQaJe62U9bkDZKKyhPCU= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -284,11 +282,11 @@ golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20220829200755-d48e67d00261/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.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/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= -golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= diff --git a/pkg/config/setup/system_probe.go b/pkg/config/setup/system_probe.go index a31d90efac8d8..12a94b923c7b7 100644 --- a/pkg/config/setup/system_probe.go +++ b/pkg/config/setup/system_probe.go @@ -80,6 +80,9 @@ func InitSystemProbeConfig(cfg pkgconfigmodel.Config) { cfg.BindEnvAndSetDefault("sbom.cache.clean_interval", "30m") // used by custom cache. cfg.BindEnvAndSetDefault("sbom.scan_queue.base_backoff", "5m") cfg.BindEnvAndSetDefault("sbom.scan_queue.max_backoff", "1h") + // those configs are used by the core agent path, but are not used by the system probe + cfg.SetKnown("sbom.container_image.enabled") + cfg.SetKnown("sbom.container_image.overlayfs_direct_scan") // Auto exit configuration cfg.BindEnvAndSetDefault("auto_exit.validation_period", 60) @@ -214,6 +217,7 @@ func InitSystemProbeConfig(cfg pkgconfigmodel.Config) { cfg.BindEnvAndSetDefault(join(netNS, "conntrack_init_timeout"), 10*time.Second) cfg.BindEnvAndSetDefault(join(netNS, "allow_netlink_conntracker_fallback"), true) cfg.BindEnvAndSetDefault(join(netNS, "enable_ebpf_conntracker"), true) + cfg.BindEnvAndSetDefault(join(netNS, "enable_cilium_lb_conntracker"), false) cfg.BindEnvAndSetDefault(join(spNS, "source_excludes"), map[string][]string{}) cfg.BindEnvAndSetDefault(join(spNS, "dest_excludes"), map[string][]string{}) @@ -368,13 +372,12 @@ func InitSystemProbeConfig(cfg pkgconfigmodel.Config) { eventMonitorBindEnvAndSetDefault(cfg, join(evNS, "network.classifier_handle"), 0) eventMonitorBindEnvAndSetDefault(cfg, join(evNS, "network.raw_classifier_handle"), 0) eventMonitorBindEnvAndSetDefault(cfg, join(evNS, "event_stream.use_ring_buffer"), true) - eventMonitorBindEnvAndSetDefault(cfg, join(evNS, "event_stream.use_fentry"), false) - eventMonitorBindEnvAndSetDefault(cfg, join(evNS, "event_stream.use_fentry_amd64"), false) - eventMonitorBindEnvAndSetDefault(cfg, join(evNS, "event_stream.use_fentry_arm64"), false) + eventMonitorBindEnvAndSetDefault(cfg, join(evNS, "event_stream.use_fentry"), true) + eventMonitorBindEnv(cfg, join(evNS, "event_stream.use_fentry_amd64")) + eventMonitorBindEnv(cfg, join(evNS, "event_stream.use_fentry_arm64")) eventMonitorBindEnv(cfg, join(evNS, "event_stream.buffer_size")) eventMonitorBindEnvAndSetDefault(cfg, join(evNS, "envs_with_value"), []string{"LD_PRELOAD", "LD_LIBRARY_PATH", "PATH", "HISTSIZE", "HISTFILESIZE", "GLIBC_TUNABLES"}) eventMonitorBindEnvAndSetDefault(cfg, join(evNS, "runtime_compilation.enabled"), false) - eventMonitorBindEnv(cfg, join(evNS, "runtime_compilation.compiled_constants_enabled")) eventMonitorBindEnvAndSetDefault(cfg, join(evNS, "network.enabled"), true) eventMonitorBindEnvAndSetDefault(cfg, join(evNS, "network.ingress.enabled"), false) eventMonitorBindEnvAndSetDefault(cfg, join(evNS, "network.raw_packet.enabled"), false) diff --git a/pkg/config/setup/system_probe_cws.go b/pkg/config/setup/system_probe_cws.go index d2cc6276907d3..c689e1fd68e28 100644 --- a/pkg/config/setup/system_probe_cws.go +++ b/pkg/config/setup/system_probe_cws.go @@ -57,6 +57,7 @@ func initCWSSystemProbeConfig(cfg pkgconfigmodel.Config) { cfg.BindEnvAndSetDefault("runtime_security_config.activity_dump.min_timeout", "10m") cfg.BindEnvAndSetDefault("runtime_security_config.activity_dump.max_dump_size", 1750) cfg.BindEnvAndSetDefault("runtime_security_config.activity_dump.traced_cgroups_count", 5) + cfg.BindEnvAndSetDefault("runtime_security_config.activity_dump.cgroup_managers", []string{"docker", "podman", "containerd", "cri-o"}) cfg.BindEnvAndSetDefault("runtime_security_config.activity_dump.traced_event_types", []string{"exec", "open", "dns", "imds"}) cfg.BindEnv("runtime_security_config.activity_dump.cgroup_dump_timeout") // deprecated in favor of dump_duration cfg.BindEnvAndSetDefault("runtime_security_config.activity_dump.dump_duration", "900s") diff --git a/pkg/config/structure/go.mod b/pkg/config/structure/go.mod index a4b08d8efd789..0ad28fd9f92f5 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 ) @@ -44,6 +44,7 @@ require ( require ( github.com/DataDog/datadog-agent/pkg/util/log v0.56.0-rc.3 // indirect 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/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/fsnotify/fsnotify v1.8.0 // indirect @@ -57,9 +58,11 @@ require ( github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect go.uber.org/atomic v1.11.0 // indirect - golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f // indirect - golang.org/x/sys v0.27.0 // indirect - golang.org/x/text v0.20.0 // indirect + golang.org/x/exp v0.0.0-20241210194714-1829a127f884 // indirect + golang.org/x/sys v0.28.0 // indirect + golang.org/x/text v0.21.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) + +replace github.com/DataDog/datadog-agent/pkg/version => ../../version diff --git a/pkg/config/structure/go.sum b/pkg/config/structure/go.sum index 594839f68ca17..c5a94912c5617 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= @@ -188,8 +188,8 @@ golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnf golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f h1:XdNn9LlyWAhLVp6P/i8QYBW+hlyhrhei9uErw2B5GJo= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f/go.mod h1:D5SMRVC3C2/4+F/DB1wZsLRnSNimn2Sp/NPsCrsv8ak= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884 h1:Y/Mj/94zIQQGHVSv1tTtQBDaQaJe62U9bkDZKKyhPCU= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -222,11 +222,11 @@ golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20220829200755-d48e67d00261/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.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/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= -golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= diff --git a/pkg/config/teeconfig/go.mod b/pkg/config/teeconfig/go.mod index 5f73448a14327..daec9f976da68 100644 --- a/pkg/config/teeconfig/go.mod +++ b/pkg/config/teeconfig/go.mod @@ -11,11 +11,12 @@ 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 ( 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/fsnotify/fsnotify v1.8.0 // indirect github.com/hashicorp/hcl v1.0.1-vault-5 // indirect @@ -28,8 +29,11 @@ require ( github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect go.uber.org/atomic v1.11.0 // indirect - golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f // indirect - golang.org/x/sys v0.27.0 // indirect - golang.org/x/text v0.20.0 // indirect + golang.org/x/exp v0.0.0-20241210194714-1829a127f884 // indirect + golang.org/x/sys v0.28.0 // indirect + golang.org/x/text v0.21.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect ) + +replace github.com/DataDog/datadog-agent/pkg/version => ../../version diff --git a/pkg/config/teeconfig/go.sum b/pkg/config/teeconfig/go.sum index ef76baba5c97d..4ffd1e9d2ce0a 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= @@ -185,8 +185,8 @@ golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnf golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f h1:XdNn9LlyWAhLVp6P/i8QYBW+hlyhrhei9uErw2B5GJo= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f/go.mod h1:D5SMRVC3C2/4+F/DB1wZsLRnSNimn2Sp/NPsCrsv8ak= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884 h1:Y/Mj/94zIQQGHVSv1tTtQBDaQaJe62U9bkDZKKyhPCU= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -219,11 +219,11 @@ golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20220829200755-d48e67d00261/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.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/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= -golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= diff --git a/pkg/config/utils/go.mod b/pkg/config/utils/go.mod index 4c39a2d8c2f78..79904b4e40b59 100644 --- a/pkg/config/utils/go.mod +++ b/pkg/config/utils/go.mod @@ -38,8 +38,8 @@ require ( github.com/DataDog/datadog-agent/pkg/config/model v0.59.0 github.com/DataDog/datadog-agent/pkg/config/setup v0.59.0 github.com/DataDog/datadog-agent/pkg/config/structure v0.59.0 - github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 - github.com/DataDog/datadog-agent/pkg/version v0.56.0-rc.3 + github.com/DataDog/datadog-agent/pkg/util/log v0.59.1 + github.com/DataDog/datadog-agent/pkg/version v0.59.1 github.com/stretchr/testify v1.10.0 ) @@ -54,28 +54,28 @@ require ( github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/optional v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/pointer v0.59.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.1 // indirect 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.0 // indirect - github.com/DataDog/viper v1.13.5 // indirect + github.com/DataDog/datadog-agent/pkg/util/winutil v0.59.1 // 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 - github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 // indirect + github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb // indirect github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 // indirect - github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c // indirect + github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c // indirect github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect 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/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // 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 @@ -84,9 +84,9 @@ require ( github.com/tklauser/numcpus v0.8.0 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect go.uber.org/atomic v1.11.0 // indirect - golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f // indirect - golang.org/x/sys v0.27.0 // indirect - golang.org/x/text v0.20.0 // indirect + golang.org/x/exp v0.0.0-20241210194714-1829a127f884 // indirect + golang.org/x/sys v0.28.0 // indirect + golang.org/x/text v0.21.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/pkg/config/utils/go.sum b/pkg/config/utils/go.sum index b70b04e70aa56..e78672416b092 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= @@ -69,7 +71,6 @@ github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/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= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -84,8 +85,8 @@ github.com/grpc-ecosystem/grpc-gateway v1.13.0/go.mod h1:8XEsbTttt/W+VvjtQhLACqC github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/hcl v1.0.1-vault-5 h1:kI3hhbbyzr4dldA8UdTb7ZlVVlI2DACdCfz31RPDgJM= github.com/hashicorp/hcl v1.0.1-vault-5/go.mod h1:XYhtn6ijBSAj6n4YqAaf7RBPS4I06AItNorpy+MoQNM= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 h1:S4qyfL2sEm5Budr4KVMyEniCy+PbS55651I/a+Kn/NQ= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb h1:PGufWXXDq9yaev6xX1YQauaO1MV90e6Mpoq1I7Lz/VM= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= @@ -107,8 +108,8 @@ 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-20220913051719-115f729f3c8c h1:VtwQ41oftZwlMnOEbMWQtSEUgU64U4s+GHk7hZK+jtY= -github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c/go.mod h1:JKx41uQRwqlTZabZc+kILPrO/3jlKnQ2Z8b7YiVw5cE= +github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a h1:3Bm7EwfUQUvhNeKIkUct/gl9eod1TcXuj8stxvi/GoI= +github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a/go.mod h1:ilwx/Dta8jXAgpFYFvSWEMwxmbWXyiUHkd5FwyKhb5k= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= @@ -135,8 +136,8 @@ github.com/pkg/errors v0.8.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-20220216144756-c35f1ee13d7c h1:NRoLoZvkBTKvR5gQLgA3e0hqjkY9u1wm+iOL45VN/qI= -github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 h1:o4JXh1EVt9k/+g42oCprj/FisM4qX9L3sZB3upGN2ZU= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= @@ -167,12 +168,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= @@ -237,8 +234,8 @@ golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnf golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f h1:XdNn9LlyWAhLVp6P/i8QYBW+hlyhrhei9uErw2B5GJo= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f/go.mod h1:D5SMRVC3C2/4+F/DB1wZsLRnSNimn2Sp/NPsCrsv8ak= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884 h1:Y/Mj/94zIQQGHVSv1tTtQBDaQaJe62U9bkDZKKyhPCU= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -275,11 +272,11 @@ golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20220829200755-d48e67d00261/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.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/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= -golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= diff --git a/pkg/databasemonitoring/aws/aurora.go b/pkg/databasemonitoring/aws/aurora.go index 6e5b25198b20d..18f849bf2d926 100644 --- a/pkg/databasemonitoring/aws/aurora.go +++ b/pkg/databasemonitoring/aws/aurora.go @@ -32,6 +32,7 @@ type Instance struct { Port int32 IamEnabled bool Engine string + DbName string } const ( @@ -46,7 +47,6 @@ func (c *Client) GetAuroraClusterEndpoints(ctx context.Context, dbClusterIdentif return nil, fmt.Errorf("at least one database cluster identifier is required") } clusters := make(map[string]*AuroraCluster, 0) - for _, clusterID := range dbClusterIdentifiers { // TODO: Seth Samuel: This method is not paginated, so if there are more than 100 instances in a cluster, we will only get the first 100 // We should add pagination support to this method at some point @@ -82,6 +82,9 @@ func (c *Client) GetAuroraClusterEndpoints(ctx context.Context, dbClusterIdentif if db.Engine != nil { instance.Engine = *db.Engine } + if db.DBName != nil { + instance.DbName = *db.DBName + } if _, ok := clusters[*db.DBClusterIdentifier]; !ok { clusters[*db.DBClusterIdentifier] = &AuroraCluster{ Instances: make([]*Instance, 0), diff --git a/pkg/databasemonitoring/aws/aurora_test.go b/pkg/databasemonitoring/aws/aurora_test.go index 4fd364ad3da49..d4bb8676fd6d7 100644 --- a/pkg/databasemonitoring/aws/aurora_test.go +++ b/pkg/databasemonitoring/aws/aurora_test.go @@ -68,6 +68,7 @@ func TestGetAuroraClusterEndpoints(t *testing.T) { AvailabilityZone: aws.String("us-east-1a"), DBInstanceStatus: aws.String("available"), Engine: aws.String("aurora-postgresql"), + DBName: aws.String("postgres"), }, }, }, nil).Times(1) @@ -81,6 +82,7 @@ func TestGetAuroraClusterEndpoints(t *testing.T) { Port: 5432, IamEnabled: true, Engine: "aurora-postgresql", + DbName: "postgres", }, }, }, @@ -101,6 +103,7 @@ func TestGetAuroraClusterEndpoints(t *testing.T) { AvailabilityZone: aws.String("us-east-1a"), DBInstanceStatus: aws.String("available"), Engine: aws.String("aurora-postgresql"), + DBName: aws.String("postgres"), }, { Endpoint: &types.Endpoint{ @@ -112,6 +115,7 @@ func TestGetAuroraClusterEndpoints(t *testing.T) { AvailabilityZone: aws.String("us-east-1a"), DBInstanceStatus: aws.String("available"), Engine: aws.String("aurora-postgresql"), + DBName: aws.String("postgres"), }, { Endpoint: &types.Endpoint{ @@ -123,6 +127,7 @@ func TestGetAuroraClusterEndpoints(t *testing.T) { AvailabilityZone: aws.String("us-east-1a"), DBInstanceStatus: aws.String("available"), Engine: aws.String("aurora-postgresql"), + DBName: aws.String("postgres"), }, }, }, nil).Times(1) @@ -136,18 +141,21 @@ func TestGetAuroraClusterEndpoints(t *testing.T) { Port: 5432, IamEnabled: true, Engine: "aurora-postgresql", + DbName: "postgres", }, { Endpoint: "test-endpoint-2", Port: 5432, IamEnabled: false, Engine: "aurora-postgresql", + DbName: "postgres", }, { Endpoint: "test-endpoint-3", Port: 5444, IamEnabled: false, Engine: "aurora-postgresql", + DbName: "postgres", }, }, }, @@ -168,6 +176,7 @@ func TestGetAuroraClusterEndpoints(t *testing.T) { AvailabilityZone: aws.String("us-east-1a"), DBInstanceStatus: aws.String("available"), Engine: aws.String("aurora-postgresql"), + DBName: aws.String("postgres"), }, { Endpoint: &types.Endpoint{ @@ -179,6 +188,7 @@ func TestGetAuroraClusterEndpoints(t *testing.T) { AvailabilityZone: aws.String("us-east-1a"), DBInstanceStatus: aws.String("terminating"), Engine: aws.String("aurora-postgresql"), + DBName: aws.String("postgres"), }, { Endpoint: &types.Endpoint{ @@ -190,6 +200,7 @@ func TestGetAuroraClusterEndpoints(t *testing.T) { AvailabilityZone: aws.String("us-east-1a"), DBInstanceStatus: aws.String("terminating"), Engine: aws.String("aurora-postgresql"), + DBName: aws.String("postgres"), }, }, }, nil).Times(1) @@ -203,6 +214,7 @@ func TestGetAuroraClusterEndpoints(t *testing.T) { Port: 5432, IamEnabled: true, Engine: "aurora-postgresql", + DbName: "postgres", }, }, }, @@ -223,6 +235,7 @@ func TestGetAuroraClusterEndpoints(t *testing.T) { AvailabilityZone: aws.String("us-east-1a"), DBInstanceStatus: aws.String("available"), Engine: aws.String("aurora-postgresql"), + DBName: aws.String("postgres"), }, }, }, nil).Times(1) @@ -239,6 +252,7 @@ func TestGetAuroraClusterEndpoints(t *testing.T) { Port: 5432, IamEnabled: true, Engine: "aurora-postgresql", + DbName: "postgres", }, }, }, @@ -259,6 +273,7 @@ func TestGetAuroraClusterEndpoints(t *testing.T) { AvailabilityZone: aws.String("us-east-1a"), DBInstanceStatus: aws.String("available"), Engine: aws.String("aurora-postgresql"), + DBName: aws.String("postgres"), }, { Endpoint: &types.Endpoint{ @@ -270,6 +285,7 @@ func TestGetAuroraClusterEndpoints(t *testing.T) { AvailabilityZone: aws.String("us-east-1a"), DBInstanceStatus: aws.String("available"), Engine: aws.String("aurora-postgresql"), + DBName: aws.String("postgres"), }, }, }, nil).Times(1) @@ -286,6 +302,7 @@ func TestGetAuroraClusterEndpoints(t *testing.T) { AvailabilityZone: aws.String("us-east-1c"), DBInstanceStatus: aws.String("available"), Engine: aws.String("aurora-postgresql"), + DBName: aws.String("postgres"), }, }, }, nil).Times(1) @@ -299,12 +316,14 @@ func TestGetAuroraClusterEndpoints(t *testing.T) { Port: 5432, IamEnabled: true, Engine: "aurora-postgresql", + DbName: "postgres", }, { Endpoint: "test-endpoint-2", Port: 5432, IamEnabled: false, Engine: "aurora-postgresql", + DbName: "postgres", }, }, }, @@ -315,6 +334,7 @@ func TestGetAuroraClusterEndpoints(t *testing.T) { Port: 5444, IamEnabled: true, Engine: "aurora-postgresql", + DbName: "postgres", }, }, }, diff --git a/pkg/dynamicinstrumentation/codegen/c/base_event.h b/pkg/dynamicinstrumentation/codegen/c/base_event.h new file mode 100644 index 0000000000000..04b2da65d0974 --- /dev/null +++ b/pkg/dynamicinstrumentation/codegen/c/base_event.h @@ -0,0 +1,15 @@ +#ifndef DI_BASE_EVENT_H +#define DI_BASE_EVENT_H + +#include "ktypes.h" + +// standard fields which all events created in bpf will contain, regardless of the function that the +// probe is instrumenting +struct base_event { + char probe_id[36]; // identifier for each user-configured instrumentation point, it's a standard 36 character UUID + __u32 pid; // process ID + __u32 uid; // user ID + __u64 program_counters[10]; // program counters representing the stack trace of the instrumented function invocation +}__attribute__((aligned(8))); + +#endif diff --git a/pkg/dynamicinstrumentation/codegen/c/dynamicinstrumentation.c b/pkg/dynamicinstrumentation/codegen/c/dynamicinstrumentation.c index 0f850b0ad8731..b42611f97e205 100644 --- a/pkg/dynamicinstrumentation/codegen/c/dynamicinstrumentation.c +++ b/pkg/dynamicinstrumentation/codegen/c/dynamicinstrumentation.c @@ -2,41 +2,22 @@ #include "bpf_tracing.h" #include "kconfig.h" #include -#include "types.h" - -#define MAX_STRING_SIZE {{ .InstrumentationInfo.InstrumentationOptions.StringMaxSize}} -#define PARAM_BUFFER_SIZE {{ .InstrumentationInfo.InstrumentationOptions.ArgumentsMaxSize}} -#define STACK_DEPTH_LIMIT 10 -#define MAX_SLICE_SIZE 1800 -#define MAX_SLICE_LENGTH 20 - -struct { - __uint(type, BPF_MAP_TYPE_RINGBUF); - __uint(max_entries, 1 << 24); -} events SEC(".maps"); - -struct { - __uint(type, BPF_MAP_TYPE_ARRAY); - __uint(key_size, sizeof(__u32)); - __uint(value_size, sizeof(char[PARAM_BUFFER_SIZE])); - __uint(max_entries, 1); -} zeroval SEC(".maps"); - -struct event { - struct base_event base; - char output[PARAM_BUFFER_SIZE]; -}; +#include "base_event.h" +#include "macros.h" +#include "event.h" +#include "maps.h" +#include "expressions.h" SEC("uprobe/{{.GetBPFFuncName}}") int {{.GetBPFFuncName}}(struct pt_regs *ctx) { - bpf_printk("{{.GetBPFFuncName}} probe in {{.ServiceName}} has triggered"); + log_debug("{{.GetBPFFuncName}} probe in {{.ServiceName}} has triggered"); // reserve space on ringbuffer - struct event *event; - event = bpf_ringbuf_reserve(&events, sizeof(struct event), 0); + event_t *event; + event = bpf_ringbuf_reserve(&events, sizeof(event_t), 0); if (!event) { - bpf_printk("No space available on ringbuffer, dropping event"); + log_debug("No space available on ringbuffer, dropping event"); return 0; } @@ -44,15 +25,27 @@ int {{.GetBPFFuncName}}(struct pt_regs *ctx) __u32 key = 0; zero_string = bpf_map_lookup_elem(&zeroval, &key); if (!zero_string) { - bpf_printk("couldn't lookup zero value in zeroval array map, dropping event for {{.GetBPFFuncName}}"); + log_debug("couldn't lookup zero value in zeroval array map, dropping event for {{.GetBPFFuncName}}"); bpf_ringbuf_discard(event, 0); return 0; } - - bpf_probe_read(&event->base.probe_id, sizeof(event->base.probe_id), zero_string); - bpf_probe_read(&event->base.program_counters, sizeof(event->base.program_counters), zero_string); - bpf_probe_read(&event->output, sizeof(event->output), zero_string); - bpf_probe_read(&event->base.probe_id, {{ .ID | len }}, "{{.ID}}"); + long err; + err = bpf_probe_read_kernel(&event->base.probe_id, sizeof(event->base.probe_id), zero_string); + if (err != 0) { + log_debug("could not zero out probe id buffer"); + } + err = bpf_probe_read_kernel(&event->base.program_counters, sizeof(event->base.program_counters), zero_string); + if (err != 0) { + log_debug("could not zero out program counter buffer"); + } + err = bpf_probe_read_kernel(&event->output, sizeof(event->output), zero_string); + if (err != 0) { + log_debug("could not zero out output buffer"); + } + err = bpf_probe_read_kernel(&event->base.probe_id, {{ .ID | len }}, "{{.ID}}"); + if (err != 0) { + log_debug("could not write probe id to output"); + } // Get tid and tgid u64 pidtgid = bpf_get_current_pid_tgid(); @@ -65,34 +58,84 @@ int {{.GetBPFFuncName}}(struct pt_regs *ctx) // Collect stack trace __u64 currentPC = PT_REGS_IP(ctx); - bpf_probe_read(&event->base.program_counters[0], sizeof(__u64), ¤tPC); + err = bpf_probe_read_kernel(&event->base.program_counters[0], sizeof(__u64), ¤tPC); + if (err != 0) { + log_debug("could not collect first program counter"); + } __u64 bp = PT_REGS_FP(ctx); - bpf_probe_read(&bp, sizeof(__u64), (void*)bp); // dereference bp to get current stack frame + err = bpf_probe_read_user(&bp, sizeof(__u64), (void*)bp); // dereference bp to get current stack frame + if (err != 0) { + log_debug("could not retrieve base pointer for current stack frame"); + } + __u64 ret_addr = PT_REGS_RET(ctx); // when bpf prog enters, the return address hasn't yet been written to the stack int i; + int j; + __u16 n; for (i = 1; i < STACK_DEPTH_LIMIT; i++) { if (bp == 0) { break; } - bpf_probe_read(&event->base.program_counters[i], sizeof(__u64), &ret_addr); - bpf_probe_read(&ret_addr, sizeof(__u64), (void*)(bp-8)); - bpf_probe_read(&bp, sizeof(__u64), (void*)bp); + err = bpf_probe_read_kernel(&event->base.program_counters[i], sizeof(__u64), &ret_addr); + if (err != 0) { + log_debug("error occurred while collecting program counter for stack trace (1)"); + } + err = bpf_probe_read_user(&ret_addr, sizeof(__u64), (void*)(bp-8)); + if (err != 0) { + log_debug("error occurred while collecting program counter for stack trace (2)"); + } + err = bpf_probe_read_user(&bp, sizeof(__u64), (void*)bp); + if (err != 0) { + log_debug("error occurred while collecting program counter for stack trace (3)"); + } } // Collect parameters + __u16 collectionMax = MAX_SLICE_LENGTH; __u8 param_type; __u16 param_size; __u16 slice_length; + __u16 *collectionLimit; + int chunk_size = 0; + + // Set up temporary storage array which is used by some location expressions + // to have memory off the stack to work with + __u64 *temp_storage = bpf_map_lookup_elem(&temp_storage_array, &key) ; + if (!temp_storage) { + log_debug("could not lookup temporary storage array"); + bpf_ringbuf_discard(event, 0); + return 0; + } + - int outputOffset = 0; + expression_context_t context = { + .ctx = ctx, + .event = event, + .temp_storage = temp_storage, + .zero_string = zero_string, + .output_offset = 0, + .stack_counter = 0, + }; {{ .InstrumentationInfo.BPFParametersSourceCode }} bpf_ringbuf_submit(event, 0); + + // Drain the stack map for next invocation + __u8 m = 0; + __u64 placeholder; + long pop_ret = 0; + for (m = 0; m < context.stack_counter; m++) { + pop_ret = bpf_map_pop_elem(¶m_stack, &placeholder); + if (pop_ret != 0) { + break; + } + } + return 0; } diff --git a/pkg/dynamicinstrumentation/codegen/c/event.h b/pkg/dynamicinstrumentation/codegen/c/event.h new file mode 100644 index 0000000000000..2170f7b6800ab --- /dev/null +++ b/pkg/dynamicinstrumentation/codegen/c/event.h @@ -0,0 +1,25 @@ +#ifndef DI_EVENT_H +#define DI_EVENT_H + +#include "ktypes.h" +#include "macros.h" + +// event is the message which is passed back to user space from bpf containing +// all information about the invocation of the instrumented function +typedef struct event { + struct base_event base; + char output[PARAM_BUFFER_SIZE]; // values of parameters +} event_t; + +// expression_context contains state that is meant to be shared across location expressions +// during execution of the full bpf program. +typedef struct expression_context { + __u64 output_offset; // current offset within the output buffer to write to + __u8 stack_counter; // current size of the bpf parameter stack, used for emptying stack + struct pt_regs *ctx; + event_t *event; // output event allocated on ringbuffer + __u64 *temp_storage; // temporary storage array on heap used by some location expressions + char *zero_string; // array of zero's used to zero out buffers +} expression_context_t; + +#endif diff --git a/pkg/dynamicinstrumentation/codegen/c/expressions.h b/pkg/dynamicinstrumentation/codegen/c/expressions.h new file mode 100644 index 0000000000000..71d822a2e8971 --- /dev/null +++ b/pkg/dynamicinstrumentation/codegen/c/expressions.h @@ -0,0 +1,323 @@ +#ifndef DI_EXPRESSIONS_H +#define DI_EXPRESSIONS_H + +// read_register reads `element_size` bytes from register `reg` into a u64 which is then pushed to +// the top of the BPF parameter stack. +static __always_inline int read_register(expression_context_t *context, __u64 reg, __u32 element_size) +{ + long err; + __u64 valueHolder = 0; + err = bpf_probe_read_kernel(&valueHolder, element_size, &context->ctx->DWARF_REGISTER(reg)); + if (err != 0) { + log_debug("error when reading data from register: %ld", err); + } + bpf_map_push_elem(¶m_stack, &valueHolder, 0); + context->stack_counter += 1; + return err; +} + +// read_stack reads `element_size` bytes from the traced program's stack at offset `stack_offset` +// into a u64 which is then pushed to the top of the BPF parameter stack. +static __always_inline int read_stack(expression_context_t *context, size_t stack_offset, __u32 element_size) +{ + long err; + __u64 valueHolder = 0; + err = bpf_probe_read_kernel(&valueHolder, element_size, &context->ctx->DWARF_STACK_REGISTER+stack_offset); + if (err != 0) { + log_debug("error when reading data from stack: %ld", err); + } + bpf_map_push_elem(¶m_stack, &valueHolder, 0); + context->stack_counter += 1; + return err; +} + +// read_register_value_to_output reads `element_size` bytes from register `reg` into a u64 which is then written to +// the output buffer. +static __always_inline int read_register_value_to_output(expression_context_t *context, __u64 reg, __u32 element_size) +{ + long err; + err = bpf_probe_read_kernel(&context->event->output[(context->output_offset)], element_size, &context->ctx->DWARF_REGISTER(reg)); + if (err != 0) { + log_debug("error when reading data while reading register value to output: %ld", err); + } + context->output_offset += element_size; + return err; +} + +// read_stack_to_output reads `element_size` bytes from the traced program's stack at offset `stack_offset` +// into a u64 which is then written to the output buffer. +static __always_inline int read_stack_value_to_output(expression_context_t *context, __u64 stack_offset, __u32 element_size) +{ + long err; + err = bpf_probe_read_kernel(&context->event->output[(context->output_offset)], element_size, &context->ctx->DWARF_STACK_REGISTER+stack_offset); + if (err != 0) { + log_debug("error when reading data while reading stack value to output: %ld", err); + } + context->output_offset += element_size; + return err; +} + +// pop writes to output `num_elements` elements, each of size `element_size, from the top of the stack. +static __always_inline int pop(expression_context_t *context, __u64 num_elements, __u32 element_size) +{ + long return_err; + long err; + __u64 valueHolder; + int i; + __u8 num_elements_byte = (__u8)num_elements; + for(i = 0; i < num_elements_byte; i++) { + bpf_map_pop_elem(¶m_stack, &valueHolder); + context->stack_counter -= 1; + log_debug("Popping to output: %llu", valueHolder); + err = bpf_probe_read_kernel(&context->event->output[(context->output_offset)+i], element_size, &valueHolder); + if (err != 0) { + log_debug("error when reading data while popping from bpf stack: %ld", err); + return_err = err; + } + context->output_offset += element_size; + } + return return_err; +} + +// dereference pops the 8-byte address from the top of the BPF parameter stack and dereferences +// it, reading a value of size `element_size` from it, and pushes that value (encoded as a u64) +// back to the BPF parameter stack. +// It should only be used for types of 8 bytes or less (see `dereference_large`). +static __always_inline int dereference(expression_context_t *context, __u32 element_size) +{ + long err; + __u64 addressHolder = 0; + err = bpf_map_pop_elem(¶m_stack, &addressHolder); + if (err != 0) { + log_debug("Error popping: %ld", err); + } else { + context->stack_counter -= 1; + } + log_debug("Going to dereference 0x%llx", addressHolder); + + __u64 valueHolder = 0; + err = bpf_probe_read_user(&valueHolder, element_size, (void*)addressHolder); + if (err != 0) { + log_debug("error when reading data while dereferencing: %ld", err); + } + // a mask is used to zero out bytes not used by a smaller type encoded into a __u64 + __u64 mask = (element_size == 8) ? ~0ULL : (1ULL << (8 * element_size)) - 1; + __u64 encodedValueHolder = valueHolder & mask; + + bpf_map_push_elem(¶m_stack, &encodedValueHolder, 0); + context->stack_counter += 1; + return err; +} + +// dereference_to_output pops the 8-byte address from the top of the BPF parameter stack and +// dereferences it, reading a value of size `element_size` from it, and writes that value +// directly to the output buffer. +// It should only be used for types of 8 bytes or less (see `dereference_large_to_output`). +static __always_inline int dereference_to_output(expression_context_t *context, __u32 element_size) +{ + long return_err; + long err; + __u64 addressHolder = 0; + bpf_map_pop_elem(¶m_stack, &addressHolder); + context->stack_counter -= 1; + + __u64 valueHolder = 0; + + log_debug("Going to deref to output: 0x%llx", addressHolder); + err = bpf_probe_read_user(&valueHolder, element_size, (void*)addressHolder); + if (err != 0) { + return_err = err; + log_debug("error when reading data while dereferencing to output: %ld", err); + } + // a mask is used to zero out bytes not used by a smaller type encoded into a __u64 + __u64 mask = (element_size == 8) ? ~0ULL : (1ULL << (8 * element_size)) - 1; + __u64 encodedValueHolder = valueHolder & mask; + + log_debug("Writing %llu to output (dereferenced)", encodedValueHolder); + err = bpf_probe_read_kernel(&context->event->output[(context->output_offset)], element_size, &encodedValueHolder); + if (err != 0) { + return_err = err; + log_debug("error when reading data while dereferencing into output: %ld", err); + } + context->output_offset += element_size; + return return_err; +} + +// dereference_large pops the 8-byte address from the top of the BPF parameter stack and dereferences +// it, reading a value of size `element_size` from it, and pushes that value, encoded in 8-byte chunks +// to the BPF parameter stack. This is safe to use for types larger than 8-bytes. +// back to the BPF parameter stack. +static __always_inline int dereference_large(expression_context_t *context, __u32 element_size, __u8 num_chunks) +{ + long return_err; + long err; + __u64 addressHolder = 0; + bpf_map_pop_elem(¶m_stack, &addressHolder); + context->stack_counter -= 1; + + int i; + __u32 chunk_size; + for (i = 0; i < num_chunks; i++) { + chunk_size = (i == num_chunks - 1 && element_size % 8 != 0) ? (element_size % 8) : 8; + err = bpf_probe_read_user(&context->temp_storage[i], element_size, (void*)(addressHolder + (i * 8))); + if (err != 0) { + return_err = err; + log_debug("error when reading data dereferencing large: %ld", err); + } + } + + // Mask the last chunk if element_size is not a multiple of 8 + if (element_size % 8 != 0) { + __u64 mask = (1ULL << (8 * (element_size % 8))) - 1; + context->temp_storage[num_chunks - 1] &= mask; + } + + for (int i = 0; i < num_chunks; i++) { + bpf_map_push_elem(¶m_stack, &context->temp_storage[i], 0); + context->stack_counter += 1; + } + + // zero out shared array + err = bpf_probe_read_kernel(context->temp_storage, element_size*num_chunks, context->zero_string); + if (err != 0) { + return_err = err; + log_debug("error when reading data zeroing out shared memory while dereferencing large: %ld", err); + } + return return_err; +} + +// dereference_large pops the 8-byte address from the top of the BPF parameter stack and dereferences +// it, reading a value of size `element_size` from it, and writes that value to the output buffer. +// This is safe to use for types larger than 8-bytes. +static __always_inline int dereference_large_to_output(expression_context_t *context, __u32 element_size) +{ + long err; + __u64 addressHolder = 0; + bpf_map_pop_elem(¶m_stack, &addressHolder); + context->stack_counter -= 1; + err = bpf_probe_read_user(&context->event->output[(context->output_offset)], element_size, (void*)(addressHolder)); + if (err != 0) { + log_debug("error when reading data: %ld", err); + } + context->output_offset += element_size; + return err; +} + +// apply_offset adds `offset` to the 8-byte address on the top of the BPF parameter stack. +static __always_inline int apply_offset(expression_context_t *context, size_t offset) +{ + __u64 addressHolder = 0; + bpf_map_pop_elem(¶m_stack, &addressHolder); + context->stack_counter -= 1; + + addressHolder += offset; + bpf_map_push_elem(¶m_stack, &addressHolder, 0); + context->stack_counter += 1; + return 0; +} + +// dereference_dynamic_to_output reads an 8-byte length from the top of the BPF parameter stack, followed by +// an 8-byte address. It applies the maximum `bytes_limit` to the length, then dereferences the address to +// the output buffer. +static __always_inline int dereference_dynamic_to_output(expression_context_t *context, __u16 bytes_limit) +{ + long err = 0; + __u64 lengthToRead = 0; + bpf_map_pop_elem(¶m_stack, &lengthToRead); + context->stack_counter -= 1; + + __u64 addressHolder = 0; + bpf_map_pop_elem(¶m_stack, &addressHolder); + context->stack_counter -= 1; + + __u32 collection_size; + collection_size = (__u16)lengthToRead; + if (collection_size > bytes_limit) { + collection_size = bytes_limit; + } + err = bpf_probe_read_user(&context->event->output[(context->output_offset)], collection_size, (void*)addressHolder); + if (err != 0) { + log_debug("error when doing dynamic dereference: %ld", err); + } + + if (collection_size > bytes_limit) { + collection_size = bytes_limit; + } + context->output_offset += collection_size; + return err; +} + +// set_limit_entry is used to set a limit for a specific collection (such as a slice). It reads the true length of the +// collection from the top of the BPF parameter stack, applies the passed `limit` to it, and updates the `collection_limit` +// map entry associated with `collection_identifier` to this limit. The `collection_identifier` is a user space generated +// and track identifier for each collection which can be referenced in BPF code. +static __always_inline int set_limit_entry(expression_context_t *context, __u16 limit, char collection_identifier[6]) +{ + // Read the 2 byte length from top of the stack, then set collectionLimit to the minimum of the two + __u64 length; + bpf_map_pop_elem(¶m_stack, &length); + context->stack_counter -= 1; + + __u16 lengthShort = (__u16)length; + if (lengthShort > limit) { + lengthShort = limit; + } + + long err = 0; + err = bpf_map_update_elem(&collection_limits, collection_identifier, &lengthShort, BPF_ANY); + if (err != 0) { + log_debug("error updating collection limit for %s to %hu: %ld", collection_identifier, lengthShort, err); + } + + log_debug("set limit entry for %s to %hu", collection_identifier, lengthShort); + return 0; +} + +// copy duplicates the u64 element on the top of the BPF parameter stack. +static __always_inline int copy(expression_context_t *context) +{ + __u64 holder; + bpf_map_peek_elem(¶m_stack, &holder); + bpf_map_push_elem(¶m_stack, &holder, 0); + context->stack_counter += 1; + return 0; +} + +// read_str_to_output reads a Go string to the output buffer, limited in length by `limit`. +// In Go, strings are internally implemented as structs with two fields. The fields are length, +// and a pointer to a character array. This expression expects the address of the string struct +// itself to be on the top of the stack. +static __always_inline int read_str_to_output(expression_context_t *context, __u16 limit) +{ + long err; + __u64 stringStructAddressHolder = 0; + err = bpf_map_pop_elem(¶m_stack, &stringStructAddressHolder); + if (err != 0) { + log_debug("error popping string struct addr: %ld", err); + return err; + } + context->stack_counter -= 1; + + char* characterPointer = 0; + err = bpf_probe_read_user(&characterPointer, sizeof(characterPointer), (void*)(stringStructAddressHolder)); + log_debug("Reading from 0x%p", characterPointer); + + __u32 length; + err = bpf_probe_read_user(&length, sizeof(length), (void*)(stringStructAddressHolder+8)); + if (err != 0) { + log_debug("error reading string length: %ld", err); + return err; + } + if (length > limit) { + length = limit; + } + err = bpf_probe_read_user(&context->event->output[(context->output_offset)], length, (char*)characterPointer); + if (err != 0) { + log_debug("error reading string: %ld", err); + } + context->output_offset += length; + log_debug("Read %u bytes (limit = %hu)", length, limit); + + return err; +} +#endif diff --git a/pkg/dynamicinstrumentation/codegen/c/macros.h b/pkg/dynamicinstrumentation/codegen/c/macros.h new file mode 100644 index 0000000000000..dc29c35e14599 --- /dev/null +++ b/pkg/dynamicinstrumentation/codegen/c/macros.h @@ -0,0 +1,9 @@ +#ifndef DI_MACROS_H +#define DI_MACROS_H + +#define MAX_STRING_SIZE {{ .InstrumentationInfo.InstrumentationOptions.StringMaxSize }} +#define PARAM_BUFFER_SIZE {{ .InstrumentationInfo.InstrumentationOptions.ArgumentsMaxSize }} +#define STACK_DEPTH_LIMIT 10 +#define MAX_SLICE_LENGTH {{ .InstrumentationInfo.InstrumentationOptions.SliceMaxLength }} + +#endif diff --git a/pkg/dynamicinstrumentation/codegen/c/maps.h b/pkg/dynamicinstrumentation/codegen/c/maps.h new file mode 100644 index 0000000000000..67f5a2a921eab --- /dev/null +++ b/pkg/dynamicinstrumentation/codegen/c/maps.h @@ -0,0 +1,31 @@ +#ifndef DI_MAPS_H +#define DI_MAPS_H + +#include "map-defs.h" + +// The events map is the ringbuffer used for communicating events from +// bpf to user space. +struct { + __uint(type, BPF_MAP_TYPE_RINGBUF); + __uint(max_entries, 1 << 24); +} events SEC(".maps"); + +// The zeroval map is used to have pre-zero'd data which bpf code can +// use to zero out event buffers (similar to memset, but verifier friendly). +BPF_ARRAY_MAP(zeroval, char[PARAM_BUFFER_SIZE], 1); + +// The temp_storage_array map is used as a temporary location in memory +// not on the bpf stack that location expressions can use for temporarily +// caching data while they operate on it without worrying about exceeding +// the 512 byte bpf stack limit. +BPF_PERCPU_ARRAY_MAP(temp_storage_array, __u64[4000], 1); + +// The collection_limits map is used for setting the known length limit +// of collections such as slices so that they can later be referenced +// when reading the values in the collection. +BPF_HASH_MAP(collection_limits, char[6], __u16, 1024); + +// The param_stack map is used as a stack for the location expressions +// to operate on values and addresses. +BPF_STACK_MAP(param_stack, __u64, 2048); +#endif diff --git a/pkg/dynamicinstrumentation/codegen/c/types.h b/pkg/dynamicinstrumentation/codegen/c/types.h deleted file mode 100644 index f170b91fe7541..0000000000000 --- a/pkg/dynamicinstrumentation/codegen/c/types.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef DI_TYPES_H -#define DI_TYPES_H - -#include "ktypes.h" - -// NOTE: Be careful when adding fields, alignment should always be to 8 bytes -struct base_event { - char probe_id[304]; - __u32 pid; - __u32 uid; - __u64 program_counters[10]; -}__attribute__((aligned(8))); - -#endif diff --git a/pkg/dynamicinstrumentation/codegen/codegen.go b/pkg/dynamicinstrumentation/codegen/codegen.go index 9c286513287fa..5c0e3e8e85e41 100644 --- a/pkg/dynamicinstrumentation/codegen/codegen.go +++ b/pkg/dynamicinstrumentation/codegen/codegen.go @@ -14,12 +14,10 @@ import ( "fmt" "io" "reflect" - "strings" "text/template" - "github.com/DataDog/datadog-agent/pkg/util/log" - "github.com/DataDog/datadog-agent/pkg/dynamicinstrumentation/ditypes" + "github.com/DataDog/datadog-agent/pkg/util/log" ) // GenerateBPFParamsCode generates the source code associated with the probe and data @@ -29,17 +27,14 @@ func GenerateBPFParamsCode(procInfo *ditypes.ProcessInfo, probe *ditypes.Probe) out := bytes.NewBuffer(parameterBytes) if probe.InstrumentationInfo.InstrumentationOptions.CaptureParameters { - params := applyCaptureDepth(procInfo.TypeMap.Functions[probe.FuncName], probe.InstrumentationInfo.InstrumentationOptions.MaxReferenceDepth) - applyFieldCountLimit(params) + params := procInfo.TypeMap.Functions[probe.FuncName] for i := range params { - flattenedParams := flattenParameters([]ditypes.Parameter{params[i]}) - + flattenedParams := flattenParameters([]*ditypes.Parameter{params[i]}) err := generateHeadersText(flattenedParams, out) if err != nil { return err } - - err = generateParametersText(flattenedParams, out) + err = generateParametersTextViaLocationExpressions(flattenedParams, out) if err != nil { return err } @@ -55,12 +50,9 @@ func GenerateBPFParamsCode(procInfo *ditypes.ProcessInfo, probe *ditypes.Probe) func resolveHeaderTemplate(param *ditypes.Parameter) (*template.Template, error) { switch param.Kind { case uint(reflect.String): - if param.Location.InReg { - return template.New("string_reg_header_template").Parse(stringRegisterHeaderTemplateText) - } - return template.New("string_stack_header_template").Parse(stringStackHeaderTemplateText) + return template.New("string_header_template").Parse(stringHeaderTemplateText) case uint(reflect.Slice): - if param.Location.InReg { + if param.Location != nil && param.Location.InReg { return template.New("slice_reg_header_template").Parse(sliceRegisterHeaderTemplateText) } return template.New("slice_stack_header_template").Parse(sliceStackHeaderTemplateText) @@ -69,7 +61,7 @@ func resolveHeaderTemplate(param *ditypes.Parameter) (*template.Template, error) } } -func generateHeadersText(params []ditypes.Parameter, out io.Writer) error { +func generateHeadersText(params []*ditypes.Parameter, out io.Writer) error { for i := range params { err := generateHeaderText(params[i], out) if err != nil { @@ -79,13 +71,13 @@ func generateHeadersText(params []ditypes.Parameter, out io.Writer) error { return nil } -func generateHeaderText(param ditypes.Parameter, out io.Writer) error { +func generateHeaderText(param *ditypes.Parameter, out io.Writer) error { if reflect.Kind(param.Kind) == reflect.Slice { - return generateSliceHeader(¶m, out) + return generateSliceHeader(param, out) } else if reflect.Kind(param.Kind) == reflect.String { - return generateStringHeader(¶m, out) + return generateStringHeader(param, out) } else { //nolint:revive // TODO - tmplt, err := resolveHeaderTemplate(¶m) + tmplt, err := resolveHeaderTemplate(param) if err != nil { return err } @@ -100,129 +92,127 @@ func generateHeaderText(param ditypes.Parameter, out io.Writer) error { return nil } -func generateParametersText(params []ditypes.Parameter, out io.Writer) error { +func generateParametersTextViaLocationExpressions(params []*ditypes.Parameter, out io.Writer) error { for i := range params { - err := generateParameterText(¶ms[i], out) - if err != nil { - return err + collectedExpressions := collectLocationExpressions(params[i]) + for _, locationExpression := range collectedExpressions { + template, err := resolveLocationExpressionTemplate(locationExpression) + if err != nil { + return err + } + err = template.Execute(out, locationExpression) + if err != nil { + return fmt.Errorf("could not execute template for generating location expression: %w", err) + } } } return nil } -func generateParameterText(param *ditypes.Parameter, out io.Writer) error { - - if param.Kind == uint(reflect.Array) || - param.Kind == uint(reflect.Struct) || - param.Kind == uint(reflect.Pointer) { - // - Arrays/structs don't have actual values, we just want to generate - // a header for them for the sake of event parsing. - // - Pointers do have actual values, but they're captured when the - // underlying value is also captured. - return nil - } - - template, err := resolveParameterTemplate(param) - if err != nil { - return err - } - param.Type = cleanupTypeName(param.Type) - err = template.Execute(out, param) - if err != nil { - return fmt.Errorf("could not execute template for generating read of parameter: %w", err) - } - - return nil -} - -func resolveParameterTemplate(param *ditypes.Parameter) (*template.Template, error) { - notSupported := param.NotCaptureReason == ditypes.Unsupported - cutForFieldLimit := param.NotCaptureReason == ditypes.FieldLimitReached - - if notSupported { - return template.New("unsupported_type_template").Parse(unsupportedTypeTemplateText) - } else if cutForFieldLimit { - return template.New("cut_field_limit_template").Parse(cutForFieldLimitTemplateText) - } - - if param.Location.InReg { - return resolveRegisterParameterTemplate(param) - } - return resolveStackParameterTemplate(param) -} - -func resolveRegisterParameterTemplate(param *ditypes.Parameter) (*template.Template, error) { - needsDereference := param.Location.NeedsDereference - stringType := param.Kind == uint(reflect.String) - sliceType := param.Kind == uint(reflect.Slice) +// collectLocationExpressions goes through the parameter tree (param.ParameterPieces) via +// breadth first traversal, collecting the LocationExpression's from each parameter and appending them +// to a collective slice. +func collectLocationExpressions(param *ditypes.Parameter) []ditypes.LocationExpression { + collectedExpressions := []ditypes.LocationExpression{} + queue := []*ditypes.Parameter{param} + var top *ditypes.Parameter + + for { + if len(queue) == 0 { + break + } + top = queue[0] + queue = queue[1:] - if needsDereference { - // Register Pointer - return template.New("pointer_register_template").Parse(pointerRegisterTemplateText) - } else if stringType { - // Register String - return template.New("string_register_template").Parse(stringRegisterTemplateText) - } else if sliceType { - // Register Slice - return template.New("slice_register_template").Parse(sliceRegisterTemplateText) - } else if !needsDereference { - // Register Normal Value - return template.New("register_template").Parse(normalValueRegisterTemplateText) + if top == nil { + continue + } + queue = append(queue, top.ParameterPieces...) + if len(top.LocationExpressions) > 0 { + collectedExpressions = append(top.LocationExpressions, collectedExpressions...) + top.LocationExpressions = []ditypes.LocationExpression{} + } } - return nil, errors.New("no template created: invalid or unsupported type") + return collectedExpressions } -func resolveStackParameterTemplate(param *ditypes.Parameter) (*template.Template, error) { - needsDereference := param.Location.NeedsDereference - stringType := param.Kind == uint(reflect.String) - sliceType := param.Kind == uint(reflect.Slice) - - if needsDereference { - // Stack Pointer - return template.New("pointer_stack_template").Parse(pointerStackTemplateText) - } else if stringType { - // Stack String - return template.New("string_stack_template").Parse(stringStackTemplateText) - } else if sliceType { - // Stack Slice - return template.New("slice_stack_template").Parse(sliceStackTemplateText) - } else if !needsDereference { - // Stack Normal Value - return template.New("stack_template").Parse(normalValueStackTemplateText) +func resolveLocationExpressionTemplate(locationExpression ditypes.LocationExpression) (*template.Template, error) { + switch locationExpression.Opcode { + case ditypes.OpReadUserRegister: + return template.New("read_register_location_expression").Parse(readRegisterTemplateText) + case ditypes.OpReadUserStack: + return template.New("read_stack_location_expression").Parse(readStackTemplateText) + case ditypes.OpReadUserRegisterToOutput: + return template.New("read_register_to_output_location_expression").Parse(readRegisterValueToOutputTemplateText) + case ditypes.OpReadUserStackToOutput: + return template.New("read_stack_to_output_location_expression").Parse(readStackValueToOutputTemplateText) + case ditypes.OpDereference: + return template.New("dereference_location_expression").Parse(dereferenceTemplateText) + case ditypes.OpDereferenceToOutput: + return template.New("dereference_to_output_location_expression").Parse(dereferenceToOutputTemplateText) + case ditypes.OpDereferenceLarge: + return template.New("dereference_large_location_expression").Parse(dereferenceLargeTemplateText) + case ditypes.OpDereferenceLargeToOutput: + return template.New("dereference_large_to_output_location_expression").Parse(dereferenceLargeToOutputTemplateText) + case ditypes.OpDereferenceDynamic: + return template.New("dereference_dynamic_location_expression").Parse(dereferenceDynamicTemplateText) + case ditypes.OpDereferenceDynamicToOutput: + return template.New("dereference_dynamic_to_output_location_expression").Parse(dereferenceDynamicToOutputTemplateText) + case ditypes.OpReadStringToOutput: + return template.New("read_string_to_output").Parse(readStringToOutputTemplateText) + case ditypes.OpApplyOffset: + return template.New("apply_offset_location_expression").Parse(applyOffsetTemplateText) + case ditypes.OpPop: + return template.New("pop_location_expression").Parse(popTemplateText) + case ditypes.OpCopy: + return template.New("copy_location_expression").Parse(copyTemplateText) + case ditypes.OpLabel: + return template.New("label").Parse(labelTemplateText) + case ditypes.OpSetGlobalLimit: + return template.New("set_limit_entry").Parse(setLimitEntryText) + case ditypes.OpJumpIfGreaterThanLimit: + return template.New("jump_if_greater_than_limit").Parse(jumpIfGreaterThanLimitText) + case ditypes.OpPrintStatement: + return template.New("print_statement").Parse(printStatementText) + case ditypes.OpComment: + return template.New("comment").Parse(commentText) + default: + return nil, errors.New("invalid location expression opcode") } - return nil, errors.New("no template created: invalid or unsupported type") -} - -func cleanupTypeName(s string) string { - return strings.TrimPrefix(s, "*") } func generateSliceHeader(slice *ditypes.Parameter, out io.Writer) error { if slice == nil { return errors.New("nil slice parameter when generating header code") } - if len(slice.ParameterPieces) != 2 { - return errors.New("invalid slice parameter when generating header code") + if len(slice.ParameterPieces) != 3 { + return fmt.Errorf("invalid slice parameter when generating header code: %d fields", len(slice.ParameterPieces)) + } + + // Slices are defined with an "array" pointer as piece 0, which is a pointer to the actual + // type, which is defined as piece 0 under that. + if len(slice.ParameterPieces) != 3 && + len(slice.ParameterPieces[0].ParameterPieces) != 1 { + return errors.New("malformed slice type") } typeHeaderBytes := []byte{} typeHeaderBuf := bytes.NewBuffer(typeHeaderBytes) - err := generateHeaderText(slice.ParameterPieces[0], typeHeaderBuf) + lenHeaderBytes := []byte{} + lenHeaderBuf := bytes.NewBuffer(lenHeaderBytes) + lenHeaderBuf.Write([]byte("// Capture length of slice:")) + err := generateHeaderText(slice.ParameterPieces[0].ParameterPieces[0], typeHeaderBuf) if err != nil { return err } - - lengthHeaderBytes := []byte{} - lengthHeaderBuf := bytes.NewBuffer(lengthHeaderBytes) - err = generateSliceLengthHeader(slice.ParameterPieces[1], lengthHeaderBuf) + err = generateParametersTextViaLocationExpressions([]*ditypes.Parameter{slice.ParameterPieces[1]}, lenHeaderBuf) if err != nil { return err } - + slice.ParameterPieces[1].LocationExpressions = []ditypes.LocationExpression{} w := sliceHeaderWrapper{ Parameter: slice, - SliceTypeHeaderText: typeHeaderBuf.String(), - SliceLengthText: lengthHeaderBuf.String(), + SliceTypeHeaderText: lenHeaderBuf.String() + typeHeaderBuf.String(), } sliceTemplate, err := resolveHeaderTemplate(slice) @@ -245,70 +235,25 @@ func generateStringHeader(stringParam *ditypes.Parameter, out io.Writer) error { if len(stringParam.ParameterPieces) != 2 { return fmt.Errorf("invalid string parameter when generating header code (pieces len %d)", len(stringParam.ParameterPieces)) } - - x := []byte{} - buf := bytes.NewBuffer(x) - err := generateStringLengthHeader(stringParam.ParameterPieces[1], buf) - if err != nil { - return err - } - - stringHeaderWrapper := stringHeaderWrapper{ - Parameter: stringParam, - StringLengthText: buf.String(), - } - - stringTemplate, err := resolveHeaderTemplate(stringParam) + stringHeaderTemplate, err := resolveHeaderTemplate(stringParam) if err != nil { return err } - - err = stringTemplate.Execute(out, stringHeaderWrapper) + err = stringHeaderTemplate.Execute(out, stringParam) if err != nil { return fmt.Errorf("could not execute template for generating string header: %w", err) } - return nil -} - -func generateStringLengthHeader(stringLengthParamPiece ditypes.Parameter, buf *bytes.Buffer) error { - var ( - tmplte *template.Template - err error - ) - if stringLengthParamPiece.Location.InReg { - tmplte, err = template.New("string_register_length_header").Parse(stringLengthRegisterTemplateText) - } else { - tmplte, err = template.New("string_stack_length_header").Parse(stringLengthStackTemplateText) - } + err = generateParametersTextViaLocationExpressions([]*ditypes.Parameter{stringParam.ParameterPieces[1]}, out) if err != nil { return err } - return tmplte.Execute(buf, stringLengthParamPiece) -} - -func generateSliceLengthHeader(sliceLengthParamPiece ditypes.Parameter, buf *bytes.Buffer) error { - var ( - tmplte *template.Template - err error - ) - if sliceLengthParamPiece.Location.InReg { - tmplte, err = template.New("slice_register_length_header").Parse(sliceLengthRegisterTemplateText) - } else { - tmplte, err = template.New("slice_stack_length_header").Parse(sliceLengthStackTemplateText) - } - if err != nil { - return err + if stringParam.ParameterPieces[1] != nil { + stringParam.ParameterPieces[1].LocationExpressions = []ditypes.LocationExpression{} } - return tmplte.Execute(buf, sliceLengthParamPiece) + return nil } type sliceHeaderWrapper struct { Parameter *ditypes.Parameter - SliceLengthText string SliceTypeHeaderText string } - -type stringHeaderWrapper struct { - Parameter *ditypes.Parameter - StringLengthText string -} diff --git a/pkg/dynamicinstrumentation/codegen/expression_templates.go b/pkg/dynamicinstrumentation/codegen/expression_templates.go new file mode 100644 index 0000000000000..8096803b96085 --- /dev/null +++ b/pkg/dynamicinstrumentation/codegen/expression_templates.go @@ -0,0 +1,114 @@ +// 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_bpf + +package codegen + +var readRegisterTemplateText = ` +// Arg1 = register +// Arg2 = size of element +read_register(&context, {{.Arg1}}, {{.Arg2}}); +` + +var readStackTemplateText = ` +// Arg1 = stack offset +// Arg2 = size of element +read_stack(&context, {{.Arg1}}, {{.Arg2}}); +` + +var readRegisterValueToOutputTemplateText = ` +// Arg1 = register +// Arg2 = size of element +read_register_value_to_output(&context, {{.Arg1}}, {{.Arg2}}); +` + +var readStackValueToOutputTemplateText = ` +// Arg1 = stack offset +// Arg2 = size of element +read_stack_value_to_output(&context, {{.Arg1}}, {{.Arg2}}); +` + +var popTemplateText = ` +// Arg1 = number of elements (u64) to pop +// Arg2 = size of each element +pop(&context, {{.Arg1}}, {{.Arg2}}); +` + +var dereferenceTemplateText = ` +// Arg1 = size in bytes of value we're reading from the 8 byte address at the top of the stack +dereference(&context, {{.Arg1}}); +` + +var dereferenceToOutputTemplateText = ` +// Arg1 = size in bytes of value we're reading from the 8 byte address at the top of the stack +dereference_to_output(&context, {{.Arg1}}); +` + +var dereferenceLargeTemplateText = ` +// Arg1 = size in bytes of value we're reading from the 8 byte address at the top of the stack +// Arg2 = number of chunks (should be ({{.Arg1}} + 7) / 8) +dereference_large(&context, {{.Arg1}}, {{.Arg2}}); +` + +var dereferenceLargeToOutputTemplateText = ` +// Arg1 = size in bytes of value we're reading from the 8 byte address at the top of the stack +dereference_large_to_output(&context, {{.Arg1}}); +` + +var applyOffsetTemplateText = ` +// Arg1 = uint value (offset) we're adding to the 8-byte address on top of the stack +apply_offset(&context, {{.Arg1}}); +` + +var dereferenceDynamicTemplateText = ` +// Arg1 = maximum limit on bytes read +// Arg2 = number of chunks (should be (max + 7)/8) +// Arg3 = size of each element +dereference_dynamic(&context, {{.Arg1}}, {{.Arg2}}, {{.Arg3}}); +` + +var dereferenceDynamicToOutputTemplateText = ` +// Arg1 = maximum limit on bytes read +dereference_dynamic_to_output(&context, {{.Arg1}}); +` + +var readStringToOutputTemplateText = ` +// Arg1 = maximum limit on string length +read_str_to_output(&context, {{.Arg1}}); +` + +var copyTemplateText = ` +copy(&context); +` + +var setLimitEntryText = ` +// Arg1 = Maximum limit +set_limit_entry(&context, {{.Arg1}}, "{{.CollectionIdentifier}}"); +` + +var jumpIfGreaterThanLimitText = ` +collectionLimit = bpf_map_lookup_elem(&collection_limits, "{{.CollectionIdentifier}}"); +if (!collectionLimit) { + log_debug("couldn't find collection limit for {{.CollectionIdentifier}}"); + collectionLimit = &collectionMax; +} +if ({{.Arg1}} == *collectionLimit) { + log_debug("collection limit for {{.CollectionIdentifier}} exceeded: %d", *collectionLimit); + goto {{.Label}}; +} +` + +var labelTemplateText = ` +{{.Label}}: +` + +var commentText = ` +// {{.Label}} +` + +var printStatementText = ` +log_debug("{{.Label}}", "{{.CollectionIdentifier}}"); +` diff --git a/pkg/dynamicinstrumentation/codegen/output_offsets.go b/pkg/dynamicinstrumentation/codegen/output_offsets.go index bdad1337ffa73..6e5ffe7e10cfe 100644 --- a/pkg/dynamicinstrumentation/codegen/output_offsets.go +++ b/pkg/dynamicinstrumentation/codegen/output_offsets.go @@ -11,55 +11,15 @@ import ( "math/rand" "reflect" - "github.com/DataDog/datadog-agent/pkg/util/log" - "github.com/DataDog/datadog-agent/pkg/dynamicinstrumentation/ditypes" ) -type paramDepthCounter struct { - depth int - param *ditypes.Parameter -} - -func applyCaptureDepth(params []ditypes.Parameter, maxDepth int) []ditypes.Parameter { - log.Tracef("Applying capture depth: %d", maxDepth) - queue := []paramDepthCounter{} - +func flattenParameters(params []*ditypes.Parameter) []*ditypes.Parameter { + flattenedParams := []*ditypes.Parameter{} for i := range params { - queue = append(queue, paramDepthCounter{ - depth: 0, - param: ¶ms[i], - }) - } - - for len(queue) != 0 { - front := queue[0] - queue = queue[1:] - - if front.depth == maxDepth { - // max capture depth reached, remove parameters below this level. - front.param.ParameterPieces = []ditypes.Parameter{} - if front.param.Kind == uint(reflect.Struct) { - // struct size reflects the number of fields, - // setting to 0 tells the user space parsing not to - // expect anything else. - front.param.TotalSize = 0 - } - } else { - for i := range front.param.ParameterPieces { - queue = append(queue, paramDepthCounter{ - depth: front.depth + 1, - param: &front.param.ParameterPieces[i], - }) - } + if params[i] == nil { + continue } - } - return params -} - -func flattenParameters(params []ditypes.Parameter) []ditypes.Parameter { - flattenedParams := []ditypes.Parameter{} - for i := range params { kind := reflect.Kind(params[i].Kind) if kind == reflect.Slice || kind == reflect.String { // Slices don't get flattened as we need the underlying type. @@ -69,9 +29,9 @@ func flattenParameters(params []ditypes.Parameter) []ditypes.Parameter { flattenedParams = append(flattenedParams, params[i]) } else if hasHeader(kind) { paramHeader := params[i] - paramHeader.ParameterPieces = nil flattenedParams = append(flattenedParams, paramHeader) flattenedParams = append(flattenedParams, flattenParameters(params[i].ParameterPieces)...) + paramHeader.ParameterPieces = nil } else if len(params[i].ParameterPieces) > 0 { flattenedParams = append(flattenedParams, flattenParameters(params[i].ParameterPieces)...) } else { @@ -86,44 +46,6 @@ func flattenParameters(params []ditypes.Parameter) []ditypes.Parameter { return flattenedParams } -func applyFieldCountLimit(params []ditypes.Parameter) { - queue := []*ditypes.Parameter{} - for i := range params { - queue = append(queue, ¶ms[len(params)-1-i]) - } - var ( - current *ditypes.Parameter - max int - ) - for len(queue) != 0 { - current = queue[0] - queue = queue[1:] - - max = len(current.ParameterPieces) - if len(current.ParameterPieces) > ditypes.MaxFieldCount { - max = ditypes.MaxFieldCount - for j := max; j < len(current.ParameterPieces); j++ { - excludeForFieldCount(¤t.ParameterPieces[j]) - } - } - for n := 0; n < max; n++ { - queue = append(queue, ¤t.ParameterPieces[n]) - } - } -} - -func excludeForFieldCount(root *ditypes.Parameter) { - // Exclude all in this tree - if root == nil { - return - } - root.NotCaptureReason = ditypes.FieldLimitReached - root.Kind = ditypes.KindCutFieldLimit - for i := range root.ParameterPieces { - excludeForFieldCount(&root.ParameterPieces[i]) - } -} - func hasHeader(kind reflect.Kind) bool { return kind == reflect.Struct || kind == reflect.Array || diff --git a/pkg/dynamicinstrumentation/codegen/templates.go b/pkg/dynamicinstrumentation/codegen/templates.go index 72fdcade8f44a..87f08d3c9593a 100644 --- a/pkg/dynamicinstrumentation/codegen/templates.go +++ b/pkg/dynamicinstrumentation/codegen/templates.go @@ -11,24 +11,18 @@ var headerTemplateText = ` // Name={{.Name}} ID={{.ID}} TotalSize={{.TotalSize}} Kind={{.Kind}} // Write the kind and size to output buffer param_type = {{.Kind}}; -bpf_probe_read(&event->output[outputOffset], sizeof(param_type), ¶m_type); +bpf_probe_read_kernel(&event->output[context.output_offset], sizeof(param_type), ¶m_type); param_size = {{.TotalSize}}; -bpf_probe_read(&event->output[outputOffset+1], sizeof(param_size), ¶m_size); -outputOffset += 3; +bpf_probe_read_kernel(&event->output[context.output_offset+1], sizeof(param_size), ¶m_size); +context.output_offset += 3; ` - -// The length and type of slices aren't known until parsing, so they require -// special headers to read in the length dynamically var sliceRegisterHeaderTemplateText = ` // Name={{.Parameter.Name}} ID={{.Parameter.ID}} TotalSize={{.Parameter.TotalSize}} Kind={{.Parameter.Kind}} // Write the slice kind to output buffer param_type = {{.Parameter.Kind}}; -bpf_probe_read(&event->output[outputOffset], sizeof(param_type), ¶m_type); - -{{.SliceLengthText}} +bpf_probe_read_kernel(&event->output[context.output_offset], sizeof(param_type), ¶m_type); -bpf_probe_read(&event->output[outputOffset+1], sizeof(param_size), ¶m_size); -outputOffset += 3; +context.output_offset += 1; __u16 indexSlice{{.Parameter.ID}}; slice_length = param_size; @@ -44,185 +38,21 @@ for (indexSlice{{.Parameter.ID}} = 0; indexSlice{{.Parameter.ID}} < MAX_SLICE_LE } ` -var sliceLengthRegisterTemplateText = ` -bpf_probe_read(¶m_size, sizeof(param_size), &ctx->DWARF_REGISTER({{.Location.Register}})); -` - -// The length and type of slices aren't known until parsing, so they require -// special headers to read in the length dynamically var sliceStackHeaderTemplateText = ` // Name={{.Parameter.Name}} ID={{.Parameter.ID}} TotalSize={{.Parameter.TotalSize}} Kind={{.Parameter.Kind}} // Write the slice kind to output buffer param_type = {{.Parameter.Kind}}; -bpf_probe_read(&event->output[outputOffset], sizeof(param_type), ¶m_type); - -{{.SliceLengthText}} - -bpf_probe_read(&event->output[outputOffset+1], sizeof(param_size), ¶m_size); -outputOffset += 3; - -__u16 indexSlice{{.Parameter.ID}}; -slice_length = param_size; -if (slice_length > MAX_SLICE_LENGTH) { - slice_length = MAX_SLICE_LENGTH; -} +bpf_probe_read_kernel(&event->output[context.output_offset], sizeof(param_type), ¶m_type); -for (indexSlice{{.Parameter.ID}} = 0; indexSlice{{.Parameter.ID}} < MAX_SLICE_LENGTH; indexSlice{{.Parameter.ID}}++) { - if (indexSlice{{.Parameter.ID}} >= slice_length) { - break; - } - {{.SliceTypeHeaderText}} -} -` +context.output_offset += 1; -var sliceLengthStackTemplateText = ` -bpf_probe_read(¶m_size, sizeof(param_size), &ctx->DWARF_STACK_REGISTER+{{.Parameter.Location.StackOffset}}]); +{{.SliceTypeHeaderText}} ` -// The length of strings aren't known until parsing, so they require -// special headers to read in the length dynamically -var stringRegisterHeaderTemplateText = ` -// Name={{.Parameter.Name}} ID={{.Parameter.ID}} TotalSize={{.Parameter.TotalSize}} Kind={{.Parameter.Kind}} -// Write the string kind to output buffer -param_type = {{.Parameter.Kind}}; -bpf_probe_read(&event->output[outputOffset], sizeof(param_type), ¶m_type); - -// Read string length and write it to output buffer - -{{.StringLengthText}} - -// Limit string length -__u16 string_size_{{.Parameter.ID}} = param_size; -if (string_size_{{.Parameter.ID}} > MAX_STRING_SIZE) { - string_size_{{.Parameter.ID}} = MAX_STRING_SIZE; -} -bpf_probe_read(&event->output[outputOffset+1], sizeof(string_size_{{.Parameter.ID}}), &string_size_{{.Parameter.ID}}); -outputOffset += 3; -` - -var stringLengthRegisterTemplateText = ` -bpf_probe_read(¶m_size, sizeof(param_size), &ctx->DWARF_REGISTER({{.Location.Register}})); -` - -// The length of strings aren't known until parsing, so they require -// special headers to read in the length dynamically -var stringStackHeaderTemplateText = ` -// Name={{.Parameter.Name}} ID={{.Parameter.ID}} TotalSize={{.Parameter.TotalSize}} Kind={{.Parameter.Kind}} -// Write the string kind to output buffer -param_type = {{.Parameter.Kind}}; -bpf_probe_read(&event->output[outputOffset], sizeof(param_type), ¶m_type); - -// Read string length and write it to output buffer -{{.StringLengthText}} - -// Limit string length -__u16 string_size_{{.Parameter.ID}} = param_size; -if (string_size_{{.Parameter.ID}} > MAX_STRING_SIZE) { - string_size_{{.Parameter.ID}} = MAX_STRING_SIZE; -} -bpf_probe_read(&event->output[outputOffset+1], sizeof(string_size_{{.Parameter.ID}}), &string_size_{{.Parameter.ID}}); -outputOffset += 3; -` - -var stringLengthStackTemplateText = ` -bpf_probe_read(¶m_size, sizeof(param_size), (char*)((ctx->DWARF_STACK_REGISTER)+{{.Location.StackOffset}})); -` - -var sliceRegisterTemplateText = ` -// Name={{.Name}} ID={{.ID}} TotalSize={{.TotalSize}} Kind={{.Kind}} -// Read contents of slice -bpf_probe_read(&event->output[outputOffset], MAX_SLICE_SIZE, (void*)ctx->DWARF_REGISTER({{.Location.Register}})); -outputOffset += MAX_SLICE_SIZE; -` - -var sliceStackTemplateText = ` -// Name={{.Name}} ID={{.ID}} TotalSize={{.TotalSize}} Kind={{.Kind}} -// Read contents of slice -bpf_probe_read(&event->output[outputOffset], MAX_SLICE_SIZE, (void*)(ctx->DWARF_STACK_REGISTER+{{.Location.StackOffset}}); -outputOffset += MAX_SLICE_SIZE;` - -var stringRegisterTemplateText = ` -// Name={{.Name}} ID={{.ID}} TotalSize={{.TotalSize}} Kind={{.Kind}} -// Read string length and write it to output buffer - -// We limit string length variable again in case the verifier forgot about it (which often happens) -__u16 string_size_{{.ID}}_new; -string_size_{{.ID}}_new = string_size_{{.ID}}; -if (string_size_{{.ID}}_new > MAX_STRING_SIZE) { - string_size_{{.ID}}_new = MAX_STRING_SIZE; -} - -// Read contents of string -bpf_probe_read(&event->output[outputOffset], string_size_{{.ID}}_new, (void*)ctx->DWARF_REGISTER({{.Location.Register}})); -outputOffset += string_size_{{.ID}}_new; -` - -var stringStackTemplateText = ` -// Name={{.Name}} ID={{.ID}} TotalSize={{.TotalSize}} Kind={{.Kind}} - -// We limit string length variable again in case the verifier forgot about it (which often happens) -__u16 string_size_{{.ID}}_new; -string_size_{{.ID}}_new = string_size_{{.ID}}; -if (string_size_{{.ID}}_new > MAX_STRING_SIZE) { - string_size_{{.ID}}_new = MAX_STRING_SIZE; -} -// Read contents of string -bpf_probe_read(&ret_addr, sizeof(__u64), (void*)(ctx->DWARF_STACK_REGISTER+{{.Location.StackOffset}})); -bpf_probe_read(&event->output[outputOffset], string_size_{{.ID}}_new, (void*)(ret_addr)); -outputOffset += string_size_{{.ID}}_new; -` - -var pointerRegisterTemplateText = ` -// Name={{.Name}} ID={{.ID}} TotalSize={{.TotalSize}} Kind={{.Kind}} -// Read the pointer value (address of underlying value) -void *ptrTo{{.ID}}; -bpf_probe_read(&ptrTo{{.ID}}, sizeof(ptrTo{{.ID}}), &ctx->DWARF_REGISTER({{.Location.Register}})); - -// Write the underlying value to output -bpf_probe_read(&event->output[outputOffset], {{.TotalSize}}, ptrTo{{.ID}}+{{.Location.PointerOffset}}); -outputOffset += {{.TotalSize}}; - -// Write the pointer address to output -ptrTo{{.ID}} += {{.Location.PointerOffset}}; -bpf_probe_read(&event->output[outputOffset], sizeof(ptrTo{{.ID}}), &ptrTo{{.ID}}); -` - -var pointerStackTemplateText = ` -// Name={{.Name}} ID={{.ID}} TotalSize={{.TotalSize}} Kind={{.Kind}} -// Read the pointer value (address of underlying value) -void *ptrTo{{.ID}}; -bpf_probe_read(&ptrTo{{.ID}}, sizeof(ptrTo{{.ID}}), (char*)((ctx->DWARF_STACK_REGISTER)+{{.Location.StackOffset}}+8)); - -// Write the underlying value to output -bpf_probe_read(&event->output[outputOffset], {{.TotalSize}}, ptrTo{{.ID}}+{{.Location.PointerOffset}}); -outputOffset += {{.TotalSize}}; - -// Write the pointer address to output -ptrTo{{.ID}} += {{.Location.PointerOffset}}; -bpf_probe_read(&event->output[outputOffset], sizeof(ptrTo{{.ID}}), &ptrTo{{.ID}}); -` - -var normalValueRegisterTemplateText = ` +var stringHeaderTemplateText = ` // Name={{.Name}} ID={{.ID}} TotalSize={{.TotalSize}} Kind={{.Kind}} -bpf_probe_read(&event->output[outputOffset], {{.TotalSize}}, &ctx->DWARF_REGISTER({{.Location.Register}})); -outputOffset += {{.TotalSize}}; -` - -var normalValueStackTemplateText = ` -// Name={{.Name}} ID={{.ID}} TotalSize={{.TotalSize}} Kind={{.Kind}} -// Read value for {{.Name}} -bpf_probe_read(&event->output[outputOffset], {{.TotalSize}}, (char*)((ctx->DWARF_STACK_REGISTER)+{{.Location.StackOffset}})); -outputOffset += {{.TotalSize}}; -` - -// Unsupported types just get a single `255` value to signify as a placeholder -// that an unsupported type goes here. Size is where we keep the actual type. -var unsupportedTypeTemplateText = ` -// Name={{.Name}} ID={{.ID}} TotalSize={{.TotalSize}} Kind={{.Kind}} -// No capture, unsupported type -` - -var cutForFieldLimitTemplateText = ` -// Name={{.Name}} ID={{.ID}} TotalSize={{.TotalSize}} Kind={{.Kind}} -// No capture, cut for field limit +// Write the string kind to output buffer +param_type = {{.Kind}}; +bpf_probe_read_kernel(&event->output[context.output_offset], sizeof(param_type), ¶m_type); +context.output_offset += 1; ` diff --git a/pkg/dynamicinstrumentation/di.go b/pkg/dynamicinstrumentation/di.go index 3f39870bafccd..ffaeebbaea572 100644 --- a/pkg/dynamicinstrumentation/di.go +++ b/pkg/dynamicinstrumentation/di.go @@ -80,9 +80,7 @@ func RunDynamicInstrumentation(opts *DIOptions) (*GoDI, error) { if err != nil { return nil, err } - stopFunctions := []func(){ - diagnostics.StopGlobalDiagnostics, - } + stopFunctions := []func(){} if opts.ReaderWriterOptions.CustomReaderWriters { cm, err := diconfig.NewReaderConfigManager() if err != nil { diff --git a/pkg/dynamicinstrumentation/diconfig/binary_inspection.go b/pkg/dynamicinstrumentation/diconfig/binary_inspection.go index 02885a2b6772a..a1ce4e901d0d0 100644 --- a/pkg/dynamicinstrumentation/diconfig/binary_inspection.go +++ b/pkg/dynamicinstrumentation/diconfig/binary_inspection.go @@ -80,6 +80,7 @@ func AnalyzeBinary(procInfo *ditypes.ProcessInfo) error { // Use the result from InspectWithDWARF to populate the locations of parameters for functionName, functionMetadata := range r.Functions { putLocationsInParams(functionMetadata.Parameters, r.StructOffsets, procInfo.TypeMap.Functions, functionName) + populateLocationExpressionsForFunction(r.Functions, procInfo, functionName) correctStructSizes(procInfo.TypeMap.Functions[functionName]) } @@ -88,15 +89,15 @@ func AnalyzeBinary(procInfo *ditypes.ProcessInfo) error { // collectFieldIDs returns all struct fields if there are any amongst types of parameters // including if there's structs that are nested deep within complex types -func collectFieldIDs(param ditypes.Parameter) []bininspect.FieldIdentifier { +func collectFieldIDs(param *ditypes.Parameter) []bininspect.FieldIdentifier { fieldIDs := []bininspect.FieldIdentifier{} - stack := append([]ditypes.Parameter{param}, param.ParameterPieces...) + stack := append([]*ditypes.Parameter{param}, param.ParameterPieces...) for len(stack) != 0 { current := stack[len(stack)-1] stack = stack[:len(stack)-1] - if !kindIsSupported(reflect.Kind(current.Kind)) { + if current == nil || !kindIsSupported(reflect.Kind(current.Kind)) { continue } if len(current.ParameterPieces) != 0 { @@ -125,10 +126,45 @@ func collectFieldIDs(param ditypes.Parameter) []bininspect.FieldIdentifier { return fieldIDs } +func populateLocationExpressionsForFunction( + metadata map[string]bininspect.FunctionMetadata, + procInfo *ditypes.ProcessInfo, + functionName string, +) { + log.Tracef("Populating location expressions for %s", functionName) + functions := procInfo.TypeMap.Functions + parameters := functions[functionName] + probes := procInfo.GetProbes() + funcNamesToLimits := map[string]*ditypes.InstrumentationInfo{} + for i := range probes { + funcNamesToLimits[probes[i].FuncName] = probes[i].InstrumentationInfo + } + + funcMetadata, ok := metadata[functionName] + if !ok { + log.Warnf("no function metadata for function %s", functionName) + return + } + limitInfo, ok := funcNamesToLimits[functionName] + if !ok || limitInfo == nil { + log.Warnf("no limit info available for function %s", functionName) + return + } + for i := range parameters { + if i >= len(funcMetadata.Parameters) { + log.Warnf("parameter metadata does not line up with parameter itself (not found in metadata: %v)", parameters[i]) + break + } + GenerateLocationExpression(limitInfo, parameters[i]) + } +} + +// putLocationsInParams collects parameter locations from metadata which is retrieved +// from the bininspect package, and assigns it in the Parameter representation. func putLocationsInParams( paramMetadatas []bininspect.ParameterMetadata, fieldLocations map[bininspect.FieldIdentifier]uint64, - funcMap map[string][]ditypes.Parameter, + funcMap map[string][]*ditypes.Parameter, funcName string) { params := funcMap[funcName] @@ -146,18 +182,24 @@ func putLocationsInParams( } assignLocationsInOrder(params, locations) - correctTypeSpecificLocations(params, fieldLocations) - + for i := range params { + correctStructLocations(params[i], fieldLocations) + } funcMap[funcName] = params } -func assignLocationsInOrder(params []ditypes.Parameter, locations []ditypes.Location) { +// assignLocationsInOrder takes a slice of locations and a slice of parameters and assigns +// the locations in the intended order according to how they were retrieved from DWARF. +// The locations convey where in memory the parameter will be at function entry, such +// as specific registers or stack offsets. Logic such as assigning locations to individual +// array elements or types that are pointed to is handled. +func assignLocationsInOrder(params []*ditypes.Parameter, locations []ditypes.Location) { stack := []*ditypes.Parameter{} locationCounter := 0 // Start by pushing addresses of all parameters to stack for i := range params { - stack = append(stack, ¶ms[len(params)-1-i]) + stack = append(stack, params[len(params)-1-i]) } for { @@ -168,124 +210,40 @@ func assignLocationsInOrder(params []ditypes.Parameter, locations []ditypes.Loca stack = stack[:len(stack)-1] if len(current.ParameterPieces) != 0 && current.Kind != uint(reflect.Array) && - current.Kind != uint(reflect.Pointer) && - current.Kind != uint(reflect.Slice) && - current.Kind != uint(reflect.String) { - + current.Kind != uint(reflect.Pointer) { for i := range current.ParameterPieces { - stack = append(stack, ¤t.ParameterPieces[len(current.ParameterPieces)-1-i]) + stack = append(stack, current.ParameterPieces[len(current.ParameterPieces)-1-i]) } } else { // Location fields are directly assigned instead of setting the whole // location field to preserve other fields locationToAssign := locations[locationCounter] + if current.Location == nil { + current.Location = &ditypes.Location{} + } current.Location.InReg = locationToAssign.InReg current.Location.Register = locationToAssign.Register current.Location.StackOffset = locationToAssign.StackOffset - - if reflect.Kind(current.Kind) == reflect.String { - // Strings actually have two locations (pointer, length) - // but are shortened to a single one for parsing. The location - // of the length is stored as a piece of the overall string - // which contains the location of the string's address. - if len(locations) <= locationCounter+1 || - len(current.ParameterPieces) != 2 { - return - } - stringLengthLocation := locations[locationCounter+1] - current.ParameterPieces[1].Location.InReg = stringLengthLocation.InReg - current.ParameterPieces[1].Location.Register = stringLengthLocation.Register - current.ParameterPieces[1].Location.StackOffset = stringLengthLocation.StackOffset - locationCounter++ - } else if reflect.Kind(current.Kind) == reflect.Slice { - // Slices actually have three locations (array, length, capacity) - // but are shortened to a single one for parsing. The location - // of the length is stored as a piece of the overall slice - // which contains the location of the slice's address. - // The capacity slice field is ignored. - if len(locations) <= locationCounter+1 { - return - } - sliceLength := ditypes.Parameter{} - sliceLengthLocation := locations[locationCounter+1] - sliceLength.Location.InReg = sliceLengthLocation.InReg - sliceLength.Location.Register = sliceLengthLocation.Register - sliceLength.Location.StackOffset = sliceLengthLocation.StackOffset - current.ParameterPieces = append(current.ParameterPieces, sliceLength) - locationCounter += 2 - } locationCounter++ } } } -func correctTypeSpecificLocations(params []ditypes.Parameter, fieldLocations map[bininspect.FieldIdentifier]uint64) { - for i := range params { - if params[i].Kind == uint(reflect.Array) { - correctArrayLocations(¶ms[i], fieldLocations) - } else if params[i].Kind == uint(reflect.Pointer) { - correctPointerLocations(¶ms[i], fieldLocations) - } else if params[i].Kind == uint(reflect.Struct) || params[i].Kind == uint(reflect.String) { - correctStructLocations(¶ms[i], fieldLocations) - } - } -} - -// correctStructLocations sets pointer and stack offsets for struct fields from -// bininspect results +// correctStructLocations finds structs in the passed parameter tree (`structParam`) and sets the FieldOffset +// field in individual fields which convey the offset of the field within the struct when the struct is stored +// on the stack or heap. func correctStructLocations(structParam *ditypes.Parameter, fieldLocations map[bininspect.FieldIdentifier]uint64) { for i := range structParam.ParameterPieces { - fieldID := bininspect.FieldIdentifier{ - StructName: structParam.Type, - FieldName: structParam.ParameterPieces[i].Name, - } - offset, ok := fieldLocations[fieldID] - if !ok { - log.Infof("no field location available for %s.%s\n", fieldID.StructName, fieldID.FieldName) - structParam.ParameterPieces[i].NotCaptureReason = ditypes.NoFieldLocation + if structParam.ParameterPieces[i] == nil { continue } - fieldLocationsHaveAlreadyBeenDirectlyAssigned := isLocationSet(structParam.ParameterPieces[i].Location) - if fieldLocationsHaveAlreadyBeenDirectlyAssigned { - // The location would be set if it was directly assigned to (i.e. has its own register instead of needing - // to dereference a pointer or get the element from a slice) - structParam.ParameterPieces[i].Location = structParam.Location - structParam.ParameterPieces[i].Location.StackOffset = int64(offset) + structParam.Location.StackOffset + fieldID := bininspect.FieldIdentifier{ + StructName: structParam.Type, + FieldName: structParam.ParameterPieces[i].Name, } - - structParam.ParameterPieces[i].Location.PointerOffset = offset - structParam.ParameterPieces[i].Location.StackOffset = structParam.ParameterPieces[0].Location.StackOffset + int64(offset) - - correctTypeSpecificLocations([]ditypes.Parameter{structParam.ParameterPieces[i]}, fieldLocations) - } -} - -func isLocationSet(l ditypes.Location) bool { - return reflect.DeepEqual(l, ditypes.Location{}) -} - -// correctPointerLocations takes a parameters location and copies it to the underlying -// type that's pointed to. It sets `NeedsDereference` to true -// then calls the top level function on each element of the array to ensure all -// element's have corrected locations -func correctPointerLocations(pointerParam *ditypes.Parameter, fieldLocations map[bininspect.FieldIdentifier]uint64) { - // Pointers should have exactly one entry in ParameterPieces that correspond to the underlying type - if len(pointerParam.ParameterPieces) != 1 { - return - } - pointerParam.ParameterPieces[0].Location = pointerParam.Location - pointerParam.ParameterPieces[0].Location.NeedsDereference = true - correctTypeSpecificLocations([]ditypes.Parameter{pointerParam.ParameterPieces[0]}, fieldLocations) -} - -// correctArrayLocations takes a parameter's location, and distribute it to each element -// by using `stack offset + (size*index)` then calls the top level function on each element -// of the array to ensure all element's have corrected locations -func correctArrayLocations(arrayParam *ditypes.Parameter, fieldLocations map[bininspect.FieldIdentifier]uint64) { - initialOffset := arrayParam.Location.StackOffset - for i := range arrayParam.ParameterPieces { - arrayParam.ParameterPieces[i].Location.StackOffset = initialOffset + (arrayParam.ParameterPieces[i].TotalSize * int64(i)) - correctTypeSpecificLocations([]ditypes.Parameter{arrayParam.ParameterPieces[i]}, fieldLocations) + offset := fieldLocations[fieldID] + structParam.ParameterPieces[i].FieldOffset = offset + correctStructLocations(structParam.ParameterPieces[i], fieldLocations) } } diff --git a/pkg/dynamicinstrumentation/diconfig/binary_inspection_test.go b/pkg/dynamicinstrumentation/diconfig/binary_inspection_test.go index 32d31e49c2188..cc2d6dc5da170 100644 --- a/pkg/dynamicinstrumentation/diconfig/binary_inspection_test.go +++ b/pkg/dynamicinstrumentation/diconfig/binary_inspection_test.go @@ -15,49 +15,66 @@ import ( "strings" "testing" + "github.com/DataDog/datadog-agent/pkg/dynamicinstrumentation/ditypes" "github.com/DataDog/datadog-agent/pkg/dynamicinstrumentation/testutil" - "github.com/DataDog/datadog-agent/pkg/network/go/bininspect" - "github.com/DataDog/datadog-agent/pkg/util/safeelf" - - "github.com/kr/pretty" + "github.com/stretchr/testify/require" ) -func TestBinaryInspection(t *testing.T) { - - testFunctions := []string{ - "github.com/DataDog/datadog-agent/pkg/dynamicinstrumentation/testutil/sample.test_single_string", - "github.com/DataDog/datadog-agent/pkg/dynamicinstrumentation/testutil/sample.test_nonembedded_struct", - "github.com/DataDog/datadog-agent/pkg/dynamicinstrumentation/testutil/sample.test_struct", - "github.com/DataDog/datadog-agent/pkg/dynamicinstrumentation/testutil/sample.test_uint_slice", - } - - curDir, err := pwd() - if err != nil { - t.Error(err) +func TestAnalyzeBinary(t *testing.T) { + + testCases := []struct { + FuncName string + ExpectedParameters []*ditypes.Parameter + }{ + { + FuncName: "github.com/DataDog/datadog-agent/pkg/dynamicinstrumentation/testutil/sample.test_single_int", + ExpectedParameters: []*ditypes.Parameter{ + { + Name: "x", + ID: "", + Type: "int", + TotalSize: 8, + Kind: 0x2, + Location: &ditypes.Location{InReg: true, StackOffset: 0, Register: 0, NeedsDereference: false, PointerOffset: 0x0}, + LocationExpressions: nil, + FieldOffset: 0x0, + NotCaptureReason: 0x0, + ParameterPieces: nil, + }, + }, + }, } - binPath, err := testutil.BuildGoBinaryWrapper(curDir, "../testutil/sample/sample_service") - if err != nil { - t.Error(err) - } + for i := range testCases { + t.Run(testCases[i].FuncName, func(t *testing.T) { - f, err := safeelf.Open(binPath) - if err != nil { - t.Error(err) - } + curDir, err := pwd() + if err != nil { + t.Error(err) + } - result, err := bininspect.InspectWithDWARF(f, testFunctions, nil) - if err != nil { - t.Error(">", err) - } + binPath, err := testutil.BuildGoBinaryWrapper(curDir, "../testutil/sample/sample_service") + if err != nil { + t.Error(err) + } - for _, funcMetadata := range result.Functions { - for paramName, paramMeta := range funcMetadata.Parameters { - for _, piece := range paramMeta.Pieces { - pretty.Log(paramName, piece) + procInfo := ditypes.ProcessInfo{ + BinaryPath: binPath, + ProbesByID: ditypes.ProbesByID{ + testCases[i].FuncName: &ditypes.Probe{ + ServiceName: "sample", + FuncName: testCases[i].FuncName, + }, + }, } - } + err = AnalyzeBinary(&procInfo) + if err != nil { + t.Error(err) + } + require.Equal(t, testCases[i].ExpectedParameters, procInfo.TypeMap.Functions[testCases[i].FuncName]) + }) } + } // pwd returns the current directory of the caller. diff --git a/pkg/dynamicinstrumentation/diconfig/config_manager.go b/pkg/dynamicinstrumentation/diconfig/config_manager.go index b939b8827d6cb..c24369dcb1145 100644 --- a/pkg/dynamicinstrumentation/diconfig/config_manager.go +++ b/pkg/dynamicinstrumentation/diconfig/config_manager.go @@ -127,7 +127,7 @@ func (cm *RCConfigManager) installConfigProbe(procInfo *ditypes.ProcessInfo) err svcConfigProbe := *configProbe svcConfigProbe.ServiceName = procInfo.ServiceName procInfo.ProbesByID[configProbe.ID] = &svcConfigProbe - + log.Infof("Installing config probe for service: %s", svcConfigProbe.ServiceName) err = AnalyzeBinary(procInfo) if err != nil { return fmt.Errorf("could not analyze binary for config probe: %w", err) @@ -165,6 +165,9 @@ func (cm *RCConfigManager) installConfigProbe(procInfo *ditypes.ProcessInfo) err func (cm *RCConfigManager) readConfigs(r *ringbuf.Reader, procInfo *ditypes.ProcessInfo) { log.Tracef("Waiting for configs for service: %s", procInfo.ServiceName) + configRateLimiter := ratelimiter.NewMultiProbeRateLimiter(0.0) + configRateLimiter.SetRate(ditypes.ConfigBPFProbeID, 0) + for { record, err := r.Read() if err != nil { @@ -172,13 +175,14 @@ func (cm *RCConfigManager) readConfigs(r *ringbuf.Reader, procInfo *ditypes.Proc continue } - configEventParams, err := eventparser.ParseParams(record.RawSample) + configEvent, err := eventparser.ParseEvent(record.RawSample, configRateLimiter) if err != nil { log.Errorf("error parsing configuration for PID %d: %v", procInfo.PID, err) continue } + configEventParams := configEvent.Argdata if len(configEventParams) != 3 { - log.Errorf("error parsing configuration for PID %d: not enough arguments", procInfo.PID) + log.Errorf("error parsing configuration for PID: %d: not enough arguments", procInfo.PID) continue } @@ -238,7 +242,7 @@ func (cm *RCConfigManager) readConfigs(r *ringbuf.Reader, procInfo *ditypes.Proc } func applyConfigUpdate(procInfo *ditypes.ProcessInfo, probe *ditypes.Probe) { - log.Tracef("Applying config update: %v", probe) + log.Tracef("Applying config update: %v\n", probe) err := AnalyzeBinary(procInfo) if err != nil { log.Errorf("couldn't inspect binary: %v\n", err) @@ -289,8 +293,8 @@ func newConfigProbe() *ditypes.Probe { FuncName: "gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer.passProbeConfiguration", InstrumentationInfo: &ditypes.InstrumentationInfo{ InstrumentationOptions: &ditypes.InstrumentationOptions{ - ArgumentsMaxSize: 100000, - StringMaxSize: 30000, + ArgumentsMaxSize: 50000, + StringMaxSize: 10000, MaxFieldCount: int(ditypes.MaxFieldCount), MaxReferenceDepth: 8, CaptureParameters: true, diff --git a/pkg/dynamicinstrumentation/diconfig/dwarf.go b/pkg/dynamicinstrumentation/diconfig/dwarf.go index 85b9ba2ba4176..01091a4d059c3 100644 --- a/pkg/dynamicinstrumentation/diconfig/dwarf.go +++ b/pkg/dynamicinstrumentation/diconfig/dwarf.go @@ -26,15 +26,11 @@ func getTypeMap(dwarfData *dwarf.Data, targetFunctions map[string]bool) (*ditype return loadFunctionDefinitions(dwarfData, targetFunctions) } -var dwarfMap = make(map[string]*dwarf.Data) - type seenTypeCounter struct { parameter *ditypes.Parameter count uint8 } -var seenTypes = make(map[string]*seenTypeCounter) - func loadFunctionDefinitions(dwarfData *dwarf.Data, targetFunctions map[string]bool) (*ditypes.TypeMap, error) { entryReader := dwarfData.Reader() typeReader := dwarfData.Reader() @@ -42,17 +38,19 @@ func loadFunctionDefinitions(dwarfData *dwarf.Data, targetFunctions map[string]b var funcName string var result = ditypes.TypeMap{ - Functions: make(map[string][]ditypes.Parameter), - InlinedFunctions: make(map[uint64][]*dwarf.Entry), + Functions: make(map[string][]*ditypes.Parameter), } var ( name string + isReturn bool typeFields *ditypes.Parameter ) entryLoop: for { + seenTypes := make(map[string]*seenTypeCounter) + entry, err := entryReader.Next() if err == io.EOF || entry == nil { break @@ -83,25 +81,6 @@ entryLoop: } } - if entry.Tag == dwarf.TagInlinedSubroutine { - // This is a inlined function - for i := range entry.Field { - // Find it's high program counter (where it exits in the parent routine) - if entry.Field[i].Attr == dwarf.AttrHighpc { - - // The field for HighPC can be a constant or address, which are int64 and uint64 respectively - if entry.Field[i].Class == dwarf.ClassConstant { - result.InlinedFunctions[uint64(entry.Field[i].Val.(int64))] = - append([]*dwarf.Entry{entry}, result.InlinedFunctions[uint64(entry.Field[i].Val.(int64))]...) - } else if entry.Field[i].Class == dwarf.ClassAddress { - result.InlinedFunctions[entry.Field[i].Val.(uint64)] = - append([]*dwarf.Entry{entry}, result.InlinedFunctions[entry.Field[i].Val.(uint64)]...) - } - } - } - continue entryLoop - } - if entry.Tag == dwarf.TagSubprogram { for _, field := range entry.Field { @@ -117,7 +96,8 @@ entryLoop: if !targetFunctions[funcName] { continue entryLoop } - result.Functions[funcName] = make([]ditypes.Parameter, 0) + params := make([]*ditypes.Parameter, 0) + result.Functions[funcName] = params readingAFunction = true continue entryLoop } @@ -144,6 +124,10 @@ entryLoop: name = entry.Field[i].Val.(string) } + if entry.Field[i].Attr == dwarf.AttrVarParam { + isReturn = entry.Field[i].Val.(bool) + } + // Collect information about the type of this ditypes.Parameter if entry.Field[i].Attr == dwarf.AttrType { @@ -153,7 +137,7 @@ entryLoop: return nil, err } - typeFields, err = expandTypeData(typeEntry.Offset, dwarfData) + typeFields, err = expandTypeData(typeEntry.Offset, dwarfData, seenTypes) if err != nil { return nil, fmt.Errorf("error while parsing debug information: %w", err) } @@ -161,12 +145,11 @@ entryLoop: } } - if typeFields != nil { + if typeFields != nil && !isReturn /* we ignore return values for now */ { // We've collected information about this ditypes.Parameter, append it to the slice of ditypes.Parameters for this function typeFields.Name = name - result.Functions[funcName] = append(result.Functions[funcName], *typeFields) + result.Functions[funcName] = append(result.Functions[funcName], typeFields) } - seenTypes = make(map[string]*seenTypeCounter) // reset seen types map for next parameter } // Sort program counter slice for lookup when resolving pcs->functions @@ -181,23 +164,19 @@ entryLoop: } func loadDWARF(binaryPath string) (*dwarf.Data, error) { - if dwarfData, ok := dwarfMap[binaryPath]; ok { - return dwarfData, nil - } elfFile, err := safeelf.Open(binaryPath) if err != nil { return nil, fmt.Errorf("couldn't open elf binary: %w", err) } - + defer elfFile.Close() dwarfData, err := elfFile.DWARF() if err != nil { return nil, fmt.Errorf("couldn't retrieve debug info from elf: %w", err) } - dwarfMap[binaryPath] = dwarfData return dwarfData, nil } -func expandTypeData(offset dwarf.Offset, dwarfData *dwarf.Data) (*ditypes.Parameter, error) { +func expandTypeData(offset dwarf.Offset, dwarfData *dwarf.Data, seenTypes map[string]*seenTypeCounter) (*ditypes.Parameter, error) { typeReader := dwarfData.Reader() typeReader.Seek(offset) @@ -227,8 +206,8 @@ func expandTypeData(offset dwarf.Offset, dwarfData *dwarf.Data) (*ditypes.Parame v, typeParsedAlready := seenTypes[typeHeader.Type] if typeParsedAlready { v.count++ - if v.count >= ditypes.MaxReferenceDepth { - return v.parameter, nil + if v.count > ditypes.MaxReferenceDepth { + return &ditypes.Parameter{}, nil } } else { seenTypes[typeHeader.Type] = &seenTypeCounter{ @@ -237,26 +216,20 @@ func expandTypeData(offset dwarf.Offset, dwarfData *dwarf.Data) (*ditypes.Parame } } - if typeKind == uint(reflect.Slice) { - sliceElements, err := getSliceField(typeEntry.Offset, dwarfData) - if err != nil { - return nil, fmt.Errorf("could not collect fields of slice type: %w", err) - } - typeHeader = sliceElements[0] - } else if typeEntry.Tag == dwarf.TagStructType { - structFields, err := getStructFields(typeEntry.Offset, dwarfData) + if typeEntry.Tag == dwarf.TagStructType || typeKind == uint(reflect.Slice) || typeKind == uint(reflect.String) { + structFields, err := getStructFields(typeEntry.Offset, dwarfData, seenTypes) if err != nil { return nil, fmt.Errorf("could not collect fields of struct type of ditypes.Parameter: %w", err) } typeHeader.ParameterPieces = structFields } else if typeEntry.Tag == dwarf.TagArrayType { - arrayElements, err := getIndividualArrayElements(typeEntry.Offset, dwarfData) + arrayElements, err := getIndividualArrayElements(typeEntry.Offset, dwarfData, seenTypes) if err != nil { return nil, fmt.Errorf("could not get length of array: %w", err) } typeHeader.ParameterPieces = arrayElements } else if typeEntry.Tag == dwarf.TagPointerType { - pointerElements, err := getPointerLayers(typeEntry.Offset, dwarfData) + pointerElements, err := getPointerLayers(typeEntry.Offset, dwarfData, seenTypes) if err != nil { return nil, fmt.Errorf("could not find pointer type: %w", err) } @@ -266,50 +239,7 @@ func expandTypeData(offset dwarf.Offset, dwarfData *dwarf.Data) (*ditypes.Parame return &typeHeader, nil } -// getSliceField returns the representation of a slice as a []ditypes.Parameter. The returned -// slice will have only one element. -// -// Slices are represented internally in go as a struct with 3 fields. The pointer to the -// the underlying array, the array length, and the array capacity. -func getSliceField(offset dwarf.Offset, dwarfData *dwarf.Data) ([]ditypes.Parameter, error) { - typeReader := dwarfData.Reader() - - typeReader.Seek(offset) - typeEntry, err := typeReader.Next() - if err != nil { - return nil, fmt.Errorf("could not get slice type entry: %w", err) - } - - elementTypeName, elementTypeSize, elementTypeKind := getTypeEntryBasicInfo(typeEntry) - sliceParameter := ditypes.Parameter{ - Type: elementTypeName, - TotalSize: elementTypeSize, - Kind: elementTypeKind, - } - - arrayEntry, err := typeReader.Next() - if err != nil { - return nil, fmt.Errorf("could not get slice type entry: %w", err) - } - - for i := range arrayEntry.Field { - if arrayEntry.Field[i].Attr == dwarf.AttrType { - typeReader.Seek(arrayEntry.Field[i].Val.(dwarf.Offset)) - typeEntry, err := typeReader.Next() - if err != nil { - return nil, err - } - underlyingType, err := expandTypeData(typeEntry.Offset, dwarfData) - if err != nil { - return nil, err - } - sliceParameter.ParameterPieces = append(sliceParameter.ParameterPieces, underlyingType.ParameterPieces[0]) - } - } - return []ditypes.Parameter{sliceParameter}, nil -} - -func getIndividualArrayElements(offset dwarf.Offset, dwarfData *dwarf.Data) ([]ditypes.Parameter, error) { +func getIndividualArrayElements(offset dwarf.Offset, dwarfData *dwarf.Data, seenTypes map[string]*seenTypeCounter) ([]*ditypes.Parameter, error) { savedArrayEntryOffset := offset typeReader := dwarfData.Reader() @@ -339,7 +269,7 @@ func getIndividualArrayElements(offset dwarf.Offset, dwarfData *dwarf.Data) ([]d return nil, err } - elementFields, err = expandTypeData(arrayElementTypeEntry.Offset, dwarfData) + elementFields, err = expandTypeData(arrayElementTypeEntry.Offset, dwarfData, seenTypes) if err != nil { return nil, err } @@ -366,7 +296,7 @@ func getIndividualArrayElements(offset dwarf.Offset, dwarfData *dwarf.Data) ([]d } } - arrayElements := []ditypes.Parameter{} + arrayElements := []*ditypes.Parameter{} for h := 0; h < int(arrayLength); h++ { newParam := ditypes.Parameter{} copyTree(&newParam.ParameterPieces, &elementFields.ParameterPieces) @@ -374,17 +304,17 @@ func getIndividualArrayElements(offset dwarf.Offset, dwarfData *dwarf.Data) ([]d newParam.Type = elementTypeName newParam.Kind = elementTypeKind newParam.TotalSize = elementTypeSize - arrayElements = append(arrayElements, newParam) + arrayElements = append(arrayElements, &newParam) } return arrayElements, nil } -func getStructFields(offset dwarf.Offset, dwarfData *dwarf.Data) ([]ditypes.Parameter, error) { +func getStructFields(offset dwarf.Offset, dwarfData *dwarf.Data, seenTypes map[string]*seenTypeCounter) ([]*ditypes.Parameter, error) { inOrderReader := dwarfData.Reader() typeReader := dwarfData.Reader() - structFields := []ditypes.Parameter{} + structFields := []*ditypes.Parameter{} fieldEntry := &dwarf.Entry{} // Start at the entry of the definition of the struct @@ -399,14 +329,14 @@ func getStructFields(offset dwarf.Offset, dwarfData *dwarf.Data) ([]ditypes.Para for { fieldEntry, err = inOrderReader.Next() if err != nil { - return []ditypes.Parameter{}, err + return []*ditypes.Parameter{}, err } if entryIsEmpty(fieldEntry) || fieldEntry.Tag != dwarf.TagMember { break } - newStructField := ditypes.Parameter{} + newStructField := &ditypes.Parameter{} for i := range fieldEntry.Field { @@ -420,30 +350,30 @@ func getStructFields(offset dwarf.Offset, dwarfData *dwarf.Data) ([]ditypes.Para typeReader.Seek(fieldEntry.Field[i].Val.(dwarf.Offset)) typeEntry, err := typeReader.Next() if err != nil { - return []ditypes.Parameter{}, err + return []*ditypes.Parameter{}, err } if !entryTypeIsSupported(typeEntry) { unsupportedType := resolveUnsupportedEntry(typeEntry) - structFields = append(structFields, *unsupportedType) + structFields = append(structFields, unsupportedType) continue } if typeEntry.Tag == dwarf.TagTypedef { typeEntry, err = resolveTypedefToRealType(typeEntry, typeReader) if err != nil { - return []ditypes.Parameter{}, err + return []*ditypes.Parameter{}, err } } newStructField.Type, newStructField.TotalSize, newStructField.Kind = getTypeEntryBasicInfo(typeEntry) if typeEntry.Tag != dwarf.TagBaseType { - field, err := expandTypeData(typeEntry.Offset, dwarfData) - if err != nil { - return []ditypes.Parameter{}, err + field, err := expandTypeData(typeEntry.Offset, dwarfData, seenTypes) + if err != nil || field == nil { + return []*ditypes.Parameter{}, err } field.Name = newStructField.Name - structFields = append(structFields, *field) + structFields = append(structFields, field) } else { structFields = append(structFields, newStructField) } @@ -453,7 +383,7 @@ func getStructFields(offset dwarf.Offset, dwarfData *dwarf.Data) ([]ditypes.Para return structFields, nil } -func getPointerLayers(offset dwarf.Offset, dwarfData *dwarf.Data) ([]ditypes.Parameter, error) { +func getPointerLayers(offset dwarf.Offset, dwarfData *dwarf.Data, seenTypes map[string]*seenTypeCounter) ([]*ditypes.Parameter, error) { typeReader := dwarfData.Reader() typeReader.Seek(offset) pointerEntry, err := typeReader.Next() @@ -470,16 +400,16 @@ func getPointerLayers(offset dwarf.Offset, dwarfData *dwarf.Data) ([]ditypes.Par return nil, err } - underlyingType, err = expandTypeData(typeEntry.Offset, dwarfData) + underlyingType, err = expandTypeData(typeEntry.Offset, dwarfData, seenTypes) if err != nil { return nil, err } } } if underlyingType == nil { - return []ditypes.Parameter{}, nil + return []*ditypes.Parameter{}, nil } - return []ditypes.Parameter{*underlyingType}, nil + return []*ditypes.Parameter{underlyingType}, nil } // Can use `Children` field, but there's also always a NULL/empty entry at the end of entry trees. @@ -556,32 +486,37 @@ func resolveTypedefToRealType(outerType *dwarf.Entry, reader *dwarf.Reader) (*dw return outerType, nil } -func correctStructSizes(params []ditypes.Parameter) { +func correctStructSizes(params []*ditypes.Parameter) { for i := range params { - correctStructSize(¶ms[i]) + correctStructSize(params[i]) } } // correctStructSize sets the size of structs to the number of fields in the struct func correctStructSize(param *ditypes.Parameter) { - if len(param.ParameterPieces) == 0 { + if param == nil || len(param.ParameterPieces) == 0 { return } if param.Kind == uint(reflect.Struct) || param.Kind == uint(reflect.Array) { param.TotalSize = int64(len(param.ParameterPieces)) } for i := range param.ParameterPieces { - correctStructSize(¶m.ParameterPieces[i]) + correctStructSize(param.ParameterPieces[i]) } } -func copyTree(dst, src *[]ditypes.Parameter) { +func copyTree(dst, src *[]*ditypes.Parameter) { if dst == nil || src == nil || len(*src) == 0 { return } - *dst = make([]ditypes.Parameter, len(*src)) + *dst = make([]*ditypes.Parameter, len(*src)) copy(*dst, *src) for i := range *src { + // elements can be nil if there was a nil element originally in src + // that was copied to dst + if (*dst)[i] == nil || (*src)[i] == nil { + continue + } copyTree(&((*dst)[i].ParameterPieces), &((*src)[i].ParameterPieces)) } } diff --git a/pkg/dynamicinstrumentation/diconfig/location_expression.go b/pkg/dynamicinstrumentation/diconfig/location_expression.go new file mode 100644 index 0000000000000..001f015912805 --- /dev/null +++ b/pkg/dynamicinstrumentation/diconfig/location_expression.go @@ -0,0 +1,341 @@ +// 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_bpf + +package diconfig + +import ( + "fmt" + "reflect" + "strings" + + "math/rand" + + "github.com/DataDog/datadog-agent/pkg/dynamicinstrumentation/ditypes" + "github.com/DataDog/datadog-agent/pkg/util/log" +) + +// GenerateLocationExpression takes metadata about a parameter, including its type and location, and generates a list of +// LocationExpressions that can be used to read the parameter from the target process. +// +// It walks the tree of the parameter and its pieces, generating LocationExpressions for each piece. +// +//nolint:revive +func GenerateLocationExpression(limitsInfo *ditypes.InstrumentationInfo, param *ditypes.Parameter) { + triePaths, expressionTargets := generateLocationVisitsMap(param) + + getParamFromTriePaths := func(pathElement string) *ditypes.Parameter { + for n := range triePaths { + if triePaths[n].TypePath == pathElement { + return triePaths[n].Parameter + } + } + return nil + } + + // Go through each target type/field which needs to be captured + for i := range expressionTargets { + pathToInstrumentationTarget, instrumentationTarget := expressionTargets[i].TypePath, expressionTargets[i].Parameter + + targetExpressions := []ditypes.LocationExpression{} + pathElements := []string{pathToInstrumentationTarget} + // pathElements gets populated with every individual stretch of the path to the instrumentation target + for { + lastElementIndex := strings.LastIndex(pathToInstrumentationTarget, "@") + if lastElementIndex == -1 { + break + } + pathToInstrumentationTarget = pathToInstrumentationTarget[:lastElementIndex] + pathElements = append([]string{pathToInstrumentationTarget}, pathElements...) + } + + // Go through each path element of the instrumentation target + for pathElementIndex := range pathElements { + var elementParam *ditypes.Parameter = getParamFromTriePaths(pathElements[pathElementIndex]) + if elementParam == nil { + log.Infof("Path not found to target: %s", pathElements[pathElementIndex]) + continue + } + // Check if this instrumentation target is directly assigned + if elementParam.Location != nil { + // Type is directly assigned + if elementParam.Kind == uint(reflect.Array) { + if elementParam.TotalSize == 0 && len(elementParam.ParameterPieces) == 0 { + continue + } + GenerateLocationExpression(limitsInfo, elementParam.ParameterPieces[0]) + expressionsToUseForEachArrayElement := collectAllLocationExpressions(elementParam.ParameterPieces[0], true) + targetExpressions = append(targetExpressions, + // Read process stack address to the stack + ditypes.ReadRegisterLocationExpression(ditypes.StackRegister, 8), + ditypes.ApplyOffsetLocationExpression(uint(elementParam.Location.StackOffset)), + ) + //FIXME: Do we need to limit lengths of arrays?? + for i := 0; i < len(elementParam.ParameterPieces); i++ { + targetExpressions = append(targetExpressions, + ditypes.CopyLocationExpression(), + ditypes.ApplyOffsetLocationExpression(uint(i*(int(elementParam.ParameterPieces[0].TotalSize)))), + ) + targetExpressions = append(targetExpressions, expressionsToUseForEachArrayElement...) + } + } else if elementParam.Kind == uint(reflect.Pointer) { + targetExpressions = append(targetExpressions, + ditypes.DirectReadLocationExpression(elementParam), + ) + } else { + targetExpressions = append(targetExpressions, + ditypes.DirectReadLocationExpression(elementParam), + ditypes.PopLocationExpression(1, uint(elementParam.TotalSize)), + ) + } + continue + } else { /* end directly assigned types */ + // This is not directly assigned, expect the address for it on the stack + if elementParam.Kind == uint(reflect.Pointer) { + targetExpressions = append(targetExpressions, + ditypes.DereferenceLocationExpression(uint(elementParam.TotalSize)), + ) + } else if elementParam.Kind == uint(reflect.Struct) { + // Structs don't provide context on location, or have values themselves + // but we know that if there's a struct, the next element will have to have + // the offset applied + if len(pathElements) > pathElementIndex+1 { + // Apply the appropriate offset for the next element (the struct field) + structField := getParamFromTriePaths(pathElements[pathElementIndex+1]) + targetExpressions = append(targetExpressions, + ditypes.CopyLocationExpression(), + ditypes.ApplyOffsetLocationExpression(uint(structField.FieldOffset)), + ) + } + continue + } else if elementParam.Kind == uint(reflect.String) { + if len(instrumentationTarget.ParameterPieces) != 2 { + continue + } + stringCharArray := instrumentationTarget.ParameterPieces[0] + stringLength := instrumentationTarget.ParameterPieces[1] + if stringCharArray == nil || stringLength == nil { + continue + } + + if stringLength.Location != nil { + stringLength.LocationExpressions = append(stringLength.LocationExpressions, + ditypes.DirectReadLocationExpression(stringLength), + ditypes.PopLocationExpression(1, 2), + ) + } else { + stringLength.LocationExpressions = append(stringLength.LocationExpressions, + ditypes.ApplyOffsetLocationExpression(uint(stringLength.FieldOffset)), + ditypes.DereferenceToOutputLocationExpression(2), + ) + } + + if stringCharArray.Location != nil && stringLength.Location != nil { + // Fields of the string are directly assigned + targetExpressions = append(targetExpressions, + // Read string dynamically: + ditypes.DirectReadLocationExpression(stringCharArray), + ditypes.DirectReadLocationExpression(stringLength), + ditypes.DereferenceDynamicToOutputLocationExpression(uint(limitsInfo.InstrumentationOptions.StringMaxSize)), + ) + } else { + // Expect address of the string struct itself on the location expression stack + targetExpressions = append(targetExpressions, + ditypes.ReadStringToOutputLocationExpression(uint16(limitsInfo.InstrumentationOptions.StringMaxSize)), + ) + } + continue + /* end parsing strings */ + } else if elementParam.Kind == uint(reflect.Slice) { + if len(elementParam.ParameterPieces) != 3 { + continue + } + sliceIdentifier := randomLabel() + slicePointer := elementParam.ParameterPieces[0] + sliceLength := elementParam.ParameterPieces[1] + sliceLength.LocationExpressions = append(sliceLength.LocationExpressions, + ditypes.PrintStatement("%s", "Reading the length of slice"), + ) + if sliceLength.Location != nil { + sliceLength.LocationExpressions = append(sliceLength.LocationExpressions, + ditypes.DirectReadLocationExpression(sliceLength), + ditypes.PopLocationExpression(1, 2), + ) + } else { + sliceLength.LocationExpressions = append(sliceLength.LocationExpressions, + ditypes.ApplyOffsetLocationExpression(uint(sliceLength.FieldOffset)), + ditypes.DereferenceToOutputLocationExpression(2), + ) + } + if len(slicePointer.ParameterPieces) == 0 { + continue + } + + // Generate and collect the location expressions for collecting an individual + // element of this slice + sliceElementType := slicePointer.ParameterPieces[0] + + if slicePointer.Location != nil && sliceLength.Location != nil { + // Fields of the slice are directly assigned + targetExpressions = append(targetExpressions, + ditypes.PrintStatement("%s", "Reading the length of slice and setting limit (directly read)"), + ditypes.DirectReadLocationExpression(sliceLength), + ditypes.SetLimitEntry(sliceIdentifier, uint(ditypes.SliceMaxLength)), + ) + for i := 0; i < ditypes.SliceMaxLength; i++ { + GenerateLocationExpression(limitsInfo, sliceElementType) + expressionsToUseForEachSliceElement := collectAllLocationExpressions(sliceElementType, true) + labelName := randomLabel() + targetExpressions = append(targetExpressions, + ditypes.PrintStatement("%s", "Reading slice element "+fmt.Sprintf("%d", i)), + ditypes.JumpToLabelIfEqualToLimit(uint(i), sliceIdentifier, labelName), + ditypes.DirectReadLocationExpression(slicePointer), + ditypes.ApplyOffsetLocationExpression(uint(sliceElementType.TotalSize)*uint(i)), + ) + targetExpressions = append(targetExpressions, expressionsToUseForEachSliceElement...) + targetExpressions = append(targetExpressions, ditypes.InsertLabel(labelName)) + } + } else { + // Expect address of the slice struct on stack, use offsets accordingly + targetExpressions = append(targetExpressions, + ditypes.PrintStatement("%s", "Reading the length of slice and setting limit (indirect read)"), + ditypes.CopyLocationExpression(), // Setup stack so it has two pointers to slice struct + ditypes.ApplyOffsetLocationExpression(8), // Change the top pointer to the address of the length field + ditypes.DereferenceLocationExpression(8), // Dereference to place length on top of the stack + ditypes.SetLimitEntry(sliceIdentifier, uint(ditypes.SliceMaxLength)), + ) + // Expect address of slice struct on top of the stack, check limit and copy/apply offset accordingly + for i := 0; i < ditypes.SliceMaxLength; i++ { + GenerateLocationExpression(limitsInfo, sliceElementType) + expressionsToUseForEachSliceElement := collectAllLocationExpressions(sliceElementType, true) + labelName := randomLabel() + targetExpressions = append(targetExpressions, + ditypes.PrintStatement("%s", "Reading slice element "+fmt.Sprintf("%d", i)), + ditypes.JumpToLabelIfEqualToLimit(uint(i), sliceIdentifier, labelName), + ditypes.CopyLocationExpression(), + ditypes.DereferenceLocationExpression(8), + ditypes.ApplyOffsetLocationExpression(uint(i*(int(sliceElementType.TotalSize)))), + ) + targetExpressions = append(targetExpressions, expressionsToUseForEachSliceElement...) + targetExpressions = append(targetExpressions, ditypes.InsertLabel(labelName)) + } + } + continue + /* end parsing slices */ + } else if elementParam.Kind == uint(reflect.Array) { + // Expect the address of the array itself on the stack + if elementParam.TotalSize == 0 && len(elementParam.ParameterPieces) == 0 { + continue + } + //FIXME: Do we need to limit lengths of arrays?? + if elementParam.ParameterPieces[0] == nil { + continue + } + GenerateLocationExpression(limitsInfo, elementParam.ParameterPieces[0]) + expressionsToUseForEachArrayElement := collectAllLocationExpressions(elementParam.ParameterPieces[0], true) + for i := 0; i < len(elementParam.ParameterPieces); i++ { + targetExpressions = append(targetExpressions, + ditypes.CopyLocationExpression(), + ditypes.ApplyOffsetLocationExpression(uint(int(elementParam.ParameterPieces[0].TotalSize)*i)), + ) + targetExpressions = append(targetExpressions, expressionsToUseForEachArrayElement...) + } + } else { + // Basic type, indirectly assigned + targetExpressions = append(targetExpressions, + ditypes.DereferenceToOutputLocationExpression(uint(elementParam.TotalSize))) + } + } /* end indirectly assigned types */ + } + expressionTargets[i].Parameter.LocationExpressions = targetExpressions + } +} + +func collectAllLocationExpressions(parameter *ditypes.Parameter, remove bool) []ditypes.LocationExpression { + if parameter == nil { + return []ditypes.LocationExpression{} + } + expressions := parameter.LocationExpressions + for i := range parameter.ParameterPieces { + expressions = append(expressions, collectAllLocationExpressions(parameter.ParameterPieces[i], remove)...) + } + if remove { + parameter.LocationExpressions = []ditypes.LocationExpression{} + } + return expressions +} + +//nolint:all +func printLocationExpressions(expressions []ditypes.LocationExpression) { + for i := range expressions { + fmt.Printf("%s %d %d %d %s %s\n", + expressions[i].Opcode.String(), + expressions[i].Arg1, + expressions[i].Arg2, + expressions[i].Arg3, + expressions[i].Label, + expressions[i].CollectionIdentifier, + ) + } +} + +type expressionParamTuple struct { + TypePath string + Parameter *ditypes.Parameter +} + +// generateLocationVisitsMap follows the tree of parameters (parameter.ParameterPieces), and +// collects string values of all the paths to nodes that need expressions (`needsExpressions`), +// as well as all combinations of elements that can be achieved by walking the tree (`trieKeys`). +func generateLocationVisitsMap(parameter *ditypes.Parameter) (trieKeys, needsExpressions []expressionParamTuple) { + trieKeys = []expressionParamTuple{} + needsExpressions = []expressionParamTuple{} + + var visit func(param *ditypes.Parameter, path string) + visit = func(param *ditypes.Parameter, path string) { + if param == nil { + return + } + trieKeys = append(trieKeys, expressionParamTuple{path + param.Type, param}) + + if (len(param.ParameterPieces) == 0 || + isBasicType(param.Kind) || + param.Kind == uint(reflect.Array) || + param.Kind == uint(reflect.Slice)) && + param.Kind != uint(reflect.Struct) && + param.Kind != uint(reflect.Pointer) { + needsExpressions = append(needsExpressions, expressionParamTuple{path + param.Type, param}) + return + } + + for i := range param.ParameterPieces { + newPath := path + param.Type + "@" + visit(param.ParameterPieces[i], newPath) + } + } + visit(parameter, "") + return trieKeys, needsExpressions +} + +func isBasicType(kind uint) bool { + switch reflect.Kind(kind) { + case reflect.Bool, reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, + reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr, + reflect.Float32, reflect.Float64, reflect.Complex64, reflect.Complex128, reflect.String: + return true + default: + return false + } +} + +func randomLabel() string { + length := 6 + randomString := make([]byte, length) + for i := 0; i < length; i++ { + randomString[i] = byte(65 + rand.Intn(25)) + } + return string(randomString) +} diff --git a/pkg/dynamicinstrumentation/diconfig/location_expression_test.go b/pkg/dynamicinstrumentation/diconfig/location_expression_test.go new file mode 100644 index 0000000000000..fff581de716a3 --- /dev/null +++ b/pkg/dynamicinstrumentation/diconfig/location_expression_test.go @@ -0,0 +1,54 @@ +// 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_bpf + +package diconfig + +import ( + "reflect" + "testing" + + "github.com/stretchr/testify/require" + + "github.com/DataDog/datadog-agent/pkg/dynamicinstrumentation/ditypes" +) + +func TestLocationExpressionGeneration(t *testing.T) { + testCases := []struct { + Name string + Parameter *ditypes.Parameter + Limits *ditypes.InstrumentationInfo + ExpectedOutput []ditypes.LocationExpression + }{ + { + Name: "DirectlyAssignedRegisterUint", + Parameter: &ditypes.Parameter{ + Type: "uint", + Kind: uint(reflect.Uint), + TotalSize: 8, + Location: &ditypes.Location{ + InReg: true, + Register: 1, + PointerOffset: 9999, // should not be used + StackOffset: 8888, // should not be used + NeedsDereference: true, // should not be used + }, + }, + ExpectedOutput: []ditypes.LocationExpression{ + ditypes.ReadRegisterLocationExpression(1, 8), + ditypes.PopLocationExpression(1, 8), + }, + }, + } + + for _, testcase := range testCases { + t.Run(testcase.Name, func(t *testing.T) { + GenerateLocationExpression(testcase.Limits, testcase.Parameter) + resultExpressions := collectAllLocationExpressions(testcase.Parameter, true) + require.Equal(t, testcase.ExpectedOutput, resultExpressions) + }) + } +} diff --git a/pkg/dynamicinstrumentation/diconfig/mem_config_manager.go b/pkg/dynamicinstrumentation/diconfig/mem_config_manager.go index 16301afddd2d5..7e7ca74f9a933 100644 --- a/pkg/dynamicinstrumentation/diconfig/mem_config_manager.go +++ b/pkg/dynamicinstrumentation/diconfig/mem_config_manager.go @@ -208,6 +208,7 @@ func (rc *rcConfig) toProbe(service string) *ditypes.Probe { CaptureParameters: ditypes.CaptureParameters, ArgumentsMaxSize: ditypes.ArgumentsMaxSize, StringMaxSize: ditypes.StringMaxSize, + SliceMaxLength: ditypes.SliceMaxLength, MaxReferenceDepth: rc.Capture.MaxReferenceDepth, }, }, diff --git a/pkg/dynamicinstrumentation/ditypes/analysis.go b/pkg/dynamicinstrumentation/ditypes/analysis.go index 0aa4a698e5782..c311ff7f74bec 100644 --- a/pkg/dynamicinstrumentation/ditypes/analysis.go +++ b/pkg/dynamicinstrumentation/ditypes/analysis.go @@ -12,15 +12,10 @@ import ( "fmt" ) -// TypeMap contains all the information about functions and their parameters including -// functions that have been inlined in the binary +// TypeMap contains all the information about functions and their parameters type TypeMap struct { // Functions maps fully-qualified function names to a slice of its parameters - Functions map[string][]Parameter - - // InlinedFunctions maps program counters to a slice of dwarf entries used - // when resolving stack traces that include inlined functions - InlinedFunctions map[uint64][]*dwarf.Entry + Functions map[string][]*Parameter // FunctionsByPC places DWARF subprogram (function) entries in order by // its low program counter which is necessary for resolving stack traces @@ -34,14 +29,16 @@ type TypeMap struct { // Parameter represents a function parameter as read from DWARF info type Parameter struct { - Name string - ID string - Type string - TotalSize int64 - Kind uint - Location Location - NotCaptureReason NotCaptureReason - ParameterPieces []Parameter + Name string // Name is populated by the local name of the parameter + ID string // ID is randomly generated for each parameter to avoid + Type string // Type is a string representation of the type name + TotalSize int64 // TotalSize is the size of the parameter type + Kind uint // Kind is a constant representation of the type, see reflect.Kind + Location *Location // Location represents where the parameter will be in memory when passed to the target function + LocationExpressions []LocationExpression // LocationExpressions are the needed instructions for extracting the parameter value from memory + FieldOffset uint64 // FieldOffset is the offset of Parameter field within a struct, if it is a struct field + NotCaptureReason NotCaptureReason // NotCaptureReason conveys to the user why the parameter was not captured + ParameterPieces []*Parameter // ParameterPieces are the sub-fields, such as struct fields or array elements } func (p Parameter) String() string { @@ -78,6 +75,300 @@ func (s SpecialKind) String() string { } } +func (l LocationExpression) String() string { + return fmt.Sprintf("%s (%d, %d, %d)", l.Opcode.String(), l.Arg1, l.Arg2, l.Arg3) +} + +// LocationExpressionOpcode uniquely identifies each location expression operation +type LocationExpressionOpcode uint + +const ( + // OpInvalid represents an invalid operation + OpInvalid LocationExpressionOpcode = iota + // OpComment represents a comment operation + OpComment + // OpPrintStatement represents a print statement operation + OpPrintStatement + // OpReadUserRegister represents an operation to read a user register + OpReadUserRegister + // OpReadUserStack represents an operation to read the user stack + OpReadUserStack + // OpReadUserRegisterToOutput represents an operation to read a user register and output the value + OpReadUserRegisterToOutput + // OpReadUserStackToOutput represents an operation to read the user stack and output the value + OpReadUserStackToOutput + // OpDereference represents an operation to dereference a pointer + OpDereference + // OpDereferenceToOutput represents an operation to dereference a pointer and output the value + OpDereferenceToOutput + // OpDereferenceLarge represents an operation to dereference a large pointer + OpDereferenceLarge + // OpDereferenceLargeToOutput represents an operation to dereference a large pointer and output the value + OpDereferenceLargeToOutput + // OpDereferenceDynamic represents an operation to dynamically dereference a pointer + OpDereferenceDynamic + // OpDereferenceDynamicToOutput represents an operation to dynamically dereference a pointer and output the value + OpDereferenceDynamicToOutput + // OpReadStringToOutput represents an operation to read a string and output the value + OpReadStringToOutput + // OpApplyOffset represents an operation to apply an offset + OpApplyOffset + // OpPop represents an operation to pop a value from the stack + OpPop + // OpCopy represents an operation to copy a value + OpCopy + // OpLabel represents a label operation + OpLabel + // OpSetGlobalLimit represents an operation to set a global limit + OpSetGlobalLimit + // OpJumpIfGreaterThanLimit represents an operation to jump if a value is greater than a limit + OpJumpIfGreaterThanLimit +) + +func (op LocationExpressionOpcode) String() string { + switch op { + case OpInvalid: + return "Invalid" + case OpComment: + return "Comment" + case OpPrintStatement: + return "PrintStatement" + case OpReadUserRegister: + return "ReadUserRegister" + case OpReadUserStack: + return "ReadUserStack" + case OpReadUserRegisterToOutput: + return "ReadUserRegisterToOutput" + case OpReadUserStackToOutput: + return "ReadUserStackToOutput" + case OpDereference: + return "Dereference" + case OpDereferenceToOutput: + return "DereferenceToOutput" + case OpDereferenceLarge: + return "DereferenceLarge" + case OpDereferenceLargeToOutput: + return "DereferenceLargeToOutput" + case OpDereferenceDynamic: + return "DereferenceDynamic" + case OpDereferenceDynamicToOutput: + return "DereferenceDynamicToOutput" + case OpReadStringToOutput: + return "ReadStringToOutput" + case OpApplyOffset: + return "ApplyOffset" + case OpPop: + return "Pop" + case OpCopy: + return "Copy" + case OpLabel: + return "Label" + case OpSetGlobalLimit: + return "SetGlobalLimit" + case OpJumpIfGreaterThanLimit: + return "JumpIfGreaterThanLimit" + default: + return fmt.Sprintf("LocationExpressionOpcode(%d)", int(op)) + } +} + +// CopyLocationExpression express creates an expression which +// duplicates the u64 element on the top of the BPF parameter stack. +func CopyLocationExpression() LocationExpression { + return LocationExpression{Opcode: OpCopy} +} + +// DirectReadLocationExpression creates an expression which +// directly reads a value from either a specific register or stack offset +// and writes it to the bpf param stack +func DirectReadLocationExpression(p *Parameter) LocationExpression { + if p == nil || p.Location == nil { + return LocationExpression{Opcode: OpInvalid} + } + if p.Location.InReg { + return ReadRegisterLocationExpression(uint(p.Location.Register), uint(p.TotalSize)) + } + return ReadStackLocationExpression(uint(p.Location.StackOffset), uint(p.TotalSize)) +} + +// DirectReadToOutputLocationExpression creates an expression which +// directly reads a value from either a specific register or stack offset +// and writes it to the output buffer +func DirectReadToOutputLocationExpression(p *Parameter) LocationExpression { + if p == nil || p.Location == nil { + return LocationExpression{Opcode: OpInvalid} + } + if p.Location.InReg { + return ReadRegisterToOutputLocationExpression(uint(p.Location.Register), uint(p.TotalSize)) + } + return ReadStackToOutputLocationExpression(uint(p.Location.StackOffset), uint(p.TotalSize)) +} + +// ReadRegisterLocationExpression creates an expression which +// reads `size` bytes from register `reg` into a u64 which is then pushed to +// the top of the BPF parameter stack. +// Arg1 = register +// Arg2 = size of element +func ReadRegisterLocationExpression(register, size uint) LocationExpression { + return LocationExpression{Opcode: OpReadUserRegister, Arg1: register, Arg2: size} +} + +// ReadStackLocationExpression creates an expression which +// reads `size` bytes from the traced program's stack at offset `stack_offset` +// into a u64 which is then pushed to the top of the BPF parameter stack. +// Arg1 = stack offset +// Arg2 = size of element +func ReadStackLocationExpression(offset, size uint) LocationExpression { + return LocationExpression{Opcode: OpReadUserStack, Arg1: offset, Arg2: size} +} + +// ReadRegisterToOutputLocationExpression creates an expression which +// reads `size` bytes from register `reg` into a u64 which is then written to +// the output buffer. +// Arg1 = register +// Arg2 = size of element +func ReadRegisterToOutputLocationExpression(register, size uint) LocationExpression { + return LocationExpression{Opcode: OpReadUserRegisterToOutput, Arg1: register, Arg2: size} +} + +// ReadStackToOutputLocationExpression creates an expression which +// reads `size` bytes from the traced program's stack at offset `stack_offset` +// into a u64 which is then written to the output buffer +// Arg1 = stack offset +// Arg2 = size of element +func ReadStackToOutputLocationExpression(offset, size uint) LocationExpression { + return LocationExpression{Opcode: OpReadUserStackToOutput, Arg1: offset, Arg2: size} +} + +// DereferenceLocationExpression creates an expression which +// pops the 8-byte address from the top of the BPF parameter stack and dereferences +// it, reading a value of size `valueSize` from it, and pushes that value (encoded as a u64) +// back to the BPF parameter stack. +// It should only be used for types of 8 bytes or less +// Arg1 = size of value we're reading from the 8 byte address at the top of the stack +func DereferenceLocationExpression(valueSize uint) LocationExpression { + if valueSize > 8 { + return LocationExpression{Opcode: OpDereferenceLarge, Arg1: valueSize, Arg2: (valueSize + 7) / 8} + } + return LocationExpression{Opcode: OpDereference, Arg1: valueSize} +} + +// DereferenceToOutputLocationExpression creates an expression which +// pops the 8-byte address from the top of the BPF parameter stack and +// dereferences it, reading a value of size `valueSize` from it, and writes that value +// directly to the output buffer. +// It should only be used for types of 8 bytes or less +// Arg1 = size of value we're reading from the 8 byte address at the top of the stack +func DereferenceToOutputLocationExpression(valueSize uint) LocationExpression { + if valueSize > 8 { + return LocationExpression{Opcode: OpDereferenceLargeToOutput, Arg1: valueSize, Arg2: (valueSize + 7) / 8} + } + return LocationExpression{Opcode: OpDereferenceToOutput, Arg1: valueSize} +} + +// DereferenceLargeLocationExpression creates an expression which +// pops the 8-byte address from the top of the BPF parameter stack and dereferences +// it, reading a value of size `typeSize` from it, and pushes that value, encoded in 8-byte chunks +// to the BPF parameter stack. This is safe to use for types larger than 8-bytes. +// back to the BPF parameter stack. +// Arg1 = size in bytes of value we're reading from the 8 byte address at the top of the stack +// Arg2 = number of chunks (should be ({{.Arg1}} + 7) / 8) +func DereferenceLargeLocationExpression(typeSize uint) LocationExpression { + return LocationExpression{Opcode: OpDereferenceLarge, Arg1: typeSize, Arg2: (typeSize + 7) / 8} +} + +// DereferenceLargeToOutputLocationExpression creates an expression which +// pops the 8-byte address from the top of the BPF parameter stack and dereferences +// it, reading a value of size `typeSize` from it, and writes that value to the output buffer. +// This is safe to use for types larger than 8-bytes. +// Arg1 = size in bytes of value we're reading from the 8 byte address at the top of the stack +// Arg2 = number of chunks (should be ({{.Arg1}} + 7) / 8) +func DereferenceLargeToOutputLocationExpression(typeSize uint) LocationExpression { + return LocationExpression{Opcode: OpDereferenceLargeToOutput, Arg1: typeSize, Arg2: (typeSize + 7) / 8} +} + +// DereferenceDynamicToOutputLocationExpression creates an expression which +// reads an 8-byte length from the top of the BPF parameter stack, followed by +// an 8-byte address. It applies the maximum `readLimit` to the length, then dereferences the address to +// the output buffer. +// Maximum limit (Arg1) should be set to the size of each element * max collection length +// Arg1 = maximum limit on bytes read +func DereferenceDynamicToOutputLocationExpression(readLimit uint) LocationExpression { + return LocationExpression{Opcode: OpDereferenceDynamicToOutput, Arg1: readLimit} +} + +// ReadStringToOutputLocationExpression creates an expression which +// reads a Go string to the output buffer, limited in length by `limit`. +// In Go, strings are internally implemented as structs with two fields. The fields are length, +// and a pointer to a character array. This expression expects the address of the string struct +// itself to be on the top of the stack. +// Arg1 = string length limit +func ReadStringToOutputLocationExpression(limit uint16) LocationExpression { + return LocationExpression{Opcode: OpReadStringToOutput, Arg1: uint(limit)} +} + +// ApplyOffsetLocationExpression creates an expression which +// adds `offset` to the 8-byte address on the top of the bpf parameter stack. +// Arg1 = uint value (offset) we're adding to the 8-byte address on top of the stack +func ApplyOffsetLocationExpression(offset uint) LocationExpression { + return LocationExpression{Opcode: OpApplyOffset, Arg1: offset} +} + +// PopLocationExpression creates an expression which +// writes to output `num_elements` elements, each of size `elementSize, from the top of the stack. +// Arg1 = number of elements to pop +// Arg2 = size of each element +func PopLocationExpression(numElements, elementSize uint) LocationExpression { + return LocationExpression{Opcode: OpPop, Arg1: numElements, Arg2: elementSize} +} + +// InsertLabel inserts a label in the bpf program +// No args, just set label +func InsertLabel(label string) LocationExpression { + return LocationExpression{Opcode: OpLabel, Label: label} +} + +// SetLimitEntry associates a collection identifier with the passed limit +// Arg1 = limit to set +// CollectionIdentifier = the collection that we're limiting +func SetLimitEntry(collectionIdentifier string, limit uint) LocationExpression { + return LocationExpression{Opcode: OpSetGlobalLimit, CollectionIdentifier: collectionIdentifier, Arg1: limit} +} + +// JumpToLabelIfEqualToLimit jumps to a specified label if the limit associated with the collection (by identifier) +// is equal to the passed value +// Arg1 = value to compare to global limit variable +// CollectionIdentifier = the collection that we're limiting +// Label = label to jump to if the value is equal to the global limit variable +func JumpToLabelIfEqualToLimit(val uint, collectionIdentifier, label string) LocationExpression { + return LocationExpression{Opcode: OpJumpIfGreaterThanLimit, CollectionIdentifier: collectionIdentifier, Arg1: val, Label: label} +} + +// InsertComment inserts a comment into the bpf program +// Label = comment +func InsertComment(comment string) LocationExpression { + return LocationExpression{Opcode: OpComment, Label: comment} +} + +// PrintStatement inserts a print statement into the bpf program +// Label = format +// CollectionIdentifier = arguments +// Example usage: PrintStatement("%d", "variableName") +func PrintStatement(format, arguments string) LocationExpression { + return LocationExpression{Opcode: OpPrintStatement, Label: format, CollectionIdentifier: arguments} +} + +// LocationExpression is an operation which will be executed in bpf with the purpose +// of capturing parameters from a running Go program +type LocationExpression struct { + Opcode LocationExpressionOpcode + Arg1 uint + Arg2 uint + Arg3 uint + CollectionIdentifier string + Label string +} + // Location represents where a particular datatype is found on probe entry type Location struct { InReg bool diff --git a/pkg/dynamicinstrumentation/ditypes/arch_amd64.go b/pkg/dynamicinstrumentation/ditypes/arch_amd64.go new file mode 100644 index 0000000000000..a80b8e187ed27 --- /dev/null +++ b/pkg/dynamicinstrumentation/ditypes/arch_amd64.go @@ -0,0 +1,13 @@ +// 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_bpf && amd64 + +package ditypes + +// StackRegister is the register containing the address of the +// program stack. On x86 DWARF maps the register number 7 to +// the stack pointer. +const StackRegister = 7 diff --git a/pkg/dynamicinstrumentation/ditypes/arch_arm64.go b/pkg/dynamicinstrumentation/ditypes/arch_arm64.go new file mode 100644 index 0000000000000..ac80bd65864fd --- /dev/null +++ b/pkg/dynamicinstrumentation/ditypes/arch_arm64.go @@ -0,0 +1,13 @@ +// 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_bpf && arm64 + +package ditypes + +// StackRegister is the register containing the address of the +// program stack. On ARM64 DWARF maps the register number 29 to +// the stack pointer. +const StackRegister = 29 diff --git a/pkg/dynamicinstrumentation/ditypes/config.go b/pkg/dynamicinstrumentation/ditypes/config.go index ba9667e069552..3614a6754e30f 100644 --- a/pkg/dynamicinstrumentation/ditypes/config.go +++ b/pkg/dynamicinstrumentation/ditypes/config.go @@ -29,11 +29,10 @@ const ConfigBPFProbeID = "config" // ConfigBPFProbeID is the ID used for the con var ( CaptureParameters = true // CaptureParameters is the default value for if probes should capture parameter values ArgumentsMaxSize = 10000 // ArgumentsMaxSize is the default size in bytes of the output buffer used for param values - StringMaxSize = 512 // StringMaxSize is the default size in bytes of a single string + StringMaxSize = 512 // StringMaxSize is the length limit MaxReferenceDepth uint8 = 4 // MaxReferenceDepth is the default depth that DI will traverse datatypes for capturing values MaxFieldCount = 20 // MaxFieldCount is the default limit for how many fields DI will capture in a single data type - SliceMaxSize = 1800 // SliceMaxSize is the default limit in bytes of a slice - SliceMaxLength = 100 // SliceMaxLength is the default limit in number of elements of a slice + SliceMaxLength = 10 // SliceMaxLength is the default limit in number of elements of a slice ) // ProbeID is the unique identifier for probes @@ -260,7 +259,6 @@ type InstrumentationOptions struct { StringMaxSize int MaxReferenceDepth int MaxFieldCount int - SliceMaxSize int SliceMaxLength int } diff --git a/pkg/dynamicinstrumentation/ditypes/ebpf.go b/pkg/dynamicinstrumentation/ditypes/ebpf.go index 40bc53fdf9d28..7b4121e79ec1d 100644 --- a/pkg/dynamicinstrumentation/ditypes/ebpf.go +++ b/pkg/dynamicinstrumentation/ditypes/ebpf.go @@ -8,7 +8,7 @@ package ditypes /* -#include "../codegen/c/types.h" +#include "../codegen/c/base_event.h" */ import "C" diff --git a/pkg/dynamicinstrumentation/ditypes/ebpf_linux.go b/pkg/dynamicinstrumentation/ditypes/ebpf_linux.go index d76d6c39c2105..ab6efaabe5e33 100644 --- a/pkg/dynamicinstrumentation/ditypes/ebpf_linux.go +++ b/pkg/dynamicinstrumentation/ditypes/ebpf_linux.go @@ -4,10 +4,10 @@ package ditypes type BaseEvent struct { - Probe_id [304]byte + Probe_id [36]byte Pid uint32 Uid uint32 Program_counters [10]uint64 } -const SizeofBaseEvent = 0x188 +const SizeofBaseEvent = 0x80 diff --git a/pkg/dynamicinstrumentation/eventparser/event_parser.go b/pkg/dynamicinstrumentation/eventparser/event_parser.go index 3b34303fa137b..7e336cc989b7a 100644 --- a/pkg/dynamicinstrumentation/eventparser/event_parser.go +++ b/pkg/dynamicinstrumentation/eventparser/event_parser.go @@ -21,74 +21,51 @@ import ( "github.com/DataDog/datadog-agent/pkg/util/log" ) -// MaxBufferSize is the maximum size of the output buffer from bpf which is read by this package -const MaxBufferSize = 10000 - var ( - byteOrder = binary.LittleEndian + byteOrder = binary.NativeEndian ) // ParseEvent takes the raw buffer from bpf and parses it into an event. It also potentially // applies a rate limit -func ParseEvent(record []byte, ratelimiters *ratelimiter.MultiProbeRateLimiter) *ditypes.DIEvent { +func ParseEvent(record []byte, ratelimiters *ratelimiter.MultiProbeRateLimiter) (*ditypes.DIEvent, error) { event := ditypes.DIEvent{} if len(record) < ditypes.SizeofBaseEvent { - log.Tracef("malformed event record (length %d)", len(record)) - return nil + return nil, fmt.Errorf("malformed event record (length %d)", len(record)) } baseEvent := *(*ditypes.BaseEvent)(unsafe.Pointer(&record[0])) event.ProbeID = unix.ByteSliceToString(baseEvent.Probe_id[:]) allowed, droppedEvents, successfulEvents := ratelimiters.AllowOneEvent(event.ProbeID) if !allowed { - log.Tracef("event dropped by rate limit. Probe %s\t(%d dropped events out of %d)\n", + return nil, fmt.Errorf("event dropped by rate limit, probe %s (%d dropped events out of %d)", event.ProbeID, droppedEvents, droppedEvents+successfulEvents) - return nil } event.PID = baseEvent.Pid event.UID = baseEvent.Uid event.StackPCs = baseEvent.Program_counters[:] event.Argdata = readParams(record[ditypes.SizeofBaseEvent:]) - return &event -} - -// ParseParams extracts just the parsed parameters from the full event record -func ParseParams(record []byte) ([]*ditypes.Param, error) { - if len(record) < 392 { - return nil, fmt.Errorf("malformed event record (length %d)", len(record)) - } - return readParams(record[392:]), nil + return &event, nil } func readParams(values []byte) []*ditypes.Param { + if len(values) >= 100 { + log.Tracef("DI event bytes (0:100): %v", values[0:100]) + } outputParams := []*ditypes.Param{} - for i := 0; i < MaxBufferSize; { - if i+3 >= len(values) { - break - } + for i := 0; i+3 < len(values); { paramTypeDefinition := parseTypeDefinition(values[i:]) if paramTypeDefinition == nil { break } - sizeOfTypeDefinition := countBufferUsedByTypeDefinition(paramTypeDefinition) i += sizeOfTypeDefinition val, numBytesRead := parseParamValue(paramTypeDefinition, values[i:]) if val == nil { return outputParams } - if reflect.Kind(val.Kind) == reflect.Slice { - // In BPF we read the slice by reading the maximum size of a slice - // that we allow, instead of just the size of the slice (which we - // know at runtime). This is to satisfy the verifier. When parsing - // here, we read just the actual slice content, but have to move the - // buffer index ahead by the amount of space used by the max read. - i += ditypes.SliceMaxSize - } else { - i += numBytesRead - } + i += numBytesRead outputParams = append(outputParams, val) } return outputParams @@ -99,44 +76,49 @@ func readParams(values []byte) []*ditypes.Param { // from the byte buffer. It returns the resulting parameter and an indication of // how many bytes were read from the buffer func parseParamValue(definition *ditypes.Param, buffer []byte) (*ditypes.Param, int) { + var bufferIndex int // Start by creating a stack with each layer of the definition // which will correspond with the layers of the values read from buffer. - // This is done using a temporary stack. + // This is done using a temporary stack to reverse the order. tempStack := newParamStack() definitionStack := newParamStack() tempStack.push(definition) for !tempStack.isEmpty() { current := tempStack.pop() - definitionStack.push(copyParam(current)) - for i := 0; i < len(current.Fields); i++ { - tempStack.push(current.Fields[i]) + copiedParam := copyParam(current) + definitionStack.push(copiedParam) + for n := 0; n < len(current.Fields); n++ { + tempStack.push(current.Fields[n]) } } - var i int + valueStack := newParamStack() - for i = 0; i+3 < len(buffer); { + for bufferIndex <= len(buffer) { paramDefinition := definitionStack.pop() if paramDefinition == nil { break } - if !isTypeWithHeader(paramDefinition.Kind) { - if i+int(paramDefinition.Size) >= len(buffer) { + nextIndex := bufferIndex + int(paramDefinition.Size) + if reflect.Kind(paramDefinition.Kind) == reflect.String { + if nextIndex > len(buffer) { + break + } + paramDefinition.ValueStr = string(buffer[bufferIndex:nextIndex]) + bufferIndex += int(paramDefinition.Size) + valueStack.push(paramDefinition) + } else if !isTypeWithHeader(paramDefinition.Kind) { + if nextIndex > len(buffer) { break } // This is a regular value (no sub-fields). // We parse the value of it from the buffer and push it to the value stack - paramDefinition.ValueStr = parseIndividualValue(paramDefinition.Kind, buffer[i:i+int(paramDefinition.Size)]) - i += int(paramDefinition.Size) + paramDefinition.ValueStr = parseIndividualValue(paramDefinition.Kind, buffer[bufferIndex:nextIndex]) + bufferIndex += int(paramDefinition.Size) valueStack.push(paramDefinition) } else if reflect.Kind(paramDefinition.Kind) == reflect.Pointer { - if i+int(paramDefinition.Size) >= len(buffer) { + if nextIndex > len(buffer) { break } - // Pointers are unique in that they have their own value, and sub-fields. - // We parse the value of it from the buffer, place it in the value for - // the pointer itself, then pop the next value and place it as a sub-field. - paramDefinition.ValueStr = parseIndividualValue(paramDefinition.Kind, buffer[i:i+int(paramDefinition.Size)]) - i += int(paramDefinition.Size) paramDefinition.Fields = append(paramDefinition.Fields, valueStack.pop()) valueStack.push(paramDefinition) } else { @@ -151,7 +133,18 @@ func parseParamValue(definition *ditypes.Param, buffer []byte) (*ditypes.Param, valueStack.push(paramDefinition) } } - return valueStack.pop(), i + return valueStack.pop(), bufferIndex +} + +func deepCopyParam(dst, src *ditypes.Param) { + dst.Type = src.Type + dst.Kind = src.Kind + dst.Size = src.Size + dst.Fields = make([]*ditypes.Param, len(src.Fields)) + for i, field := range src.Fields { + dst.Fields[i] = &ditypes.Param{} + deepCopyParam(dst.Fields[i], field) + } } func copyParam(p *ditypes.Param) *ditypes.Param { @@ -183,15 +176,23 @@ func parseTypeDefinition(b []byte) *ditypes.Param { if len(b) < 3 { return nil } + + kind := b[i] newParam := &ditypes.Param{ - Kind: b[i], - Size: binary.LittleEndian.Uint16(b[i+1 : i+3]), - Type: parseKindToString(b[i]), + Kind: kind, + Size: byteOrder.Uint16(b[i+1 : i+3]), + Type: parseKindToString(kind), } - if newParam.Kind == 0 && newParam.Size == 0 { + if newParam.Kind == 0 { break } i += 3 + if newParam.Size == 0 { + if reflect.Kind(newParam.Kind) == reflect.Struct { + goto stackCheck + } + break + } if isTypeWithHeader(newParam.Kind) { stack.push(newParam) continue @@ -203,12 +204,27 @@ func parseTypeDefinition(b []byte) *ditypes.Param { } top := stack.peek() top.Fields = append(top.Fields, newParam) + + if reflect.Kind(top.Kind) == reflect.Slice { + // top.Size is the length of the slice. + // We copy+append the type of the slice so we have the correct + // number of slice elements to parse values into. + if top.Size == 0 { + top.Fields = []*ditypes.Param{} + } else if top.Size > 1 { + for q := 1; q < int(top.Size); q++ { + sliceElementTypeCopy := &ditypes.Param{} + deepCopyParam(sliceElementTypeCopy, top.Fields[0]) + top.Fields = append(top.Fields, sliceElementTypeCopy) + } + } + } + if len(top.Fields) == int(top.Size) || (reflect.Kind(top.Kind) == reflect.Pointer && len(top.Fields) == 1) { newParam = stack.pop() goto stackCheck } - } return nil } @@ -224,15 +240,23 @@ func countBufferUsedByTypeDefinition(root *ditypes.Param) int { front := queue[0] queue = queue[1:] counter += 3 - queue = append(queue, front.Fields...) + + if reflect.Kind(front.Kind) == reflect.Slice && len(front.Fields) > 0 { + // The fields of slice elements are amended after the fact to account + // for the runtime discovered length. However, only one definition of + // the slice element's type is present in the buffer. + queue = append(queue, front.Fields[0]) + } else { + queue = append(queue, front.Fields...) + } } return counter } func isTypeWithHeader(pieceType byte) bool { return reflect.Kind(pieceType) == reflect.Struct || - reflect.Kind(pieceType) == reflect.Slice || reflect.Kind(pieceType) == reflect.Array || + reflect.Kind(pieceType) == reflect.Slice || reflect.Kind(pieceType) == reflect.Pointer } diff --git a/pkg/dynamicinstrumentation/eventparser/event_parser_test.go b/pkg/dynamicinstrumentation/eventparser/event_parser_test.go index 94496b5cd2d0f..cb20a19cd9ad1 100644 --- a/pkg/dynamicinstrumentation/eventparser/event_parser_test.go +++ b/pkg/dynamicinstrumentation/eventparser/event_parser_test.go @@ -8,11 +8,12 @@ package eventparser import ( - "fmt" "reflect" "testing" "github.com/DataDog/datadog-agent/pkg/dynamicinstrumentation/ditypes" + "github.com/kr/pretty" + "github.com/stretchr/testify/assert" ) func TestCountBufferUsedByTypeDefinition(t *testing.T) { @@ -109,6 +110,28 @@ func TestParseParamValue(t *testing.T) { }, }, }, + { + name: "same sized string", + inputBuffer: []byte{ + 65, 65, 65, + }, + inputDefinition: &ditypes.Param{ + Type: "string", Size: 0x3, Kind: 0x18, + }, + expectedValue: &ditypes.Param{ + ValueStr: "AAA", Type: "string", Size: 0x3, Kind: 0x18, + }, + }, + { + name: "empty string", + inputBuffer: []byte{}, + inputDefinition: &ditypes.Param{ + Type: "string", Size: 0x0, Kind: 0x18, + }, + expectedValue: &ditypes.Param{ + ValueStr: "", Type: "string", Size: 0x0, Kind: 0x18, + }, + }, } for _, tt := range tests { @@ -135,10 +158,6 @@ func TestReadParams(t *testing.T) { 8, 1, 0, // Struct field 1 is a uint8 (size 1) 9, 2, 0, // Struct field 2 is a uint16 (size 2) 8, 1, 0, // Struct field 3 is a uint8 (size 1) - 25, 3, 0, // Slice elements are each a struct with 3 fields - 8, 1, 0, // Struct field 1 is a uint8 (size 1) - 9, 2, 0, // Struct field 2 is a uint16 (size 2) - 8, 1, 0, // Struct field 3 is a uint8 (size 1) 1, 2, 0, 3, // Content of slice element 1 (not relevant for this function) 4, 5, 0, 6, // Content of slice element 2 (not relevant for this function) // Padding @@ -167,11 +186,7 @@ func TestReadParams(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { output := readParams(tt.inputBuffer) - if !reflect.DeepEqual(output, tt.expectedResult) { - fmt.Printf("Got: %v\n", output) - fmt.Printf("Expected: %v\n", tt.expectedResult) - t.Errorf("Didn't read correctly!") - } + assert.Equal(t, output, tt.expectedResult) }) } } @@ -234,13 +249,6 @@ func TestParseTypeDefinition(t *testing.T) { 25, 2, 0, // Struct field 4 is a struct with 2 fields 8, 1, 0, // Nested struct field 1 is a uint8 (size 1) 8, 1, 0, // Nested struct field 2 is a uint8 (size 1) - 25, 4, 0, // Slice elements are each a struct with 2 fields - 8, 1, 0, // Struct field 1 is a uint8 (size 1) - 8, 1, 0, // Struct field 2 is a uint8 (size 1) - 8, 1, 0, // Struct field 3 is a uint8 (size 1) - 25, 2, 0, // Struct field 4 is a struct with 2 fields - 8, 1, 0, // Nested struct field 1 is a uint8 (size 1) - 8, 1, 0, // Nested struct field 2 is a uint8 (size 1) 1, 2, 3, // Content of slice element 1 (top-level uint8, then 2 second tier uint8s) 4, 5, 6, // Content of slice element 2 (top-level uint8, then 2 second tier uint8s) // Padding @@ -288,11 +296,174 @@ func TestParseTypeDefinition(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { typeDefinition := parseTypeDefinition(tt.inputBuffer) - if !reflect.DeepEqual(typeDefinition, tt.expectedResult) { - fmt.Printf("%v\n", typeDefinition) - fmt.Printf("%v\n", tt.expectedResult) - t.Errorf("Not equal!") + if !paramsAreEqual(typeDefinition, tt.expectedResult) { + t.Errorf("params are not equal\nExpected: %s\nReceived: %s\n", pretty.Sprint(tt.expectedResult), pretty.Sprint(typeDefinition)) } }) } } + +func paramsAreEqual(p1, p2 *ditypes.Param) bool { + if p1 == nil && p2 == nil { + return true + } + if p1 == nil || p2 == nil { + return false + } + if p1.ValueStr != p2.ValueStr || p1.Type != p2.Type || p1.Size != p2.Size || p1.Kind != p2.Kind { + return false + } + if len(p1.Fields) != len(p2.Fields) { + return false + } + for i := range p1.Fields { + if !paramsAreEqual(p1.Fields[i], p2.Fields[i]) { + return false + } + } + return true +} + +func TestParseParams(t *testing.T) { + type testCase struct { + Name string + Buffer []byte + ExpectedOutput []*ditypes.Param + } + + testCases := []testCase{ + { + Name: "uint slice ok", + Buffer: []byte{23, 3, 0, 7, 8, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + ExpectedOutput: []*ditypes.Param{ + { + Type: "slice", + Size: 3, + Kind: byte(reflect.Slice), + Fields: []*ditypes.Param{ + { + Kind: byte(reflect.Uint), + ValueStr: "1", + Type: "uint", + Size: 8, + }, + { + Kind: byte(reflect.Uint), + ValueStr: "2", + Type: "uint", + Size: 8, + }, + { + Kind: byte(reflect.Uint), + ValueStr: "3", + Type: "uint", + Size: 8, + }, + }, + }, + }, + }, + { + Name: "uint pointer ok", + Buffer: []byte{22, 8, 0, 7, 8, 0, 123, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + ExpectedOutput: []*ditypes.Param{ + { + Type: "ptr", + Size: 8, + Kind: byte(reflect.Pointer), + Fields: []*ditypes.Param{ + { + Kind: byte(reflect.Uint), + ValueStr: "123", + Type: "uint", + Size: 8, + }, + }, + }, + }, + }, + { + Name: "struct pointer ok", + Buffer: []byte{22, 8, 0, 25, 3, 0, 1, 1, 0, 2, 8, 0, 4, 2, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + ExpectedOutput: []*ditypes.Param{ + { + Type: "ptr", + Size: 8, + Kind: byte(reflect.Pointer), + Fields: []*ditypes.Param{ + { + Type: "struct", + Size: 3, + Kind: byte(reflect.Struct), + Fields: []*ditypes.Param{ + { + Kind: byte(reflect.Bool), + ValueStr: "true", + Type: "bool", + Size: 1, + }, + { + Kind: byte(reflect.Int), + ValueStr: "1", + Type: "int", + Size: 8, + }, + { + Kind: byte(reflect.Int16), + ValueStr: "2", + Type: "int16", + Size: 2, + }, + }, + }, + }, + }, + }, + }, + { + Name: "struct pointer nil", + Buffer: []byte{22, 8, 0, 25, 3, 0, 1, 1, 0, 2, 8, 0, 4, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + ExpectedOutput: []*ditypes.Param{ + { + Type: "ptr", + Size: 8, + Kind: byte(reflect.Pointer), + Fields: []*ditypes.Param{ + { + Type: "struct", + Size: 3, + Kind: byte(reflect.Struct), + Fields: []*ditypes.Param{ + { + Kind: byte(reflect.Bool), + ValueStr: "false", + Type: "bool", + Size: 1, + }, + { + Kind: byte(reflect.Int), + ValueStr: "0", + Type: "int", + Size: 8, + }, + { + Kind: byte(reflect.Int16), + ValueStr: "0", + Type: "int16", + Size: 2, + }, + }, + }, + }, + }, + }, + }, + } + + for i := range testCases { + t.Run(testCases[i].Name, func(t *testing.T) { + result := readParams(testCases[i].Buffer) + assert.Equal(t, testCases[i].ExpectedOutput, result) + }) + } +} diff --git a/pkg/dynamicinstrumentation/eventparser/param_stack.go b/pkg/dynamicinstrumentation/eventparser/param_stack.go index b2359951ca25a..bf2f7c5259cc9 100644 --- a/pkg/dynamicinstrumentation/eventparser/param_stack.go +++ b/pkg/dynamicinstrumentation/eventparser/param_stack.go @@ -21,7 +21,7 @@ func newParamStack() *paramStack { } func (s *paramStack) isEmpty() bool { - return len(s.arr) == 0 + return s == nil || len(s.arr) == 0 } func (s *paramStack) pop() *ditypes.Param { diff --git a/pkg/dynamicinstrumentation/module/module.go b/pkg/dynamicinstrumentation/module/module.go index 27a20ea18b390..7352b8def49e6 100644 --- a/pkg/dynamicinstrumentation/module/module.go +++ b/pkg/dynamicinstrumentation/module/module.go @@ -32,7 +32,8 @@ func NewModule(config *Config) (*Module, error) { //nolint:revive // TODO ProbesFilePath: coreconfig.SystemProbe().GetString("dynamic_instrumentation.probes_file_path"), SnapshotOutput: coreconfig.SystemProbe().GetString("dynamic_instrumentation.snapshot_output_file_path"), DiagnosticOutput: coreconfig.SystemProbe().GetString("dynamic_instrumentation.diagnostics_output_file_path"), - }}) + }, + }) if err != nil { return nil, err } diff --git a/pkg/dynamicinstrumentation/ringbufconsumer.go b/pkg/dynamicinstrumentation/ringbufconsumer.go index efcf578932009..9cadc02da1d15 100644 --- a/pkg/dynamicinstrumentation/ringbufconsumer.go +++ b/pkg/dynamicinstrumentation/ringbufconsumer.go @@ -49,7 +49,11 @@ func (goDI *GoDI) startRingbufferConsumer(rate float64) (func(), error) { continue } - event := eventparser.ParseEvent(record.RawSample, rateLimiters) + event, err := eventparser.ParseEvent(record.RawSample, rateLimiters) + if err != nil { + log.Trace(err) + continue + } if event == nil { continue } diff --git a/pkg/dynamicinstrumentation/testutil/e2e_test.go b/pkg/dynamicinstrumentation/testutil/e2e_test.go index 9783fba6c7ba4..0dc0b7ddcbe07 100644 --- a/pkg/dynamicinstrumentation/testutil/e2e_test.go +++ b/pkg/dynamicinstrumentation/testutil/e2e_test.go @@ -19,6 +19,8 @@ import ( "text/template" "time" + "github.com/kr/pretty" + "github.com/DataDog/datadog-agent/pkg/dynamicinstrumentation" "github.com/DataDog/datadog-agent/pkg/dynamicinstrumentation/diconfig" "github.com/DataDog/datadog-agent/pkg/dynamicinstrumentation/ditypes" @@ -26,11 +28,19 @@ import ( "github.com/cilium/ebpf" "github.com/cilium/ebpf/features" "github.com/cilium/ebpf/rlimit" - "github.com/kr/pretty" "github.com/stretchr/testify/require" ) +type testResult struct { + testName string + matches []bool + expectation ditypes.CapturedValueMap + unexpectedResults []ditypes.CapturedValueMap +} + +var results = make(map[string]*testResult) + func TestGoDI(t *testing.T) { flake.Mark(t) if err := rlimit.RemoveMemlock(); err != nil { @@ -107,9 +117,14 @@ func TestGoDI(t *testing.T) { buf = bytes.NewBuffer(b) functionWithoutPackagePrefix, _ := strings.CutPrefix(function, "github.com/DataDog/datadog-agent/pkg/dynamicinstrumentation/testutil/sample.") t.Log("Instrumenting ", functionWithoutPackagePrefix) + results[function] = &testResult{ + testName: functionWithoutPackagePrefix, + expectation: expectedCaptureValue, + matches: []bool{}, + unexpectedResults: []ditypes.CapturedValueMap{}, + } err = cfgTemplate.Execute(buf, configDataType{functionWithoutPackagePrefix}) require.NoError(t, err) - eventOutputWriter.doCompare = false eventOutputWriter.expectedResult = expectedCaptureValue // Read the configuration via the config manager @@ -122,11 +137,22 @@ func TestGoDI(t *testing.T) { time.Sleep(time.Second * 2) doCapture = false } + + for i := range results { + for _, ok := range results[i].matches { + if !ok { + t.Errorf("Failed test for: %s\nReceived event: %v\nExpected: %v", + results[i].testName, + pretty.Sprint(results[i].unexpectedResults), + pretty.Sprint(results[i].expectation)) + break + } + } + } } type eventOutputTestWriter struct { t *testing.T - doCompare bool expectedResult map[string]*ditypes.CapturedValue } @@ -141,12 +167,20 @@ func (e *eventOutputTestWriter) Write(p []byte) (n int, err error) { e.t.Error("failed to unmarshal snapshot", err) } - funcName := snapshot.Debugger.ProbeInSnapshot.Type + "." + snapshot.Debugger.ProbeInSnapshot.Method + funcName := snapshot.Debugger.ProbeInSnapshot.Method actual := snapshot.Debugger.Captures.Entry.Arguments scrubPointerValues(actual) + b, ok := results[funcName] + if !ok { + e.t.Errorf("received event from unexpected probe: %s", funcName) + return + } if !reflect.DeepEqual(e.expectedResult, actual) { - e.t.Error("Unexpected ", funcName, pretty.Sprint(actual)) - e.t.Log("Expected: ", pretty.Sprint(e.expectedResult)) + b.matches = append(b.matches, false) + b.unexpectedResults = append(b.unexpectedResults, actual) + e.t.Error("received unexpected value") + } else { + b.matches = append(b.matches, true) } return len(p), nil @@ -197,7 +231,7 @@ var configTemplateText = ` ], "captureSnapshot": false, "capture": { - "maxReferenceDepth": 6 + "maxReferenceDepth": 5 }, "sampling": { "snapshotsPerSecond": 5000 diff --git a/pkg/dynamicinstrumentation/testutil/fixtures.go b/pkg/dynamicinstrumentation/testutil/fixtures.go index fd8fbbc50243e..ae12846d40309 100644 --- a/pkg/dynamicinstrumentation/testutil/fixtures.go +++ b/pkg/dynamicinstrumentation/testutil/fixtures.go @@ -94,37 +94,37 @@ var stringCaptures = fixtures{ var arrayCaptures = fixtures{ "github.com/DataDog/datadog-agent/pkg/dynamicinstrumentation/testutil/sample.test_byte_array": {"x": {Type: "array", Fields: fieldMap{ - "[2]uint8[0]": capturedValue("uint8", "1"), - "[2]uint8[1]": capturedValue("uint8", "1"), + "arg_0": capturedValue("uint8", "1"), + "arg_1": capturedValue("uint8", "1"), }}}, "github.com/DataDog/datadog-agent/pkg/dynamicinstrumentation/testutil/sample.test_rune_array": {"x": {Type: "array", Fields: fieldMap{ - "[2]int32[0]": capturedValue("int32", "1"), - "[2]int32[1]": capturedValue("int32", "2"), + "arg_0": capturedValue("int32", "1"), + "arg_1": capturedValue("int32", "2"), }}}, "github.com/DataDog/datadog-agent/pkg/dynamicinstrumentation/testutil/sample.test_string_array": {"x": {Type: "array", Fields: fieldMap{ - "[2]string[0]": capturedValue("string", "one"), - "[2]string[1]": capturedValue("string", "two"), + "arg_0": capturedValue("string", "one"), + "arg_1": capturedValue("string", "two"), }}}, "github.com/DataDog/datadog-agent/pkg/dynamicinstrumentation/testutil/sample.test_int_array": {"x": {Type: "array", Fields: fieldMap{ - "[2]int[0]": capturedValue("int", "1"), - "[2]int[1]": capturedValue("int", "2"), + "arg_0": capturedValue("int", "1"), + "arg_1": capturedValue("int", "2"), }}}, "github.com/DataDog/datadog-agent/pkg/dynamicinstrumentation/testutil/sample.test_int8_array": {"x": {Type: "array", Fields: fieldMap{ - "[2]int8[0]": capturedValue("int8", "1"), - "[2]int8[1]": capturedValue("int8", "2"), + "arg_0": capturedValue("int8", "1"), + "arg_1": capturedValue("int8", "2"), }}}, "github.com/DataDog/datadog-agent/pkg/dynamicinstrumentation/testutil/sample.test_uint_array": {"x": {Type: "array", Fields: fieldMap{ - "[2]uint[0]": capturedValue("uint", "1"), - "[2]uint[1]": capturedValue("uint", "2"), + "arg_0": capturedValue("uint", "1"), + "arg_1": capturedValue("uint", "2"), }}}, - "github.com/DataDog/datadog-agent/pkg/dynamicinstrumentation/testutil/sample.test_array_of_arrays": {"a": {Type: "array", Fields: fieldMap{ - "[2][2]int[0]": {Type: "array", Fields: fieldMap{ - "[2]int[0]": capturedValue("int", "1"), - "[2]int[1]": capturedValue("int", "2"), + "github.com/DataDog/datadog-agent/pkg/dynamicinstrumentation/testutil/sample.test_array_of_arrays": {"arg_0": {Type: "array", Fields: fieldMap{ + "arg_0": {Type: "array", Fields: fieldMap{ + "arg_0": capturedValue("int", "1"), + "arg_1": capturedValue("int", "2"), }}, - "[2][2]int[1]": {Type: "array", Fields: fieldMap{ - "[2]int[0]": capturedValue("int", "3"), - "[2]int[1]": capturedValue("int", "4"), + "arg_1": {Type: "array", Fields: fieldMap{ + "arg_0": capturedValue("int", "3"), + "arg_1": capturedValue("int", "4"), }}, }}}, "github.com/DataDog/datadog-agent/pkg/dynamicinstrumentation/testutil/sample.test_array_of_structs": {"a": {Type: "array", Fields: fieldMap{ @@ -163,14 +163,14 @@ var arrayCaptures = fixtures{ var structCaptures = fixtures{ "github.com/DataDog/datadog-agent/pkg/dynamicinstrumentation/testutil/sample.test_string_struct": {"t": {Type: "struct", Fields: fieldMap{ - "a": capturedValue("string", "a"), - "b": capturedValue("string", "bb"), - "c": capturedValue("string", "ccc"), + "arg_0": capturedValue("string", "a"), + "arg_1": capturedValue("string", "bb"), + "arg_2": capturedValue("string", "ccc"), }}}, "github.com/DataDog/datadog-agent/pkg/dynamicinstrumentation/testutil/sample.receiver.test_method_receiver": { "r": { Type: "struct", Fields: fieldMap{ - "u": capturedValue("uint", "1"), + "arg_0": capturedValue("uint", "1"), }}, "a": capturedValue("int", "2"), }, @@ -211,16 +211,16 @@ var structCaptures = fixtures{ // "z": capturedValue("CutFieldLimit", "reached field limit"), // }}}, "github.com/DataDog/datadog-agent/pkg/dynamicinstrumentation/testutil/sample.test_nonembedded_struct": {"x": {Type: "struct", Fields: fieldMap{ - "aBool": capturedValue("bool", "true"), - "aInt": capturedValue("int", "1"), - "aInt16": capturedValue("int16", "2"), + "arg_0": capturedValue("bool", "true"), + "arg_1": capturedValue("int", "1"), + "arg_2": capturedValue("int16", "2"), }}}, "github.com/DataDog/datadog-agent/pkg/dynamicinstrumentation/testutil/sample.test_struct_pointer": {"x": {Type: "ptr", Fields: fieldMap{ "arg_0": { Type: "struct", Fields: fieldMap{ - "aBool": capturedValue("bool", "true"), - "aInt": capturedValue("int", "1"), - "aInt16": capturedValue("int16", "2"), + "arg_0": capturedValue("bool", "true"), + "arg_1": capturedValue("int", "1"), + "arg_2": capturedValue("int16", "2"), }}, }}}, "github.com/DataDog/datadog-agent/pkg/dynamicinstrumentation/testutil/sample.test_multiple_embedded_struct": {"b": {Type: "struct", Fields: fieldMap{ diff --git a/pkg/dynamicinstrumentation/testutil/sample/complex.go b/pkg/dynamicinstrumentation/testutil/sample/complex.go new file mode 100644 index 0000000000000..bf481a19930b2 --- /dev/null +++ b/pkg/dynamicinstrumentation/testutil/sample/complex.go @@ -0,0 +1,71 @@ +// 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 sample + +import "io" + +type outer struct { + A *middle +} + +type middle struct { + B *inner +} + +type inner struct { + C int + D byte + E string +} + +//nolint:all +//go:noinline +func test_multiple_dereferences(o outer) {} + +type bigStruct struct { + x []*string + z int + writer io.Writer +} + +//nolint:all +//go:noinline +func test_big_struct(b bigStruct) {} + +type circularReferenceType struct { + t *circularReferenceType +} + +//nolint:all +//go:noinline +func test_circular_type(x circularReferenceType) {} + +//nolint:all +func ExecuteComplexFuncs() { + o := outer{ + A: &middle{ + B: &inner{ + C: 1, + D: 2, + E: "three", + }, + }, + } + + str := "abc" + s := []*string{&str} + + test_big_struct(bigStruct{ + x: s, + z: 5, + writer: io.Discard, + }) + test_multiple_dereferences(o) + + circ := circularReferenceType{} + circ.t = &circ + test_circular_type(circ) +} diff --git a/pkg/dynamicinstrumentation/testutil/sample/pointers.go b/pkg/dynamicinstrumentation/testutil/sample/pointers.go index 3a01d3f422b93..fe037afdac862 100644 --- a/pkg/dynamicinstrumentation/testutil/sample/pointers.go +++ b/pkg/dynamicinstrumentation/testutil/sample/pointers.go @@ -7,6 +7,11 @@ package sample import "unsafe" +type structWithTwoValues struct { + a uint + b bool +} + type structWithPointer struct { a *uint64 } @@ -28,6 +33,10 @@ type reallyComplexType struct { aStringPtr *string } +//nolint:all +//go:noinline +func test_pointer_to_simple_struct(a *structWithTwoValues) {} + //nolint:all //go:noinline func test_linked_list(a node) {} @@ -41,6 +50,10 @@ type node struct { //go:noinline func test_unsafe_pointer(x unsafe.Pointer) {} +//nolint:all +//go:noinline +func test_array_pointer(x *[2]uint) {} + //nolint:all //go:noinline func test_uint_pointer(x *uint) {} @@ -69,6 +82,10 @@ func test_struct_with_string_pointer(z spws) {} //go:noinline func test_string_pointer(z *string) {} +//nolint:all +//go:noinline +func test_string_slice_pointer(a *[]string) {} + //nolint:all func ExecutePointerFuncs() { var u64F uint64 = 5 @@ -78,7 +95,7 @@ func ExecutePointerFuncs() { r := "abc" z := spws{3, &r} - var uintToPointTo uint = 123 + var uintToPointTo uint = 1 test_uint_pointer(&uintToPointTo) n := nStruct{true, 1, 2} @@ -92,6 +109,9 @@ func ExecutePointerFuncs() { test_struct_with_string_pointer(z) test_string_pointer(&r) + x := structWithTwoValues{9, true} + test_pointer_to_simple_struct(&x) + rct := reallyComplexType{ pointerToStructWithAPointerToAStruct: &ssaw, anArray: [1]nStruct{n}, @@ -103,11 +123,20 @@ func ExecutePointerFuncs() { b := node{ val: 1, b: &node{ - val: 2, - b: nil, + val: 5, + b: &node{ + val: 3, + b: nil, + }, }, } test_linked_list(b) test_unsafe_pointer(unsafe.Pointer(&b)) + + aruint := [2]uint{1, 2} + test_array_pointer(&aruint) + + stringSlice := []string{"aaa", "bbb", "ccc", "ddd"} + test_string_slice_pointer(&stringSlice) } diff --git a/pkg/dynamicinstrumentation/testutil/sample/sample_service/sample_service.go b/pkg/dynamicinstrumentation/testutil/sample/sample_service/sample_service.go index c7a1faa665372..4192672d8a965 100644 --- a/pkg/dynamicinstrumentation/testutil/sample/sample_service/sample_service.go +++ b/pkg/dynamicinstrumentation/testutil/sample/sample_service/sample_service.go @@ -44,6 +44,7 @@ func main() { sample.ExecuteStructFuncs() sample.ExecuteStackAndInlining() sample.ExecutePointerFuncs() + sample.ExecuteComplexFuncs() // unsupported for MVP, should not cause crashes sample.ExecuteGenericFuncs() diff --git a/pkg/dynamicinstrumentation/testutil/sample/slices.go b/pkg/dynamicinstrumentation/testutil/sample/slices.go index f31b479984f1e..c4fd70551a864 100644 --- a/pkg/dynamicinstrumentation/testutil/sample/slices.go +++ b/pkg/dynamicinstrumentation/testutil/sample/slices.go @@ -28,16 +28,36 @@ func expandSlice(x []int) { //go:noinline func test_uint_slice(u []uint) {} +//nolint:all +//go:noinline +func test_empty_slice(u []uint) {} + +//nolint:all +//go:noinline +func test_slice_of_slices(u [][]uint) {} + //nolint:all //go:noinline func test_struct_slice(xs []structWithNoStrings) {} +//nolint:all +//go:noinline +func test_string_slice(s []string) {} + //nolint:all func ExecuteSliceFuncs() { originalSlice := []int{1, 2, 3} expandSlice(originalSlice) sprintSlice(originalSlice) + test_string_slice([]string{"abc", "xyz", "123"}) test_uint_slice([]uint{1, 2, 3}) test_struct_slice([]structWithNoStrings{{42, true}, {24, true}}) + + test_slice_of_slices([][]uint{ + {4}, + {5, 6}, + {7, 8, 9}, + }) + test_empty_slice([]uint{}) } diff --git a/pkg/dynamicinstrumentation/testutil/sample/strings.go b/pkg/dynamicinstrumentation/testutil/sample/strings.go index 0eb3564e6e5c5..d9791cd80427e 100644 --- a/pkg/dynamicinstrumentation/testutil/sample/strings.go +++ b/pkg/dynamicinstrumentation/testutil/sample/strings.go @@ -9,7 +9,12 @@ package sample //go:noinline func test_single_string(x string) {} +//nolint:all +//go:noinline +func test_three_strings(x, y, z string) {} + //nolint:all func ExecuteStringFuncs() { test_single_string("abc") + test_three_strings("abc", "def", "ghi") } diff --git a/pkg/dynamicinstrumentation/testutil/sample/structs.go b/pkg/dynamicinstrumentation/testutil/sample/structs.go index ff57ffba8d1c3..1befe97aa8930 100644 --- a/pkg/dynamicinstrumentation/testutil/sample/structs.go +++ b/pkg/dynamicinstrumentation/testutil/sample/structs.go @@ -25,6 +25,14 @@ func test_struct_with_array(a structWithAnArray) {} //go:noinline func test_struct_with_a_slice(s structWithASlice) {} +//nolint:all +//go:noinline +func test_pointer_to_struct_with_a_slice(s *structWithASlice) {} + +//nolint:all +//go:noinline +func test_pointer_to_struct_with_a_string(s *structWithAString) {} + //nolint:all //go:noinline func test_struct(x aStruct) {} @@ -91,7 +99,9 @@ func ExecuteStructFuncs() { test_ten_strings(tenStrings{}) test_struct_and_byte('a', s) test_struct_with_array(structWithAnArray{[5]uint8{1, 2, 3, 4, 5}}) - test_struct_with_a_slice(structWithASlice{[]uint8{1, 2, 3}}) + test_struct_with_a_slice(structWithASlice{1, []uint8{2, 3, 4}}) + test_pointer_to_struct_with_a_slice(&structWithASlice{5, []uint8{2, 3, 4}}) + test_pointer_to_struct_with_a_string(&structWithAString{5, "abcdef"}) tenStr := tenStrings{ first: "one", @@ -202,9 +212,15 @@ type structWithAnArray struct { } type structWithASlice struct { + x int slice []uint8 } +type structWithAString struct { + x int + s string +} + type nestedStruct struct { anotherInt int anotherString string diff --git a/pkg/dynamicinstrumentation/uploader/di_log_converter.go b/pkg/dynamicinstrumentation/uploader/di_log_converter.go index e42ca051819be..7abdfa76b4f4e 100644 --- a/pkg/dynamicinstrumentation/uploader/di_log_converter.go +++ b/pkg/dynamicinstrumentation/uploader/di_log_converter.go @@ -79,7 +79,7 @@ func convertProbe(probe *ditypes.Probe) ditypes.ProbeInSnapshot { } } -func convertCaptures(defs []ditypes.Parameter, captures []*ditypes.Param) ditypes.Captures { +func convertCaptures(defs []*ditypes.Parameter, captures []*ditypes.Param) ditypes.Captures { return ditypes.Captures{ Entry: &ditypes.Capture{ Arguments: convertArgs(defs, captures), @@ -87,8 +87,8 @@ func convertCaptures(defs []ditypes.Parameter, captures []*ditypes.Param) ditype } } -func reportCaptureError(defs []ditypes.Parameter) ditypes.Captures { - notCapturedReason := "Failed to instrument, type is unsupported or too complex. Please report this issue." +func reportCaptureError(defs []*ditypes.Parameter) ditypes.Captures { + notCapturedReason := "type unsupported" args := make(map[string]*ditypes.CapturedValue) for _, def := range defs { @@ -104,23 +104,21 @@ func reportCaptureError(defs []ditypes.Parameter) ditypes.Captures { } } -func convertArgs(defs []ditypes.Parameter, captures []*ditypes.Param) map[string]*ditypes.CapturedValue { +func convertArgs(defs []*ditypes.Parameter, captures []*ditypes.Param) map[string]*ditypes.CapturedValue { args := make(map[string]*ditypes.CapturedValue) for idx, capture := range captures { var ( - argName string - captureDef *ditypes.Parameter - defPieces []ditypes.Parameter + argName string + defPieces []*ditypes.Parameter ) if idx < len(defs) { argName = defs[idx].Name - captureDef = &defs[idx] } if argName == "" { argName = fmt.Sprintf("arg_%d", idx) } if reflect.Kind(capture.Kind) == reflect.Slice { - args[argName] = convertSlice(captureDef, capture) + args[argName] = convertSlice(capture) continue } if capture == nil { @@ -143,15 +141,29 @@ func convertArgs(defs []ditypes.Parameter, captures []*ditypes.Param) map[string return args } -func convertSlice(def *ditypes.Parameter, capture *ditypes.Param) *ditypes.CapturedValue { - if def == nil || len(def.ParameterPieces) != 2 { - // The definition should have two fields, for type, and for length - return nil +func convertSlice(capture *ditypes.Param) *ditypes.CapturedValue { + defs := []*ditypes.Parameter{} + for i := range capture.Fields { + var ( + fieldType string + fieldKind uint + fieldSize int64 + ) + if capture.Fields[i] != nil { + fieldType = capture.Fields[i].Type + fieldKind = uint(capture.Fields[i].Kind) + fieldSize = int64(capture.Fields[i].Size) + } + defs = append(defs, &ditypes.Parameter{ + Name: fmt.Sprintf("[%d]%s", i, fieldType), + Type: fieldType, + Kind: fieldKind, + TotalSize: fieldSize, + }) } sliceValue := &ditypes.CapturedValue{ - Fields: map[string]*ditypes.CapturedValue{}, + Fields: convertArgs(defs, capture.Fields), } - sliceValue.Fields = convertArgs(def.ParameterPieces, capture.Fields) return sliceValue } @@ -163,7 +175,7 @@ func parseFuncName(funcName string) (string, string) { return "", funcName } -func getFunctionArguments(proc *ditypes.ProcessInfo, probe *ditypes.Probe) []ditypes.Parameter { +func getFunctionArguments(proc *ditypes.ProcessInfo, probe *ditypes.Probe) []*ditypes.Parameter { return proc.TypeMap.Functions[probe.FuncName] } diff --git a/pkg/dynamicinstrumentation/uploader/stack_trace.go b/pkg/dynamicinstrumentation/uploader/stack_trace.go index f428e2c40e0d2..d01edeae2da6c 100644 --- a/pkg/dynamicinstrumentation/uploader/stack_trace.go +++ b/pkg/dynamicinstrumentation/uploader/stack_trace.go @@ -30,23 +30,6 @@ func parseStackTrace(procInfo *ditypes.ProcessInfo, rawProgramCounters []uint64) break } - entries, ok := procInfo.TypeMap.InlinedFunctions[rawProgramCounters[i]] - if ok { - for n := range entries { - inlinedFuncInfo, err := pcToLine(procInfo, rawProgramCounters[i]) - if err != nil { - return stackTrace, fmt.Errorf("could not resolve pc to inlined function info: %w", err) - } - - symName, lineNumber, err := parseInlinedEntry(procInfo.DwarfData.Reader(), entries[n]) - if err != nil { - return stackTrace, fmt.Errorf("could not get inlined entries: %w", err) - } - stackFrame := ditypes.StackFrame{Function: fmt.Sprintf("%s [inlined in %s]", symName, inlinedFuncInfo.fn), FileName: inlinedFuncInfo.file, Line: int(lineNumber)} - stackTrace = append(stackTrace, stackFrame) - } - } - funcInfo, err := pcToLine(procInfo, rawProgramCounters[i]) if err != nil { return stackTrace, fmt.Errorf("could not resolve pc to function info: %w", err) @@ -114,6 +97,9 @@ func pcToLine(procInfo *ditypes.ProcessInfo, pc uint64) (*funcInfo, error) { return nil, fmt.Errorf("invalid file number in dwarf function entry associated with compile unit") } + if int(fileNumber) >= len(files) || files[fileNumber] == nil { + return nil, fmt.Errorf("could not find file") + } file = files[fileNumber].Name return &funcInfo{ @@ -122,30 +108,3 @@ func pcToLine(procInfo *ditypes.ProcessInfo, pc uint64) (*funcInfo, error) { fn: fn, }, nil } - -func parseInlinedEntry(reader *dwarf.Reader, e *dwarf.Entry) (name string, line int64, err error) { - - var offset dwarf.Offset - - for i := range e.Field { - if e.Field[i].Attr == dwarf.AttrAbstractOrigin { - offset = e.Field[i].Val.(dwarf.Offset) - reader.Seek(offset) - entry, err := reader.Next() - if err != nil { - return "", -1, fmt.Errorf("could not read inlined function origin: %w", err) - } - for j := range entry.Field { - if entry.Field[j].Attr == dwarf.AttrName { - name = entry.Field[j].Val.(string) - } - } - } - - if e.Field[i].Attr == dwarf.AttrCallLine { - line = e.Field[i].Val.(int64) - } - } - - return name, line, nil -} diff --git a/pkg/dynamicinstrumentation/uploader/writer.go b/pkg/dynamicinstrumentation/uploader/writer.go index 7708c6166f4cb..3f31e4e2a6f75 100644 --- a/pkg/dynamicinstrumentation/uploader/writer.go +++ b/pkg/dynamicinstrumentation/uploader/writer.go @@ -67,7 +67,7 @@ func (s *WriterSerializer[T]) Enqueue(item *T) error { //nolint:revive // TODO if err != nil { return fmt.Errorf("Failed to marshal item %v", item) } - + bs = append(bs, '\n') _, err = s.output.Write(bs) if err != nil { return err diff --git a/pkg/ebpf/c/map-defs.h b/pkg/ebpf/c/map-defs.h index c55e84f2c00e9..8df57cb7a3147 100644 --- a/pkg/ebpf/c/map-defs.h +++ b/pkg/ebpf/c/map-defs.h @@ -3,50 +3,56 @@ #include "bpf_helpers.h" -#define BPF_MAP(_name, _type, _key_type, _value_type, _max_entries, _pin, _map_flags) \ - struct { \ - __uint(type, _type); \ - __uint(max_entries, _max_entries); \ - __uint(pinning, _pin); \ - __type(key, _key_type); \ - __type(value, _value_type); \ - __uint(map_flags, _map_flags); \ +#define BPF_MAP(_name, _type, _key_type, _value_type, _max_entries, _pin, _map_flags, _key_exclude) \ + struct { \ + __uint(type, _type); \ + __uint(max_entries, _max_entries); \ + __uint(pinning, _pin); \ + _key_exclude(__type(key, _key_type)); \ + __type(value, _value_type); \ + __uint(map_flags, _map_flags); \ } _name SEC(".maps"); +#define EXCLUDE_KEY_TYPE(x) +#define INCLUDE_KEY_TYPE(x) x + #define BPF_PERF_EVENT_ARRAY_MAP_PINNED(name, value_type, max_entries) \ - BPF_MAP(name, BPF_MAP_TYPE_PERF_EVENT_ARRAY, u32, value_type, max_entries, 1, 0) + BPF_MAP(name, BPF_MAP_TYPE_PERF_EVENT_ARRAY, u32, value_type, max_entries, 1, 0, INCLUDE_KEY_TYPE) #define BPF_PERF_EVENT_ARRAY_MAP(name, value_type) \ - BPF_MAP(name, BPF_MAP_TYPE_PERF_EVENT_ARRAY, u32, value_type, 0, 0, 0) + BPF_MAP(name, BPF_MAP_TYPE_PERF_EVENT_ARRAY, u32, value_type, 0, 0, 0, INCLUDE_KEY_TYPE) #define BPF_RINGBUF_MAP(name, value_type) \ - BPF_MAP(name, BPF_MAP_TYPE_RINGBUF, u32, value_type, 0, 0, 0) + BPF_MAP(name, BPF_MAP_TYPE_RINGBUF, u32, value_type, 0, 0, 0, INCLUDE_KEY_TYPE) #define BPF_ARRAY_MAP(name, value_type, max_entries) \ - BPF_MAP(name, BPF_MAP_TYPE_ARRAY, u32, value_type, max_entries, 0, 0) + BPF_MAP(name, BPF_MAP_TYPE_ARRAY, u32, value_type, max_entries, 0, 0, INCLUDE_KEY_TYPE) #define BPF_HASH_MAP_PINNED(name, key_type, value_type, max_entries) \ - BPF_MAP(name, BPF_MAP_TYPE_HASH, key_type, value_type, max_entries, 1, 0) + BPF_MAP(name, BPF_MAP_TYPE_HASH, key_type, value_type, max_entries, 1, 0, INCLUDE_KEY_TYPE) #define BPF_HASH_MAP(name, key_type, value_type, max_entries) \ - BPF_MAP(name, BPF_MAP_TYPE_HASH, key_type, value_type, max_entries, 0, 0) + BPF_MAP(name, BPF_MAP_TYPE_HASH, key_type, value_type, max_entries, 0, 0, INCLUDE_KEY_TYPE) #define BPF_PROG_ARRAY(name, max_entries) \ - BPF_MAP(name, BPF_MAP_TYPE_PROG_ARRAY, u32, u32, max_entries, 0, 0) + BPF_MAP(name, BPF_MAP_TYPE_PROG_ARRAY, u32, u32, max_entries, 0, 0, INCLUDE_KEY_TYPE) #define BPF_LRU_MAP(name, key_type, value_type, max_entries) \ - BPF_MAP(name, BPF_MAP_TYPE_LRU_HASH, key_type, value_type, max_entries, 0, 0) + BPF_MAP(name, BPF_MAP_TYPE_LRU_HASH, key_type, value_type, max_entries, 0, 0, INCLUDE_KEY_TYPE) #define BPF_LRU_MAP_PINNED(name, key_type, value_type, max_entries) \ - BPF_MAP(name, BPF_MAP_TYPE_LRU_HASH, key_type, value_type, max_entries, 1, 0) + BPF_MAP(name, BPF_MAP_TYPE_LRU_HASH, key_type, value_type, max_entries, 1, 0, INCLUDE_KEY_TYPE) #define BPF_LRU_MAP_FLAGS(name, key_type, value_type, max_entries, map_flags) \ - BPF_MAP(name, BPF_MAP_TYPE_LRU_HASH, key_type, value_type, max_entries, 0, map_flags) + BPF_MAP(name, BPF_MAP_TYPE_LRU_HASH, key_type, value_type, max_entries, 0, map_flags, INCLUDE_KEY_TYPE) #define BPF_PERCPU_HASH_MAP(name, key_type, value_type, max_entries) \ - BPF_MAP(name, BPF_MAP_TYPE_PERCPU_HASH, key_type, value_type, max_entries, 0, 0) + BPF_MAP(name, BPF_MAP_TYPE_PERCPU_HASH, key_type, value_type, max_entries, 0, 0, INCLUDE_KEY_TYPE) #define BPF_PERCPU_ARRAY_MAP(name, value_type, max_entries) \ - BPF_MAP(name, BPF_MAP_TYPE_PERCPU_ARRAY, u32, value_type, max_entries, 0, 0) + BPF_MAP(name, BPF_MAP_TYPE_PERCPU_ARRAY, u32, value_type, max_entries, 0, 0, INCLUDE_KEY_TYPE) + +#define BPF_STACK_MAP(name, value_type, max_entries) \ + BPF_MAP(name, BPF_MAP_TYPE_STACK, 0, value_type, max_entries, 0, 0, EXCLUDE_KEY_TYPE) #endif diff --git a/pkg/ebpf/debug_handlers.go b/pkg/ebpf/debug_handlers.go index ea10d22a844c2..04cba9faed556 100644 --- a/pkg/ebpf/debug_handlers.go +++ b/pkg/ebpf/debug_handlers.go @@ -6,10 +6,9 @@ package ebpf import ( + "fmt" "io" "net/http" - - "github.com/DataDog/datadog-agent/pkg/util/log" ) // HandleBTFLoaderInfo responds with where the system-probe found BTF data (and @@ -17,7 +16,7 @@ import ( func HandleBTFLoaderInfo(w http.ResponseWriter, _ *http.Request) { info, err := GetBTFLoaderInfo() if err != nil { - log.Errorf("unable to get ebpf_btf_loader info: %s", err) + fmt.Fprintf(w, "unable to get ebpf_btf_loader info: %s", err) w.WriteHeader(500) return } diff --git a/pkg/ebpf/ebpftest/fail_log.go b/pkg/ebpf/ebpftest/fail_log.go index ccc8df5e112b4..15c98ef098188 100644 --- a/pkg/ebpf/ebpftest/fail_log.go +++ b/pkg/ebpf/ebpftest/fail_log.go @@ -10,6 +10,7 @@ import ( "strings" "testing" + //nolint:depguard // creating a custom logger for testing "github.com/cihub/seelog" "github.com/DataDog/datadog-agent/pkg/util/log" @@ -21,7 +22,7 @@ func FailLogLevel(t testing.TB, level string) { inner := &failureTestLogger{TB: t} t.Cleanup(func() { t.Helper() - log.SetupLogger(seelog.Default, "off") + log.SetupLogger(log.Default(), "off") inner.outputIfFailed() }) logger, err := seelog.LoggerFromCustomReceiver(inner) diff --git a/pkg/ebpf/ebpftest/log.go b/pkg/ebpf/ebpftest/log.go index a13f7e14d9d34..06b1fb11fb707 100644 --- a/pkg/ebpf/ebpftest/log.go +++ b/pkg/ebpf/ebpftest/log.go @@ -9,6 +9,7 @@ import ( "strings" "testing" + //nolint:depguard // creating a custom logger for testing "github.com/cihub/seelog" "github.com/DataDog/datadog-agent/pkg/util/log" @@ -17,7 +18,7 @@ import ( // LogLevel sets the logger level for this test only func LogLevel(t testing.TB, level string) { t.Cleanup(func() { - log.SetupLogger(seelog.Default, "off") + log.SetupLogger(log.Default(), "off") }) logger, err := seelog.LoggerFromCustomReceiver(testLogger{t}) if err != nil { diff --git a/pkg/ebpf/helper_call_patcher.go b/pkg/ebpf/helper_call_patcher.go index b274d752270a9..380bbab529aeb 100644 --- a/pkg/ebpf/helper_call_patcher.go +++ b/pkg/ebpf/helper_call_patcher.go @@ -40,7 +40,7 @@ var replaceIns = asm.Mov.Imm(asm.R0, 0) // conditionally select eBPF helpers. This should be regarded as a last resort // when the aforementioned options don't apply (prebuilt artifacts, for // example). -func NewHelperCallRemover(helpers ...asm.BuiltinFunc) Modifier { +func NewHelperCallRemover(helpers ...asm.BuiltinFunc) ModifierBeforeInit { return &helperCallRemover{ helpers: helpers, } @@ -81,10 +81,6 @@ func (h *helperCallRemover) BeforeInit(m *manager.Manager, _ names.ModuleName, _ return nil } -func (h *helperCallRemover) AfterInit(*manager.Manager, names.ModuleName, *manager.Options) error { - return nil -} - func (h *helperCallRemover) String() string { return fmt.Sprintf("HelperCallRemover[%+v]", h.helpers) } diff --git a/pkg/ebpf/manager.go b/pkg/ebpf/manager.go index 06e790609a9ec..0cf37a7e1891a 100644 --- a/pkg/ebpf/manager.go +++ b/pkg/ebpf/manager.go @@ -8,6 +8,7 @@ package ebpf import ( + "errors" "fmt" "io" "sync" @@ -51,27 +52,76 @@ func NewManagerWithDefault(mgr *manager.Manager, name string, modifiers ...Modif return NewManager(mgr, name, append(defaultModifiers, modifiers...)...) } -// Modifier is an interface that can be implemented by a package to -// add functionality to the ebpf.Manager. It exposes a name to identify the modifier, -// two functions that will be called before and after the ebpf.Manager.InitWithOptions -// call, and a function that will be called when the manager is stopped. -// Note regarding internal state of the modifier: if the modifier is added to the list of modifiers -// enabled by default (pkg/ebpf/ebpf.go:registerDefaultModifiers), all managers with those default modifiers -// will share the same instance of the modifier. On the other hand, if the modifier is added to a specific -// manager, it can have its own instance of the modifier, unless the caller explicitly uses the same modifier -// instance with different managers. In other words, if the modifier is to have any internal state specific to -// each manager, it should not be added to the list of default modifiers, and developers using it -// should be aware of this behavior. +// Modifier is an interface that can be implemented by a package to add +// functionality to the ebpf.Manager. It exposes a name to identify the +// modifier, and then any of the functions Before/AfterInit, Before/AfterStart, +// Before/AfterStop, that will be called at the corresponding stage of the +// manager lifecycle. To avoid code churn and implementing unnecessary +// functions, the Modifier interface is split into sub-interfaces, each with a +// single function. This way, the developer can implement only the functions +// they need, and the manager will call them at the right time. Note regarding +// internal state of the modifier: if the modifier is added to the list of +// modifiers enabled by default (see NewManagerWithDefault above), all managers +// with those default modifiers will share the same instance of the modifier. On +// the other hand, if the modifier is added to a specific manager, it can have +// its own instance of the modifier, unless the caller explicitly uses the same +// modifier instance with different managers. In other words, if the modifier is +// to have any internal state specific to each manager, it should not be added +// to the list of default modifiers, and developers using it should be aware of +// this behavior. type Modifier interface { fmt.Stringer +} + +// ModifierBeforeInit is a sub-interface of Modifier that exposes a BeforeInit method +type ModifierBeforeInit interface { + Modifier + // BeforeInit is called before the ebpf.Manager.InitWithOptions call - // names.ModuleName refers to the name associated with Manager instance. + // names.ModuleName refers to the name associated with Manager instance. An + // error returned from this function will stop the initialization process. BeforeInit(*manager.Manager, names.ModuleName, *manager.Options) error +} + +// ModifierAfterInit is a sub-interface of Modifier that exposes an AfterInit method +type ModifierAfterInit interface { + Modifier // AfterInit is called after the ebpf.Manager.InitWithOptions call AfterInit(*manager.Manager, names.ModuleName, *manager.Options) error } +// ModifierBeforeStop is a sub-interface of Modifier that exposes a BeforeStop method +type ModifierBeforeStop interface { + Modifier + + // BeforeStop is called before the ebpf.Manager.Stop call. An error returned + // from this function will not prevent the manager from stopping, but it will + // be logged. + BeforeStop(*manager.Manager, names.ModuleName, manager.MapCleanupType) error +} + +// ModifierAfterStop is a sub-interface of Modifier that exposes an AfterStop method +type ModifierAfterStop interface { + Modifier + + // AfterStop is called after the ebpf.Manager.Stop call. An error returned + // from this function will be logged. + AfterStop(*manager.Manager, names.ModuleName, manager.MapCleanupType) error +} + +func runModifiersOfType[K Modifier](modifiers []Modifier, funcName string, runner func(K) error) error { + var errs error + for _, mod := range modifiers { + if as, ok := mod.(K); ok { + if err := runner(as); err != nil { + errs = errors.Join(errs, fmt.Errorf("error running %s manager modifier %s: %w", mod, funcName, err)) + } + } + } + return errs +} + // InitWithOptions is a wrapper around ebpf-manager.Manager.InitWithOptions func (m *Manager) InitWithOptions(bytecode io.ReaderAt, opts *manager.Options) error { // we must load the ELF file before initialization, @@ -81,22 +131,40 @@ func (m *Manager) InitWithOptions(bytecode io.ReaderAt, opts *manager.Options) e return fmt.Errorf("failed to load elf from reader: %w", err) } - for _, mod := range m.EnabledModifiers { - log.Tracef("Running %s manager modifier BeforeInit", mod) - if err := mod.BeforeInit(m.Manager, m.Name, opts); err != nil { - return fmt.Errorf("error running %s manager modifier: %w", mod, err) - } + err := runModifiersOfType(m.EnabledModifiers, "BeforeInit", func(mod ModifierBeforeInit) error { + return mod.BeforeInit(m.Manager, m.Name, opts) + }) + if err != nil { + return err } if err := m.Manager.InitWithOptions(nil, *opts); err != nil { return err } - for _, mod := range m.EnabledModifiers { - log.Tracef("Running %s manager modifier AfterInit", mod) - if err := mod.AfterInit(m.Manager, m.Name, opts); err != nil { - return fmt.Errorf("error running %s manager modifier: %w", mod, err) - } + return runModifiersOfType(m.EnabledModifiers, "AfterInit", func(mod ModifierAfterInit) error { + return mod.AfterInit(m.Manager, m.Name, opts) + }) +} + +// Stop is a wrapper around ebpf-manager.Manager.Stop +func (m *Manager) Stop(cleanupType manager.MapCleanupType) error { + var errs error + + err := runModifiersOfType(m.EnabledModifiers, "BeforeStop", func(mod ModifierBeforeStop) error { + return mod.BeforeStop(m.Manager, m.Name, cleanupType) + }) + if err != nil { + errs = errors.Join(errs, err) + } + + if err := m.Manager.Stop(cleanupType); err != nil { + errs = errors.Join(errs, fmt.Errorf("failed to stop manager %w", err)) } - return nil + + err = runModifiersOfType(m.EnabledModifiers, "AfterStop", func(mod ModifierAfterStop) error { + return mod.AfterStop(m.Manager, m.Name, cleanupType) + }) + + return errors.Join(errs, err) } diff --git a/pkg/ebpf/manager_test.go b/pkg/ebpf/manager_test.go index 32018e808fb0e..0a03659dadfa1 100644 --- a/pkg/ebpf/manager_test.go +++ b/pkg/ebpf/manager_test.go @@ -9,29 +9,44 @@ package ebpf import ( "testing" - "github.com/DataDog/datadog-agent/pkg/ebpf/names" manager "github.com/DataDog/ebpf-manager" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + "github.com/stretchr/testify/require" + + "github.com/DataDog/datadog-agent/pkg/ebpf/bytecode" + "github.com/DataDog/datadog-agent/pkg/ebpf/names" ) -// PrintkPatcherModifier adds an InstructionPatcher to the manager that removes the newline character from log_debug calls if needed type dummyModifier struct { + mock.Mock } const dummyModifierName = "DummyModifier" func (t *dummyModifier) String() string { + // Do not mock this method for simplicity, to avoid having to define it always return dummyModifierName } -// BeforeInit adds the patchPrintkNewline function to the manager -func (t *dummyModifier) BeforeInit(_ *manager.Manager, _ names.ModuleName, _ *manager.Options) error { - return nil +func (t *dummyModifier) BeforeInit(m *manager.Manager, name names.ModuleName, opts *manager.Options) error { + args := t.Called(m, name, opts) + return args.Error(0) +} + +func (t *dummyModifier) AfterInit(m *manager.Manager, name names.ModuleName, opts *manager.Options) error { + args := t.Called(m, name, opts) + return args.Error(0) } -// AfterInit is a no-op for this modifier -func (t *dummyModifier) AfterInit(_ *manager.Manager, _ names.ModuleName, _ *manager.Options) error { - return nil +func (t *dummyModifier) BeforeStop(m *manager.Manager, name names.ModuleName, cleanupType manager.MapCleanupType) error { + args := t.Called(m, name, cleanupType) + return args.Error(0) +} + +func (t *dummyModifier) AfterStop(m *manager.Manager, name names.ModuleName, cleanupType manager.MapCleanupType) error { + args := t.Called(m, name, cleanupType) + return args.Error(0) } func TestNewManagerWithDefault(t *testing.T) { @@ -69,3 +84,40 @@ func TestNewManagerWithDefault(t *testing.T) { }) } } + +func TestManagerInitWithOptions(t *testing.T) { + modifier := &dummyModifier{} + modifier.On("BeforeInit", mock.Anything, mock.Anything, mock.Anything).Return(nil) + modifier.On("AfterInit", mock.Anything, mock.Anything, mock.Anything).Return(nil) + + mgr := NewManager(&manager.Manager{}, "test", modifier) + require.NotNil(t, mgr) + + // Load a simple eBPF program to test the modifiers + cfg := NewConfig() + require.NotNil(t, cfg) + + buf, err := bytecode.GetReader(cfg.BPFDir, "logdebug-test.o") + require.NoError(t, err) + t.Cleanup(func() { _ = buf.Close }) + + opts := manager.Options{} + err = mgr.InitWithOptions(buf, &opts) + require.NoError(t, err) + + modifier.AssertExpectations(t) +} + +func TestManagerStop(t *testing.T) { + modifier := &dummyModifier{} + modifier.On("BeforeStop", mock.Anything, mock.Anything, mock.Anything).Return(nil) + modifier.On("AfterStop", mock.Anything, mock.Anything, mock.Anything).Return(nil) + + mgr := NewManager(&manager.Manager{}, "test", modifier) + require.NotNil(t, mgr) + + // The Stop call will fail because the manager is not initialized, but the modifiers should still be called + _ = mgr.Stop(manager.CleanAll) + + modifier.AssertExpectations(t) +} diff --git a/pkg/ebpf/map_cleaner_test.go b/pkg/ebpf/map_cleaner_test.go index 635c882a36bed..a9dfdbd1cb32b 100644 --- a/pkg/ebpf/map_cleaner_test.go +++ b/pkg/ebpf/map_cleaner_test.go @@ -12,7 +12,6 @@ import ( "testing" "time" - "github.com/cihub/seelog" "github.com/cilium/ebpf" "github.com/cilium/ebpf/rlimit" "github.com/stretchr/testify/assert" @@ -26,7 +25,7 @@ func TestMain(m *testing.M) { if logLevel == "" { logLevel = "warn" } - log.SetupLogger(seelog.Default, logLevel) + log.SetupLogger(log.Default(), logLevel) os.Exit(m.Run()) } diff --git a/pkg/ebpf/maps/generic_map.go b/pkg/ebpf/maps/generic_map.go index dfaa5a5cd0ee2..02036ce8a7605 100644 --- a/pkg/ebpf/maps/generic_map.go +++ b/pkg/ebpf/maps/generic_map.go @@ -124,14 +124,46 @@ func validateValueTypeForMapType[V any](t ebpf.MapType) error { return nil } +func validateKeyValueSizes[K, V any](m *ebpf.Map) error { + var k K + tk := reflect.TypeOf(k) + if tk.Size() != uintptr(m.KeySize()) { + return fmt.Errorf("map key size (%d) does not match key type (%T) size (%d)", m.KeySize(), k, tk.Size()) + } + var v V + tv := reflect.TypeOf(v) + tvSize := tv.Size() + if isPerCPU(m.Type()) { + tvSize = tv.Elem().Size() + } + if tvSize != uintptr(m.ValueSize()) { + return fmt.Errorf("map value size (%d) does not match value type (%T) size (%d)", m.ValueSize(), v, tvSize) + } + + return nil +} + // Map creates a new GenericMap from an existing ebpf.Map func Map[K any, V any](m *ebpf.Map) (*GenericMap[K, V], error) { if err := validateValueTypeForMapType[V](m.Type()); err != nil { return nil, err } + if err := validateKeyValueSizes[K, V](m); err != nil { + return nil, err + } + + // See if we can perform binary.Read on the key type. If we can't we can't use the batch API + // for this map + var kval K + keySupportsBatchAPI := canBinaryReadKey[K]() + if !keySupportsBatchAPI { + log.Warnf("Key type %T does not support binary.Read, batch API will not be used for this map", kval) + } + return &GenericMap[K, V]{ - m: m, + m: m, + keySupportsBatchAPI: keySupportsBatchAPI, }, nil } diff --git a/pkg/ebpf/maps/generic_map_test.go b/pkg/ebpf/maps/generic_map_test.go index 3bc59f494f8b6..837932b518cce 100644 --- a/pkg/ebpf/maps/generic_map_test.go +++ b/pkg/ebpf/maps/generic_map_test.go @@ -572,3 +572,43 @@ func TestIterateWithPointerKey(t *testing.T) { require.NoError(t, it.Err()) require.Equal(t, expectedNumbers, actualNumbers) } + +func TestValidateMapKeyValueSize(t *testing.T) { + m, err := ebpf.NewMap(&ebpf.MapSpec{ + Type: ebpf.Hash, + MaxEntries: 1, + KeySize: 8, + ValueSize: 8, + }) + + require.NoError(t, err, "could not create map") + t.Cleanup(func() { m.Close() }) + + gm, err := Map[uint32, uint64](m) + assert.Error(t, err) + assert.Nil(t, gm) + + gm2, err := Map[uint64, uint32](m) + assert.Error(t, err) + assert.Nil(t, gm2) + + gm3, err := Map[uint64, uint64](m) + assert.NoError(t, err) + assert.NotNil(t, gm3) +} + +func TestGenericHashMapCanUseBatchAPI(t *testing.T) { + hash, err := ebpf.NewMap(&ebpf.MapSpec{ + Type: ebpf.Hash, + KeySize: 4, + ValueSize: 4, + MaxEntries: 10, + }) + require.NoError(t, err) + t.Cleanup(func() { hash.Close() }) + + gm, err := Map[int32, int32](hash) + require.NoError(t, err) + + require.Equal(t, BatchAPISupported(), gm.CanUseBatchAPI()) +} diff --git a/pkg/ebpf/printk_patcher.go b/pkg/ebpf/printk_patcher.go index afda0f4869c6a..b417c8b011415 100644 --- a/pkg/ebpf/printk_patcher.go +++ b/pkg/ebpf/printk_patcher.go @@ -213,6 +213,9 @@ func patchPrintkInstructions(p *ebpf.ProgramSpec) (int, error) { type PrintkPatcherModifier struct { } +// ensure PrintkPatcherModifier implements the ModifierBeforeInit interface +var _ ModifierBeforeInit = &PrintkPatcherModifier{} + func (t *PrintkPatcherModifier) String() string { return "PrintkPatcherModifier" } @@ -222,8 +225,3 @@ func (t *PrintkPatcherModifier) BeforeInit(m *manager.Manager, _ names.ModuleNam m.InstructionPatchers = append(m.InstructionPatchers, patchPrintkNewline) return nil } - -// AfterInit is a no-op for this modifier -func (t *PrintkPatcherModifier) AfterInit(_ *manager.Manager, _ names.ModuleName, _ *manager.Options) error { - return nil -} diff --git a/pkg/ebpf/printk_patcher_test.go b/pkg/ebpf/printk_patcher_test.go index 3d028ae6e6af4..5e8c9d85cb5a1 100644 --- a/pkg/ebpf/printk_patcher_test.go +++ b/pkg/ebpf/printk_patcher_test.go @@ -9,7 +9,6 @@ package ebpf import ( "bufio" - "math" "os" "path/filepath" "strings" @@ -20,7 +19,6 @@ import ( "github.com/DataDog/ebpf-manager/tracefs" "github.com/cilium/ebpf" "github.com/stretchr/testify/require" - "golang.org/x/sys/unix" "github.com/DataDog/datadog-agent/pkg/ebpf/bytecode" ebpfkernel "github.com/DataDog/datadog-agent/pkg/security/ebpf/kernel" @@ -64,11 +62,8 @@ func TestPatchPrintkNewline(t *testing.T) { } opts := manager.Options{ - RLimit: &unix.Rlimit{ - Cur: math.MaxUint64, - Max: math.MaxUint64, - }, - MapEditors: make(map[string]*ebpf.Map), + RemoveRlimit: true, + MapEditors: make(map[string]*ebpf.Map), } mgr.InstructionPatchers = append(mgr.InstructionPatchers, patchPrintkNewline) diff --git a/pkg/ebpf/telemetry/errors_telemetry_test.go b/pkg/ebpf/telemetry/errors_telemetry_test.go index 7b4a3fe8d812e..3d7485f39877b 100644 --- a/pkg/ebpf/telemetry/errors_telemetry_test.go +++ b/pkg/ebpf/telemetry/errors_telemetry_test.go @@ -8,12 +8,9 @@ package telemetry import ( - "math" "os" "testing" - "golang.org/x/sys/unix" - 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/ebpf/bytecode" @@ -75,10 +72,7 @@ func triggerTestAndGetTelemetry(t *testing.T) []prometheus.Metric { collector := NewEBPFErrorsCollector() options := manager.Options{ - RLimit: &unix.Rlimit{ - Cur: math.MaxUint64, - Max: math.MaxUint64, - }, + RemoveRlimit: true, ActivatedProbes: []manager.ProbesSelector{ &manager.ProbeSelector{ ProbeIdentificationPair: manager.ProbeIdentificationPair{ diff --git a/pkg/ebpf/uprobes/attacher_test.go b/pkg/ebpf/uprobes/attacher_test.go index 26428868c1d70..8b9e144d15a80 100644 --- a/pkg/ebpf/uprobes/attacher_test.go +++ b/pkg/ebpf/uprobes/attacher_test.go @@ -27,14 +27,12 @@ import ( "github.com/DataDog/datadog-agent/pkg/ebpf/bytecode" "github.com/DataDog/datadog-agent/pkg/ebpf/ebpftest" "github.com/DataDog/datadog-agent/pkg/ebpf/prebuilt" - eventmonitortestutil "github.com/DataDog/datadog-agent/pkg/eventmonitor/testutil" + "github.com/DataDog/datadog-agent/pkg/eventmonitor/consumers/testutil" "github.com/DataDog/datadog-agent/pkg/network/go/bininspect" "github.com/DataDog/datadog-agent/pkg/network/usm/sharedlibraries" fileopener "github.com/DataDog/datadog-agent/pkg/network/usm/sharedlibraries/testutil" "github.com/DataDog/datadog-agent/pkg/network/usm/utils" "github.com/DataDog/datadog-agent/pkg/process/monitor" - procmontestutil "github.com/DataDog/datadog-agent/pkg/process/monitor/testutil" - secutils "github.com/DataDog/datadog-agent/pkg/security/utils" "github.com/DataDog/datadog-agent/pkg/util/kernel" ) @@ -800,8 +798,7 @@ func launchProcessMonitor(t *testing.T, useEventStream bool) *monitor.ProcessMon t.Cleanup(pm.Stop) require.NoError(t, pm.Initialize(useEventStream)) if useEventStream { - secutils.SetCachedHostname("test-hostname") - eventmonitortestutil.StartEventMonitor(t, procmontestutil.RegisterProcessMonitorEventConsumer) + monitor.InitializeEventConsumer(testutil.NewTestProcessConsumer(t)) } return pm @@ -988,9 +985,10 @@ func (s *SharedLibrarySuite) TestDetectionWithPIDAndRootNamespace() { t.Cleanup(ua.Stop) time.Sleep(10 * time.Millisecond) - // simulate a slow (1 second) : open, write, close of the file + // simulate a slow (1 second) : open, read, close of the file // in a new pid and mount namespaces - o, err := exec.Command("unshare", "--fork", "--pid", "-R", root, "/ash", "-c", fmt.Sprintf("sleep 1 > %s", libpath)).CombinedOutput() + o, err := exec.Command("unshare", "--fork", "--pid", "-R", root, "/ash", "-c", + fmt.Sprintf("touch foo && mv foo %s && sleep 1 < %s", libpath, libpath)).CombinedOutput() if err != nil { t.Log(err, string(o)) } diff --git a/pkg/ebpf/uprobes/testutil.go b/pkg/ebpf/uprobes/testutil.go index 93b109b499aa3..2d4e8b85d4b25 100644 --- a/pkg/ebpf/uprobes/testutil.go +++ b/pkg/ebpf/uprobes/testutil.go @@ -13,6 +13,7 @@ import ( "path/filepath" "runtime" "strconv" + "strings" "sync" "testing" "time" @@ -132,6 +133,21 @@ type FakeProcFSEntry struct { Command string Exe string Maps string + Env map[string]string +} + +// getEnvironContents returns the formatted contents of the /proc//environ file for the entry. +func (f *FakeProcFSEntry) getEnvironContents() string { + if len(f.Env) == 0 { + return "" + } + + formattedEnvVars := make([]string, 0, len(f.Env)) + for k, v := range f.Env { + formattedEnvVars = append(formattedEnvVars, fmt.Sprintf("%s=%s", k, v)) + } + + return strings.Join(formattedEnvVars, "\x00") + "\x00" } // CreateFakeProcFS creates a fake /proc filesystem with the given entries, useful for testing attachment to processes. @@ -145,16 +161,13 @@ func CreateFakeProcFS(t *testing.T, entries []FakeProcFSEntry) string { createFile(t, filepath.Join(baseDir, "comm"), entry.Command) createFile(t, filepath.Join(baseDir, "maps"), entry.Maps) createSymlink(t, entry.Exe, filepath.Join(baseDir, "exe")) + createFile(t, filepath.Join(baseDir, "environ"), entry.getEnvironContents()) } return procRoot } func createFile(t *testing.T, path, data string) { - if data == "" { - return - } - dir := filepath.Dir(path) require.NoError(t, os.MkdirAll(dir, 0775)) require.NoError(t, os.WriteFile(path, []byte(data), 0775)) diff --git a/pkg/ebpf/verifier/stats_test.go b/pkg/ebpf/verifier/stats_test.go index 9af6a7c3f4cc2..fca00b8840f16 100644 --- a/pkg/ebpf/verifier/stats_test.go +++ b/pkg/ebpf/verifier/stats_test.go @@ -19,7 +19,6 @@ import ( "github.com/DataDog/datadog-agent/pkg/util/kernel" "github.com/DataDog/datadog-agent/pkg/util/log" - "github.com/cihub/seelog" "github.com/cilium/ebpf" "github.com/cilium/ebpf/rlimit" "github.com/stretchr/testify/assert" @@ -37,7 +36,7 @@ func TestMain(m *testing.M) { if logLevel == "" { logLevel = "warn" } - log.SetupLogger(seelog.Default, logLevel) + log.SetupLogger(log.Default(), logLevel) os.Exit(m.Run()) } diff --git a/pkg/flare/archive.go b/pkg/flare/archive.go index c3e5dffe00ca8..8e820bb36f3ef 100644 --- a/pkg/flare/archive.go +++ b/pkg/flare/archive.go @@ -214,7 +214,7 @@ func getExpVar(fb flaretypes.FlareBuilder) error { apmDebugPort := pkgconfigsetup.Datadog().GetInt("apm_config.debug.port") f := filepath.Join("expvar", "trace-agent") - resp, err := http.Get(fmt.Sprintf("http://127.0.0.1:%d/debug/vars", apmDebugPort)) + resp, err := http.Get(fmt.Sprintf("https://127.0.0.1:%d/debug/vars", apmDebugPort)) if err != nil { return fb.AddFile(f, []byte(fmt.Sprintf("Error retrieving vars: %v", err))) } @@ -266,7 +266,7 @@ func getProcessAgentFullConfig() ([]byte, error) { return nil, fmt.Errorf("wrong configuration to connect to process-agent") } - procStatusURL := fmt.Sprintf("http://%s/config/all", addressPort) + procStatusURL := fmt.Sprintf("https://%s/config/all", addressPort) bytes, err := getHTTPCallContent(procStatusURL) if err != nil { @@ -314,7 +314,7 @@ func getChecksFromProcessAgent(fb flaretypes.FlareBuilder, getAddressPort func() log.Errorf("Could not zip process agent checks: wrong configuration to connect to process-agent: %s", err.Error()) return } - checkURL := fmt.Sprintf("http://%s/check/", addressPort) + checkURL := fmt.Sprintf("https://%s/check/", addressPort) getCheck := func(checkName, setting string) { filename := fmt.Sprintf("%s_check_output.json", checkName) @@ -394,7 +394,12 @@ func getProcessAgentTaggerList() ([]byte, error) { return nil, fmt.Errorf("wrong configuration to connect to process-agent") } - taggerListURL := fmt.Sprintf("http://%s/agent/tagger-list", addressPort) + err = apiutil.SetAuthToken(pkgconfigsetup.Datadog()) + if err != nil { + return nil, err + } + + taggerListURL := fmt.Sprintf("https://%s/agent/tagger-list", addressPort) return getTaggerList(taggerListURL) } @@ -480,7 +485,8 @@ func getHTTPCallContent(url string) ([]byte, error) { ctx, cancel := context.WithTimeout(context.Background(), 4*time.Second) defer cancel() - client := http.Client{} + client := apiutil.GetClient(false) // FIX: get certificates right then make this true + req, err := http.NewRequest(http.MethodGet, url, nil) if err != nil { return nil, err diff --git a/pkg/flare/archive_linux.go b/pkg/flare/archive_linux.go index 1c9b5d7a4ad48..9a3aea87a0ac0 100644 --- a/pkg/flare/archive_linux.go +++ b/pkg/flare/archive_linux.go @@ -38,6 +38,8 @@ func addSystemProbePlatformSpecificEntries(fb flaretypes.FlareBuilder) { _ = fb.AddFileFromFunc(filepath.Join("system-probe", "conntrack_cached.log"), getSystemProbeConntrackCached) _ = fb.AddFileFromFunc(filepath.Join("system-probe", "conntrack_host.log"), getSystemProbeConntrackHost) _ = fb.AddFileFromFunc(filepath.Join("system-probe", "ebpf_btf_loader.log"), getSystemProbeBTFLoaderInfo) + _ = fb.AddFileFromFunc(filepath.Join("system-probe", "selinux_sestatus.log"), getSystemProbeSelinuxSestatus) + _ = fb.AddFileFromFunc(filepath.Join("system-probe", "selinux_semodule_list.log"), getSystemProbeSelinuxSemoduleList) } } @@ -148,3 +150,15 @@ func getSystemProbeBTFLoaderInfo() ([]byte, error) { url := sysprobeclient.DebugURL("/ebpf_btf_loader_info") return getHTTPData(sysProbeClient, url) } + +func getSystemProbeSelinuxSestatus() ([]byte, error) { + sysProbeClient := sysprobeclient.Get(getSystemProbeSocketPath()) + url := sysprobeclient.DebugURL("/selinux_sestatus") + return getHTTPData(sysProbeClient, url) +} + +func getSystemProbeSelinuxSemoduleList() ([]byte, error) { + sysProbeClient := sysprobeclient.Get(getSystemProbeSocketPath()) + url := sysprobeclient.DebugURL("/selinux_semodule_list") + return getHTTPData(sysProbeClient, url) +} diff --git a/pkg/flare/archive_test.go b/pkg/flare/archive_test.go index fb4ee4866a224..25271c47273f9 100644 --- a/pkg/flare/archive_test.go +++ b/pkg/flare/archive_test.go @@ -219,7 +219,7 @@ process_config: _, err = w.Write(b) require.NoError(t, err) } - srv := httptest.NewServer(http.HandlerFunc(handler)) + srv := httptest.NewTLSServer(http.HandlerFunc(handler)) defer srv.Close() setupIPCAddress(t, cfg, srv.URL) @@ -294,7 +294,7 @@ func TestProcessAgentChecks(t *testing.T) { require.NoError(t, err) } - srv := httptest.NewServer(http.HandlerFunc(handler)) + srv := httptest.NewTLSServer(http.HandlerFunc(handler)) defer srv.Close() setupIPCAddress(t, configmock.New(t), srv.URL) diff --git a/pkg/flare/archive_win.go b/pkg/flare/archive_win.go index e62f23d58a8dc..96afe5ac17a94 100644 --- a/pkg/flare/archive_win.go +++ b/pkg/flare/archive_win.go @@ -31,7 +31,7 @@ var ( eventLogChannelsToExport = map[string]string{ "System": "Event/System/Provider[@Name=\"Service Control Manager\"]", - "Application": "Event/System/Provider[@Name=\"datadog-trace-agent\" or @Name=\"DatadogAgent\"]", + "Application": "Event/System/Provider[@Name=\"datadog-trace-agent\" or @Name=\"DatadogAgent\" or @Name=\".NET Runtime\" or @Name=\"Application Error\"]", "Microsoft-Windows-WMI-Activity/Operational": "*", } execTimeout = 30 * time.Second diff --git a/pkg/fleet/daemon/daemon.go b/pkg/fleet/daemon/daemon.go index 566275521126a..5023393d99e5b 100644 --- a/pkg/fleet/daemon/daemon.go +++ b/pkg/fleet/daemon/daemon.go @@ -20,9 +20,6 @@ import ( "sync" "time" - "gopkg.in/DataDog/dd-trace-go.v1/ddtrace" - "gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer" - "github.com/DataDog/datadog-agent/comp/core/config" "github.com/DataDog/datadog-agent/pkg/config/remote/client" "github.com/DataDog/datadog-agent/pkg/config/utils" @@ -34,6 +31,7 @@ import ( "github.com/DataDog/datadog-agent/pkg/fleet/internal/cdn" "github.com/DataDog/datadog-agent/pkg/fleet/internal/exec" "github.com/DataDog/datadog-agent/pkg/fleet/internal/paths" + "github.com/DataDog/datadog-agent/pkg/fleet/telemetry" pbgo "github.com/DataDog/datadog-agent/pkg/proto/pbgo/core" "github.com/DataDog/datadog-agent/pkg/util/log" "github.com/DataDog/datadog-agent/pkg/version" @@ -142,7 +140,34 @@ func (d *daemonImpl) GetState() (map[string]repository.State, error) { d.m.Lock() defer d.m.Unlock() - return d.installer.States() + states, err := d.installer.States() + if err != nil { + return nil, err + } + + var configStates map[string]repository.State + if d.env.RemotePolicies { + configStates, err = d.installer.ConfigStates() + if err != nil { + return nil, err + } + } + + res := make(map[string]repository.State) + for pkg, state := range states { + res[pkg] = state + } + for pkg, state := range configStates { + if _, ok := res[pkg]; !ok { + res[pkg] = repository.State{ + Stable: "", + Experiment: "", + StablePoliciesState: state.StablePoliciesState, + ExperimentPoliciesState: state.ExperimentPoliciesState, + } + } + } + return res, nil } // GetRemoteConfigState returns the remote config state. @@ -271,8 +296,8 @@ func (d *daemonImpl) Install(ctx context.Context, url string, args []string) err } func (d *daemonImpl) install(ctx context.Context, url string, args []string) (err error) { - span, ctx := tracer.StartSpanFromContext(ctx, "install") - defer func() { span.Finish(tracer.WithError(err)) }() + span, ctx := telemetry.StartSpanFromContext(ctx, "install") + defer func() { span.Finish(err) }() d.refreshState(ctx) defer d.refreshState(ctx) @@ -293,8 +318,8 @@ func (d *daemonImpl) StartExperiment(ctx context.Context, url string) error { } func (d *daemonImpl) startExperiment(ctx context.Context, url string) (err error) { - span, ctx := tracer.StartSpanFromContext(ctx, "start_experiment") - defer func() { span.Finish(tracer.WithError(err)) }() + span, ctx := telemetry.StartSpanFromContext(ctx, "start_experiment") + defer func() { span.Finish(err) }() d.refreshState(ctx) defer d.refreshState(ctx) @@ -308,8 +333,8 @@ func (d *daemonImpl) startExperiment(ctx context.Context, url string) (err error } func (d *daemonImpl) startInstallerExperiment(ctx context.Context, url string) (err error) { - span, ctx := tracer.StartSpanFromContext(ctx, "start_installer_experiment") - defer func() { span.Finish(tracer.WithError(err)) }() + span, ctx := telemetry.StartSpanFromContext(ctx, "start_installer_experiment") + defer func() { span.Finish(err) }() d.refreshState(ctx) defer d.refreshState(ctx) @@ -334,8 +359,8 @@ func (d *daemonImpl) PromoteExperiment(ctx context.Context, pkg string) error { } func (d *daemonImpl) promoteExperiment(ctx context.Context, pkg string) (err error) { - span, ctx := tracer.StartSpanFromContext(ctx, "promote_experiment") - defer func() { span.Finish(tracer.WithError(err)) }() + span, ctx := telemetry.StartSpanFromContext(ctx, "promote_experiment") + defer func() { span.Finish(err) }() d.refreshState(ctx) defer d.refreshState(ctx) @@ -356,8 +381,8 @@ func (d *daemonImpl) StopExperiment(ctx context.Context, pkg string) error { } func (d *daemonImpl) stopExperiment(ctx context.Context, pkg string) (err error) { - span, ctx := tracer.StartSpanFromContext(ctx, "stop_experiment") - defer func() { span.Finish(tracer.WithError(err)) }() + span, ctx := telemetry.StartSpanFromContext(ctx, "stop_experiment") + defer func() { span.Finish(err) }() d.refreshState(ctx) defer d.refreshState(ctx) @@ -378,8 +403,8 @@ func (d *daemonImpl) StartConfigExperiment(ctx context.Context, url string, vers } func (d *daemonImpl) startConfigExperiment(ctx context.Context, url string, version string) (err error) { - span, ctx := tracer.StartSpanFromContext(ctx, "start_config_experiment") - defer func() { span.Finish(tracer.WithError(err)) }() + span, ctx := telemetry.StartSpanFromContext(ctx, "start_config_experiment") + defer func() { span.Finish(err) }() d.refreshState(ctx) defer d.refreshState(ctx) @@ -400,8 +425,8 @@ func (d *daemonImpl) PromoteConfigExperiment(ctx context.Context, pkg string) er } func (d *daemonImpl) promoteConfigExperiment(ctx context.Context, pkg string) (err error) { - span, ctx := tracer.StartSpanFromContext(ctx, "promote_config_experiment") - defer func() { span.Finish(tracer.WithError(err)) }() + span, ctx := telemetry.StartSpanFromContext(ctx, "promote_config_experiment") + defer func() { span.Finish(err) }() d.refreshState(ctx) defer d.refreshState(ctx) @@ -422,8 +447,8 @@ func (d *daemonImpl) StopConfigExperiment(ctx context.Context, pkg string) error } func (d *daemonImpl) stopConfigExperiment(ctx context.Context, pkg string) (err error) { - span, ctx := tracer.StartSpanFromContext(ctx, "stop_config_experiment") - defer func() { span.Finish(tracer.WithError(err)) }() + span, ctx := telemetry.StartSpanFromContext(ctx, "stop_config_experiment") + defer func() { span.Finish(err) }() d.refreshState(ctx) defer d.refreshState(ctx) @@ -455,7 +480,7 @@ func (d *daemonImpl) handleRemoteAPIRequest(request remoteAPIRequest) (err error defer d.m.Unlock() defer d.requestsWG.Done() parentSpan, ctx := newRequestContext(request) - defer parentSpan.Finish(tracer.WithError(err)) + defer parentSpan.Finish(err) d.refreshState(ctx) defer d.refreshState(ctx) @@ -475,7 +500,10 @@ func (d *daemonImpl) handleRemoteAPIRequest(request remoteAPIRequest) (err error s.Experiment != request.ExpectedState.Experiment || c.Stable != request.ExpectedState.StableConfig || c.Experiment != request.ExpectedState.ExperimentConfig) { - log.Infof("remote request %s not executed as state does not match: expected %v, got %v", request.ID, request.ExpectedState, s) + log.Infof( + "remote request %s not executed as state does not match: expected %v, got package: %v, config: %v", + request.ID, request.ExpectedState, s, c, + ) setRequestInvalid(ctx) d.refreshState(ctx) return nil @@ -491,7 +519,10 @@ func (d *daemonImpl) handleRemoteAPIRequest(request remoteAPIRequest) (err error } experimentPackage, ok := d.catalog.getPackage(request.Package, params.Version, runtime.GOARCH, runtime.GOOS) if !ok { - return fmt.Errorf("could not get package %s, %s for %s, %s", request.Package, params.Version, runtime.GOARCH, runtime.GOOS) + return installerErrors.Wrap( + installerErrors.ErrPackageNotFound, + fmt.Errorf("could not get package %s, %s for %s, %s", request.Package, params.Version, runtime.GOARCH, runtime.GOOS), + ) } log.Infof("Installer: Received remote request %s to start experiment for package %s version %s", request.ID, request.Package, request.Params) if request.Package == "datadog-installer" { @@ -532,31 +563,20 @@ var requestStateKey requestKey // requestState represents the state of a task. type requestState struct { - Package string - ID string - State pbgo.TaskState - Err *installerErrors.InstallerError + Package string + ID string + State pbgo.TaskState + Err error + ErrorCode installerErrors.InstallerErrorCode } -func newRequestContext(request remoteAPIRequest) (ddtrace.Span, context.Context) { +func newRequestContext(request remoteAPIRequest) (*telemetry.Span, context.Context) { ctx := context.WithValue(context.Background(), requestStateKey, &requestState{ Package: request.Package, ID: request.ID, State: pbgo.TaskState_RUNNING, }) - - ctxCarrier := tracer.TextMapCarrier{ - tracer.DefaultTraceIDHeader: request.TraceID, - tracer.DefaultParentIDHeader: request.ParentSpanID, - tracer.DefaultPriorityHeader: "2", - } - spanCtx, err := tracer.Extract(ctxCarrier) - if err != nil { - log.Debugf("failed to extract span context from install script params: %v", err) - return tracer.StartSpan("remote_request"), ctx - } - - return tracer.StartSpanFromContext(ctx, "remote_request", tracer.ChildOf(spanCtx)) + return telemetry.StartSpanFromIDs(ctx, "remote_request", request.TraceID, request.ParentSpanID) } func setRequestInvalid(ctx context.Context) { @@ -569,7 +589,8 @@ func setRequestDone(ctx context.Context, err error) { state.State = pbgo.TaskState_DONE if err != nil { state.State = pbgo.TaskState_ERROR - state.Err = installerErrors.FromErr(err) + state.Err = err + state.ErrorCode = installerErrors.GetCode(err) } } @@ -605,17 +626,24 @@ func (d *daemonImpl) refreshState(ctx context.Context) { log.Errorf("could not get available size: %v", err) } + for pkg, configState := range configState { + if _, ok := state[pkg]; !ok { + state[pkg] = repository.State{} + } + tmp := state[pkg] + tmp.StablePoliciesState = configState.StablePoliciesState + tmp.ExperimentPoliciesState = configState.ExperimentPoliciesState + state[pkg] = tmp + } + var packages []*pbgo.PackageState for pkg, s := range state { p := &pbgo.PackageState{ - Package: pkg, - StableVersion: s.Stable, - ExperimentVersion: s.Experiment, - } - cs, hasConfig := configState[pkg] - if hasConfig { - p.StableConfigState = cs.StablePoliciesState - p.ExperimentConfigState = cs.ExperimentPoliciesState + Package: pkg, + StableVersion: s.Stable, + ExperimentVersion: s.Experiment, + StableConfigState: s.StablePoliciesState, + ExperimentConfigState: s.ExperimentPoliciesState, } configState, err := d.resolveRemoteConfigVersion(ctx, pkg) @@ -630,7 +658,7 @@ func (d *daemonImpl) refreshState(ctx context.Context) { var taskErr *pbgo.TaskError if requestState.Err != nil { taskErr = &pbgo.TaskError{ - Code: uint64(requestState.Err.Code()), + Code: uint64(requestState.ErrorCode), Message: requestState.Err.Error(), } } diff --git a/pkg/fleet/installer/errors/errors.go b/pkg/fleet/installer/errors/errors.go index 736c609af033c..e8679359d3909 100644 --- a/pkg/fleet/installer/errors/errors.go +++ b/pkg/fleet/installer/errors/errors.go @@ -42,27 +42,17 @@ func (e InstallerError) Error() string { return e.err.Error() } -// Unwrap returns the wrapped error. -func (e InstallerError) Unwrap() error { - return e.err -} - // Is implements the Is method of the errors.Is interface. func (e InstallerError) Is(target error) bool { _, ok := target.(*InstallerError) return ok } -// Code returns the error code of the installer error. -func (e InstallerError) Code() InstallerErrorCode { - return e.code -} - // Wrap wraps the given error with an installer error. // If the given error is already an installer error, it is not wrapped and // left as it is. Only the deepest InstallerError remains. func Wrap(errCode InstallerErrorCode, err error) error { - if FromErr(err).code != errUnknown { + if errors.Is(err, &InstallerError{}) { return err } return &InstallerError{ @@ -71,50 +61,40 @@ func Wrap(errCode InstallerErrorCode, err error) error { } } -// FromErr returns a new InstallerError from the given error. -// Unwraps the error until it finds an InstallerError and return unknown error code if not found. -func FromErr(err error) *InstallerError { - if err == nil { - return nil +// GetCode returns the installer error code of the given error. +func GetCode(err error) InstallerErrorCode { + code := errUnknown + e := &InstallerError{} + if ok := errors.As(err, &e); ok { + code = e.code } - e, ok := err.(*InstallerError) - if !ok { - unwrappedErr := errors.Unwrap(err) - if unwrappedErr == nil { - return &InstallerError{ - err: err, - code: errUnknown, - } - } - return FromErr(unwrappedErr) - } - return e + return code } // ToJSON returns the error as a JSON string. -func (e InstallerError) ToJSON() string { +func ToJSON(err error) string { tmp := installerErrorJSON{ - Error: e.err.Error(), - Code: int(e.code), + Error: err.Error(), + Code: int(GetCode(err)), } jsonErr, err := json.Marshal(tmp) if err != nil { - return e.err.Error() + return err.Error() } return string(jsonErr) } // FromJSON returns an InstallerError from a JSON string. -func FromJSON(errStr string) InstallerError { +func FromJSON(errStr string) *InstallerError { var jsonError installerErrorJSON err := json.Unmarshal([]byte(errStr), &jsonError) if err != nil { - return InstallerError{ + return &InstallerError{ err: errors.New(errStr), code: errUnknown, } } - return InstallerError{ + return &InstallerError{ err: errors.New(jsonError.Error), code: InstallerErrorCode(jsonError.Code), } diff --git a/pkg/fleet/installer/errors/errors_test.go b/pkg/fleet/installer/errors/errors_test.go index 5115faaaf8a26..4cb8be7eb4a0e 100644 --- a/pkg/fleet/installer/errors/errors_test.go +++ b/pkg/fleet/installer/errors/errors_test.go @@ -6,40 +6,34 @@ package errors import ( + "errors" "fmt" "testing" "github.com/stretchr/testify/assert" ) -func TestFromErr(t *testing.T) { +func TestGetCode(t *testing.T) { + // Nil case + assert.Equal(t, GetCode(nil), errUnknown) + + // Simple case var err error = &InstallerError{ err: fmt.Errorf("test: test"), code: ErrDownloadFailed, } - taskErr := FromErr(err) - assert.Equal(t, taskErr, &InstallerError{ - err: fmt.Errorf("test: test"), - code: ErrDownloadFailed, - }) + assert.Equal(t, GetCode(err), ErrDownloadFailed) - assert.Nil(t, FromErr(nil)) -} - -func TestFromErrWithWrap(t *testing.T) { - err := fmt.Errorf("test: %w", &InstallerError{ - err: fmt.Errorf("test: test"), - code: ErrDownloadFailed, - }) - taskErr := FromErr(err) - assert.Equal(t, taskErr, &InstallerError{ - err: fmt.Errorf("test: test"), + // Wrap + err = fmt.Errorf("test1: %w", &InstallerError{ + err: fmt.Errorf("test2: test3"), code: ErrDownloadFailed, }) + assert.Equal(t, GetCode(err), ErrDownloadFailed) - taskErr2 := fmt.Errorf("Wrap 2: %w", fmt.Errorf("Wrap 1: %w", taskErr)) - assert.Equal(t, FromErr(taskErr2).Code(), ErrDownloadFailed) - assert.Nil(t, FromErr(nil)) + // Multiple wraps + err = fmt.Errorf("Wrap 2: %w", fmt.Errorf("Wrap 1: %w", err)) + assert.Equal(t, GetCode(err), ErrDownloadFailed) } func TestWrap(t *testing.T) { @@ -59,5 +53,22 @@ func TestWrap(t *testing.T) { }) taskErr3 := Wrap(ErrFilesystemIssue, fmt.Errorf("Wrap 2: %w", fmt.Errorf("Wrap 1: %w", taskErr2))) - assert.Equal(t, FromErr(taskErr3).Code(), ErrDownloadFailed) + unwrapped := &InstallerError{} + assert.True(t, errors.As(taskErr3, &unwrapped)) + assert.Equal(t, unwrapped.code, ErrDownloadFailed) +} + +func TestToJSON(t *testing.T) { + err := fmt.Errorf("test: %w", &InstallerError{ + err: fmt.Errorf("test2: test3"), + code: ErrDownloadFailed, + }) + assert.Equal(t, ToJSON(err), `{"error":"test: test2: test3","code":1}`) +} + +func TestFromJSON(t *testing.T) { + json := `{"error":"test: test2: test3","code":1}` + err := FromJSON(json) + assert.Equal(t, err.Error(), "test: test2: test3") + assert.Equal(t, GetCode(err), ErrDownloadFailed) } diff --git a/pkg/fleet/installer/installer.go b/pkg/fleet/installer/installer.go index e43e0cfaae4d2..179cad03a2834 100644 --- a/pkg/fleet/installer/installer.go +++ b/pkg/fleet/installer/installer.go @@ -19,6 +19,7 @@ import ( "github.com/DataDog/datadog-agent/pkg/fleet/internal/cdn" "github.com/DataDog/datadog-agent/pkg/fleet/internal/paths" + "github.com/DataDog/datadog-agent/pkg/fleet/telemetry" "github.com/DataDog/datadog-agent/pkg/fleet/installer/env" installerErrors "github.com/DataDog/datadog-agent/pkg/fleet/installer/errors" @@ -28,13 +29,12 @@ import ( "github.com/DataDog/datadog-agent/pkg/fleet/internal/db" "github.com/DataDog/datadog-agent/pkg/util/log" "github.com/DataDog/datadog-agent/pkg/version" - "gopkg.in/DataDog/dd-trace-go.v1/ddtrace/ext" - "gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer" ) const ( packageDatadogAgent = "datadog-agent" packageAPMInjector = "datadog-apm-inject" + packageAPMLibraries = "datadog-apm-libraries" packageDatadogInstaller = "datadog-installer" ) @@ -164,9 +164,9 @@ func (i *installerImpl) Install(ctx context.Context, url string, args []string) if err != nil { return fmt.Errorf("could not download package: %w", err) } - span, ok := tracer.SpanFromContext(ctx) + span, ok := telemetry.SpanFromContext(ctx) if ok { - span.SetTag(ext.ResourceName, pkg.Name) + span.SetResourceName(pkg.Name) span.SetTag("package_version", pkg.Version) } err = i.preparePackage(ctx, pkg.Name, args) // Preinst @@ -211,6 +211,16 @@ func (i *installerImpl) Install(ctx context.Context, url string, args []string) if err != nil { return fmt.Errorf("could not configure package: %w", err) } + if pkg.Name == packageDatadogInstaller { + // We must handle the configuration of some packages that are not + // don't have an OCI. To properly configure their configuration repositories, + // we call configurePackage when setting up the installer; which is the only + // package that is always installed. + err = i.configurePackage(ctx, packageAPMLibraries) + if err != nil { + return fmt.Errorf("could not configure package: %w", err) + } + } err = i.setupPackage(ctx, pkg.Name, args) // Postinst if err != nil { return fmt.Errorf("could not setup package: %w", err) @@ -471,9 +481,9 @@ func (i *installerImpl) Purge(ctx context.Context) { } // remove all from disk - span, _ := tracer.StartSpanFromContext(ctx, "remove_all") + span, _ := telemetry.StartSpanFromContext(ctx, "remove_all") err = os.RemoveAll(i.packagesDir) - defer span.Finish(tracer.WithError(err)) + defer span.Finish(err) if err != nil { log.Warnf("could not delete packages dir: %v", err) } @@ -621,6 +631,8 @@ func (i *installerImpl) promoteExperiment(ctx context.Context, pkg string) error func (i *installerImpl) preparePackage(ctx context.Context, pkg string, _ []string) error { switch pkg { + case packageDatadogInstaller: + return packages.PrepareInstaller(ctx) case packageDatadogAgent: return packages.PrepareAgent(ctx) default: @@ -659,11 +671,11 @@ func (i *installerImpl) configurePackage(ctx context.Context, pkg string) (err e return nil } - span, _ := tracer.StartSpanFromContext(ctx, "configure_package") - defer func() { span.Finish(tracer.WithError(err)) }() + span, _ := telemetry.StartSpanFromContext(ctx, "configure_package") + defer func() { span.Finish(err) }() switch pkg { - case packageDatadogAgent, packageAPMInjector: + case packageDatadogAgent, packageAPMInjector, packageAPMLibraries: config, err := i.cdn.Get(ctx, pkg) if err != nil { return fmt.Errorf("could not get %s CDN config: %w", pkg, err) diff --git a/pkg/fleet/installer/oci/download.go b/pkg/fleet/installer/oci/download.go index 1ddff40e37238..e557cf8b53d7f 100644 --- a/pkg/fleet/installer/oci/download.go +++ b/pkg/fleet/installer/oci/download.go @@ -20,7 +20,6 @@ import ( "syscall" "time" - "github.com/awslabs/amazon-ecr-credential-helper/ecr-login" "github.com/google/go-containerregistry/pkg/authn" "github.com/google/go-containerregistry/pkg/name" oci "github.com/google/go-containerregistry/pkg/v1" @@ -31,11 +30,11 @@ import ( "github.com/google/go-containerregistry/pkg/v1/types" "go.uber.org/multierr" "golang.org/x/net/http2" - httptrace "gopkg.in/DataDog/dd-trace-go.v1/contrib/net/http" "github.com/DataDog/datadog-agent/pkg/fleet/installer/env" installerErrors "github.com/DataDog/datadog-agent/pkg/fleet/installer/errors" "github.com/DataDog/datadog-agent/pkg/fleet/installer/tar" + "github.com/DataDog/datadog-agent/pkg/fleet/telemetry" "github.com/DataDog/datadog-agent/pkg/util/log" ) @@ -44,8 +43,6 @@ const ( RegistryAuthDefault string = "docker" // RegistryAuthGCR is the Google Container Registry authentication method. RegistryAuthGCR string = "gcr" - // RegistryAuthECR is the Amazon Elastic Container Registry authentication method. - RegistryAuthECR string = "ecr" // RegistryAuthPassword is the password registry authentication method. RegistryAuthPassword string = "password" ) @@ -65,8 +62,8 @@ const ( ) const ( - layerMaxSize = 3 << 30 // 3GiB - extractLayerRetries = 3 + layerMaxSize = 3 << 30 // 3GiB + networkRetries = 3 ) var ( @@ -154,8 +151,6 @@ func getKeychain(auth string, username string, password string) authn.Keychain { switch auth { case RegistryAuthGCR: return google.Keychain - case RegistryAuthECR: - return authn.NewKeychainFromHelper(ecr.NewECRHelper()) case RegistryAuthPassword: return usernamePasswordKeychain{ username: username, @@ -241,7 +236,7 @@ func getRefAndKeychain(env *env.Env, url string) urlWithKeychain { // If they are specified, the registry and authentication overrides are applied first. // Then we try each registry in the list of default registries in order and return the first successful download. func (d *Downloader) downloadRegistry(ctx context.Context, url string) (oci.Image, error) { - transport := httptrace.WrapRoundTripper(d.client.Transport) + transport := telemetry.WrapRoundTripper(d.client.Transport) var err error if d.env.Mirror != "" { transport, err = newMirrorTransport(transport, d.env.Mirror) @@ -323,30 +318,32 @@ func (d *DownloadedPackage) ExtractLayers(mediaType types.MediaType, dir string) return fmt.Errorf("could not get layer media type: %w", err) } if layerMediaType == mediaType { - // Retry stream reset errors - for i := 0; i < extractLayerRetries; i++ { - if i > 0 { - time.Sleep(time.Second) - } - uncompressedLayer, err := layer.Uncompressed() - if err != nil { - return fmt.Errorf("could not uncompress layer: %w", err) - } - err = tar.Extract(uncompressedLayer, dir, layerMaxSize) - uncompressedLayer.Close() - if err != nil { - if !isStreamResetError(err) && !isConnectionResetByPeerError(err) { - return fmt.Errorf("could not extract layer: %w", err) + err = withNetworkRetries( + func() error { + var err error + defer func() { + if err != nil { + deferErr := tar.Clean(dir) + if deferErr != nil { + err = deferErr + } + } + }() + uncompressedLayer, err := layer.Uncompressed() + if err != nil { + return err } - log.Warnf("network error while extracting layer, retrying") - // Clean up the directory before retrying to avoid partial extraction - err = tar.Clean(dir) + err = tar.Extract(uncompressedLayer, dir, layerMaxSize) + uncompressedLayer.Close() if err != nil { - return fmt.Errorf("could not clean directory: %w", err) + return err } - } else { - break - } + + return nil + }, + ) + if err != nil { + return fmt.Errorf("could not extract layer: %w", err) } } } @@ -354,16 +351,22 @@ func (d *DownloadedPackage) ExtractLayers(mediaType types.MediaType, dir string) } // WriteOCILayout writes the image as an OCI layout to the given directory. -func (d *DownloadedPackage) WriteOCILayout(dir string) error { - layoutPath, err := layout.Write(dir, empty.Index) - if err != nil { - return fmt.Errorf("could not write layout: %w", err) - } - err = layoutPath.AppendImage(d.Image) - if err != nil { - return fmt.Errorf("could not append image to layout: %w", err) - } - return nil +func (d *DownloadedPackage) WriteOCILayout(dir string) (err error) { + var layoutPath layout.Path + return withNetworkRetries( + func() error { + layoutPath, err = layout.Write(dir, empty.Index) + if err != nil { + return fmt.Errorf("could not write layout: %w", err) + } + + err = layoutPath.AppendImage(d.Image) + if err != nil { + return fmt.Errorf("could not append image to layout: %w", err) + } + return nil + }, + ) } // PackageURL returns the package URL for the given site, package and version. @@ -376,15 +379,50 @@ func PackageURL(env *env.Env, pkg string, version string) string { } } +func withNetworkRetries(f func() error) error { + var err error + for i := 0; i < networkRetries; i++ { + err = f() + if err == nil { + return nil + } + if !isRetryableNetworkError(err) { + return err + } + log.Warnf("retrying after network error: %s", err) + time.Sleep(time.Second) + } + return err +} + +// isRetryableNetworkError returns true if the error is a network error we should retry on +func isRetryableNetworkError(err error) bool { + if err == nil { + return false + } + + if netErr, ok := err.(*net.OpError); ok { + if netErr.Temporary() { + // Temporary errors, such as "connection timed out" + return true + } + if syscallErr, ok := netErr.Err.(*os.SyscallError); ok { + if errno, ok := syscallErr.Err.(syscall.Errno); ok { + // Connection reset errors, such as "connection reset by peer" + return errno == syscall.ECONNRESET + } + } + } + + return isStreamResetError(err) +} + // isStreamResetError returns true if the given error is a stream reset error. // Sometimes, in GCR, the tar extract fails with "stream error: stream ID x; INTERNAL_ERROR; received from peer". // This happens because the uncompressed layer reader is a http/2 response body under the hood. That body is // streamed and receives a "reset stream frame", with the code 0x2 (INTERNAL_ERROR). This is an error from the server // that we need to retry. func isStreamResetError(err error) bool { - if err == nil { - return false - } serr := http2.StreamError{} if errors.As(err, &serr) { return serr.Code == http2.ErrCodeInternal @@ -396,18 +434,6 @@ func isStreamResetError(err error) bool { return false } -// isConnectionResetByPeer returns true if the error is a connection reset by peer error -func isConnectionResetByPeerError(err error) bool { - if netErr, ok := err.(*net.OpError); ok { - if syscallErr, ok := netErr.Err.(*os.SyscallError); ok { - if errno, ok := syscallErr.Err.(syscall.Errno); ok { - return errno == syscall.ECONNRESET - } - } - } - return false -} - type usernamePasswordKeychain struct { username string password string diff --git a/pkg/fleet/installer/packages/apm_inject.go b/pkg/fleet/installer/packages/apm_inject.go index 3f51793cf3486..0066671494204 100644 --- a/pkg/fleet/installer/packages/apm_inject.go +++ b/pkg/fleet/installer/packages/apm_inject.go @@ -19,9 +19,9 @@ import ( "github.com/DataDog/datadog-agent/pkg/fleet/installer/env" "github.com/DataDog/datadog-agent/pkg/fleet/installer/packages/embedded" + "github.com/DataDog/datadog-agent/pkg/fleet/telemetry" "github.com/DataDog/datadog-agent/pkg/util/log" "go.uber.org/multierr" - "gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer" ) const ( @@ -32,8 +32,8 @@ const ( // SetupAPMInjector sets up the injector at bootstrap func SetupAPMInjector(ctx context.Context) (err error) { - span, ctx := tracer.StartSpanFromContext(ctx, "setup_injector") - defer func() { span.Finish(tracer.WithError(err)) }() + span, ctx := telemetry.StartSpanFromContext(ctx, "setup_injector") + defer func() { span.Finish(err) }() installer := newAPMInjectorInstaller(injectorPath) defer func() { installer.Finish(err) }() return installer.Setup(ctx) @@ -41,8 +41,8 @@ func SetupAPMInjector(ctx context.Context) (err error) { // RemoveAPMInjector removes the APM injector func RemoveAPMInjector(ctx context.Context) (err error) { - span, ctx := tracer.StartSpanFromContext(ctx, "remove_injector") - defer func() { span.Finish(tracer.WithError(err)) }() + span, ctx := telemetry.StartSpanFromContext(ctx, "remove_injector") + defer func() { span.Finish(err) }() installer := newAPMInjectorInstaller(injectorPath) defer func() { installer.Finish(err) }() return installer.Remove(ctx) @@ -50,8 +50,8 @@ func RemoveAPMInjector(ctx context.Context) (err error) { // InstrumentAPMInjector instruments the APM injector func InstrumentAPMInjector(ctx context.Context, method string) (err error) { - span, ctx := tracer.StartSpanFromContext(ctx, "instrument_injector") - defer func() { span.Finish(tracer.WithError(err)) }() + span, ctx := telemetry.StartSpanFromContext(ctx, "instrument_injector") + defer func() { span.Finish(err) }() installer := newAPMInjectorInstaller(injectorPath) installer.envs.InstallScript.APMInstrumentationEnabled = method defer func() { installer.Finish(err) }() @@ -60,8 +60,8 @@ func InstrumentAPMInjector(ctx context.Context, method string) (err error) { // UninstrumentAPMInjector uninstruments the APM injector func UninstrumentAPMInjector(ctx context.Context, method string) (err error) { - span, ctx := tracer.StartSpanFromContext(ctx, "uninstrument_injector") - defer func() { span.Finish(tracer.WithError(err)) }() + span, ctx := telemetry.StartSpanFromContext(ctx, "uninstrument_injector") + defer func() { span.Finish(err) }() installer := newAPMInjectorInstaller(injectorPath) installer.envs.InstallScript.APMInstrumentationEnabled = method defer func() { installer.Finish(err) }() @@ -148,8 +148,8 @@ func (a *apmInjectorInstaller) Setup(ctx context.Context) error { } func (a *apmInjectorInstaller) Remove(ctx context.Context) (err error) { - span, _ := tracer.StartSpanFromContext(ctx, "remove_injector") - defer func() { span.Finish(tracer.WithError(err)) }() + span, _ := telemetry.StartSpanFromContext(ctx, "remove_injector") + defer func() { span.Finish(err) }() err = a.removeInstrumentScripts(ctx) if err != nil { @@ -277,8 +277,8 @@ func (a *apmInjectorInstaller) deleteLDPreloadConfigContent(_ context.Context, l } func (a *apmInjectorInstaller) verifySharedLib(ctx context.Context, libPath string) (err error) { - span, _ := tracer.StartSpanFromContext(ctx, "verify_shared_lib") - defer func() { span.Finish(tracer.WithError(err)) }() + span, _ := telemetry.StartSpanFromContext(ctx, "verify_shared_lib") + defer func() { span.Finish(err) }() echoPath, err := exec.LookPath("echo") if err != nil { // If echo is not found, to not block install, @@ -302,8 +302,8 @@ func (a *apmInjectorInstaller) verifySharedLib(ctx context.Context, libPath stri // - Referenced in our public documentation, so we override them to use installer commands for consistency // - Used on deb/rpm removal and may break the OCI in the process func (a *apmInjectorInstaller) addInstrumentScripts(ctx context.Context) (err error) { - span, _ := tracer.StartSpanFromContext(ctx, "add_instrument_scripts") - defer func() { span.Finish(tracer.WithError(err)) }() + span, _ := telemetry.StartSpanFromContext(ctx, "add_instrument_scripts") + defer func() { span.Finish(err) }() hostMutator := newFileMutator( "/usr/bin/dd-host-install", @@ -370,8 +370,8 @@ func (a *apmInjectorInstaller) addInstrumentScripts(ctx context.Context) (err er // removeInstrumentScripts removes the install scripts that come with the APM injector // if and only if they've been installed by the installer and not modified func (a *apmInjectorInstaller) removeInstrumentScripts(ctx context.Context) (retErr error) { - span, _ := tracer.StartSpanFromContext(ctx, "remove_instrument_scripts") - defer func() { span.Finish(tracer.WithError(retErr)) }() + span, _ := telemetry.StartSpanFromContext(ctx, "remove_instrument_scripts") + defer func() { span.Finish(retErr) }() for _, script := range []string{"dd-host-install", "dd-container-install", "dd-cleanup"} { path := filepath.Join("/usr/bin", script) diff --git a/pkg/fleet/installer/packages/apm_sockets.go b/pkg/fleet/installer/packages/apm_sockets.go index db2def19fe43f..4c2e866116557 100644 --- a/pkg/fleet/installer/packages/apm_sockets.go +++ b/pkg/fleet/installer/packages/apm_sockets.go @@ -15,8 +15,8 @@ import ( "path/filepath" "strings" + "github.com/DataDog/datadog-agent/pkg/fleet/telemetry" "github.com/DataDog/datadog-agent/pkg/util/log" - "gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer" "gopkg.in/yaml.v2" ) @@ -119,9 +119,9 @@ func (a *apmInjectorInstaller) configureSocketsEnv(ctx context.Context) (retErr } // setSocketEnvs sets the socket environment variables -func setSocketEnvs(ctx context.Context, envFile []byte) ([]byte, error) { - span, _ := tracer.StartSpanFromContext(ctx, "set_socket_envs") - defer span.Finish() +func setSocketEnvs(ctx context.Context, envFile []byte) (res []byte, err error) { + span, _ := telemetry.StartSpanFromContext(ctx, "set_socket_envs") + defer span.Finish(err) apmSocket, statsdSocket, err := getSocketsPath() if err != nil { @@ -169,8 +169,8 @@ func addEnvsIfNotSet(envs map[string]string, envFile []byte) ([]byte, error) { // // Reloading systemd & restarting the unit has to be done separately by the caller func addSystemDEnvOverrides(ctx context.Context, unit string) (err error) { - span, _ := tracer.StartSpanFromContext(ctx, "add_systemd_env_overrides") - defer func() { span.Finish(tracer.WithError(err)) }() + span, _ := telemetry.StartSpanFromContext(ctx, "add_systemd_env_overrides") + defer func() { span.Finish(err) }() span.SetTag("unit", unit) // The - is important as it lets the unit start even if the file is missing. diff --git a/pkg/fleet/installer/packages/app_armor.go b/pkg/fleet/installer/packages/app_armor.go index bd0ea2889802e..054a319fe4139 100644 --- a/pkg/fleet/installer/packages/app_armor.go +++ b/pkg/fleet/installer/packages/app_armor.go @@ -15,8 +15,8 @@ import ( "path/filepath" "strings" + "github.com/DataDog/datadog-agent/pkg/fleet/telemetry" "github.com/DataDog/datadog-agent/pkg/util/log" - "gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer" ) const ( @@ -33,8 +33,8 @@ func setupAppArmor(ctx context.Context) (err error) { // no-op if apparmor is not installed return nil } - span, _ := tracer.StartSpanFromContext(ctx, "setup_app_armor") - defer func() { span.Finish(tracer.WithError(err)) }() + span, _ := telemetry.StartSpanFromContext(ctx, "setup_app_armor") + defer func() { span.Finish(err) }() if err = os.MkdirAll(appArmorConfigPath, 0755); err != nil { return fmt.Errorf("failed to create %s: %w", appArmorConfigPath, err) } @@ -61,8 +61,8 @@ func removeAppArmor(ctx context.Context) (err error) { } return err } - span, _ := tracer.StartSpanFromContext(ctx, "remove_app_armor") - defer span.Finish(tracer.WithError(err)) + span, _ := telemetry.StartSpanFromContext(ctx, "remove_app_armor") + defer span.Finish(err) if err = os.Remove(datadogProfilePath); err != nil { return err } diff --git a/pkg/fleet/installer/packages/datadog_agent.go b/pkg/fleet/installer/packages/datadog_agent.go index 7236096bbf1e1..7a07b99389ee0 100644 --- a/pkg/fleet/installer/packages/datadog_agent.go +++ b/pkg/fleet/installer/packages/datadog_agent.go @@ -16,14 +16,13 @@ import ( "path/filepath" "strings" + "github.com/DataDog/datadog-agent/pkg/fleet/telemetry" "github.com/DataDog/datadog-agent/pkg/util/installinfo" "github.com/DataDog/datadog-agent/pkg/util/log" - "gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer" ) const ( agentPackage = "datadog-agent" - pathOldAgent = "/opt/datadog-agent" agentSymlink = "/usr/bin/datadog-agent" agentUnit = "datadog-agent.service" traceAgentUnit = "datadog-agent-trace.service" @@ -55,6 +54,13 @@ var ( ) var ( + rootOwnedConfigPaths = []string{ + "security-agent.yaml", + "system-probe.yaml", + "inject/tracer.yaml", + "inject", + "managed", + } // matches omnibus/package-scripts/agent-deb/postinst rootOwnedAgentPaths = []string{ "embedded/bin/system-probe", @@ -66,29 +72,34 @@ var ( // PrepareAgent prepares the machine to install the agent func PrepareAgent(ctx context.Context) (err error) { - span, ctx := tracer.StartSpanFromContext(ctx, "prepare_agent") - defer func() { span.Finish(tracer.WithError(err)) }() + span, ctx := telemetry.StartSpanFromContext(ctx, "prepare_agent") + defer func() { span.Finish(err) }() - // Check if the agent has been installed by a package manager, if yes remove it - if !oldAgentInstalled() { - return nil // Nothing to do - } - err = stopOldAgentUnits(ctx) + err = removeDebRPMPackage(ctx, "datadog-agent") if err != nil { - return fmt.Errorf("failed to stop old agent units: %w", err) + return fmt.Errorf("failed to remove deb/rpm datadog-agent package: %w", err) + } + + for _, unit := range stableUnits { + if err := stopUnit(ctx, unit); err != nil { + log.Warnf("Failed to stop %s: %s", unit, err) + } + if err := disableUnit(ctx, unit); err != nil { + log.Warnf("Failed to disable %s: %s", unit, err) + } } return removeDebRPMPackage(ctx, agentPackage) } // SetupAgent installs and starts the agent func SetupAgent(ctx context.Context, _ []string) (err error) { - span, ctx := tracer.StartSpanFromContext(ctx, "setup_agent") + span, ctx := telemetry.StartSpanFromContext(ctx, "setup_agent") defer func() { if err != nil { log.Errorf("Failed to setup agent, reverting: %s", err) err = errors.Join(err, RemoveAgent(ctx)) } - span.Finish(tracer.WithError(err)) + span.Finish(err) }() for _, unit := range stableUnits { @@ -104,7 +115,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) } @@ -112,6 +123,9 @@ func SetupAgent(ctx context.Context, _ []string) (err error) { if err = os.Chown("/etc/datadog-agent", ddAgentUID, ddAgentGID); err != nil { return fmt.Errorf("failed to chown /etc/datadog-agent: %v", err) } + if err = chownRecursive("/etc/datadog-agent", ddAgentUID, ddAgentGID, rootOwnedConfigPaths); err != nil { + return fmt.Errorf("failed to chown /etc/datadog-agent: %v", err) + } if err = chownRecursive("/opt/datadog-packages/datadog-agent/stable/", ddAgentUID, ddAgentGID, rootOwnedAgentPaths); err != nil { return fmt.Errorf("failed to chown /opt/datadog-packages/datadog-agent/stable/: %v", err) } @@ -150,66 +164,51 @@ func SetupAgent(ctx context.Context, _ []string) (err error) { // RemoveAgent stops and removes the agent func RemoveAgent(ctx context.Context) error { - span, ctx := tracer.StartSpanFromContext(ctx, "remove_agent_units") - defer span.Finish() + span, ctx := telemetry.StartSpanFromContext(ctx, "remove_agent_units") + var spanErr error + defer func() { span.Finish(spanErr) }() // stop experiments, they can restart stable agent for _, unit := range experimentalUnits { if err := stopUnit(ctx, unit); err != nil { log.Warnf("Failed to stop %s: %s", unit, err) + spanErr = err } } // stop stable agents for _, unit := range stableUnits { if err := stopUnit(ctx, unit); err != nil { log.Warnf("Failed to stop %s: %s", unit, err) + spanErr = err } } if err := disableUnit(ctx, agentUnit); err != nil { log.Warnf("Failed to disable %s: %s", agentUnit, err) + spanErr = err } // remove units from disk for _, unit := range experimentalUnits { if err := removeUnit(ctx, unit); err != nil { log.Warnf("Failed to remove %s: %s", unit, err) + spanErr = err } } for _, unit := range stableUnits { if err := removeUnit(ctx, unit); err != nil { log.Warnf("Failed to remove %s: %s", unit, err) + spanErr = err } } if err := os.Remove(agentSymlink); err != nil { log.Warnf("Failed to remove agent symlink: %s", err) + spanErr = err } installinfo.RmInstallInfo() // TODO: Return error to caller? return nil } -func oldAgentInstalled() bool { - _, err := os.Stat(pathOldAgent) - return err == nil -} - -func stopOldAgentUnits(ctx context.Context) error { - if !oldAgentInstalled() { - return nil - } - span, ctx := tracer.StartSpanFromContext(ctx, "remove_old_agent_units") - defer span.Finish() - for _, unit := range stableUnits { - if err := stopUnit(ctx, unit); err != nil { - return fmt.Errorf("failed to stop %s: %v", unit, err) - } - if err := disableUnit(ctx, unit); err != nil { - return fmt.Errorf("failed to disable %s: %v", unit, err) - } - } - return nil -} - func chownRecursive(path string, uid int, gid int, ignorePaths []string) error { return filepath.Walk(path, func(p string, _ os.FileInfo, err error) error { if err != nil { @@ -230,7 +229,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_agent_windows.go b/pkg/fleet/installer/packages/datadog_agent_windows.go index d330ab434d0e0..48e3e1e00148c 100644 --- a/pkg/fleet/installer/packages/datadog_agent_windows.go +++ b/pkg/fleet/installer/packages/datadog_agent_windows.go @@ -10,11 +10,13 @@ package packages import ( "context" "fmt" - + "github.com/DataDog/datadog-agent/pkg/fleet/internal/msi" + "github.com/DataDog/datadog-agent/pkg/fleet/internal/paths" "github.com/DataDog/datadog-agent/pkg/fleet/internal/winregistry" + "github.com/DataDog/datadog-agent/pkg/fleet/telemetry" "github.com/DataDog/datadog-agent/pkg/util/log" - - "gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer" + "os" + "path" ) const ( @@ -28,12 +30,11 @@ func PrepareAgent(_ context.Context) error { // SetupAgent installs and starts the agent func SetupAgent(ctx context.Context, args []string) (err error) { - span, _ := tracer.StartSpanFromContext(ctx, "setup_agent") + span, _ := telemetry.StartSpanFromContext(ctx, "setup_agent") defer func() { - if err != nil { - log.Errorf("Failed to setup agent: %s", err) - } - span.Finish(tracer.WithError(err)) + // Don't log error here, or it will appear twice in the output + // since installerImpl.Install will also print the error. + span.Finish(err) }() // Make sure there are no Agent already installed _ = removeAgentIfInstalled(ctx) @@ -43,12 +44,12 @@ func SetupAgent(ctx context.Context, args []string) (err error) { // StartAgentExperiment starts the agent experiment func StartAgentExperiment(ctx context.Context) (err error) { - span, _ := tracer.StartSpanFromContext(ctx, "start_experiment") + span, _ := telemetry.StartSpanFromContext(ctx, "start_experiment") defer func() { if err != nil { log.Errorf("Failed to start agent experiment: %s", err) } - span.Finish(tracer.WithError(err)) + span.Finish(err) }() err = removeAgentIfInstalled(ctx) @@ -66,12 +67,12 @@ func StartAgentExperiment(ctx context.Context) (err error) { // StopAgentExperiment stops the agent experiment, i.e. removes/uninstalls it. func StopAgentExperiment(ctx context.Context) (err error) { - span, _ := tracer.StartSpanFromContext(ctx, "stop_experiment") + span, _ := telemetry.StartSpanFromContext(ctx, "stop_experiment") defer func() { if err != nil { log.Errorf("Failed to stop agent experiment: %s", err) } - span.Finish(tracer.WithError(err)) + span.Finish(err) }() err = removeAgentIfInstalled(ctx) @@ -109,30 +110,48 @@ func installAgentPackage(target string, args []string) error { if err != nil { return fmt.Errorf("failed to get Agent user: %w", err) } - args = append(args, fmt.Sprintf("DDAGENTUSER_NAME=%s", agentUser)) - cmd, err := msiexec(target, datadogAgent, "/i", args) + rootPath := "" + _, err = os.Stat(paths.RootTmpDir) + // If bootstrap has not been called before, `paths.RootTmpDir` might not exist + if os.IsExist(err) { + rootPath = paths.RootTmpDir + } + tempDir, err := os.MkdirTemp(rootPath, "datadog-agent") + if err != nil { + return err + } + logFile := path.Join(tempDir, "msi.log") + + cmd, err := msi.Cmd( + msi.Install(), + msi.WithMsiFromPackagePath(target, datadogAgent), + msi.WithDdAgentUserName(agentUser), + msi.WithAdditionalArgs(args), + msi.WithLogFile(path.Join(tempDir, "msi.log")), + ) + var output []byte if err == nil { - err = cmd.Run() + output, err = cmd.Run() } if err != nil { - return fmt.Errorf("failed to install Agent %s: %w", target, err) + return fmt.Errorf("failed to install Agent %s: %w\nLog file located at: %s\n%s", target, err, logFile, string(output)) } return nil } func removeAgentIfInstalled(ctx context.Context) (err error) { - if isProductInstalled("Datadog Agent") { - span, _ := tracer.StartSpanFromContext(ctx, "remove_agent") + if msi.IsProductInstalled("Datadog Agent") { + span, _ := telemetry.StartSpanFromContext(ctx, "remove_agent") defer func() { if err != nil { // removal failed, this should rarely happen. // Rollback might have restored the Agent, but we can't be sure. log.Errorf("Failed to remove agent: %s", err) } - span.Finish(tracer.WithError(err)) + span.Finish(err) }() - err := removeProduct("Datadog Agent") + err := msi.RemoveProduct("Datadog Agent") if err != nil { return err } diff --git a/pkg/fleet/installer/packages/datadog_installer.go b/pkg/fleet/installer/packages/datadog_installer.go index ceaf08bf330d6..1e36bb462c1fd 100644 --- a/pkg/fleet/installer/packages/datadog_installer.go +++ b/pkg/fleet/installer/packages/datadog_installer.go @@ -41,6 +41,17 @@ func addDDAgentGroup(ctx context.Context) error { return exec.CommandContext(ctx, "groupadd", "--system", "dd-agent").Run() } +// PrepareInstaller prepares the installer +func PrepareInstaller(ctx context.Context) error { + if err := stopUnit(ctx, installerUnit); err != nil { + log.Warnf("Failed to stop unit %s: %s", installerUnit, err) + } + if err := disableUnit(ctx, installerUnit); err != nil { + log.Warnf("Failed to disable %s: %s", installerUnit, err) + } + return nil +} + // SetupInstaller installs and starts the installer systemd units func SetupInstaller(ctx context.Context) (err error) { defer func() { @@ -60,7 +71,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 +176,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/datadog_installer_windows.go b/pkg/fleet/installer/packages/datadog_installer_windows.go index 2d8dc8241c541..6df65c397dd69 100644 --- a/pkg/fleet/installer/packages/datadog_installer_windows.go +++ b/pkg/fleet/installer/packages/datadog_installer_windows.go @@ -10,78 +10,80 @@ package packages import ( "context" + "fmt" + "os" + "path" - "github.com/DataDog/datadog-agent/pkg/util/log" - "gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer" + "github.com/DataDog/datadog-agent/pkg/fleet/internal/msi" + "github.com/DataDog/datadog-agent/pkg/fleet/internal/paths" ) const ( datadogInstaller = "datadog-installer" ) +// PrepareInstaller prepares the installer +func PrepareInstaller(_ context.Context) error { + return nil +} + // SetupInstaller installs and starts the installer -func SetupInstaller(ctx context.Context) (err error) { - span, _ := tracer.StartSpanFromContext(ctx, "setup_installer") - defer func() { - if err != nil { - log.Errorf("Failed to setup installer: %s", err) - } - span.Finish(tracer.WithError(err)) - }() - cmd, err := msiexec("stable", datadogInstaller, "/i", nil) - if err == nil { - // This is the first time that we are installing the installer, - // so we can run it synchronously. - err = cmd.Run() +func SetupInstaller(_ context.Context) error { + rootPath := "" + _, err := os.Stat(paths.RootTmpDir) + // If bootstrap has not been called before, `paths.RootTmpDir` might not exist + if os.IsExist(err) { + rootPath = paths.RootTmpDir + } + tempDir, err := os.MkdirTemp(rootPath, "datadog-installer") + if err != nil { + return err + } + + cmd, err := msi.Cmd(msi.Install(), msi.WithMsiFromPackagePath("stable", datadogInstaller), msi.WithLogFile(path.Join(tempDir, "setup_installer.log"))) + if err != nil { + return fmt.Errorf("failed to setup installer: %w", err) } - return err + output, err := cmd.Run() + if err != nil { + return fmt.Errorf("failed to setup installer: %w\n%s", err, string(output)) + } + return nil } // RemoveInstaller removes the installer -func RemoveInstaller(ctx context.Context) (err error) { - span, _ := tracer.StartSpanFromContext(ctx, "remove_installer") - defer func() { - if err != nil { - log.Errorf("Failed to remove installer: %s", err) - } - span.Finish(tracer.WithError(err)) - }() - err = removeProduct("Datadog Installer") - return err +func RemoveInstaller(_ context.Context) error { + return msi.RemoveProduct("Datadog Installer") } // StartInstallerExperiment starts the installer experiment -func StartInstallerExperiment(ctx context.Context) (err error) { - span, _ := tracer.StartSpanFromContext(ctx, "start_installer_experiment") - defer func() { - if err != nil { - log.Errorf("Failed to start installer experiment: %s", err) - } - span.Finish(tracer.WithError(err)) - }() - cmd, err := msiexec("experiment", datadogInstaller, "/i", nil) - if err == nil { - // Launch the msiexec process asynchronously. - err = cmd.Start() +func StartInstallerExperiment(_ context.Context) error { + tempDir, err := os.MkdirTemp(paths.RootTmpDir, "datadog-installer") + if err != nil { + return err + } + + cmd, err := msi.Cmd(msi.Install(), msi.WithMsiFromPackagePath("experiment", datadogInstaller), msi.WithLogFile(path.Join(tempDir, "start_installer_experiment.log"))) + if err != nil { + return fmt.Errorf("failed to start installer experiment: %w", err) } - return err + // Launch the msiexec process asynchronously. + return cmd.FireAndForget() } // StopInstallerExperiment stops the installer experiment -func StopInstallerExperiment(ctx context.Context) (err error) { - span, _ := tracer.StartSpanFromContext(ctx, "stop_installer_experiment") - defer func() { - if err != nil { - log.Errorf("Failed to stop installer experiment: %s", err) - } - span.Finish(tracer.WithError(err)) - }() - cmd, err := msiexec("stable", datadogInstaller, "/i", nil) - if err == nil { - // Launch the msiexec process asynchronously. - err = cmd.Start() +func StopInstallerExperiment(_ context.Context) error { + tempDir, err := os.MkdirTemp(paths.RootTmpDir, "datadog-installer") + if err != nil { + return err + } + + cmd, err := msi.Cmd(msi.Install(), msi.WithMsiFromPackagePath("stable", datadogInstaller), msi.WithLogFile(path.Join(tempDir, "stop_installer_experiment.log"))) + if err != nil { + return fmt.Errorf("failed to stop installer experiment: %w", err) } - return err + // Launch the msiexec process asynchronously. + return cmd.FireAndForget() } // PromoteInstallerExperiment promotes the installer experiment diff --git a/pkg/fleet/installer/packages/docker.go b/pkg/fleet/installer/packages/docker.go index 8c19fc04a4ec8..a8d1b2f110f4b 100644 --- a/pkg/fleet/installer/packages/docker.go +++ b/pkg/fleet/installer/packages/docker.go @@ -20,9 +20,9 @@ import ( "syscall" "time" + "github.com/DataDog/datadog-agent/pkg/fleet/telemetry" "github.com/DataDog/datadog-agent/pkg/util/log" - "github.com/shirou/gopsutil/v3/process" - "gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer" + "github.com/shirou/gopsutil/v4/process" ) type dockerDaemonConfig map[string]interface{} @@ -73,14 +73,14 @@ func (a *apmInjectorInstaller) uninstrumentDocker(ctx context.Context) error { } // setDockerConfigContent sets the content of the docker daemon configuration -func (a *apmInjectorInstaller) setDockerConfigContent(ctx context.Context, previousContent []byte) ([]byte, error) { - span, _ := tracer.StartSpanFromContext(ctx, "set_docker_config_content") - defer span.Finish() +func (a *apmInjectorInstaller) setDockerConfigContent(ctx context.Context, previousContent []byte) (res []byte, err error) { + span, _ := telemetry.StartSpanFromContext(ctx, "set_docker_config_content") + defer span.Finish(err) dockerConfig := dockerDaemonConfig{} if len(previousContent) > 0 { - err := json.Unmarshal(previousContent, &dockerConfig) + err = json.Unmarshal(previousContent, &dockerConfig) if err != nil { return nil, err } @@ -140,15 +140,16 @@ func (a *apmInjectorInstaller) deleteDockerConfigContent(_ context.Context, prev // // This method is valid since at least Docker 17.03 (last update 2018-08-30) func (a *apmInjectorInstaller) verifyDockerRuntime(ctx context.Context) (err error) { - span, _ := tracer.StartSpanFromContext(ctx, "verify_docker_runtime") - defer func() { span.Finish(tracer.WithError(err)) }() + span, _ := telemetry.StartSpanFromContext(ctx, "verify_docker_runtime") + defer func() { span.Finish(err) }() if !isDockerActive(ctx) { log.Warn("docker is inactive, skipping docker runtime verification") return nil } - for i := 0; i < 3; i++ { + currentRuntime := "" + for i := 0; i < 5; i++ { if i > 0 { time.Sleep(time.Second) } @@ -157,23 +158,28 @@ func (a *apmInjectorInstaller) verifyDockerRuntime(ctx context.Context) (err err cmd.Stdout = &outb err = cmd.Run() if err != nil { - if i < 2 { + if i < 5 { log.Debug("failed to verify docker runtime, retrying: ", err) } else { log.Warn("failed to verify docker runtime: ", err) } } if strings.TrimSpace(outb.String()) == "dd-shim" { + span.SetTag("retries", i) + span.SetTag("docker_runtime", "dd-shim") return nil } + currentRuntime = strings.TrimSpace(outb.String()) } - err = fmt.Errorf("docker default runtime has not been set to injector docker runtime") + span.SetTag("retries", 5) + span.SetTag("docker_runtime", currentRuntime) + err = fmt.Errorf("docker default runtime has not been set to injector docker runtime (is \"%s\")", currentRuntime) return err } func reloadDockerConfig(ctx context.Context) (err error) { - span, _ := tracer.StartSpanFromContext(ctx, "reload_docker") - defer func() { span.Finish(tracer.WithError(err)) }() + span, _ := telemetry.StartSpanFromContext(ctx, "reload_docker") + defer func() { span.Finish(err) }() if !isDockerActive(ctx) { log.Warn("docker is inactive, skipping docker reload") return nil @@ -205,8 +211,8 @@ func reloadDockerConfig(ctx context.Context) (err error) { // isDockerInstalled checks if docker is installed on the system func isDockerInstalled(ctx context.Context) bool { - span, _ := tracer.StartSpanFromContext(ctx, "is_docker_installed") - defer span.Finish() + span, _ := telemetry.StartSpanFromContext(ctx, "is_docker_installed") + defer span.Finish(nil) // Docker is installed if the docker binary is in the PATH _, err := exec.LookPath("docker") diff --git a/pkg/fleet/installer/packages/file.go b/pkg/fleet/installer/packages/file.go index b8670b26ee34d..f6e6b7eeadb70 100644 --- a/pkg/fleet/installer/packages/file.go +++ b/pkg/fleet/installer/packages/file.go @@ -15,8 +15,8 @@ import ( "os" "syscall" + "github.com/DataDog/datadog-agent/pkg/fleet/telemetry" "github.com/DataDog/datadog-agent/pkg/util/log" - "gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer" ) var rollbackNoop = func() error { return nil } @@ -46,8 +46,8 @@ func newFileMutator(path string, transform func(ctx context.Context, existing [] } func (ft *fileMutator) mutate(ctx context.Context) (rollback func() error, err error) { - span, ctx := tracer.StartSpanFromContext(ctx, "mutate_file") - defer func() { span.Finish(tracer.WithError(err)) }() + span, ctx := telemetry.StartSpanFromContext(ctx, "mutate_file") + defer func() { span.Finish(err) }() span.SetTag("file", ft.path) defer os.Remove(ft.pathTmp) diff --git a/pkg/fleet/installer/packages/pkg_manager.go b/pkg/fleet/installer/packages/pkg_manager.go index e74dba210a015..90eb34a5b2f52 100644 --- a/pkg/fleet/installer/packages/pkg_manager.go +++ b/pkg/fleet/installer/packages/pkg_manager.go @@ -8,44 +8,62 @@ package packages import ( - "bytes" "context" + "errors" "fmt" "os/exec" - "gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer" + "github.com/DataDog/datadog-agent/pkg/fleet/telemetry" ) +func dpkgInstalled() (bool, error) { + _, err := exec.LookPath("dpkg") + if err != nil && !errors.Is(err, exec.ErrNotFound) { + return false, err + } + return err == nil, nil +} + +func rpmInstalled() (bool, error) { + _, err := exec.LookPath("rpm") + if err != nil && !errors.Is(err, exec.ErrNotFound) { + return false, err + } + return err == nil, nil +} + // removeDebRPMPackage removes a package installed via deb/rpm package manager // It doesn't remove dependencies or purge as we want to keep existing configuration files // and reinstall the package using the installer. // Note: we don't run the pre/post remove scripts as we want to avoid surprises for older agent versions (like removing config) func removeDebRPMPackage(ctx context.Context, pkg string) (err error) { - span, _ := tracer.StartSpanFromContext(ctx, "remove_deb_rpm_package") - defer func() { span.Finish(tracer.WithError(err)) }() - // Compute the right command depending on the package manager - var cmd *exec.Cmd - if _, pathErr := exec.LookPath("dpkg"); pathErr == nil { - // Doesn't fail if the package isn't installed - cmd = exec.Command("dpkg", "-r", "--no-triggers", agentPackage) - } else if _, pathErr := exec.LookPath("rpm"); pathErr == nil { - // Check if package exist, else the command will fail - pkgErr := exec.Command("rpm", "-q", agentPackage).Run() - if pkgErr == nil { - cmd = exec.Command("rpm", "-e", "--nodeps", "--noscripts", agentPackage) - } - } - - if cmd == nil { - // If we can't find a package manager or the package is not installed, ignore this step + span, _ := telemetry.StartSpanFromContext(ctx, "removeDebRPMPackage") + defer func() { span.Finish(err) }() + + dpkgInstalled, err := dpkgInstalled() + if err != nil { + return err + } + rpmInstalled, err := rpmInstalled() + if err != nil { + return err + } + var packageInstalled bool + var removeCmd *exec.Cmd + if dpkgInstalled { + removeCmd = exec.Command("dpkg", "-r", pkg) + packageInstalled = exec.Command("dpkg", "-s", pkg).Run() == nil + } + if rpmInstalled { + removeCmd = exec.Command("rpm", "-e", pkg) + packageInstalled = exec.Command("rpm", "-q", pkg).Run() == nil + } + if !packageInstalled { return nil } - - // Run the command - var buf bytes.Buffer - cmd.Stderr = &buf - if err := cmd.Run(); err != nil { - return fmt.Errorf("failed to uninstall deb/rpm package %s (%w): %s", pkg, err, buf.String()) + out, err := removeCmd.CombinedOutput() + if err != nil { + return fmt.Errorf("failed to uninstall deb/rpm package %s (%w): %s", pkg, err, out) } return nil } diff --git a/pkg/fleet/installer/packages/systemd.go b/pkg/fleet/installer/packages/systemd.go index 679331907f7fd..0daf5623b8332 100644 --- a/pkg/fleet/installer/packages/systemd.go +++ b/pkg/fleet/installer/packages/systemd.go @@ -17,15 +17,15 @@ import ( "path/filepath" "github.com/DataDog/datadog-agent/pkg/fleet/installer/packages/embedded" + "github.com/DataDog/datadog-agent/pkg/fleet/telemetry" "github.com/DataDog/datadog-agent/pkg/util/log" - "gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer" ) const systemdPath = "/etc/systemd/system" func stopUnit(ctx context.Context, unit string, args ...string) (err error) { - span, _ := tracer.StartSpanFromContext(ctx, "stop_unit") - defer func() { span.Finish(tracer.WithError(err)) }() + span, _ := telemetry.StartSpanFromContext(ctx, "stop_unit") + defer func() { span.Finish(err) }() span.SetTag("unit", unit) args = append([]string{"stop", unit}, args...) err = exec.CommandContext(ctx, "systemctl", args...).Run() @@ -42,8 +42,8 @@ func stopUnit(ctx context.Context, unit string, args ...string) (err error) { } func startUnit(ctx context.Context, unit string, args ...string) (err error) { - span, _ := tracer.StartSpanFromContext(ctx, "start_unit") - defer func() { span.Finish(tracer.WithError(err)) }() + span, _ := telemetry.StartSpanFromContext(ctx, "start_unit") + defer func() { span.Finish(err) }() span.SetTag("unit", unit) args = append([]string{"start", unit}, args...) err = exec.CommandContext(ctx, "systemctl", args...).Run() @@ -56,8 +56,8 @@ func startUnit(ctx context.Context, unit string, args ...string) (err error) { } func enableUnit(ctx context.Context, unit string) (err error) { - span, _ := tracer.StartSpanFromContext(ctx, "enable_unit") - defer func() { span.Finish(tracer.WithError(err)) }() + span, _ := telemetry.StartSpanFromContext(ctx, "enable_unit") + defer func() { span.Finish(err) }() span.SetTag("unit", unit) err = exec.CommandContext(ctx, "systemctl", "enable", unit).Run() exitErr := &exec.ExitError{} @@ -69,8 +69,8 @@ func enableUnit(ctx context.Context, unit string) (err error) { } func disableUnit(ctx context.Context, unit string) (err error) { - span, _ := tracer.StartSpanFromContext(ctx, "disable_unit") - defer func() { span.Finish(tracer.WithError(err)) }() + span, _ := telemetry.StartSpanFromContext(ctx, "disable_unit") + defer func() { span.Finish(err) }() span.SetTag("unit", unit) enabledErr := exec.CommandContext(ctx, "systemctl", "is-enabled", "--quiet", unit).Run() @@ -93,8 +93,8 @@ func disableUnit(ctx context.Context, unit string) (err error) { } func loadUnit(ctx context.Context, unit string) (err error) { - span, _ := tracer.StartSpanFromContext(ctx, "load_unit") - defer func() { span.Finish(tracer.WithError(err)) }() + span, _ := telemetry.StartSpanFromContext(ctx, "load_unit") + defer func() { span.Finish(err) }() span.SetTag("unit", unit) content, err := embedded.FS.ReadFile(unit) if err != nil { @@ -105,15 +105,19 @@ func loadUnit(ctx context.Context, unit string) (err error) { } func removeUnit(ctx context.Context, unit string) (err error) { - span, _ := tracer.StartSpanFromContext(ctx, "remove_unit") - defer func() { span.Finish(tracer.WithError(err)) }() + span, _ := telemetry.StartSpanFromContext(ctx, "remove_unit") + defer func() { span.Finish(err) }() span.SetTag("unit", unit) - return os.Remove(path.Join(systemdPath, unit)) + err = os.Remove(path.Join(systemdPath, unit)) + if err != nil && !os.IsNotExist(err) { + return err + } + return nil } func systemdReload(ctx context.Context) (err error) { - span, _ := tracer.StartSpanFromContext(ctx, "systemd_reload") - defer func() { span.Finish(tracer.WithError(err)) }() + span, _ := telemetry.StartSpanFromContext(ctx, "systemd_reload") + defer func() { span.Finish(err) }() err = exec.CommandContext(ctx, "systemctl", "daemon-reload").Run() exitErr := &exec.ExitError{} if !errors.As(err, &exitErr) { diff --git a/pkg/fleet/installer/setup/common/config.go b/pkg/fleet/installer/setup/common/config.go index 5ec929682808b..fb4550edebb65 100644 --- a/pkg/fleet/installer/setup/common/config.go +++ b/pkg/fleet/installer/setup/common/config.go @@ -3,239 +3,225 @@ // 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" - "github.com/DataDog/datadog-agent/pkg/fleet/internal/paths" - "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, "/etc/datadog-agent/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"` - Source string `yaml:"source"` -} - -type sparkConfig struct { - InitConfig interface{} `yaml:"init_config"` - 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"` - ClusterName string `yaml:"cluster_name"` - StreamingMetrics bool `yaml:"streaming_metrics"` +func writeConfigs(config Config, configDir string) error { + err := writeConfig(filepath.Join(configDir, datadogConfFile), config.DatadogYAML, 0640, true) + if err != nil { + return fmt.Errorf("could not write datadog.yaml: %w", err) + } + 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 } -type injectorConfig struct { - Version int `yaml:"version"` - ConfigSources string `yaml:"config_sources"` - EnvsToInject []EnvVar `yaml:"additional_environment_variables"` +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) + } + 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) + } + 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 } -// EnvVar is a struct that represents an environment variable -type EnvVar struct { - Key string `yaml:"key"` - Value string `yaml:"value"` +// 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 } -// 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() - if err != nil { - return nil, fmt.Errorf("failed to get agent user and group IDs: %v", err) - } - return newHostInstaller(env, ddUID, ddGID) +// 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"` + Proxy DatadogConfigProxy `yaml:"proxy,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"` } -func newHostInstaller(env *env.Env, ddUID, ddGID int) (*HostInstaller, error) { - i := &HostInstaller{} - if env.APIKey == "" { - return nil, fmt.Errorf("DD_API key is required") - } - i.AddAgentConfig("api_key", env.APIKey) - - if env.Site != "" { - i.AddAgentConfig("site", env.Site) - } - i.ddUID = ddUID - i.ddGID = ddGID - i.env = env - return i, nil +// DatadogConfigProxy represents the configuration for the proxy +type DatadogConfigProxy struct { + HTTP string `yaml:"http,omitempty"` + HTTPS string `yaml:"https,omitempty"` + NoProxy []string `yaml:"no_proxy,omitempty"` } -// SetAgentVersion sets the agent version to install -func (i *HostInstaller) SetAgentVersion(version string) { - i.agentVersion = version +// DatadogConfigDJM represents the configuration for the Data Jobs Monitoring +type DatadogConfigDJM struct { + Enabled bool `yaml:"enabled,omitempty"` } -// SetInjectorVersion sets the injector version to install -func (i *HostInstaller) SetInjectorVersion(version string) { - i.injectorVersion = version +// DatadogConfigProcessConfig represents the configuration for the process agent +type DatadogConfigProcessConfig struct { + ExpvarPort int `yaml:"expvar_port,omitempty"` } -// SetJavaTracerVersion sets the java tracer version to install -func (i *HostInstaller) SetJavaTracerVersion(version string) { - i.javaVersion = version +// IntegrationConfig represents the configuration for an integration under conf.d/ +type IntegrationConfig struct { + InitConfig []any `yaml:"init_config"` + Instances []any `yaml:"instances,omitempty"` + Logs []IntegrationConfigLogs `yaml:"logs,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}) +// 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"` } -// AddAgentConfig adds a key value pair to the agent agentConfiguration -func (i *HostInstaller) AddAgentConfig(key string, value interface{}) { - i.agentConfig[key] = value +// 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"` } -// 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) - } +// IntegrationConfigInstanceYarn represents the configuration for the Yarn integration +type IntegrationConfigInstanceYarn struct { + ResourceManagerURI string `yaml:"resourcemanager_uri"` + ClusterName string `yaml:"cluster_name"` } -// AddSparkInstance adds a spark instance to the agent agentConfiguration -func (i *HostInstaller) AddSparkInstance(spark SparkInstance) { - i.sparkConfig.Instances = append(i.sparkConfig.Instances, spark) +// 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"` } -// AddHostTag adds a host tag to the agent agentConfiguration -func (i *HostInstaller) AddHostTag(key, value string) { - i.hostTags = append(i.hostTags, tag{key, value}) +// InjectTracerConfigEnvVar represents an environment variable to inject +type InjectTracerConfigEnvVar struct { + Key string `yaml:"key"` + Value string `yaml:"value"` } -func (i *HostInstaller) writeYamlConfig(path string, yml interface{}, perm os.FileMode, agentOwner bool) error { - data, err := yaml.Marshal(yml) - if err != nil { - return err +// 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 - } - } - if len(i.sparkConfig.Instances) > 0 { - if err := i.writeYamlConfig(sparkConfigFile, i.sparkConfig, 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.injectorConfig.EnvsToInject) > 0 { - if err := i.writeYamlConfig(injectTracerConfigFile, i.injectorConfig, 0644, false); 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 } - 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 +} - cmd := exec.NewInstallerExec(i.env, paths.StableInstallerPath) +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 new file mode 100644 index 0000000000000..7a98560656730 --- /dev/null +++ b/pkg/fleet/installer/setup/common/config_test.go @@ -0,0 +1,168 @@ +// 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 common + +import ( + "os" + "path/filepath" + "testing" + + "github.com/stretchr/testify/assert" + "gopkg.in/yaml.v3" +) + +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, map[string]interface{}{ + "version": 1, + "config_sources": "env", + "additional_environment_variables": []interface{}{ + map[string]interface{}{ + "key": "DD_ENV", + "value": "prod", + }, + }, + }, injectTracer) +} + +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{}{ + "init_config": []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/output.go b/pkg/fleet/installer/setup/common/output.go new file mode 100644 index 0000000000000..cc42f5e4c8d02 --- /dev/null +++ b/pkg/fleet/installer/setup/common/output.go @@ -0,0 +1,18 @@ +// 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 "io" + +// Output is a writer for the output. It will support some ANSI escape sequences to format the output. +type Output struct { + tty io.Writer +} + +// WriteString writes a string to the output. +func (o *Output) WriteString(s string) { + _, _ = o.tty.Write([]byte(s)) +} 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..b6e512d7dc5d6 --- /dev/null +++ b/pkg/fleet/installer/setup/common/setup.go @@ -0,0 +1,142 @@ +// 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" + "io" + "os" + "strings" + "time" + + "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" + "github.com/DataDog/datadog-agent/pkg/fleet/telemetry" + "github.com/DataDog/datadog-agent/pkg/version" +) + +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 + start time.Time + flavor string + + Out *Output + Env *env.Env + Ctx context.Context + Span *telemetry.Span + Packages Packages + Config Config +} + +// NewSetup creates a new Setup structure with some default values. +func NewSetup(ctx context.Context, env *env.Env, flavor string, flavorPath string, logOutput io.Writer) (*Setup, error) { + header := `Datadog Installer %s - https://www.datadoghq.com +Running the %s installation script (https://github.com/DataDog/datadog-agent/tree/%s/pkg/fleet/installer/setup/%s) - %s +` + start := time.Now() + output := &Output{tty: logOutput} + output.WriteString(fmt.Sprintf(header, version.AgentVersion, flavor, version.Commit, flavorPath, start.Format(time.RFC3339))) + if env.APIKey == "" { + return nil, ErrNoAPIKey + } + installer, err := installer.NewInstaller(env) + if err != nil { + return nil, fmt.Errorf("failed to create installer: %w", err) + } + var proxyNoProxy []string + if os.Getenv("DD_PROXY_NO_PROXY") != "" { + proxyNoProxy = strings.Split(os.Getenv("DD_PROXY_NO_PROXY"), ",") + } + span, ctx := telemetry.StartSpanFromContext(ctx, fmt.Sprintf("setup.%s", flavor)) + s := &Setup{ + configDir: configDir, + installer: installer, + start: start, + flavor: flavor, + Out: output, + Env: env, + Ctx: ctx, + Span: span, + Config: Config{ + DatadogYAML: DatadogConfig{ + APIKey: env.APIKey, + Hostname: os.Getenv("DD_HOSTNAME"), + Site: env.Site, + Proxy: DatadogConfigProxy{ + HTTP: os.Getenv("DD_PROXY_HTTP"), + HTTPS: os.Getenv("DD_PROXY_HTTPS"), + NoProxy: proxyNoProxy, + }, + 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(err) }() + s.Out.WriteString("Applying configurations...\n") + err = writeConfigs(s.Config, s.configDir) + if err != nil { + return fmt.Errorf("failed to write configuration: %w", err) + } + packages := resolvePackages(s.Packages) + s.Out.WriteString("The following packages will be installed:\n") + s.Out.WriteString(fmt.Sprintf(" - %s / %s\n", "datadog-installer", version.AgentVersion)) + for _, p := range packages { + s.Out.WriteString(fmt.Sprintf(" - %s / %s\n", p.name, p.version)) + } + err = s.installPackage("datadog-installer", installerOCILayoutURL) + if err != nil { + return fmt.Errorf("failed to install installer: %w", err) + } + for _, p := range packages { + url := oci.PackageURL(s.Env, p.name, p.version) + err = s.installPackage(p.name, url) + if err != nil { + return fmt.Errorf("failed to install package %s: %w", url, err) + } + } + s.Out.WriteString(fmt.Sprintf("Successfully ran the %s install script in %s!\n", s.flavor, time.Since(s.start).Round(time.Second))) + return nil +} + +// installPackage mimicks the telemetry of calling the install package command +func (s *Setup) installPackage(name string, url string) (err error) { + span, ctx := telemetry.StartSpanFromContext(s.Ctx, "install") + defer func() { span.Finish(err) }() + span.SetTag("url", url) + span.SetTopLevel() + + s.Out.WriteString(fmt.Sprintf("Installing %s...\n", name)) + err = s.installer.Install(ctx, url, nil) + if err != nil { + return err + } + s.Out.WriteString(fmt.Sprintf("Successfully installed %s\n", name)) + return nil +} diff --git a/pkg/fleet/installer/setup/djm/databricks.go b/pkg/fleet/installer/setup/djm/databricks.go index f13127c4dcbc5..e1e699f65a2de 100644 --- a/pkg/fleet/installer/setup/djm/databricks.go +++ b/pkg/fleet/installer/setup/djm/databricks.go @@ -3,188 +3,206 @@ // 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" + "regexp" + "strings" - "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" - databricksJavaVersion = "1.41.1" - databricksAgentVersion = "7.57.2" - logsService = "databricks" + databricksInjectorVersion = "0.26.0-1" + databricksJavaTracerVersion = "1.42.2-1" + databricksAgentVersion = "7.58.2-1" ) -type databricksSetup struct { - ctx context.Context - *common.HostInstaller - setupIssues []string -} +var ( + jobNameRegex = regexp.MustCompile(`[,\']`) + clusterNameRegex = regexp.MustCompile(`[^a-zA-Z0-9_:.-]`) + 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", + }, + } + tracerEnvConfigDatabricks = []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) + s.Packages.Install(common.DatadogAPMInjectPackage, databricksInjectorVersion) + s.Packages.Install(common.DatadogAPMLibraryJavaPackage, databricksJavaTracerVersion) - 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, - } - return ds.setup() -} - -func (ds *databricksSetup) setup() error { - // agent binary to install - ds.SetAgentVersion(databricksAgentVersion) + 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 - // avoid port conflict - ds.AddAgentConfig("process_config.expvar_port", -1) - ds.AddAgentConfig("expected_tags_duration", "10m") - ds.AddAgentConfig("djm_config.enabled", true) + s.Config.InjectTracerYAML.AdditionalEnvironmentVariables = tracerEnvConfigDatabricks - ds.extractHostTagsFromEnv() + setupCommonHostTags(s) + installMethod := "manual" + if os.Getenv("DD_DJM_INIT_IS_MANAGED_INSTALL") != "true" { + installMethod = "managed" + } + s.Span.SetTag("install_method", installMethod) - 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 setupCommonHostTags(s *common.Setup) { + setIfExists(s, "DB_DRIVER_IP", "spark_host_ip", nil) + setIfExists(s, "DB_INSTANCE_TYPE", "databricks_instance_type", nil) + setIfExists(s, "DB_IS_JOB_CLUSTER", "databricks_is_job_cluster", nil) + setIfExists(s, "DD_JOB_NAME", "job_name", func(v string) string { + return jobNameRegex.ReplaceAllString(v, "_") + }) + setIfExists(s, "DB_CLUSTER_NAME", "databricks_cluster_name", func(v string) string { + return clusterNameRegex.ReplaceAllString(v, "_") + }) + setIfExists(s, "DB_CLUSTER_ID", "databricks_cluster_id", nil) -var varExtractions = []varExtraction{ - {"DATABRICKS_WORKSPACE", "workspace"}, - {"DB_CLUSTER_NAME", "databricks_cluster_name"}, - {"DB_CLUSTER_ID", "databricks_cluster_id"}, - {"DB_NODE_TYPE", "databricks_node_type"}, -} + // dupes for backward compatibility + setIfExists(s, "DB_CLUSTER_ID", "cluster_id", nil) + setIfExists(s, "DB_CLUSTER_NAME", "cluster_name", func(v string) string { + return clusterNameRegex.ReplaceAllString(v, "_") + }) -func (ds *databricksSetup) extractHostTagsFromEnv() { - for _, ve := range varExtractions { - if val, ok := os.LookupEnv(ve.envVar); ok { - ds.AddHostTag(ve.tagKey, val) - continue - } - ds.setupIssues = append(ds.setupIssues, ve.envVar+"_not_set") + jobID, runID, ok := getJobAndRunIDs() + if ok { + setHostTag(s, "jobid", jobID) + setHostTag(s, "runid", runID) } } -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 getJobAndRunIDs() (jobID, runID string, ok bool) { + clusterName := os.Getenv("DB_CLUSTER_NAME") + if !strings.HasPrefix(clusterName, "job-") { + return "", "", false + } + if !strings.Contains(clusterName, "-run-") { + return "", "", false + } + parts := strings.Split(clusterName, "-") + if len(parts) != 4 { + return "", "", false + } + if parts[0] != "job" || parts[2] != "run" { + return "", "", false + } + return parts[1], parts[3], true } -func (ds *databricksSetup) setupAgentSparkCheck() { - driverIP := os.Getenv("DB_DRIVER_IP") - if driverIP == "" { - log.Warn("DB_DRIVER_IP not set") +func setIfExists(s *common.Setup, envKey, tagKey string, normalize func(string) string) { + value, ok := os.LookupEnv(envKey) + if !ok { return } - driverPort := os.Getenv("DB_DRIVER_PORT") - if driverPort == "" { - log.Warn("DB_DRIVER_PORT not set") - return + if normalize != nil { + value = normalize(value) } - clusterName := os.Getenv("DB_CLUSTER_NAME") + setHostTag(s, tagKey, value) +} - ds.AddSparkInstance(common.SparkInstance{ - SparkURL: "http://" + driverIP + ":" + driverPort, - SparkClusterMode: "spark_driver_mode", - ClusterName: clusterName, - StreamingMetrics: true, - }) +func setHostTag(s *common.Setup, tagKey, value string) { + s.Config.DatadogYAML.Tags = append(s.Config.DatadogYAML.Tags, tagKey+":"+value) + s.Span.SetTag("host_tag_set."+tagKey, "true") } -func (ds *databricksSetup) driverLogCollection() { - if os.Getenv("DRIVER_LOGS_ENABLED") != "true" { - return +func setupDatabricksDriver(s *common.Setup) { + s.Span.SetTag("spark_node", "driver") + + s.Config.DatadogYAML.Tags = append(s.Config.DatadogYAML.Tags, "node_type:driver") + + var sparkIntegration common.IntegrationConfig + if os.Getenv("DRIVER_LOGS_ENABLED") == "true" { + s.Config.DatadogYAML.LogsEnabled = true + sparkIntegration.Logs = driverLogs } - 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, - }) + if os.Getenv("DB_DRIVER_IP") != "" { + sparkIntegration.Instances = []any{ + common.IntegrationConfigInstanceSpark{ + SparkURL: "http://" + os.Getenv("DB_DRIVER_IP") + ":40001", + SparkClusterMode: "spark_driver_mode", + ClusterName: os.Getenv("DB_CLUSTER_NAME"), + StreamingMetrics: true, + }, + } + } else { + log.Warn("DB_DRIVER_IP not set") + } + s.Config.IntegrationConfigs["spark.d/databricks.yaml"] = sparkIntegration } -func (ds *databricksSetup) workerLogCollection() { - if os.Getenv("WORKER_LOGS_ENABLED") != "true" { - return +func setupDatabricksWorker(s *common.Setup) { + s.Span.SetTag("spark_node", "worker") + + s.Config.DatadogYAML.Tags = append(s.Config.DatadogYAML.Tags, "node_type:worker") + + 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_test.go b/pkg/fleet/installer/setup/djm/databricks_test.go new file mode 100644 index 0000000000000..0bd7d183122cf --- /dev/null +++ b/pkg/fleet/installer/setup/djm/databricks_test.go @@ -0,0 +1,81 @@ +// 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 djm contains data-jobs-monitoring installation logic +package djm + +import ( + "context" + "os" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/DataDog/datadog-agent/pkg/fleet/installer/setup/common" + "github.com/DataDog/datadog-agent/pkg/fleet/telemetry" +) + +func TestSetupCommonHostTags(t *testing.T) { + tests := []struct { + name string + env map[string]string + wantTags []string + }{ + { + name: "basic fields with formatting", + env: map[string]string{ + "DB_DRIVER_IP": "192.168.1.100", + "DB_INSTANCE_TYPE": "m4.xlarge", + "DB_IS_JOB_CLUSTER": "true", + "DD_JOB_NAME": "example,'job,name", + "DB_CLUSTER_NAME": "example[,'job]name", + "DB_CLUSTER_ID": "cluster123", + }, + wantTags: []string{ + "spark_host_ip:192.168.1.100", + "databricks_instance_type:m4.xlarge", + "databricks_is_job_cluster:true", + "job_name:example__job_name", + "databricks_cluster_name:example___job_name", + "databricks_cluster_id:cluster123", + "cluster_id:cluster123", + "cluster_name:example___job_name", + }, + }, + { + name: "with job, run ids", + env: map[string]string{ + "DB_CLUSTER_NAME": "job-123-run-456", + }, + wantTags: []string{ + "databricks_cluster_name:job-123-run-456", + "cluster_name:job-123-run-456", + "jobid:123", + "runid:456", + }, + }, + { + name: "Missing env vars results in no tags", + env: map[string]string{}, + wantTags: []string{}, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + os.Clearenv() + for k, v := range tt.env { + require.NoError(t, os.Setenv(k, v)) + } + span, _ := telemetry.StartSpanFromContext(context.Background(), "test") + s := &common.Setup{Span: span} + + setupCommonHostTags(s) + + assert.ElementsMatch(t, tt.wantTags, s.Config.DatadogYAML.Tags) + }) + } +} 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/djm/emr.go b/pkg/fleet/installer/setup/djm/emr.go new file mode 100644 index 0000000000000..c8003f4d70866 --- /dev/null +++ b/pkg/fleet/installer/setup/djm/emr.go @@ -0,0 +1,202 @@ +// 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 djm contains data-jobs-monitoring installation logic +package djm + +import ( + "context" + "encoding/json" + "fmt" + "os" + "os/exec" + "path/filepath" + "strconv" + "time" + + "github.com/DataDog/datadog-agent/pkg/fleet/installer/setup/common" + "github.com/DataDog/datadog-agent/pkg/fleet/telemetry" + "github.com/DataDog/datadog-agent/pkg/util/log" +) + +const ( + emrInjectorVersion = "0.26.0-1" + emrJavaTracerVersion = "1.42.2-1" + emrAgentVersion = "7.58.2-1" + commandTimeoutDuration = 10 * time.Second +) + +var ( + emrInfoPath = "/mnt/var/lib/info" + tracerEnvConfigEmr = []common.InjectTracerConfigEnvVar{ + { + Key: "DD_DATA_JOBS_ENABLED", + Value: "true", + }, + { + Key: "DD_INTEGRATIONS_ENABLED", + Value: "false", + }, + { + Key: "DD_DATA_JOBS_COMMAND_PATTERN", + Value: ".*org.apache.spark.deploy.*", + }, + { + Key: "DD_SPARK_APP_NAME_AS_SERVICE", + Value: "true", + }, + { + Key: "DD_INJECT_FORCE", + Value: "true", + }, + } +) + +type emrInstanceInfo struct { + IsMaster bool `json:"isMaster"` + InstanceGroupID string `json:"instanceGroupId"` +} + +type cluster struct { + Name string `json:"Name"` +} + +type emrResponse struct { + Cluster cluster `json:"cluster"` +} + +type extraEmrInstanceInfo struct { + JobFlowID string `json:"jobFlowId"` + ReleaseLabel string `json:"releaseLabel"` +} + +// SetupEmr sets up the DJM environment on EMR +func SetupEmr(s *common.Setup) error { + + s.Packages.Install(common.DatadogAgentPackage, emrAgentVersion) + s.Packages.Install(common.DatadogAPMInjectPackage, emrInjectorVersion) + s.Packages.Install(common.DatadogAPMLibraryJavaPackage, emrJavaTracerVersion) + + os.Setenv("DD_APM_INSTRUMENTATION_ENABLED", "host") + + hostname, err := os.Hostname() + if err != nil { + return fmt.Errorf("failed to get hostname: %w", err) + } + s.Config.DatadogYAML.Hostname = hostname + s.Config.DatadogYAML.DJM.Enabled = true + s.Config.InjectTracerYAML.AdditionalEnvironmentVariables = tracerEnvConfigEmr + + // Ensure tags are always attached with the metrics + s.Config.DatadogYAML.ExpectedTagsDuration = "10m" + isMaster, clusterName, err := setupCommonEmrHostTags(s) + if err != nil { + return fmt.Errorf("failed to set tags: %w", err) + } + if isMaster { + setupEmrResourceManager(s, clusterName) + } + return nil +} + +func setupCommonEmrHostTags(s *common.Setup) (bool, string, error) { + + instanceInfoRaw, err := os.ReadFile(filepath.Join(emrInfoPath, "instance.json")) + if err != nil { + return false, "", fmt.Errorf("error reading instance file: %w", err) + } + + var info emrInstanceInfo + if err = json.Unmarshal(instanceInfoRaw, &info); err != nil { + return false, "", fmt.Errorf("error umarshalling instance file: %w", err) + } + + setHostTag(s, "instance_group_id", info.InstanceGroupID) + setHostTag(s, "is_master_node", strconv.FormatBool(info.IsMaster)) + s.Span.SetTag("host_tag."+"is_master_node", info.IsMaster) + + extraInstanceInfoRaw, err := os.ReadFile(filepath.Join(emrInfoPath, "extraInstanceData.json")) + if err != nil { + return info.IsMaster, "", fmt.Errorf("error reading extra instance data file: %w", err) + } + + var extraInfo extraEmrInstanceInfo + if err = json.Unmarshal(extraInstanceInfoRaw, &extraInfo); err != nil { + return info.IsMaster, "", fmt.Errorf("error umarshalling extra instance data file: %w", err) + } + setHostTag(s, "job_flow_id", extraInfo.JobFlowID) + setHostTag(s, "cluster_id", extraInfo.JobFlowID) + setHostTag(s, "emr_version", extraInfo.ReleaseLabel) + s.Span.SetTag("emr_version", extraInfo.ReleaseLabel) + + clusterName := resolveClusterName(s, extraInfo.JobFlowID) + setHostTag(s, "cluster_name", clusterName) + + return info.IsMaster, clusterName, nil +} + +func setupEmrResourceManager(s *common.Setup, clusterName string) { + + var sparkIntegration common.IntegrationConfig + var yarnIntegration common.IntegrationConfig + + sparkIntegration.Instances = []any{ + common.IntegrationConfigInstanceSpark{ + SparkURL: "http://127.0.0.1:8088", + SparkClusterMode: "spark_yarn_mode", + ClusterName: clusterName, + StreamingMetrics: false, + }, + } + yarnIntegration.Instances = []any{ + common.IntegrationConfigInstanceYarn{ + ResourceManagerURI: "http://127.0.0.1:8088", + ClusterName: clusterName, + }, + } + s.Config.IntegrationConfigs["spark.d/conf.yaml"] = sparkIntegration + s.Config.IntegrationConfigs["yarn.d/conf.yaml"] = yarnIntegration + +} + +var executeCommandWithTimeout = func(s *common.Setup, command string, args ...string) (output []byte, err error) { + span, _ := telemetry.StartSpanFromContext(s.Ctx, "setup.command") + span.SetResourceName(command) + defer func() { span.Finish(err) }() + + ctx, cancel := context.WithTimeout(context.Background(), commandTimeoutDuration) + defer cancel() + + cmd := exec.CommandContext(ctx, command, args...) + output, err = cmd.Output() + + if err != nil { + span.Finish(err) + return nil, err + } + return output, nil +} + +func resolveClusterName(s *common.Setup, jobFlowID string) string { + var err error + span, _ := telemetry.StartSpanFromContext(s.Ctx, "resolve.cluster_name") + defer func() { span.Finish(err) }() + emrResponseRaw, err := executeCommandWithTimeout(s, "aws", "emr", "describe-cluster", "--cluster-id", jobFlowID) + if err != nil { + log.Warnf("error describing emr cluster, using cluster id as name: %v", err) + return jobFlowID + } + var response emrResponse + if err = json.Unmarshal(emrResponseRaw, &response); err != nil { + log.Warnf("error unmarshalling AWS EMR response, using cluster id as name: %v", err) + return jobFlowID + } + clusterName := response.Cluster.Name + if clusterName == "" { + log.Warn("clusterName is empty, using cluster id as name") + return jobFlowID + } + return clusterName +} diff --git a/pkg/fleet/installer/setup/djm/emr_test.go b/pkg/fleet/installer/setup/djm/emr_test.go new file mode 100644 index 0000000000000..f5931399475fc --- /dev/null +++ b/pkg/fleet/installer/setup/djm/emr_test.go @@ -0,0 +1,86 @@ +// 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 djm contains data-jobs-monitoring installation logic +package djm + +import ( + "context" + _ "embed" + "fmt" + "os" + "path/filepath" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/DataDog/datadog-agent/pkg/fleet/installer/setup/common" + "github.com/DataDog/datadog-agent/pkg/fleet/telemetry" +) + +//go:embed testdata/instance.json +var instanceJSON string + +//go:embed testdata/extraInstanceData.json +var extraInstanceJSON string + +//go:embed testdata/emrDescribeClusterResponse.json +var emrDescribeClusterResponse string + +func TestSetupEmr(t *testing.T) { + + // Mock AWS emr describe command + originalExecuteCommand := executeCommandWithTimeout + defer func() { executeCommandWithTimeout = originalExecuteCommand }() // Restore original after test + + executeCommandWithTimeout = func(s *common.Setup, command string, args ...string) (output []byte, err error) { + span, _ := telemetry.StartSpanFromContext(s.Ctx, "setup.command") + span.SetResourceName(command) + defer func() { span.Finish(err) }() + if command == "aws" && args[0] == "emr" && args[1] == "describe-cluster" { + return []byte(emrDescribeClusterResponse), nil + } + return nil, fmt.Errorf("unexpected command: %s", command) + } + + // Write info files in temp dir + emrInfoPath = t.TempDir() + + require.NoError(t, os.WriteFile(filepath.Join(emrInfoPath, "instance.json"), []byte(instanceJSON), 0644)) + + require.NoError(t, os.WriteFile(filepath.Join(emrInfoPath, "extraInstanceData.json"), []byte(extraInstanceJSON), 0644)) + + tests := []struct { + name string + wantTags []string + }{ + { + name: "basic fields json", + wantTags: []string{ + "instance_group_id:ig-123", + "is_master_node:true", + "job_flow_id:j-456", + "cluster_id:j-456", + "emr_version:emr-7.2.0", + "cluster_name:TestCluster", + }, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + span, _ := telemetry.StartSpanFromContext(context.Background(), "test") + s := &common.Setup{ + Span: span, + Ctx: context.Background(), + } + + _, _, err := setupCommonEmrHostTags(s) + assert.Nil(t, err) + assert.ElementsMatch(t, tt.wantTags, s.Config.DatadogYAML.Tags) + }) + } +} diff --git a/pkg/fleet/installer/setup/djm/testdata/emrDescribeClusterResponse.json b/pkg/fleet/installer/setup/djm/testdata/emrDescribeClusterResponse.json new file mode 100644 index 0000000000000..13a104ad37cf4 --- /dev/null +++ b/pkg/fleet/installer/setup/djm/testdata/emrDescribeClusterResponse.json @@ -0,0 +1,167 @@ +{ + "Cluster": { + "Id": "j-456", + "Name": "TestCluster", + "Status": { + "State": "WAITING", + "StateChangeReason": { + "Message": "Cluster ready to run steps." + }, + "Timeline": { + "CreationDateTime": "2024-12-19T12:33:52.519000+00:00", + "ReadyDateTime": "2024-12-19T12:39:40.738000+00:00" + } + }, + "Ec2InstanceAttributes": { + "Ec2KeyName": "name-key", + "Ec2SubnetId": "subnet-123", + "RequestedEc2SubnetIds": [ + "subnet-a75bb2c3" + ], + "Ec2AvailabilityZone": "us-east-1a", + "RequestedEc2AvailabilityZones": [], + "IamInstanceProfile": "IamInstanceProfile", + "EmrManagedMasterSecurityGroup": "sg-EmrManagedMasterSecurityGroup", + "EmrManagedSlaveSecurityGroup": "sg-EmrManagedSlaveSecurityGroup", + "AdditionalMasterSecurityGroups": [ + "sg-0348948a9f025a14e", + "sg-0cca41352bd4bf322" + ], + "AdditionalSlaveSecurityGroups": [ + "sg-1", + "sg-2" + ] + }, + "InstanceCollectionType": "INSTANCE_GROUP", + "LogUri": "s3n://bucket/emr_logs/", + "ReleaseLabel": "emr-7.2.0", + "AutoTerminate": false, + "TerminationProtected": false, + "UnhealthyNodeReplacement": true, + "VisibleToAllUsers": true, + "Applications": [ + { + "Name": "Hadoop", + "Version": "3.3.6" + }, + { + "Name": "Hive", + "Version": "3.1.3" + }, + { + "Name": "JupyterEnterpriseGateway", + "Version": "2.6.0" + }, + { + "Name": "Livy", + "Version": "0.8.0" + }, + { + "Name": "Spark", + "Version": "3.5.1" + } + ], + "Tags": [ + { + "Key": "emr_env", + "Value": "sandbox" + } + ], + "ServiceRole": "arn:aws:iam::123456:role/EMR_DefaultRole", + "NormalizedInstanceHours": 16, + "NormalizedInstanceHours": 16, + "MasterPublicDnsName": "ec2-1-2-3-4.compute-1.amazonaws.com", + "Configurations": [], + "ScaleDownBehavior": "TERMINATE_AT_TASK_COMPLETION", + "KerberosAttributes": {}, + "ClusterArn": "arn:aws:elasticmapreduce:us-east-1:601427279990:cluster/j-456", + "StepConcurrencyLevel": 2, + "PlacementGroups": [], + "OSReleaseLabel": "2023.6.20241121.0", + "BootstrapActions": [], + "InstanceGroups": [ + { + "Id": "ig-123", + "Name": "Primary", + "Market": "ON_DEMAND", + "InstanceGroupType": "MASTER", + "InstanceType": "m4.xlarge", + "RequestedInstanceCount": 1, + "RunningInstanceCount": 1, + "Status": { + "State": "RUNNING", + "StateChangeReason": { + "Message": "" + }, + "Timeline": { + "CreationDateTime": "2024-12-19T12:33:52.539000+00:00", + "ReadyDateTime": "2024-12-19T12:39:11.301000+00:00" + } + }, + "Configurations": [], + "ConfigurationsVersion": 0, + "LastSuccessfullyAppliedConfigurations": [], + "LastSuccessfullyAppliedConfigurationsVersion": 0, + "EbsBlockDevices": [ + { + "VolumeSpecification": { + "VolumeType": "gp2", + "SizeInGB": 32 + }, + "Device": "/dev/sdb" + }, + { + "VolumeSpecification": { + "VolumeType": "gp2", + "SizeInGB": 32 + }, + "Device": "/dev/sdc" + } + ], + "EbsOptimized": true, + "ShrinkPolicy": {} + }, + { + "Id": "ig-124", + "Name": "Core", + "Market": "ON_DEMAND", + "InstanceGroupType": "CORE", + "InstanceType": "m4.xlarge", + "RequestedInstanceCount": 1, + "RunningInstanceCount": 1, + "Status": { + "State": "RUNNING", + "StateChangeReason": { + "Message": "" + }, + "Timeline": { + "CreationDateTime": "2024-12-19T12:33:52.539000+00:00", + "ReadyDateTime": "2024-12-19T12:39:40.738000+00:00" + } + }, + "Configurations": [], + "ConfigurationsVersion": 0, + "LastSuccessfullyAppliedConfigurations": [], + "LastSuccessfullyAppliedConfigurationsVersion": 0, + "EbsBlockDevices": [ + { + "VolumeSpecification": { + "VolumeType": "gp2", + "SizeInGB": 32 + }, + "Device": "/dev/sdb" + }, + { + "VolumeSpecification": { + "VolumeType": "gp2", + "SizeInGB": 32 + }, + "Device": "/dev/sdc" + } + ], + "EbsOptimized": true, + "ShrinkPolicy": {} + } + ] + } +} diff --git a/pkg/fleet/installer/setup/djm/testdata/extraInstanceData.json b/pkg/fleet/installer/setup/djm/testdata/extraInstanceData.json new file mode 100644 index 0000000000000..1748d961173c4 --- /dev/null +++ b/pkg/fleet/installer/setup/djm/testdata/extraInstanceData.json @@ -0,0 +1,90 @@ +{ + "masterHost": "localhost", + "systemActions": [], + "startupScripts": [], + "hadoopEnv": {}, + "jobFlowId": "j-456", + "jobFlowCreationInstant": 1734611632519, + "instanceCount": 2, + "masterInstanceType": "m4.xlarge", + "instanceGroups": { + "CORE": [ + { + "instanceType": "m4.xlarge", + "instanceCount": 1 + } + ], + "MASTER": [ + { + "instanceType": "m4.xlarge", + "instanceCount": 1 + } + ] + }, + "slaveInstanceType": "m4.xlarge", + "supportedProducts": [], + "runJobTracker": false, + "runTaskTracker": false, + "runNameNode": true, + "runDataNode": false, + "runResourceManager": true, + "runNodeManager": false, + "instanceGroupId": "ig-123", + "instanceRole": "master", + "marketType": "on_demand", + "instanceGroupInstanceType": "m4.xlarge", + "hasIAMInstanceProfile": true, + "hadoopVersion": "Hadoop_3_3_6", + "region": "us-east-1", + "regionSet": "aws", + "deleteSteps": false, + "stepConcurrencyLevel": 2, + "emrNotebookProfilerIntegrationEnabled": true, + "debuggingInfo": { + "sdbDisabled": false, + "sqsEnabled": true, + "sqsQueueName": "AWS-ElasticMapReduce-j-456", + "stepFailureAnalysisEnabled": true, + "emrLogAnalyticsEnabled": false, + "appViewerForSparkEnabled": true, + "frequencyOfUpload": 120, + "appViewerDelayBetweenCyclesInSeconds": 120, + "appViewerFileSizeThresholdToDelayUploadInGb": 2.0, + "appViewerLargeFileCycleDelay": 2, + "onClusterUiProxyEnabled": true + }, + "accountId": "123456", + "releaseLabel": "emr-7.2.0", + "serviceEndpoints": { + "S3_DEFAULT": "s3.amazonaws.com", + "S3_LOCAL": "s3.amazonaws.com", + "DYNAMODB": "dynamodb.us-east-1.amazonaws.com", + "MONITORING": "http://monitor-api.amazon.com", + "DNS": "dns-manage.amazon.com", + "TIMBER": "https://timber-iad.amazon.com", + "CLOUDWATCH": "monitoring.us-east-1.amazonaws.com", + "EDP": "datapipeline.us-east-1.amazonaws.com", + "STS": "sts.us-east-1.amazonaws.com", + "EC2": "ec2.us-east-1.amazonaws.com", + "SNS": "sns.us-east-1.amazonaws.com", + "IAMADMIN": "iamadmin.amazonaws.com", + "RDS": "rds.us-east-1.amazonaws.com", + "SWF": "swf.us-east-1.amazonaws.com", + "MONITORING_READ": "http://monitor-api.amazon.com", + "SIMPLEDB": "sdb.amazonaws.com", + "EMR": "elasticmapreduce.us-east-1.amazonaws.com", + "KMS": "kms.us-east-1.amazonaws.com", + "IAM": "iam.amazonaws.com", + "SQS": "sqs.us-east-1.amazonaws.com", + "SIM": "https://maxis-service-prod-iad.amazon.com", + "FLUXO": "ticket-api.amazon.com", + "KINESIS": "kinesis.us-east-1.amazonaws.com", + "AEGIR": "https://aegir-us-east-1.amazon.com", + "REDSHIFT": "redshift.us-east-1.amazonaws.com", + "ANYSCALE": "autoscaling.us-east-1.amazonaws.com" + }, + "numCandidates": 1, + "haEnabled": false, + "candidates": [] + +} diff --git a/pkg/fleet/installer/setup/djm/testdata/instance.json b/pkg/fleet/installer/setup/djm/testdata/instance.json new file mode 100644 index 0000000000000..86a9aa33b1022 --- /dev/null +++ b/pkg/fleet/installer/setup/djm/testdata/instance.json @@ -0,0 +1,4 @@ +{ + "instanceGroupId": "ig-123", + "isMaster": true +} diff --git a/pkg/fleet/installer/setup/install.sh b/pkg/fleet/installer/setup/install.sh index 440e8b71acf1d..074b275028111 100644 --- a/pkg/fleet/installer/setup/install.sh +++ b/pkg/fleet/installer/setup/install.sh @@ -15,38 +15,40 @@ 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}" case "$(uname -m)" in x86_64) - echo "${downloader_bin_linux_amd64}" | base64 -d | $sudo_cmd tee "${downloader_path}" >/dev/null + write_installer_amd64 "$sudo_cmd" "$downloader_path" ;; aarch64) - echo "${downloader_bin_linux_arm64}" | base64 -d | $sudo_cmd tee "${downloader_path}" >/dev/null + write_installer_arm64 "$sudo_cmd" "$downloader_path" ;; 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}" } # Embedded binaries used to install Datadog. # Source: https://github.com/DataDog/datadog-agent/tree/INSTALLER_COMMIT/pkg/fleet/installer # DO NOT EDIT THIS SECTION MANUALLY. -downloader_bin_linux_amd64=$( - cat </dev/null +} +write_installer_arm64() { + local sudo_cmd=$1 + local path=$2 + base64 -d <<<"DOWNLOADER_BIN_LINUX_ARM64" | $sudo_cmd tee "${path}" >/dev/null +} install "$@" exit 0 diff --git a/pkg/fleet/installer/setup/setup.go b/pkg/fleet/installer/setup/setup.go index 376abc751eaf5..b435f3c76ae18 100644 --- a/pkg/fleet/installer/setup/setup.go +++ b/pkg/fleet/installer/setup/setup.go @@ -9,26 +9,40 @@ package setup 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/fleet/installer/setup/djm" "github.com/DataDog/datadog-agent/pkg/fleet/internal/exec" "github.com/DataDog/datadog-agent/pkg/fleet/internal/paths" ) -const ( - // FlavorDatabricks is the flavor for the Data Jobs Monitoring databricks setup. - FlavorDatabricks = "databricks" -) +type flavor struct { + path string // path is used to print the path to the setup script for users. + run func(*common.Setup) error +} + +var flavors = map[string]flavor{ + "databricks": {path: "djm/databricks.go", run: djm.SetupDatabricks}, + "emr": {path: "djm/emr.go", run: djm.SetupEmr}, +} // Setup installs Datadog. func Setup(ctx context.Context, env *env.Env, flavor string) error { - switch flavor { - case FlavorDatabricks: - return djm.SetupDatabricks(ctx, env) - default: - return fmt.Errorf("unknown setup flavor %s", flavor) + f, ok := flavors[flavor] + if !ok { + return fmt.Errorf("unknown flavor %s", flavor) + } + s, err := common.NewSetup(ctx, env, flavor, f.path, os.Stdout) + if err != nil { + return err + } + err = f.run(s) + if err != nil { + return err } + return s.Run() } // Agent7InstallScript is the setup used by the agent7 install script. diff --git a/pkg/fleet/internal/bootstrap/bootstrap_windows.go b/pkg/fleet/internal/bootstrap/bootstrap_windows.go index 6990ec77cf042..7172d02a1b6a9 100644 --- a/pkg/fleet/internal/bootstrap/bootstrap_windows.go +++ b/pkg/fleet/internal/bootstrap/bootstrap_windows.go @@ -11,8 +11,8 @@ package bootstrap import ( "context" "fmt" + "github.com/DataDog/datadog-agent/pkg/fleet/internal/msi" "os" - "os/exec" "path/filepath" "github.com/DataDog/datadog-agent/pkg/fleet/installer/env" @@ -81,20 +81,19 @@ func downloadInstaller(ctx context.Context, env *env.Env, url string, tmpDir str } else if len(msis) == 0 { return nil, fmt.Errorf("no MSIs in package") } - msiArgs := []string{ - "/i", - msis[0], - "/qn", - "MSIFASTINSTALL=7", - } - if env.AgentUserName != "" { - msiArgs = append(msiArgs, fmt.Sprintf("DDAGENTUSER_NAME=%s", env.AgentUserName)) - // don't need to look at the registry here since the installer will read it if the command line - // parameter is not provided + + cmd, err := msi.Cmd( + msi.Install(), + msi.WithMsi(msis[0]), + msi.WithDdAgentUserName(env.AgentUserName), + ) + var output []byte + if err == nil { + output, err = cmd.Run() } - err = exec.Command("msiexec", msiArgs...).Run() + if err != nil { - return nil, fmt.Errorf("failed to install the Datadog Installer") + return nil, fmt.Errorf("failed to install the Datadog Installer: %w\n%s", err, string(output)) } return iexec.NewInstallerExec(env, paths.StableInstallerPath), nil } diff --git a/pkg/fleet/internal/cdn/cdn.go b/pkg/fleet/internal/cdn/cdn.go index ab74ce9bfe0a7..dcb57bf0ee17d 100644 --- a/pkg/fleet/internal/cdn/cdn.go +++ b/pkg/fleet/internal/cdn/cdn.go @@ -7,6 +7,7 @@ package cdn import ( + "bytes" "context" "encoding/json" "errors" @@ -16,11 +17,15 @@ import ( "runtime" "github.com/DataDog/datadog-agent/pkg/fleet/installer/env" + "github.com/DataDog/datadog-agent/pkg/fleet/telemetry" pbgo "github.com/DataDog/datadog-agent/pkg/proto/pbgo/core" - "gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer" + "gopkg.in/yaml.v2" ) -const policyMetadataFilename = "policy.metadata" +const ( + policyMetadataFilename = "policy.metadata" + doNotEditDisclaimer = `# This configuration was generated by Datadog's Fleet Automation. DO NOT EDIT.` +) var ( // ErrProductNotSupported is returned when the product is not supported. @@ -110,13 +115,13 @@ func New(env *env.Env, configDBPath string) (*CDN, error) { // Get fetches the configuration for the given package. func (c *CDN) Get(ctx context.Context, pkg string) (cfg Config, err error) { - span, _ := tracer.StartSpanFromContext(ctx, "cdn.Get") + span, _ := telemetry.StartSpanFromContext(ctx, "cdn.Get") defer func() { spanErr := err if spanErr == ErrProductNotSupported { spanErr = nil } - span.Finish(tracer.WithError(spanErr)) + span.Finish(spanErr) }() switch pkg { @@ -134,7 +139,16 @@ func (c *CDN) Get(ctx context.Context, pkg string) (cfg Config, err error) { if err != nil { return nil, err } - cfg, err = newAPMConfig(c.hostTagsGetter.get(), orderedLayers...) + cfg, err = newAPMSSIConfig(c.hostTagsGetter.get(), orderedLayers...) + if err != nil { + return nil, err + } + case "datadog-apm-libraries": + orderedLayers, err := c.fetcher.get(ctx) + if err != nil { + return nil, err + } + cfg, err = newAPMLibrariesConfig(c.hostTagsGetter.get(), orderedLayers...) if err != nil { return nil, err } @@ -151,27 +165,32 @@ func (c *CDN) Close() error { } // writePolicyMetadata writes the policy metadata to the given directory -// and makes it readable to dd-agent +// and makes it world-readable func writePolicyMetadata(config Config, dir string) error { - ddAgentUID, ddAgentGID, err := getAgentIDs() - if err != nil { - return fmt.Errorf("error getting dd-agent user and group IDs: %w", err) - } - state := config.State() stateBytes, err := json.Marshal(state) if err != nil { return fmt.Errorf("could not marshal state: %w", err) } - err = os.WriteFile(filepath.Join(dir, policyMetadataFilename), stateBytes, 0440) + err = os.WriteFile(filepath.Join(dir, policyMetadataFilename), stateBytes, 0444) if err != nil { return fmt.Errorf("could not write %s: %w", policyMetadataFilename, err) } - if runtime.GOOS != "windows" { - err = os.Chown(filepath.Join(dir, policyMetadataFilename), ddAgentUID, ddAgentGID) - if err != nil { - return fmt.Errorf("could not chown %s: %w", policyMetadataFilename, err) - } - } return nil } + +// marshalYAMLConfig marshals the config as YAML. +func marshalYAMLConfig(c map[string]interface{}) ([]byte, error) { + if len(c) == 0 { + return nil, nil + } + var b bytes.Buffer + b.WriteString(doNotEditDisclaimer) + b.WriteString("\n") + rawConfig, err := yaml.Marshal(c) + if err != nil { + return nil, err + } + b.Write(rawConfig) + return b.Bytes(), nil +} diff --git a/pkg/fleet/internal/cdn/config_datadog_agent.go b/pkg/fleet/internal/cdn/config_datadog_agent.go index b9882ebaad469..71e96d0d2655e 100644 --- a/pkg/fleet/internal/cdn/config_datadog_agent.go +++ b/pkg/fleet/internal/cdn/config_datadog_agent.go @@ -6,7 +6,6 @@ package cdn import ( - "bytes" "crypto/sha256" "encoding/json" "fmt" @@ -18,12 +17,10 @@ import ( pbgo "github.com/DataDog/datadog-agent/pkg/proto/pbgo/core" "github.com/DataDog/datadog-agent/pkg/util/log" - "gopkg.in/yaml.v2" ) const ( - layerKeys = "fleet_layers" - doNotEditDisclaimer = `# This configuration was generated by Datadog's Fleet Automation. DO NOT EDIT.` + layerKeys = "fleet_layers" configDatadogYAML = "datadog.yaml" configSecurityAgentYAML = "security-agent.yaml" @@ -106,15 +103,15 @@ func newAgentConfig(orderedLayers ...[]byte) (*agentConfig, error) { compiledLayer.AgentConfig[layerKeys] = policyIDs // Marshal into YAML configs - config, err := marshalAgentConfig(compiledLayer.AgentConfig) + config, err := marshalYAMLConfig(compiledLayer.AgentConfig) if err != nil { return nil, err } - securityAgentConfig, err := marshalAgentConfig(compiledLayer.SecurityAgentConfig) + securityAgentConfig, err := marshalYAMLConfig(compiledLayer.SecurityAgentConfig) if err != nil { return nil, err } - systemProbeConfig, err := marshalAgentConfig(compiledLayer.SystemProbeConfig) + systemProbeConfig, err := marshalYAMLConfig(compiledLayer.SystemProbeConfig) if err != nil { return nil, err } @@ -182,22 +179,6 @@ func (a *agentConfig) Write(dir string) error { return writePolicyMetadata(a, dir) } -// marshalAgentConfig marshals the config as YAML. -func marshalAgentConfig(c map[string]interface{}) ([]byte, error) { - if len(c) == 0 { - return nil, nil - } - var b bytes.Buffer - b.WriteString(doNotEditDisclaimer) - b.WriteString("\n") - rawConfig, err := yaml.Marshal(c) - if err != nil { - return nil, err - } - b.Write(rawConfig) - return b.Bytes(), nil -} - // 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") diff --git a/pkg/fleet/internal/cdn/config_datadog_apm.go b/pkg/fleet/internal/cdn/config_datadog_apm_inject.go similarity index 83% rename from pkg/fleet/internal/cdn/config_datadog_apm.go rename to pkg/fleet/internal/cdn/config_datadog_apm_inject.go index fd171f06e0d92..f5cc04894b7f7 100644 --- a/pkg/fleet/internal/cdn/config_datadog_apm.go +++ b/pkg/fleet/internal/cdn/config_datadog_apm_inject.go @@ -21,37 +21,37 @@ const ( injectorConfigFilename = "injector.msgpack" ) -// apmConfig represents the injector configuration from the CDN. -type apmConfig struct { +// apmSSIConfig represents the injector configuration from the CDN. +type apmSSIConfig struct { version string policyIDs []string injectorConfig []byte } -// apmConfigLayer is a config layer that can be merged with other layers into a config. -type apmConfigLayer struct { +// apmSSIConfigLayer is a config layer that can be merged with other layers into a config. +type apmSSIConfigLayer struct { ID string `json:"name"` InjectorConfig map[string]interface{} `json:"apm_ssi_config"` } // State returns the APM configs state -func (i *apmConfig) State() *pbgo.PoliciesState { +func (i *apmSSIConfig) State() *pbgo.PoliciesState { return &pbgo.PoliciesState{ MatchedPolicies: i.policyIDs, Version: i.version, } } -func newAPMConfig(hostTags []string, orderedLayers ...[]byte) (*apmConfig, error) { +func newAPMSSIConfig(hostTags []string, orderedLayers ...[]byte) (*apmSSIConfig, error) { // Compile ordered layers into a single config // TODO: maybe we don't want that and we should reject if there are more than one config? policyIDs := []string{} - compiledLayer := &apmConfigLayer{ + compiledLayer := &apmSSIConfigLayer{ InjectorConfig: map[string]interface{}{}, } for _, rawLayer := range orderedLayers { - layer := &apmConfigLayer{} + layer := &apmSSIConfigLayer{} if err := json.Unmarshal(rawLayer, layer); err != nil { log.Warnf("Failed to unmarshal layer: %v", err) continue @@ -84,7 +84,7 @@ func newAPMConfig(hostTags []string, orderedLayers ...[]byte) (*apmConfig, error return nil, err } - return &apmConfig{ + return &apmSSIConfig{ version: fmt.Sprintf("%x", hash.Sum(nil)), policyIDs: policyIDs, @@ -93,7 +93,7 @@ func newAPMConfig(hostTags []string, orderedLayers ...[]byte) (*apmConfig, error } // Write writes the agent configuration to the given directory. -func (i *apmConfig) Write(dir string) error { +func (i *apmSSIConfig) Write(dir string) error { if i.injectorConfig != nil { err := os.WriteFile(filepath.Join(dir, injectorConfigFilename), []byte(i.injectorConfig), 0644) // Must be world readable if err != nil { diff --git a/pkg/fleet/internal/cdn/config_datadog_apm_libraries.go b/pkg/fleet/internal/cdn/config_datadog_apm_libraries.go new file mode 100644 index 0000000000000..bf31d18bd69a3 --- /dev/null +++ b/pkg/fleet/internal/cdn/config_datadog_apm_libraries.go @@ -0,0 +1,101 @@ +// 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 cdn + +import ( + "crypto/sha256" + "encoding/json" + "fmt" + "os" + "path/filepath" + + pbgo "github.com/DataDog/datadog-agent/pkg/proto/pbgo/core" + "github.com/DataDog/datadog-agent/pkg/util/log" +) + +const ( + apmLibrariesConfigPath = "libraries_config.yaml" +) + +// apmLibrariesConfig represents the injector configuration from the CDN. +type apmLibrariesConfig struct { + version string + policyIDs []string + + apmLibrariesConfig []byte +} + +// apmLibrariesConfigLayer is a config layer that can be merged with other layers into a config. +type apmLibrariesConfigLayer struct { + ID string `json:"name"` + APMLibrariesConfig map[string]interface{} `json:"apm_libraries_config"` +} + +// State returns the APM configs state +func (i *apmLibrariesConfig) State() *pbgo.PoliciesState { + return &pbgo.PoliciesState{ + MatchedPolicies: i.policyIDs, + Version: i.version, + } +} + +func newAPMLibrariesConfig(hostTags []string, orderedLayers ...[]byte) (*apmLibrariesConfig, error) { + // Compile ordered layers into a single config + policyIDs := []string{} + compiledLayer := &apmLibrariesConfigLayer{ + APMLibrariesConfig: map[string]interface{}{}, + } + for _, rawLayer := range orderedLayers { + layer := &apmLibrariesConfigLayer{} + if err := json.Unmarshal(rawLayer, layer); err != nil { + log.Warnf("Failed to unmarshal layer: %v", err) + continue + } + + if layer.APMLibrariesConfig != nil { + cfg, err := merge(compiledLayer.APMLibrariesConfig, layer.APMLibrariesConfig) + if err != nil { + return nil, err + } + compiledLayer.APMLibrariesConfig = cfg.(map[string]interface{}) + policyIDs = append(policyIDs, layer.ID) + } + } + + hash := sha256.New() + version, err := json.Marshal(compiledLayer) + if err != nil { + return nil, err + } + hash.Write(version) + + // Add host tags AFTER compiling the version -- we don't want to trigger noop updates + compiledLayer.APMLibrariesConfig["host_tags"] = hostTags + + // Marshal into msgpack configs + yamlCfg, err := marshalYAMLConfig(compiledLayer.APMLibrariesConfig) + if err != nil { + return nil, err + } + + return &apmLibrariesConfig{ + version: fmt.Sprintf("%x", hash.Sum(nil)), + policyIDs: policyIDs, + + apmLibrariesConfig: yamlCfg, + }, nil +} + +// Write writes the agent configuration to the given directory. +func (i *apmLibrariesConfig) Write(dir string) error { + if i.apmLibrariesConfig != nil { + err := os.WriteFile(filepath.Join(dir, apmLibrariesConfigPath), []byte(i.apmLibrariesConfig), 0644) // Must be world readable + if err != nil { + return fmt.Errorf("could not write %s: %w", apmLibrariesConfigPath, err) + } + } + return writePolicyMetadata(i, dir) +} diff --git a/pkg/fleet/internal/cdn/scope_expression.go b/pkg/fleet/internal/cdn/scope_expression.go index 659d6798c0670..cc86626fcf9c0 100644 --- a/pkg/fleet/internal/cdn/scope_expression.go +++ b/pkg/fleet/internal/cdn/scope_expression.go @@ -10,7 +10,9 @@ import ( "fmt" "regexp" + "github.com/DataDog/datadog-agent/comp/metadata/host/hostimpl/utils" "github.com/DataDog/datadog-agent/pkg/fleet/installer/env" + "github.com/DataDog/datadog-agent/pkg/gohai/platform" "github.com/DataDog/datadog-agent/pkg/version" "github.com/expr-lang/expr" ) @@ -115,6 +117,8 @@ func getScopeExprVars(env *env.Env, hostTagsGetter hostTagsGetter) map[string]in return map[string]interface{}{ "hostname": env.Hostname, "installer_version": version.AgentVersion, // AgentVersion evaluates to the installer version here + "os": platform.CollectInfo().KernelName.ValueOrDefault(), + "os_version": utils.GetOSVersion(), "tags": hostTagsGetter.get(), } diff --git a/pkg/fleet/internal/exec/installer_exec.go b/pkg/fleet/internal/exec/installer_exec.go index 29ca01999dcb9..92f5880723fa9 100644 --- a/pkg/fleet/internal/exec/installer_exec.go +++ b/pkg/fleet/internal/exec/installer_exec.go @@ -22,7 +22,6 @@ import ( installerErrors "github.com/DataDog/datadog-agent/pkg/fleet/installer/errors" "github.com/DataDog/datadog-agent/pkg/fleet/installer/repository" "github.com/DataDog/datadog-agent/pkg/fleet/telemetry" - "gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer" ) // InstallerExec is an implementation of the Installer interface that uses the installer binary. @@ -41,13 +40,13 @@ func NewInstallerExec(env *env.Env, installerBinPath string) *InstallerExec { type installerCmd struct { *exec.Cmd - span tracer.Span + span *telemetry.Span ctx context.Context } func (i *InstallerExec) newInstallerCmd(ctx context.Context, command string, args ...string) *installerCmd { env := i.env.ToEnv() - span, ctx := tracer.StartSpanFromContext(ctx, fmt.Sprintf("installer.%s", command)) + span, ctx := telemetry.StartSpanFromContext(ctx, fmt.Sprintf("installer.%s", command)) span.SetTag("args", args) cmd := exec.CommandContext(ctx, i.installerBinPath, append([]string{command}, args...)...) env = append(os.Environ(), env...) @@ -58,7 +57,7 @@ func (i *InstallerExec) newInstallerCmd(ctx context.Context, command string, arg return cmd.Process.Signal(os.Interrupt) } } - env = append(env, telemetry.EnvFromSpanContext(span.Context())...) + env = append(env, telemetry.EnvFromContext(ctx)...) cmd.Env = env cmd.Stdout = os.Stdout cmd.Stderr = os.Stderr @@ -72,14 +71,14 @@ func (i *InstallerExec) newInstallerCmd(ctx context.Context, command string, arg // Install installs a package. func (i *InstallerExec) Install(ctx context.Context, url string, _ []string) (err error) { cmd := i.newInstallerCmd(ctx, "install", url) - defer func() { cmd.span.Finish(tracer.WithError(err)) }() + defer func() { cmd.span.Finish(err) }() return cmd.Run() } // Remove removes a package. func (i *InstallerExec) Remove(ctx context.Context, pkg string) (err error) { cmd := i.newInstallerCmd(ctx, "remove", pkg) - defer func() { cmd.span.Finish(tracer.WithError(err)) }() + defer func() { cmd.span.Finish(err) }() return cmd.Run() } @@ -91,70 +90,70 @@ func (i *InstallerExec) Purge(_ context.Context) { // InstallExperiment installs an experiment. func (i *InstallerExec) InstallExperiment(ctx context.Context, url string) (err error) { cmd := i.newInstallerCmd(ctx, "install-experiment", url) - defer func() { cmd.span.Finish(tracer.WithError(err)) }() + defer func() { cmd.span.Finish(err) }() return cmd.Run() } // RemoveExperiment removes an experiment. func (i *InstallerExec) RemoveExperiment(ctx context.Context, pkg string) (err error) { cmd := i.newInstallerCmd(ctx, "remove-experiment", pkg) - defer func() { cmd.span.Finish(tracer.WithError(err)) }() + defer func() { cmd.span.Finish(err) }() return cmd.Run() } // PromoteExperiment promotes an experiment to stable. func (i *InstallerExec) PromoteExperiment(ctx context.Context, pkg string) (err error) { cmd := i.newInstallerCmd(ctx, "promote-experiment", pkg) - defer func() { cmd.span.Finish(tracer.WithError(err)) }() + defer func() { cmd.span.Finish(err) }() return cmd.Run() } // InstallConfigExperiment installs an experiment. func (i *InstallerExec) InstallConfigExperiment(ctx context.Context, url string, version string) (err error) { cmd := i.newInstallerCmd(ctx, "install-config-experiment", url, version) - defer func() { cmd.span.Finish(tracer.WithError(err)) }() + defer func() { cmd.span.Finish(err) }() return cmd.Run() } // RemoveConfigExperiment removes an experiment. func (i *InstallerExec) RemoveConfigExperiment(ctx context.Context, pkg string) (err error) { cmd := i.newInstallerCmd(ctx, "remove-config-experiment", pkg) - defer func() { cmd.span.Finish(tracer.WithError(err)) }() + defer func() { cmd.span.Finish(err) }() return cmd.Run() } // PromoteConfigExperiment promotes an experiment to stable. func (i *InstallerExec) PromoteConfigExperiment(ctx context.Context, pkg string) (err error) { cmd := i.newInstallerCmd(ctx, "promote-config-experiment", pkg) - defer func() { cmd.span.Finish(tracer.WithError(err)) }() + defer func() { cmd.span.Finish(err) }() return cmd.Run() } // GarbageCollect runs the garbage collector. func (i *InstallerExec) GarbageCollect(ctx context.Context) (err error) { cmd := i.newInstallerCmd(ctx, "garbage-collect") - defer func() { cmd.span.Finish(tracer.WithError(err)) }() + defer func() { cmd.span.Finish(err) }() return cmd.Run() } // InstrumentAPMInjector instruments the APM auto-injector. func (i *InstallerExec) InstrumentAPMInjector(ctx context.Context, method string) (err error) { cmd := i.newInstallerCmd(ctx, "apm instrument", method) - defer func() { cmd.span.Finish(tracer.WithError(err)) }() + defer func() { cmd.span.Finish(err) }() return cmd.Run() } // UninstrumentAPMInjector uninstruments the APM auto-injector. func (i *InstallerExec) UninstrumentAPMInjector(ctx context.Context, method string) (err error) { cmd := i.newInstallerCmd(ctx, "apm uninstrument", method) - defer func() { cmd.span.Finish(tracer.WithError(err)) }() + defer func() { cmd.span.Finish(err) }() return cmd.Run() } // IsInstalled checks if a package is installed. func (i *InstallerExec) IsInstalled(ctx context.Context, pkg string) (_ bool, err error) { cmd := i.newInstallerCmd(ctx, "is-installed", pkg) - defer func() { cmd.span.Finish(tracer.WithError(err)) }() + defer func() { cmd.span.Finish(err) }() err = cmd.Run() if err != nil && cmd.ProcessState.ExitCode() == 10 { return false, nil @@ -168,7 +167,7 @@ func (i *InstallerExec) IsInstalled(ctx context.Context, pkg string) (_ bool, er // DefaultPackages returns the default packages to install. func (i *InstallerExec) DefaultPackages(ctx context.Context) (_ []string, err error) { cmd := i.newInstallerCmd(ctx, "default-packages") - defer func() { cmd.span.Finish(tracer.WithError(err)) }() + defer func() { cmd.span.Finish(err) }() var stdout bytes.Buffer var stderr bytes.Buffer cmd.Stdout = &stdout @@ -190,7 +189,7 @@ func (i *InstallerExec) DefaultPackages(ctx context.Context) (_ []string, err er // Setup runs the setup command. func (i *InstallerExec) Setup(ctx context.Context) (err error) { cmd := i.newInstallerCmd(ctx, "setup") - defer func() { cmd.span.Finish(tracer.WithError(err)) }() + defer func() { cmd.span.Finish(err) }() var stderr bytes.Buffer cmd.Stderr = &stderr err = cmd.Run() @@ -252,5 +251,5 @@ func (iCmd *installerCmd) Run() error { } installerError := installerErrors.FromJSON(strings.TrimSpace(errBuf.String())) - return fmt.Errorf("run failed: %v \n%s", installerError, err.Error()) + return fmt.Errorf("run failed: %w \n%s", installerError, err.Error()) } diff --git a/pkg/fleet/internal/msi/file_in_use.log b/pkg/fleet/internal/msi/file_in_use.log new file mode 100644 index 0000000000000..eb0ad60b3ddd6 Binary files /dev/null and b/pkg/fleet/internal/msi/file_in_use.log differ diff --git a/pkg/fleet/internal/msi/invalid_credentials.log b/pkg/fleet/internal/msi/invalid_credentials.log new file mode 100644 index 0000000000000..3d568391bdb12 Binary files /dev/null and b/pkg/fleet/internal/msi/invalid_credentials.log differ diff --git a/pkg/fleet/internal/msi/missing_password_for_dc.log b/pkg/fleet/internal/msi/missing_password_for_dc.log new file mode 100644 index 0000000000000..c87c3dc183493 Binary files /dev/null and b/pkg/fleet/internal/msi/missing_password_for_dc.log differ diff --git a/pkg/fleet/internal/msi/msiexec.go b/pkg/fleet/internal/msi/msiexec.go new file mode 100644 index 0000000000000..f2ca387fb3aa2 --- /dev/null +++ b/pkg/fleet/internal/msi/msiexec.go @@ -0,0 +1,289 @@ +// 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 msi contains helper functions to work with msi packages +package msi + +import ( + "errors" + "fmt" + "github.com/DataDog/datadog-agent/pkg/fleet/internal/paths" + "io/fs" + "os" + "os/exec" + "path" + "path/filepath" + "regexp" +) + +type msiexecArgs struct { + // target should be either a full path to a MSI, an URL to a MSI or a product code. + target string + + // msiAction should be "/i" for installation, "/x" for uninstallation etc... + msiAction string + + // logFile should be a full local path where msiexec will write the installation logs. + // If nothing is specified, a random, temporary file is used. + logFile string + ddagentUserName string + + // additionalArgs are further args that can be passed to msiexec + additionalArgs []string +} + +// MsiexecOption is an option type for creating msiexec command lines +type MsiexecOption func(*msiexecArgs) error + +// Install specifies that msiexec will be invoked to install a product +func Install() MsiexecOption { + return func(a *msiexecArgs) error { + a.msiAction = "/i" + return nil + } +} + +// Uninstall specifies that msiexec will be invoked to uninstall a product +func Uninstall() MsiexecOption { + return func(a *msiexecArgs) error { + a.msiAction = "/x" + return nil + } +} + +// WithMsi specifies the MSI target for msiexec +func WithMsi(target string) MsiexecOption { + return func(a *msiexecArgs) error { + a.target = target + return nil + } +} + +// WithMsiFromPackagePath finds an MSI from the packages folder +func WithMsiFromPackagePath(target, product string) MsiexecOption { + return func(a *msiexecArgs) error { + updaterPath := filepath.Join(paths.PackagesPath, product, target) + msis, err := filepath.Glob(filepath.Join(updaterPath, fmt.Sprintf("%s-*-1-x86_64.msi", product))) + if err != nil { + return err + } + if len(msis) > 1 { + return fmt.Errorf("too many MSIs in package") + } else if len(msis) == 0 { + return fmt.Errorf("no MSIs in package") + } + a.target = msis[0] + return nil + } +} + +// WithProduct specifies the product name to target for msiexec +func WithProduct(productName string) MsiexecOption { + return func(a *msiexecArgs) error { + product, err := FindProductCode(productName) + if err != nil { + return fmt.Errorf("error trying to find product %s: %w", productName, err) + } + a.target = product.Code + return nil + } +} + +// WithLogFile specifies the log file for msiexec +func WithLogFile(logFile string) MsiexecOption { + return func(a *msiexecArgs) error { + a.logFile = logFile + return nil + } +} + +// WithAdditionalArgs specifies additional arguments for msiexec +func WithAdditionalArgs(additionalArgs []string) MsiexecOption { + return func(a *msiexecArgs) error { + a.additionalArgs = additionalArgs + return nil + } +} + +// WithDdAgentUserName specifies the DDAGENTUSER_NAME to use +func WithDdAgentUserName(ddagentUserName string) MsiexecOption { + return func(a *msiexecArgs) error { + a.ddagentUserName = ddagentUserName + return nil + } +} + +// Msiexec is a type wrapping msiexec +type Msiexec struct { + *exec.Cmd + + // logFile is the path to the MSI log file + logFile string + + // postExecActions is a list of actions to be executed after msiexec has run + postExecActions []func() +} + +func (m *Msiexec) openAndProcessLogFile() ([]byte, error) { + logfile, err := os.Open(m.logFile) + if err != nil { + if errors.Is(err, os.ErrNotExist) { + // File does not exist is not necessarily an error + return nil, nil + } + return nil, err + } + result, err := m.processLogFile(logfile) + _ = logfile.Close() + return result, err +} + +// processLogFile takes an open file and processes it with a series of processors to obtain +// a condensed version of the log file with only the relevant information. +func (m *Msiexec) processLogFile(logFile fs.File) ([]byte, error) { + // Compile a list of regular expressions we are interested in extracting from the logs + return processLogFile(logFile, + func(bytes []byte) []TextRange { + // Only need one TextRange of context before and after since other regexes will combine + return FindAllIndexWithContext(regexp.MustCompile("Datadog[.]CustomActions.*"), bytes, 1, 1) + }, + func(bytes []byte) []TextRange { + // Only need one TextRange of context before and after since other regexes will combine + return FindAllIndexWithContext(regexp.MustCompile("System[.]Exception"), bytes, 1, 1) + }, + func(bytes []byte) []TextRange { + // typically looks like this: + // Calling custom action AgentCustomActions!Datadog.AgentCustomActions.CustomActions.StartDDServices + // CA: 01:50:49: StartDDServices. Failed to start services: System.InvalidOperationException: Cannot start service datadogagent on computer '.'. ---> System.ComponentModel.Win32Exception: The service did not start due to a logon failure + // --- End of inner exception stack trace --- + // at System.ServiceProcess.ServiceController.Start(String args) + // at Datadog.CustomActions.Native.ServiceController.StartService(String serviceName, TimeSpan timeout) + // at Datadog.CustomActions.ServiceCustomAction.StartDDServices() + // Other regexes will pick up on the stack trace, but there's not much information to get before the error + return FindAllIndexWithContext(regexp.MustCompile("Cannot start service"), bytes, 1, 2) + }, + func(bytes []byte) []TextRange { + // Typically looks like this: + // CA(ddnpm): DriverInstall: serviceDef::create() + // CA(ddnpm): DriverInstall: Failed to CreateService 1073 + // CA(ddnpm): DriverInstall: Service exists, verifying + // CA(ddnpm): DriverInstall: Updated path for existing service + // So include a bit of context before and after + return FindAllIndexWithContext(regexp.MustCompile("Failed to CreateService"), bytes, 5, 5) + }, + func(bytes []byte) []TextRange { + // Typically looks like this: + // Calling custom action AgentCustomActions!Datadog.AgentCustomActions.CustomActions.ProcessDdAgentUserCredentials + // CA: 01:49:43: LookupAccountWithExtendedDomainSyntax. User not found, trying again with fixed domain part: \toto + // CA: 01:49:43: ProcessDdAgentUserCredentials. User toto doesn't exist. + // CA: 01:49:43: ProcessDdAgentUserCredentials. domain part is empty, using default + // CA: 01:49:43: ProcessDdAgentUserCredentials. Installing with DDAGENTUSER_PROCESSED_NAME=toto and DDAGENTUSER_PROCESSED_DOMAIN=datadoghq-qa-labs.local + // CA: 01:49:43: HandleProcessDdAgentUserCredentialsException. Error processing ddAgentUser credentials: Datadog.CustomActions.InvalidAgentUserConfigurationException: A password was not provided. A password is a required when installing on Domain Controllers. + // at Datadog.CustomActions.ProcessUserCustomActions.ProcessDdAgentUserCredentials(Boolean calledFromUIControl) + // MSI (s) (C8!50) [01:49:43:906]: Product: Datadog Agent -- A password was not provided. A password is a required when installing on Domain Controllers. + // + // A password was not provided. A password is a required when installing on Domain Controllers. + // CustomAction ProcessDdAgentUserCredentials returned actual error code 1603 (note this may not be 100% accurate if translation happened inside sandbox) + // Action ended 1:49:43: ProcessDdAgentUserCredentials. Return value 3. + // So include lots of context to ensure we get the full picture + return FindAllIndexWithContext(regexp.MustCompile("A password was not provided"), bytes, 6, 6) + }, + func(bytes []byte) []TextRange { + // Typically looks like this: + // Info 1603. The file C:\Program Files\Datadog\Datadog Agent\bin\agent\process-agent.exe is being held in use by the following process: Name: process-agent, Id: 4704, Window Title: '(not determined yet)'. Close that application and retry. + // Not much context to be had before and after + return FindAllIndexWithContext(regexp.MustCompile("is being held in use by the following process"), bytes, 1, 1) + }, + func(bytes []byte) []TextRange { + // Typically looks like this: + // Calling custom action AgentCustomActions!Datadog.AgentCustomActions.CustomActions.StartDDServices + // CustomAction WixFailWhenDeferred returned actual error code 1603 (note this may not be 100% accurate if translation happened inside sandbox) + // Action ended 2:11:49: InstallFinalize. Return value 3. + // The important context is the TextRange after the error ("Return value 3") but the previous lines can include some useful information too + return FindAllIndexWithContext(regexp.MustCompile("returned actual error"), bytes, 5, 1) + }, + func(bytes []byte) []TextRange { + // Typically looks like this: + // Action 12:24:00: InstallServices. Installing new services + // InstallServices: Service: + // Error 1923. Service 'Datadog Agent' (datadogagent) could not be installed. Verify that you have sufficient privileges to install system services. + // MSI (s) (54:EC) [12:25:53:886]: Product: Datadog Agent -- Error 1923. Service 'Datadog Agent' (datadogagent) could not be installed. Verify that you have sufficient privileges to install system services. + return FindAllIndexWithContext(regexp.MustCompile("Verify that you have sufficient privileges to install system services"), bytes, 2, 1) + }) +} + +// Run runs msiexec synchronously +func (m *Msiexec) Run() ([]byte, error) { + err := m.Cmd.Run() + // The log file *should not* be too big. Avoid verbose log files. + logFileBytes, err2 := m.openAndProcessLogFile() + err = errors.Join(err, err2) + for _, p := range m.postExecActions { + p() + } + + return logFileBytes, err +} + +// RunAsync runs msiexec asynchronously +func (m *Msiexec) RunAsync(done func([]byte, error)) error { + err := m.Cmd.Start() + if err != nil { + return err + } + go func() { + err := m.Cmd.Wait() + // The log file *should not* be too big. Avoid verbose log files. + logFileBytes, err2 := m.openAndProcessLogFile() + err = errors.Join(err, err2) + for _, p := range m.postExecActions { + p() + } + done(logFileBytes, err) + }() + return nil +} + +// FireAndForget starts msiexec and doesn't wait for it to finish. +// The log file won't be read at the end and post execution actions will not be executed. +func (m *Msiexec) FireAndForget() error { + return m.Cmd.Start() +} + +// Cmd creates a new Msiexec wrapper around cmd.Exec that will call msiexec +func Cmd(options ...MsiexecOption) (*Msiexec, error) { + a := &msiexecArgs{} + for _, opt := range options { + if err := opt(a); err != nil { + return nil, err + } + } + if a.msiAction == "" || a.target == "" { + return nil, fmt.Errorf("argument error") + } + + cmd := &Msiexec{} + if len(a.logFile) == 0 { + tempDir, err := os.MkdirTemp("", "datadog-installer") + if err != nil { + return nil, err + } + a.logFile = path.Join(tempDir, "msi.log") + cmd.postExecActions = append(cmd.postExecActions, func() { + _ = os.RemoveAll(tempDir) + }) + } + args := append(a.additionalArgs, a.msiAction, a.target, "/qn", "MSIFASTINSTALL=7", "/log", a.logFile) + if a.ddagentUserName != "" { + args = append(args, fmt.Sprintf("DDAGENTUSER_NAME=%s", a.ddagentUserName)) + } + + cmd.Cmd = exec.Command("msiexec", args...) + cmd.logFile = a.logFile + + return cmd, nil +} diff --git a/pkg/fleet/internal/msi/msilog.go b/pkg/fleet/internal/msi/msilog.go new file mode 100644 index 0000000000000..47f8ef5f30641 --- /dev/null +++ b/pkg/fleet/internal/msi/msilog.go @@ -0,0 +1,130 @@ +// 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 msi contains helper functions to work with msi packages +package msi + +import ( + "bytes" + "fmt" + "golang.org/x/text/encoding/unicode" + "io" + "io/fs" + "regexp" + "sort" +) + +// TextRange is a simple struct to represent a range of text in a file. +type TextRange struct { + start int + end int +} + +// FindAllIndexWithContext is similar to FindAllIndex but expands the matched range for a number of lines +// before and after the TextRange (called contextBefore and contextAfter). +func FindAllIndexWithContext(r *regexp.Regexp, input []byte, contextBefore, contextAfter int) []TextRange { + contextBefore = max(contextBefore, 0) + contextAfter = max(contextAfter, 0) + var extractedRanges []TextRange + results := r.FindAllIndex(input, -1) + for _, result := range results { + lineCounter := 0 + charCounter := result[0] + for ; charCounter >= 0; charCounter-- { + if input[charCounter] == '\n' { + lineCounter++ + } + if lineCounter > contextBefore { + break + } + } + lineStart := charCounter + 1 + + lineCounter = 0 + charCounter = result[1] + for ; charCounter < len(input); charCounter++ { + if input[charCounter] == '\n' { + lineCounter++ + } + if lineCounter > contextAfter { + break + } + } + lineEnd := charCounter + + extractedRanges = append(extractedRanges, TextRange{lineStart, lineEnd}) + } + + return extractedRanges +} + +// insert merges newRanges into existingRanges by combining overlapping or adjacent ranges. +func insert(existingRanges, newRanges []TextRange) []TextRange { + // Combine all ranges into a single slice for sorting + allRanges := append(existingRanges, newRanges...) + + // Sort ranges by start value (and end value if starts are equal) + sort.Slice(allRanges, func(i, j int) bool { + if allRanges[i].start == allRanges[j].start { + return allRanges[i].end < allRanges[j].end + } + return allRanges[i].start < allRanges[j].start + }) + + // Merge ranges + var merged []TextRange + for _, current := range allRanges { + // If merged is empty or the current range does not overlap with the last merged range + if len(merged) == 0 || merged[len(merged)-1].end < current.start { + merged = append(merged, current) // Add the current range + } else { + // Overlapping or adjacent: Extend the end of the last merged range + merged[len(merged)-1].end = max(merged[len(merged)-1].end, current.end) + } + } + + return merged +} + +// Combine processes input using multiple logFileProcessors and merges their output ranges. +func Combine(input []byte, processors ...logFileProcessor) []TextRange { + var allRanges []TextRange + + // Collect all ranges from each processor + for _, processor := range processors { + allRanges = append(allRanges, processor(input)...) + } + + // Use the improved insert function to merge all collected ranges + return insert(nil, allRanges) +} + +type logFileProcessor func([]byte) []TextRange + +// processLogFile reads a UTF-16 MSI log file and applies various processors on it +// to retain only the relevant log lines. It combines the various outputs from the processors and +// decorate each range of log lines with a marker ('---') to distinguish them. +func processLogFile(logFile fs.File, processors ...logFileProcessor) ([]byte, error) { + logFileBuffer := bytes.NewBuffer(nil) + _, err := io.Copy(logFileBuffer, logFile) + if err != nil { + return nil, err + } + decodedLogsBytes, err := unicode.UTF16(unicode.LittleEndian, unicode.UseBOM).NewDecoder().Bytes(logFileBuffer.Bytes()) + if err != nil { + return nil, err + } + + var output []byte + rangesToSave := Combine(decodedLogsBytes, processors...) + for _, ranges := range rangesToSave { + output = append(output, []byte(fmt.Sprintf("--- %d:%d\r\n", ranges.start, ranges.end))...) + output = append(output, decodedLogsBytes[ranges.start:ranges.end]...) + output = append(output, '\r', '\n', '\r', '\n') + } + return output, nil +} diff --git a/pkg/fleet/internal/msi/msilog_test.go b/pkg/fleet/internal/msi/msilog_test.go new file mode 100644 index 0000000000000..f52ff24f2a65f --- /dev/null +++ b/pkg/fleet/internal/msi/msilog_test.go @@ -0,0 +1,393 @@ +// 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 msi + +import ( + "embed" + "github.com/stretchr/testify/require" + "golang.org/x/text/encoding/unicode" + "regexp" + "strings" + "testing" +) + +//go:embed wixfailwhendeferred.log +//go:embed missing_password_for_dc.log +//go:embed file_in_use.log +//go:embed invalid_credentials.log +//go:embed service_marked_for_deletion.log +var logFilesFS embed.FS + +func TestFindAllIndexWithContext(t *testing.T) { + data, err := logFilesFS.ReadFile("wixfailwhendeferred.log") + require.NoError(t, err) + + r := regexp.MustCompile("returned actual error") + decodedLogsBytes, err := unicode.UTF16(unicode.LittleEndian, unicode.UseBOM).NewDecoder().Bytes(data) + require.NoError(t, err) + + matches := FindAllIndexWithContext(r, decodedLogsBytes, 2, 1) + + expectedMatches := []string{ + `Action start 2:10:53: WixRemoveFoldersEx. +WixRemoveFoldersEx: Error 0x80070057: Missing folder property: dd_PROJECTLOCATION_0 for row: RemoveFolderEx +CustomAction WixRemoveFoldersEx returned actual error code 1603 but will be translated to success due to continue marking +Action ended 2:10:53: WixRemoveFoldersEx. Return value 1.`, + `Calling custom action AgentCustomActions!Datadog.AgentCustomActions.CustomActions.PrepareDecompressPythonDistributions +CA: 02:10:56: PrepareDecompressPythonDistributions. Could not set the progress bar size +CustomAction PrepareDecompressPythonDistributions returned actual error code 1603 but will be translated to success due to continue marking +Action ended 2:10:56: PrepareDecompressPythonDistributions. Return value 1.`, + `SFXCA: Binding to CLR version v4.0.30319 +Calling custom action AgentCustomActions!Datadog.AgentCustomActions.CustomActions.StartDDServices +CustomAction WixFailWhenDeferred returned actual error code 1603 (note this may not be 100% accurate if translation happened inside sandbox) +Action ended 2:11:49: InstallFinalize. Return value 3.`, + } + for i, expectedMatch := range expectedMatches { + text := strings.ReplaceAll(string(decodedLogsBytes[matches[i].start:matches[i].end]), "\r", "") + require.Equal(t, expectedMatch, text) + } +} + +func TestFindAllIndexWithContextOutOfRangeDoesntFail(t *testing.T) { + data, err := logFilesFS.ReadFile("wixfailwhendeferred.log") + require.NoError(t, err) + + r := regexp.MustCompile("returned actual error") + decodedLogsBytes, err := unicode.UTF16(unicode.LittleEndian, unicode.UseBOM).NewDecoder().Bytes(data) + require.NoError(t, err) + + matches := FindAllIndexWithContext(r, decodedLogsBytes, -21, -1435) + expectedMatches := []string{ + `CustomAction WixRemoveFoldersEx returned actual error code 1603 but will be translated to success due to continue marking`, + `CustomAction PrepareDecompressPythonDistributions returned actual error code 1603 but will be translated to success due to continue marking`, + `CustomAction WixFailWhenDeferred returned actual error code 1603 (note this may not be 100% accurate if translation happened inside sandbox)`, + } + for i, expectedMatch := range expectedMatches { + text := strings.ReplaceAll(string(decodedLogsBytes[matches[i].start:matches[i].end]), "\r", "") + require.Equal(t, expectedMatch, text) + } +} + +func TestCombineRanges(t *testing.T) { + tests := map[string]struct { + input []logFileProcessor + expected []TextRange + }{ + "overlap left": { + input: []logFileProcessor{ + func(_ []byte) []TextRange { + return []TextRange{{1, 5}} + }, + func(_ []byte) []TextRange { + return []TextRange{{4, 7}} + }}, + expected: []TextRange{{1, 7}}, + }, + "overlap right": { + input: []logFileProcessor{ + func(_ []byte) []TextRange { + return []TextRange{{2, 4}} + }, + func(_ []byte) []TextRange { + return []TextRange{{1, 3}} + }}, + expected: []TextRange{{1, 4}}, + }, + "no overlap": { + input: []logFileProcessor{ + func(_ []byte) []TextRange { + return []TextRange{{2, 4}} + }, + func(_ []byte) []TextRange { + return []TextRange{{5, 10}} + }}, + expected: []TextRange{{2, 4}, {5, 10}}, + }, + "full overlap": { + input: []logFileProcessor{ + func(_ []byte) []TextRange { + return []TextRange{{2, 4}} + }, + func(_ []byte) []TextRange { + return []TextRange{{1, 10}} + }}, + expected: []TextRange{{1, 10}}, + }, + "full overlap inverted": { + input: []logFileProcessor{ + func(_ []byte) []TextRange { + return []TextRange{{1, 10}} + }, + func(_ []byte) []TextRange { + return []TextRange{{2, 4}} + }}, + expected: []TextRange{{1, 10}}, + }, + "test many ranges": { + input: []logFileProcessor{ + func(_ []byte) []TextRange { + return []TextRange{{16067, 16421}} + }, + func(_ []byte) []TextRange { + return []TextRange{{19659, 20140}} + }, + func(_ []byte) []TextRange { + return []TextRange{{16002, 16359}} + }, + func(_ []byte) []TextRange { + return []TextRange{{19559, 19951}} + }, + func(_ []byte) []TextRange { + return []TextRange{{59421, 59556}} + }}, + expected: []TextRange{{16002, 16421}, {19559, 20140}, {59421, 59556}}, + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + require.Equal(t, test.expected, Combine(nil, test.input...)) + }) + } +} + +func TestReadLogFile(t *testing.T) { + m := &Msiexec{} + + tests := map[string]struct { + input string + expected string + }{ + "Wix built-in failure mode": { + input: "wixfailwhendeferred.log", + expected: `--- 1547:2038 +Action ended 2:10:53: LaunchConditions. Return value 1. +Action start 2:10:53: ValidateProductID. +Action ended 2:10:53: ValidateProductID. Return value 1. +Action start 2:10:53: WixRemoveFoldersEx. +WixRemoveFoldersEx: Error 0x80070057: Missing folder property: dd_PROJECTLOCATION_0 for row: RemoveFolderEx +CustomAction WixRemoveFoldersEx returned actual error code 1603 but will be translated to success due to continue marking +Action ended 2:10:53: WixRemoveFoldersEx. Return value 1. + +--- 6770:7391 +Action start 2:10:55: PrepareDecompressPythonDistributions. +SFXCA: Extracting custom action to temporary directory: C:\Windows\Installer\MSIB32B.tmp-\ +SFXCA: Binding to CLR version v4.0.30319 +Calling custom action AgentCustomActions!Datadog.AgentCustomActions.CustomActions.PrepareDecompressPythonDistributions +CA: 02:10:56: PrepareDecompressPythonDistributions. Could not set the progress bar size +CustomAction PrepareDecompressPythonDistributions returned actual error code 1603 but will be translated to success due to continue marking +Action ended 2:10:56: PrepareDecompressPythonDistributions. Return value 1. + +--- 16002:16421 +CA: 02:11:30: AddUser. ddagentuser already exists, not creating +CA: 02:11:30: GetPreviousAgentUser. Could not find previous agent user: System.Exception: Agent user information is not in registry + at Datadog.CustomActions.InstallStateCustomActions.GetPreviousAgentUser(ISession session, IRegistryServices registryServices, INativeMethods nativeMethods) +CA: 02:11:30: ConfigureUser. Resetting ddagentuser password. + +--- 19559:20140 +CA: 02:11:36: ConfigureServiceUsers. Configuring services with account WIN-ST17FJ32SOG\ddagentuser +CA: 02:11:36: GetPreviousAgentUser. Could not find previous agent user: System.Exception: Agent user information is not in registry + at Datadog.CustomActions.InstallStateCustomActions.GetPreviousAgentUser(ISession session, IRegistryServices registryServices, INativeMethods nativeMethods) +CA: 02:11:36: UpdateAndLogAccessControl. datadog-process-agent current ACLs: D:(A;;CCLCSWLOCRRC;;;IU)(A;;CCLCSWLOCRRC;;;SU)(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA) + +--- 24843:25383 +CA(ddprocmon): DriverInstall: Done with create() 0 +CA(ddprocmon): DriverInstall: done installing services +SFXCA: Extracting custom action to temporary directory: C:\Windows\Installer\MSI593F.tmp-\ +SFXCA: Binding to CLR version v4.0.30319 +Calling custom action AgentCustomActions!Datadog.AgentCustomActions.CustomActions.StartDDServices +CustomAction WixFailWhenDeferred returned actual error code 1603 (note this may not be 100% accurate if translation happened inside sandbox) +Action ended 2:11:49: InstallFinalize. Return value 3. + +`, + }, + "Missing password for DC": { + input: "missing_password_for_dc.log", + expected: `--- 3625:5242 +SFXCA: Binding to CLR version v4.0.30319 +Calling custom action AgentCustomActions!Datadog.AgentCustomActions.CustomActions.ProcessDdAgentUserCredentials +CA: 01:49:43: LookupAccountWithExtendedDomainSyntax. User not found, trying again with fixed domain part: \toto +CA: 01:49:43: ProcessDdAgentUserCredentials. User toto doesn't exist. +CA: 01:49:43: ProcessDdAgentUserCredentials. domain part is empty, using default +CA: 01:49:43: ProcessDdAgentUserCredentials. Installing with DDAGENTUSER_PROCESSED_NAME=toto and DDAGENTUSER_PROCESSED_DOMAIN=datadoghq-qa-labs.local +CA: 01:49:43: HandleProcessDdAgentUserCredentialsException. Error processing ddAgentUser credentials: Datadog.CustomActions.InvalidAgentUserConfigurationException: A password was not provided. A password is a required when installing on Domain Controllers. + at Datadog.CustomActions.ProcessUserCustomActions.ProcessDdAgentUserCredentials(Boolean calledFromUIControl) +MSI (s) (C8!50) [01:49:43:906]: Product: Datadog Agent -- A password was not provided. A password is a required when installing on Domain Controllers. + +A password was not provided. A password is a required when installing on Domain Controllers. +CustomAction ProcessDdAgentUserCredentials returned actual error code 1603 (note this may not be 100% accurate if translation happened inside sandbox) +Action ended 1:49:43: ProcessDdAgentUserCredentials. Return value 3. +Action ended 1:49:43: INSTALL. Return value 3. +Property(S): UpgradeCode = {0C50421B-AEFB-4F15-A809-7AF256D608A5} +Property(S): NETFRAMEWORK45 = #528449 +Property(S): WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 + +`, + }, + "File in use": { + input: "file_in_use.log", + expected: `--- 3557:3890 +Action start 1:45:18: InstallValidate. +Info 1603. The file C:\Program Files\Datadog\Datadog Agent\bin\agent\process-agent.exe is being held in use by the following process: Name: process-agent, Id: 4704, Window Title: '(not determined yet)'. Close that application and retry. +Action ended 1:45:21: InstallValidate. Return value 1. + +--- 5653:5849 +SFXCA: Binding to CLR version v4.0.30319 +Calling custom action CustomActions!Datadog.CustomActions.PrerequisitesCustomActions.EnsureAdminCaller +Action ended 1:45:22: RunAsAdmin. Return value 1. + +--- 5983:6218 +SFXCA: Binding to CLR version v4.0.30319 +Calling custom action CustomActions!Datadog.CustomActions.InstallStateCustomActions.ReadInstallState +CA: 01:45:23: RegistryProperty. Found DDAGENTUSER_NAME in registry DDOG-HQ-QA-LABS\ddGmsa$ + +--- 7338:7520 +SFXCA: Binding to CLR version v4.0.30319 +Calling custom action CustomActions!Datadog.CustomActions.ConfigCustomActions.ReadConfig +Action ended 1:45:25: ReadConfig. Return value 1. + +--- 7627:7960 +Action start 1:45:25: InstallValidate. +Info 1603. The file C:\Program Files\Datadog\Datadog Agent\bin\agent\process-agent.exe is being held in use by the following process: Name: process-agent, Id: 4704, Window Title: '(not determined yet)'. Close that application and retry. +Action ended 1:45:27: InstallValidate. Return value 1. + +--- 12929:13180 +SFXCA: Binding to CLR version v4.0.30319 +Calling custom action CustomActions!Datadog.CustomActions.Rollback.RestoreDaclRollbackCustomAction.DoRollback +CA: 01:45:35: DoRollback. Resetting inheritance flag on "C:\Program Files\Datadog\Datadog Agent\" + +--- 13273:13484 +SFXCA: Binding to CLR version v4.0.30319 +Calling custom action CustomActions!Datadog.CustomActions.ServiceCustomAction.StopDDServices +CA: 01:45:39: StopDDServices. Service datadog-system-probe status: Stopped + +--- 14824:15093 +SFXCA: Binding to CLR version v4.0.30319 +Calling custom action CustomActions!Datadog.CustomActions.ConfigureUserCustomActions.UninstallUser +CA: 01:45:42: UninstallUser. Removing file access for DDOG-HQ-QA-LABS\ddGmsa$ (S-1-5-21-3647231507-2031390810-2876811253-1605) + +--- 464565:465186 +Action start 1:46:16: PrepareDecompressPythonDistributions. +SFXCA: Extracting custom action to temporary directory: C:\Windows\Installer\MSI58A1.tmp-\ +SFXCA: Binding to CLR version v4.0.30319 +Calling custom action AgentCustomActions!Datadog.AgentCustomActions.CustomActions.PrepareDecompressPythonDistributions +CA: 01:46:17: PrepareDecompressPythonDistributions. Could not set the progress bar size +CustomAction PrepareDecompressPythonDistributions returned actual error code 1603 but will be translated to success due to continue marking +Action ended 1:46:17: PrepareDecompressPythonDistributions. Return value 1. + +`, + }, + "Invalid credentials": { + input: "invalid_credentials.log", + expected: `--- 7263:7883 +Action start 1:50:19: PrepareDecompressPythonDistributions. +SFXCA: Extracting custom action to temporary directory: C:\Windows\Installer\MSID56.tmp-\ +SFXCA: Binding to CLR version v4.0.30319 +Calling custom action AgentCustomActions!Datadog.AgentCustomActions.CustomActions.PrepareDecompressPythonDistributions +CA: 01:50:19: PrepareDecompressPythonDistributions. Could not set the progress bar size +CustomAction PrepareDecompressPythonDistributions returned actual error code 1603 but will be translated to success due to continue marking +Action ended 1:50:19: PrepareDecompressPythonDistributions. Return value 1. + +--- 25259:26729 +CA: 01:50:48: StoreAgentUserInRegistry. Storing installedUser=ddagentuser +CA(ddnpm): DriverInstall: Initialized +CA(ddnpm): DriverInstall: Installing services +CA(ddnpm): DriverInstall: installing service +CA(ddnpm): DriverInstall: serviceDef::create() +CA(ddnpm): DriverInstall: Failed to CreateService 1073 +CA(ddnpm): DriverInstall: Service exists, verifying +CA(ddnpm): DriverInstall: Updated path for existing service +CA(ddnpm): DriverInstall: done installing services +CA(ddapm): DriverInstall: Initialized +CA(ddapm): DriverInstall: Installing services +CA(ddapm): DriverInstall: installing service +CA(ddapm): DriverInstall: serviceDef::create() +CA(ddapm): DriverInstall: Failed to CreateService 1073 +CA(ddapm): DriverInstall: Service exists, verifying +CA(ddapm): DriverInstall: Updated path for existing service +CA(ddapm): DriverInstall: done installing services +CA(ddprocmon): DriverInstall: Initialized +CA(ddprocmon): DriverInstall: Installing services +CA(ddprocmon): DriverInstall: installing service +CA(ddprocmon): DriverInstall: serviceDef::create() +CA(ddprocmon): DriverInstall: Failed to CreateService 1073 +CA(ddprocmon): DriverInstall: Service exists, verifying +CA(ddprocmon): DriverInstall: Updated path for existing service +CA(ddprocmon): DriverInstall: done installing services +SFXCA: Extracting custom action to temporary directory: C:\Windows\Installer\MSI7FD3.tmp-\ +SFXCA: Binding to CLR version v4.0.30319 + +--- 26730:27404 +Calling custom action AgentCustomActions!Datadog.AgentCustomActions.CustomActions.StartDDServices +CA: 01:50:49: StartDDServices. Failed to start services: System.InvalidOperationException: Cannot start service datadogagent on computer '.'. ---> System.ComponentModel.Win32Exception: The service did not start due to a logon failure + --- End of inner exception stack trace --- + at System.ServiceProcess.ServiceController.Start(String args) + at Datadog.CustomActions.Native.ServiceController.StartService(String serviceName, TimeSpan timeout) + at Datadog.CustomActions.ServiceCustomAction.StartDDServices() +Action ended 1:50:49: InstallFinalize. Return value 1. + +`, + }, + "Service marked for deletion": { + input: "service_marked_for_deletion.log", + expected: `--- 1546:2037 +Action ended 6:11:36: LaunchConditions. Return value 1. +Action start 6:11:36: ValidateProductID. +Action ended 6:11:36: ValidateProductID. Return value 1. +Action start 6:11:36: WixRemoveFoldersEx. +WixRemoveFoldersEx: Error 0x80070057: Missing folder property: dd_PROJECTLOCATION_0 for row: RemoveFolderEx +CustomAction WixRemoveFoldersEx returned actual error code 1603 but will be translated to success due to continue marking +Action ended 6:11:36: WixRemoveFoldersEx. Return value 1. + +--- 6876:7497 +Action start 6:11:38: PrepareDecompressPythonDistributions. +SFXCA: Extracting custom action to temporary directory: C:\Windows\Installer\MSI7CB7.tmp-\ +SFXCA: Binding to CLR version v4.0.30319 +Calling custom action AgentCustomActions!Datadog.AgentCustomActions.CustomActions.PrepareDecompressPythonDistributions +CA: 06:11:39: PrepareDecompressPythonDistributions. Could not set the progress bar size +CustomAction PrepareDecompressPythonDistributions returned actual error code 1603 but will be translated to success due to continue marking +Action ended 6:11:39: PrepareDecompressPythonDistributions. Return value 1. + +--- 16762:17181 +CA: 06:12:16: AddUser. ddagentuser already exists, not creating +CA: 06:12:16: GetPreviousAgentUser. Could not find previous agent user: System.Exception: Agent user information is not in registry + at Datadog.CustomActions.InstallStateCustomActions.GetPreviousAgentUser(ISession session, IRegistryServices registryServices, INativeMethods nativeMethods) +CA: 06:12:16: ConfigureUser. Resetting ddagentuser password. + +--- 19832:20285 + } +] +MSI (s) (B4:24) [06:12:21:764]: Product: Datadog Agent -- Error 1923. Service 'Datadog Agent' (datadogagent) could not be installed. Verify that you have sufficient privileges to install system services. + +Error 1923. Service 'Datadog Agent' (datadogagent) could not be installed. Verify that you have sufficient privileges to install system services. +SFXCA: Extracting custom action to temporary directory: C:\Windows\Installer\MSI2787.tmp-\ + +--- 20286:20851 +SFXCA: Binding to CLR version v4.0.30319 +Calling custom action AgentCustomActions!Datadog.AgentCustomActions.CustomActions.EnsureNpmServiceDependency +ExecServiceConfig: Error 0x80070430: Cannot change service configuration. Error: The specified service has been marked for deletion. + +ExecServiceConfig: Error 0x80070430: Failed to configure service: datadogagent +CustomAction ExecServiceConfig returned actual error code 1603 (note this may not be 100% accurate if translation happened inside sandbox) +Action ended 6:12:22: InstallFinalize. Return value 3. + +`, + }, + } + + for name, test := range tests { + t.Run(name, func(t *testing.T) { + file, err := logFilesFS.Open(test.input) + require.NoError(t, err) + got, err := m.processLogFile(file) + require.NoError(t, err) + resultString := strings.ReplaceAll(string(got), "\r", "") + require.Equal(t, test.expected, resultString) + }) + } +} diff --git a/pkg/fleet/installer/packages/msiexec.go b/pkg/fleet/internal/msi/product.go similarity index 59% rename from pkg/fleet/installer/packages/msiexec.go rename to pkg/fleet/internal/msi/product.go index e65692bb38c8f..e87144d748f9d 100644 --- a/pkg/fleet/installer/packages/msiexec.go +++ b/pkg/fleet/internal/msi/product.go @@ -5,34 +5,14 @@ //go:build windows -package packages +package msi import ( "fmt" - "os/exec" - "path/filepath" - "github.com/DataDog/datadog-agent/pkg/fleet/internal/paths" - "github.com/DataDog/datadog-agent/pkg/util/log" "golang.org/x/sys/windows/registry" ) -func msiexec(target, product, operation string, args []string) (*exec.Cmd, error) { - updaterPath := filepath.Join(paths.PackagesPath, product, target) - msis, err := filepath.Glob(filepath.Join(updaterPath, fmt.Sprintf("%s-*-1-x86_64.msi", product))) - if err != nil { - return nil, err - } - if len(msis) > 1 { - return nil, fmt.Errorf("too many MSIs in package") - } else if len(msis) == 0 { - return nil, fmt.Errorf("no MSIs in package") - } - - cmd := exec.Command("msiexec", append([]string{operation, msis[0], "/qn", "MSIFASTINSTALL=7"}, args...)...) - return cmd, nil -} - // Product represents a software from the Windows Registry type Product struct { // Code is the software product code @@ -41,7 +21,8 @@ type Product struct { UninstallString string } -func findProductCode(name string) (*Product, error) { +// FindProductCode looks for the productName in the registry and returns information about it +func FindProductCode(productName string) (*Product, error) { rootPath := "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall" reg, err := registry.OpenKey(registry.LOCAL_MACHINE, rootPath, registry.ENUMERATE_SUB_KEYS) if err != nil { @@ -53,55 +34,55 @@ func findProductCode(name string) (*Product, error) { return nil, err } for _, key := range keys { - product, err := processKey(rootPath, key, name) + product, err := processKey(rootPath, key, productName) if err == nil && product != nil { - return product, err + return product, nil } } - return nil, nil + return nil, fmt.Errorf("product not found") } -func processKey(rootPath, key, name string) (*Product, error) { - subkey, err := registry.OpenKey(registry.LOCAL_MACHINE, rootPath+"\\"+key, registry.QUERY_VALUE) +// IsProductInstalled returns true if the given productName is installed +func IsProductInstalled(productName string) bool { + product, err := FindProductCode(productName) if err != nil { - return nil, err - } - defer subkey.Close() - - displayName, _, err := subkey.GetStringValue("DisplayName") - if err == nil && displayName == name { - product := &Product{} - product.UninstallString, _, _ = subkey.GetStringValue("UninstallString") - product.Code = key - return product, nil + return false } - - return nil, nil + return product != nil } -// removeProduct uses the registry to try and find a product and use msiexec to remove it. +// RemoveProduct uses the registry to try and find a product and use msiexec to remove it. // It is different from msiexec in that it uses the registry and not the stable/experiment path on disk to // uninstall the product. // This is needed because in certain circumstances the installer database stored in the stable/experiment paths does not // reflect the installed version, and using those installers can lead to undefined behavior (either failure to uninstall, // or weird bugs from uninstalling a product with an installer from a different version). -func removeProduct(productName string) error { - log.Debugf("Removing product %s", productName) - product, err := findProductCode(productName) +func RemoveProduct(productName string) error { + cmd, err := Cmd(Uninstall(), WithProduct(productName)) if err != nil { - return fmt.Errorf("error trying to find product %s: %w", productName, err) + return fmt.Errorf("failed to remove product: %w", err) } - if product != nil { - cmd := exec.Command("msiexec", "/x", product.Code, "/qn", "MSIFASTINSTALL=7") - return cmd.Run() + output, err := cmd.Run() + if err != nil { + return fmt.Errorf("failed to remove product: %w\n%s", err, string(output)) } - return fmt.Errorf("product %s not found", productName) + return nil } -func isProductInstalled(productName string) bool { - product, err := findProductCode(productName) +func processKey(rootPath, key, name string) (*Product, error) { + subkey, err := registry.OpenKey(registry.LOCAL_MACHINE, rootPath+"\\"+key, registry.QUERY_VALUE) if err != nil { - return false + return nil, err } - return product != nil + defer subkey.Close() + + displayName, _, err := subkey.GetStringValue("DisplayName") + if err == nil && displayName == name { + product := &Product{} + product.UninstallString, _, _ = subkey.GetStringValue("UninstallString") + product.Code = key + return product, nil + } + + return nil, nil } diff --git a/pkg/fleet/internal/msi/service_marked_for_deletion.log b/pkg/fleet/internal/msi/service_marked_for_deletion.log new file mode 100644 index 0000000000000..7844b7a546931 Binary files /dev/null and b/pkg/fleet/internal/msi/service_marked_for_deletion.log differ diff --git a/pkg/fleet/internal/msi/wixfailwhendeferred.log b/pkg/fleet/internal/msi/wixfailwhendeferred.log new file mode 100644 index 0000000000000..fb1982434be9b Binary files /dev/null and b/pkg/fleet/internal/msi/wixfailwhendeferred.log differ diff --git a/pkg/fleet/telemetry/http_wrapper.go b/pkg/fleet/telemetry/http_wrapper.go new file mode 100644 index 0000000000000..2f94bda79fe1f --- /dev/null +++ b/pkg/fleet/telemetry/http_wrapper.go @@ -0,0 +1,84 @@ +// 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 telemetry provides the telemetry for fleet components. +package telemetry + +import ( + "net/http" + "strconv" + "strings" +) + +// WrapRoundTripper wraps the round tripper with the telemetry round tripper. +func WrapRoundTripper(rt http.RoundTripper) http.RoundTripper { + if rt == nil { + rt = http.DefaultTransport + } + if wrapped, ok := rt.(*roundTripper); ok { + rt = wrapped.base + } + return &roundTripper{ + base: rt, + } +} + +type roundTripper struct { + base http.RoundTripper +} + +func (rt *roundTripper) RoundTrip(req *http.Request) (res *http.Response, err error) { + span, _ := StartSpanFromContext(req.Context(), "http.request") + defer func() { span.Finish(err) }() + + url := *req.URL + url.User = nil + + span.span.Type = "http" + span.SetResourceName(req.Method + " " + urlFromRequest(req)) + span.span.Meta["http.method"] = req.Method + span.span.Meta["http.url"] = req.URL.String() + span.span.Meta["span.kind"] = "client" + span.span.Meta["network.destination.name"] = url.Hostname() + res, err = rt.base.RoundTrip(req) + if err != nil { + span.SetTag("http.errors", err.Error()) + return res, err + } + span.SetTag("http.status_code", strconv.Itoa(res.StatusCode)) + if res.StatusCode >= 400 { + span.SetTag("http.errors", res.Status) + } + return res, err +} + +// urlFromRequest returns the URL from the HTTP request. The URL query string is included in the return object iff queryString is true +// See https://docs.datadoghq.com/tracing/configure_data_security#redacting-the-query-in-the-url for more information. +func urlFromRequest(r *http.Request) string { + // Quoting net/http comments about net.Request.URL on server requests: + // "For most requests, fields other than Path and RawQuery will be + // empty. (See RFC 7230, Section 5.3)" + // This is why we don't rely on url.URL.String(), url.URL.Host, url.URL.Scheme, etc... + var url string + path := r.URL.EscapedPath() + scheme := r.URL.Scheme + if r.TLS != nil { + scheme = "https" + } + if r.Host != "" { + url = strings.Join([]string{scheme, "://", r.Host, path}, "") + } else { + url = path + } + // Collect the query string if we are allowed to report it and obfuscate it if possible/allowed + if r.URL.RawQuery != "" { + query := r.URL.RawQuery + url = strings.Join([]string{url, query}, "?") + } + if frag := r.URL.EscapedFragment(); frag != "" { + url = strings.Join([]string{url, frag}, "#") + } + return url +} diff --git a/pkg/fleet/telemetry/span.go b/pkg/fleet/telemetry/span.go new file mode 100644 index 0000000000000..ac5f00b9ade0a --- /dev/null +++ b/pkg/fleet/telemetry/span.go @@ -0,0 +1,150 @@ +// 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 telemetry provides the telemetry for fleet components. +package telemetry + +import ( + "context" + "fmt" + "math/rand/v2" + "runtime/debug" + "strconv" + "sync" + "sync/atomic" + "time" + + "github.com/DataDog/datadog-agent/pkg/internaltelemetry" +) + +const spanKey = spanContextKey("span_context") + +type spanContextKey string + +// Span represents a span. +type Span struct { + mu sync.Mutex + span internaltelemetry.Span + finished atomic.Bool +} + +func newSpan(name string, parentID, traceID uint64) *Span { + if traceID == 0 { + traceID = rand.Uint64() + if !headSamplingKeep(name, traceID) { + traceID = dropTraceID + } + } + s := &Span{ + span: internaltelemetry.Span{ + TraceID: traceID, + ParentID: parentID, + SpanID: rand.Uint64(), + Name: name, + Resource: name, + Start: time.Now().UnixNano(), + Meta: make(map[string]string), + Metrics: make(map[string]float64), + }, + } + if parentID == 0 { + s.SetTopLevel() + } + + globalTracer.registerSpan(s) + return s +} + +// Finish finishes the span with an error. +func (s *Span) Finish(err error) { + s.finished.Store(true) + s.mu.Lock() + defer s.mu.Unlock() + s.span.Duration = time.Now().UnixNano() - s.span.Start + if err != nil { + s.span.Error = 1 + s.span.Meta = map[string]string{ + "error.message": err.Error(), + "error.stack": string(debug.Stack()), + } + } + globalTracer.finishSpan(s) +} + +// SetResourceName sets the resource name of the span. +func (s *Span) SetResourceName(name string) { + if s.finished.Load() { + return + } + s.mu.Lock() + defer s.mu.Unlock() + s.span.Resource = name +} + +// SetTopLevel sets the span as a top level span. +func (s *Span) SetTopLevel() { + s.SetTag("_top_level", 1) +} + +// SetTag sets a tag on the span. +func (s *Span) SetTag(key string, value interface{}) { + if s.finished.Load() { + return + } + s.mu.Lock() + defer s.mu.Unlock() + if value == nil { + s.span.Meta[key] = "nil" + } + switch v := value.(type) { + case string: + s.span.Meta[key] = v + case bool: + s.span.Meta[key] = strconv.FormatBool(v) + case int: + s.span.Metrics[key] = float64(v) + case int8: + s.span.Metrics[key] = float64(v) + case int16: + s.span.Metrics[key] = float64(v) + case int32: + s.span.Metrics[key] = float64(v) + case int64: + s.span.Metrics[key] = float64(v) + case uint: + s.span.Metrics[key] = float64(v) + case uint8: + s.span.Metrics[key] = float64(v) + case uint16: + s.span.Metrics[key] = float64(v) + case uint32: + s.span.Metrics[key] = float64(v) + case uint64: + s.span.Metrics[key] = float64(v) + case float32: + s.span.Metrics[key] = float64(v) + case float64: + s.span.Metrics[key] = v + default: + s.span.Meta[key] = fmt.Sprintf("not_supported_type %T", v) + } +} + +type spanIDs struct { + traceID uint64 + spanID uint64 +} + +func getSpanIDsFromContext(ctx context.Context) (spanIDs, bool) { + sIDs, ok := ctx.Value(spanKey).(spanIDs) + if !ok { + return spanIDs{}, false + } + return sIDs, true +} + +func setSpanIDsInContext(ctx context.Context, span *Span) context.Context { + return context.WithValue(ctx, spanKey, spanIDs{traceID: span.span.TraceID, spanID: span.span.SpanID}) +} diff --git a/pkg/fleet/telemetry/telemetry.go b/pkg/fleet/telemetry/telemetry.go index b63bdfb0de764..66174ad18fc32 100644 --- a/pkg/fleet/telemetry/telemetry.go +++ b/pkg/fleet/telemetry/telemetry.go @@ -8,250 +8,178 @@ package telemetry import ( "context" - "errors" "fmt" - "io" - "net" "net/http" "os" + "strconv" "strings" - "sync" - - "gopkg.in/DataDog/dd-trace-go.v1/ddtrace" - "gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer" - - "github.com/gorilla/mux" + "time" "github.com/DataDog/datadog-agent/pkg/internaltelemetry" - pb "github.com/DataDog/datadog-agent/pkg/proto/pbgo/trace" - traceconfig "github.com/DataDog/datadog-agent/pkg/trace/config" - "github.com/DataDog/datadog-agent/pkg/util/log" "github.com/DataDog/datadog-agent/pkg/version" ) const ( - // EnvTraceID is the environment variable key for the trace ID - EnvTraceID = "DATADOG_TRACE_ID" - // EnvParentID is the environment variable key for the parent ID - EnvParentID = "DATADOG_PARENT_ID" -) - -const ( + envTraceID = "DATADOG_TRACE_ID" + envParentID = "DATADOG_PARENT_ID" telemetrySubdomain = "instrumentation-telemetry-intake" - telemetryEndpoint = "/v0.4/traces" ) // Telemetry handles the telemetry for fleet components. type Telemetry struct { telemetryClient internaltelemetry.Client + done chan struct{} + flushed chan struct{} - site string + env string service string - - listener *telemetryListener - server *http.Server - client *http.Client - - samplingRules []tracer.SamplingRule } -// Option is a functional option for telemetry. -type Option func(*Telemetry) - // NewTelemetry creates a new telemetry instance -func NewTelemetry(client *http.Client, apiKey string, site string, service string, opts ...Option) *Telemetry { - endpoint := &traceconfig.Endpoint{ +func NewTelemetry(client *http.Client, apiKey string, site string, service string) *Telemetry { + t := newTelemetry(client, apiKey, site, service) + t.Start() + return t +} + +func newTelemetry(client *http.Client, apiKey string, site string, service string) *Telemetry { + endpoint := &internaltelemetry.Endpoint{ Host: fmt.Sprintf("https://%s.%s", telemetrySubdomain, strings.TrimSpace(site)), APIKey: apiKey, } - listener := newTelemetryListener() - t := &Telemetry{ - telemetryClient: internaltelemetry.NewClient(client, []*traceconfig.Endpoint{endpoint}, service, site == "datad0g.com"), - site: site, - service: service, - listener: listener, - server: &http.Server{}, - client: &http.Client{ - Transport: &http.Transport{ - Dial: listener.Dial, - }, - }, + env := "prod" + if site == "datad0g.com" { + env = "staging" } - for _, opt := range opts { - opt(t) + + return &Telemetry{ + telemetryClient: internaltelemetry.NewClient(client, []*internaltelemetry.Endpoint{endpoint}, service, site == "datad0g.com"), + done: make(chan struct{}), + flushed: make(chan struct{}), + env: env, + service: service, } - t.server.Handler = t.handler() - return t } // Start starts the telemetry -func (t *Telemetry) Start(_ context.Context) error { +func (t *Telemetry) Start() { + ticker := time.Tick(1 * time.Minute) go func() { - err := t.server.Serve(t.listener) - if err != nil { - log.Infof("telemetry server stopped: %v", err) + for { + select { + case <-ticker: + t.sendCompletedSpans() + case <-t.done: + t.sendCompletedSpans() + close(t.flushed) + return + } } }() - env := "prod" - if t.site == "datad0g.com" { - env = "staging" - } - - tracer.Start( - tracer.WithService(t.service), - tracer.WithServiceVersion(version.AgentVersion), - tracer.WithEnv(env), - tracer.WithGlobalTag("site", t.site), - tracer.WithHTTPClient(t.client), - tracer.WithLogStartup(false), - - // We don't need the value, we just need to enforce that it's not - // the default. If it is, then the tracer will try to use the socket - // if it exists -- and it always exists for newer agents. - // If the agent address is the socket, the tracer overrides WithHTTPClient to use it. - tracer.WithAgentAddr("192.0.2.42:12345"), // 192.0.2.0/24 is reserved - tracer.WithSamplingRules(t.samplingRules), - ) - return nil } // Stop stops the telemetry -func (t *Telemetry) Stop(ctx context.Context) error { - tracer.Flush() - tracer.Stop() - t.listener.Close() - err := t.server.Shutdown(ctx) - if err != nil { - log.Errorf("error shutting down telemetry server: %v", err) - } - return nil +func (t *Telemetry) Stop() { + close(t.done) + <-t.flushed } -func (t *Telemetry) handler() http.Handler { - r := mux.NewRouter().Headers("Content-Type", "application/msgpack").Subrouter() - r.HandleFunc(telemetryEndpoint, func(w http.ResponseWriter, r *http.Request) { - defer r.Body.Close() - body, err := io.ReadAll(r.Body) - if err != nil { - log.Errorf("error reading request body: %v", err) - w.WriteHeader(http.StatusInternalServerError) - return - } - var traces pb.Traces - _, err = traces.UnmarshalMsg(body) - if err != nil { - log.Errorf("error unmarshalling traces: %v", err) - w.WriteHeader(http.StatusBadRequest) - return - } - t.telemetryClient.SendTraces(traces) - w.WriteHeader(http.StatusOK) - }) - return r -} - -type telemetryListener struct { - conns chan net.Conn - - close chan struct{} - closeOnce sync.Once -} - -func newTelemetryListener() *telemetryListener { - return &telemetryListener{ - conns: make(chan net.Conn), - close: make(chan struct{}), +func (t *Telemetry) extractCompletedSpans() internaltelemetry.Traces { + spans := globalTracer.flushCompletedSpans() + if len(spans) == 0 { + return internaltelemetry.Traces{} } -} - -func (l *telemetryListener) Close() error { - l.closeOnce.Do(func() { - close(l.close) - }) - return nil -} - -func (l *telemetryListener) Accept() (net.Conn, error) { - select { - case <-l.close: - return nil, errors.New("listener closed") - case conn := <-l.conns: - return conn, nil + traces := make(map[uint64][]*internaltelemetry.Span) + for _, span := range spans { + span.span.Service = t.service + span.span.Meta["env"] = t.env + span.span.Meta["version"] = version.AgentVersion + span.span.Metrics["_sampling_priority_v1"] = 2 + traces[span.span.TraceID] = append(traces[span.span.TraceID], &span.span) } + tracesArray := make([]internaltelemetry.Trace, 0, len(traces)) + for _, trace := range traces { + tracesArray = append(tracesArray, internaltelemetry.Trace(trace)) + } + return internaltelemetry.Traces(tracesArray) } -func (l *telemetryListener) Addr() net.Addr { - return addr(0) -} - -func (l *telemetryListener) Dial(_, _ string) (net.Conn, error) { - select { - case <-l.close: - return nil, errors.New("listener closed") - default: +func (t *Telemetry) sendCompletedSpans() { + tracesArray := t.extractCompletedSpans() + if len(tracesArray) == 0 { + return } - server, client := net.Pipe() - l.conns <- server - return client, nil + t.telemetryClient.SendTraces(tracesArray) } -type addr int - -func (addr) Network() string { - return "memory" +// SpanFromContext returns the span from the context if available. +func SpanFromContext(ctx context.Context) (*Span, bool) { + spanIDs, ok := getSpanIDsFromContext(ctx) + if !ok { + return nil, false + } + return globalTracer.getSpan(spanIDs.spanID) } -func (addr) String() string { - return "local" +// StartSpanFromEnv starts a span using the environment variables to find the parent span. +func StartSpanFromEnv(ctx context.Context, operationName string) (*Span, context.Context) { + traceID, parentID := extractIDsFromEnv() + return StartSpanFromIDs(ctx, operationName, traceID, parentID) } -// StartSpanFromEnv starts a span using the environment variables to find the parent span. -func StartSpanFromEnv(ctx context.Context, operationName string, spanOptions ...ddtrace.StartSpanOption) (ddtrace.Span, context.Context) { - spanContext, ok := spanContextFromEnv() - if ok { - spanOptions = append([]ddtrace.StartSpanOption{tracer.ChildOf(spanContext)}, spanOptions...) +func extractIDsFromEnv() (string, string) { + parentID, ok := os.LookupEnv(envParentID) + if !ok { + return "0", "0" + } + traceID, ok := os.LookupEnv(envTraceID) + if !ok { + return "0", "0" } - return tracer.StartSpanFromContext(ctx, operationName, spanOptions...) + return traceID, parentID } -// spanContextFromEnv injects the traceID and parentID from the environment into the context if available. -func spanContextFromEnv() (ddtrace.SpanContext, bool) { - traceID := os.Getenv(EnvTraceID) - parentID := os.Getenv(EnvParentID) - ctxCarrier := tracer.TextMapCarrier{ - tracer.DefaultTraceIDHeader: traceID, - tracer.DefaultParentIDHeader: parentID, - tracer.DefaultPriorityHeader: "2", +func converIDsToUint64(traceID, parentID string) (uint64, uint64) { + traceIDInt, err := strconv.ParseUint(traceID, 10, 64) + if err != nil { + return 0, 0 } - spanCtx, err := tracer.Extract(ctxCarrier) + parentIDInt, err := strconv.ParseUint(parentID, 10, 64) if err != nil { - log.Debugf("failed to extract span context from install script params: %v", err) - return nil, false + return 0, 0 } - return spanCtx, true + return traceIDInt, parentIDInt } -// EnvFromSpanContext returns the environment variables for the span context. -func EnvFromSpanContext(spanCtx ddtrace.SpanContext) []string { - env := []string{ - fmt.Sprintf("%s=%d", EnvTraceID, spanCtx.TraceID()), - fmt.Sprintf("%s=%d", EnvParentID, spanCtx.SpanID()), - } - return env +// StartSpanFromIDs starts a span using the trace and parent +// IDs provided. +func StartSpanFromIDs(ctx context.Context, operationName, traceID, parentID string) (*Span, context.Context) { + traceIDInt, parentIDInt := converIDsToUint64(traceID, parentID) + span, ctx := startSpanFromIDs(ctx, operationName, traceIDInt, parentIDInt) + span.SetTopLevel() + return span, ctx } -// SpanContextFromContext extracts the span context from the context if available. -func SpanContextFromContext(ctx context.Context) (ddtrace.SpanContext, bool) { - span, ok := tracer.SpanFromContext(ctx) - if !ok { - return nil, false - } - return span.Context(), true +func startSpanFromIDs(ctx context.Context, operationName string, traceID, parentID uint64) (*Span, context.Context) { + s := newSpan(operationName, parentID, traceID) + ctx = setSpanIDsInContext(ctx, s) + return s, ctx } -// WithSamplingRules sets the sampling rules for the telemetry. -func WithSamplingRules(rules ...tracer.SamplingRule) Option { - return func(t *Telemetry) { - t.samplingRules = rules +// StartSpanFromContext starts a span using the context to find the parent span. +func StartSpanFromContext(ctx context.Context, operationName string) (*Span, context.Context) { + spanIDs, _ := getSpanIDsFromContext(ctx) + return startSpanFromIDs(ctx, operationName, spanIDs.traceID, spanIDs.spanID) +} + +// EnvFromContext returns the environment variables for the context. +func EnvFromContext(ctx context.Context) []string { + sIDs, ok := getSpanIDsFromContext(ctx) + if !ok { + return []string{} + } + return []string{ + fmt.Sprintf("%s=%s", envTraceID, strconv.FormatUint(sIDs.traceID, 10)), + fmt.Sprintf("%s=%s", envParentID, strconv.FormatUint(sIDs.spanID, 10)), } } diff --git a/pkg/fleet/telemetry/telemetry_test.go b/pkg/fleet/telemetry/telemetry_test.go new file mode 100644 index 0000000000000..d0866ee4d4a13 --- /dev/null +++ b/pkg/fleet/telemetry/telemetry_test.go @@ -0,0 +1,222 @@ +// 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 telemetry provides the telemetry for fleet components. +package telemetry + +import ( + "context" + "errors" + "net/http" + "os" + "testing" + + "github.com/DataDog/datadog-agent/pkg/internaltelemetry" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestFreshSpan(t *testing.T) { + ctx := context.Background() + _, ok := SpanFromContext(ctx) + require.False(t, ok) + + s, ctx := StartSpanFromContext(ctx, "test") + require.NotNil(t, s) + s.SetResourceName("new") + + span, ok := SpanFromContext(ctx) + require.True(t, ok) + require.Equal(t, s, span) + + assert.Equal(t, "test", s.span.Name) + assert.Equal(t, "new", s.span.Resource) + assert.Equal(t, "new", s.span.Resource) + assert.Equal(t, "new", span.span.Resource) +} + +func TestInheritence(t *testing.T) { + ctx := context.Background() + s, ctx := StartSpanFromContext(ctx, "test") + require.NotNil(t, s) + + child, _ := StartSpanFromContext(ctx, "child") + require.NotNil(t, child) + + assert.Equal(t, s.span.SpanID, child.span.ParentID) + assert.Equal(t, s.span.TraceID, child.span.TraceID) +} + +func TestStartSpanFromIDs(t *testing.T) { + ctx := context.Background() + traceID := "100" + parentID := "200" + + span, ctx := StartSpanFromIDs(ctx, "ids-operation", traceID, parentID) + require.NotNil(t, span, "Expected a span") + require.Equal(t, uint64(100), span.span.TraceID) + require.Equal(t, uint64(200), span.span.ParentID) + + val, ok := span.span.Metrics["_top_level"] + require.True(t, ok) + require.Equal(t, 1.0, val) + + spanFromCtx, ok := SpanFromContext(ctx) + require.True(t, ok) + require.Equal(t, span, spanFromCtx) +} + +func strPtr(s string) *string { + return &s +} + +func TestSpanFromEnv(t *testing.T) { + randTraceID := uint64(9) + tt := []struct { + name string + envTraceID *string + envParentID *string + expectedTraceID uint64 + expectedParentID uint64 + }{ + { + name: "no parent env", + envTraceID: strPtr("100"), + envParentID: nil, + expectedTraceID: randTraceID, + expectedParentID: 0, + }, + { + name: "no trace env", + envTraceID: nil, + envParentID: strPtr("100"), + expectedTraceID: randTraceID, + expectedParentID: 0, + }, + { + name: "traceID malformed", + envTraceID: strPtr("not-a-number"), + envParentID: strPtr("200"), + expectedTraceID: randTraceID, + expectedParentID: 0, + }, + { + name: "parentID malformed", + envTraceID: strPtr("100"), + envParentID: strPtr("not-a-number"), + expectedTraceID: randTraceID, + expectedParentID: 0, + }, + { + name: "inheritance", + envTraceID: strPtr("100"), + envParentID: strPtr("200"), + expectedTraceID: 100, + expectedParentID: 200, + }, + } + for _, tc := range tt { + t.Run(tc.name, func(t *testing.T) { + if tc.envTraceID != nil { + os.Setenv(envTraceID, *tc.envTraceID) + defer os.Unsetenv(envTraceID) + } + if tc.envParentID != nil { + os.Setenv(envParentID, *tc.envParentID) + defer os.Unsetenv(envParentID) + } + + span, ctx := StartSpanFromEnv(context.Background(), "env-operation") + require.NotNil(t, span, "Expected a span") + s, ok := SpanFromContext(ctx) + assert.True(t, ok) + assert.Equal(t, span, s) + + assert.Equal(t, tc.expectedParentID, span.span.ParentID) + if tc.expectedTraceID != randTraceID { + assert.Equal(t, tc.expectedTraceID, span.span.TraceID) + } else { + assert.NotEqual(t, 0, span.span.TraceID) + } + + }) + } +} + +func TestLimit(t *testing.T) { + totalSpans := maxSpansInFlight + 2 + ctx := context.Background() + for i := 0; i < totalSpans; i++ { + _, ctx = StartSpanFromContext(ctx, "test") + } + assert.Len(t, globalTracer.spans, maxSpansInFlight) +} + +func TestEnvFromContext(t *testing.T) { + s, ctx := StartSpanFromContext(context.Background(), "test") + s.span.TraceID = 456 + s.span.SpanID = 123 + ctx = setSpanIDsInContext(ctx, s) + env := EnvFromContext(ctx) + assert.ElementsMatch(t, []string{"DATADOG_TRACE_ID=456", "DATADOG_PARENT_ID=123"}, env) + + env = EnvFromContext(context.Background()) + assert.ElementsMatch(t, []string{}, env) +} + +func TestSpanFinished(t *testing.T) { + s, _ := StartSpanFromContext(context.Background(), "test") + s.Finish(nil) + s.SetResourceName("new") + s.SetTag("key", "value") + + assert.Equal(t, "test", s.span.Resource) + _, ok := s.span.Meta["key"] + assert.False(t, ok) +} + +func TestRemapOnFlush(t *testing.T) { + const testService = "test-service" + const numTraces = 10 + telem := newTelemetry(&http.Client{}, "api", "datad0g.com", testService) + globalTracer = &tracer{spans: make(map[uint64]*Span)} + + // traces with 2 spans + for i := 0; i < numTraces; i++ { + parentSpan, ctx := StartSpanFromContext(context.Background(), "parent") + childSpan, _ := StartSpanFromContext(ctx, "child") + childSpan.Finish(errors.New("test_error")) + parentSpan.Finish(nil) + } + resTraces := telem.extractCompletedSpans() + require.Len(t, resTraces, numTraces) + + for _, trace := range resTraces { + assert.Len(t, trace, 2) + for _, span := range trace { + assert.Equal(t, testService, span.Service) + assert.Equal(t, "staging", span.Meta["env"]) + assert.Equal(t, 2.0, span.Metrics["_sampling_priority_v1"]) + } + var parent, child *internaltelemetry.Span + if trace[0].Name == "parent" { + parent = trace[0] + child = trace[1] + } else { + parent = trace[1] + child = trace[0] + } + assert.Equal(t, parent.SpanID, child.ParentID) + val, ok := parent.Metrics["_top_level"] + require.True(t, ok) + require.Equal(t, 1.0, val) + _, ok = child.Metrics["_top_level"] + require.False(t, ok) + + require.Equal(t, int32(1), child.Error) + require.Equal(t, "test_error", child.Meta["error.message"]) + require.Contains(t, child.Meta["error.stack"], "telemetry_test.go") + } +} diff --git a/pkg/fleet/telemetry/tracer.go b/pkg/fleet/telemetry/tracer.go new file mode 100644 index 0000000000000..0923b3563e457 --- /dev/null +++ b/pkg/fleet/telemetry/tracer.go @@ -0,0 +1,92 @@ +// 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 telemetry provides the telemetry for fleet components. +package telemetry + +import ( + "math" + "strings" + "sync" +) + +const ( + dropTraceID = 1 + maxSpansInFlight = 1000 +) + +var ( + globalTracer *tracer + samplingRates = map[string]float64{ + "cdn": 0.1, + "garbage_collect": 0.05, + "HTTPClient": 0.05, + } +) + +func init() { + globalTracer = &tracer{ + spans: make(map[uint64]*Span), + } +} + +type tracer struct { + mu sync.Mutex + spans map[uint64]*Span + completedSpans []*Span +} + +func (t *tracer) registerSpan(span *Span) { + if span.span.TraceID == dropTraceID { + return + } + t.mu.Lock() + defer t.mu.Unlock() + // naive maxSpansInFlight check as this is just telemetry + // next iteration if needed would be to flush long running spans to troubleshoot + if len(t.spans) >= maxSpansInFlight { + return + } + t.spans[span.span.SpanID] = span +} + +func (t *tracer) getSpan(spanID uint64) (*Span, bool) { + t.mu.Lock() + defer t.mu.Unlock() + span, ok := t.spans[spanID] + return span, ok +} + +func (t *tracer) finishSpan(span *Span) { + t.mu.Lock() + defer t.mu.Unlock() + delete(t.spans, span.span.SpanID) + t.completedSpans = append(t.completedSpans, span) +} + +func (t *tracer) flushCompletedSpans() []*Span { + t.mu.Lock() + defer t.mu.Unlock() + newSpanArray := make([]*Span, 0) + completedSpans := t.completedSpans + t.completedSpans = newSpanArray + return completedSpans +} + +func headSamplingKeep(spanName string, traceID uint64) bool { + for k, r := range samplingRates { + if strings.Contains(spanName, k) { + return sampledByRate(traceID, r) + } + } + return true +} + +func sampledByRate(n uint64, rate float64) bool { + if rate < 1 { + return n*uint64(1111111111111111111) < uint64(rate*math.MaxUint64) + } + return true +} diff --git a/pkg/gohai/cpu/util_linux.go b/pkg/gohai/cpu/util_linux.go index 129801f8bdaf2..fc82760141e56 100644 --- a/pkg/gohai/cpu/util_linux.go +++ b/pkg/gohai/cpu/util_linux.go @@ -12,7 +12,7 @@ import ( "strconv" "strings" - log "github.com/cihub/seelog" + "github.com/DataDog/datadog-agent/pkg/util/log" ) var prefix = "" // only used for testing diff --git a/pkg/gohai/filesystem/filesystem_nix.go b/pkg/gohai/filesystem/filesystem_nix.go index 27f5094d1e282..f4171904f60bd 100644 --- a/pkg/gohai/filesystem/filesystem_nix.go +++ b/pkg/gohai/filesystem/filesystem_nix.go @@ -10,10 +10,10 @@ import ( "fmt" "strings" + "github.com/moby/sys/mountinfo" "golang.org/x/sys/unix" - log "github.com/cihub/seelog" - "github.com/moby/sys/mountinfo" + "github.com/DataDog/datadog-agent/pkg/util/log" ) type fsInfoGetter func(*mountinfo.Info) (uint64, error) diff --git a/pkg/gohai/go.mod b/pkg/gohai/go.mod index d836c017c69c6..61a9d4274f3c5 100644 --- a/pkg/gohai/go.mod +++ b/pkg/gohai/go.mod @@ -6,28 +6,26 @@ go 1.23.0 require ( github.com/DataDog/datadog-agent/pkg/util/log v0.56.0-rc.3 - github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 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.27.0 + golang.org/x/sys v0.28.0 ) 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/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/kr/text v0.2.0 // indirect - github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c // indirect + github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a // 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/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // 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 go.uber.org/atomic v1.11.0 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) @@ -35,3 +33,5 @@ replace ( github.com/DataDog/datadog-agent/pkg/util/log => ../util/log github.com/DataDog/datadog-agent/pkg/util/scrubber => ../util/scrubber ) + +replace github.com/DataDog/datadog-agent/pkg/version => ../version diff --git a/pkg/gohai/go.sum b/pkg/gohai/go.sum index b2d1eb2720650..e168179638c6e 100644 --- a/pkg/gohai/go.sum +++ b/pkg/gohai/go.sum @@ -1,34 +1,30 @@ github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 h1:kHaBemcxl8o/pQ5VM1c8PVE1PubbNx3mjUr09OqWGCs= github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575/go.mod h1:9d6lWj8KzO/fd/NrVaLscBKmPigpZpn5YawRPw+e3Yo= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= 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= -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= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= 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-20220913051719-115f729f3c8c h1:VtwQ41oftZwlMnOEbMWQtSEUgU64U4s+GHk7hZK+jtY= -github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c/go.mod h1:JKx41uQRwqlTZabZc+kILPrO/3jlKnQ2Z8b7YiVw5cE= +github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a h1:3Bm7EwfUQUvhNeKIkUct/gl9eod1TcXuj8stxvi/GoI= +github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a/go.mod h1:ilwx/Dta8jXAgpFYFvSWEMwxmbWXyiUHkd5FwyKhb5k= github.com/moby/sys/mountinfo v0.7.2 h1:1shs6aH5s4o5H2zQLn796ADW1wMrIwHsyJ2v9KouLrg= github.com/moby/sys/mountinfo v0.7.2/go.mod h1:1YOa8w8Ih7uW0wALDUgT1dTTSBrZ+HiBLGws92L2RU4= 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-20220216144756-c35f1ee13d7c h1:NRoLoZvkBTKvR5gQLgA3e0hqjkY9u1wm+iOL45VN/qI= -github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 h1:o4JXh1EVt9k/+g42oCprj/FisM4qX9L3sZB3upGN2ZU= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55/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= @@ -42,12 +38,10 @@ go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0 golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.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= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/pkg/gohai/memory/memory_linux.go b/pkg/gohai/memory/memory_linux.go index 356d9dee67d9e..822a082fc4aee 100644 --- a/pkg/gohai/memory/memory_linux.go +++ b/pkg/gohai/memory/memory_linux.go @@ -14,7 +14,7 @@ import ( "strings" "github.com/DataDog/datadog-agent/pkg/gohai/utils" - log "github.com/cihub/seelog" + "github.com/DataDog/datadog-agent/pkg/util/log" ) func parseMemoryInfo(reader io.Reader) (totalBytes utils.Value[uint64], swapTotalKb utils.Value[uint64], err error) { diff --git a/pkg/gohai/platform/platform_darwin.go b/pkg/gohai/platform/platform_darwin.go index e1fb7ed154923..a28bdf3ebead5 100644 --- a/pkg/gohai/platform/platform_darwin.go +++ b/pkg/gohai/platform/platform_darwin.go @@ -9,9 +9,10 @@ import ( "errors" "runtime" - "github.com/DataDog/datadog-agent/pkg/gohai/utils" - log "github.com/cihub/seelog" "golang.org/x/sys/unix" + + "github.com/DataDog/datadog-agent/pkg/gohai/utils" + "github.com/DataDog/datadog-agent/pkg/util/log" ) // getUnameProcessor is similar to `uname -p` diff --git a/pkg/gohai/processes/gops/process_info.go b/pkg/gohai/processes/gops/process_info.go index 8f21f07ba5dc8..bdbd3c4601109 100644 --- a/pkg/gohai/processes/gops/process_info.go +++ b/pkg/gohai/processes/gops/process_info.go @@ -12,12 +12,10 @@ import ( "fmt" "runtime" - // 3p - log "github.com/cihub/seelog" + "github.com/shirou/gopsutil/v4/mem" + "github.com/shirou/gopsutil/v4/process" - // project - "github.com/shirou/gopsutil/v3/mem" - "github.com/shirou/gopsutil/v3/process" + "github.com/DataDog/datadog-agent/pkg/util/log" ) // ProcessInfo contains information about a single process diff --git a/pkg/gpu/aggregator.go b/pkg/gpu/aggregator.go index 6e907c24428a1..30a20e9146efd 100644 --- a/pkg/gpu/aggregator.go +++ b/pkg/gpu/aggregator.go @@ -38,13 +38,13 @@ type aggregator struct { // processTerminated is true if the process has ended and this aggregator should be deleted processTerminated bool - // sysCtx is the system context with global GPU-system data - sysCtx *systemContext + // deviceMaxThreads is the maximum number of threads the GPU can run in parallel, for utilization calculations + deviceMaxThreads uint64 } -func newAggregator(sysCtx *systemContext) *aggregator { +func newAggregator(deviceMaxThreads uint64) *aggregator { return &aggregator{ - sysCtx: sysCtx, + deviceMaxThreads: deviceMaxThreads, } } @@ -60,8 +60,7 @@ func (agg *aggregator) processKernelSpan(span *kernelSpan) { } durationSec := float64(tsEnd-tsStart) / float64(time.Second.Nanoseconds()) - maxThreads := uint64(agg.sysCtx.maxGpuThreadsPerDevice[0]) // TODO: MultiGPU support not enabled yet - agg.totalThreadSecondsUsed += durationSec * float64(min(span.avgThreadCount, maxThreads)) // we can't use more threads than the GPU has + agg.totalThreadSecondsUsed += durationSec * float64(min(span.avgThreadCount, agg.deviceMaxThreads)) // we can't use more threads than the GPU has } // processPastData takes spans/allocations that have already been closed @@ -86,8 +85,7 @@ func (agg *aggregator) processCurrentData(data *streamData) { func (agg *aggregator) getGPUUtilization() float64 { intervalSecs := float64(agg.measuredIntervalNs) / float64(time.Second.Nanoseconds()) if intervalSecs > 0 { - // TODO: MultiGPU support not enabled yet - availableThreadSeconds := float64(agg.sysCtx.maxGpuThreadsPerDevice[0]) * intervalSecs + availableThreadSeconds := float64(agg.deviceMaxThreads) * intervalSecs return agg.totalThreadSecondsUsed / availableThreadSeconds } diff --git a/pkg/gpu/consumer.go b/pkg/gpu/consumer.go index f4ebb7f04b0f2..55148350b12e3 100644 --- a/pkg/gpu/consumer.go +++ b/pkg/gpu/consumer.go @@ -220,7 +220,7 @@ func (c *cudaEventConsumer) getStreamKey(header *gpuebpf.CudaEventHeader) stream // Try to get the GPU device if we can, but do not fail if we can't as we want to report // the data even if we can't get the GPU UUID - gpuDevice, err := c.sysCtx.getCurrentActiveGpuDevice(int(pid), int(tid)) + gpuDevice, err := c.sysCtx.getCurrentActiveGpuDevice(int(pid), int(tid), containerID) if err != nil { log.Warnf("Error getting GPU device for process %d: %v", pid, err) } else { diff --git a/pkg/gpu/consumer_test.go b/pkg/gpu/consumer_test.go index 6530f2bb49738..c7c7aa04837d7 100644 --- a/pkg/gpu/consumer_test.go +++ b/pkg/gpu/consumer_test.go @@ -22,7 +22,7 @@ import ( func TestConsumerCanStartAndStop(t *testing.T) { handler := ddebpf.NewRingBufferHandler(consumerChannelSize) cfg := config.New() - ctx, err := getSystemContext(testutil.GetBasicNvmlMock(), kernel.ProcFSRoot()) + ctx, err := getSystemContext(testutil.GetBasicNvmlMock(), kernel.ProcFSRoot(), testutil.GetWorkloadMetaMock(t)) require.NoError(t, err) consumer := newCudaEventConsumer(ctx, handler, cfg) diff --git a/pkg/gpu/context.go b/pkg/gpu/context.go index 6c38ae4ad978c..59d778bfea5c1 100644 --- a/pkg/gpu/context.go +++ b/pkg/gpu/context.go @@ -16,10 +16,15 @@ import ( "github.com/NVIDIA/go-nvml/pkg/nvml" + workloadmeta "github.com/DataDog/datadog-agent/comp/core/workloadmeta/def" + "github.com/DataDog/datadog-agent/pkg/errors" "github.com/DataDog/datadog-agent/pkg/gpu/cuda" "github.com/DataDog/datadog-agent/pkg/util/ktime" + "github.com/DataDog/datadog-agent/pkg/util/log" ) +const nvidiaResourceName = "nvidia.com/gpu" + // systemContext holds certain attributes about the system that are used by the GPU probe. type systemContext struct { // maxGpuThreadsPerDevice maps each device index to the maximum number of threads it can run in parallel @@ -60,6 +65,9 @@ type systemContext struct { // visibleDevicesCache is a cache of visible devices for each process, to avoid // looking into the environment variables every time visibleDevicesCache map[int][]nvml.Device + + // workloadmeta is the workloadmeta component that we use to get necessary container metadata + workloadmeta workloadmeta.Component } // symbolsEntry embeds cuda.Symbols adding a field for keeping track of the last @@ -73,7 +81,7 @@ func (e *symbolsEntry) updateLastUsedTime() { e.lastUsedTime = time.Now() } -func getSystemContext(nvmlLib nvml.Interface, procRoot string) (*systemContext, error) { +func getSystemContext(nvmlLib nvml.Interface, procRoot string, wmeta workloadmeta.Component) (*systemContext, error) { ctx := &systemContext{ maxGpuThreadsPerDevice: make(map[int]int), deviceSmVersions: make(map[int]int), @@ -83,6 +91,7 @@ func getSystemContext(nvmlLib nvml.Interface, procRoot string) (*systemContext, procRoot: procRoot, selectedDeviceByPIDAndTID: make(map[int]map[int]int32), visibleDevicesCache: make(map[int][]nvml.Device), + workloadmeta: wmeta, } if err := ctx.fillDeviceInfo(); err != nil { @@ -209,13 +218,75 @@ func (ctx *systemContext) cleanupOldEntries() { } } +// filterDevicesForContainer filters the available GPU devices for the given +// container. If the ID is not empty, we check the assignment of GPU resources +// to the container and return only the devices that are available to the +// container. +func (ctx *systemContext) filterDevicesForContainer(devices []nvml.Device, containerID string) ([]nvml.Device, error) { + if containerID == "" { + // If the process is not running in a container, we assume all devices are available. + return devices, nil + } + + container, err := ctx.workloadmeta.GetContainer(containerID) + if err != nil { + // If we don't find the container, we assume all devices are available. + // This can happen sometimes, e.g. if we don't have the container in the + // store yet. Do not block metrics on that. + if errors.IsNotFound(err) { + return devices, nil + } + + // Some error occurred while retrieving the container, this could be a + // general error with the store, report it. + return nil, fmt.Errorf("cannot retrieve data for container %s: %s", containerID, err) + } + + var filteredDevices []nvml.Device + for _, resource := range container.AllocatedResources { + // Only consider NVIDIA GPUs + if resource.Name != nvidiaResourceName { + continue + } + + for _, device := range devices { + uuid, ret := device.GetUUID() + if ret != nvml.SUCCESS { + log.Warnf("Error getting GPU UUID for device %s: %s", device, nvml.ErrorString(ret)) + continue + } + + if resource.ID == uuid { + filteredDevices = append(filteredDevices, device) + break + } + } + } + + // We didn't find any devices assigned to the container, report it as an error. + if len(filteredDevices) == 0 { + return nil, fmt.Errorf("no GPU devices found for container %s that matched its allocated resources %+v", containerID, container.AllocatedResources) + } + + return filteredDevices, nil +} + // getCurrentActiveGpuDevice returns the active GPU device for a given process and thread, based on the // last selection (via cudaSetDevice) this thread made and the visible devices for the process. -func (ctx *systemContext) getCurrentActiveGpuDevice(pid int, tid int) (nvml.Device, error) { +func (ctx *systemContext) getCurrentActiveGpuDevice(pid int, tid int, containerID string) (nvml.Device, error) { visibleDevices, ok := ctx.visibleDevicesCache[pid] if !ok { - var err error - visibleDevices, err = cuda.GetVisibleDevicesForProcess(ctx.gpuDevices, pid, ctx.procRoot) + // Order is important! We need to filter the devices for the container + // first. In a container setting, the environment variable acts as a + // filter on the devices that are available to the process, not on the + // devices available on the host system. + var err error // avoid shadowing visibleDevices, declare error before so we can use = instead of := + visibleDevices, err = ctx.filterDevicesForContainer(ctx.gpuDevices, containerID) + if err != nil { + return nil, fmt.Errorf("error filtering devices for container %s: %w", containerID, err) + } + + visibleDevices, err = cuda.GetVisibleDevicesForProcess(visibleDevices, pid, ctx.procRoot) if err != nil { return nil, fmt.Errorf("error getting visible devices for process %d: %w", pid, err) } @@ -248,3 +319,17 @@ func (ctx *systemContext) setDeviceSelection(pid int, tid int, deviceIndex int32 ctx.selectedDeviceByPIDAndTID[pid][tid] = deviceIndex } + +// getDeviceByUUID returns the device with the given UUID. +func (ctx *systemContext) getDeviceByUUID(uuid string) (nvml.Device, error) { + for _, dev := range ctx.gpuDevices { + devUUID, ret := dev.GetUUID() + if ret != nvml.SUCCESS { + return nil, fmt.Errorf("error getting device UUID: %s", nvml.ErrorString(ret)) + } + if devUUID == uuid { + return dev, nil + } + } + return nil, fmt.Errorf("device with UUID %s not found", uuid) +} diff --git a/pkg/gpu/context_test.go b/pkg/gpu/context_test.go new file mode 100644 index 0000000000000..dbb6e1735df24 --- /dev/null +++ b/pkg/gpu/context_test.go @@ -0,0 +1,176 @@ +// 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_bpf + +package gpu + +import ( + "strconv" + "strings" + "testing" + + "github.com/stretchr/testify/require" + + workloadmeta "github.com/DataDog/datadog-agent/comp/core/workloadmeta/def" + "github.com/DataDog/datadog-agent/pkg/ebpf/uprobes" + "github.com/DataDog/datadog-agent/pkg/gpu/testutil" + "github.com/DataDog/datadog-agent/pkg/util/kernel" +) + +func TestFilterDevicesForContainer(t *testing.T) { + wmetaMock := testutil.GetWorkloadMetaMock(t) + sysCtx, err := getSystemContext(testutil.GetBasicNvmlMock(), kernel.ProcFSRoot(), wmetaMock) + require.NotNil(t, sysCtx) + require.NoError(t, err) + + // Create a container with a single GPU and add it to the store + containerID := "abcdef" + deviceIndex := 2 + gpuUUID := testutil.GPUUUIDs[deviceIndex] + container := &workloadmeta.Container{ + EntityID: workloadmeta.EntityID{ + Kind: workloadmeta.KindContainer, + ID: containerID, + }, + EntityMeta: workloadmeta.EntityMeta{ + Name: containerID, + }, + AllocatedResources: []workloadmeta.ContainerAllocatedResource{ + { + Name: nvidiaResourceName, + ID: gpuUUID, + }, + }, + } + + wmetaMock.Set(container) + storeContainer, err := wmetaMock.GetContainer(containerID) + require.NoError(t, err, "container should be found in the store") + require.NotNil(t, storeContainer, "container should be found in the store") + + t.Run("NoContainer", func(t *testing.T) { + filtered, err := sysCtx.filterDevicesForContainer(sysCtx.gpuDevices, "") + require.NoError(t, err) + testutil.RequireDeviceListsEqual(t, filtered, sysCtx.gpuDevices) // With no container, all devices should be returned + }) + + t.Run("NonExistentContainer", func(t *testing.T) { + filtered, err := sysCtx.filterDevicesForContainer(sysCtx.gpuDevices, "non-existent-at-all") + require.NoError(t, err) + testutil.RequireDeviceListsEqual(t, filtered, sysCtx.gpuDevices) // If we can't find the container, all devices should be returned + }) + + t.Run("ContainerWithGPU", func(t *testing.T) { + filtered, err := sysCtx.filterDevicesForContainer(sysCtx.gpuDevices, containerID) + require.NoError(t, err) + require.Len(t, filtered, 1) + testutil.RequireDeviceListsEqual(t, filtered, sysCtx.gpuDevices[deviceIndex:deviceIndex+1]) + }) +} + +func TestGetCurrentActiveGpuDevice(t *testing.T) { + pidNoContainer := 1234 + pidNoContainerButEnv := 2235 + pidContainer := 3238 + pidContainerAndEnv := 3239 + + envVisibleDevices := []int32{1, 2, 3} + envVisibleDevicesStr := make([]string, len(envVisibleDevices)) + for i, idx := range envVisibleDevices { + envVisibleDevicesStr[i] = strconv.Itoa(int(idx)) + } + envVisibleDevicesValue := strings.Join(envVisibleDevicesStr, ",") + + procFs := uprobes.CreateFakeProcFS(t, []uprobes.FakeProcFSEntry{ + {Pid: uint32(pidNoContainer)}, + {Pid: uint32(pidContainer)}, + {Pid: uint32(pidContainerAndEnv), Env: map[string]string{"CUDA_VISIBLE_DEVICES": envVisibleDevicesValue}}, + {Pid: uint32(pidNoContainerButEnv), Env: map[string]string{"CUDA_VISIBLE_DEVICES": envVisibleDevicesValue}}, + }) + + wmetaMock := testutil.GetWorkloadMetaMock(t) + sysCtx, err := getSystemContext(testutil.GetBasicNvmlMock(), procFs, wmetaMock) + require.NotNil(t, sysCtx) + require.NoError(t, err) + + // Create a container with a single GPU and add it to the store + containerID := "abcdef" + container := &workloadmeta.Container{ + EntityID: workloadmeta.EntityID{ + Kind: workloadmeta.KindContainer, + ID: containerID, + }, + EntityMeta: workloadmeta.EntityMeta{ + Name: containerID, + }, + } + + containerDeviceIndexes := []int32{1, 2, 3, 4} + for _, idx := range containerDeviceIndexes { + gpuUUID := testutil.GPUUUIDs[idx] + resource := workloadmeta.ContainerAllocatedResource{ + Name: nvidiaResourceName, + ID: gpuUUID, + } + container.AllocatedResources = append(container.AllocatedResources, resource) + } + + wmetaMock.Set(container) + storeContainer, err := wmetaMock.GetContainer(containerID) + require.NoError(t, err, "container should be found in the store") + require.NotNil(t, storeContainer, "container should be found in the store") + + cases := []struct { + name string + pid int + containerID string + configuredDeviceIdx []int32 + expectedDeviceIdx []int32 + }{ + { + name: "NoContainer", + containerID: "", + pid: pidNoContainer, + configuredDeviceIdx: []int32{1, 2}, + expectedDeviceIdx: []int32{1, 2}, + }, + { + name: "NoContainerButEnv", + containerID: "", + pid: pidNoContainerButEnv, + configuredDeviceIdx: []int32{1, 2}, + expectedDeviceIdx: []int32{envVisibleDevices[1], envVisibleDevices[2]}, + }, + { + name: "WithContainer", + containerID: containerID, + pid: pidContainer, + configuredDeviceIdx: []int32{1, 2}, + expectedDeviceIdx: []int32{containerDeviceIndexes[1], containerDeviceIndexes[2]}, + }, + { + name: "WithContainerAndEnv", + pid: pidContainerAndEnv, + containerID: containerID, + configuredDeviceIdx: []int32{1, 2}, + expectedDeviceIdx: []int32{containerDeviceIndexes[envVisibleDevices[1]], containerDeviceIndexes[envVisibleDevices[2]]}, + }, + } + + for _, c := range cases { + t.Run(c.name, func(t *testing.T) { + for i, idx := range c.configuredDeviceIdx { + sysCtx.setDeviceSelection(c.pid, c.pid+i, idx) + } + + for i, idx := range c.expectedDeviceIdx { + activeDevice, err := sysCtx.getCurrentActiveGpuDevice(c.pid, c.pid+i, c.containerID) + require.NoError(t, err) + testutil.RequireDevicesEqual(t, sysCtx.gpuDevices[idx], activeDevice, "invalid device at index %d (real index is %d, selected index is %d)", i, idx, c.configuredDeviceIdx[i]) + } + }) + } +} diff --git a/pkg/gpu/probe.go b/pkg/gpu/probe.go index 3ab58ede54f35..fafc90df19c28 100644 --- a/pkg/gpu/probe.go +++ b/pkg/gpu/probe.go @@ -22,6 +22,7 @@ import ( "github.com/cilium/ebpf" "github.com/DataDog/datadog-agent/comp/core/telemetry" + workloadmeta "github.com/DataDog/datadog-agent/comp/core/workloadmeta/def" "github.com/DataDog/datadog-agent/pkg/collector/corechecks/gpu/model" ddebpf "github.com/DataDog/datadog-agent/pkg/ebpf" ebpftelemetry "github.com/DataDog/datadog-agent/pkg/ebpf/telemetry" @@ -81,6 +82,10 @@ type ProbeDependencies struct { // ProcessMonitor is the process monitor interface ProcessMonitor uprobes.ProcessMonitor + + // WorkloadMeta used to retrieve data about workloads (containers, processes) running + // on the host + WorkloadMeta workloadmeta.Component } // Probe represents the GPU monitoring probe @@ -109,7 +114,7 @@ func NewProbe(cfg *config.Config, deps ProbeDependencies) (*Probe, error) { } attachCfg := getAttacherConfig(cfg) - sysCtx, err := getSystemContext(deps.NvmlLib, cfg.ProcRoot) + sysCtx, err := getSystemContext(deps.NvmlLib, cfg.ProcRoot, deps.WorkloadMeta) if err != nil { return nil, fmt.Errorf("error getting system context: %w", err) } diff --git a/pkg/gpu/probe_stub.go b/pkg/gpu/probe_stub.go index 734a11919abb9..2f4ebf544c984 100644 --- a/pkg/gpu/probe_stub.go +++ b/pkg/gpu/probe_stub.go @@ -11,6 +11,7 @@ import ( "github.com/NVIDIA/go-nvml/pkg/nvml" "github.com/DataDog/datadog-agent/comp/core/telemetry" + workloadmeta "github.com/DataDog/datadog-agent/comp/core/workloadmeta/def" "github.com/DataDog/datadog-agent/pkg/collector/corechecks/gpu/model" "github.com/DataDog/datadog-agent/pkg/ebpf" "github.com/DataDog/datadog-agent/pkg/gpu/config" @@ -21,6 +22,7 @@ type ProbeDependencies struct { Telemetry telemetry.Component NvmlLib nvml.Interface ProcessMonitor any // uprobes.ProcessMonitor is only compiled with the linux_bpf build tag, so we need to use type any here + WorkloadMeta workloadmeta.Component } // Probe is not implemented on non-linux systems diff --git a/pkg/gpu/probe_test.go b/pkg/gpu/probe_test.go index f3eda56e2d2d9..ff2834b0327bc 100644 --- a/pkg/gpu/probe_test.go +++ b/pkg/gpu/probe_test.go @@ -47,6 +47,7 @@ func (s *probeTestSuite) getProbe() *Probe { deps := ProbeDependencies{ NvmlLib: testutil.GetBasicNvmlMock(), ProcessMonitor: consumerstestutil.NewTestProcessConsumer(t), + WorkloadMeta: testutil.GetWorkloadMetaMock(t), } probe, err := NewProbe(cfg, deps) require.NoError(t, err) diff --git a/pkg/gpu/stats.go b/pkg/gpu/stats.go index 753fadcf084d9..ba50db6c5226a 100644 --- a/pkg/gpu/stats.go +++ b/pkg/gpu/stats.go @@ -8,8 +8,13 @@ package gpu import ( + "fmt" + + "github.com/NVIDIA/go-nvml/pkg/nvml" + "github.com/DataDog/datadog-agent/pkg/collector/corechecks/gpu/model" ddebpf "github.com/DataDog/datadog-agent/pkg/ebpf" + "github.com/DataDog/datadog-agent/pkg/util/log" ) // statsGenerator connects to the active stream handlers and generates stats for the GPU monitoring, by distributing @@ -40,7 +45,12 @@ func (g *statsGenerator) getStats(nowKtime int64) *model.GPUStats { g.currGenerationKTime = nowKtime for key, handler := range g.streamHandlers { - aggr := g.getOrCreateAggregator(key) + aggr, err := g.getOrCreateAggregator(key) + if err != nil { + log.Errorf("Error getting or creating aggregator for key %v: %s", key, err) + continue + } + currData := handler.getCurrentData(uint64(nowKtime)) pastData := handler.getPastData(true) @@ -76,7 +86,7 @@ func (g *statsGenerator) getStats(nowKtime int64) *model.GPUStats { return stats } -func (g *statsGenerator) getOrCreateAggregator(sKey streamKey) *aggregator { +func (g *statsGenerator) getOrCreateAggregator(sKey streamKey) (*aggregator, error) { aggKey := model.StatsKey{ PID: sKey.pid, DeviceUUID: sKey.gpuUUID, @@ -84,13 +94,23 @@ func (g *statsGenerator) getOrCreateAggregator(sKey streamKey) *aggregator { } if _, ok := g.aggregators[aggKey]; !ok { - g.aggregators[aggKey] = newAggregator(g.sysCtx) + gpuDevice, err := g.sysCtx.getDeviceByUUID(sKey.gpuUUID) + if err != nil { + return nil, fmt.Errorf("Error getting device by UUID %s: %s", sKey.gpuUUID, err) + } + + maxThreads, ret := gpuDevice.GetNumGpuCores() + if ret != nvml.SUCCESS { + return nil, fmt.Errorf("Error getting number of GPU cores: %s", nvml.ErrorString(ret)) + } + + g.aggregators[aggKey] = newAggregator(uint64(maxThreads)) } // Update the last check time and the measured interval, as these change between check runs g.aggregators[aggKey].lastCheckKtime = uint64(g.lastGenerationKTime) g.aggregators[aggKey].measuredIntervalNs = g.currGenerationKTime - g.lastGenerationKTime - return g.aggregators[aggKey] + return g.aggregators[aggKey], nil } // getNormalizationFactor returns the factor to use for utilization diff --git a/pkg/gpu/stats_test.go b/pkg/gpu/stats_test.go index 4ebbec874ecdc..5aa4b2304cf3a 100644 --- a/pkg/gpu/stats_test.go +++ b/pkg/gpu/stats_test.go @@ -31,7 +31,7 @@ func getMetricsEntry(key model.StatsKey, stats *model.GPUStats) *model.Utilizati } func getStatsGeneratorForTest(t *testing.T) (*statsGenerator, map[streamKey]*StreamHandler, int64) { - sysCtx, err := getSystemContext(testutil.GetBasicNvmlMock(), kernel.ProcFSRoot()) + sysCtx, err := getSystemContext(testutil.GetBasicNvmlMock(), kernel.ProcFSRoot(), testutil.GetWorkloadMetaMock(t)) require.NoError(t, err) require.NotNil(t, sysCtx) @@ -233,3 +233,49 @@ func TestGetStatsWithPastAndCurrentData(t *testing.T) { expectedUtil := expectedUtilKern1 + expectedUtilKern2 require.InDelta(t, expectedUtil, metrics.UtilizationPercentage, 0.001) } + +func TestGetStatsMultiGPU(t *testing.T) { + statsGen, streamHandlers, ktime := getStatsGeneratorForTest(t) + + startKtime := ktime + int64(1*time.Second) + endKtime := startKtime + int64(1*time.Second) + + pid := uint32(1) + numThreads := uint64(5) + + // Add kernels for all devices + for i, uuid := range testutil.GPUUUIDs { + streamID := uint64(i) + streamKey := streamKey{pid: pid, stream: streamID, gpuUUID: uuid} + streamHandlers[streamKey] = &StreamHandler{ + processEnded: false, + kernelSpans: []*kernelSpan{ + { + startKtime: uint64(startKtime), + endKtime: uint64(endKtime), + avgThreadCount: numThreads, + numKernels: 10, + }, + }, + } + } + + checkDuration := 10 * time.Second + checkKtime := ktime + int64(checkDuration) + stats := statsGen.getStats(checkKtime) + require.NotNil(t, stats) + + // Check the metrics for each device + for i, uuid := range testutil.GPUUUIDs { + metricsKey := model.StatsKey{PID: pid, DeviceUUID: uuid} + metrics := getMetricsEntry(metricsKey, stats) + require.NotNil(t, metrics, "cannot find metrics for key %+v", metricsKey) + + gpuCores := float64(testutil.GPUCores[i]) + threadSecondsUsed := float64(numThreads) * float64(endKtime-startKtime) / 1e9 + threadSecondsAvailable := gpuCores * checkDuration.Seconds() + expectedUtil := threadSecondsUsed / threadSecondsAvailable + + require.InDelta(t, expectedUtil, metrics.UtilizationPercentage, 0.001, "invalid utilization for device %d (uuid=%s)", i, uuid) + } +} diff --git a/pkg/gpu/stream_test.go b/pkg/gpu/stream_test.go index f33e4f342e98b..0e4f0a5b734c8 100644 --- a/pkg/gpu/stream_test.go +++ b/pkg/gpu/stream_test.go @@ -21,10 +21,16 @@ import ( "github.com/DataDog/datadog-agent/pkg/util/kernel" ) -func TestKernelLaunchesHandled(t *testing.T) { - sysCtx, err := getSystemContext(testutil.GetBasicNvmlMock(), kernel.ProcFSRoot()) +func getSystemContextForTest(t *testing.T) *systemContext { + sysCtx, err := getSystemContext(testutil.GetBasicNvmlMock(), kernel.ProcFSRoot(), testutil.GetWorkloadMetaMock(t)) require.NoError(t, err) - stream := newStreamHandler(0, "", sysCtx) + require.NotNil(t, sysCtx) + + return sysCtx +} + +func TestKernelLaunchesHandled(t *testing.T) { + stream := newStreamHandler(0, "", getSystemContextForTest(t)) kernStartTime := uint64(1) launch := &gpuebpf.CudaKernelLaunch{ @@ -81,9 +87,7 @@ func TestKernelLaunchesHandled(t *testing.T) { } func TestMemoryAllocationsHandled(t *testing.T) { - sysCtx, err := getSystemContext(testutil.GetBasicNvmlMock(), kernel.ProcFSRoot()) - require.NoError(t, err) - stream := newStreamHandler(0, "", sysCtx) + stream := newStreamHandler(0, "", getSystemContextForTest(t)) memAllocTime := uint64(1) memFreeTime := uint64(2) @@ -152,9 +156,7 @@ func TestMemoryAllocationsHandled(t *testing.T) { } func TestMemoryAllocationsDetectLeaks(t *testing.T) { - sysCtx, err := getSystemContext(testutil.GetBasicNvmlMock(), kernel.ProcFSRoot()) - require.NoError(t, err) - stream := newStreamHandler(0, "", sysCtx) + stream := newStreamHandler(0, "", getSystemContextForTest(t)) memAllocTime := uint64(1) memAddr := uint64(42) @@ -187,9 +189,7 @@ func TestMemoryAllocationsDetectLeaks(t *testing.T) { } func TestMemoryAllocationsNoCrashOnInvalidFree(t *testing.T) { - sysCtx, err := getSystemContext(testutil.GetBasicNvmlMock(), kernel.ProcFSRoot()) - require.NoError(t, err) - stream := newStreamHandler(0, "", sysCtx) + stream := newStreamHandler(0, "", getSystemContextForTest(t)) memAllocTime := uint64(1) memFreeTime := uint64(2) @@ -231,9 +231,7 @@ func TestMemoryAllocationsNoCrashOnInvalidFree(t *testing.T) { } func TestMemoryAllocationsMultipleAllocsHandled(t *testing.T) { - sysCtx, err := getSystemContext(testutil.GetBasicNvmlMock(), kernel.ProcFSRoot()) - require.NoError(t, err) - stream := newStreamHandler(0, "", sysCtx) + stream := newStreamHandler(0, "", getSystemContextForTest(t)) memAllocTime1, memAllocTime2 := uint64(1), uint64(10) memFreeTime1, memFreeTime2 := uint64(15), uint64(20) @@ -324,7 +322,7 @@ func TestMemoryAllocationsMultipleAllocsHandled(t *testing.T) { func TestKernelLaunchesIncludeEnrichedKernelData(t *testing.T) { proc := kernel.ProcFSRoot() - sysCtx, err := getSystemContext(testutil.GetBasicNvmlMock(), proc) + sysCtx, err := getSystemContext(testutil.GetBasicNvmlMock(), proc, testutil.GetWorkloadMetaMock(t)) require.NoError(t, err) // Set up the caches in system context so no actual queries are done diff --git a/pkg/gpu/testutil/mocks.go b/pkg/gpu/testutil/mocks.go index b703a39001ef4..009385125600a 100644 --- a/pkg/gpu/testutil/mocks.go +++ b/pkg/gpu/testutil/mocks.go @@ -9,8 +9,19 @@ package testutil import ( + "fmt" + "testing" + "github.com/NVIDIA/go-nvml/pkg/nvml" nvmlmock "github.com/NVIDIA/go-nvml/pkg/nvml/mock" + "github.com/stretchr/testify/require" + "go.uber.org/fx" + + "github.com/DataDog/datadog-agent/comp/core" + workloadmeta "github.com/DataDog/datadog-agent/comp/core/workloadmeta/def" + workloadmetafxmock "github.com/DataDog/datadog-agent/comp/core/workloadmeta/fx-mock" + workloadmetamock "github.com/DataDog/datadog-agent/comp/core/workloadmeta/mock" + "github.com/DataDog/datadog-agent/pkg/util/fxutil" ) // DefaultGpuCores is the default number of cores for a GPU device in the mock. @@ -18,25 +29,33 @@ const DefaultGpuCores = 10 // GPUUUIDs is a list of UUIDs for the devices returned by the mock var GPUUUIDs = []string{ - "GPU-12345678-1234-1234-1234-123456789012", - "GPU-99999999-1234-1234-1234-123456789013", - "GPU-00000000-1234-1234-1234-123456789014", + "GPU-00000000-1234-1234-1234-123456789012", + "GPU-11111111-1234-1234-1234-123456789013", + "GPU-22222222-1234-1234-1234-123456789014", + "GPU-33333333-1234-1234-1234-123456789015", + "GPU-44444444-1234-1234-1234-123456789016", + "GPU-55555555-1234-1234-1234-123456789017", + "GPU-66666666-1234-1234-1234-123456789018", } +// GPUCores is a list of number of cores for the devices returned by the mock, +// should be the same length as GPUUUIDs. If not, GetBasicNvmlMock will panic. +var GPUCores = []int{DefaultGpuCores, 20, 30, 40, 50, 60, 70} + // DefaultGpuUUID is the UUID for the default device returned by the mock var DefaultGpuUUID = GPUUUIDs[0] // GetDeviceMock returns a mock of the nvml.Device with the given UUID. -func GetDeviceMock(uuid string) *nvmlmock.Device { +func GetDeviceMock(deviceIdx int) *nvmlmock.Device { return &nvmlmock.Device{ GetNumGpuCoresFunc: func() (int, nvml.Return) { - return DefaultGpuCores, nvml.SUCCESS + return GPUCores[deviceIdx], nvml.SUCCESS }, GetCudaComputeCapabilityFunc: func() (int, int, nvml.Return) { return 7, 5, nvml.SUCCESS }, GetUUIDFunc: func() (string, nvml.Return) { - return uuid, nvml.SUCCESS + return GPUUUIDs[deviceIdx], nvml.SUCCESS }, } } @@ -44,15 +63,66 @@ func GetDeviceMock(uuid string) *nvmlmock.Device { // GetBasicNvmlMock returns a mock of the nvml.Interface with a single device with 10 cores, // useful for basic tests that need only the basic interaction with NVML to be working. func GetBasicNvmlMock() *nvmlmock.Interface { + if len(GPUUUIDs) != len(GPUCores) { + // Make it really easy to spot errors if we change any of the arrays. + panic("GPUUUIDs and GPUCores must have the same length, please fix it") + } + return &nvmlmock.Interface{ DeviceGetCountFunc: func() (int, nvml.Return) { return len(GPUUUIDs), nvml.SUCCESS }, DeviceGetHandleByIndexFunc: func(index int) (nvml.Device, nvml.Return) { - return GetDeviceMock(GPUUUIDs[index]), nvml.SUCCESS + return GetDeviceMock(index), nvml.SUCCESS }, DeviceGetCudaComputeCapabilityFunc: func(nvml.Device) (int, int, nvml.Return) { return 7, 5, nvml.SUCCESS }, } } + +// GetWorkloadMetaMock returns a mock of the workloadmeta.Component. +func GetWorkloadMetaMock(t *testing.T) workloadmetamock.Mock { + return fxutil.Test[workloadmetamock.Mock](t, fx.Options( + core.MockBundle(), + workloadmetafxmock.MockModule(workloadmeta.NewParams()), + )) +} + +// RequireDevicesEqual checks that the two devices are equal by comparing their UUIDs, which gives a better +// output than using require.Equal on the devices themselves +func RequireDevicesEqual(t *testing.T, expected, actual nvml.Device, msgAndArgs ...interface{}) { + extraFmt := "" + if len(msgAndArgs) > 0 { + extraFmt = fmt.Sprintf(msgAndArgs[0].(string), msgAndArgs[1:]...) + ": " + } + + expectedUUID, ret := expected.GetUUID() + require.Equal(t, ret, nvml.SUCCESS, "%s%scannot retrieve UUID for expected device %v%s", extraFmt, expected) + + actualUUID, ret := actual.GetUUID() + require.Equal(t, ret, nvml.SUCCESS, "%scannot retrieve UUID for actual device %v%s", extraFmt, actual) + + require.Equal(t, expectedUUID, actualUUID, "%sUUIDs do not match", extraFmt) +} + +// RequireDeviceListsEqual checks that the two device lists are equal by comparing their UUIDs, which gives a better +// output than using require.ElementsMatch on the lists themselves +func RequireDeviceListsEqual(t *testing.T, expected, actual []nvml.Device, msgAndArgs ...interface{}) { + extraFmt := "" + if len(msgAndArgs) > 0 { + extraFmt = fmt.Sprintf(msgAndArgs[0].(string), msgAndArgs[1:]...) + ": " + } + + require.Len(t, actual, len(expected), "%sdevice lists have different lengths", extraFmt) + + for i := range expected { + expectedUUID, ret := expected[i].GetUUID() + require.Equal(t, ret, nvml.SUCCESS, "%scannot retrieve UUID for expected device index %d", extraFmt, i) + + actualUUID, ret := actual[i].GetUUID() + require.Equal(t, ret, nvml.SUCCESS, "%scannot retrieve UUID for actual device index %d", extraFmt, i) + + require.Equal(t, expectedUUID, actualUUID, "%sUUIDs do not match for element %d", extraFmt, i) + } +} diff --git a/pkg/internaltelemetry/client.go b/pkg/internaltelemetry/client.go index 4469ba0d0f060..ee7754fad190b 100644 --- a/pkg/internaltelemetry/client.go +++ b/pkg/internaltelemetry/client.go @@ -21,11 +21,9 @@ import ( "go.uber.org/atomic" - pb "github.com/DataDog/datadog-agent/pkg/proto/pbgo/trace" - "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 ( @@ -36,13 +34,19 @@ const ( // Client defines the interface for a telemetry client type Client interface { SendLog(level string, message string) - SendTraces(traces pb.Traces) + SendTraces(traces Traces) +} + +// Endpoint defines the endpoint object +type Endpoint struct { + APIKey string `json:"-"` + Host string } type client struct { m sync.Mutex client httpClient - endpoints []*config.Endpoint + endpoints []*Endpoint sendPayloadTimeout time.Duration // we can pre-calculate the host payload structure at init time @@ -94,7 +98,7 @@ type Application struct { // TracePayload defines the trace payload object type TracePayload struct { - Traces []pb.Trace `json:"traces"` + Traces []Trace `json:"traces"` } // LogPayload defines the log payload object @@ -115,7 +119,7 @@ type httpClient interface { } // NewClient creates a new telemetry client -func NewClient(httpClient httpClient, endpoints []*config.Endpoint, service string, debug bool) Client { +func NewClient(httpClient httpClient, endpoints []*Endpoint, service string, debug bool) Client { info, err := host.Info() if err != nil { log.Errorf("failed to retrieve host info: %v", err) @@ -158,7 +162,7 @@ func (c *client) SendLog(level, message string) { c.sendPayload(RequestTypeLogs, payload) } -func (c *client) SendTraces(traces pb.Traces) { +func (c *client) SendTraces(traces Traces) { c.m.Lock() defer c.m.Unlock() payload := TracePayload{ @@ -170,8 +174,8 @@ func (c *client) SendTraces(traces pb.Traces) { // sampleTraces is a simple uniform sampling function that samples traces based // on the sampling rate, given that there is no trace agent to sample the traces // We try to keep the tracer behaviour: the first rule that matches apply its rate to the whole trace -func (c *client) sampleTraces(traces pb.Traces) pb.Traces { - tracesWithSampling := pb.Traces{} +func (c *client) sampleTraces(traces Traces) Traces { + tracesWithSampling := Traces{} for _, trace := range traces { samplingRate := 1.0 for _, span := range trace { @@ -206,7 +210,7 @@ func (c *client) sendPayload(requestType RequestType, payload interface{}) { group := sync.WaitGroup{} for _, endpoint := range c.endpoints { group.Add(1) - go func(endpoint *config.Endpoint) { + go func(endpoint *Endpoint) { defer group.Done() url := fmt.Sprintf("%s%s", endpoint.Host, telemetryEndpoint) req, err := http.NewRequest("POST", url, bytes.NewReader(serializedPayload)) diff --git a/pkg/internaltelemetry/traces.go b/pkg/internaltelemetry/traces.go new file mode 100644 index 0000000000000..54c8545a604b7 --- /dev/null +++ b/pkg/internaltelemetry/traces.go @@ -0,0 +1,41 @@ +// 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 internaltelemetry full description in README.md +package internaltelemetry + +// Traces is a collection of traces +type Traces []Trace + +// Trace is a collection of spans with the same trace ID +type Trace []*Span + +// Span used for installation telemetry +type Span struct { + // Service is the name of the service that handled this span. + Service string `json:"service"` + // Name is the name of the operation this span represents. + Name string `json:"name"` + // Resource is the name of the resource this span represents. + Resource string `json:"resource"` + // TraceID is the ID of the trace to which this span belongs. + TraceID uint64 `json:"trace_id"` + // SpanID is the ID of this span. + SpanID uint64 `json:"span_id"` + // ParentID is the ID of the parent span. + ParentID uint64 `json:"parent_id"` + // Start is the start time of this span in nanoseconds since the Unix epoch. + Start int64 `json:"start"` + // Duration is the duration of this span in nanoseconds. + Duration int64 `json:"duration"` + // Error is the error status of this span. + Error int32 `json:"error"` + // Meta is a mapping from tag name to tag value for string-valued tags. + Meta map[string]string `json:"meta,omitempty"` + // Metrics is a mapping from metric name to metric value for numeric metrics. + Metrics map[string]float64 `json:"metrics,omitempty"` + // Type is the type of the span. + Type string `json:"type"` +} diff --git a/pkg/kubestatemetrics/builder/builder.go b/pkg/kubestatemetrics/builder/builder.go index d0c5ebd1ea998..ea26602567f56 100644 --- a/pkg/kubestatemetrics/builder/builder.go +++ b/pkg/kubestatemetrics/builder/builder.go @@ -9,6 +9,7 @@ package builder import ( "context" + "fmt" "reflect" "time" @@ -18,7 +19,11 @@ import ( v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + apiwatch "k8s.io/apimachinery/pkg/watch" clientset "k8s.io/client-go/kubernetes" + "k8s.io/client-go/metadata" + "k8s.io/client-go/rest" "k8s.io/client-go/tools/cache" ksmbuild "k8s.io/kube-state-metrics/v2/pkg/builder" ksmtypes "k8s.io/kube-state-metrics/v2/pkg/builder/types" @@ -196,6 +201,14 @@ func GenerateStores[T any]( isPod = true } else if u, ok := expectedType.(*unstructured.Unstructured); ok { isPod = u.GetAPIVersion() == "v1" && u.GetKind() == "Pod" + } else if _, ok := expectedType.(*corev1.ConfigMap); ok { + configMapStore, err := generateConfigMapStores(b, metricFamilies, useAPIServerCache) + if err != nil { + log.Debugf("Defaulting to kube-state-metrics for configmap collection: %v", err) + } else { + log.Debug("Using meta.k8s.io API for configmap collection") + return configMapStore + } } if b.namespaces.IsAllNamespaces() { @@ -340,3 +353,101 @@ func handlePodCollection[T any](b *Builder, store cache.Store, client T, listWat listWatcher := listWatchFunc(client, namespace, fieldSelector) b.startReflector(&corev1.Pod{}, store, listWatcher, useAPIServerCache) } + +func generateConfigMapStores( + b *Builder, + metricFamilies []generator.FamilyGenerator, + useAPIServerCache bool, +) ([]cache.Store, error) { + restConfig, err := rest.InClusterConfig() + if err != nil { + return nil, fmt.Errorf("failed to create in-cluster config for metadata client: %w", err) + } + + metadataClient, err := metadata.NewForConfig(restConfig) + if err != nil { + return nil, fmt.Errorf("failed to create metadata client: %w", err) + } + + gvr := schema.GroupVersionResource{ + Group: "", + Version: "v1", + Resource: "configmaps", + } + + filteredMetricFamilies := generator.FilterFamilyGenerators(b.allowDenyList, metricFamilies) + composedMetricGenFuncs := generator.ComposeMetricGenFuncs(filteredMetricFamilies) + + stores := make([]cache.Store, 0) + + if b.namespaces.IsAllNamespaces() { + log.Infof("Using NamespaceAll for ConfigMap collection.") + store := store.NewMetricsStore(composedMetricGenFuncs, "configmap") + listWatcher := createConfigMapListWatch(metadataClient, gvr, v1.NamespaceAll) + b.startReflector(&corev1.ConfigMap{}, store, listWatcher, useAPIServerCache) + return []cache.Store{store}, nil + } + + for _, ns := range b.namespaces { + store := store.NewMetricsStore(composedMetricGenFuncs, "configmap") + listWatcher := createConfigMapListWatch(metadataClient, gvr, ns) + b.startReflector(&corev1.ConfigMap{}, store, listWatcher, useAPIServerCache) + stores = append(stores, store) + } + + return stores, nil +} + +func createConfigMapListWatch(metadataClient metadata.Interface, gvr schema.GroupVersionResource, namespace string) *cache.ListWatch { + return &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + result, err := metadataClient.Resource(gvr).Namespace(namespace).List(context.TODO(), options) + if err != nil { + return nil, err + } + + configMapList := &corev1.ConfigMapList{} + for _, item := range result.Items { + configMapList.Items = append(configMapList.Items, corev1.ConfigMap{ + ObjectMeta: v1.ObjectMeta{ + Name: item.GetName(), + Namespace: item.GetNamespace(), + UID: item.GetUID(), + ResourceVersion: item.GetResourceVersion(), + }, + }) + } + + return configMapList, nil + }, + WatchFunc: func(options v1.ListOptions) (apiwatch.Interface, error) { + watcher, err := metadataClient.Resource(gvr).Namespace(namespace).Watch(context.TODO(), options) + if err != nil { + return nil, err + } + + return apiwatch.Filter(watcher, func(event apiwatch.Event) (apiwatch.Event, bool) { + if event.Object == nil { + return event, false + } + + partialObject, ok := event.Object.(*v1.PartialObjectMetadata) + if !ok { + return event, false + } + + configMap := &corev1.ConfigMap{ + ObjectMeta: v1.ObjectMeta{ + Name: partialObject.GetName(), + Namespace: partialObject.GetNamespace(), + UID: partialObject.GetUID(), + ResourceVersion: partialObject.GetResourceVersion(), + }, + } + + event.Object = configMap + return event, true + }), nil + }, + } +} diff --git a/pkg/linters/components/pkgconfigusage/go.mod b/pkg/linters/components/pkgconfigusage/go.mod index 20461858aabd2..9b24d1e11940e 100644 --- a/pkg/linters/components/pkgconfigusage/go.mod +++ b/pkg/linters/components/pkgconfigusage/go.mod @@ -5,7 +5,7 @@ go 1.23.0 require ( github.com/golangci/plugin-module-register v0.1.1 github.com/stretchr/testify v1.10.0 - golang.org/x/tools v0.27.0 + golang.org/x/tools v0.28.0 ) require ( @@ -14,7 +14,7 @@ require ( github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/rogpeppe/go-internal v1.13.1 // indirect golang.org/x/mod v0.22.0 // indirect - golang.org/x/sync v0.9.0 // indirect + golang.org/x/sync v0.10.0 // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/pkg/linters/components/pkgconfigusage/go.sum b/pkg/linters/components/pkgconfigusage/go.sum index 9f7ff6dacdfaf..11aca8345b971 100644 --- a/pkg/linters/components/pkgconfigusage/go.sum +++ b/pkg/linters/components/pkgconfigusage/go.sum @@ -22,10 +22,10 @@ github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOf github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= golang.org/x/mod v0.22.0 h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4= golang.org/x/mod v0.22.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= -golang.org/x/sync v0.9.0 h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ= -golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/tools v0.27.0 h1:qEKojBykQkQ4EynWy4S8Weg69NumxKdn40Fce3uc/8o= -golang.org/x/tools v0.27.0/go.mod h1:sUi0ZgbwW9ZPAq26Ekut+weQPR5eIM6GQLQ1Yjm1H0Q= +golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= +golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/tools v0.28.0 h1:WuB6qZ4RPCQo5aP3WdKZS7i595EdWqWR8vqJTlwTVK8= +golang.org/x/tools v0.28.0/go.mod h1:dcIOrVd3mfQKTgrDVQHqCPMWy6lnhfhtX3hLXYVLfRw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= diff --git a/pkg/logs/auditor/go.mod b/pkg/logs/auditor/go.mod index 9f000ce69c516..5cfe442db0138 100644 --- a/pkg/logs/auditor/go.mod +++ b/pkg/logs/auditor/go.mod @@ -47,7 +47,7 @@ require ( github.com/DataDog/datadog-agent/pkg/logs/message v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/logs/sources v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/status/health v0.56.0-rc.3 - github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 + github.com/DataDog/datadog-agent/pkg/util/log v0.59.1 github.com/stretchr/testify v1.10.0 ) @@ -66,30 +66,30 @@ require ( github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/optional v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/pointer v0.59.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.1 // indirect github.com/DataDog/datadog-agent/pkg/util/statstracker v0.56.0-rc.3 // indirect 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.0 // indirect - github.com/DataDog/datadog-agent/pkg/version v0.56.0-rc.3 // indirect - github.com/DataDog/viper v1.13.5 // 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.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 - github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 // indirect + github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb // indirect github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 // indirect - github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c // indirect + github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c // indirect github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect 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/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // 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 @@ -98,9 +98,9 @@ require ( github.com/tklauser/numcpus v0.8.0 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect go.uber.org/atomic v1.11.0 // indirect - golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f // indirect - golang.org/x/sys v0.27.0 // indirect - golang.org/x/text v0.20.0 // indirect + golang.org/x/exp v0.0.0-20241210194714-1829a127f884 // indirect + golang.org/x/sys v0.28.0 // indirect + golang.org/x/text v0.21.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/pkg/logs/auditor/go.sum b/pkg/logs/auditor/go.sum index b70b04e70aa56..e78672416b092 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= @@ -69,7 +71,6 @@ github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/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= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -84,8 +85,8 @@ github.com/grpc-ecosystem/grpc-gateway v1.13.0/go.mod h1:8XEsbTttt/W+VvjtQhLACqC github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/hcl v1.0.1-vault-5 h1:kI3hhbbyzr4dldA8UdTb7ZlVVlI2DACdCfz31RPDgJM= github.com/hashicorp/hcl v1.0.1-vault-5/go.mod h1:XYhtn6ijBSAj6n4YqAaf7RBPS4I06AItNorpy+MoQNM= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 h1:S4qyfL2sEm5Budr4KVMyEniCy+PbS55651I/a+Kn/NQ= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb h1:PGufWXXDq9yaev6xX1YQauaO1MV90e6Mpoq1I7Lz/VM= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= @@ -107,8 +108,8 @@ 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-20220913051719-115f729f3c8c h1:VtwQ41oftZwlMnOEbMWQtSEUgU64U4s+GHk7hZK+jtY= -github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c/go.mod h1:JKx41uQRwqlTZabZc+kILPrO/3jlKnQ2Z8b7YiVw5cE= +github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a h1:3Bm7EwfUQUvhNeKIkUct/gl9eod1TcXuj8stxvi/GoI= +github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a/go.mod h1:ilwx/Dta8jXAgpFYFvSWEMwxmbWXyiUHkd5FwyKhb5k= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= @@ -135,8 +136,8 @@ github.com/pkg/errors v0.8.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-20220216144756-c35f1ee13d7c h1:NRoLoZvkBTKvR5gQLgA3e0hqjkY9u1wm+iOL45VN/qI= -github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 h1:o4JXh1EVt9k/+g42oCprj/FisM4qX9L3sZB3upGN2ZU= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= @@ -167,12 +168,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= @@ -237,8 +234,8 @@ golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnf golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f h1:XdNn9LlyWAhLVp6P/i8QYBW+hlyhrhei9uErw2B5GJo= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f/go.mod h1:D5SMRVC3C2/4+F/DB1wZsLRnSNimn2Sp/NPsCrsv8ak= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884 h1:Y/Mj/94zIQQGHVSv1tTtQBDaQaJe62U9bkDZKKyhPCU= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -275,11 +272,11 @@ golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20220829200755-d48e67d00261/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.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/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= -golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= diff --git a/pkg/logs/client/go.mod b/pkg/logs/client/go.mod index 9f0ec05367e17..3ffd5bc7d11a3 100644 --- a/pkg/logs/client/go.mod +++ b/pkg/logs/client/go.mod @@ -60,10 +60,10 @@ require ( github.com/DataDog/datadog-agent/pkg/telemetry v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/util/backoff v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/util/http v0.56.0-rc.3 - github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 - github.com/DataDog/datadog-agent/pkg/version v0.56.0-rc.3 + github.com/DataDog/datadog-agent/pkg/util/log v0.59.1 + github.com/DataDog/datadog-agent/pkg/version v0.59.1 github.com/stretchr/testify v1.10.0 - golang.org/x/net v0.31.0 + golang.org/x/net v0.33.0 ) require ( @@ -84,39 +84,39 @@ require ( github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/optional v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/pointer v0.59.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.1 // indirect github.com/DataDog/datadog-agent/pkg/util/statstracker v0.56.0-rc.3 // indirect 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.0 // indirect - github.com/DataDog/viper v1.13.5 // indirect + github.com/DataDog/datadog-agent/pkg/util/winutil v0.59.1 // 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 - github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 // indirect + github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 // indirect github.com/klauspost/compress v1.17.11 // indirect - github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c // indirect + github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c // indirect github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect 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/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect github.com/prometheus/client_golang v1.20.5 // indirect 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 @@ -130,9 +130,9 @@ require ( go.uber.org/fx v1.23.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect - golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f // indirect - golang.org/x/sys v0.27.0 // indirect - golang.org/x/text v0.20.0 // indirect + golang.org/x/exp v0.0.0-20241210194714-1829a127f884 // indirect + golang.org/x/sys v0.28.0 // indirect + golang.org/x/text v0.21.0 // indirect google.golang.org/protobuf v1.35.2 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/pkg/logs/client/go.sum b/pkg/logs/client/go.sum index 9a3e2a6dae741..93266efb7e100 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= @@ -71,7 +73,6 @@ github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/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= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -86,8 +87,8 @@ github.com/grpc-ecosystem/grpc-gateway v1.13.0/go.mod h1:8XEsbTttt/W+VvjtQhLACqC github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/hcl v1.0.1-vault-5 h1:kI3hhbbyzr4dldA8UdTb7ZlVVlI2DACdCfz31RPDgJM= github.com/hashicorp/hcl v1.0.1-vault-5/go.mod h1:XYhtn6ijBSAj6n4YqAaf7RBPS4I06AItNorpy+MoQNM= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 h1:S4qyfL2sEm5Budr4KVMyEniCy+PbS55651I/a+Kn/NQ= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb h1:PGufWXXDq9yaev6xX1YQauaO1MV90e6Mpoq1I7Lz/VM= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= @@ -113,8 +114,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -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/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a h1:3Bm7EwfUQUvhNeKIkUct/gl9eod1TcXuj8stxvi/GoI= +github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a/go.mod h1:ilwx/Dta8jXAgpFYFvSWEMwxmbWXyiUHkd5FwyKhb5k= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= @@ -141,8 +142,8 @@ github.com/pkg/errors v0.8.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-20220216144756-c35f1ee13d7c h1:NRoLoZvkBTKvR5gQLgA3e0hqjkY9u1wm+iOL45VN/qI= -github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 h1:o4JXh1EVt9k/+g42oCprj/FisM4qX9L3sZB3upGN2ZU= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= @@ -174,12 +175,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= @@ -246,8 +243,8 @@ golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnf golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f h1:XdNn9LlyWAhLVp6P/i8QYBW+hlyhrhei9uErw2B5GJo= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f/go.mod h1:D5SMRVC3C2/4+F/DB1wZsLRnSNimn2Sp/NPsCrsv8ak= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884 h1:Y/Mj/94zIQQGHVSv1tTtQBDaQaJe62U9bkDZKKyhPCU= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -265,8 +262,8 @@ golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191002035440-2ec189313ef0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.31.0 h1:68CPQngjLL0r2AlUKiSxtQFKvzRVbnzLwMUn5SzcLHo= -golang.org/x/net v0.31.0/go.mod h1:P4fl1q7dY2hnZFxEk4pPSkDHF+QqjitcnDjUQyMM+pM= +golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= +golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -286,11 +283,11 @@ golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20220829200755-d48e67d00261/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.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/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= -golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= diff --git a/pkg/logs/client/http/destination.go b/pkg/logs/client/http/destination.go index 2a554e5476504..93bf35ec67167 100644 --- a/pkg/logs/client/http/destination.go +++ b/pkg/logs/client/http/destination.go @@ -396,6 +396,13 @@ func httpClientFactory(timeout time.Duration, cfg pkgconfigmodel.Reader) func() var transport *http.Transport transportConfig := cfg.Get("logs_config.http_protocol") + + // If any proxy is set, use http1 + // This will be removed in a future version + if cfg.GetProxies() != nil { + transportConfig = "http1" + } + // Configure transport based on user setting switch transportConfig { case "http1": diff --git a/pkg/logs/client/http/destination_test.go b/pkg/logs/client/http/destination_test.go index 92bf984a79e5a..3f65bba9b9e2c 100644 --- a/pkg/logs/client/http/destination_test.go +++ b/pkg/logs/client/http/destination_test.go @@ -494,3 +494,34 @@ func TestTransportProtocol_HTTP1FallBack(t *testing.T) { // Assert that the server automatically falls back to HTTP/1.1 assert.Equal(t, "HTTP/1.1", resp.Proto) } + +func TestTransportProtocol_HTTP1WhenUsingProxy(t *testing.T) { + c := configmock.New(t) + + // Force client to use ALNP + c.SetWithoutSource("logs_config.http_protocol", "auto") + c.SetWithoutSource("skip_ssl_validation", true) + + // The test server uses TLS, so if we set the http proxy (not https), it still makes + // a request to the test server, but disable HTTP/2 since a proxy is configured. + c.SetWithoutSource("proxy.http", "http://foo.bar") + + server := NewTestHTTPSServer(false) + defer server.Close() + + timeout := 5 * time.Second + client := httpClientFactory(timeout, c)() + + req, err := http.NewRequest("POST", server.URL, nil) + if err != nil { + t.Fatalf("Failed to create request: %v", err) + } + resp, err := client.Do(req) + if err != nil { + t.Fatalf("Failed to send request: %v", err) + } + defer resp.Body.Close() + + // Assert that the server chose HTTP/1.1 because a proxy was configured + assert.Equal(t, "HTTP/1.1", resp.Proto) +} diff --git a/pkg/logs/diagnostic/go.mod b/pkg/logs/diagnostic/go.mod index e5350d717dc74..1bf602bdb6ed7 100644 --- a/pkg/logs/diagnostic/go.mod +++ b/pkg/logs/diagnostic/go.mod @@ -67,34 +67,34 @@ require ( github.com/DataDog/datadog-agent/pkg/util/filesystem v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/fxutil v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.59.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/log v0.59.1 // indirect github.com/DataDog/datadog-agent/pkg/util/optional v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/pointer v0.59.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.1 // indirect github.com/DataDog/datadog-agent/pkg/util/statstracker v0.56.0-rc.3 // indirect 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.0 // indirect - github.com/DataDog/datadog-agent/pkg/version v0.56.0-rc.3 // indirect - github.com/DataDog/viper v1.13.5 // 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.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 - github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 // indirect + github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 // indirect - github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c // indirect + github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c // indirect github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect 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/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // 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 @@ -108,9 +108,9 @@ require ( go.uber.org/fx v1.23.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect - golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f // indirect - golang.org/x/sys v0.27.0 // indirect - golang.org/x/text v0.20.0 // indirect + golang.org/x/exp v0.0.0-20241210194714-1829a127f884 // indirect + golang.org/x/sys v0.28.0 // indirect + golang.org/x/text v0.21.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/pkg/logs/diagnostic/go.sum b/pkg/logs/diagnostic/go.sum index 324945ccfacf2..6ffaa516a7a51 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= @@ -70,7 +72,6 @@ github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/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= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -85,8 +86,8 @@ github.com/grpc-ecosystem/grpc-gateway v1.13.0/go.mod h1:8XEsbTttt/W+VvjtQhLACqC github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/hcl v1.0.1-vault-5 h1:kI3hhbbyzr4dldA8UdTb7ZlVVlI2DACdCfz31RPDgJM= github.com/hashicorp/hcl v1.0.1-vault-5/go.mod h1:XYhtn6ijBSAj6n4YqAaf7RBPS4I06AItNorpy+MoQNM= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 h1:S4qyfL2sEm5Budr4KVMyEniCy+PbS55651I/a+Kn/NQ= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb h1:PGufWXXDq9yaev6xX1YQauaO1MV90e6Mpoq1I7Lz/VM= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= @@ -108,8 +109,8 @@ 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-20220913051719-115f729f3c8c h1:VtwQ41oftZwlMnOEbMWQtSEUgU64U4s+GHk7hZK+jtY= -github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c/go.mod h1:JKx41uQRwqlTZabZc+kILPrO/3jlKnQ2Z8b7YiVw5cE= +github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a h1:3Bm7EwfUQUvhNeKIkUct/gl9eod1TcXuj8stxvi/GoI= +github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a/go.mod h1:ilwx/Dta8jXAgpFYFvSWEMwxmbWXyiUHkd5FwyKhb5k= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= @@ -136,8 +137,8 @@ github.com/pkg/errors v0.8.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-20220216144756-c35f1ee13d7c h1:NRoLoZvkBTKvR5gQLgA3e0hqjkY9u1wm+iOL45VN/qI= -github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 h1:o4JXh1EVt9k/+g42oCprj/FisM4qX9L3sZB3upGN2ZU= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= @@ -169,12 +170,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= @@ -241,8 +238,8 @@ golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnf golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f h1:XdNn9LlyWAhLVp6P/i8QYBW+hlyhrhei9uErw2B5GJo= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f/go.mod h1:D5SMRVC3C2/4+F/DB1wZsLRnSNimn2Sp/NPsCrsv8ak= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884 h1:Y/Mj/94zIQQGHVSv1tTtQBDaQaJe62U9bkDZKKyhPCU= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -279,11 +276,11 @@ golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20220829200755-d48e67d00261/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.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/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= -golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= diff --git a/pkg/logs/launchers/types.go b/pkg/logs/launchers/types.go index 8585db583c104..fcba401073eb4 100644 --- a/pkg/logs/launchers/types.go +++ b/pkg/logs/launchers/types.go @@ -13,7 +13,7 @@ import ( ) // Launcher implementations launch logs pipelines in response to sources, and -// mange those pipelines' lifetime. +// manage those pipelines' lifetime. // // Launchers are started when the logs-agent starts, or when they are added to // the agent, and stopped when it stops. diff --git a/pkg/logs/message/go.mod b/pkg/logs/message/go.mod index a7acc1d3319f8..a1f853b6f0e44 100644 --- a/pkg/logs/message/go.mod +++ b/pkg/logs/message/go.mod @@ -42,7 +42,7 @@ replace ( require ( github.com/DataDog/datadog-agent/comp/logs/agent/config v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/logs/sources v0.56.0-rc.3 - github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 + github.com/DataDog/datadog-agent/pkg/util/log v0.59.1 github.com/stretchr/testify v1.10.0 ) @@ -62,30 +62,30 @@ require ( github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/optional v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/pointer v0.59.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.1 // indirect github.com/DataDog/datadog-agent/pkg/util/statstracker v0.56.0-rc.3 // indirect 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.0 // indirect - github.com/DataDog/datadog-agent/pkg/version v0.56.0-rc.3 // indirect - github.com/DataDog/viper v1.13.5 // 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.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 - github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 // indirect + github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb // indirect github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 // indirect - github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c // indirect + github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c // indirect github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect 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/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // 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 @@ -94,9 +94,9 @@ require ( github.com/tklauser/numcpus v0.8.0 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect go.uber.org/atomic v1.11.0 // indirect - golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f // indirect - golang.org/x/sys v0.27.0 // indirect - golang.org/x/text v0.20.0 // indirect + golang.org/x/exp v0.0.0-20241210194714-1829a127f884 // indirect + golang.org/x/sys v0.28.0 // indirect + golang.org/x/text v0.21.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/pkg/logs/message/go.sum b/pkg/logs/message/go.sum index b70b04e70aa56..e78672416b092 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= @@ -69,7 +71,6 @@ github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/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= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -84,8 +85,8 @@ github.com/grpc-ecosystem/grpc-gateway v1.13.0/go.mod h1:8XEsbTttt/W+VvjtQhLACqC github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/hcl v1.0.1-vault-5 h1:kI3hhbbyzr4dldA8UdTb7ZlVVlI2DACdCfz31RPDgJM= github.com/hashicorp/hcl v1.0.1-vault-5/go.mod h1:XYhtn6ijBSAj6n4YqAaf7RBPS4I06AItNorpy+MoQNM= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 h1:S4qyfL2sEm5Budr4KVMyEniCy+PbS55651I/a+Kn/NQ= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb h1:PGufWXXDq9yaev6xX1YQauaO1MV90e6Mpoq1I7Lz/VM= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= @@ -107,8 +108,8 @@ 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-20220913051719-115f729f3c8c h1:VtwQ41oftZwlMnOEbMWQtSEUgU64U4s+GHk7hZK+jtY= -github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c/go.mod h1:JKx41uQRwqlTZabZc+kILPrO/3jlKnQ2Z8b7YiVw5cE= +github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a h1:3Bm7EwfUQUvhNeKIkUct/gl9eod1TcXuj8stxvi/GoI= +github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a/go.mod h1:ilwx/Dta8jXAgpFYFvSWEMwxmbWXyiUHkd5FwyKhb5k= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= @@ -135,8 +136,8 @@ github.com/pkg/errors v0.8.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-20220216144756-c35f1ee13d7c h1:NRoLoZvkBTKvR5gQLgA3e0hqjkY9u1wm+iOL45VN/qI= -github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 h1:o4JXh1EVt9k/+g42oCprj/FisM4qX9L3sZB3upGN2ZU= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= @@ -167,12 +168,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= @@ -237,8 +234,8 @@ golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnf golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f h1:XdNn9LlyWAhLVp6P/i8QYBW+hlyhrhei9uErw2B5GJo= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f/go.mod h1:D5SMRVC3C2/4+F/DB1wZsLRnSNimn2Sp/NPsCrsv8ak= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884 h1:Y/Mj/94zIQQGHVSv1tTtQBDaQaJe62U9bkDZKKyhPCU= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -275,11 +272,11 @@ golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20220829200755-d48e67d00261/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.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/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= -golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= diff --git a/pkg/logs/metrics/go.mod b/pkg/logs/metrics/go.mod index 3a272b272eee0..4bdfea3031f8c 100644 --- a/pkg/logs/metrics/go.mod +++ b/pkg/logs/metrics/go.mod @@ -40,7 +40,7 @@ require ( go.uber.org/fx v1.23.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect - golang.org/x/sys v0.27.0 // indirect + golang.org/x/sys v0.28.0 // indirect google.golang.org/protobuf v1.35.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/pkg/logs/metrics/go.sum b/pkg/logs/metrics/go.sum index cd355525b9620..2565635bc3e93 100644 --- a/pkg/logs/metrics/go.sum +++ b/pkg/logs/metrics/go.sum @@ -52,8 +52,8 @@ go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.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= google.golang.org/protobuf v1.35.2 h1:8Ar7bF+apOIoThw1EdZl0p1oWvMqTHmpA2fRTyZO8io= google.golang.org/protobuf v1.35.2/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/pkg/logs/pipeline/go.mod b/pkg/logs/pipeline/go.mod index aa3225348e8e9..648683ddc4ee4 100644 --- a/pkg/logs/pipeline/go.mod +++ b/pkg/logs/pipeline/go.mod @@ -71,7 +71,7 @@ require ( github.com/DataDog/datadog-agent/pkg/logs/sender v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/logs/status/statusinterface v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/status/health v0.56.0-rc.3 - github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 + github.com/DataDog/datadog-agent/pkg/util/log v0.59.1 github.com/DataDog/datadog-agent/pkg/util/startstop v0.56.0-rc.3 github.com/hashicorp/go-multierror v1.1.1 github.com/stretchr/testify v1.10.0 @@ -79,7 +79,7 @@ require ( ) require ( - github.com/DataDog/agent-payload/v5 v5.0.137 // indirect + github.com/DataDog/agent-payload/v5 v5.0.138 // indirect github.com/DataDog/datadog-agent/comp/core/secrets v0.59.0 // indirect github.com/DataDog/datadog-agent/comp/core/telemetry v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/comp/def v0.56.0-rc.3 // indirect @@ -100,43 +100,43 @@ require ( github.com/DataDog/datadog-agent/pkg/util/http v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/pkg/util/optional v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/pointer v0.59.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.1 // indirect github.com/DataDog/datadog-agent/pkg/util/statstracker v0.56.0-rc.3 // indirect 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.0 // indirect - github.com/DataDog/datadog-agent/pkg/version v0.56.0-rc.3 // 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/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 github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/hcl v1.0.1-vault-5 // indirect - github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 // indirect + github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 // indirect github.com/klauspost/compress v1.17.11 // indirect - github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c // indirect + github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c // indirect github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect 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/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect github.com/prometheus/client_golang v1.20.5 // indirect 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 @@ -149,10 +149,10 @@ require ( go.uber.org/fx v1.23.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect - golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f // indirect - golang.org/x/net v0.31.0 // indirect - golang.org/x/sys v0.27.0 // indirect - golang.org/x/text v0.20.0 // indirect + golang.org/x/exp v0.0.0-20241210194714-1829a127f884 // indirect + golang.org/x/net v0.33.0 // indirect + golang.org/x/sys v0.28.0 // indirect + golang.org/x/text v0.21.0 // indirect google.golang.org/protobuf v1.35.2 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/pkg/logs/pipeline/go.sum b/pkg/logs/pipeline/go.sum index 97219095a045b..c49694b4b2b0c 100644 --- a/pkg/logs/pipeline/go.sum +++ b/pkg/logs/pipeline/go.sum @@ -1,11 +1,11 @@ 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/agent-payload/v5 v5.0.137 h1:nV02RrYj6AwlQBGIEv6yG23CuxGtG0YWoFZAVE6vwxY= -github.com/DataDog/agent-payload/v5 v5.0.137/go.mod h1:lxh9lb5xYrBXjblpIWYUi4deJqVbkIfkjwesi5nskDc= +github.com/DataDog/agent-payload/v5 v5.0.138 h1:Wg7hmWuoLC/o0X3zZ+uGcfRHPyaytljudgSY9O59zjc= +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= @@ -77,7 +79,6 @@ github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/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= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -97,8 +98,8 @@ github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9 github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/hcl v1.0.1-vault-5 h1:kI3hhbbyzr4dldA8UdTb7ZlVVlI2DACdCfz31RPDgJM= github.com/hashicorp/hcl v1.0.1-vault-5/go.mod h1:XYhtn6ijBSAj6n4YqAaf7RBPS4I06AItNorpy+MoQNM= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 h1:S4qyfL2sEm5Budr4KVMyEniCy+PbS55651I/a+Kn/NQ= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb h1:PGufWXXDq9yaev6xX1YQauaO1MV90e6Mpoq1I7Lz/VM= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= @@ -125,8 +126,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -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/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a h1:3Bm7EwfUQUvhNeKIkUct/gl9eod1TcXuj8stxvi/GoI= +github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a/go.mod h1:ilwx/Dta8jXAgpFYFvSWEMwxmbWXyiUHkd5FwyKhb5k= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= @@ -153,8 +154,8 @@ github.com/pkg/errors v0.8.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-20220216144756-c35f1ee13d7c h1:NRoLoZvkBTKvR5gQLgA3e0hqjkY9u1wm+iOL45VN/qI= -github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 h1:o4JXh1EVt9k/+g42oCprj/FisM4qX9L3sZB3upGN2ZU= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= @@ -186,12 +187,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= @@ -262,8 +259,8 @@ golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f h1:XdNn9LlyWAhLVp6P/i8QYBW+hlyhrhei9uErw2B5GJo= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f/go.mod h1:D5SMRVC3C2/4+F/DB1wZsLRnSNimn2Sp/NPsCrsv8ak= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884 h1:Y/Mj/94zIQQGHVSv1tTtQBDaQaJe62U9bkDZKKyhPCU= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -284,8 +281,8 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20191002035440-2ec189313ef0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.31.0 h1:68CPQngjLL0r2AlUKiSxtQFKvzRVbnzLwMUn5SzcLHo= -golang.org/x/net v0.31.0/go.mod h1:P4fl1q7dY2hnZFxEk4pPSkDHF+QqjitcnDjUQyMM+pM= +golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= +golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -307,12 +304,12 @@ golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20220829200755-d48e67d00261/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.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/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= -golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= diff --git a/pkg/logs/pipeline/mock/mock.go b/pkg/logs/pipeline/mock/mock.go index 448ea1fb2416f..0dfaab71e6ec9 100644 --- a/pkg/logs/pipeline/mock/mock.go +++ b/pkg/logs/pipeline/mock/mock.go @@ -44,6 +44,10 @@ func (p *mockProvider) StopSDSProcessing() error { return nil } +func (p *mockProvider) GetOutputChan() chan *message.Message { + return nil +} + // Flush does nothing // //nolint:revive // TODO(AML) Fix revive linter diff --git a/pkg/logs/pipeline/processor_only_provider.go b/pkg/logs/pipeline/processor_only_provider.go new file mode 100644 index 0000000000000..906675e1360ff --- /dev/null +++ b/pkg/logs/pipeline/processor_only_provider.go @@ -0,0 +1,86 @@ +// 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 pipeline + +import ( + "context" + "strconv" + + "github.com/DataDog/datadog-agent/comp/core/hostname/hostnameinterface" + "github.com/DataDog/datadog-agent/comp/logs/agent/config" + pkgconfigmodel "github.com/DataDog/datadog-agent/pkg/config/model" + pkgconfigsetup "github.com/DataDog/datadog-agent/pkg/config/setup" + "github.com/DataDog/datadog-agent/pkg/logs/diagnostic" + "github.com/DataDog/datadog-agent/pkg/logs/message" + "github.com/DataDog/datadog-agent/pkg/logs/metrics" + "github.com/DataDog/datadog-agent/pkg/logs/processor" +) + +// processorOnlyProvider implements the Provider provider interface and only contains the processor +type processorOnlyProvider struct { + processor *processor.Processor + inputChan chan *message.Message + outputChan chan *message.Message + pipelineMonitor *metrics.TelemetryPipelineMonitor +} + +// NewProcessorOnlyProvider is used by the logs check subcommand as the feature does not require the functionalities of the log pipeline other then the processor. +func NewProcessorOnlyProvider(diagnosticMessageReceiver diagnostic.MessageReceiver, processingRules []*config.ProcessingRule, cfg pkgconfigmodel.Reader, hostname hostnameinterface.Component) Provider { + chanSize := pkgconfigsetup.Datadog().GetInt("logs_config.message_channel_size") + outputChan := make(chan *message.Message, chanSize) + encoder := processor.JSONEncoder + inputChan := make(chan *message.Message, chanSize) + pipelineID := 0 + pipelineMonitor := metrics.NewTelemetryPipelineMonitor(strconv.Itoa(pipelineID)) + processor := processor.New(cfg, inputChan, outputChan, processingRules, + encoder, diagnosticMessageReceiver, hostname, pipelineMonitor) + + p := &processorOnlyProvider{ + processor: processor, + inputChan: inputChan, + outputChan: outputChan, + pipelineMonitor: pipelineMonitor, + } + + return p +} + +func (p *processorOnlyProvider) Start() { + p.processor.Start() +} + +func (p *processorOnlyProvider) Stop() { + p.processor.Stop() +} + +func (p *processorOnlyProvider) ReconfigureSDSStandardRules(_ []byte) (bool, error) { + return false, nil +} + +func (p *processorOnlyProvider) ReconfigureSDSAgentConfig(_ []byte) (bool, error) { + return false, nil +} + +func (p *processorOnlyProvider) StopSDSProcessing() error { + return nil +} + +func (p *processorOnlyProvider) NextPipelineChan() chan *message.Message { + return p.inputChan +} + +func (p *processorOnlyProvider) NextPipelineChanWithMonitor() (chan *message.Message, metrics.PipelineMonitor) { + return p.inputChan, p.pipelineMonitor +} + +func (p *processorOnlyProvider) GetOutputChan() chan *message.Message { + return p.outputChan +} + +// Flush flushes synchronously all the contained pipeline of this provider. +func (p *processorOnlyProvider) Flush(ctx context.Context) { + p.processor.Flush(ctx) +} diff --git a/pkg/logs/pipeline/provider.go b/pkg/logs/pipeline/provider.go index 9ee6ec8a5dfa0..15561004e8379 100644 --- a/pkg/logs/pipeline/provider.go +++ b/pkg/logs/pipeline/provider.go @@ -33,6 +33,7 @@ type Provider interface { ReconfigureSDSAgentConfig(config []byte) (bool, error) StopSDSProcessing() error NextPipelineChan() chan *message.Message + GetOutputChan() chan *message.Message NextPipelineChanWithMonitor() (chan *message.Message, metrics.PipelineMonitor) // Flush flushes all pipeline contained in this Provider Flush(ctx context.Context) @@ -183,6 +184,10 @@ func (p *provider) NextPipelineChan() chan *message.Message { return nextPipeline.InputChan } +func (p *provider) GetOutputChan() chan *message.Message { + return nil +} + // NextPipelineChanWithMonitor returns the next pipeline input channel with it's monitor. func (p *provider) NextPipelineChanWithMonitor() (chan *message.Message, metrics.PipelineMonitor) { pipelinesLen := len(p.pipelines) diff --git a/pkg/logs/processor/go.mod b/pkg/logs/processor/go.mod index 42339476936cc..7ed5454c761a5 100644 --- a/pkg/logs/processor/go.mod +++ b/pkg/logs/processor/go.mod @@ -48,7 +48,7 @@ replace ( ) require ( - github.com/DataDog/agent-payload/v5 v5.0.137 + github.com/DataDog/agent-payload/v5 v5.0.138 github.com/DataDog/datadog-agent/comp/core/hostname/hostnameinterface v0.56.0-rc.3 github.com/DataDog/datadog-agent/comp/logs/agent/config v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/config/model v0.59.0 @@ -57,7 +57,7 @@ require ( github.com/DataDog/datadog-agent/pkg/logs/metrics v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/logs/sds v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/logs/sources v0.56.0-rc.3 - github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 + github.com/DataDog/datadog-agent/pkg/util/log v0.59.1 github.com/stretchr/testify v1.10.0 ) @@ -80,42 +80,42 @@ require ( github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/optional v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/pointer v0.59.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.1 // indirect github.com/DataDog/datadog-agent/pkg/util/statstracker v0.56.0-rc.3 // indirect 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.0 // indirect - github.com/DataDog/datadog-agent/pkg/version v0.56.0-rc.3 // 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/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 github.com/hashicorp/hcl v1.0.1-vault-5 // indirect - github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 // indirect + github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 // indirect github.com/klauspost/compress v1.17.11 // indirect - github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c // indirect + github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c // indirect github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect 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/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect github.com/prometheus/client_golang v1.20.5 // indirect 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 @@ -129,9 +129,9 @@ require ( go.uber.org/fx v1.23.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect - golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f // indirect - golang.org/x/sys v0.27.0 // indirect - golang.org/x/text v0.20.0 // indirect + golang.org/x/exp v0.0.0-20241210194714-1829a127f884 // indirect + golang.org/x/sys v0.28.0 // indirect + golang.org/x/text v0.21.0 // indirect google.golang.org/protobuf v1.35.2 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/pkg/logs/processor/go.sum b/pkg/logs/processor/go.sum index a85960b0566cf..0ce56a71d0273 100644 --- a/pkg/logs/processor/go.sum +++ b/pkg/logs/processor/go.sum @@ -1,11 +1,11 @@ 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/agent-payload/v5 v5.0.137 h1:nV02RrYj6AwlQBGIEv6yG23CuxGtG0YWoFZAVE6vwxY= -github.com/DataDog/agent-payload/v5 v5.0.137/go.mod h1:lxh9lb5xYrBXjblpIWYUi4deJqVbkIfkjwesi5nskDc= +github.com/DataDog/agent-payload/v5 v5.0.138 h1:Wg7hmWuoLC/o0X3zZ+uGcfRHPyaytljudgSY9O59zjc= +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= @@ -77,7 +79,6 @@ github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/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= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -92,8 +93,8 @@ github.com/grpc-ecosystem/grpc-gateway v1.13.0/go.mod h1:8XEsbTttt/W+VvjtQhLACqC github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/hcl v1.0.1-vault-5 h1:kI3hhbbyzr4dldA8UdTb7ZlVVlI2DACdCfz31RPDgJM= github.com/hashicorp/hcl v1.0.1-vault-5/go.mod h1:XYhtn6ijBSAj6n4YqAaf7RBPS4I06AItNorpy+MoQNM= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 h1:S4qyfL2sEm5Budr4KVMyEniCy+PbS55651I/a+Kn/NQ= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb h1:PGufWXXDq9yaev6xX1YQauaO1MV90e6Mpoq1I7Lz/VM= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= @@ -120,8 +121,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -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/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a h1:3Bm7EwfUQUvhNeKIkUct/gl9eod1TcXuj8stxvi/GoI= +github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a/go.mod h1:ilwx/Dta8jXAgpFYFvSWEMwxmbWXyiUHkd5FwyKhb5k= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= @@ -148,8 +149,8 @@ github.com/pkg/errors v0.8.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-20220216144756-c35f1ee13d7c h1:NRoLoZvkBTKvR5gQLgA3e0hqjkY9u1wm+iOL45VN/qI= -github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 h1:o4JXh1EVt9k/+g42oCprj/FisM4qX9L3sZB3upGN2ZU= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= @@ -181,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= @@ -257,8 +254,8 @@ golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f h1:XdNn9LlyWAhLVp6P/i8QYBW+hlyhrhei9uErw2B5GJo= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f/go.mod h1:D5SMRVC3C2/4+F/DB1wZsLRnSNimn2Sp/NPsCrsv8ak= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884 h1:Y/Mj/94zIQQGHVSv1tTtQBDaQaJe62U9bkDZKKyhPCU= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -300,12 +297,12 @@ golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20220829200755-d48e67d00261/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.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/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= -golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= diff --git a/pkg/logs/processor/json.go b/pkg/logs/processor/json.go index 59d9503d93bea..d19b3f8406c93 100644 --- a/pkg/logs/processor/json.go +++ b/pkg/logs/processor/json.go @@ -18,6 +18,9 @@ const nanoToMillis = 1000000 // JSONEncoder is a shared json encoder. var JSONEncoder Encoder = &jsonEncoder{} +// JSONPayload is a shared JSON representation of a message +var JSONPayload = jsonPayload{} + // jsonEncoder transforms a message into a JSON byte array. type jsonEncoder struct{} diff --git a/pkg/logs/sds/go.mod b/pkg/logs/sds/go.mod index b9c7c9706a849..746d2c939624c 100644 --- a/pkg/logs/sds/go.mod +++ b/pkg/logs/sds/go.mod @@ -52,7 +52,7 @@ require ( github.com/DataDog/datadog-agent/pkg/config/model v0.59.0 github.com/DataDog/datadog-agent/pkg/logs/message v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/telemetry v0.56.0-rc.3 - github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 + github.com/DataDog/datadog-agent/pkg/util/log v0.59.1 github.com/DataDog/dd-sensitive-data-scanner/sds-go/go v0.0.0-20240816154533-f7f9beb53a42 github.com/stretchr/testify v1.10.0 ) @@ -77,39 +77,39 @@ require ( github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/optional v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/pointer v0.59.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.1 // indirect github.com/DataDog/datadog-agent/pkg/util/statstracker v0.56.0-rc.3 // indirect 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.0 // indirect - github.com/DataDog/datadog-agent/pkg/version v0.56.0-rc.3 // indirect - github.com/DataDog/viper v1.13.5 // 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.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 - github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 // indirect + github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 // indirect github.com/klauspost/compress v1.17.11 // indirect - github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c // indirect + github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c // indirect github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect 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/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect github.com/prometheus/client_golang v1.20.5 // indirect 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 @@ -123,9 +123,9 @@ require ( go.uber.org/fx v1.23.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect - golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f // indirect - golang.org/x/sys v0.27.0 // indirect - golang.org/x/text v0.20.0 // indirect + golang.org/x/exp v0.0.0-20241210194714-1829a127f884 // indirect + golang.org/x/sys v0.28.0 // indirect + golang.org/x/text v0.21.0 // indirect google.golang.org/protobuf v1.35.2 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/pkg/logs/sds/go.sum b/pkg/logs/sds/go.sum index 2d08c2de231b8..c7d810e696690 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= @@ -71,7 +73,6 @@ github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/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= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -86,8 +87,8 @@ github.com/grpc-ecosystem/grpc-gateway v1.13.0/go.mod h1:8XEsbTttt/W+VvjtQhLACqC github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/hcl v1.0.1-vault-5 h1:kI3hhbbyzr4dldA8UdTb7ZlVVlI2DACdCfz31RPDgJM= github.com/hashicorp/hcl v1.0.1-vault-5/go.mod h1:XYhtn6ijBSAj6n4YqAaf7RBPS4I06AItNorpy+MoQNM= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 h1:S4qyfL2sEm5Budr4KVMyEniCy+PbS55651I/a+Kn/NQ= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb h1:PGufWXXDq9yaev6xX1YQauaO1MV90e6Mpoq1I7Lz/VM= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= @@ -113,8 +114,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -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/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a h1:3Bm7EwfUQUvhNeKIkUct/gl9eod1TcXuj8stxvi/GoI= +github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a/go.mod h1:ilwx/Dta8jXAgpFYFvSWEMwxmbWXyiUHkd5FwyKhb5k= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= @@ -141,8 +142,8 @@ github.com/pkg/errors v0.8.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-20220216144756-c35f1ee13d7c h1:NRoLoZvkBTKvR5gQLgA3e0hqjkY9u1wm+iOL45VN/qI= -github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 h1:o4JXh1EVt9k/+g42oCprj/FisM4qX9L3sZB3upGN2ZU= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= @@ -174,12 +175,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= @@ -246,8 +243,8 @@ golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnf golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f h1:XdNn9LlyWAhLVp6P/i8QYBW+hlyhrhei9uErw2B5GJo= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f/go.mod h1:D5SMRVC3C2/4+F/DB1wZsLRnSNimn2Sp/NPsCrsv8ak= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884 h1:Y/Mj/94zIQQGHVSv1tTtQBDaQaJe62U9bkDZKKyhPCU= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -284,11 +281,11 @@ golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20220829200755-d48e67d00261/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.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/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= -golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= diff --git a/pkg/logs/sender/go.mod b/pkg/logs/sender/go.mod index 085c081f2774e..9281b13a29774 100644 --- a/pkg/logs/sender/go.mod +++ b/pkg/logs/sender/go.mod @@ -59,7 +59,7 @@ require ( github.com/DataDog/datadog-agent/pkg/logs/sources v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/logs/status/statusinterface v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/telemetry v0.56.0-rc.3 - github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 + github.com/DataDog/datadog-agent/pkg/util/log v0.59.1 github.com/benbjohnson/clock v1.3.5 github.com/stretchr/testify v1.10.0 ) @@ -84,39 +84,39 @@ require ( github.com/DataDog/datadog-agent/pkg/util/http v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/pkg/util/optional v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/pointer v0.59.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.1 // indirect github.com/DataDog/datadog-agent/pkg/util/statstracker v0.56.0-rc.3 // indirect 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.0 // indirect - github.com/DataDog/datadog-agent/pkg/version v0.56.0-rc.3 // indirect - github.com/DataDog/viper v1.13.5 // 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.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 - github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 // indirect + github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 // indirect github.com/klauspost/compress v1.17.11 // indirect - github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c // indirect + github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c // indirect github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect 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/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect github.com/prometheus/client_golang v1.20.5 // indirect 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 @@ -130,10 +130,10 @@ require ( go.uber.org/fx v1.23.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect - golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f // indirect - golang.org/x/net v0.31.0 // indirect - golang.org/x/sys v0.27.0 // indirect - golang.org/x/text v0.20.0 // indirect + golang.org/x/exp v0.0.0-20241210194714-1829a127f884 // indirect + golang.org/x/net v0.33.0 // indirect + golang.org/x/sys v0.28.0 // indirect + golang.org/x/text v0.21.0 // indirect google.golang.org/protobuf v1.35.2 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/pkg/logs/sender/go.sum b/pkg/logs/sender/go.sum index 9a3e2a6dae741..93266efb7e100 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= @@ -71,7 +73,6 @@ github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/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= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -86,8 +87,8 @@ github.com/grpc-ecosystem/grpc-gateway v1.13.0/go.mod h1:8XEsbTttt/W+VvjtQhLACqC github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/hcl v1.0.1-vault-5 h1:kI3hhbbyzr4dldA8UdTb7ZlVVlI2DACdCfz31RPDgJM= github.com/hashicorp/hcl v1.0.1-vault-5/go.mod h1:XYhtn6ijBSAj6n4YqAaf7RBPS4I06AItNorpy+MoQNM= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 h1:S4qyfL2sEm5Budr4KVMyEniCy+PbS55651I/a+Kn/NQ= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb h1:PGufWXXDq9yaev6xX1YQauaO1MV90e6Mpoq1I7Lz/VM= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= @@ -113,8 +114,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -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/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a h1:3Bm7EwfUQUvhNeKIkUct/gl9eod1TcXuj8stxvi/GoI= +github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a/go.mod h1:ilwx/Dta8jXAgpFYFvSWEMwxmbWXyiUHkd5FwyKhb5k= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= @@ -141,8 +142,8 @@ github.com/pkg/errors v0.8.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-20220216144756-c35f1ee13d7c h1:NRoLoZvkBTKvR5gQLgA3e0hqjkY9u1wm+iOL45VN/qI= -github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 h1:o4JXh1EVt9k/+g42oCprj/FisM4qX9L3sZB3upGN2ZU= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= @@ -174,12 +175,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= @@ -246,8 +243,8 @@ golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnf golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f h1:XdNn9LlyWAhLVp6P/i8QYBW+hlyhrhei9uErw2B5GJo= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f/go.mod h1:D5SMRVC3C2/4+F/DB1wZsLRnSNimn2Sp/NPsCrsv8ak= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884 h1:Y/Mj/94zIQQGHVSv1tTtQBDaQaJe62U9bkDZKKyhPCU= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -265,8 +262,8 @@ golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191002035440-2ec189313ef0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.31.0 h1:68CPQngjLL0r2AlUKiSxtQFKvzRVbnzLwMUn5SzcLHo= -golang.org/x/net v0.31.0/go.mod h1:P4fl1q7dY2hnZFxEk4pPSkDHF+QqjitcnDjUQyMM+pM= +golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= +golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -286,11 +283,11 @@ golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20220829200755-d48e67d00261/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.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/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= -golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= diff --git a/pkg/logs/sources/config_source.go b/pkg/logs/sources/config_source.go new file mode 100644 index 0000000000000..649dd28fd689a --- /dev/null +++ b/pkg/logs/sources/config_source.go @@ -0,0 +1,46 @@ +// 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 sources + +// ConfigSources receives file paths to log configs and creates sources. The sources are added to a channel and read by the launcher. +// This class implements the SourceProvider interface +type ConfigSources struct { + addedByType map[string][]*LogSource +} + +// NewConfigSources provides an instance of ConfigSources. +func NewConfigSources() *ConfigSources { + return &ConfigSources{ + addedByType: make(map[string][]*LogSource), + } +} + +// AddSource adds source to the map of stored sources by type. +func (s *ConfigSources) AddSource(source *LogSource) { + s.addedByType[source.Config.Type] = append(s.addedByType[source.Config.Type], source) +} + +// SubscribeAll is required for the SourceProvider interface +func (s *ConfigSources) SubscribeAll() (added chan *LogSource, _ chan *LogSource) { + return +} + +// SubscribeForType returns a channel carrying LogSources for a given source type +func (s *ConfigSources) SubscribeForType(sourceType string) (added chan *LogSource, _ chan *LogSource) { + added = make(chan *LogSource) + go func() { + for _, logSource := range s.addedByType[sourceType] { + added <- logSource + } + }() + + return added, nil +} + +// GetAddedForType is required for the SourceProvider interface +func (s *ConfigSources) GetAddedForType(_ string) chan *LogSource { + return nil +} diff --git a/pkg/logs/sources/config_source_test.go b/pkg/logs/sources/config_source_test.go new file mode 100644 index 0000000000000..d66227cae62f5 --- /dev/null +++ b/pkg/logs/sources/config_source_test.go @@ -0,0 +1,82 @@ +// 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 sources + +import ( + "fmt" + "os" + "testing" + + "github.com/stretchr/testify/assert" + + logsConfig "github.com/DataDog/datadog-agent/comp/logs/agent/config" +) + +func CreateTestFile(tempDir string) *os.File { + // Ensure the directory exists + err := os.MkdirAll(tempDir, 0755) + if err != nil { + return nil + } + + // Specify the exact file name + filePath := fmt.Sprintf("%s/config.yaml", tempDir) + + // Create the file with the specified name + tempFile, err := os.Create(filePath) + if err != nil { + return nil + } + + // Write the content to the file + configContent := `logs: + - type: file + path: "/tmp/test.log" + service: "custom_logs" + source: "custom"` + + _, err = tempFile.Write([]byte(configContent)) + if err != nil { + tempFile.Close() // Close file before returning + return nil + } + + // Close the file after writing + tempFile.Close() + + // Reopen the file for returning if needed + file, err := os.Open(filePath) + if err != nil { + return nil + } + return file +} + +func TestSubscribeForTypeAndAddFileSource(t *testing.T) { + tempDir := "tmp/" + tempFile := CreateTestFile(tempDir) + defer os.RemoveAll(tempDir) + defer os.Remove(tempFile.Name()) + + wd, err := os.Getwd() + assert.NoError(t, err) + absolutePath := wd + "/" + tempFile.Name() + data, err := os.ReadFile(absolutePath) + assert.NoError(t, err) + logsConfig, err := logsConfig.ParseYAML(data) + assert.NoError(t, err) + configSource := NewConfigSources() + for _, cfg := range logsConfig { + source := NewLogSource("test-config-name", cfg) + configSource.AddSource(source) + } + + addedChan, _ := configSource.SubscribeForType("file") + added := <-addedChan + assert.NotNil(t, added) + assert.Equal(t, "file", added.Config.Type) + assert.Equal(t, "/tmp/test.log", added.Config.Path) +} diff --git a/pkg/logs/sources/go.mod b/pkg/logs/sources/go.mod index b81f5d609a906..8cdd4331e4cf3 100644 --- a/pkg/logs/sources/go.mod +++ b/pkg/logs/sources/go.mod @@ -41,7 +41,7 @@ replace ( require ( github.com/DataDog/datadog-agent/comp/logs/agent/config v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/logs/status/utils v0.56.0-rc.3 - github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 + github.com/DataDog/datadog-agent/pkg/util/log v0.59.1 github.com/DataDog/datadog-agent/pkg/util/statstracker v0.56.0-rc.3 github.com/stretchr/testify v1.10.0 ) @@ -61,29 +61,29 @@ require ( github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/optional v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/pointer v0.59.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.1 // indirect 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.0 // indirect - github.com/DataDog/datadog-agent/pkg/version v0.56.0-rc.3 // indirect - github.com/DataDog/viper v1.13.5 // 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.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 - github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 // indirect + github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb // indirect github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 // indirect - github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c // indirect + github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c // indirect github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect 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/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // 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 @@ -92,9 +92,9 @@ require ( github.com/tklauser/numcpus v0.8.0 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect go.uber.org/atomic v1.11.0 // indirect - golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f // indirect - golang.org/x/sys v0.27.0 // indirect - golang.org/x/text v0.20.0 // indirect + golang.org/x/exp v0.0.0-20241210194714-1829a127f884 // indirect + golang.org/x/sys v0.28.0 // indirect + golang.org/x/text v0.21.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/pkg/logs/sources/go.sum b/pkg/logs/sources/go.sum index b70b04e70aa56..e78672416b092 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= @@ -69,7 +71,6 @@ github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/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= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -84,8 +85,8 @@ github.com/grpc-ecosystem/grpc-gateway v1.13.0/go.mod h1:8XEsbTttt/W+VvjtQhLACqC github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/hcl v1.0.1-vault-5 h1:kI3hhbbyzr4dldA8UdTb7ZlVVlI2DACdCfz31RPDgJM= github.com/hashicorp/hcl v1.0.1-vault-5/go.mod h1:XYhtn6ijBSAj6n4YqAaf7RBPS4I06AItNorpy+MoQNM= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 h1:S4qyfL2sEm5Budr4KVMyEniCy+PbS55651I/a+Kn/NQ= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb h1:PGufWXXDq9yaev6xX1YQauaO1MV90e6Mpoq1I7Lz/VM= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= @@ -107,8 +108,8 @@ 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-20220913051719-115f729f3c8c h1:VtwQ41oftZwlMnOEbMWQtSEUgU64U4s+GHk7hZK+jtY= -github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c/go.mod h1:JKx41uQRwqlTZabZc+kILPrO/3jlKnQ2Z8b7YiVw5cE= +github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a h1:3Bm7EwfUQUvhNeKIkUct/gl9eod1TcXuj8stxvi/GoI= +github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a/go.mod h1:ilwx/Dta8jXAgpFYFvSWEMwxmbWXyiUHkd5FwyKhb5k= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= @@ -135,8 +136,8 @@ github.com/pkg/errors v0.8.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-20220216144756-c35f1ee13d7c h1:NRoLoZvkBTKvR5gQLgA3e0hqjkY9u1wm+iOL45VN/qI= -github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 h1:o4JXh1EVt9k/+g42oCprj/FisM4qX9L3sZB3upGN2ZU= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= @@ -167,12 +168,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= @@ -237,8 +234,8 @@ golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnf golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f h1:XdNn9LlyWAhLVp6P/i8QYBW+hlyhrhei9uErw2B5GJo= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f/go.mod h1:D5SMRVC3C2/4+F/DB1wZsLRnSNimn2Sp/NPsCrsv8ak= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884 h1:Y/Mj/94zIQQGHVSv1tTtQBDaQaJe62U9bkDZKKyhPCU= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -275,11 +272,11 @@ golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20220829200755-d48e67d00261/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.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/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= -golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= diff --git a/pkg/logs/tailers/windowsevent/tailer_test.go b/pkg/logs/tailers/windowsevent/tailer_test.go index 5c8c635314edb..8fb0c2311d49a 100644 --- a/pkg/logs/tailers/windowsevent/tailer_test.go +++ b/pkg/logs/tailers/windowsevent/tailer_test.go @@ -13,8 +13,6 @@ import ( "testing" "time" - "github.com/cihub/seelog" - pkglog "github.com/DataDog/datadog-agent/pkg/util/log" "github.com/cenkalti/backoff" @@ -61,7 +59,7 @@ func TestReadEventsSuite(t *testing.T) { func (s *ReadEventsSuite) SetupSuite() { // Enable logger if false { - pkglog.SetupLogger(seelog.Default, "debug") + pkglog.SetupLogger(pkglog.Default(), "debug") } s.ti = eventlog_test.GetAPITesterByName(s.testAPI, s.T()) diff --git a/pkg/logs/util/testutils/go.mod b/pkg/logs/util/testutils/go.mod index d7bbeef948cbb..98e75634adcf4 100644 --- a/pkg/logs/util/testutils/go.mod +++ b/pkg/logs/util/testutils/go.mod @@ -58,31 +58,31 @@ require ( github.com/DataDog/datadog-agent/pkg/util/executable v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/filesystem v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.59.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/log v0.59.1 // indirect github.com/DataDog/datadog-agent/pkg/util/optional v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/pointer v0.59.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.1 // indirect github.com/DataDog/datadog-agent/pkg/util/statstracker v0.56.0-rc.3 // indirect 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.0 // indirect - github.com/DataDog/datadog-agent/pkg/version v0.56.0-rc.3 // indirect - github.com/DataDog/viper v1.13.5 // 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.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 - github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 // indirect + github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb // indirect github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 // indirect - github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c // indirect + github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c // indirect 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/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // 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 @@ -91,8 +91,9 @@ require ( github.com/tklauser/numcpus v0.8.0 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect go.uber.org/atomic v1.11.0 // indirect - golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f // indirect - golang.org/x/sys v0.27.0 // indirect - golang.org/x/text v0.20.0 // indirect + golang.org/x/exp v0.0.0-20241210194714-1829a127f884 // indirect + golang.org/x/sys v0.28.0 // indirect + golang.org/x/text v0.21.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/pkg/logs/util/testutils/go.sum b/pkg/logs/util/testutils/go.sum index b70b04e70aa56..e78672416b092 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= @@ -69,7 +71,6 @@ github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/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= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -84,8 +85,8 @@ github.com/grpc-ecosystem/grpc-gateway v1.13.0/go.mod h1:8XEsbTttt/W+VvjtQhLACqC github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/hcl v1.0.1-vault-5 h1:kI3hhbbyzr4dldA8UdTb7ZlVVlI2DACdCfz31RPDgJM= github.com/hashicorp/hcl v1.0.1-vault-5/go.mod h1:XYhtn6ijBSAj6n4YqAaf7RBPS4I06AItNorpy+MoQNM= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 h1:S4qyfL2sEm5Budr4KVMyEniCy+PbS55651I/a+Kn/NQ= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb h1:PGufWXXDq9yaev6xX1YQauaO1MV90e6Mpoq1I7Lz/VM= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= @@ -107,8 +108,8 @@ 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-20220913051719-115f729f3c8c h1:VtwQ41oftZwlMnOEbMWQtSEUgU64U4s+GHk7hZK+jtY= -github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c/go.mod h1:JKx41uQRwqlTZabZc+kILPrO/3jlKnQ2Z8b7YiVw5cE= +github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a h1:3Bm7EwfUQUvhNeKIkUct/gl9eod1TcXuj8stxvi/GoI= +github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a/go.mod h1:ilwx/Dta8jXAgpFYFvSWEMwxmbWXyiUHkd5FwyKhb5k= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= @@ -135,8 +136,8 @@ github.com/pkg/errors v0.8.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-20220216144756-c35f1ee13d7c h1:NRoLoZvkBTKvR5gQLgA3e0hqjkY9u1wm+iOL45VN/qI= -github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 h1:o4JXh1EVt9k/+g42oCprj/FisM4qX9L3sZB3upGN2ZU= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= @@ -167,12 +168,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= @@ -237,8 +234,8 @@ golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnf golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f h1:XdNn9LlyWAhLVp6P/i8QYBW+hlyhrhei9uErw2B5GJo= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f/go.mod h1:D5SMRVC3C2/4+F/DB1wZsLRnSNimn2Sp/NPsCrsv8ak= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884 h1:Y/Mj/94zIQQGHVSv1tTtQBDaQaJe62U9bkDZKKyhPCU= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -275,11 +272,11 @@ golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20220829200755-d48e67d00261/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.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/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= -golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= diff --git a/pkg/metrics/go.mod b/pkg/metrics/go.mod index 2129bb8455c09..783e05bb34e3d 100644 --- a/pkg/metrics/go.mod +++ b/pkg/metrics/go.mod @@ -46,8 +46,8 @@ require ( github.com/DataDog/datadog-agent/pkg/tagset v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/telemetry v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/util/buf v0.56.0-rc.3 - github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 - github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.21.0 + github.com/DataDog/datadog-agent/pkg/util/log v0.59.1 + github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.22.0 github.com/stretchr/testify v1.10.0 go.uber.org/atomic v1.11.0 ) @@ -67,40 +67,41 @@ require ( github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/optional v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/pointer v0.59.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.1 // indirect github.com/DataDog/datadog-agent/pkg/util/sort v0.56.0-rc.3 // indirect 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.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/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 - github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 // indirect + github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 // indirect github.com/klauspost/compress v1.17.11 // indirect - github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c // indirect + github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c // indirect github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect 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/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect github.com/prometheus/client_golang v1.20.5 // indirect 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 @@ -114,10 +115,12 @@ require ( go.uber.org/fx v1.23.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect - golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f // indirect - golang.org/x/sys v0.27.0 // indirect - golang.org/x/text v0.20.0 // indirect + golang.org/x/exp v0.0.0-20241210194714-1829a127f884 // indirect + golang.org/x/sys v0.28.0 // indirect + golang.org/x/text v0.21.0 // indirect google.golang.org/protobuf v1.35.2 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) + +replace github.com/DataDog/datadog-agent/pkg/version => ../version diff --git a/pkg/metrics/go.sum b/pkg/metrics/go.sum index 9528a7ab7312d..8734f3756e46c 100644 --- a/pkg/metrics/go.sum +++ b/pkg/metrics/go.sum @@ -1,13 +1,13 @@ 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/opentelemetry-mapping-go/pkg/internal/sketchtest v0.21.0 h1:VS4NTqwczwezMVvI6A7xYR3ugPmMUJ4FcdFrsdnZI2I= -github.com/DataDog/opentelemetry-mapping-go/pkg/internal/sketchtest v0.21.0/go.mod h1:66XlN7QpQKqIvw8e2UbCXV5X8wGnEw851nT9BjJ75dY= -github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.21.0 h1:/Dp1WBvekdusS9Tw9pLE7RG04eluNktQ29arLS4SpGM= -github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.21.0/go.mod h1:asNuwNy1O2HbadkcZVuqmFGonfEzXS/SBvOo8V1MJvQ= +github.com/DataDog/opentelemetry-mapping-go/pkg/internal/sketchtest v0.22.0 h1:cXcKVEU1D0HlguR7GunnvuI70TghkarCa9DApqzMY94= +github.com/DataDog/opentelemetry-mapping-go/pkg/internal/sketchtest v0.22.0/go.mod h1:ES00EXfyEKgUkjd93tAXCxJA6i0seeOhZoS5Cj2qzzg= +github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.22.0 h1:63SzQz9Ab8XJj8fQKQz6UZNBhOm8rucwzbDfwTVF6dQ= +github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.22.0/go.mod h1:E/PY/aQ6S/N5hBPHXZRGmovs5b1BSi4RHGNcB4yP/Z0= 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= @@ -77,7 +79,6 @@ github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/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= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -94,8 +95,8 @@ github.com/grpc-ecosystem/grpc-gateway v1.13.0/go.mod h1:8XEsbTttt/W+VvjtQhLACqC github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/hcl v1.0.1-vault-5 h1:kI3hhbbyzr4dldA8UdTb7ZlVVlI2DACdCfz31RPDgJM= github.com/hashicorp/hcl v1.0.1-vault-5/go.mod h1:XYhtn6ijBSAj6n4YqAaf7RBPS4I06AItNorpy+MoQNM= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 h1:S4qyfL2sEm5Budr4KVMyEniCy+PbS55651I/a+Kn/NQ= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb h1:PGufWXXDq9yaev6xX1YQauaO1MV90e6Mpoq1I7Lz/VM= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= @@ -121,8 +122,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -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/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a h1:3Bm7EwfUQUvhNeKIkUct/gl9eod1TcXuj8stxvi/GoI= +github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a/go.mod h1:ilwx/Dta8jXAgpFYFvSWEMwxmbWXyiUHkd5FwyKhb5k= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= @@ -149,8 +150,8 @@ github.com/pkg/errors v0.8.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-20220216144756-c35f1ee13d7c h1:NRoLoZvkBTKvR5gQLgA3e0hqjkY9u1wm+iOL45VN/qI= -github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 h1:o4JXh1EVt9k/+g42oCprj/FisM4qX9L3sZB3upGN2ZU= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= @@ -182,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= @@ -256,8 +253,8 @@ golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnf golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f h1:XdNn9LlyWAhLVp6P/i8QYBW+hlyhrhei9uErw2B5GJo= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f/go.mod h1:D5SMRVC3C2/4+F/DB1wZsLRnSNimn2Sp/NPsCrsv8ak= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884 h1:Y/Mj/94zIQQGHVSv1tTtQBDaQaJe62U9bkDZKKyhPCU= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -294,11 +291,11 @@ golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20220829200755-d48e67d00261/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.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/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= -golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= diff --git a/pkg/metrics/metricsource.go b/pkg/metrics/metricsource.go index 4132329578862..5fcc0ff956952 100644 --- a/pkg/metrics/metricsource.go +++ b/pkg/metrics/metricsource.go @@ -37,7 +37,7 @@ const ( MetricSourceContainerd MetricSourceCri MetricSourceDocker - MetricSourceNtp + MetricSourceNTP MetricSourceSystemd MetricSourceHelm MetricSourceKubernetesAPIServer @@ -60,6 +60,8 @@ const ( MetricSourceDisk MetricSourceNetwork MetricSourceSnmp + MetricSourceCloudFoundry + MetricSourceJenkins // Python Checks MetricSourceZenohRouter @@ -135,6 +137,9 @@ const ( MetricSourceAwsPricing MetricSourceAqua MetricSourceKubernetesClusterAutoscaler + MetricSourceKubeVirtAPI + MetricSourceKubeVirtController + MetricSourceKubeVirtHandler MetricSourceTraefikMesh MetricSourceWeaviate MetricSourceTorchserve @@ -302,6 +307,8 @@ const ( MetricSourceAppgateSDP MetricSourceAnyscale MetricSourceMilvus + MetricSourceNvidiaNim + MetricSourceQuarkus ) // String returns a string representation of MetricSource @@ -349,7 +356,7 @@ func (ms MetricSource) String() string { return "cri" case MetricSourceDocker: return "docker" - case MetricSourceNtp: + case MetricSourceNTP: return "ntp" case MetricSourceSystemd: return "systemd" @@ -441,6 +448,8 @@ func (ms MetricSource) String() string { return "citrix_hypervisor" case MetricSourceClickhouse: return "clickhouse" + case MetricSourceCloudFoundry: + return "cloudfoundry" case MetricSourceCloudFoundryAPI: return "cloud_foundry_api" case MetricSourceCockroachdb: @@ -523,6 +532,8 @@ func (ms MetricSource) String() string { return "impala" case MetricSourceIstio: return "istio" + case MetricSourceJenkins: + return "jenkins" case MetricSourceKafkaConsumer: return "kafka_consumer" case MetricSourceKepler: @@ -705,6 +716,8 @@ func (ms MetricSource) String() string { return "karpenter" case MetricSourceNvidiaTriton: return "nvidia_triton" + case MetricSourceNvidiaNim: + return "nvidia_nim" case MetricSourceRay: return "ray" case MetricSourceStrimzi: @@ -867,6 +880,8 @@ func (ms MetricSource) String() string { return "aws_neuron" case MetricSourceMilvus: return "milvus" + case MetricSourceQuarkus: + return "quarkus" default: return "" } @@ -884,7 +899,7 @@ func CheckNameToMetricSource(name string) MetricSource { case "docker": return MetricSourceDocker case "ntp": - return MetricSourceNtp + return MetricSourceNTP case "systemd": return MetricSourceSystemd case "helm": @@ -1071,6 +1086,12 @@ func CheckNameToMetricSource(name string) MetricSource { return MetricSourceKubeProxy case "kube_scheduler": return MetricSourceKubeScheduler + case "kubevirt_api": + return MetricSourceKubeVirtAPI + case "kubevirt_controller": + return MetricSourceKubeVirtController + case "kubevirt_handler": + return MetricSourceKubeVirtHandler case "kubelet": return MetricSourceKubelet case "kubernetes_state": @@ -1233,6 +1254,8 @@ func CheckNameToMetricSource(name string) MetricSource { return MetricSourceKarpenter case "nvidia_triton": return MetricSourceNvidiaTriton + case "nvidia_nim": + return MetricSourceNvidiaNim case "ray": return MetricSourceRay case "strimzi": @@ -1401,6 +1424,8 @@ func CheckNameToMetricSource(name string) MetricSource { return MetricSourceTibcoEMS case "milvus": return MetricSourceMilvus + case "quarkus": + return MetricSourceQuarkus default: return MetricSourceUnknown } diff --git a/pkg/network/config/config.go b/pkg/network/config/config.go index c6d57230a4003..bf0e4ad498786 100644 --- a/pkg/network/config/config.go +++ b/pkg/network/config/config.go @@ -209,9 +209,12 @@ type Config struct { // default is true EnableConntrackAllNamespaces bool - // EnableEbpfConntracker enables the ebpf based network conntracker. Used only for testing at the moment + // EnableEbpfConntracker enables the ebpf based network conntracker EnableEbpfConntracker bool + // EnableCiliumLBConntracker enables the cilium load balancer conntracker + EnableCiliumLBConntracker bool + // ClosedChannelSize specifies the size for closed channel for the tracer ClosedChannelSize int @@ -360,6 +363,7 @@ func New() *Config { IgnoreConntrackInitFailure: cfg.GetBool(sysconfig.FullKeyPath(netNS, "ignore_conntrack_init_failure")), ConntrackInitTimeout: cfg.GetDuration(sysconfig.FullKeyPath(netNS, "conntrack_init_timeout")), EnableEbpfConntracker: cfg.GetBool(sysconfig.FullKeyPath(netNS, "enable_ebpf_conntracker")), + EnableCiliumLBConntracker: cfg.GetBool(sysconfig.FullKeyPath(netNS, "enable_cilium_lb_conntracker")), EnableGatewayLookup: cfg.GetBool(sysconfig.FullKeyPath(netNS, "enable_gateway_lookup")), @@ -414,8 +418,8 @@ func New() *Config { log.Info("network tracer DNS inspection disabled by configuration") } - if c.EnableProcessEventMonitoring { - log.Info("network process event monitoring enabled") + if !c.EnableProcessEventMonitoring { + log.Info("network process event monitoring disabled") } return c } diff --git a/pkg/network/dns/ebpf.go b/pkg/network/dns/ebpf.go index 8401cd5bd78a7..2536e9bb1ebd9 100644 --- a/pkg/network/dns/ebpf.go +++ b/pkg/network/dns/ebpf.go @@ -8,10 +8,7 @@ package dns import ( - "math" - manager "github.com/DataDog/ebpf-manager" - "golang.org/x/sys/unix" ddebpf "github.com/DataDog/datadog-agent/pkg/ebpf" "github.com/DataDog/datadog-agent/pkg/ebpf/bytecode" @@ -68,10 +65,7 @@ func (e *ebpfProgram) Init() error { kprobeAttachMethod = manager.AttachKprobeWithKprobeEvents } err := e.InitWithOptions(e.bytecode, manager.Options{ - RLimit: &unix.Rlimit{ - Cur: math.MaxUint64, - Max: math.MaxUint64, - }, + RemoveRlimit: true, ActivatedProbes: []manager.ProbesSelector{ &manager.ProbeSelector{ ProbeIdentificationPair: manager.ProbeIdentificationPair{ diff --git a/pkg/network/dns/snooper_test.go b/pkg/network/dns/snooper_test.go index 3a0d334c80488..a6c1383a9ddcc 100644 --- a/pkg/network/dns/snooper_test.go +++ b/pkg/network/dns/snooper_test.go @@ -230,7 +230,7 @@ func TestDNSFailedResponseCount(t *testing.T) { "nonexistenent.net.com", "missingdomain.com", } - queryIP, queryPort, reps, _ := testdns.SendDNSQueries(t, domains, testdns.GetServerIP(t), "tcp") + queryIP, queryPort, reps, _ := testdns.SendDNSQueries(domains, testdns.GetServerIP(t), "tcp") for _, rep := range reps { require.NotNil(t, rep) require.Equal(t, rep.Rcode, mdns.RcodeNameError) // All the queries should have failed @@ -281,7 +281,7 @@ func TestDNSOverNonPort53(t *testing.T) { shutdown, port := newTestServer(t, localhost, "udp") defer shutdown() - queryIP, queryPort, reps, err := testdns.SendDNSQueriesOnPort(t, domains, net.ParseIP(localhost), strconv.Itoa(int(port)), "udp") + queryIP, queryPort, reps, err := testdns.SendDNSQueriesOnPort(domains, net.ParseIP(localhost), strconv.Itoa(int(port)), "udp") require.NoError(t, err) require.NotNil(t, reps[0]) @@ -334,7 +334,7 @@ func TestDNSOverUDPTimeoutCount(t *testing.T) { invalidServerIP := "8.8.8.90" domainQueried := "agafsdfsdasdfsd" - queryIP, queryPort, reps, err := testdns.SendDNSQueries(t, []string{domainQueried}, net.ParseIP(invalidServerIP), "udp") + queryIP, queryPort, reps, err := testdns.SendDNSQueries([]string{domainQueried}, net.ParseIP(invalidServerIP), "udp") require.ErrorIs(t, err, os.ErrDeadlineExceeded, "error should be i/o timeout") require.Len(t, reps, 1) require.Nil(t, reps[0]) @@ -358,7 +358,7 @@ func TestDNSOverUDPTimeoutCountWithoutDomain(t *testing.T) { invalidServerIP := "8.8.8.90" domainQueried := "agafsdfsdasdfsd" - queryIP, queryPort, reps, err := testdns.SendDNSQueries(t, []string{domainQueried}, net.ParseIP(invalidServerIP), "udp") + queryIP, queryPort, reps, err := testdns.SendDNSQueries([]string{domainQueried}, net.ParseIP(invalidServerIP), "udp") require.ErrorIs(t, err, os.ErrDeadlineExceeded, "error should be i/o timeout") require.Len(t, reps, 1) require.Nil(t, reps[0]) diff --git a/pkg/network/ebpf/c/co-re/tracer-fentry.c b/pkg/network/ebpf/c/co-re/tracer-fentry.c index 09259e948047d..b89ab7e351d35 100644 --- a/pkg/network/ebpf/c/co-re/tracer-fentry.c +++ b/pkg/network/ebpf/c/co-re/tracer-fentry.c @@ -8,6 +8,7 @@ #include "ipv6.h" #include "sock.h" #include "skb.h" +#include "pid_tgid.h" #include "tracer/tracer.h" #include "tracer/events.h" @@ -52,7 +53,7 @@ static __always_inline bool event_in_task(char *prog_name) { } static __always_inline int read_conn_tuple_partial_from_flowi4(conn_tuple_t *t, struct flowi4 *fl4, u64 pid_tgid, metadata_mask_t type) { - t->pid = pid_tgid >> 32; + t->pid = GET_USER_MODE_PID(pid_tgid); t->metadata = type; if (t->saddr_l == 0) { @@ -85,7 +86,7 @@ static __always_inline int read_conn_tuple_partial_from_flowi4(conn_tuple_t *t, } static __always_inline int read_conn_tuple_partial_from_flowi6(conn_tuple_t *t, struct flowi6 *fl6, u64 pid_tgid, metadata_mask_t type) { - t->pid = pid_tgid >> 32; + t->pid = GET_USER_MODE_PID(pid_tgid); t->metadata = type; struct in6_addr addr = BPF_CORE_READ(fl6, saddr); @@ -233,7 +234,7 @@ int BPF_PROG(tcp_close, struct sock *sk, long timeout) { u64 pid_tgid = bpf_get_current_pid_tgid(); // Get network namespace id - log_debug("fentry/tcp_close: tgid: %llu, pid: %llu", pid_tgid >> 32, pid_tgid & 0xFFFFFFFF); + log_debug("fentry/tcp_close: kernel thread id: %llu, user mode pid: %llu", GET_KERNEL_THREAD_ID(pid_tgid), GET_USER_MODE_PID(pid_tgid)); if (!read_conn_tuple(&t, sk, pid_tgid, CONN_TYPE_TCP)) { return 0; } @@ -410,14 +411,14 @@ SEC("fentry/tcp_retransmit_skb") int BPF_PROG(tcp_retransmit_skb, struct sock *sk, struct sk_buff *skb, int segs, int err) { RETURN_IF_NOT_IN_SYSPROBE_TASK("fentry/tcp_retransmit_skb"); log_debug("fexntry/tcp_retransmit"); - u64 tid = bpf_get_current_pid_tgid(); + u64 pid_tgid = bpf_get_current_pid_tgid(); tcp_retransmit_skb_args_t args = {}; args.retrans_out_pre = BPF_CORE_READ(tcp_sk(sk), retrans_out); if (args.retrans_out_pre < 0) { return 0; } - bpf_map_update_with_telemetry(pending_tcp_retransmit_skb, &tid, &args, BPF_ANY); + bpf_map_update_with_telemetry(pending_tcp_retransmit_skb, &pid_tgid, &args, BPF_ANY); return 0; } @@ -426,18 +427,18 @@ SEC("fexit/tcp_retransmit_skb") int BPF_PROG(tcp_retransmit_skb_exit, struct sock *sk, struct sk_buff *skb, int segs, int err) { RETURN_IF_NOT_IN_SYSPROBE_TASK("fexit/tcp_retransmit_skb"); log_debug("fexit/tcp_retransmit"); - u64 tid = bpf_get_current_pid_tgid(); + u64 pid_tgid = bpf_get_current_pid_tgid(); if (err < 0) { - bpf_map_delete_elem(&pending_tcp_retransmit_skb, &tid); + bpf_map_delete_elem(&pending_tcp_retransmit_skb, &pid_tgid); return 0; } - tcp_retransmit_skb_args_t *args = bpf_map_lookup_elem(&pending_tcp_retransmit_skb, &tid); + tcp_retransmit_skb_args_t *args = bpf_map_lookup_elem(&pending_tcp_retransmit_skb, &pid_tgid); if (args == NULL) { return 0; } u32 retrans_out_pre = args->retrans_out_pre; u32 retrans_out = BPF_CORE_READ(tcp_sk(sk), retrans_out); - bpf_map_delete_elem(&pending_tcp_retransmit_skb, &tid); + bpf_map_delete_elem(&pending_tcp_retransmit_skb, &pid_tgid); if (retrans_out < 0) { return 0; @@ -450,7 +451,7 @@ SEC("fentry/tcp_connect") int BPF_PROG(tcp_connect, struct sock *sk) { RETURN_IF_NOT_IN_SYSPROBE_TASK("fentry/tcp_connect"); u64 pid_tgid = bpf_get_current_pid_tgid(); - log_debug("fentry/tcp_connect: tgid: %llu, pid: %llu", pid_tgid >> 32, pid_tgid & 0xFFFFFFFF); + log_debug("fentry/tcp_connect: kernel thread id: %llu, user mode pid: %llu", GET_KERNEL_THREAD_ID(pid_tgid), GET_USER_MODE_PID(pid_tgid)); conn_tuple_t t = {}; if (!read_conn_tuple(&t, sk, 0, CONN_TYPE_TCP)) { @@ -479,8 +480,8 @@ int BPF_PROG(tcp_finish_connect, struct sock *sk, struct sk_buff *skb, int rc) { return 0; } u64 pid_tgid = pid_tgid_p->pid_tgid; - t.pid = pid_tgid >> 32; - log_debug("fentry/tcp_finish_connect: tgid: %llu, pid: %llu", pid_tgid >> 32, pid_tgid & 0xFFFFFFFF); + t.pid = GET_USER_MODE_PID(pid_tgid); + log_debug("fentry/tcp_finish_connect: kernel thread id: %llu, user mode pid: %llu", GET_KERNEL_THREAD_ID(pid_tgid), GET_USER_MODE_PID(pid_tgid)); handle_tcp_stats(&t, sk, TCP_ESTABLISHED); handle_message(&t, 0, 0, CONN_DIRECTION_OUTGOING, 0, 0, PACKET_COUNT_NONE, sk); @@ -498,7 +499,7 @@ int BPF_PROG(inet_csk_accept_exit, struct sock *_sk, int flags, int *err, bool k } u64 pid_tgid = bpf_get_current_pid_tgid(); - log_debug("fexit/inet_csk_accept: tgid: %llu, pid: %llu", pid_tgid >> 32, pid_tgid & 0xFFFFFFFF); + log_debug("fexit/inet_csk_accept: kernel thread id: %llu, user mode pid: %llu", GET_KERNEL_THREAD_ID(pid_tgid), GET_USER_MODE_PID(pid_tgid)); conn_tuple_t t = {}; if (!read_conn_tuple(&t, sk, pid_tgid, CONN_TYPE_TCP)) { diff --git a/pkg/network/ebpf/c/pid_tgid.h b/pkg/network/ebpf/c/pid_tgid.h new file mode 100644 index 0000000000000..a3439bca233a7 --- /dev/null +++ b/pkg/network/ebpf/c/pid_tgid.h @@ -0,0 +1,52 @@ +#ifndef __PID_TGID_H +#define __PID_TGID_H + +/* + * The following documentation is based on https://stackoverflow.com/a/9306150 + * Note on Process and Thread Identifiers: + * + * What users refer to as a "PID" is not quite the same as what the kernel sees. + * + * In the kernel: + * - Each thread has its own ID, called a PID (though it might be better termed a TID, or Thread ID). + * - Threads within the same process share a TGID (Thread Group ID), which is the PID of the first thread + * created when the process was initialized. + * + * When a process is created: + * - It starts as a single thread where the PID and TGID are the same. + * + * When a new thread is created: + * - It receives its own unique PID for independent scheduling by the kernel. + * - It inherits the TGID from the original (parent) thread, tying it to the same process. + * + * This separation allows the kernel to schedule threads independently while maintaining the process view + * (TGID) when reporting information to users. + * + * Example Hierarchy of Threads: + * + * USER VIEW + * vvvvvvvv + * + * | + * <-- PID 43 -->|<----------------- PID 42 -----------------> + * | | + * | +---------+ | + * | | process | | + * | _| pid=42 |_ | + * __(fork) _/ | tgid=42 | \_ (new thread) _ + * / | +---------+ | \ + * +---------+ | | +---------+ + * | process | | | | process | + * | pid=43 | | | | pid=44 | + * | tgid=43 | | | | tgid=42 | + * +---------+ | | +---------+ + * | | + * <-- PID 43 -->|<--------- PID 42 -------->|<--- PID 44 ---> + * | | + * ^^^^^^^^ + * KERNEL VIEW + */ +#define GET_USER_MODE_PID(x) ((x) >> 32) +#define GET_KERNEL_THREAD_ID(x) ((x) & 0xFFFFFFFF) + +#endif // __PID_TGID_H diff --git a/pkg/network/ebpf/c/prebuilt/conntrack.c b/pkg/network/ebpf/c/prebuilt/conntrack.c index 8e77c1fd98ff8..8417806ce3077 100644 --- a/pkg/network/ebpf/c/prebuilt/conntrack.c +++ b/pkg/network/ebpf/c/prebuilt/conntrack.c @@ -12,6 +12,7 @@ #include "conntrack/maps.h" #include "ip.h" #include "ipv6.h" +#include "pid_tgid.h" SEC("kprobe/__nf_conntrack_hash_insert") int BPF_BYPASSABLE_KPROBE(kprobe___nf_conntrack_hash_insert, struct nf_conn *ct) { @@ -32,7 +33,7 @@ int BPF_BYPASSABLE_KPROBE(kprobe___nf_conntrack_hash_insert, struct nf_conn *ct) SEC("kprobe/ctnetlink_fill_info") int BPF_BYPASSABLE_KPROBE(kprobe_ctnetlink_fill_info) { - u32 pid = bpf_get_current_pid_tgid() >> 32; + u32 pid = GET_USER_MODE_PID(bpf_get_current_pid_tgid()); if (pid != systemprobe_pid()) { log_debug("skipping kprobe/ctnetlink_fill_info invocation from non-system-probe process"); return 0; diff --git a/pkg/network/ebpf/c/prebuilt/offset-guess.c b/pkg/network/ebpf/c/prebuilt/offset-guess.c index cc32fee223935..556a770082684 100644 --- a/pkg/network/ebpf/c/prebuilt/offset-guess.c +++ b/pkg/network/ebpf/c/prebuilt/offset-guess.c @@ -298,11 +298,11 @@ int kprobe__sock_common_getsockopt(struct pt_regs* ctx) { SEC("kprobe/tcp_v6_connect") int kprobe__tcp_v6_connect(struct pt_regs* ctx) { struct sock* sk; - u64 pid = bpf_get_current_pid_tgid(); + u64 pid_tgid = bpf_get_current_pid_tgid(); sk = (struct sock*)PT_REGS_PARM1(ctx); - bpf_map_update_elem(&connectsock_ipv6, &pid, &sk, BPF_ANY); + bpf_map_update_elem(&connectsock_ipv6, &pid_tgid, &sk, BPF_ANY); return 0; } @@ -310,17 +310,17 @@ int kprobe__tcp_v6_connect(struct pt_regs* ctx) { // Used for offset guessing (see: pkg/ebpf/offsetguess.go) SEC("kretprobe/tcp_v6_connect") int kretprobe__tcp_v6_connect(struct pt_regs* __attribute__((unused)) ctx) { - u64 pid = bpf_get_current_pid_tgid(); + u64 pid_tgid = bpf_get_current_pid_tgid(); u64 zero = 0; struct sock** skpp; tracer_status_t* status; - skpp = bpf_map_lookup_elem(&connectsock_ipv6, &pid); + skpp = bpf_map_lookup_elem(&connectsock_ipv6, &pid_tgid); if (skpp == 0) { return 0; // missed entry } struct sock* skp = *skpp; - bpf_map_delete_elem(&connectsock_ipv6, &pid); + bpf_map_delete_elem(&connectsock_ipv6, &pid_tgid); status = bpf_map_lookup_elem(&tracer_status, &zero); if (status == NULL || is_sk_buff_event(status->what)) { diff --git a/pkg/network/ebpf/c/prebuilt/usm.c b/pkg/network/ebpf/c/prebuilt/usm.c index 8b5e62ede108e..99217fa2bcfc9 100644 --- a/pkg/network/ebpf/c/prebuilt/usm.c +++ b/pkg/network/ebpf/c/prebuilt/usm.c @@ -7,6 +7,7 @@ #include "offsets.h" #include "protocols/classification/dispatcher-helpers.h" +#include "protocols/flush.h" #include "protocols/http/buffer.h" #include "protocols/http/http.h" #include "protocols/http2/decoding.h" @@ -48,19 +49,4 @@ int BPF_BYPASSABLE_KPROBE(kprobe__tcp_sendmsg, struct sock *sk) { return 0; } -SEC("tracepoint/net/netif_receive_skb") -int tracepoint__net__netif_receive_skb(void *ctx) { - CHECK_BPF_PROGRAM_BYPASSED() - log_debug("tracepoint/net/netif_receive_skb"); - // flush batch to userspace - // because perf events can't be sent from socket filter programs - http_batch_flush(ctx); - http2_batch_flush(ctx); - terminated_http2_batch_flush(ctx); - kafka_batch_flush(ctx); - postgres_batch_flush(ctx); - redis_batch_flush(ctx); - return 0; -} - char _license[] SEC("license") = "GPL"; diff --git a/pkg/network/ebpf/c/prebuilt/usm_events_test.c b/pkg/network/ebpf/c/prebuilt/usm_events_test.c index 820afb50ef0f0..f2bfb640aa54a 100644 --- a/pkg/network/ebpf/c/prebuilt/usm_events_test.c +++ b/pkg/network/ebpf/c/prebuilt/usm_events_test.c @@ -9,6 +9,7 @@ #include "defs.h" #include "map-defs.h" #include "protocols/events.h" +#include "pid_tgid.h" // -------------------------------------------------------- // this is a test program for pkg/networks/protocols/events @@ -37,7 +38,7 @@ struct syscalls_enter_write_args { SEC("tracepoint/syscalls/sys_enter_write") int tracepoint__syscalls__sys_enter_write(struct syscalls_enter_write_args *ctx) { __u32 zero = 0; - __u32 pid = bpf_get_current_pid_tgid() >> 32; + __u32 pid = GET_USER_MODE_PID(bpf_get_current_pid_tgid()); test_ctx_t *test_ctx = bpf_map_lookup_elem(&test, &zero); if (!test_ctx || test_ctx->expected_fd != ctx->fd || test_ctx->expected_pid != pid) return 0; diff --git a/pkg/network/ebpf/c/protocols/classification/defs.h b/pkg/network/ebpf/c/protocols/classification/defs.h index 46dbfd8e7df51..235d638d2f5b5 100644 --- a/pkg/network/ebpf/c/protocols/classification/defs.h +++ b/pkg/network/ebpf/c/protocols/classification/defs.h @@ -76,7 +76,7 @@ typedef enum { // Each `protocol_t` entry is implicitly associated to a single // `protocol_layer_t` value (see notes above). // -//In order to determine which `protocol_layer_t` a `protocol_t` belongs to, +// In order to determine which `protocol_layer_t` a `protocol_t` belongs to, // users can call `get_protocol_layer` typedef enum { LAYER_UNKNOWN, @@ -103,7 +103,7 @@ typedef struct { // `protocol_stack_t` is embedded in the `conn_stats_t` type, which is used // across the whole NPM kernel code. If we added the 64-bit timestamp field // directly to `protocol_stack_t`, we would go from 4 bytes to 12 bytes, which -// bloats the eBPF stack size of some NPM probes. Using the wrapper type +// bloats the eBPF stack size of some NPM probes. Using the wrapper type // prevents that, because we pretty much only store the wrapper type in the // connection_protocol map, but elsewhere in the code we're still using // protocol_stack_t, so this is change is "transparent" to most of the code. @@ -123,6 +123,8 @@ typedef enum { CLASSIFICATION_GRPC_PROG, __PROG_ENCRYPTION, // Encryption classification programs go here + CLASSIFICATION_TLS_CLIENT_PROG, + CLASSIFICATION_TLS_SERVER_PROG, CLASSIFICATION_PROG_MAX, } classification_prog_t; diff --git a/pkg/network/ebpf/c/protocols/classification/protocol-classification.h b/pkg/network/ebpf/c/protocols/classification/protocol-classification.h index e3f44bfa16bdc..865288731ac7f 100644 --- a/pkg/network/ebpf/c/protocols/classification/protocol-classification.h +++ b/pkg/network/ebpf/c/protocols/classification/protocol-classification.h @@ -160,15 +160,26 @@ __maybe_unused static __always_inline void protocol_classifier_entrypoint(struct protocol_t app_layer_proto = get_protocol_from_stack(protocol_stack, LAYER_APPLICATION); - if ((app_layer_proto == PROTOCOL_UNKNOWN || app_layer_proto == PROTOCOL_POSTGRES) && is_tls(buffer, usm_ctx->buffer.size, skb_info.data_end)) { + tls_record_header_t tls_hdr = {0}; + + if ((app_layer_proto == PROTOCOL_UNKNOWN || app_layer_proto == PROTOCOL_POSTGRES) && is_tls(skb, skb_info.data_off, skb_info.data_end, &tls_hdr)) { protocol_stack = get_or_create_protocol_stack(&usm_ctx->tuple); if (!protocol_stack) { return; } // TLS classification - update_protocol_information(usm_ctx, protocol_stack, PROTOCOL_TLS); - // The connection is TLS encrypted, thus we cannot classify the protocol - // using the socket filter and therefore we can bail out; + if (tls_hdr.content_type != TLS_HANDSHAKE) { + // We can't classify TLS encrypted traffic further, so return early + update_protocol_information(usm_ctx, protocol_stack, PROTOCOL_TLS); + return; + } + + // Parse TLS handshake payload + tls_info_t *tags = get_or_create_tls_enhanced_tags(&usm_ctx->tuple); + if (tags) { + // The packet is a TLS handshake, so trigger tail calls to extract metadata from the payload + goto next_program; + } return; } @@ -200,6 +211,58 @@ __maybe_unused static __always_inline void protocol_classifier_entrypoint(struct classification_next_program(skb, usm_ctx); } +__maybe_unused static __always_inline void protocol_classifier_entrypoint_tls_handshake_client(struct __sk_buff *skb) { + usm_context_t *usm_ctx = usm_context(skb); + if (!usm_ctx) { + return; + } + tls_info_t* tls_info = get_tls_enhanced_tags(&usm_ctx->tuple); + if (!tls_info) { + goto next_program; + } + __u32 offset = usm_ctx->skb_info.data_off + sizeof(tls_record_header_t); + __u32 data_end = usm_ctx->skb_info.data_end; + if (!is_tls_handshake_client_hello(skb, offset, usm_ctx->skb_info.data_end)) { + goto next_program; + } + if (!parse_client_hello(skb, offset, data_end, tls_info)) { + return; + } + +next_program: + classification_next_program(skb, usm_ctx); +} + +__maybe_unused static __always_inline void protocol_classifier_entrypoint_tls_handshake_server(struct __sk_buff *skb) { + usm_context_t *usm_ctx = usm_context(skb); + if (!usm_ctx) { + return; + } + tls_info_t* tls_info = get_tls_enhanced_tags(&usm_ctx->tuple); + if (!tls_info) { + goto next_program; + } + __u32 offset = usm_ctx->skb_info.data_off + sizeof(tls_record_header_t); + __u32 data_end = usm_ctx->skb_info.data_end; + if (!is_tls_handshake_server_hello(skb, offset, data_end)) { + goto next_program; + } + if (!parse_server_hello(skb, offset, data_end, tls_info)) { + return; + } + + protocol_stack_t *protocol_stack = get_protocol_stack_if_exists(&usm_ctx->tuple); + if (!protocol_stack) { + return; + } + update_protocol_information(usm_ctx, protocol_stack, PROTOCOL_TLS); + // We can't classify TLS encrypted traffic further, so return early + return; + +next_program: + classification_next_program(skb, usm_ctx); +} + __maybe_unused static __always_inline void protocol_classifier_entrypoint_queues(struct __sk_buff *skb) { usm_context_t *usm_ctx = usm_context(skb); if (!usm_ctx) { diff --git a/pkg/network/ebpf/c/protocols/classification/routing-helpers.h b/pkg/network/ebpf/c/protocols/classification/routing-helpers.h index 9e2ba628851c6..d7565977eb36d 100644 --- a/pkg/network/ebpf/c/protocols/classification/routing-helpers.h +++ b/pkg/network/ebpf/c/protocols/classification/routing-helpers.h @@ -18,29 +18,7 @@ static __always_inline bool has_available_program(classification_prog_t current_ return true; } -#pragma clang diagnostic push -// The following check is ignored because *currently* there are no API or -// Encryption classification programs registerd. -// Therefore the enum containing all BPF programs looks like the following: -// -// typedef enum { -// CLASSIFICATION_PROG_UNKNOWN = 0, -// __PROG_APPLICATION, -// APPLICATION_PROG_A -// APPLICATION_PROG_B -// APPLICATION_PROG_C -// ... -// __PROG_API, -// // No programs here -// __PROG_ENCRYPTION, -// // No programs here -// CLASSIFICATION_PROG_MAX, -// } classification_prog_t; -// -// Which means that the following conditionals will always evaluate to false: -// a) current_program > __PROG_API && current_program < __PROG_ENCRYPTION -// b) current_program > __PROG_ENCRYPTION && current_program < CLASSIFICATION_PROG_MAX -#pragma clang diagnostic ignored "-Wtautological-overlap-compare" +// get_current_program_layer returns the layer bit of the current program static __always_inline u16 get_current_program_layer(classification_prog_t current_program) { if (current_program > __PROG_APPLICATION && current_program < __PROG_API) { return LAYER_APPLICATION_BIT; @@ -56,20 +34,19 @@ static __always_inline u16 get_current_program_layer(classification_prog_t curre return 0; } -#pragma clang diagnostic pop static __always_inline classification_prog_t next_layer_entrypoint(usm_context_t *usm_ctx) { u16 to_skip = usm_ctx->routing_skip_layers; + if (!(to_skip&LAYER_ENCRYPTION_BIT)) { + return __PROG_ENCRYPTION+1; + } if (!(to_skip&LAYER_APPLICATION_BIT)) { return __PROG_APPLICATION+1; } if (!(to_skip&LAYER_API_BIT)) { return __PROG_API+1; } - if (!(to_skip&LAYER_ENCRYPTION_BIT)) { - return __PROG_ENCRYPTION+1; - } return CLASSIFICATION_PROG_UNKNOWN; } diff --git a/pkg/network/ebpf/c/protocols/flush.h b/pkg/network/ebpf/c/protocols/flush.h new file mode 100644 index 0000000000000..dc13d6ec9b698 --- /dev/null +++ b/pkg/network/ebpf/c/protocols/flush.h @@ -0,0 +1,39 @@ +#ifndef __USM_FLUSH_H +#define __USM_FLUSH_H + +#include "bpf_bypass.h" + +#include "protocols/http/http.h" +#include "protocols/http2/decoding.h" +#include "protocols/kafka/kafka-parsing.h" +#include "protocols/postgres/decoding.h" +#include "protocols/redis/decoding.h" + +// flush all batched events to userspace for all protocols. +// because perf events can't be sent from socket filter programs. +static __always_inline void flush(void *ctx) { + http_batch_flush(ctx); + http2_batch_flush(ctx); + terminated_http2_batch_flush(ctx); + kafka_batch_flush(ctx); + postgres_batch_flush(ctx); + redis_batch_flush(ctx); +} + +SEC("tracepoint/net/netif_receive_skb") +int tracepoint__net__netif_receive_skb(void *ctx) { + CHECK_BPF_PROGRAM_BYPASSED() + log_debug("tracepoint/net/netif_receive_skb"); + flush(ctx); + return 0; +} + +SEC("raw_tracepoint/net/netif_receive_skb") +int BPF_PROG(raw_tracepoint__net__netif_receive_skb) { + CHECK_BPF_PROGRAM_BYPASSED() + log_debug("raw_tracepoint/net/netif_receive_skb"); + flush(ctx); + return 0; +} + +#endif diff --git a/pkg/network/ebpf/c/protocols/helpers/big_endian.h b/pkg/network/ebpf/c/protocols/helpers/big_endian.h index 0b9d6ff14c022..b0867ce719d7b 100644 --- a/pkg/network/ebpf/c/protocols/helpers/big_endian.h +++ b/pkg/network/ebpf/c/protocols/helpers/big_endian.h @@ -16,7 +16,7 @@ } \ type val; \ bpf_memset(&val, 0, sizeof(type)); \ - bpf_skb_load_bytes_with_telemetry(skb, offset, &val, sizeof(type)); \ + bpf_skb_load_bytes(skb, offset, &val, sizeof(type)); \ *out = transformer(val); \ return true; \ } diff --git a/pkg/network/ebpf/c/protocols/http2/decoding-defs.h b/pkg/network/ebpf/c/protocols/http2/decoding-defs.h index ed795398d5e81..5b55f8e0d216f 100644 --- a/pkg/network/ebpf/c/protocols/http2/decoding-defs.h +++ b/pkg/network/ebpf/c/protocols/http2/decoding-defs.h @@ -216,7 +216,7 @@ typedef struct { __u32 remainder; __u32 header_length; char buf[HTTP2_FRAME_HEADER_SIZE]; -} frame_header_remainder_t; +} incomplete_frame_t; // http2_telemetry_t is used to hold the HTTP/2 kernel telemetry. // request_seen Count of HTTP/2 requests seen diff --git a/pkg/network/ebpf/c/protocols/http2/decoding-tls.h b/pkg/network/ebpf/c/protocols/http2/decoding-tls.h index 2ff6c3a677722..78f179ddd3f28 100644 --- a/pkg/network/ebpf/c/protocols/http2/decoding-tls.h +++ b/pkg/network/ebpf/c/protocols/http2/decoding-tls.h @@ -151,13 +151,13 @@ int uprobe__http2_tls_termination(struct pt_regs *ctx) { terminated_http2_batch_enqueue(&args->tup); // Deleting the entry for the original tuple. - bpf_map_delete_elem(&http2_remainder, &args->tup); + bpf_map_delete_elem(&http2_incomplete_frames, &args->tup); bpf_map_delete_elem(&http2_dynamic_counter_table, &args->tup); // In case of local host, the protocol will be deleted for both (client->server) and (server->client), // so we won't reach for that path again in the code, so we're deleting the opposite side as well. flip_tuple(&args->tup); bpf_map_delete_elem(&http2_dynamic_counter_table, &args->tup); - bpf_map_delete_elem(&http2_remainder, &args->tup); + bpf_map_delete_elem(&http2_incomplete_frames, &args->tup); return 0; } diff --git a/pkg/network/ebpf/c/protocols/http2/decoding.h b/pkg/network/ebpf/c/protocols/http2/decoding.h index d214b46a1b503..2582951c20ea5 100644 --- a/pkg/network/ebpf/c/protocols/http2/decoding.h +++ b/pkg/network/ebpf/c/protocols/http2/decoding.h @@ -401,12 +401,12 @@ static __always_inline void pktbuf_process_headers(pktbuf_t pkt, dynamic_table_i } // The function is trying to read the remaining of a split frame header. We have the first part in -// `frame_state->buf` (from the previous packet), and now we're trying to read the remaining (`frame_state->remainder` +// `incomplete_frame->buf` (from the previous packet), and now we're trying to read the remaining (`incomplete_frame->remainder` // bytes from the current packet). -static __always_inline void pktbuf_fix_header_frame(pktbuf_t pkt, char *out, frame_header_remainder_t *frame_state) { - bpf_memcpy(out, frame_state->buf, HTTP2_FRAME_HEADER_SIZE); +static __always_inline void pktbuf_fix_header_frame(pktbuf_t pkt, char *out, incomplete_frame_t *incomplete_frame) { + bpf_memcpy(out, incomplete_frame->buf, HTTP2_FRAME_HEADER_SIZE); // Verifier is unhappy with a single call to `bpf_skb_load_bytes` with a variable length (although checking boundaries) - switch (frame_state->remainder) { + switch (incomplete_frame->remainder) { case 1: pktbuf_load_bytes_from_current_offset(pkt, out + HTTP2_FRAME_HEADER_SIZE - 1, 1); break; @@ -435,23 +435,36 @@ static __always_inline void pktbuf_fix_header_frame(pktbuf_t pkt, char *out, fra return; } -static __always_inline bool pktbuf_get_first_frame(pktbuf_t pkt, frame_header_remainder_t *frame_state, http2_frame_t *current_frame, http2_telemetry_t *http2_tel) { - // Attempting to read the initial frame in the packet, or handling a state where there is no remainder and finishing reading the current frame. - if (frame_state == NULL) { - // Checking we have enough bytes in the packet to read a frame header. - if (pktbuf_data_offset(pkt) + HTTP2_FRAME_HEADER_SIZE > pktbuf_data_end(pkt)) { - // Not enough bytes, cannot read frame, so we have 0 interesting frames in that packet. - return false; - } +// Reads a frame from the packet, and reports if it's a valid frame. +static __always_inline bool read_frame(pktbuf_t pkt, http2_frame_t *current_frame) { + // Checking we have enough bytes in the packet to read a frame header. + if (pktbuf_data_offset(pkt) + HTTP2_FRAME_HEADER_SIZE > pktbuf_data_end(pkt)) { + // Not enough bytes, cannot read frame, so we have 0 interesting frames in that packet. + return false; + } - // Reading frame, and ensuring the frame is valid. - pktbuf_load_bytes_from_current_offset(pkt, (char *)current_frame, HTTP2_FRAME_HEADER_SIZE); - pktbuf_advance(pkt, HTTP2_FRAME_HEADER_SIZE); - if (!format_http2_frame_header(current_frame)) { - // Frame is not valid, so we have 0 interesting frames in that packet. - return false; - } - return true; + // Reading frame, and ensuring the frame is valid. + pktbuf_load_bytes_from_current_offset(pkt, (char *)current_frame, HTTP2_FRAME_HEADER_SIZE); + pktbuf_advance(pkt, HTTP2_FRAME_HEADER_SIZE); + return format_http2_frame_header(current_frame); +} + +// Fixes an incomplete frame header. The function is trying to read the remaining of a split frame header. +static __always_inline bool fix_incomplete_frame_header(pktbuf_t pkt, incomplete_frame_t *incomplete_frame, http2_frame_t *current_frame) { + pktbuf_fix_header_frame(pkt, (char*)current_frame, incomplete_frame); + bool res = false; + if (format_http2_frame_header(current_frame)) { + pktbuf_advance(pkt, incomplete_frame->remainder); + res = true; + } + incomplete_frame->remainder = 0; + return res; +} + +static __always_inline bool pktbuf_get_first_frame(pktbuf_t pkt, incomplete_frame_t *incomplete_frame, http2_frame_t *current_frame) { + // Attempting to read the initial frame in the packet, or handling a state where there is no remainder and finishing reading the current frame. + if (incomplete_frame == NULL) { + return read_frame(pkt, current_frame); } // Getting here means we have a frame state from the previous packets. @@ -467,38 +480,30 @@ static __always_inline bool pktbuf_get_first_frame(pktbuf_t pkt, frame_header_re // Frame-header-remainder. - if (frame_state->header_length == HTTP2_FRAME_HEADER_SIZE) { + if (incomplete_frame->header_length == HTTP2_FRAME_HEADER_SIZE) { // A case where we read an interesting valid frame header in the previous call, and now we're trying to read the // rest of the frame payload. But, since we already read a valid frame, we just fill it as an interesting frame, // and continue to the next tail call. // Copy the cached frame header to the current frame. - bpf_memcpy((char *)current_frame, frame_state->buf, HTTP2_FRAME_HEADER_SIZE); - frame_state->remainder = 0; + bpf_memcpy((char *)current_frame, incomplete_frame->buf, HTTP2_FRAME_HEADER_SIZE); + incomplete_frame->remainder = 0; return true; } - if (frame_state->header_length > 0) { - pktbuf_fix_header_frame(pkt, (char*)current_frame, frame_state); - if (format_http2_frame_header(current_frame)) { - pktbuf_advance(pkt, frame_state->remainder); - frame_state->remainder = 0; - return true; - } - frame_state->remainder = 0; - // We couldn't read frame header using the remainder. - return false; + if (incomplete_frame->header_length > 0) { + return fix_incomplete_frame_header(pkt, incomplete_frame, current_frame); } // We failed to read a frame, if we have a remainder trying to consume it and read the following frame. - if (frame_state->remainder > 0) { + if (incomplete_frame->remainder > 0) { // To make a "best effort," if we are in a state where we are left with a remainder, and the length of it from // our current position is larger than the data end, we will attempt to handle the remaining buffer as much as possible. - if (pktbuf_data_offset(pkt) + frame_state->remainder > pktbuf_data_end(pkt)) { - frame_state->remainder -= pktbuf_data_end(pkt) - pktbuf_data_offset(pkt); + if (pktbuf_data_offset(pkt) + incomplete_frame->remainder > pktbuf_data_end(pkt)) { + incomplete_frame->remainder -= pktbuf_data_end(pkt) - pktbuf_data_offset(pkt); pktbuf_set_offset(pkt, pktbuf_data_end(pkt)); return false; } - pktbuf_advance(pkt, frame_state->remainder); - frame_state->remainder = 0; + pktbuf_advance(pkt, incomplete_frame->remainder); + incomplete_frame->remainder = 0; // The remainders "ends" the current packet. No interesting frames were found. if (pktbuf_data_offset(pkt) == pktbuf_data_end(pkt)) { return false; @@ -620,31 +625,25 @@ static __always_inline void handle_first_frame(pktbuf_t pkt, __u32 *external_dat return; } - frame_header_remainder_t *frame_state = bpf_map_lookup_elem(&http2_remainder, tup); - - http2_telemetry_t *http2_tel = get_telemetry(pkt); - if (http2_tel == NULL) { - return; - } - - bool has_valid_first_frame = pktbuf_get_first_frame(pkt, frame_state, ¤t_frame, http2_tel); + incomplete_frame_t *incomplete_frame = bpf_map_lookup_elem(&http2_incomplete_frames, tup); + bool has_valid_first_frame = pktbuf_get_first_frame(pkt, incomplete_frame, ¤t_frame); // If we have a state and we consumed it, then delete it. - if (frame_state != NULL && frame_state->remainder == 0) { - bpf_map_delete_elem(&http2_remainder, tup); + if (incomplete_frame != NULL && incomplete_frame->remainder == 0) { + bpf_map_delete_elem(&http2_incomplete_frames, tup); } if (!has_valid_first_frame) { // Handling the case where we have a frame header remainder, and we couldn't read the frame header. if (pktbuf_data_offset(pkt) < pktbuf_data_end(pkt) && pktbuf_data_offset(pkt) + HTTP2_FRAME_HEADER_SIZE > pktbuf_data_end(pkt)) { - frame_header_remainder_t new_frame_state = { 0 }; - new_frame_state.remainder = HTTP2_FRAME_HEADER_SIZE - (pktbuf_data_end(pkt) - pktbuf_data_offset(pkt)); - bpf_memset(new_frame_state.buf, 0, HTTP2_FRAME_HEADER_SIZE); + incomplete_frame_t new_incomplete_frame = { 0 }; + new_incomplete_frame.remainder = HTTP2_FRAME_HEADER_SIZE - (pktbuf_data_end(pkt) - pktbuf_data_offset(pkt)); + bpf_memset(new_incomplete_frame.buf, 0, HTTP2_FRAME_HEADER_SIZE); #pragma unroll(HTTP2_FRAME_HEADER_SIZE) - for (__u32 iteration = 0; iteration < HTTP2_FRAME_HEADER_SIZE && new_frame_state.remainder + iteration < HTTP2_FRAME_HEADER_SIZE; ++iteration) { - pktbuf_load_bytes(pkt, pktbuf_data_offset(pkt) + iteration, new_frame_state.buf + iteration, 1); + for (__u32 iteration = 0; iteration < HTTP2_FRAME_HEADER_SIZE && new_incomplete_frame.remainder + iteration < HTTP2_FRAME_HEADER_SIZE; ++iteration) { + pktbuf_load_bytes(pkt, pktbuf_data_offset(pkt) + iteration, new_incomplete_frame.buf + iteration, 1); } - new_frame_state.header_length = HTTP2_FRAME_HEADER_SIZE - new_frame_state.remainder; - bpf_map_update_elem(&http2_remainder, tup, &new_frame_state, BPF_ANY); + new_incomplete_frame.header_length = HTTP2_FRAME_HEADER_SIZE - new_incomplete_frame.remainder; + bpf_map_update_elem(&http2_incomplete_frames, tup, &new_incomplete_frame, BPF_ANY); } return; } @@ -660,19 +659,19 @@ static __always_inline void handle_first_frame(pktbuf_t pkt, __u32 *external_dat pktbuf_advance(pkt, current_frame.length); // We're exceeding the packet boundaries, so we have a remainder. if (pktbuf_data_offset(pkt) > pktbuf_data_end(pkt)) { - frame_header_remainder_t new_frame_state = { 0 }; + incomplete_frame_t new_incomplete_frame = { 0 }; // Saving the remainder. - new_frame_state.remainder = pktbuf_data_offset(pkt) - pktbuf_data_end(pkt); + new_incomplete_frame.remainder = pktbuf_data_offset(pkt) - pktbuf_data_end(pkt); // We did find an interesting frame (as frames_count == 1), so we cache the current frame and waiting for the // next call. if (iteration_value->frames_count == 1) { - new_frame_state.header_length = HTTP2_FRAME_HEADER_SIZE; - bpf_memcpy(new_frame_state.buf, (char *)¤t_frame, HTTP2_FRAME_HEADER_SIZE); + new_incomplete_frame.header_length = HTTP2_FRAME_HEADER_SIZE; + bpf_memcpy(new_incomplete_frame.buf, (char *)¤t_frame, HTTP2_FRAME_HEADER_SIZE); } iteration_value->frames_count = 0; - bpf_map_update_elem(&http2_remainder, tup, &new_frame_state, BPF_ANY); + bpf_map_update_elem(&http2_incomplete_frames, tup, &new_incomplete_frame, BPF_ANY); // Not calling the next tail call as we have nothing to process. return; } @@ -709,14 +708,14 @@ int socket__http2_handle_first_frame(struct __sk_buff *skb) { // If we detected a tcp termination we should stop processing the packet, and clear its dynamic table by deleting the counter. if (is_tcp_termination(&dispatcher_args_copy.skb_info)) { // Deleting the entry for the original tuple. - bpf_map_delete_elem(&http2_remainder, &dispatcher_args_copy.tup); + bpf_map_delete_elem(&http2_incomplete_frames, &dispatcher_args_copy.tup); bpf_map_delete_elem(&http2_dynamic_counter_table, &dispatcher_args_copy.tup); terminated_http2_batch_enqueue(&dispatcher_args_copy.tup); // In case of local host, the protocol will be deleted for both (client->server) and (server->client), // so we won't reach for that path again in the code, so we're deleting the opposite side as well. flip_tuple(&dispatcher_args_copy.tup); bpf_map_delete_elem(&http2_dynamic_counter_table, &dispatcher_args_copy.tup); - bpf_map_delete_elem(&http2_remainder, &dispatcher_args_copy.tup); + bpf_map_delete_elem(&http2_incomplete_frames, &dispatcher_args_copy.tup); return 0; } @@ -774,21 +773,21 @@ static __always_inline void filter_frame(pktbuf_t pkt, void *map_key, conn_tuple __sync_fetch_and_add(&http2_tel->exceeding_max_frames_to_filter, 1); } - frame_header_remainder_t new_frame_state = { 0 }; + incomplete_frame_t new_incomplete_frame = { 0 }; if (pktbuf_data_offset(pkt) > pktbuf_data_end(pkt)) { // We have a remainder - new_frame_state.remainder = pktbuf_data_offset(pkt) - pktbuf_data_end(pkt); - bpf_map_update_elem(&http2_remainder, tup, &new_frame_state, BPF_ANY); + new_incomplete_frame.remainder = pktbuf_data_offset(pkt) - pktbuf_data_end(pkt); + bpf_map_update_elem(&http2_incomplete_frames, tup, &new_incomplete_frame, BPF_ANY); } else if (pktbuf_data_offset(pkt) < pktbuf_data_end(pkt) && pktbuf_data_offset(pkt) + HTTP2_FRAME_HEADER_SIZE > pktbuf_data_end(pkt)) { // We have a frame header remainder - new_frame_state.remainder = HTTP2_FRAME_HEADER_SIZE - (pktbuf_data_end(pkt) - pktbuf_data_offset(pkt)); - bpf_memset(new_frame_state.buf, 0, HTTP2_FRAME_HEADER_SIZE); + new_incomplete_frame.remainder = HTTP2_FRAME_HEADER_SIZE - (pktbuf_data_end(pkt) - pktbuf_data_offset(pkt)); + bpf_memset(new_incomplete_frame.buf, 0, HTTP2_FRAME_HEADER_SIZE); #pragma unroll(HTTP2_FRAME_HEADER_SIZE) - for (__u32 iteration = 0; iteration < HTTP2_FRAME_HEADER_SIZE && new_frame_state.remainder + iteration < HTTP2_FRAME_HEADER_SIZE; ++iteration) { - pktbuf_load_bytes(pkt, pktbuf_data_offset(pkt) + iteration, new_frame_state.buf + iteration, 1); + for (__u32 iteration = 0; iteration < HTTP2_FRAME_HEADER_SIZE && new_incomplete_frame.remainder + iteration < HTTP2_FRAME_HEADER_SIZE; ++iteration) { + pktbuf_load_bytes(pkt, pktbuf_data_offset(pkt) + iteration, new_incomplete_frame.buf + iteration, 1); } - new_frame_state.header_length = HTTP2_FRAME_HEADER_SIZE - new_frame_state.remainder; - bpf_map_update_elem(&http2_remainder, tup, &new_frame_state, BPF_ANY); + new_incomplete_frame.header_length = HTTP2_FRAME_HEADER_SIZE - new_incomplete_frame.remainder; + bpf_map_update_elem(&http2_incomplete_frames, tup, &new_incomplete_frame, BPF_ANY); } if (iteration_value->frames_count == 0) { diff --git a/pkg/network/ebpf/c/protocols/http2/maps-defs.h b/pkg/network/ebpf/c/protocols/http2/maps-defs.h index 949afce785df7..98dfc6eddb127 100644 --- a/pkg/network/ebpf/c/protocols/http2/maps-defs.h +++ b/pkg/network/ebpf/c/protocols/http2/maps-defs.h @@ -1,10 +1,10 @@ #ifndef __HTTP2_MAPS_DEFS_H #define __HTTP2_MAPS_DEFS_H -// http2_remainder maps a connection tuple to the remainder from the previous packet. +// http2_incomplete_frames maps a connection tuple to a frame remainder from the previous packet. // It is possible for frames to be split to multiple tcp packets, so we need to associate the remainder from the previous // packet, to the current one. -BPF_HASH_MAP(http2_remainder, conn_tuple_t, frame_header_remainder_t, 0) +BPF_HASH_MAP(http2_incomplete_frames, conn_tuple_t, incomplete_frame_t, 0) /* http2_dynamic_table is the map that holding the supported dynamic values - the index is the static index and the conn tuple and it is value is the buffer which contains the dynamic string. */ diff --git a/pkg/network/ebpf/c/protocols/kafka/kafka-parsing.h b/pkg/network/ebpf/c/protocols/kafka/kafka-parsing.h index 81af62163fa9f..b4dfe339107e5 100644 --- a/pkg/network/ebpf/c/protocols/kafka/kafka-parsing.h +++ b/pkg/network/ebpf/c/protocols/kafka/kafka-parsing.h @@ -1602,6 +1602,12 @@ static __always_inline bool kafka_process(conn_tuple_t *tup, kafka_info_t *kafka */ u32 offset = pktbuf_data_offset(pkt); + u32 pktlen = pktbuf_data_end(pkt) - offset; + + if (pktlen < sizeof(kafka_header_t)) { + return false; + } + kafka_transaction_t *kafka_transaction = &kafka->event.transaction; kafka_header_t kafka_header; bpf_memset(&kafka_header, 0, sizeof(kafka_header)); diff --git a/pkg/network/ebpf/c/protocols/postgres/decoding-maps.h b/pkg/network/ebpf/c/protocols/postgres/decoding-maps.h index 67288e1243f9e..3ccbd67e52466 100644 --- a/pkg/network/ebpf/c/protocols/postgres/decoding-maps.h +++ b/pkg/network/ebpf/c/protocols/postgres/decoding-maps.h @@ -15,4 +15,8 @@ BPF_PERCPU_ARRAY_MAP(postgres_scratch_buffer, postgres_event_t, 1) // Maintains the current state of tail calls for each Postgres message. BPF_PERCPU_ARRAY_MAP(postgres_iterations, postgres_tail_call_state_t, 1) +// Postgres telemetry maps in kernel provide empirical statistics on the number of processed Postgres messages. +// Key 0 for plaintext traffic, key 1 for encrypted traffic. +BPF_ARRAY_MAP(postgres_telemetry, postgres_kernel_msg_count_t, 2) + #endif diff --git a/pkg/network/ebpf/c/protocols/postgres/decoding.h b/pkg/network/ebpf/c/protocols/postgres/decoding.h index 300ca6ba949a9..3f5e6d489376e 100644 --- a/pkg/network/ebpf/c/protocols/postgres/decoding.h +++ b/pkg/network/ebpf/c/protocols/postgres/decoding.h @@ -108,6 +108,48 @@ static int __always_inline skip_string(pktbuf_t pkt, int message_len) { return SKIP_STRING_FAILED; } +// Return a pointer to the postgres telemetry record in the corresponding map. +static __always_inline void* get_pg_msg_counts_map(pktbuf_t pkt) { + const __u32 plain_key = 0; + const __u32 tls_key = 1; + + pktbuf_map_lookup_option_t pg_telemetry_lookup_opt[] = { + [PKTBUF_SKB] = { + .map = &postgres_telemetry, + .key = (void*)&plain_key, + }, + [PKTBUF_TLS] = { + .map = &postgres_telemetry, + .key = (void*)&tls_key, + }, + }; + return pktbuf_map_lookup(pkt, pg_telemetry_lookup_opt); +} + +// update_msg_count_telemetry increases the corresponding counter of the telemetry bucket. +static __always_inline void update_msg_count_telemetry(postgres_kernel_msg_count_t* pg_msg_counts, __u8 count) { + // This line can be interpreted as a step function of the difference, multiplied by the difference itself. + // The step function of the difference returns 0 if the difference is negative and 1 if it is positive. + // As a result, if the difference is negative, the output will be 0; if the difference is positive, + // the output will equal the difference. + count = count < PG_KERNEL_MSG_COUNT_FIRST_BUCKET ? 0 : count - PG_KERNEL_MSG_COUNT_FIRST_BUCKET; + + // This line functions as a ceiling operation, ensuring that if the count is not a multiple of the bucket size, + // it is rounded up to the next bucket. Since eBPF does not support floating-point numbers, the implementation + // adds (bucket size - 1) to the count and then divides the result by the bucket size. + // This effectively simulates the ceiling function. + __u8 bucket_idx = (count + PG_KERNEL_MSG_COUNT_BUCKET_SIZE - 1) / PG_KERNEL_MSG_COUNT_BUCKET_SIZE; + + // This line ensures that the bucket index stays within the range of 0 to PG_KERNEL_MSG_COUNT_NUM_BUCKETS. + // While not strictly necessary, we include this check to satisfy the verifier and to explicitly define a lower bound. + bucket_idx = bucket_idx < 0 ? 0 : bucket_idx; + + // This line ensures that the bucket index remains within the range of 0 to PG_KERNEL_MSG_COUNT_NUM_BUCKETS, + // preventing any possibility of exceeding the upper bound. + bucket_idx = bucket_idx >= PG_KERNEL_MSG_COUNT_NUM_BUCKETS ? PG_KERNEL_MSG_COUNT_NUM_BUCKETS-1 : bucket_idx; + __sync_fetch_and_add(&pg_msg_counts->msg_count_buckets[bucket_idx], 1); +} + // Reads the first message header and decides what to do based on the // message tag. If the message is a new query, it stores the query in the in-flight map. // If the message is a parse message, we tail call to the dedicated process_parse_message program. @@ -148,7 +190,7 @@ static __always_inline void postgres_handle_message(pktbuf_t pkt, conn_tuple_t * return; } - iteration_value->iteration = 0; + iteration_value->total_msg_count = 0; iteration_value->data_off = 0; pktbuf_tail_call_option_t handle_response_tail_call_array[] = { [PKTBUF_SKB] = { @@ -197,10 +239,10 @@ static __always_inline void postgres_handle_parse_message(pktbuf_t pkt, conn_tup // Handles Postgres command complete messages by examining packet data for both plaintext and TLS traffic. // This function handles multiple messages within a single packet, processing up to POSTGRES_MAX_MESSAGES_PER_TAIL_CALL -// messages per call. When more messages exist beyond this limit, it uses tail call chaining (up to -// POSTGRES_MAX_TAIL_CALLS_FOR_MAX_MESSAGES) to continue processing. -static __always_inline bool handle_response(pktbuf_t pkt, conn_tuple_t conn_tuple) { +// messages per call. When more messages exist beyond this limit, it uses tail call chaining to continue processing. +static __always_inline bool handle_response(pktbuf_t pkt, conn_tuple_t conn_tuple, postgres_kernel_msg_count_t* pg_msg_counts) { const __u32 zero = 0; + bool read_result = false; bool found_command_complete = false; struct pg_message_header header; @@ -210,7 +252,7 @@ static __always_inline bool handle_response(pktbuf_t pkt, conn_tuple_t conn_tupl return 0; } - if (iteration_value->iteration >= POSTGRES_MAX_TAIL_CALLS_FOR_MAX_MESSAGES) { + if (iteration_value->total_msg_count >= (POSTGRES_MAX_TOTAL_MESSAGES - 1)) { return 0; } @@ -225,13 +267,14 @@ static __always_inline bool handle_response(pktbuf_t pkt, conn_tuple_t conn_tupl return 0; } + __u8 messages_count = 0; #pragma unroll(POSTGRES_MAX_MESSAGES_PER_TAIL_CALL) - for (__u32 iteration = 0; iteration < POSTGRES_MAX_MESSAGES_PER_TAIL_CALL; ++iteration) { - if (!read_message_header(pkt, &header)) { + for (; messages_count < POSTGRES_MAX_MESSAGES_PER_TAIL_CALL; ++messages_count) { + read_result = read_message_header(pkt, &header); + if (read_result != true) { break; } if (header.message_tag == POSTGRES_COMMAND_COMPLETE_MAGIC_BYTE) { - handle_command_complete(&conn_tuple, transaction); found_command_complete = true; break; } @@ -240,20 +283,35 @@ static __always_inline bool handle_response(pktbuf_t pkt, conn_tuple_t conn_tupl // the message tag. So we need to add 1 to the message length to jump over the entire message. pktbuf_advance(pkt, header.message_len + 1); } + iteration_value->total_msg_count += messages_count; if (found_command_complete) { + handle_command_complete(&conn_tuple, transaction); + update_msg_count_telemetry(pg_msg_counts, iteration_value->total_msg_count); + return 0; } - // We didn't find a command complete message, so we need to continue processing the packet. - // We save the current data offset and increment the iteration counter. - iteration_value->iteration += 1; - iteration_value->data_off = pktbuf_data_offset(pkt); - // If the maximum number of tail calls has been reached, we can skip invoking the next tail call. - if (iteration_value->iteration >= POSTGRES_MAX_TAIL_CALLS_FOR_MAX_MESSAGES) { + if (iteration_value->total_msg_count >= (POSTGRES_MAX_TOTAL_MESSAGES - 1)) { + // reached max messages, add counter and stop iterating. + __sync_fetch_and_add(&pg_msg_counts->reached_max_messages, 1); + return 0; + } + if (pktbuf_data_offset(pkt) == pktbuf_data_end(pkt)) { + // stop the iterator if the end of the TCP packet is reached. + update_msg_count_telemetry(pg_msg_counts, iteration_value->total_msg_count); + return 0; + } + if (read_result == false) { + // the packet was fragmented, add counter stop iterating. + __sync_fetch_and_add(&pg_msg_counts->fragmented_packets, 1); return 0; } + // We didn't find a command complete message, so we need to continue processing the packet. + // We save the current data offset. + iteration_value->data_off = pktbuf_data_offset(pkt); + pktbuf_tail_call_option_t handle_response_tail_call_array[] = { [PKTBUF_SKB] = { .prog_array_map = &protocols_progs, @@ -315,7 +373,11 @@ int socket__postgres_handle_response(struct __sk_buff* skb) { normalize_tuple(&conn_tuple); pktbuf_t pkt = pktbuf_from_skb(skb, &skb_info); - handle_response(pkt, conn_tuple); + postgres_kernel_msg_count_t* pg_msg_counts = get_pg_msg_counts_map(pkt); + if (pg_msg_counts == NULL) { + return 0; + } + handle_response(pkt, conn_tuple, pg_msg_counts); return 0; } @@ -406,10 +468,15 @@ int uprobe__postgres_tls_handle_response(struct pt_regs *ctx) { return 0; } + pktbuf_t pkt = pktbuf_from_tls(ctx, args); + postgres_kernel_msg_count_t* pg_msg_counts = get_pg_msg_counts_map(pkt); + if (pg_msg_counts == NULL) { + return 0; + } + // Copying the tuple to the stack to handle verifier issues on kernel 4.14. conn_tuple_t tup = args->tup; - pktbuf_t pkt = pktbuf_from_tls(ctx, args); - handle_response(pkt, tup); + handle_response(pkt, tup, pg_msg_counts); return 0; } diff --git a/pkg/network/ebpf/c/protocols/postgres/types.h b/pkg/network/ebpf/c/protocols/postgres/types.h index 0e88332dc78a7..6f0abf951ddaf 100644 --- a/pkg/network/ebpf/c/protocols/postgres/types.h +++ b/pkg/network/ebpf/c/protocols/postgres/types.h @@ -7,10 +7,13 @@ #define POSTGRES_BUFFER_SIZE 160 // Represents the maximum number of tail calls we can use to process a single message. -#define POSTGRES_MAX_TAIL_CALLS_FOR_MAX_MESSAGES 1 +#define POSTGRES_MAX_TAIL_CALLS_FOR_MAX_MESSAGES 3 // Represents the maximum number of messages we process in a single tail call. -#define POSTGRES_MAX_MESSAGES_PER_TAIL_CALL 80 +#define POSTGRES_MAX_MESSAGES_PER_TAIL_CALL 60 + +// maximum number of messages to fetch +#define POSTGRES_MAX_TOTAL_MESSAGES (POSTGRES_MAX_TAIL_CALLS_FOR_MAX_MESSAGES * POSTGRES_MAX_MESSAGES_PER_TAIL_CALL) // Postgres transaction information we store in the kernel. typedef struct { @@ -30,10 +33,26 @@ typedef struct { } postgres_event_t; typedef struct { - __u8 iteration; + __u8 total_msg_count; // Saving the packet data offset is crucial for maintaining the current read position and ensuring proper utilization // of tail calls. __u32 data_off; } postgres_tail_call_state_t; +// Postgres communication operates via a continuous message stream. +// Gather empirical statistics on the number of messages processed by the program. +// These statistics enable optimization of the monitoring code. +// Collect counters for each subsequent bucket. +// bucket 0: count 0 to 100, bucket 1: 100 to 119, bucket 2: 120 to 139 etc. +#define PG_KERNEL_MSG_COUNT_NUM_BUCKETS 5 +#define PG_KERNEL_MSG_COUNT_BUCKET_SIZE 20 +#define PG_KERNEL_MSG_COUNT_FIRST_BUCKET 100 + +// This structure stores statistics about the number of Postgres messages in a TCP packet. +typedef struct { + __u64 reached_max_messages; + __u64 fragmented_packets; + __u64 msg_count_buckets[PG_KERNEL_MSG_COUNT_NUM_BUCKETS]; +} postgres_kernel_msg_count_t; + #endif diff --git a/pkg/network/ebpf/c/protocols/sockfd-probes.h b/pkg/network/ebpf/c/protocols/sockfd-probes.h index 9c31f236ab087..06ecbeee6fe57 100644 --- a/pkg/network/ebpf/c/protocols/sockfd-probes.h +++ b/pkg/network/ebpf/c/protocols/sockfd-probes.h @@ -13,6 +13,7 @@ #include "sock.h" #include "sockfd.h" +#include "pid_tgid.h" SEC("kprobe/tcp_close") int BPF_KPROBE(kprobe__tcp_close, struct sock *sk) { @@ -53,7 +54,7 @@ int BPF_KPROBE(kprobe__sockfd_lookup_light, int sockfd) { // but can reduce the accuracy of programs relying on socket FDs for // processes with a lot of FD churn pid_fd_t key = { - .pid = pid_tgid >> 32, + .pid = GET_USER_MODE_PID(pid_tgid), .fd = sockfd, }; conn_tuple_t *t = bpf_map_lookup_elem(&tuple_by_pid_fd, &key); @@ -121,7 +122,7 @@ int BPF_KRETPROBE(kretprobe__sockfd_lookup_light, struct socket *socket) { } pid_fd_t pid_fd = { - .pid = pid_tgid >> 32, + .pid = GET_USER_MODE_PID(pid_tgid), .fd = (*sockfd), }; diff --git a/pkg/network/ebpf/c/protocols/tls/go-tls-conn.h b/pkg/network/ebpf/c/protocols/tls/go-tls-conn.h index ba812de0385bd..d297ad11f57cf 100644 --- a/pkg/network/ebpf/c/protocols/tls/go-tls-conn.h +++ b/pkg/network/ebpf/c/protocols/tls/go-tls-conn.h @@ -4,6 +4,7 @@ #include "bpf_helpers.h" #include "ip.h" #include "port_range.h" +#include "pid_tgid.h" #include "protocols/http/maps.h" #include "protocols/tls/go-tls-types.h" @@ -49,7 +50,7 @@ static __always_inline conn_tuple_t* conn_tup_from_tls_conn(tls_offsets_data_t* // The code path below should be executed only once during the lifecycle of a TLS connection pid_fd_t pid_fd = { - .pid = pid_tgid >> 32, + .pid = GET_USER_MODE_PID(pid_tgid), // fd is populated by the code downstream .fd = 0, }; diff --git a/pkg/network/ebpf/c/protocols/tls/go-tls-maps.h b/pkg/network/ebpf/c/protocols/tls/go-tls-maps.h index 1c66dee1d0abc..896b77cc8190f 100644 --- a/pkg/network/ebpf/c/protocols/tls/go-tls-maps.h +++ b/pkg/network/ebpf/c/protocols/tls/go-tls-maps.h @@ -11,11 +11,11 @@ BPF_HASH_MAP(offsets_data, go_tls_offsets_data_key_t, tls_offsets_data_t, 1024) /* go_tls_read_args is used to get the read function info when running in the read-return uprobe. The key contains the go routine id and the pid. */ -BPF_LRU_MAP(go_tls_read_args, go_tls_function_args_key_t, go_tls_read_args_data_t, 2048) +BPF_HASH_MAP(go_tls_read_args, go_tls_function_args_key_t, go_tls_read_args_data_t, 2048) /* go_tls_write_args is used to get the read function info when running in the write-return uprobe. The key contains the go routine id and the pid. */ -BPF_LRU_MAP(go_tls_write_args, go_tls_function_args_key_t, go_tls_write_args_data_t, 2048) +BPF_HASH_MAP(go_tls_write_args, go_tls_function_args_key_t, go_tls_write_args_data_t, 2048) /* This map associates crypto/tls.(*Conn) values to the corresponding conn_tuple_t* value. It is used to implement a simplified version of tup_from_ssl_ctx from usm.c diff --git a/pkg/network/ebpf/c/protocols/tls/https.h b/pkg/network/ebpf/c/protocols/tls/https.h index f1d0562033a54..ac3c509daaeb3 100644 --- a/pkg/network/ebpf/c/protocols/tls/https.h +++ b/pkg/network/ebpf/c/protocols/tls/https.h @@ -17,6 +17,7 @@ #include "bpf_builtins.h" #include "port_range.h" #include "sock.h" +#include "pid_tgid.h" #include "protocols/amqp/helpers.h" #include "protocols/redis/helpers.h" @@ -250,7 +251,7 @@ static __always_inline conn_tuple_t* tup_from_ssl_ctx(void *ssl_ctx, u64 pid_tgi // the code path below should be executed only once during the lifecycle of a SSL session pid_fd_t pid_fd = { - .pid = pid_tgid >> 32, + .pid = GET_USER_MODE_PID(pid_tgid), .fd = ssl_sock->fd, }; diff --git a/pkg/network/ebpf/c/protocols/tls/native-tls-maps.h b/pkg/network/ebpf/c/protocols/tls/native-tls-maps.h index 4ee9366cd58cc..5e139833d4302 100644 --- a/pkg/network/ebpf/c/protocols/tls/native-tls-maps.h +++ b/pkg/network/ebpf/c/protocols/tls/native-tls-maps.h @@ -3,20 +3,20 @@ #include "map-defs.h" -BPF_LRU_MAP(ssl_sock_by_ctx, void *, ssl_sock_t, 1) +BPF_HASH_MAP(ssl_sock_by_ctx, void *, ssl_sock_t, 1) -BPF_LRU_MAP(ssl_read_args, u64, ssl_read_args_t, 1024) +BPF_HASH_MAP(ssl_read_args, u64, ssl_read_args_t, 1024) -BPF_LRU_MAP(ssl_read_ex_args, u64, ssl_read_ex_args_t, 1024) +BPF_HASH_MAP(ssl_read_ex_args, u64, ssl_read_ex_args_t, 1024) -BPF_LRU_MAP(ssl_write_args, u64, ssl_write_args_t, 1024) +BPF_HASH_MAP(ssl_write_args, u64, ssl_write_args_t, 1024) -BPF_LRU_MAP(ssl_write_ex_args, u64, ssl_write_ex_args_t, 1024) +BPF_HASH_MAP(ssl_write_ex_args, u64, ssl_write_ex_args_t, 1024) -BPF_LRU_MAP(bio_new_socket_args, __u64, __u32, 1024) +BPF_HASH_MAP(bio_new_socket_args, __u64, __u32, 1024) -BPF_LRU_MAP(fd_by_ssl_bio, __u32, void *, 1024) +BPF_HASH_MAP(fd_by_ssl_bio, __u32, void *, 1024) -BPF_LRU_MAP(ssl_ctx_by_pid_tgid, __u64, void *, 1024) +BPF_HASH_MAP(ssl_ctx_by_pid_tgid, __u64, void *, 1) #endif diff --git a/pkg/network/ebpf/c/protocols/tls/tls.h b/pkg/network/ebpf/c/protocols/tls/tls.h index 0f7f2cdf9ee56..813c548360a9a 100644 --- a/pkg/network/ebpf/c/protocols/tls/tls.h +++ b/pkg/network/ebpf/c/protocols/tls/tls.h @@ -1,9 +1,9 @@ #ifndef __TLS_H #define __TLS_H -#include "ktypes.h" -#include "bpf_builtins.h" +#include "tracer/tracer.h" +// TLS version constants (SSL versions are deprecated, included for completeness) #define SSL_VERSION20 0x0200 #define SSL_VERSION30 0x0300 #define TLS_VERSION10 0x0301 @@ -11,122 +11,612 @@ #define TLS_VERSION12 0x0303 #define TLS_VERSION13 0x0304 -#define TLS_HANDSHAKE 0x16 -#define TLS_APPLICATION_DATA 0x17 +// TLS Content Types (https://www.rfc-editor.org/rfc/rfc5246#page-19 6.2. Record Layer) +#define TLS_HANDSHAKE 0x16 +#define TLS_APPLICATION_DATA 0x17 +#define TLS_CHANGE_CIPHER_SPEC 0x14 +#define TLS_ALERT 0x15 -/* https://www.rfc-editor.org/rfc/rfc5246#page-19 6.2. Record Layer */ +// TLS Handshake Types +#define TLS_HANDSHAKE_CLIENT_HELLO 0x01 +#define TLS_HANDSHAKE_SERVER_HELLO 0x02 + +// Bitmask constants for offered versions +#define TLS_VERSION10_BIT 1 << 0 +#define TLS_VERSION11_BIT 1 << 1 +#define TLS_VERSION12_BIT 1 << 2 +#define TLS_VERSION13_BIT 1 << 3 +// Maximum number of extensions to parse when looking for SUPPORTED_VERSIONS_EXTENSION +#define MAX_EXTENSIONS 16 +// The supported_versions extension for TLS 1.3 is described in RFC 8446 Section 4.2.1 +#define SUPPORTED_VERSIONS_EXTENSION 0x002B + +// Maximum TLS record payload size (16 KB) #define TLS_MAX_PAYLOAD_LENGTH (1 << 14) -// TLS record layer header structure +// The following field lengths and message formats are defined by the TLS specifications +// For TLS 1.2 (and earlier) see: +// RFC 5246 - The Transport Layer Security (TLS) Protocol Version 1.2 +// https://tools.ietf.org/html/rfc5246 +// Particularly Section 7.4 details handshake messages and their fields, and Section 6.2.1 +// covers the TLS record layer. +// For TLS 1.3, see: +// RFC 8446 - The Transport Layer Security (TLS) Protocol Version 1.3 +// https://tools.ietf.org/html/rfc8446 +// Many handshake structures are similar, but some extensions (like supported_versions) are defined here +#define TLS_HANDSHAKE_LENGTH 3 // Handshake length is 3 bytes (RFC 5246 Section 7.4) +#define TLS_HELLO_MESSAGE_HEADER_SIZE 4 // handshake_type(1) + length(3) +#define RANDOM_LENGTH 32 // Random field length in Client/Server Hello (RFC 5246 Section 7.4.1.2) +#define PROTOCOL_VERSION_LENGTH 2 // Protocol version field is 2 bytes (RFC 5246 Section 6.2.1) +#define SESSION_ID_LENGTH 1 // Session ID length field is 1 byte (RFC 5246 Section 7.4.1.2) +#define CIPHER_SUITES_LENGTH 2 // Cipher Suites length field is 2 bytes (RFC 5246 Section 7.4.1.2) +#define COMPRESSION_METHODS_LENGTH 1 // Compression Methods length field is 1 byte (RFC 5246 Section 7.4.1.2) +#define EXTENSION_TYPE_LENGTH 2 // Extension Type field is 2 bytes (RFC 5246 Section 7.4.1.4) +#define EXTENSION_LENGTH_FIELD 2 // Extension Length field is 2 bytes (RFC 5246 Section 7.4.1.4) + +// For single-byte fields (list lengths, etc.) +#define SINGLE_BYTE_LENGTH 1 + +// Minimum extension header length = Extension Type (2 bytes) + Extension Length (2 bytes) = 4 bytes +#define MIN_EXTENSION_HEADER_LENGTH (EXTENSION_TYPE_LENGTH + EXTENSION_LENGTH_FIELD) + +// Maximum number of supported versions we unroll for (all TLS versions) +#define MAX_SUPPORTED_VERSIONS 4 + +// TLS record layer header structure (RFC 5246) typedef struct { __u8 content_type; __u16 version; __u16 length; } __attribute__((packed)) tls_record_header_t; -typedef struct { +// Checks if the TLS version is valid +static __always_inline bool is_valid_tls_version(__u16 version) { + switch (version) { + case SSL_VERSION20: + case SSL_VERSION30: + case TLS_VERSION10: + case TLS_VERSION11: + case TLS_VERSION12: + case TLS_VERSION13: + return true; + default: + return false; + } +} + +// set_tls_offered_version sets the bit corresponding to the offered version in the offered_versions field of tls_info +static __always_inline void set_tls_offered_version(tls_info_t *tls_info, __u16 version) { + switch (version) { + case TLS_VERSION10: + tls_info->offered_versions |= TLS_VERSION10_BIT; + break; + case TLS_VERSION11: + tls_info->offered_versions |= TLS_VERSION11_BIT; + break; + case TLS_VERSION12: + tls_info->offered_versions |= TLS_VERSION12_BIT; + break; + case TLS_VERSION13: + tls_info->offered_versions |= TLS_VERSION13_BIT; + break; + default: + break; + } +} + +// TLS Record Header (RFC 5246 Section 6.2.1) +// +// +---------+---------+---------+-----------+ +// | type(1) | version(2) | length(2) | +// +---------+---------+---------+-----------+ +// type: 1 byte (TLS_CONTENT_TYPE) +// version: 2 bytes (e.g., 0x03 0x03 for TLS 1.2) +// length: 2 bytes (total number of payload bytes following this header) + +// read_tls_record_header reads the TLS record header from the packet +// Reference: RFC 5246 Section 6.2.1 (Record Layer), https://tools.ietf.org/html/rfc5246#section-6.2.1 +// Validates the record header fields (content_type, version, length) and checks for correctness within packet bounds. +static __always_inline bool read_tls_record_header(struct __sk_buff *skb, __u32 header_offset, __u32 data_end, tls_record_header_t *tls_hdr) { + // Ensure there's enough space for TLS record header + if (header_offset + sizeof(tls_record_header_t) > data_end) { + return false; + } + + // Read TLS record header + if (bpf_skb_load_bytes(skb, header_offset, tls_hdr, sizeof(tls_record_header_t)) < 0) { + return false; + } + + // Convert fields to host byte order + tls_hdr->version = bpf_ntohs(tls_hdr->version); + tls_hdr->length = bpf_ntohs(tls_hdr->length); + + // Validate version and length + if (!is_valid_tls_version(tls_hdr->version)) { + return false; + } + if (tls_hdr->length > TLS_MAX_PAYLOAD_LENGTH) { + return false; + } + + // Ensure we don't read beyond the packet + return header_offset + sizeof(tls_record_header_t) + tls_hdr->length <= data_end; +} + +// TLS Handshake Message Header (RFC 5246 Section 7.4) +// +---------+---------+---------+---------+ +// | handshake_type(1) | length(3 bytes) | +// +---------+---------+---------+---------+ +// +// The handshake_type identifies the handshake message (e.g., ClientHello, ServerHello). +// length indicates the size of the handshake message that follows (not including these 4 bytes). + +// is_valid_tls_handshake checks if the TLS handshake message is valid +// The function expects the record to have already been validated. It further checks that the +// handshake_type and handshake_length are consistent. +static __always_inline bool is_valid_tls_handshake(struct __sk_buff *skb, __u32 header_offset, __u32 data_end, const tls_record_header_t *hdr) { + // At this point, we know from read_tls_record_header() that: + // - hdr->version is a valid TLS version + // - hdr->length fits entirely within the packet (header_offset + hdr->length <= data_end) + + __u32 handshake_offset = header_offset + sizeof(tls_record_header_t); + + // Ensure we don't read beyond the packet + if (handshake_offset + SINGLE_BYTE_LENGTH > data_end) { + return false; + } + // Read handshake_type (1 byte) __u8 handshake_type; - __u8 length[3]; - __u16 version; -} __attribute__((packed)) tls_hello_message_t; + if (bpf_skb_load_bytes(skb, handshake_offset, &handshake_type, SINGLE_BYTE_LENGTH) < 0) { + return false; + } -#define TLS_HANDSHAKE_CLIENT_HELLO 0x01 -#define TLS_HANDSHAKE_SERVER_HELLO 0x02 -// The size of the handshake type and the length. -#define TLS_HELLO_MESSAGE_HEADER_SIZE 4 + // Read handshake_length (3 bytes) + __u32 length_offset = handshake_offset + SINGLE_BYTE_LENGTH; + if (length_offset + TLS_HANDSHAKE_LENGTH > data_end) { + return false; + } + __u8 handshake_length_bytes[TLS_HANDSHAKE_LENGTH]; + if (bpf_skb_load_bytes(skb, length_offset, handshake_length_bytes, TLS_HANDSHAKE_LENGTH) < 0) { + return false; + } -// is_valid_tls_version checks if the given version is a valid TLS version as -// defined in the TLS specification. -static __always_inline bool is_valid_tls_version(__u16 version) { - switch (version) { - case SSL_VERSION20: - case SSL_VERSION30: - case TLS_VERSION10: - case TLS_VERSION11: - case TLS_VERSION12: - case TLS_VERSION13: + __u32 handshake_length = (handshake_length_bytes[0] << 16) | + (handshake_length_bytes[1] << 8) | + handshake_length_bytes[2]; + + // Verify that the handshake message length plus the 4-byte handshake header (1 byte type + 3 bytes length) + // matches the total length defined in the record header. + // If handshake_length + TLS_HELLO_MESSAGE_HEADER_SIZE != hdr->length, the handshake message structure is inconsistent. + if (handshake_length + TLS_HELLO_MESSAGE_HEADER_SIZE != hdr->length) { + return false; + } + + // Check that the handshake_type is one of the expected values (ClientHello or ServerHello). + // This ensures we are dealing with a known handshake message type. + if (handshake_type != TLS_HANDSHAKE_CLIENT_HELLO && handshake_type != TLS_HANDSHAKE_SERVER_HELLO) { + return false; + } + + // At this point, we've confirmed: + // - The handshake message fits within the record. + // - The handshake_type is a known TLS Hello message. + // - The handshake_length matches the record header's length. + return true; +} + +// is_tls checks if the packet is a TLS packet by reading and validating the TLS record header +// Reference: RFC 5246 Section 6.2.1 (Record Layer), https://tools.ietf.org/html/rfc5246#section-6.2.1 +// Validates that content_type matches known TLS types (Handshake, Application Data, etc.). +static __always_inline bool is_tls(struct __sk_buff *skb, __u32 header_offset, __u32 data_end, tls_record_header_t *tls_hdr) { + // Read and validate the TLS record header + if (!read_tls_record_header(skb, header_offset, data_end, tls_hdr)) { + return false; + } + + switch (tls_hdr->content_type) { + case TLS_HANDSHAKE: + return is_valid_tls_handshake(skb, header_offset, data_end, tls_hdr); + case TLS_APPLICATION_DATA: + case TLS_CHANGE_CIPHER_SPEC: + case TLS_ALERT: return true; + default: + return false; + } +} + +// parse_tls_handshake_header extracts handshake_length and protocol_version from a TLS handshake message +// References: +// - RFC 5246 Section 7.4 (Handshake Protocol Overview), https://tools.ietf.org/html/rfc5246#section-7.4 +// For ClientHello and ServerHello, this includes parsing the handshake type (skipped prior) and the 3-byte length field, followed by a 2-byte protocol version field. +static __always_inline bool parse_tls_handshake_header(struct __sk_buff *skb, __u32 *offset, __u32 data_end, __u32 *handshake_length, __u16 *protocol_version) { + *offset += SINGLE_BYTE_LENGTH; // Move past handshake type (1 byte) + + // Read handshake length (3 bytes) + if (*offset + TLS_HANDSHAKE_LENGTH > data_end) { + return false; + } + __u8 handshake_length_bytes[TLS_HANDSHAKE_LENGTH]; + if (bpf_skb_load_bytes(skb, *offset, handshake_length_bytes, TLS_HANDSHAKE_LENGTH) < 0) { + return false; } + *handshake_length = (handshake_length_bytes[0] << 16) | + (handshake_length_bytes[1] << 8) | + handshake_length_bytes[2]; + *offset += TLS_HANDSHAKE_LENGTH; - return false; + // Ensure we don't read beyond the packet + if (*offset + *handshake_length > data_end) { + return false; + } + + // Read protocol version (2 bytes) + if (*offset + PROTOCOL_VERSION_LENGTH > data_end) { + return false; + } + __u16 version; + if (bpf_skb_load_bytes(skb, *offset, &version, PROTOCOL_VERSION_LENGTH) < 0) { + return false; + } + *protocol_version = bpf_ntohs(version); + *offset += PROTOCOL_VERSION_LENGTH; + + return true; } -// is_valid_tls_app_data checks if the buffer is a valid TLS Application Data -// record header. The record header is considered valid if: -// - the TLS version field is a known SSL/TLS version -// - the payload length is below the maximum payload length defined in the -// standard. -// - the payload length + the size of the record header is less than the size -// of the skb -static __always_inline bool is_valid_tls_app_data(tls_record_header_t *hdr, __u32 buf_size, __u32 skb_len) { - return sizeof(*hdr) + hdr->length <= skb_len; +// skip_random_and_session_id Skips the Random (32 bytes) and the Session ID from the TLS Hello messages +// References: +// - RFC 5246 Section 7.4.1.2 (Client Hello and Server Hello): https://tools.ietf.org/html/rfc5246#section-7.4.1.2 +// ClientHello and ServerHello contain a "random" field (32 bytes) followed by a "session_id_length" (1 byte) +// and a session_id of that length. This helper increments the offset accordingly after reading and skipping these fields. +static __always_inline bool skip_random_and_session_id(struct __sk_buff *skb, __u32 *offset, __u32 data_end) { + // Skip Random (32 bytes) + *offset += RANDOM_LENGTH; + + // Read Session ID Length (1 byte) + if (*offset + SESSION_ID_LENGTH > data_end) { + return false; + } + __u8 session_id_length; + if (bpf_skb_load_bytes(skb, *offset, &session_id_length, SESSION_ID_LENGTH) < 0) { + return false; + } + *offset += SESSION_ID_LENGTH; + + // Skip Session ID + *offset += session_id_length; + + // Ensure we don't read beyond the packet + return *offset <= data_end; +} + +// parse_supported_versions_extension looks for the supported_versions extension in the ClientHello or ServerHello and populates tags +// References: +// - For TLS 1.3 supported_versions extension: RFC 8446 Section 4.2.1: https://tools.ietf.org/html/rfc8446#section-4.2.1 +// For ClientHello this extension contains a list of supported versions (2 bytes each) preceded by a 1-byte length. +// supported_versions extension structure: +// +-----+--------------------+ +// | len(1) | versions(2 * N) | +// +-----+--------------------+ +// For ServerHello (TLS 1.3), it contains a single selected_version (2 bytes). +// +---------------------+ +// | selected_version(2) | +// +---------------------+ +static __always_inline bool parse_supported_versions_extension(struct __sk_buff *skb, __u32 *offset, __u32 data_end, __u32 extensions_end, tls_info_t *tags, bool is_client_hello) { + if (is_client_hello) { + // Read supported version list length (1 byte) + if (*offset + SINGLE_BYTE_LENGTH > data_end || *offset + SINGLE_BYTE_LENGTH > extensions_end) { + return false; + } + __u8 sv_list_length; + if (bpf_skb_load_bytes(skb, *offset, &sv_list_length, SINGLE_BYTE_LENGTH) < 0) { + return false; + } + *offset += SINGLE_BYTE_LENGTH; + + if (*offset + sv_list_length > data_end || *offset + sv_list_length > extensions_end) { + return false; + } + + // Parse the list of supported versions (2 bytes each) + __u8 sv_offset = 0; + __u16 sv_version; + #pragma unroll(MAX_SUPPORTED_VERSIONS) + for (int idx = 0; idx < MAX_SUPPORTED_VERSIONS; idx++) { + if (sv_offset + 1 >= sv_list_length) { + break; + } + // Each supported version is 2 bytes + if (*offset + PROTOCOL_VERSION_LENGTH > data_end) { + return false; + } + + if (bpf_skb_load_bytes(skb, *offset, &sv_version, PROTOCOL_VERSION_LENGTH) < 0) { + return false; + } + sv_version = bpf_ntohs(sv_version); + *offset += PROTOCOL_VERSION_LENGTH; + + set_tls_offered_version(tags, sv_version); + sv_offset += PROTOCOL_VERSION_LENGTH; + } + } else { + // ServerHello + // The selected_version field is 2 bytes + if (*offset + PROTOCOL_VERSION_LENGTH > data_end) { + return false; + } + + // Read selected version (2 bytes) + __u16 selected_version; + if (bpf_skb_load_bytes(skb, *offset, &selected_version, PROTOCOL_VERSION_LENGTH) < 0) { + return false; + } + selected_version = bpf_ntohs(selected_version); + *offset += PROTOCOL_VERSION_LENGTH; + + tags->chosen_version = selected_version; + } + + return true; +} + +// parse_tls_extensions parses TLS extensions in both ClientHello and ServerHello +// References: +// - RFC 5246 Section 7.4.1.4 (Hello Extensions): https://tools.ietf.org/html/rfc5246#section-7.4.1.4 +// - For TLS 1.3 supported_versions extension: RFC 8446 Section 4.2.1: https://tools.ietf.org/html/rfc8446#section-4.2.1 +// This function iterates over extensions, reading the extension_type and extension_length, and if it encounters +// the supported_versions extension, it calls parse_supported_versions_extension to handle it. +// ASCII snippet for a single extension: +// +---------+---------+--------------------------------+ +// | ext_type(2) | ext_length(2) | ext_data(ext_length) | +// +---------+---------+--------------------------------+ +// For multiple extensions, they are just concatenated one after another. +static __always_inline bool parse_tls_extensions(struct __sk_buff *skb, __u32 *offset, __u32 data_end, __u32 extensions_end, tls_info_t *tags, bool is_client_hello) { + __u16 extension_type; + __u16 extension_length; + + #pragma unroll(MAX_EXTENSIONS) + for (int i = 0; i < MAX_EXTENSIONS; i++) { + if (*offset + MIN_EXTENSION_HEADER_LENGTH > extensions_end) { + break; + } + + // Read Extension Type (2 bytes) + if (bpf_skb_load_bytes(skb, *offset, &extension_type, EXTENSION_TYPE_LENGTH) < 0) { + return false; + } + extension_type = bpf_ntohs(extension_type); + *offset += EXTENSION_TYPE_LENGTH; + + // Read Extension Length (2 bytes) + if (bpf_skb_load_bytes(skb, *offset, &extension_length, EXTENSION_LENGTH_FIELD) < 0) { + return false; + } + extension_length = bpf_ntohs(extension_length); + *offset += EXTENSION_LENGTH_FIELD; + + if (*offset + extension_length > data_end || *offset + extension_length > extensions_end) { + return false; + } + + if (extension_type == SUPPORTED_VERSIONS_EXTENSION) { + if (!parse_supported_versions_extension(skb, offset, data_end, extensions_end, tags, is_client_hello)) { + return false; + } + } else { + // Skip other extensions + *offset += extension_length; + } + + if (*offset >= extensions_end) { + break; + } + } + + return true; } -// is_tls_handshake checks if the given TLS message header is a valid TLS -// handshake message. The message is considered valid if: -// - The type matches CLIENT_HELLO or SERVER_HELLO -// - The version is a known SSL/TLS version -static __always_inline bool is_tls_handshake(tls_record_header_t *hdr, const char *buf, __u32 buf_size) { - // Checking the buffer size contains at least the size of the tls record header and the tls hello message header. - if (sizeof(tls_record_header_t) + sizeof(tls_hello_message_t) > buf_size) { +// parse_client_hello parses the ClientHello message and populates tags +// Reference: RFC 5246 Section 7.4.1.2 (Client Hello), https://tools.ietf.org/html/rfc5246 +// Structure (simplified): +// handshake_type (1 byte), length (3 bytes), version (2 bytes), random(32 bytes), session_id_length(1 byte), session_id(variable), cipher_suites_length(2 bytes), cipher_suites(variable), compression_methods_length(1 byte), compression_methods(variable), extensions_length(2 bytes), extensions(variable) +// After the handshake header (handshake_type + length), the ClientHello fields are: +// +----------------------------+ +// | client_version (2) | +// +----------------------------+ +// | random (32) | +// +----------------------------+ +// | session_id_length (1) | +// | session_id (...) | +// +----------------------------+ +// | cipher_suites_length(2) | +// | cipher_suites(...) | +// +----------------------------+ +// | compression_methods_len(1) | +// | compression_methods(...) | +// +----------------------------+ +// | extensions_length (2) | +// | extensions(...) | +// +----------------------------+ +static __always_inline bool parse_client_hello(struct __sk_buff *skb, __u32 offset, __u32 data_end, tls_info_t *tags) { + __u32 handshake_length; + __u16 client_version; + + if (!parse_tls_handshake_header(skb, &offset, data_end, &handshake_length, &client_version)) { + return false; + } + + set_tls_offered_version(tags, client_version); + + // TLS 1.2 is the highest version we will see in the header. If the connection is actually a higher version (1.3), + // it must be extracted from the extensions. Lower versions (1.0, 1.1) will not have extensions. + if (client_version != TLS_VERSION12) { + return true; + } + + if (!skip_random_and_session_id(skb, &offset, data_end)) { + return false; + } + + // Read Cipher Suites Length (2 bytes) + if (offset + CIPHER_SUITES_LENGTH > data_end) { + return false; + } + __u16 cipher_suites_length; + if (bpf_skb_load_bytes(skb, offset, &cipher_suites_length, CIPHER_SUITES_LENGTH) < 0) { + return false; + } + cipher_suites_length = bpf_ntohs(cipher_suites_length); + offset += CIPHER_SUITES_LENGTH; + + // Skip Cipher Suites + offset += cipher_suites_length; + + // Read Compression Methods Length (1 byte) + if (offset + COMPRESSION_METHODS_LENGTH > data_end) { + return false; + } + __u8 compression_methods_length; + if (bpf_skb_load_bytes(skb, offset, &compression_methods_length, COMPRESSION_METHODS_LENGTH) < 0) { return false; } - // Checking the tls record header length is greater than the tls hello message header length. - if (hdr->length < sizeof(tls_hello_message_t)) { + offset += COMPRESSION_METHODS_LENGTH; + + // Skip Compression Methods + offset += compression_methods_length; + + // Check if extensions are present + if (offset + EXTENSION_LENGTH_FIELD > data_end) { return false; } - // Getting the tls hello message header. - tls_hello_message_t msg = *(tls_hello_message_t *)(buf + sizeof(tls_record_header_t)); - // If the message is not a CLIENT_HELLO or SERVER_HELLO, we don't attempt to classify. - if (msg.handshake_type != TLS_HANDSHAKE_CLIENT_HELLO && msg.handshake_type != TLS_HANDSHAKE_SERVER_HELLO) { + // Read Extensions Length (2 bytes) + __u16 extensions_length; + if (bpf_skb_load_bytes(skb, offset, &extensions_length, EXTENSION_LENGTH_FIELD) < 0) { return false; } - // Converting the fields to host byte order. - __u32 length = msg.length[0] << 16 | msg.length[1] << 8 | msg.length[2]; - // TLS handshake message length should be equal to the record header length minus the size of the hello message - // header. - if (length + TLS_HELLO_MESSAGE_HEADER_SIZE != hdr->length) { + extensions_length = bpf_ntohs(extensions_length); + offset += EXTENSION_LENGTH_FIELD; + + if (offset + extensions_length > data_end) { return false; } - msg.version = bpf_ntohs(msg.version); - return is_valid_tls_version(msg.version) && msg.version >= hdr->version; + __u32 extensions_end = offset + extensions_length; + + return parse_tls_extensions(skb, &offset, data_end, extensions_end, tags, true); } -// is_tls checks if the given buffer is a valid TLS record header. We are -// currently checking for two types of record headers: -// - TLS Handshake record headers -// - TLS Application Data record headers -static __always_inline bool is_tls(const char *buf, __u32 buf_size, __u32 skb_len) { - if (buf_size < sizeof(tls_record_header_t)) { +// parse_server_hello parses the ServerHello message and populates tags +// Reference: RFC 5246 Section 7.4.1.2 (Server Hello), https://tools.ietf.org/html/rfc5246 +// Structure (simplified): +// handshake_type(1), length(3), version(2), random(32), session_id_length(1), session_id(variable), cipher_suite(2), compression_method(1), extensions_length(2), extensions(variable) +// After the handshake header (handshake_type + length), the ServerHello fields are: +// +------------------------+ +// | server_version (2) | +// +------------------------+ +// | random (32) | +// +------------------------+ +// | session_id_length (1) | +// | session_id (...) | +// +------------------------+ +// | cipher_suite (2) | +// +------------------------+ +// | compression_method (1) | +// +------------------------+ +// | extensions_length(2) | +// | extensions(...) | +// +------------------------+ +static __always_inline bool parse_server_hello(struct __sk_buff *skb, __u32 offset, __u32 data_end, tls_info_t *tags) { + __u32 handshake_length; + __u16 server_version; + + if (!parse_tls_handshake_header(skb, &offset, data_end, &handshake_length, &server_version)) { return false; } - // Copying struct to the stack, to avoid modifying the original buffer that will be used for other classifiers. - tls_record_header_t tls_record_header = *(tls_record_header_t *)buf; - // Converting the fields to host byte order. - tls_record_header.version = bpf_ntohs(tls_record_header.version); - tls_record_header.length = bpf_ntohs(tls_record_header.length); + // Set the version here and try to get the "real" version from the extensions if possible + // Note: In TLS 1.3, the server_version field is set to 1.2 + // The actual version is embedded in the supported_versions extension + tags->chosen_version = server_version; - // Checking the version in the record header. - if (!is_valid_tls_version(tls_record_header.version)) { + if (!skip_random_and_session_id(skb, &offset, data_end)) { return false; } - // Checking the length in the record header is not greater than the maximum payload length. - if (tls_record_header.length > TLS_MAX_PAYLOAD_LENGTH) { + // Read Cipher Suite (2 bytes) + if (offset + CIPHER_SUITES_LENGTH > data_end) { return false; } - switch (tls_record_header.content_type) { - case TLS_HANDSHAKE: - return is_tls_handshake(&tls_record_header, buf, buf_size); - case TLS_APPLICATION_DATA: - return is_valid_tls_app_data(&tls_record_header, buf_size, skb_len); + __u16 cipher_suite; + if (bpf_skb_load_bytes(skb, offset, &cipher_suite, CIPHER_SUITES_LENGTH) < 0) { + return false; + } + cipher_suite = bpf_ntohs(cipher_suite); + offset += CIPHER_SUITES_LENGTH; + + // Skip Compression Method (1 byte) + offset += COMPRESSION_METHODS_LENGTH; + + tags->cipher_suite = cipher_suite; + + // TLS 1.2 is the highest version we will see in the header. If the connection is actually a higher version (1.3), + // it must be extracted from the extensions. Lower versions (1.0, 1.1) will not have extensions. + if (tags->chosen_version != TLS_VERSION12) { + return true; + } + + if (offset + EXTENSION_LENGTH_FIELD > data_end) { + return false; + } + + // Read Extensions Length (2 bytes) + __u16 extensions_length; + if (bpf_skb_load_bytes(skb, offset, &extensions_length, EXTENSION_LENGTH_FIELD) < 0) { + return false; + } + extensions_length = bpf_ntohs(extensions_length); + offset += EXTENSION_LENGTH_FIELD; + + __u32 handshake_end = offset + handshake_length; + if (offset + extensions_length > data_end || offset + extensions_length > handshake_end) { + return false; + } + + __u32 extensions_end = offset + extensions_length; + + return parse_tls_extensions(skb, &offset, data_end, extensions_end, tags, false); +} + +// is_tls_handshake_type checks if the handshake type at the given offset matches the expected type (e.g., ClientHello or ServerHello) +// References: +// - RFC 5246 Section 7.4 (Handshake Protocol Overview), https://tools.ietf.org/html/rfc5246#section-7.4 +// The handshake_type is a single byte enumerated value. +static __always_inline bool is_tls_handshake_type(struct __sk_buff *skb, __u32 offset, __u32 data_end, __u8 expected_handshake_type) { + // The handshake type is a single byte enumerated value + if (offset + SINGLE_BYTE_LENGTH > data_end) { + return false; + } + __u8 handshake_type; + if (bpf_skb_load_bytes(skb, offset, &handshake_type, SINGLE_BYTE_LENGTH) < 0) { + return false; } - return false; + return handshake_type == expected_handshake_type; +} + +// is_tls_handshake_client_hello checks if the packet is a TLS ClientHello message +static __always_inline bool is_tls_handshake_client_hello(struct __sk_buff *skb, __u32 offset, __u32 data_end) { + return is_tls_handshake_type(skb, offset, data_end, TLS_HANDSHAKE_CLIENT_HELLO); +} + +// is_tls_handshake_server_hello checks if the packet is a TLS ServerHello message +static __always_inline bool is_tls_handshake_server_hello(struct __sk_buff *skb, __u32 offset, __u32 data_end) { + return is_tls_handshake_type(skb, offset, data_end, TLS_HANDSHAKE_SERVER_HELLO); } -#endif +#endif // __TLS_H diff --git a/pkg/network/ebpf/c/runtime/conntrack.c b/pkg/network/ebpf/c/runtime/conntrack.c index a054504439230..e7418edcd986e 100644 --- a/pkg/network/ebpf/c/runtime/conntrack.c +++ b/pkg/network/ebpf/c/runtime/conntrack.c @@ -21,6 +21,7 @@ #include "conntrack/maps.h" #include "netns.h" #include "ip.h" +#include "pid_tgid.h" #if defined(FEATURE_TCPV6_ENABLED) || defined(FEATURE_UDPV6_ENABLED) #include "ipv6.h" @@ -50,7 +51,7 @@ int BPF_BYPASSABLE_KPROBE(kprobe___nf_conntrack_hash_insert, struct nf_conn *ct) SEC("kprobe/ctnetlink_fill_info") int BPF_BYPASSABLE_KPROBE(kprobe_ctnetlink_fill_info) { - u32 pid = bpf_get_current_pid_tgid() >> 32; + u32 pid = GET_USER_MODE_PID(bpf_get_current_pid_tgid()); if (pid != systemprobe_pid()) { log_debug("skipping kprobe/ctnetlink_fill_info invocation from non-system-probe process"); return 0; diff --git a/pkg/network/ebpf/c/runtime/usm.c b/pkg/network/ebpf/c/runtime/usm.c index 3cb3f1245a3ab..d706ee7fc281b 100644 --- a/pkg/network/ebpf/c/runtime/usm.c +++ b/pkg/network/ebpf/c/runtime/usm.c @@ -13,8 +13,10 @@ #include "ipv6.h" #include "sock.h" #include "port_range.h" +#include "pid_tgid.h" #include "protocols/classification/dispatcher-helpers.h" +#include "protocols/flush.h" #include "protocols/http/buffer.h" #include "protocols/http/http.h" #include "protocols/http2/decoding.h" @@ -63,28 +65,13 @@ int BPF_BYPASSABLE_KPROBE(kprobe__tcp_sendmsg, struct sock *sk) { return 0; } -SEC("tracepoint/net/netif_receive_skb") -int tracepoint__net__netif_receive_skb(void *ctx) { - CHECK_BPF_PROGRAM_BYPASSED() - log_debug("tracepoint/net/netif_receive_skb"); - // flush batch to userspace - // because perf events can't be sent from socket filter programs - http_batch_flush(ctx); - http2_batch_flush(ctx); - terminated_http2_batch_flush(ctx); - kafka_batch_flush(ctx); - postgres_batch_flush(ctx); - redis_batch_flush(ctx); - return 0; -} - // GO TLS PROBES // func (c *Conn) Write(b []byte) (int, error) SEC("uprobe/crypto/tls.(*Conn).Write") int BPF_BYPASSABLE_UPROBE(uprobe__crypto_tls_Conn_Write) { u64 pid_tgid = bpf_get_current_pid_tgid(); - u64 pid = pid_tgid >> 32; + u64 pid = GET_USER_MODE_PID(pid_tgid); tls_offsets_data_t* od = get_offsets_data(); if (od == NULL) { log_debug("[go-tls-write] no offsets data in map for pid %llu", pid); @@ -125,7 +112,7 @@ int BPF_BYPASSABLE_UPROBE(uprobe__crypto_tls_Conn_Write) { SEC("uprobe/crypto/tls.(*Conn).Write/return") int BPF_BYPASSABLE_UPROBE(uprobe__crypto_tls_Conn_Write__return) { u64 pid_tgid = bpf_get_current_pid_tgid(); - u64 pid = pid_tgid >> 32; + u64 pid = GET_USER_MODE_PID(pid_tgid); tls_offsets_data_t* od = get_offsets_data(); if (od == NULL) { log_debug("[go-tls-write-return] no offsets data in map for pid %llu", pid); @@ -200,10 +187,10 @@ int BPF_BYPASSABLE_UPROBE(uprobe__crypto_tls_Conn_Write__return) { SEC("uprobe/crypto/tls.(*Conn).Read") int BPF_BYPASSABLE_UPROBE(uprobe__crypto_tls_Conn_Read) { u64 pid_tgid = bpf_get_current_pid_tgid(); - u64 pid = pid_tgid >> 32; + u64 pid = GET_USER_MODE_PID(pid_tgid); tls_offsets_data_t* od = get_offsets_data(); if (od == NULL) { - log_debug("[go-tls-read] no offsets data in map for pid %llu", pid_tgid >> 32); + log_debug("[go-tls-read] no offsets data in map for pid %llu", pid); return 0; } @@ -211,7 +198,7 @@ int BPF_BYPASSABLE_UPROBE(uprobe__crypto_tls_Conn_Read) { go_tls_function_args_key_t call_key = {0}; call_key.pid = pid; if (read_goroutine_id(ctx, &od->goroutine_id, &call_key.goroutine_id)) { - log_debug("[go-tls-read] failed reading go routine id for pid %llu", pid_tgid >> 32); + log_debug("[go-tls-read] failed reading go routine id for pid %llu", pid); return 0; } @@ -219,11 +206,11 @@ int BPF_BYPASSABLE_UPROBE(uprobe__crypto_tls_Conn_Read) { // (since the parameters might not be live by the time the return probe is hit). go_tls_read_args_data_t call_data = {0}; if (read_location(ctx, &od->read_conn_pointer, sizeof(call_data.conn_pointer), &call_data.conn_pointer)) { - log_debug("[go-tls-read] failed reading conn pointer for pid %llu", pid_tgid >> 32); + log_debug("[go-tls-read] failed reading conn pointer for pid %llu", pid); return 0; } if (read_location(ctx, &od->read_buffer.ptr, sizeof(call_data.b_data), &call_data.b_data)) { - log_debug("[go-tls-read] failed reading buffer pointer for pid %llu", pid_tgid >> 32); + log_debug("[go-tls-read] failed reading buffer pointer for pid %llu", pid); return 0; } @@ -235,7 +222,7 @@ int BPF_BYPASSABLE_UPROBE(uprobe__crypto_tls_Conn_Read) { SEC("uprobe/crypto/tls.(*Conn).Read/return") int BPF_BYPASSABLE_UPROBE(uprobe__crypto_tls_Conn_Read__return) { u64 pid_tgid = bpf_get_current_pid_tgid(); - u64 pid = pid_tgid >> 32; + u64 pid = GET_USER_MODE_PID(pid_tgid); tls_offsets_data_t* od = get_offsets_data(); if (od == NULL) { log_debug("[go-tls-read-return] no offsets data in map for pid %llu", pid); @@ -305,13 +292,13 @@ int BPF_BYPASSABLE_UPROBE(uprobe__crypto_tls_Conn_Close) { u64 pid_tgid = bpf_get_current_pid_tgid(); tls_offsets_data_t* od = get_offsets_data(); if (od == NULL) { - log_debug("[go-tls-close] no offsets data in map for pid %llu", pid_tgid >> 32); + log_debug("[go-tls-close] no offsets data in map for pid %llu", GET_USER_MODE_PID(pid_tgid)); return 0; } // Read the PID and goroutine ID to make the partial call key go_tls_function_args_key_t call_key = {0}; - call_key.pid = pid_tgid >> 32; + call_key.pid = GET_USER_MODE_PID(pid_tgid); if (read_goroutine_id(ctx, &od->goroutine_id, &call_key.goroutine_id) == 0) { bpf_map_delete_elem(&go_tls_read_args, &call_key); bpf_map_delete_elem(&go_tls_write_args, &call_key); @@ -319,13 +306,13 @@ int BPF_BYPASSABLE_UPROBE(uprobe__crypto_tls_Conn_Close) { void* conn_pointer = NULL; if (read_location(ctx, &od->close_conn_pointer, sizeof(conn_pointer), &conn_pointer)) { - log_debug("[go-tls-close] failed reading close conn pointer for pid %llu", pid_tgid >> 32); + log_debug("[go-tls-close] failed reading close conn pointer for pid %llu", GET_USER_MODE_PID(pid_tgid)); return 0; } conn_tuple_t* t = conn_tup_from_tls_conn(od, conn_pointer, pid_tgid); if (t == NULL) { - log_debug("[go-tls-close] failed getting conn tup from tls conn for pid %llu", pid_tgid >> 32); + log_debug("[go-tls-close] failed getting conn tup from tls conn for pid %llu", GET_USER_MODE_PID(pid_tgid)); return 0; } diff --git a/pkg/network/ebpf/c/shared-libraries/maps.h b/pkg/network/ebpf/c/shared-libraries/maps.h index ec0112536462a..f1d8f34d854f4 100644 --- a/pkg/network/ebpf/c/shared-libraries/maps.h +++ b/pkg/network/ebpf/c/shared-libraries/maps.h @@ -4,7 +4,9 @@ #include "shared-libraries/types.h" #include "map-defs.h" -BPF_LRU_MAP(open_at_args, __u64, lib_path_t, 1024) +// This map is used with 3 different probes, each can be called up to 1024 times each. +// Thus we need to have a map that can store 1024*3 entries. I'm using a larger map to be safe. +BPF_HASH_MAP(open_at_args, __u64, lib_path_t, 10240) /* * These maps are used for notifying userspace of a shared library being loaded diff --git a/pkg/network/ebpf/c/shared-libraries/probes.h b/pkg/network/ebpf/c/shared-libraries/probes.h index 7a71650cdba5e..de2db6d9af5f3 100644 --- a/pkg/network/ebpf/c/shared-libraries/probes.h +++ b/pkg/network/ebpf/c/shared-libraries/probes.h @@ -4,6 +4,7 @@ #include "bpf_telemetry.h" #include "bpf_bypass.h" +#include "pid_tgid.h" #include "shared-libraries/types.h" static __always_inline void fill_path_safe(lib_path_t *path, const char *path_argument) { @@ -23,10 +24,9 @@ static __always_inline void do_sys_open_helper_enter(const char *filename) { // Find the null character and clean up the garbage following it #pragma unroll for (int i = 0; i < LIB_PATH_MAX_SIZE; i++) { - if (path.len) { - path.buf[i] = 0; - } else if (path.buf[i] == 0) { + if (path.buf[i] == 0) { path.len = i; + break; } } } else { @@ -39,7 +39,7 @@ static __always_inline void do_sys_open_helper_enter(const char *filename) { } u64 pid_tgid = bpf_get_current_pid_tgid(); - path.pid = pid_tgid >> 32; + path.pid = GET_USER_MODE_PID(pid_tgid); bpf_map_update_with_telemetry(open_at_args, &pid_tgid, &path, BPF_ANY); return; } @@ -102,9 +102,24 @@ static __always_inline void do_sys_open_helper_exit(exit_sys_ctx *args) { return; } +// This definition is the same for all architectures. +#ifndef O_WRONLY +#define O_WRONLY 00000001 +#endif + +static __always_inline int should_ignore_flags(int flags) +{ + return flags & O_WRONLY; +} + SEC("tracepoint/syscalls/sys_enter_open") int tracepoint__syscalls__sys_enter_open(enter_sys_open_ctx *args) { CHECK_BPF_PROGRAM_BYPASSED() + + if (should_ignore_flags(args->flags)) { + return 0; + } + do_sys_open_helper_enter(args->filename); return 0; } @@ -119,6 +134,11 @@ int tracepoint__syscalls__sys_exit_open(exit_sys_ctx *args) { SEC("tracepoint/syscalls/sys_enter_openat") int tracepoint__syscalls__sys_enter_openat(enter_sys_openat_ctx *args) { CHECK_BPF_PROGRAM_BYPASSED() + + if (should_ignore_flags(args->flags)) { + return 0; + } + do_sys_open_helper_enter(args->filename); return 0; } @@ -133,6 +153,8 @@ int tracepoint__syscalls__sys_exit_openat(exit_sys_ctx *args) { SEC("tracepoint/syscalls/sys_enter_openat2") int tracepoint__syscalls__sys_enter_openat2(enter_sys_openat2_ctx *args) { CHECK_BPF_PROGRAM_BYPASSED() + // Unlike the other variants, openat2(2) has the flags embedded inside the + // how argument; we don't bother trying to accessing it for now. do_sys_open_helper_enter(args->filename); return 0; } diff --git a/pkg/network/ebpf/c/shared-libraries/types.h b/pkg/network/ebpf/c/shared-libraries/types.h index 3a4fe97bbc88e..ea2159d5d07eb 100644 --- a/pkg/network/ebpf/c/shared-libraries/types.h +++ b/pkg/network/ebpf/c/shared-libraries/types.h @@ -4,7 +4,7 @@ #include "ktypes.h" #define LIB_SO_SUFFIX_SIZE 9 -#define LIB_PATH_MAX_SIZE 120 +#define LIB_PATH_MAX_SIZE 220 typedef struct { __u32 pid; diff --git a/pkg/network/ebpf/c/sock.h b/pkg/network/ebpf/c/sock.h index c71e48a544f1d..997acc13edef6 100644 --- a/pkg/network/ebpf/c/sock.h +++ b/pkg/network/ebpf/c/sock.h @@ -8,6 +8,7 @@ #include "ip.h" #include "ipv6.h" #include "netns.h" +#include "pid_tgid.h" #ifdef COMPILE_CORE @@ -178,7 +179,7 @@ static __always_inline u16 _sk_family(struct sock *skp) { */ static __always_inline int read_conn_tuple_partial(conn_tuple_t* t, struct sock* skp, u64 pid_tgid, metadata_mask_t type) { int err = 0; - t->pid = pid_tgid >> 32; + t->pid = GET_USER_MODE_PID(pid_tgid); t->metadata = type; // Retrieve network namespace id first since addresses and ports may not be available for unconnected UDP diff --git a/pkg/network/ebpf/c/tracer.c b/pkg/network/ebpf/c/tracer.c index 8de25a2a37e6b..5ff4ffa95f18b 100644 --- a/pkg/network/ebpf/c/tracer.c +++ b/pkg/network/ebpf/c/tracer.c @@ -19,6 +19,7 @@ #include "tracer/port.h" #include "tracer/tcp_recv.h" #include "protocols/classification/protocol-classification.h" +#include "pid_tgid.h" __maybe_unused static __always_inline bool tcp_failed_connections_enabled() { __u64 val = 0; @@ -32,6 +33,18 @@ int socket__classifier_entry(struct __sk_buff *skb) { return 0; } +SEC("socket/classifier_tls_handshake_client") +int socket__classifier_tls_handshake_client(struct __sk_buff *skb) { + protocol_classifier_entrypoint_tls_handshake_client(skb); + return 0; +} + +SEC("socket/classifier_tls_handshake_server") +int socket__classifier_tls_handshake_server(struct __sk_buff *skb) { + protocol_classifier_entrypoint_tls_handshake_server(skb); + return 0; +} + SEC("socket/classifier_queues") int socket__classifier_queues(struct __sk_buff *skb) { protocol_classifier_entrypoint_queues(skb); @@ -226,7 +239,7 @@ int BPF_BYPASSABLE_KPROBE(kprobe__tcp_done, struct sock *sk) { pid_ts_t *failed_conn_pid = bpf_map_lookup_elem(&tcp_ongoing_connect_pid, &skp_conn); if (failed_conn_pid) { bpf_map_delete_elem(&tcp_ongoing_connect_pid, &skp_conn); - t.pid = failed_conn_pid->pid_tgid >> 32; + t.pid = GET_USER_MODE_PID(failed_conn_pid->pid_tgid); } else { increment_telemetry_count(tcp_done_missing_pid); return 0; @@ -256,7 +269,7 @@ int BPF_BYPASSABLE_KPROBE(kprobe__tcp_close, struct sock *sk) { u64 pid_tgid = bpf_get_current_pid_tgid(); // Get network namespace id - log_debug("kprobe/tcp_close: tgid: %llu, pid: %llu", pid_tgid >> 32, pid_tgid & 0xFFFFFFFF); + log_debug("kprobe/tcp_close: kernel thread id: %llu, user mode pid: %llu", GET_KERNEL_THREAD_ID(pid_tgid), GET_USER_MODE_PID(pid_tgid)); if (!read_conn_tuple(&t, sk, pid_tgid, CONN_TYPE_TCP)) { return 0; } @@ -734,7 +747,7 @@ int BPF_BYPASSABLE_KRETPROBE(kretprobe__udpv6_recvmsg) { static __always_inline int handle_ret_udp_recvmsg_pre_4_7_0(int copied, void *udp_sock_map) { u64 pid_tgid = bpf_get_current_pid_tgid(); - log_debug("kretprobe/udp_recvmsg: tgid: %llu, pid: %llu", pid_tgid >> 32, pid_tgid & 0xFFFFFFFF); + log_debug("kretprobe/udp_recvmsg: kernel thread id: %llu, user mode pid: %llu", GET_KERNEL_THREAD_ID(pid_tgid), GET_USER_MODE_PID(pid_tgid)); // Retrieve socket pointer from kprobe via pid/tgid udp_recv_sock_t *st = bpf_map_lookup_elem(udp_sock_map, &pid_tgid); @@ -886,18 +899,18 @@ int BPF_BYPASSABLE_KPROBE(kprobe__tcp_retransmit_skb_pre_4_7_0, struct sock *sk) SEC("kretprobe/tcp_retransmit_skb") int BPF_BYPASSABLE_KRETPROBE(kretprobe__tcp_retransmit_skb, int ret) { - __u64 tid = bpf_get_current_pid_tgid(); + __u64 pid_tgid = bpf_get_current_pid_tgid(); if (ret < 0) { - bpf_map_delete_elem(&pending_tcp_retransmit_skb, &tid); + bpf_map_delete_elem(&pending_tcp_retransmit_skb, &pid_tgid); return 0; } - tcp_retransmit_skb_args_t *args = bpf_map_lookup_elem(&pending_tcp_retransmit_skb, &tid); + tcp_retransmit_skb_args_t *args = bpf_map_lookup_elem(&pending_tcp_retransmit_skb, &pid_tgid); if (args == NULL) { return 0; } struct sock *sk = args->sk; int segs = args->segs; - bpf_map_delete_elem(&pending_tcp_retransmit_skb, &tid); + bpf_map_delete_elem(&pending_tcp_retransmit_skb, &pid_tgid); log_debug("kretprobe/tcp_retransmit: segs: %d", segs); return handle_retransmit(sk, segs); } @@ -908,30 +921,30 @@ int BPF_BYPASSABLE_KRETPROBE(kretprobe__tcp_retransmit_skb, int ret) { SEC("kprobe/tcp_retransmit_skb") int BPF_BYPASSABLE_KPROBE(kprobe__tcp_retransmit_skb, struct sock *sk) { - u64 tid = bpf_get_current_pid_tgid(); + u64 pid_tgid = bpf_get_current_pid_tgid(); tcp_retransmit_skb_args_t args = {}; args.sk = sk; args.segs = 0; BPF_CORE_READ_INTO(&args.retrans_out_pre, tcp_sk(sk), retrans_out); - bpf_map_update_with_telemetry(pending_tcp_retransmit_skb, &tid, &args, BPF_ANY); + bpf_map_update_with_telemetry(pending_tcp_retransmit_skb, &pid_tgid, &args, BPF_ANY); return 0; } SEC("kretprobe/tcp_retransmit_skb") int BPF_BYPASSABLE_KRETPROBE(kretprobe__tcp_retransmit_skb, int rc) { log_debug("kretprobe/tcp_retransmit"); - u64 tid = bpf_get_current_pid_tgid(); + u64 pid_tgid = bpf_get_current_pid_tgid(); if (rc < 0) { - bpf_map_delete_elem(&pending_tcp_retransmit_skb, &tid); + bpf_map_delete_elem(&pending_tcp_retransmit_skb, &pid_tgid); return 0; } - tcp_retransmit_skb_args_t *args = bpf_map_lookup_elem(&pending_tcp_retransmit_skb, &tid); + tcp_retransmit_skb_args_t *args = bpf_map_lookup_elem(&pending_tcp_retransmit_skb, &pid_tgid); if (args == NULL) { return 0; } struct sock *sk = args->sk; u32 retrans_out_pre = args->retrans_out_pre; - bpf_map_delete_elem(&pending_tcp_retransmit_skb, &tid); + bpf_map_delete_elem(&pending_tcp_retransmit_skb, &pid_tgid); u32 retrans_out = 0; BPF_CORE_READ_INTO(&retrans_out, tcp_sk(sk), retrans_out); return handle_retransmit(sk, retrans_out - retrans_out_pre); @@ -942,7 +955,7 @@ int BPF_BYPASSABLE_KRETPROBE(kretprobe__tcp_retransmit_skb, int rc) { SEC("kprobe/tcp_connect") int BPF_BYPASSABLE_KPROBE(kprobe__tcp_connect, struct sock *skp) { u64 pid_tgid = bpf_get_current_pid_tgid(); - log_debug("kprobe/tcp_connect: tgid: %llu, pid: %llu", pid_tgid >> 32, pid_tgid & 0xFFFFFFFF); + log_debug("kprobe/tcp_connect: kernel thread id: %llu, user mode pid: %llu", GET_KERNEL_THREAD_ID(pid_tgid), GET_USER_MODE_PID(pid_tgid)); conn_tuple_t t = {}; if (!read_conn_tuple(&t, skp, 0, CONN_TYPE_TCP)) { @@ -971,8 +984,8 @@ int BPF_BYPASSABLE_KPROBE(kprobe__tcp_finish_connect, struct sock *skp) { } u64 pid_tgid = pid_tgid_p->pid_tgid; - t.pid = pid_tgid >> 32; - log_debug("kprobe/tcp_finish_connect: tgid: %llu, pid: %llu", pid_tgid >> 32, pid_tgid & 0xFFFFFFFF); + t.pid = GET_USER_MODE_PID(pid_tgid); + log_debug("kprobe/tcp_finish_connect: kernel thread id: %llu, user mode pid: %llu", GET_KERNEL_THREAD_ID(pid_tgid), GET_USER_MODE_PID(pid_tgid)); handle_tcp_stats(&t, skp, TCP_ESTABLISHED); handle_message(&t, 0, 0, CONN_DIRECTION_OUTGOING, 0, 0, PACKET_COUNT_NONE, skp); @@ -989,7 +1002,7 @@ int BPF_BYPASSABLE_KRETPROBE(kretprobe__inet_csk_accept, struct sock *sk) { } u64 pid_tgid = bpf_get_current_pid_tgid(); - log_debug("kretprobe/inet_csk_accept: tgid: %llu, pid: %llu", pid_tgid >> 32, pid_tgid & 0xFFFFFFFF); + log_debug("kretprobe/inet_csk_accept: kernel thread id: %llu, user mode pid: %llu", GET_KERNEL_THREAD_ID(pid_tgid), GET_USER_MODE_PID(pid_tgid)); conn_tuple_t t = {}; if (!read_conn_tuple(&t, sk, pid_tgid, CONN_TYPE_TCP)) { diff --git a/pkg/network/ebpf/c/tracer/bind.h b/pkg/network/ebpf/c/tracer/bind.h index 67a01a2da4f4c..cc8c3dd99e5cc 100644 --- a/pkg/network/ebpf/c/tracer/bind.h +++ b/pkg/network/ebpf/c/tracer/bind.h @@ -1,6 +1,7 @@ #ifndef __TRACER_BIND_H #define __TRACER_BIND_H +#include "pid_tgid.h" #include "tracer/tracer.h" #include "tracer/maps.h" #include "tracer/port.h" @@ -19,7 +20,7 @@ static __always_inline u16 sockaddr_sin_port(struct sockaddr *addr) { } static __always_inline int sys_enter_bind(struct socket *sock, struct sockaddr *addr) { - __u64 tid = bpf_get_current_pid_tgid(); + __u64 pid_tgid = bpf_get_current_pid_tgid(); __u16 type = 0; bpf_probe_read_kernel_with_telemetry(&type, sizeof(__u16), &sock->type); @@ -28,7 +29,7 @@ static __always_inline int sys_enter_bind(struct socket *sock, struct sockaddr * } if (addr == NULL) { - log_debug("sys_enter_bind: could not read sockaddr, sock=%p, tid=%llu", sock, tid); + log_debug("sys_enter_bind: could not read sockaddr, sock=%p, pid_tgid=%llu", sock, pid_tgid); return 0; } @@ -49,19 +50,19 @@ static __always_inline int sys_enter_bind(struct socket *sock, struct sockaddr * args.addr = addr; - bpf_map_update_with_telemetry(pending_bind, &tid, &args, BPF_ANY); - log_debug("sys_enter_bind: started a bind on UDP sock=%p tid=%llu", sock, tid); + bpf_map_update_with_telemetry(pending_bind, &pid_tgid, &args, BPF_ANY); + log_debug("sys_enter_bind: started a bind on UDP sock=%p pid_tgid=%llu", sock, pid_tgid); return 0; } static __always_inline int sys_exit_bind(__s64 ret) { - __u64 tid = bpf_get_current_pid_tgid(); + __u64 pid_tgid = bpf_get_current_pid_tgid(); // bail if this bind() is not the one we're instrumenting - bind_syscall_args_t *args = bpf_map_lookup_elem(&pending_bind, &tid); + bind_syscall_args_t *args = bpf_map_lookup_elem(&pending_bind, &pid_tgid); - log_debug("sys_exit_bind: tid=%llu, ret=%lld", tid, ret); + log_debug("sys_exit_bind: pid_tgid=%llu, ret=%lld", pid_tgid, ret); if (args == NULL) { log_debug("sys_exit_bind: was not a UDP bind, will not process"); @@ -70,7 +71,7 @@ static __always_inline int sys_exit_bind(__s64 ret) { struct sock * sk = args->sk; struct sockaddr *addr = args->addr; - bpf_map_delete_elem(&pending_bind, &tid); + bpf_map_delete_elem(&pending_bind, &pid_tgid); if (ret != 0) { return 0; diff --git a/pkg/network/ebpf/c/tracer/events.h b/pkg/network/ebpf/c/tracer/events.h index 1de94d755b1f3..85f8ed48e1bab 100644 --- a/pkg/network/ebpf/c/tracer/events.h +++ b/pkg/network/ebpf/c/tracer/events.h @@ -23,6 +23,7 @@ static __always_inline void clean_protocol_classification(conn_tuple_t *tup) { conn_tuple.netns = 0; normalize_tuple(&conn_tuple); delete_protocol_stack(&conn_tuple, NULL, FLAG_TCP_CLOSE_DELETION); + bpf_map_delete_elem(&tls_enhanced_tags, &conn_tuple); conn_tuple_t *skb_tup_ptr = bpf_map_lookup_elem(&conn_tuple_to_socket_skb_conn_tuple, &conn_tuple); if (skb_tup_ptr == NULL) { @@ -31,6 +32,7 @@ static __always_inline void clean_protocol_classification(conn_tuple_t *tup) { conn_tuple_t skb_tup = *skb_tup_ptr; delete_protocol_stack(&skb_tup, NULL, FLAG_TCP_CLOSE_DELETION); + bpf_map_delete_elem(&tls_enhanced_tags, &skb_tup); bpf_map_delete_elem(&conn_tuple_to_socket_skb_conn_tuple, &conn_tuple); } diff --git a/pkg/network/ebpf/c/tracer/maps.h b/pkg/network/ebpf/c/tracer/maps.h index e6123782f8ea5..0141a970d1e5e 100644 --- a/pkg/network/ebpf/c/tracer/maps.h +++ b/pkg/network/ebpf/c/tracer/maps.h @@ -132,4 +132,7 @@ BPF_HASH_MAP(tcp_close_args, __u64, conn_tuple_t, 1024) // by using tail call. BPF_PROG_ARRAY(tcp_close_progs, 1) +// Map to store extra information about TLS connections like version, cipher, etc. +BPF_HASH_MAP(tls_enhanced_tags, conn_tuple_t, tls_info_wrapper_t, 0) + #endif diff --git a/pkg/network/ebpf/c/tracer/stats.h b/pkg/network/ebpf/c/tracer/stats.h index b05811c86190a..ca1d6d19e309e 100644 --- a/pkg/network/ebpf/c/tracer/stats.h +++ b/pkg/network/ebpf/c/tracer/stats.h @@ -16,12 +16,62 @@ #include "protocols/tls/tags-types.h" #include "ip.h" #include "skb.h" +#include "pid_tgid.h" #ifdef COMPILE_PREBUILT static __always_inline __u64 offset_rtt(); static __always_inline __u64 offset_rtt_var(); #endif +static __always_inline tls_info_t* get_tls_enhanced_tags(conn_tuple_t* tuple) { + conn_tuple_t normalized_tup = *tuple; + normalize_tuple(&normalized_tup); + tls_info_wrapper_t *wrapper = bpf_map_lookup_elem(&tls_enhanced_tags, &normalized_tup); + if (!wrapper) { + return NULL; + } + wrapper->updated = bpf_ktime_get_ns(); + return &wrapper->info; +} + +static __always_inline tls_info_t* get_or_create_tls_enhanced_tags(conn_tuple_t *tuple) { + tls_info_t *tags = get_tls_enhanced_tags(tuple); + if (!tags) { + conn_tuple_t normalized_tup = *tuple; + normalize_tuple(&normalized_tup); + tls_info_wrapper_t empty_tags_wrapper = {}; + empty_tags_wrapper.updated = bpf_ktime_get_ns(); + + bpf_map_update_with_telemetry(tls_enhanced_tags, &normalized_tup, &empty_tags_wrapper, BPF_ANY); + tls_info_wrapper_t *wrapper_ptr = bpf_map_lookup_elem(&tls_enhanced_tags, &normalized_tup); + if (!wrapper_ptr) { + return NULL; + } + tags = &wrapper_ptr->info; + } + return tags; +} + +// merge_tls_info modifies `this` by merging it with `that` +static __always_inline void merge_tls_info(tls_info_t *this, tls_info_t *that) { + if (!this || !that) { + return; + } + + // Merge chosen_version if not already set + if (this->chosen_version == 0 && that->chosen_version != 0) { + this->chosen_version = that->chosen_version; + } + + // Merge cipher_suite if not already set + if (this->cipher_suite == 0 && that->cipher_suite != 0) { + this->cipher_suite = that->cipher_suite; + } + + // Merge offered_versions bitmask + this->offered_versions |= that->offered_versions; +} + static __always_inline conn_stats_ts_t *get_conn_stats(conn_tuple_t *t, struct sock *sk) { conn_stats_ts_t *cs = bpf_map_lookup_elem(&conn_stats, t); if (cs) { @@ -111,6 +161,9 @@ static __always_inline void update_protocol_classification_information(conn_tupl mark_protocol_direction(t, &conn_tuple_copy, protocol_stack); merge_protocol_stacks(&stats->protocol_stack, protocol_stack); + tls_info_t *tls_tags = get_tls_enhanced_tags(&conn_tuple_copy); + merge_tls_info(&stats->tls_tags, tls_tags); + conn_tuple_t *cached_skb_conn_tup_ptr = bpf_map_lookup_elem(&conn_tuple_to_socket_skb_conn_tuple, &conn_tuple_copy); if (!cached_skb_conn_tup_ptr) { return; @@ -123,6 +176,9 @@ static __always_inline void update_protocol_classification_information(conn_tupl set_protocol_flag(protocol_stack, FLAG_NPM_ENABLED); mark_protocol_direction(t, &conn_tuple_copy, protocol_stack); merge_protocol_stacks(&stats->protocol_stack, protocol_stack); + + tls_tags = get_tls_enhanced_tags(&conn_tuple_copy); + merge_tls_info(&stats->tls_tags, tls_tags); } static __always_inline void determine_connection_direction(conn_tuple_t *t, conn_stats_ts_t *conn_stats) { @@ -286,7 +342,7 @@ static __always_inline int handle_skb_consume_udp(struct sock *sk, struct sk_buf flip_tuple(&t); log_debug("skb_consume_udp: bytes=%d", data_len); - t.pid = pid_tgid >> 32; + t.pid = GET_USER_MODE_PID(pid_tgid); t.netns = get_netns_from_sock(sk); return handle_message(&t, 0, data_len, CONN_DIRECTION_UNKNOWN, 0, 1, PACKET_COUNT_INCREMENT, sk); } diff --git a/pkg/network/ebpf/c/tracer/tracer.h b/pkg/network/ebpf/c/tracer/tracer.h index d688359dc9d79..c23c98b189162 100644 --- a/pkg/network/ebpf/c/tracer/tracer.h +++ b/pkg/network/ebpf/c/tracer/tracer.h @@ -29,6 +29,17 @@ typedef enum { #define CONN_DIRECTION_MASK 0b11 +typedef struct { + __u16 chosen_version; + __u16 cipher_suite; + __u8 offered_versions; +} tls_info_t; + +typedef struct { + tls_info_t info; + __u64 updated; +} tls_info_wrapper_t; + typedef struct { __u64 sent_bytes; __u64 recv_bytes; @@ -54,6 +65,7 @@ typedef struct { protocol_stack_t protocol_stack; __u8 flags; __u8 direction; + tls_info_t tls_tags; } conn_stats_ts_t; // Connection flags diff --git a/pkg/network/ebpf/kprobe_types.go b/pkg/network/ebpf/kprobe_types.go index 90d7eb1f331ae..ab5f569a9c3ec 100644 --- a/pkg/network/ebpf/kprobe_types.go +++ b/pkg/network/ebpf/kprobe_types.go @@ -30,6 +30,8 @@ type UDPRecvSock C.udp_recv_sock_t type BindSyscallArgs C.bind_syscall_args_t type ProtocolStack C.protocol_stack_t type ProtocolStackWrapper C.protocol_stack_wrapper_t +type TLSTags C.tls_info_t +type TLSTagsWrapper C.tls_info_wrapper_t // udp_recv_sock_t have *sock and *msghdr struct members, we make them opaque here type _Ctype_struct_sock uint64 @@ -63,7 +65,9 @@ const SizeofConn = C.sizeof_conn_t type ClassificationProgram = uint32 const ( - ClassificationQueues ClassificationProgram = C.CLASSIFICATION_QUEUES_PROG - ClassificationDBs ClassificationProgram = C.CLASSIFICATION_DBS_PROG - ClassificationGRPC ClassificationProgram = C.CLASSIFICATION_GRPC_PROG + ClassificationTLSClient ClassificationProgram = C.CLASSIFICATION_TLS_CLIENT_PROG + ClassificationTLSServer ClassificationProgram = C.CLASSIFICATION_TLS_SERVER_PROG + ClassificationQueues ClassificationProgram = C.CLASSIFICATION_QUEUES_PROG + ClassificationDBs ClassificationProgram = C.CLASSIFICATION_DBS_PROG + ClassificationGRPC ClassificationProgram = C.CLASSIFICATION_GRPC_PROG ) diff --git a/pkg/network/ebpf/kprobe_types_linux.go b/pkg/network/ebpf/kprobe_types_linux.go index bf9bbf38210f3..2953275bd5bfb 100644 --- a/pkg/network/ebpf/kprobe_types_linux.go +++ b/pkg/network/ebpf/kprobe_types_linux.go @@ -32,7 +32,7 @@ type ConnStats struct { Protocol_stack ProtocolStack Flags uint8 Direction uint8 - Pad_cgo_0 [6]byte + Tls_tags TLSTags } type Conn struct { Tup ConnTuple @@ -103,6 +103,16 @@ type ProtocolStackWrapper struct { Stack ProtocolStack Updated uint64 } +type TLSTags struct { + Chosen_version uint16 + Cipher_suite uint16 + Offered_versions uint8 + Pad_cgo_0 [1]byte +} +type TLSTagsWrapper struct { + Info TLSTags + Updated uint64 +} type _Ctype_struct_sock uint64 type _Ctype_struct_msghdr uint64 @@ -135,7 +145,9 @@ const SizeofConn = 0x78 type ClassificationProgram = uint32 const ( - ClassificationQueues ClassificationProgram = 0x2 - ClassificationDBs ClassificationProgram = 0x3 - ClassificationGRPC ClassificationProgram = 0x5 + ClassificationTLSClient ClassificationProgram = 0x7 + ClassificationTLSServer ClassificationProgram = 0x8 + ClassificationQueues ClassificationProgram = 0x2 + ClassificationDBs ClassificationProgram = 0x3 + ClassificationGRPC ClassificationProgram = 0x5 ) diff --git a/pkg/network/ebpf/probes/probes.go b/pkg/network/ebpf/probes/probes.go index cd72ca3ba1fe9..1f983ed25b691 100644 --- a/pkg/network/ebpf/probes/probes.go +++ b/pkg/network/ebpf/probes/probes.go @@ -27,6 +27,10 @@ const ( // ProtocolClassifierEntrySocketFilter runs a classifier algorithm as a socket filter ProtocolClassifierEntrySocketFilter ProbeFuncName = "socket__classifier_entry" + // ProtocolClassifierTLSClientSocketFilter runs classification rules for the TLS client hello packet + ProtocolClassifierTLSClientSocketFilter ProbeFuncName = "socket__classifier_tls_handshake_client" + // ProtocolClassifierTLSServerSocketFilter runs classification rules for the TLS server hello packet + ProtocolClassifierTLSServerSocketFilter ProbeFuncName = "socket__classifier_tls_handshake_server" // ProtocolClassifierQueuesSocketFilter runs a classification rules for Queue protocols. ProtocolClassifierQueuesSocketFilter ProbeFuncName = "socket__classifier_queues" // ProtocolClassifierDBsSocketFilter runs a classification rules for DB protocols. @@ -232,6 +236,8 @@ const ( ConnectionProtocolMap BPFMapName = "connection_protocol" // ConnectionTupleToSocketSKBConnMap is the map storing the connection tuple to socket skb conn tuple ConnectionTupleToSocketSKBConnMap BPFMapName = "conn_tuple_to_socket_skb_conn_tuple" + // EnhancedTLSTagsMap is the map storing additional tags for TLS connections (version, cipher, etc.) + EnhancedTLSTagsMap BPFMapName = "tls_enhanced_tags" // ClassificationProgsMap is the map storing the programs to run on classification events ClassificationProgsMap BPFMapName = "classification_progs" // TCPCloseProgsMap is the map storing the programs to run on TCP close events diff --git a/pkg/network/encoding/encoding_test.go b/pkg/network/encoding/encoding_test.go index e0d0eacfde10c..416642c484d6a 100644 --- a/pkg/network/encoding/encoding_test.go +++ b/pkg/network/encoding/encoding_test.go @@ -29,6 +29,7 @@ import ( "github.com/DataDog/datadog-agent/pkg/network/protocols/http" "github.com/DataDog/datadog-agent/pkg/network/protocols/kafka" "github.com/DataDog/datadog-agent/pkg/network/protocols/telemetry" + "github.com/DataDog/datadog-agent/pkg/network/protocols/tls" "github.com/DataDog/datadog-agent/pkg/process/util" ) @@ -192,14 +193,15 @@ func TestSerialization(t *testing.T) { BufferedData: network.BufferedData{ Conns: []network.ConnectionStats{ {ConnectionTuple: network.ConnectionTuple{ - Source: util.AddressFromString("10.1.1.1"), - Dest: util.AddressFromString("10.2.2.2"), - Pid: 6000, - NetNS: 7, - SPort: 1000, - DPort: 9000, - Type: network.TCP, - Family: network.AFINET6, + Source: util.AddressFromString("10.1.1.1"), + Dest: util.AddressFromString("10.2.2.2"), + Pid: 6000, + NetNS: 7, + SPort: 1000, + DPort: 9000, + Type: network.TCP, + Family: network.AFINET6, + Direction: network.LOCAL, }, Monotonic: network.StatCounters{ SentBytes: 1, @@ -222,25 +224,26 @@ func TestSerialization(t *testing.T) { ReplDstPort: 80, }, - Direction: network.LOCAL, Via: &network.Via{ Subnet: network.Subnet{ Alias: "subnet-foo", }, }, ProtocolStack: protocols.Stack{Application: protocols.HTTP}, + TLSTags: tls.Tags{ChosenVersion: 0, CipherSuite: 0, OfferedVersions: 0}, }, {ConnectionTuple: network.ConnectionTuple{ - Source: util.AddressFromString("10.1.1.1"), - Dest: util.AddressFromString("8.8.8.8"), - SPort: 1000, - DPort: 53, - Type: network.UDP, - Family: network.AFINET6, + Source: util.AddressFromString("10.1.1.1"), + Dest: util.AddressFromString("8.8.8.8"), + SPort: 1000, + DPort: 53, + Type: network.UDP, + Family: network.AFINET6, + Direction: network.LOCAL, }, - Direction: network.LOCAL, StaticTags: tagOpenSSL | tagTLS, ProtocolStack: protocols.Stack{Application: protocols.HTTP2}, + TLSTags: tls.Tags{ChosenVersion: 0, CipherSuite: 0, OfferedVersions: 0}, DNSStats: map[dns.Hostname]map[dns.QueryType]dns.Stats{ dns.ToHostname("foo.com"): { dns.TypeA: { diff --git a/pkg/network/encoding/marshal/dns_test.go b/pkg/network/encoding/marshal/dns_test.go index e1ffed438d9dc..24852d91f722e 100644 --- a/pkg/network/encoding/marshal/dns_test.go +++ b/pkg/network/encoding/marshal/dns_test.go @@ -27,14 +27,14 @@ func TestFormatConnectionDNS(t *testing.T) { BufferedData: network.BufferedData{ Conns: []network.ConnectionStats{ {ConnectionTuple: network.ConnectionTuple{ - Source: util.AddressFromString("10.1.1.1"), - Dest: util.AddressFromString("8.8.8.8"), - SPort: 1000, - DPort: 53, - Type: network.UDP, - Family: network.AFINET6, - }, + Source: util.AddressFromString("10.1.1.1"), + Dest: util.AddressFromString("8.8.8.8"), + SPort: 1000, + DPort: 53, + Type: network.UDP, + Family: network.AFINET6, Direction: network.LOCAL, + }, DNSStats: map[dns.Hostname]map[dns.QueryType]dns.Stats{ dns.ToHostname("foo.com"): { dns.TypeA: { diff --git a/pkg/network/encoding/marshal/format.go b/pkg/network/encoding/marshal/format.go index 99cf5c4c75694..2e0d40955191a 100644 --- a/pkg/network/encoding/marshal/format.go +++ b/pkg/network/encoding/marshal/format.go @@ -120,9 +120,10 @@ func FormatConnection(builder *model.ConnectionBuilder, conn network.ConnectionS httpStaticTags, httpDynamicTags := httpEncoder.GetHTTPAggregationsAndTags(conn, builder) http2StaticTags, http2DynamicTags := http2Encoder.WriteHTTP2AggregationsAndTags(conn, builder) + tlsDynamicTags := conn.TLSTags.GetDynamicTags() staticTags := httpStaticTags | http2StaticTags - dynamicTags := mergeDynamicTags(httpDynamicTags, http2DynamicTags) + dynamicTags := mergeDynamicTags(httpDynamicTags, http2DynamicTags, tlsDynamicTags) staticTags |= kafkaEncoder.WriteKafkaAggregations(conn, builder) staticTags |= postgresEncoder.WritePostgresAggregations(conn, builder) diff --git a/pkg/network/encoding/marshal/usm.go b/pkg/network/encoding/marshal/usm.go index bcae7a12ecc12..437a0ba4b0d64 100644 --- a/pkg/network/encoding/marshal/usm.go +++ b/pkg/network/encoding/marshal/usm.go @@ -9,8 +9,6 @@ import ( "fmt" "sync" - "github.com/cihub/seelog" - pkgconfigsetup "github.com/DataDog/datadog-agent/pkg/config/setup" "github.com/DataDog/datadog-agent/pkg/network" "github.com/DataDog/datadog-agent/pkg/network/protocols/telemetry" @@ -192,7 +190,7 @@ func (bc *USMConnectionIndex[K, V]) Close() { var total int for key, value := range bc.data { if !value.claimed { - if log.ShouldLog(seelog.TraceLvl) { + if log.ShouldLog(log.TraceLvl) { log.Tracef("key %+v unclaimed", key) } total += len(value.Data) diff --git a/pkg/network/event_common.go b/pkg/network/event_common.go index d8cf93f592535..fc20fb9fa55be 100644 --- a/pkg/network/event_common.go +++ b/pkg/network/event_common.go @@ -23,6 +23,7 @@ import ( "github.com/DataDog/datadog-agent/pkg/network/protocols/kafka" "github.com/DataDog/datadog-agent/pkg/network/protocols/postgres" "github.com/DataDog/datadog-agent/pkg/network/protocols/redis" + "github.com/DataDog/datadog-agent/pkg/network/protocols/tls" "github.com/DataDog/datadog-agent/pkg/process/util" ) @@ -234,14 +235,15 @@ type StatCookie = uint64 // ConnectionTuple represents the unique network key for a connection type ConnectionTuple struct { - Source util.Address - Dest util.Address - Pid uint32 - NetNS uint32 - SPort uint16 - DPort uint16 - Type ConnectionType - Family ConnectionFamily + Source util.Address + Dest util.Address + Pid uint32 + NetNS uint32 + SPort uint16 + DPort uint16 + Type ConnectionType + Family ConnectionFamily + Direction ConnectionDirection } func (c ConnectionTuple) String() string { @@ -283,9 +285,9 @@ type ConnectionStats struct { RTTVar uint32 StaticTags uint64 ProtocolStack protocols.Stack + TLSTags tls.Tags // keep these fields last because they are 1 byte each and otherwise inflate the struct size due to alignment - Direction ConnectionDirection SPortIsEphemeral EphemeralPortType IntraHost bool IsAssured bool diff --git a/pkg/network/event_test.go b/pkg/network/event_test.go index 60ac66900964b..9370bf3315972 100644 --- a/pkg/network/event_test.go +++ b/pkg/network/event_test.go @@ -52,16 +52,16 @@ func TestBeautifyKey(t *testing.T) { }, { ConnectionTuple: ConnectionTuple{ - Pid: 32065, - Type: 0, - Family: AFINET, - Source: util.AddressFromString("172.21.148.124"), - Dest: util.AddressFromString("130.211.21.187"), - SPort: 52012, - DPort: 443, + Pid: 32065, + Type: 0, + Family: AFINET, + Source: util.AddressFromString("172.21.148.124"), + Dest: util.AddressFromString("130.211.21.187"), + SPort: 52012, + DPort: 443, + Direction: 2, }, - Direction: 2, - Cookie: 2, + Cookie: 2, }, } { bk := c.ByteKey(buf) diff --git a/pkg/network/go/bininspect/symbols.go b/pkg/network/go/bininspect/symbols.go index 6b5f135179fe1..8549fde56f406 100644 --- a/pkg/network/go/bininspect/symbols.go +++ b/pkg/network/go/bininspect/symbols.go @@ -14,8 +14,6 @@ import ( "io" "math" - "github.com/cihub/seelog" - "github.com/DataDog/datadog-agent/pkg/util/common" "github.com/DataDog/datadog-agent/pkg/util/log" "github.com/DataDog/datadog-agent/pkg/util/safeelf" @@ -222,7 +220,7 @@ func getSymbols(f *safeelf.File, typ safeelf.SectionType, filter symbolFilter) ( // returned. func GetAllSymbolsByName(elfFile *safeelf.File, filter symbolFilter) (map[string]safeelf.Symbol, error) { regularSymbols, regularSymbolsErr := getSymbols(elfFile, safeelf.SHT_SYMTAB, filter) - if regularSymbolsErr != nil && log.ShouldLog(seelog.TraceLvl) { + if regularSymbolsErr != nil && log.ShouldLog(log.TraceLvl) { log.Tracef("Failed getting regular symbols of elf file: %s", regularSymbolsErr) } @@ -231,7 +229,7 @@ func GetAllSymbolsByName(elfFile *safeelf.File, filter symbolFilter) (map[string numWanted := filter.getNumWanted() if len(regularSymbols) != numWanted { dynamicSymbols, dynamicSymbolsErr = getSymbols(elfFile, safeelf.SHT_DYNSYM, filter) - if dynamicSymbolsErr != nil && log.ShouldLog(seelog.TraceLvl) { + if dynamicSymbolsErr != nil && log.ShouldLog(log.TraceLvl) { log.Tracef("Failed getting dynamic symbols of elf file: %s", dynamicSymbolsErr) } } diff --git a/pkg/network/netlink/conntrack_integration_test.go b/pkg/network/netlink/conntrack_integration_test.go index 2788153c3f325..46049481e9945 100644 --- a/pkg/network/netlink/conntrack_integration_test.go +++ b/pkg/network/netlink/conntrack_integration_test.go @@ -13,7 +13,6 @@ import ( "os" "testing" - "github.com/cihub/seelog" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -31,7 +30,7 @@ func TestMain(m *testing.M) { if logLevel == "" { logLevel = "warn" } - log.SetupLogger(seelog.Default, logLevel) + log.SetupLogger(log.Default(), logLevel) os.Exit(m.Run()) } diff --git a/pkg/network/netlink/conntracker.go b/pkg/network/netlink/conntracker.go index 901e763bf2e4b..0bbfe2891abff 100644 --- a/pkg/network/netlink/conntracker.go +++ b/pkg/network/netlink/conntracker.go @@ -16,15 +16,12 @@ import ( "sync" "time" + "github.com/hashicorp/golang-lru/v2/simplelru" "github.com/prometheus/client_golang/prometheus" "github.com/syndtr/gocapability/capability" "golang.org/x/sys/unix" - "github.com/cihub/seelog" - "github.com/hashicorp/golang-lru/v2/simplelru" - telemetryComp "github.com/DataDog/datadog-agent/comp/core/telemetry" - "github.com/DataDog/datadog-agent/pkg/network" "github.com/DataDog/datadog-agent/pkg/network/config" "github.com/DataDog/datadog-agent/pkg/process/util" @@ -50,7 +47,7 @@ type Conntracker interface { // Collect returns the current state of all metrics of the collector Collect(metrics chan<- prometheus.Metric) GetTranslationForConn(*network.ConnectionTuple) *network.IPTranslation - // GetType returns a string describing whether the conntracker is "ebpf" or "netlink" + // GetType returns a string describing the conntracker type GetType() string DeleteTranslation(*network.ConnectionTuple) DumpCachedTable(context.Context) (map[uint32][]DebugConntrackEntry, error) @@ -411,7 +408,7 @@ func (cc *conntrackCache) Add(c Con, orphan bool) (evicts int) { } } - if log.ShouldLog(seelog.TraceLvl) { + if log.ShouldLog(log.TraceLvl) { log.Tracef("%s", c) } @@ -433,7 +430,7 @@ func (cc *conntrackCache) removeOrphans(now time.Time) (removed int64) { cc.cache.Remove(o.key) removed++ - if log.ShouldLog(seelog.TraceLvl) { + if log.ShouldLog(log.TraceLvl) { log.Tracef("removed orphan %+v", o.key) } } diff --git a/pkg/network/netlink/consumer.go b/pkg/network/netlink/consumer.go index ff3d2950e809d..942c0b1e7b771 100644 --- a/pkg/network/netlink/consumer.go +++ b/pkg/network/netlink/consumer.go @@ -13,7 +13,6 @@ import ( "strings" "syscall" - "github.com/cihub/seelog" "github.com/mdlayher/netlink" "github.com/pkg/errors" "github.com/vishvananda/netns" @@ -205,7 +204,7 @@ func (c *Consumer) isPeerNS(conn *netlink.Conn, ns netns.NsHandle) bool { return false } - if log.ShouldLog(seelog.TraceLvl) { + if log.ShouldLog(log.TraceLvl) { log.Tracef("netlink reply: %v", msgs) } @@ -340,7 +339,14 @@ func (c *Consumer) dumpTable(family uint8, output chan Event, ns netns.NsHandle) // LoadNfConntrackKernelModule requests a dummy connection tuple from netlink conntrack which is discarded but has // the side effect of loading the nf_conntrack_netlink module -func LoadNfConntrackKernelModule(ns netns.NsHandle) error { +func LoadNfConntrackKernelModule(cfg *config.Config) error { + ns, err := cfg.GetRootNetNs() + if err != nil { + return fmt.Errorf("error fetching root net namespace, will not attempt to load nf_conntrack_netlink module: %w", err) + } + + defer ns.Close() + sock, err := NewSocket(ns) if err != nil { ino, errIno := kernel.GetInoForNs(ns) diff --git a/pkg/network/port_test.go b/pkg/network/port_test.go index 995a4e8ef0a2f..067417ae79d48 100644 --- a/pkg/network/port_test.go +++ b/pkg/network/port_test.go @@ -17,7 +17,6 @@ import ( "strconv" "testing" - "github.com/cihub/seelog" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/vishvananda/netns" @@ -32,7 +31,7 @@ func TestMain(m *testing.M) { if logLevel == "" { logLevel = "warn" } - log.SetupLogger(seelog.Default, logLevel) + log.SetupLogger(log.Default(), logLevel) os.Exit(m.Run()) } diff --git a/pkg/network/protocols/ebpf_types.go b/pkg/network/protocols/ebpf_types.go index 57bdb4539bf5e..c5b90864ee74e 100644 --- a/pkg/network/protocols/ebpf_types.go +++ b/pkg/network/protocols/ebpf_types.go @@ -19,10 +19,8 @@ const ( ) const ( - // PostgresMaxMessagesPerTailCall is the maximum number of messages that can be processed in a single tail call in our Postgres decoding solution - PostgresMaxMessagesPerTailCall = C.POSTGRES_MAX_MESSAGES_PER_TAIL_CALL - // PostgresMaxTailCalls is the maximum number of tail calls that can be made in our Postgres decoding solution - PostgresMaxTailCalls = C.POSTGRES_MAX_TAIL_CALLS_FOR_MAX_MESSAGES + // PostgresMaxTotalMessages is the maximum number of Postgres messages processed by the eBPF program. + PostgresMaxTotalMessages = C.POSTGRES_MAX_TOTAL_MESSAGES ) // DispatcherProgramType is a C type to represent the eBPF programs used for tail calls. diff --git a/pkg/network/protocols/ebpf_types_linux.go b/pkg/network/protocols/ebpf_types_linux.go index ae855cfe48b77..8cc9c663dc3d5 100644 --- a/pkg/network/protocols/ebpf_types_linux.go +++ b/pkg/network/protocols/ebpf_types_linux.go @@ -10,9 +10,7 @@ const ( ) const ( - PostgresMaxMessagesPerTailCall = 0x50 - - PostgresMaxTailCalls = 0x1 + PostgresMaxTotalMessages = 0xb4 ) type DispatcherProgramType uint32 diff --git a/pkg/network/protocols/events/consumer.go b/pkg/network/protocols/events/consumer.go index dea561ee8297f..eb00d29678b65 100644 --- a/pkg/network/protocols/events/consumer.go +++ b/pkg/network/protocols/events/consumer.go @@ -13,8 +13,6 @@ import ( "sync" "unsafe" - "github.com/cihub/seelog" - manager "github.com/DataDog/ebpf-manager" ddebpf "github.com/DataDog/datadog-agent/pkg/ebpf" @@ -169,7 +167,7 @@ func (c *Consumer[V]) Start() { c.batchReader.ReadAll(func(_ int, b *batch) { c.process(b, true) }) - if log.ShouldLog(seelog.DebugLvl) { + if log.ShouldLog(log.DebugLvl) { log.Debugf("usm events summary: name=%q %s", c.proto, c.metricGroup.Summary()) } close(done) diff --git a/pkg/network/protocols/events/consumer_test.go b/pkg/network/protocols/events/consumer_test.go index 5e9864b5a342a..4b666ba4149de 100644 --- a/pkg/network/protocols/events/consumer_test.go +++ b/pkg/network/protocols/events/consumer_test.go @@ -8,7 +8,6 @@ package events import ( - "math" "os" "path/filepath" "sync" @@ -23,7 +22,6 @@ import ( "github.com/cilium/ebpf/ringbuf" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "golang.org/x/sys/unix" ddebpf "github.com/DataDog/datadog-agent/pkg/ebpf" "github.com/DataDog/datadog-agent/pkg/ebpf/bytecode" @@ -189,10 +187,7 @@ func newEBPFProgram(c *config.Config) (*manager.Manager, error) { }, } options := manager.Options{ - RLimit: &unix.Rlimit{ - Cur: math.MaxUint64, - Max: math.MaxUint64, - }, + RemoveRlimit: true, ActivatedProbes: []manager.ProbesSelector{ &manager.ProbeSelector{ ProbeIdentificationPair: manager.ProbeIdentificationPair{ diff --git a/pkg/network/protocols/http/telemetry.go b/pkg/network/protocols/http/telemetry.go index 0dddb2591fee9..2d73136b7417b 100644 --- a/pkg/network/protocols/http/telemetry.go +++ b/pkg/network/protocols/http/telemetry.go @@ -10,8 +10,6 @@ package http import ( "fmt" - "github.com/cihub/seelog" - libtelemetry "github.com/DataDog/datadog-agent/pkg/network/protocols/telemetry" "github.com/DataDog/datadog-agent/pkg/util/log" ) @@ -99,7 +97,7 @@ func (t *Telemetry) Count(tx Transaction) { // Log logs the telemetry. func (t *Telemetry) Log() { - if log.ShouldLog(seelog.DebugLvl) { + if log.ShouldLog(log.DebugLvl) { log.Debugf("%s stats summary: %s", t.protocol, t.metricGroup.Summary()) } } diff --git a/pkg/network/protocols/http2/protocol.go b/pkg/network/protocols/http2/protocol.go index 433f55e15715e..1380073499693 100644 --- a/pkg/network/protocols/http2/protocol.go +++ b/pkg/network/protocols/http2/protocol.go @@ -47,7 +47,7 @@ type Protocol struct { const ( // InFlightMap is the name of the map used to store in-flight HTTP/2 streams InFlightMap = "http2_in_flight" - remainderTable = "http2_remainder" + incompleteFramesTable = "http2_incomplete_frames" dynamicTable = "http2_dynamic_table" dynamicTableCounter = "http2_dynamic_counter_table" http2IterationsTable = "http2_iterations" @@ -90,7 +90,7 @@ var Spec = &protocols.ProtocolSpec{ Name: tlsHTTP2IterationsTable, }, { - Name: remainderTable, + Name: incompleteFramesTable, }, { Name: "http2_headers_to_process", @@ -244,7 +244,7 @@ func (p *Protocol) ConfigureOptions(mgr *manager.Manager, opts *manager.Options) MaxEntries: p.cfg.MaxUSMConcurrentRequests, EditorFlag: manager.EditMaxEntries, } - opts.MapSpecEditors[remainderTable] = manager.MapSpecEditor{ + opts.MapSpecEditors[incompleteFramesTable] = manager.MapSpecEditor{ MaxEntries: p.cfg.MaxUSMConcurrentRequests, EditorFlag: manager.EditMaxEntries, } diff --git a/pkg/network/protocols/http2/telemetry.go b/pkg/network/protocols/http2/telemetry.go index e80b5efd1a898..6e74ad3e7ba07 100644 --- a/pkg/network/protocols/http2/telemetry.go +++ b/pkg/network/protocols/http2/telemetry.go @@ -10,8 +10,6 @@ package http2 import ( "strconv" - "github.com/cihub/seelog" - libtelemetry "github.com/DataDog/datadog-agent/pkg/network/protocols/telemetry" "github.com/DataDog/datadog-agent/pkg/util/log" ) @@ -91,7 +89,7 @@ func (t *kernelTelemetry) update(tel *HTTP2Telemetry, isTLS bool) { } func (t *kernelTelemetry) Log() { - if log.ShouldLog(seelog.DebugLvl) { + if log.ShouldLog(log.DebugLvl) { log.Debugf("http2 kernel telemetry summary: %s", t.metricGroup.Summary()) } } diff --git a/pkg/network/protocols/http2/types.go b/pkg/network/protocols/http2/types.go index 5f167e83cbb73..ab2e02dc0d999 100644 --- a/pkg/network/protocols/http2/types.go +++ b/pkg/network/protocols/http2/types.go @@ -36,7 +36,7 @@ type http2Path C.path_t type HTTP2Stream C.http2_stream_t type EbpfTx C.http2_event_t type HTTP2Telemetry C.http2_telemetry_t -type HTTP2RemainderEntry C.frame_header_remainder_t +type HTTP2IncompleteFrameEntry C.incomplete_frame_t type StaticTableEnumValue = C.static_table_value_t diff --git a/pkg/network/protocols/http2/types_linux.go b/pkg/network/protocols/http2/types_linux.go index 2e08cc9d46797..fdc8aba36c321 100644 --- a/pkg/network/protocols/http2/types_linux.go +++ b/pkg/network/protocols/http2/types_linux.go @@ -85,7 +85,7 @@ type HTTP2Telemetry struct { Exceeding_max_frames_to_filter uint64 Path_size_bucket [8]uint64 } -type HTTP2RemainderEntry struct { +type HTTP2IncompleteFrameEntry struct { Remainder uint32 Length uint32 Buf [9]byte diff --git a/pkg/network/protocols/kafka/telemetry.go b/pkg/network/protocols/kafka/telemetry.go index 9905756dd880e..cb91b714f0984 100644 --- a/pkg/network/protocols/kafka/telemetry.go +++ b/pkg/network/protocols/kafka/telemetry.go @@ -8,8 +8,6 @@ package kafka import ( - "github.com/cihub/seelog" - libtelemetry "github.com/DataDog/datadog-agent/pkg/network/protocols/telemetry" "github.com/DataDog/datadog-agent/pkg/util/log" ) @@ -51,7 +49,7 @@ func (t *Telemetry) Count(tx *KafkaTransaction) { // Log logs the kafka stats summary func (t *Telemetry) Log() { - if log.ShouldLog(seelog.DebugLvl) { + if log.ShouldLog(log.DebugLvl) { log.Debugf("kafka stats summary: %s", t.metricGroup.Summary()) } } diff --git a/pkg/network/protocols/postgres/ebpf/types.go b/pkg/network/protocols/postgres/ebpf/types.go index 7c615186958e4..63071b914e5a7 100644 --- a/pkg/network/protocols/postgres/ebpf/types.go +++ b/pkg/network/protocols/postgres/ebpf/types.go @@ -9,6 +9,7 @@ package ebpf /* #include "../../ebpf/c/protocols/postgres/types.h" +#include "../../ebpf/c/protocols/postgres/defs.h" #include "../../ebpf/c/protocols/classification/defs.h" */ import "C" @@ -19,7 +20,12 @@ type ConnTuple = C.conn_tuple_t type EbpfEvent C.postgres_event_t type EbpfTx C.postgres_transaction_t +type PostgresKernelMsgCount C.postgres_kernel_msg_count_t const ( - BufferSize = C.POSTGRES_BUFFER_SIZE + BufferSize = C.POSTGRES_BUFFER_SIZE + MsgCountBucketSize = C.PG_KERNEL_MSG_COUNT_BUCKET_SIZE + MsgCountNumBuckets = C.PG_KERNEL_MSG_COUNT_NUM_BUCKETS + MsgCountFirstBucket = C.PG_KERNEL_MSG_COUNT_FIRST_BUCKET + MsgCountMaxTotal = C.POSTGRES_MAX_TOTAL_MESSAGES ) diff --git a/pkg/network/protocols/postgres/ebpf/types_linux.go b/pkg/network/protocols/postgres/ebpf/types_linux.go index 9b0097a2b5f9d..9413ee269ac20 100644 --- a/pkg/network/protocols/postgres/ebpf/types_linux.go +++ b/pkg/network/protocols/postgres/ebpf/types_linux.go @@ -27,7 +27,16 @@ type EbpfTx struct { Tags uint8 Pad_cgo_0 [3]byte } +type PostgresKernelMsgCount struct { + Reached_max_messages uint64 + Fragmented_packets uint64 + Msg_count_buckets [5]uint64 +} const ( - BufferSize = 0xa0 + BufferSize = 0xa0 + MsgCountBucketSize = 0x14 + MsgCountNumBuckets = 0x5 + MsgCountFirstBucket = 0x64 + MsgCountMaxTotal = 0xb4 ) diff --git a/pkg/network/protocols/postgres/protocol.go b/pkg/network/protocols/postgres/protocol.go index 6bc245896a91a..c0d7aa37a6747 100644 --- a/pkg/network/protocols/postgres/protocol.go +++ b/pkg/network/protocols/postgres/protocol.go @@ -9,6 +9,7 @@ package postgres import ( "io" + "time" "unsafe" "github.com/cilium/ebpf" @@ -28,6 +29,8 @@ import ( ) const ( + // KernelTelemetryMap is the map for getting kernel metrics + KernelTelemetryMap = "postgres_telemetry" // InFlightMap is the name of the in-flight map. InFlightMap = "postgres_in_flight" scratchBufferMap = "postgres_scratch_buffer" @@ -44,11 +47,13 @@ const ( // protocol holds the state of the postgres protocol monitoring. type protocol struct { - cfg *config.Config - telemetry *Telemetry - eventsConsumer *events.Consumer[postgresebpf.EbpfEvent] - mapCleaner *ddebpf.MapCleaner[netebpf.ConnTuple, postgresebpf.EbpfTx] - statskeeper *StatKeeper + cfg *config.Config + telemetry *Telemetry + eventsConsumer *events.Consumer[postgresebpf.EbpfEvent] + mapCleaner *ddebpf.MapCleaner[netebpf.ConnTuple, postgresebpf.EbpfTx] + statskeeper *StatKeeper + kernelTelemetry *kernelTelemetry // retrieves Postgres metrics from kernel + kernelTelemetryStopCh chan struct{} } // Spec is the protocol spec for the postgres protocol. @@ -133,9 +138,11 @@ func newPostgresProtocol(cfg *config.Config) (protocols.Protocol, error) { } return &protocol{ - cfg: cfg, - telemetry: NewTelemetry(cfg), - statskeeper: NewStatkeeper(cfg), + cfg: cfg, + telemetry: NewTelemetry(cfg), + statskeeper: NewStatkeeper(cfg), + kernelTelemetry: newKernelTelemetry(), + kernelTelemetryStopCh: make(chan struct{}), }, nil } @@ -175,6 +182,7 @@ func (p *protocol) PreStart(mgr *manager.Manager) (err error) { func (p *protocol) PostStart(mgr *manager.Manager) error { // Setup map cleaner after manager start. p.setupMapCleaner(mgr) + p.startKernelTelemetry(mgr) return nil } @@ -186,11 +194,16 @@ func (p *protocol) Stop(*manager.Manager) { if p.eventsConsumer != nil { p.eventsConsumer.Stop() } + if p.kernelTelemetryStopCh != nil { + close(p.kernelTelemetryStopCh) + } } // DumpMaps dumps map contents for debugging. func (p *protocol) DumpMaps(w io.Writer, mapName string, currentMap *ebpf.Map) { - if mapName == InFlightMap { // maps/postgres_in_flight (BPF_MAP_TYPE_HASH), key ConnTuple, value EbpfTx + switch mapName { + case InFlightMap: + // maps/postgres_in_flight (BPF_MAP_TYPE_HASH), key ConnTuple, value EbpfTx var key netebpf.ConnTuple var value postgresebpf.EbpfTx protocols.WriteMapDumpHeader(w, currentMap, mapName, key, value) @@ -198,12 +211,27 @@ func (p *protocol) DumpMaps(w io.Writer, mapName string, currentMap *ebpf.Map) { for iter.Next(unsafe.Pointer(&key), unsafe.Pointer(&value)) { spew.Fdump(w, key, value) } + case KernelTelemetryMap: + // postgres_msg_count (BPF_ARRAY_MAP), key 0 and 1, value PostgresKernelMsgCount + plainKey := uint32(0) + tlsKey := uint32(1) + + var value postgresebpf.PostgresKernelMsgCount + protocols.WriteMapDumpHeader(w, currentMap, mapName, plainKey, value) + if err := currentMap.Lookup(unsafe.Pointer(&plainKey), unsafe.Pointer(&value)); err == nil { + spew.Fdump(w, plainKey, value) + } + protocols.WriteMapDumpHeader(w, currentMap, mapName, tlsKey, value) + if err := currentMap.Lookup(unsafe.Pointer(&tlsKey), unsafe.Pointer(&value)); err == nil { + spew.Fdump(w, tlsKey, value) + } } } // GetStats returns a map of Postgres stats. func (p *protocol) GetStats() *protocols.ProtocolStats { p.eventsConsumer.Sync() + p.kernelTelemetry.Log() return &protocols.ProtocolStats{ Type: protocols.Postgres, @@ -250,3 +278,40 @@ func (p *protocol) setupMapCleaner(mgr *manager.Manager) { p.mapCleaner = mapCleaner } + +func (p *protocol) startKernelTelemetry(mgr *manager.Manager) { + telemetryMap, err := protocols.GetMap(mgr, KernelTelemetryMap) + if err != nil { + log.Errorf("couldnt find kernel telemetry map: %s, error: %v", telemetryMap, err) + return + } + + plainKey := uint32(0) + tlsKey := uint32(1) + pgKernelMsgCount := &postgresebpf.PostgresKernelMsgCount{} + ticker := time.NewTicker(30 * time.Second) + + go func() { + defer ticker.Stop() + + for { + select { + case <-ticker.C: + if err := telemetryMap.Lookup(unsafe.Pointer(&plainKey), unsafe.Pointer(pgKernelMsgCount)); err != nil { + log.Errorf("unable to lookup %q map: %s", KernelTelemetryMap, err) + return + } + p.kernelTelemetry.update(pgKernelMsgCount, false) + + if err := telemetryMap.Lookup(unsafe.Pointer(&tlsKey), unsafe.Pointer(pgKernelMsgCount)); err != nil { + log.Errorf("unable to lookup %q map: %s", KernelTelemetryMap, err) + return + } + p.kernelTelemetry.update(pgKernelMsgCount, true) + + case <-p.kernelTelemetryStopCh: + return + } + } + }() +} diff --git a/pkg/network/protocols/postgres/telemetry.go b/pkg/network/protocols/postgres/telemetry.go index cc17b902c24ea..3c26d92ada9c2 100644 --- a/pkg/network/protocols/postgres/telemetry.go +++ b/pkg/network/protocols/postgres/telemetry.go @@ -9,8 +9,7 @@ package postgres import ( "fmt" - - "github.com/cihub/seelog" + "strconv" "github.com/DataDog/datadog-agent/pkg/network/config" "github.com/DataDog/datadog-agent/pkg/network/protocols/postgres/ebpf" @@ -174,7 +173,53 @@ func (t *Telemetry) Count(tx *ebpf.EbpfEvent, eventWrapper *EventWrapper) { // Log logs the postgres stats summary func (t *Telemetry) Log() { - if log.ShouldLog(seelog.DebugLvl) { + if log.ShouldLog(log.DebugLvl) { log.Debugf("postgres stats summary: %s", t.metricGroup.Summary()) } } + +// kernelTelemetry provides empirical kernel statistics about the number of messages in each TCP packet +type kernelTelemetry struct { + metricGroup *libtelemetry.MetricGroup + reachedMaxMessages *libtelemetry.TLSAwareCounter + fragmentedPackets *libtelemetry.TLSAwareCounter + msgCountBuckets [ebpf.MsgCountNumBuckets]*libtelemetry.TLSAwareCounter // Postgres messages counters divided into buckets +} + +// newKernelTelemetry this is the Postgres message counter store. +func newKernelTelemetry() *kernelTelemetry { + metricGroup := libtelemetry.NewMetricGroup("usm.postgres", libtelemetry.OptStatsd) + kernelTel := &kernelTelemetry{ + metricGroup: metricGroup, + } + kernelTel.reachedMaxMessages = libtelemetry.NewTLSAwareCounter(metricGroup, "max_messages") + kernelTel.fragmentedPackets = libtelemetry.NewTLSAwareCounter(metricGroup, "incomplete_messages") + + for i := range kernelTel.msgCountBuckets { + kernelTel.msgCountBuckets[i] = libtelemetry.NewTLSAwareCounter(metricGroup, "messages_count_bucket_"+strconv.Itoa(i+1)) + } + return kernelTel +} + +// update the postgres message counter store with new counters from the kernel, return immediately if nothing to add. +func (t *kernelTelemetry) update(kernCounts *ebpf.PostgresKernelMsgCount, isTLS bool) { + if kernCounts == nil { + return + } + + t.reachedMaxMessages.Set(int64(kernCounts.Reached_max_messages), isTLS) + t.fragmentedPackets.Set(int64(kernCounts.Fragmented_packets), isTLS) + + for i := range t.msgCountBuckets { + v := kernCounts.Msg_count_buckets[i] + t.msgCountBuckets[i].Set(int64(v), isTLS) + } +} + +// Log logs summary of telemetry +func (t *kernelTelemetry) Log() { + if log.ShouldLog(log.DebugLvl) { + s := t.metricGroup.Summary() + log.Debugf("postgres kernel telemetry, summary: %s", s) + } +} diff --git a/pkg/network/protocols/telemetry/metric.go b/pkg/network/protocols/telemetry/metric.go index 46aa226351278..56ce64a1b00b8 100644 --- a/pkg/network/protocols/telemetry/metric.go +++ b/pkg/network/protocols/telemetry/metric.go @@ -26,6 +26,11 @@ func NewCounter(name string, tagsAndOptions ...string) *Counter { return globalRegistry.FindOrCreate(c).(*Counter) } +// Set value atomically +func (c *Counter) Set(v int64) { + c.value.Store(v) +} + // Add value atomically func (c *Counter) Add(v int64) { if v > 0 { @@ -118,6 +123,15 @@ func NewTLSAwareCounter(metricGroup *MetricGroup, metricName string, tags ...str } } +// Set Sets the given value to the counter based on the encryption. +func (c *TLSAwareCounter) Set(v int64, isTLS bool) { + if isTLS { + c.counterTLS.Set(v) + return + } + c.counterPlain.Set(v) +} + // Add adds the given delta to the counter based on the encryption. func (c *TLSAwareCounter) Add(delta int64, isTLS bool) { if isTLS { diff --git a/pkg/network/protocols/telemetry/metric_group.go b/pkg/network/protocols/telemetry/metric_group.go index c1036d4aadc05..ce5eef1bcefa1 100644 --- a/pkg/network/protocols/telemetry/metric_group.go +++ b/pkg/network/protocols/telemetry/metric_group.go @@ -97,7 +97,7 @@ func (mg *MetricGroup) Summary() string { ) // safeguard against division by zero - if timeDelta == 0 { + if timeDelta < 1 { timeDelta = 1 } diff --git a/pkg/network/protocols/telemetry/registry.go b/pkg/network/protocols/telemetry/registry.go index d80df1df3394b..a49c997e5899d 100644 --- a/pkg/network/protocols/telemetry/registry.go +++ b/pkg/network/protocols/telemetry/registry.go @@ -60,18 +60,6 @@ func (r *registry) GetMetrics(params ...string) []metric { return result } -// Clear metrics -// WARNING: Only intended for tests -func Clear() { - globalRegistry.Lock() - globalRegistry.metrics = nil - globalRegistry.Unlock() - - telemetryDelta.mux.Lock() - telemetryDelta.stateByClientID = make(map[string]*clientState) - telemetryDelta.mux.Unlock() -} - func init() { globalRegistry = new(registry) } diff --git a/pkg/network/protocols/telemetry/registry_testutil.go b/pkg/network/protocols/telemetry/registry_testutil.go new file mode 100644 index 0000000000000..46777d052b4cc --- /dev/null +++ b/pkg/network/protocols/telemetry/registry_testutil.go @@ -0,0 +1,19 @@ +// 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 test + +package telemetry + +// Clear metrics +func Clear() { + globalRegistry.Lock() + globalRegistry.metrics = nil + globalRegistry.Unlock() + + telemetryDelta.mux.Lock() + telemetryDelta.stateByClientID = make(map[string]*clientState) + telemetryDelta.mux.Unlock() +} diff --git a/pkg/network/protocols/tls/types.go b/pkg/network/protocols/tls/types.go new file mode 100644 index 0000000000000..c3014c3f65f3e --- /dev/null +++ b/pkg/network/protocols/tls/types.go @@ -0,0 +1,135 @@ +// 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. + +// Package tls contains definitions and methods related to tags parsed from the TLS handshake +package tls + +import ( + "crypto/tls" + "fmt" +) + +// Constants for tag keys +const ( + TagTLSVersion = "tls.version:" + TagTLSCipherSuiteID = "tls.cipher_suite_id:" + TagTLSClientVersion = "tls.client_version:" + version10 = "tls_1.0" + version11 = "tls_1.1" + version12 = "tls_1.2" + version13 = "tls_1.3" +) + +// Bitmask constants for Offered_versions matching kernelspace definitions +const ( + OfferedTLSVersion10 uint8 = 0x01 + OfferedTLSVersion11 uint8 = 0x02 + OfferedTLSVersion12 uint8 = 0x04 + OfferedTLSVersion13 uint8 = 0x08 +) + +// VersionTags maps TLS versions to tag names for server chosen version (exported for testing) +var VersionTags = map[uint16]string{ + tls.VersionTLS10: TagTLSVersion + version10, + tls.VersionTLS11: TagTLSVersion + version11, + tls.VersionTLS12: TagTLSVersion + version12, + tls.VersionTLS13: TagTLSVersion + version13, +} + +// ClientVersionTags maps TLS versions to tag names for client offered versions (exported for testing) +var ClientVersionTags = map[uint16]string{ + tls.VersionTLS10: TagTLSClientVersion + version10, + tls.VersionTLS11: TagTLSClientVersion + version11, + tls.VersionTLS12: TagTLSClientVersion + version12, + tls.VersionTLS13: TagTLSClientVersion + version13, +} + +// Mapping of offered version bitmasks to version constants +var offeredVersionBitmask = []struct { + bitMask uint8 + version uint16 +}{ + {OfferedTLSVersion10, tls.VersionTLS10}, + {OfferedTLSVersion11, tls.VersionTLS11}, + {OfferedTLSVersion12, tls.VersionTLS12}, + {OfferedTLSVersion13, tls.VersionTLS13}, +} + +// Tags holds the TLS tags. It is used to store the TLS version, cipher suite and offered versions. +// We can't use the struct from eBPF as the definition is shared with windows. +type Tags struct { + ChosenVersion uint16 + CipherSuite uint16 + OfferedVersions uint8 +} + +// MergeWith merges the tags from another Tags struct into this one +func (t *Tags) MergeWith(that Tags) { + if t.ChosenVersion == 0 { + t.ChosenVersion = that.ChosenVersion + } + if t.CipherSuite == 0 { + t.CipherSuite = that.CipherSuite + } + if t.OfferedVersions == 0 { + t.OfferedVersions = that.OfferedVersions + } + +} + +// IsEmpty returns true if all fields are zero +func (t *Tags) IsEmpty() bool { + if t == nil { + return true + } + return t.ChosenVersion == 0 && t.CipherSuite == 0 && t.OfferedVersions == 0 +} + +// String returns a string representation of the Tags struct +func (t *Tags) String() string { + return fmt.Sprintf("ChosenVersion: %d, CipherSuite: %d, OfferedVersions: %d", t.ChosenVersion, t.CipherSuite, t.OfferedVersions) +} + +// parseOfferedVersions parses the Offered_versions bitmask into a slice of version strings +func parseOfferedVersions(offeredVersions uint8) []string { + versions := make([]string, 0, len(offeredVersionBitmask)) + for _, ov := range offeredVersionBitmask { + if (offeredVersions & ov.bitMask) != 0 { + if name := ClientVersionTags[ov.version]; name != "" { + versions = append(versions, name) + } + } + } + return versions +} + +func hexCipherSuiteTag(cipherSuite uint16) string { + return fmt.Sprintf("%s0x%04X", TagTLSCipherSuiteID, cipherSuite) +} + +// GetDynamicTags generates dynamic tags based on TLS information +func (t *Tags) GetDynamicTags() map[string]struct{} { + if t.IsEmpty() { + return nil + } + tags := make(map[string]struct{}) + + // Server chosen version + if tag, ok := VersionTags[t.ChosenVersion]; ok { + tags[tag] = struct{}{} + } + + // Client offered versions + for _, versionName := range parseOfferedVersions(t.OfferedVersions) { + tags[versionName] = struct{}{} + } + + // Cipher suite ID as hex string + if t.CipherSuite != 0 { + tags[hexCipherSuiteTag(t.CipherSuite)] = struct{}{} + } + + return tags +} diff --git a/pkg/network/protocols/tls/types_test.go b/pkg/network/protocols/tls/types_test.go new file mode 100644 index 0000000000000..979cc2bbdba32 --- /dev/null +++ b/pkg/network/protocols/tls/types_test.go @@ -0,0 +1,128 @@ +// 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. + +package tls + +import ( + "crypto/tls" + "fmt" + "reflect" + "testing" +) + +func TestParseOfferedVersions(t *testing.T) { + tests := []struct { + offeredVersions uint8 + expected []string + }{ + {0x00, []string{}}, // No versions offered + {OfferedTLSVersion10, []string{"tls.client_version:tls_1.0"}}, + {OfferedTLSVersion11, []string{"tls.client_version:tls_1.1"}}, + {OfferedTLSVersion12, []string{"tls.client_version:tls_1.2"}}, + {OfferedTLSVersion13, []string{"tls.client_version:tls_1.3"}}, + {OfferedTLSVersion10 | OfferedTLSVersion12, []string{"tls.client_version:tls_1.0", "tls.client_version:tls_1.2"}}, + {OfferedTLSVersion11 | OfferedTLSVersion13, []string{"tls.client_version:tls_1.1", "tls.client_version:tls_1.3"}}, + {0xFF, []string{"tls.client_version:tls_1.0", "tls.client_version:tls_1.1", "tls.client_version:tls_1.2", "tls.client_version:tls_1.3"}}, // All bits set + {0x40, []string{}}, // Undefined bit set + {0x80, []string{}}, // Undefined bit set + } + + for _, test := range tests { + t.Run(fmt.Sprintf("OfferedVersions_0x%02X", test.offeredVersions), func(t *testing.T) { + result := parseOfferedVersions(test.offeredVersions) + if !reflect.DeepEqual(result, test.expected) { + t.Errorf("parseOfferedVersions(0x%02X) = %v; want %v", test.offeredVersions, result, test.expected) + } + }) + } +} + +func TestGetTLSDynamicTags(t *testing.T) { + tests := []struct { + name string + tlsTags *Tags + expected map[string]struct{} + }{ + { + name: "Nil_TLSTags", + tlsTags: nil, + expected: nil, + }, + { + name: "All_Fields_Populated", + tlsTags: &Tags{ + ChosenVersion: tls.VersionTLS12, + CipherSuite: 0x009C, + OfferedVersions: OfferedTLSVersion11 | OfferedTLSVersion12, + }, + expected: map[string]struct{}{ + "tls.version:tls_1.2": {}, + "tls.cipher_suite_id:0x009C": {}, + "tls.client_version:tls_1.1": {}, + "tls.client_version:tls_1.2": {}, + }, + }, + { + name: "Unknown_Chosen_Version", + tlsTags: &Tags{ + ChosenVersion: 0xFFFF, // Unknown version + CipherSuite: 0x00FF, + OfferedVersions: OfferedTLSVersion13, + }, + expected: map[string]struct{}{ + "tls.cipher_suite_id:0x00FF": {}, + "tls.client_version:tls_1.3": {}, + }, + }, + { + name: "No_Offered_Versions", + tlsTags: &Tags{ + ChosenVersion: tls.VersionTLS13, + CipherSuite: 0x1301, + OfferedVersions: 0x00, + }, + expected: map[string]struct{}{ + "tls.version:tls_1.3": {}, + "tls.cipher_suite_id:0x1301": {}, + }, + }, + { + name: "Zero_Cipher_Suite", + tlsTags: &Tags{ + ChosenVersion: tls.VersionTLS10, + OfferedVersions: OfferedTLSVersion10, + }, + expected: map[string]struct{}{ + "tls.version:tls_1.0": {}, + "tls.client_version:tls_1.0": {}, + }, + }, + { + name: "All_Bits_Set_In_Offered_Versions", + tlsTags: &Tags{ + ChosenVersion: tls.VersionTLS12, + CipherSuite: 0xC02F, + OfferedVersions: 0xFF, // All bits set + }, + expected: map[string]struct{}{ + "tls.version:tls_1.2": {}, + "tls.cipher_suite_id:0xC02F": {}, + "tls.client_version:tls_1.0": {}, + "tls.client_version:tls_1.1": {}, + "tls.client_version:tls_1.2": {}, + "tls.client_version:tls_1.3": {}, + }, + }, + } + + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + result := test.tlsTags.GetDynamicTags() + if !reflect.DeepEqual(result, test.expected) { + t.Errorf("GetDynamicTags(%v) = %v; want %v", test.tlsTags, result, test.expected) + } + }) + } +} diff --git a/pkg/network/resolver_test.go b/pkg/network/resolver_test.go index c0977141ee34b..0d4aa826b64c8 100644 --- a/pkg/network/resolver_test.go +++ b/pkg/network/resolver_test.go @@ -19,15 +19,15 @@ import ( func TestResolveLocalConnections(t *testing.T) { conns := []ConnectionStats{ {ConnectionTuple: ConnectionTuple{ - Pid: 8579, - Source: util.AddressFromString("172.29.132.189"), - SPort: 37432, - Dest: util.AddressFromString("172.29.168.124"), - DPort: 8080, - NetNS: 4026533024, - Type: TCP, - }, + Pid: 8579, + Source: util.AddressFromString("172.29.132.189"), + SPort: 37432, + Dest: util.AddressFromString("172.29.168.124"), + DPort: 8080, + NetNS: 4026533024, + Type: TCP, Direction: OUTGOING, + }, ContainerID: struct { Source *intern.Value Dest *intern.Value @@ -37,15 +37,15 @@ func TestResolveLocalConnections(t *testing.T) { IntraHost: true, }, {ConnectionTuple: ConnectionTuple{ - Pid: 8576, - Source: util.AddressFromString("172.29.132.189"), - SPort: 46822, - Dest: util.AddressFromString("172.29.168.124"), - DPort: 8080, - NetNS: 4026533024, - Type: TCP, - }, + Pid: 8576, + Source: util.AddressFromString("172.29.132.189"), + SPort: 46822, + Dest: util.AddressFromString("172.29.168.124"), + DPort: 8080, + NetNS: 4026533024, + Type: TCP, Direction: OUTGOING, + }, ContainerID: struct { Source *intern.Value Dest *intern.Value @@ -55,15 +55,15 @@ func TestResolveLocalConnections(t *testing.T) { IntraHost: true, }, {ConnectionTuple: ConnectionTuple{ - Pid: 1342852, - Source: util.AddressFromString("172.29.168.124"), - SPort: 8080, - Dest: util.AddressFromString("172.29.132.189"), - DPort: 46822, - NetNS: 4026533176, - Type: TCP, - }, + Pid: 1342852, + Source: util.AddressFromString("172.29.168.124"), + SPort: 8080, + Dest: util.AddressFromString("172.29.132.189"), + DPort: 46822, + NetNS: 4026533176, + Type: TCP, Direction: INCOMING, + }, ContainerID: struct { Source *intern.Value Dest *intern.Value @@ -73,15 +73,15 @@ func TestResolveLocalConnections(t *testing.T) { IntraHost: true, }, {ConnectionTuple: ConnectionTuple{ - Pid: 1344818, - Source: util.AddressFromString("172.29.168.124"), - SPort: 8080, - Dest: util.AddressFromString("172.29.132.189"), - DPort: 37432, - NetNS: 4026533176, - Type: TCP, - }, + Pid: 1344818, + Source: util.AddressFromString("172.29.168.124"), + SPort: 8080, + Dest: util.AddressFromString("172.29.132.189"), + DPort: 37432, + NetNS: 4026533176, + Type: TCP, Direction: INCOMING, + }, ContainerID: struct { Source *intern.Value Dest *intern.Value @@ -116,12 +116,13 @@ func TestResolveLoopbackConnections(t *testing.T) { { name: "raddr resolution with nat", conn: ConnectionStats{ConnectionTuple: ConnectionTuple{ - Pid: 1, - Source: util.AddressFromString("127.0.0.1"), - SPort: 1234, - Dest: util.AddressFromString("10.1.1.2"), - DPort: 1234, - NetNS: 1, + Pid: 1, + Source: util.AddressFromString("127.0.0.1"), + SPort: 1234, + Dest: util.AddressFromString("10.1.1.2"), + DPort: 1234, + NetNS: 1, + Direction: INCOMING, }, IPTranslation: &IPTranslation{ ReplDstIP: util.AddressFromString("127.0.0.1"), @@ -129,7 +130,6 @@ func TestResolveLoopbackConnections(t *testing.T) { ReplSrcIP: util.AddressFromString("10.1.1.2"), ReplSrcPort: 1234, }, - Direction: INCOMING, IntraHost: true, ContainerID: struct { Source *intern.Value @@ -143,12 +143,13 @@ func TestResolveLoopbackConnections(t *testing.T) { { name: "raddr resolution with nat to localhost", conn: ConnectionStats{ConnectionTuple: ConnectionTuple{ - Pid: 2, - NetNS: 1, - Source: util.AddressFromString("10.1.1.2"), - SPort: 1234, - Dest: util.AddressFromString("10.1.1.1"), - DPort: 1234, + Pid: 2, + NetNS: 1, + Source: util.AddressFromString("10.1.1.2"), + SPort: 1234, + Dest: util.AddressFromString("10.1.1.1"), + DPort: 1234, + Direction: OUTGOING, }, IPTranslation: &IPTranslation{ ReplDstIP: util.AddressFromString("10.1.1.2"), @@ -156,7 +157,6 @@ func TestResolveLoopbackConnections(t *testing.T) { ReplSrcIP: util.AddressFromString("127.0.0.1"), ReplSrcPort: 1234, }, - Direction: OUTGOING, IntraHost: true, ContainerID: struct { Source *intern.Value @@ -170,15 +170,15 @@ func TestResolveLoopbackConnections(t *testing.T) { { name: "raddr failed localhost resolution", conn: ConnectionStats{ConnectionTuple: ConnectionTuple{ - Pid: 3, - NetNS: 3, - Source: util.AddressFromString("127.0.0.1"), - SPort: 1235, - Dest: util.AddressFromString("127.0.0.1"), - DPort: 1234, + Pid: 3, + NetNS: 3, + Source: util.AddressFromString("127.0.0.1"), + SPort: 1235, + Dest: util.AddressFromString("127.0.0.1"), + DPort: 1234, + Direction: INCOMING, }, IntraHost: true, - Direction: INCOMING, ContainerID: struct { Source *intern.Value Dest *intern.Value @@ -191,15 +191,15 @@ func TestResolveLoopbackConnections(t *testing.T) { { name: "raddr resolution within same netns (3)", conn: ConnectionStats{ConnectionTuple: ConnectionTuple{ - Pid: 5, - NetNS: 3, - Source: util.AddressFromString("127.0.0.1"), - SPort: 1240, - Dest: util.AddressFromString("127.0.0.1"), - DPort: 1235, + Pid: 5, + NetNS: 3, + Source: util.AddressFromString("127.0.0.1"), + SPort: 1240, + Dest: util.AddressFromString("127.0.0.1"), + DPort: 1235, + Direction: OUTGOING, }, IntraHost: true, - Direction: OUTGOING, ContainerID: struct { Source *intern.Value Dest *intern.Value @@ -212,15 +212,15 @@ func TestResolveLoopbackConnections(t *testing.T) { { name: "raddr resolution within same netns (1)", conn: ConnectionStats{ConnectionTuple: ConnectionTuple{ - Pid: 3, - NetNS: 3, - Source: util.AddressFromString("127.0.0.1"), - SPort: 1235, - Dest: util.AddressFromString("127.0.0.1"), - DPort: 1240, + Pid: 3, + NetNS: 3, + Source: util.AddressFromString("127.0.0.1"), + SPort: 1235, + Dest: util.AddressFromString("127.0.0.1"), + DPort: 1240, + Direction: INCOMING, }, IntraHost: true, - Direction: INCOMING, ContainerID: struct { Source *intern.Value Dest *intern.Value @@ -233,15 +233,15 @@ func TestResolveLoopbackConnections(t *testing.T) { { name: "raddr resolution within same netns (2)", conn: ConnectionStats{ConnectionTuple: ConnectionTuple{ - Pid: 5, - NetNS: 3, - Source: util.AddressFromString("127.0.0.1"), - SPort: 1240, - Dest: util.AddressFromString("127.0.0.1"), - DPort: 1235, + Pid: 5, + NetNS: 3, + Source: util.AddressFromString("127.0.0.1"), + SPort: 1240, + Dest: util.AddressFromString("127.0.0.1"), + DPort: 1235, + Direction: OUTGOING, }, IntraHost: true, - Direction: OUTGOING, ContainerID: struct { Source *intern.Value Dest *intern.Value @@ -254,15 +254,15 @@ func TestResolveLoopbackConnections(t *testing.T) { { name: "raddr failed resolution, known address in different netns", conn: ConnectionStats{ConnectionTuple: ConnectionTuple{ - Pid: 5, - NetNS: 4, - Source: util.AddressFromString("127.0.0.1"), - SPort: 1240, - Dest: util.AddressFromString("127.0.0.1"), - DPort: 1235, + Pid: 5, + NetNS: 4, + Source: util.AddressFromString("127.0.0.1"), + SPort: 1240, + Dest: util.AddressFromString("127.0.0.1"), + DPort: 1235, + Direction: OUTGOING, }, IntraHost: true, - Direction: OUTGOING, ContainerID: struct { Source *intern.Value Dest *intern.Value @@ -275,14 +275,14 @@ func TestResolveLoopbackConnections(t *testing.T) { { name: "failed laddr and raddr resolution", conn: ConnectionStats{ConnectionTuple: ConnectionTuple{ - Pid: 10, - NetNS: 10, - Source: util.AddressFromString("127.0.0.1"), - SPort: 1234, - Dest: util.AddressFromString("10.1.1.1"), - DPort: 1235, - }, + Pid: 10, + NetNS: 10, + Source: util.AddressFromString("127.0.0.1"), + SPort: 1234, + Dest: util.AddressFromString("10.1.1.1"), + DPort: 1235, Direction: OUTGOING, + }, IntraHost: false, }, expectedRaddrID: "", @@ -290,14 +290,14 @@ func TestResolveLoopbackConnections(t *testing.T) { { name: "failed resolution: unknown pid for laddr, raddr address in different netns from known address", conn: ConnectionStats{ConnectionTuple: ConnectionTuple{ - Pid: 11, - NetNS: 10, - Source: util.AddressFromString("127.0.0.1"), - SPort: 1250, - Dest: util.AddressFromString("127.0.0.1"), - DPort: 1240, - }, + Pid: 11, + NetNS: 10, + Source: util.AddressFromString("127.0.0.1"), + SPort: 1250, + Dest: util.AddressFromString("127.0.0.1"), + DPort: 1240, Direction: OUTGOING, + }, IntraHost: true, }, expectedRaddrID: "", @@ -305,14 +305,14 @@ func TestResolveLoopbackConnections(t *testing.T) { { name: "localhost resolution within same netns 1/2", conn: ConnectionStats{ConnectionTuple: ConnectionTuple{ - Pid: 6, - NetNS: 7, - Source: util.AddressFromString("127.0.0.1"), - SPort: 1260, - Dest: util.AddressFromString("127.0.0.1"), - DPort: 1250, - }, + Pid: 6, + NetNS: 7, + Source: util.AddressFromString("127.0.0.1"), + SPort: 1260, + Dest: util.AddressFromString("127.0.0.1"), + DPort: 1250, Direction: OUTGOING, + }, IntraHost: true, ContainerID: struct { Source *intern.Value @@ -326,14 +326,14 @@ func TestResolveLoopbackConnections(t *testing.T) { { name: "localhost resolution within same netns 2/2", conn: ConnectionStats{ConnectionTuple: ConnectionTuple{ - Pid: 7, - NetNS: 7, - Source: util.AddressFromString("127.0.0.1"), - SPort: 1250, - Dest: util.AddressFromString("127.0.0.1"), - DPort: 1260, - }, + Pid: 7, + NetNS: 7, + Source: util.AddressFromString("127.0.0.1"), + SPort: 1250, + Dest: util.AddressFromString("127.0.0.1"), + DPort: 1260, Direction: INCOMING, + }, IntraHost: true, ContainerID: struct { Source *intern.Value @@ -347,14 +347,14 @@ func TestResolveLoopbackConnections(t *testing.T) { { name: "zero src netns failed resolution", conn: ConnectionStats{ConnectionTuple: ConnectionTuple{ - Pid: 22, - NetNS: 0, - Source: util.AddressFromString("127.0.0.1"), - SPort: 8282, - Dest: util.AddressFromString("127.0.0.1"), - DPort: 1250, - }, + Pid: 22, + NetNS: 0, + Source: util.AddressFromString("127.0.0.1"), + SPort: 8282, + Dest: util.AddressFromString("127.0.0.1"), + DPort: 1250, Direction: OUTGOING, + }, ContainerID: struct { Source *intern.Value Dest *intern.Value @@ -367,14 +367,14 @@ func TestResolveLoopbackConnections(t *testing.T) { { name: "zero src and dst netns failed resolution", conn: ConnectionStats{ConnectionTuple: ConnectionTuple{ - Pid: 21, - NetNS: 0, - Source: util.AddressFromString("127.0.0.1"), - SPort: 8181, - Dest: util.AddressFromString("127.0.0.1"), - DPort: 8282, - }, + Pid: 21, + NetNS: 0, + Source: util.AddressFromString("127.0.0.1"), + SPort: 8181, + Dest: util.AddressFromString("127.0.0.1"), + DPort: 8282, Direction: OUTGOING, + }, ContainerID: struct { Source *intern.Value Dest *intern.Value diff --git a/pkg/network/state.go b/pkg/network/state.go index 155e75e78ca07..48f07d83242d7 100644 --- a/pkg/network/state.go +++ b/pkg/network/state.go @@ -11,7 +11,6 @@ import ( "sync" "time" - "github.com/cihub/seelog" "go4.org/intern" telemetryComponent "github.com/DataDog/datadog-agent/comp/core/telemetry" @@ -565,7 +564,7 @@ func (ns *networkState) mergeByCookie(conns []ConnectionStats) ([]ConnectionStat return true } - if log.ShouldLog(seelog.TraceLvl) { + if log.ShouldLog(log.TraceLvl) { log.Tracef("duplicate connection in collection: cookie: %d, c1: %+v, c2: %+v", c.Cookie, *ck, *c) } @@ -1421,6 +1420,7 @@ func (ac *aggregateConnection) merge(c *ConnectionStats) { } ac.ProtocolStack.MergeWith(c.ProtocolStack) + ac.TLSTags.MergeWith(c.TLSTags) if ac.DNSStats == nil { ac.DNSStats = c.DNSStats @@ -1484,6 +1484,7 @@ func (ns *networkState) mergeConnectionStats(a, b *ConnectionStats) (collision b } a.ProtocolStack.MergeWith(b.ProtocolStack) + a.TLSTags.MergeWith(b.TLSTags) return false } diff --git a/pkg/network/state_test.go b/pkg/network/state_test.go index 2e6c77c8f12f7..4dfff03a85747 100644 --- a/pkg/network/state_test.go +++ b/pkg/network/state_test.go @@ -1918,13 +1918,13 @@ func TestDetermineConnectionIntraHost(t *testing.T) { { name: "local connection with nat on both sides (outgoing)", conn: ConnectionStats{ConnectionTuple: ConnectionTuple{ - Source: util.AddressFromString("1.1.1.1"), - Dest: util.AddressFromString("169.254.169.254"), - SPort: 12345, - DPort: 80, - NetNS: 1212, - }, + Source: util.AddressFromString("1.1.1.1"), + Dest: util.AddressFromString("169.254.169.254"), + SPort: 12345, + DPort: 80, + NetNS: 1212, Direction: OUTGOING, + }, IPTranslation: &IPTranslation{ ReplSrcIP: util.AddressFromString("127.0.0.1"), ReplDstIP: util.AddressFromString("1.1.1.1"), @@ -1937,13 +1937,13 @@ func TestDetermineConnectionIntraHost(t *testing.T) { { name: "local connection with nat on both sides (incoming)", conn: ConnectionStats{ConnectionTuple: ConnectionTuple{ - Source: util.AddressFromString("127.0.0.1"), - Dest: util.AddressFromString("1.1.1.1"), - SPort: 8181, - DPort: 12345, - NetNS: 1233, - }, + Source: util.AddressFromString("127.0.0.1"), + Dest: util.AddressFromString("1.1.1.1"), + SPort: 8181, + DPort: 12345, + NetNS: 1233, Direction: INCOMING, + }, IPTranslation: &IPTranslation{ ReplSrcIP: util.AddressFromString("1.1.1.1"), ReplDstIP: util.AddressFromString("169.254.169.254"), @@ -1956,13 +1956,13 @@ func TestDetermineConnectionIntraHost(t *testing.T) { { name: "remote connection with source translation (redirect)", conn: ConnectionStats{ConnectionTuple: ConnectionTuple{ - Source: util.AddressFromString("4.4.4.4"), - Dest: util.AddressFromString("2.2.2.2"), - SPort: 12345, - DPort: 80, - NetNS: 2, - }, + Source: util.AddressFromString("4.4.4.4"), + Dest: util.AddressFromString("2.2.2.2"), + SPort: 12345, + DPort: 80, + NetNS: 2, Direction: INCOMING, + }, IPTranslation: &IPTranslation{ ReplSrcIP: util.AddressFromString("2.2.2.2"), ReplDstIP: util.AddressFromString("127.0.0.1"), @@ -1975,66 +1975,66 @@ func TestDetermineConnectionIntraHost(t *testing.T) { { name: "local connection, same network ns", conn: ConnectionStats{ConnectionTuple: ConnectionTuple{ - Source: util.AddressFromString("1.1.1.1"), - Dest: util.AddressFromString("2.2.2.2"), - SPort: 12345, - DPort: 80, - NetNS: 1, - }, + Source: util.AddressFromString("1.1.1.1"), + Dest: util.AddressFromString("2.2.2.2"), + SPort: 12345, + DPort: 80, + NetNS: 1, Direction: OUTGOING, }, + }, intraHost: true, }, { name: "local connection, same network ns", conn: ConnectionStats{ConnectionTuple: ConnectionTuple{ - Source: util.AddressFromString("2.2.2.2"), - Dest: util.AddressFromString("1.1.1.1"), - SPort: 80, - DPort: 12345, - NetNS: 1, - }, + Source: util.AddressFromString("2.2.2.2"), + Dest: util.AddressFromString("1.1.1.1"), + SPort: 80, + DPort: 12345, + NetNS: 1, Direction: INCOMING, - }, + }}, + intraHost: true, }, { name: "local connection, different network ns", conn: ConnectionStats{ConnectionTuple: ConnectionTuple{ - Source: util.AddressFromString("1.1.1.1"), - Dest: util.AddressFromString("2.2.2.2"), - SPort: 12345, - DPort: 80, - NetNS: 1, - }, + Source: util.AddressFromString("1.1.1.1"), + Dest: util.AddressFromString("2.2.2.2"), + SPort: 12345, + DPort: 80, + NetNS: 1, Direction: OUTGOING, }, + }, intraHost: true, }, { name: "local connection, different network ns", conn: ConnectionStats{ConnectionTuple: ConnectionTuple{ - Source: util.AddressFromString("2.2.2.2"), - Dest: util.AddressFromString("1.1.1.1"), - SPort: 80, - DPort: 12345, - NetNS: 2, - }, + Source: util.AddressFromString("2.2.2.2"), + Dest: util.AddressFromString("1.1.1.1"), + SPort: 80, + DPort: 12345, + NetNS: 2, Direction: INCOMING, }, + }, intraHost: true, }, { name: "remote connection", conn: ConnectionStats{ConnectionTuple: ConnectionTuple{ - Source: util.AddressFromString("1.1.1.1"), - Dest: util.AddressFromString("3.3.3.3"), - SPort: 12345, - DPort: 80, - NetNS: 1, - }, + Source: util.AddressFromString("1.1.1.1"), + Dest: util.AddressFromString("3.3.3.3"), + SPort: 12345, + DPort: 80, + NetNS: 1, Direction: OUTGOING, }, + }, intraHost: false, }, } @@ -2071,81 +2071,81 @@ func TestIntraHostFixDirection(t *testing.T) { { name: "outgoing both non-ephemeral", conn: ConnectionStats{ConnectionTuple: ConnectionTuple{ - Source: util.AddressFromString("1.1.1.1"), - Dest: util.AddressFromString("1.1.1.1"), - SPort: 123, - DPort: 456, + Source: util.AddressFromString("1.1.1.1"), + Dest: util.AddressFromString("1.1.1.1"), + SPort: 123, + DPort: 456, + Direction: OUTGOING, }, IntraHost: true, - Direction: OUTGOING, }, direction: OUTGOING, }, { name: "outgoing non ephemeral to ephemeral", conn: ConnectionStats{ConnectionTuple: ConnectionTuple{ - Source: util.AddressFromString("1.1.1.1"), - Dest: util.AddressFromString("1.1.1.1"), - SPort: 123, - DPort: 49612, + Source: util.AddressFromString("1.1.1.1"), + Dest: util.AddressFromString("1.1.1.1"), + SPort: 123, + DPort: 49612, + Direction: OUTGOING, }, IntraHost: true, - Direction: OUTGOING, }, direction: INCOMING, }, { name: "outgoing ephemeral to non ephemeral", conn: ConnectionStats{ConnectionTuple: ConnectionTuple{ - Source: util.AddressFromString("1.1.1.1"), - Dest: util.AddressFromString("1.1.1.1"), - SPort: 49612, - DPort: 123, + Source: util.AddressFromString("1.1.1.1"), + Dest: util.AddressFromString("1.1.1.1"), + SPort: 49612, + DPort: 123, + Direction: OUTGOING, }, IntraHost: true, - Direction: OUTGOING, }, direction: OUTGOING, }, { name: "incoming udp non ephemeral to ephemeral", conn: ConnectionStats{ConnectionTuple: ConnectionTuple{ - Type: UDP, - Source: util.AddressFromString("1.1.1.1"), - Dest: util.AddressFromString("1.1.1.1"), - SPort: 49612, - DPort: 123, + Type: UDP, + Source: util.AddressFromString("1.1.1.1"), + Dest: util.AddressFromString("1.1.1.1"), + SPort: 49612, + DPort: 123, + Direction: INCOMING, }, IntraHost: true, - Direction: INCOMING, }, direction: OUTGOING, }, { name: "incoming udp ephemeral to non ephemeral", conn: ConnectionStats{ConnectionTuple: ConnectionTuple{ - Type: UDP, - Source: util.AddressFromString("1.1.1.1"), - Dest: util.AddressFromString("1.1.1.1"), - SPort: 123, - DPort: 49612, + Type: UDP, + Source: util.AddressFromString("1.1.1.1"), + Dest: util.AddressFromString("1.1.1.1"), + SPort: 123, + DPort: 49612, + Direction: INCOMING, }, IntraHost: true, - Direction: INCOMING, }, direction: INCOMING, }, { name: "incoming tcp non ephemeral to ephemeral", conn: ConnectionStats{ConnectionTuple: ConnectionTuple{ - Type: TCP, - Source: util.AddressFromString("1.1.1.1"), - Dest: util.AddressFromString("1.1.1.1"), - SPort: 49612, - DPort: 123, + Type: TCP, + Source: util.AddressFromString("1.1.1.1"), + Dest: util.AddressFromString("1.1.1.1"), + SPort: 49612, + DPort: 123, + Direction: INCOMING, }, IntraHost: true, - Direction: INCOMING, }, direction: INCOMING, }, @@ -2395,17 +2395,17 @@ func TestKafkaStatsWithMultipleClients(t *testing.T) { func TestConnectionRollup(t *testing.T) { conns := []ConnectionStats{ {ConnectionTuple: ConnectionTuple{ - Source: util.AddressFromString("172.29.141.26"), - SPort: 50010, - Family: AFINET, - NetNS: 4026532341, - Pid: 28385, - Dest: util.AddressFromString("10.100.0.10"), - DPort: 53, - Type: UDP, + Source: util.AddressFromString("172.29.141.26"), + SPort: 50010, + Family: AFINET, + NetNS: 4026532341, + Pid: 28385, + Dest: util.AddressFromString("10.100.0.10"), + DPort: 53, + Type: UDP, + Direction: OUTGOING, }, // should be rolled up with next connection - Direction: OUTGOING, IntraHost: false, IPTranslation: &IPTranslation{ ReplDstIP: util.AddressFromString("172.29.141.26"), @@ -2429,17 +2429,17 @@ func TestConnectionRollup(t *testing.T) { IsClosed: true, }, {ConnectionTuple: ConnectionTuple{ - Source: util.AddressFromString("172.29.141.26"), - SPort: 49155, - Family: AFINET, - NetNS: 4026532341, - Pid: 28385, - Dest: util.AddressFromString("10.100.0.10"), - DPort: 53, - Type: UDP, + Source: util.AddressFromString("172.29.141.26"), + SPort: 49155, + Family: AFINET, + NetNS: 4026532341, + Pid: 28385, + Dest: util.AddressFromString("10.100.0.10"), + DPort: 53, + Type: UDP, + Direction: OUTGOING, }, // should be rolled up with previous connection - Direction: OUTGOING, IntraHost: false, IPTranslation: &IPTranslation{ ReplDstIP: util.AddressFromString("172.29.141.26"), @@ -2463,17 +2463,17 @@ func TestConnectionRollup(t *testing.T) { IsClosed: true, }, {ConnectionTuple: ConnectionTuple{ - Family: AFINET, - Source: util.AddressFromString("172.29.141.26"), - SPort: 52907, - NetNS: 4026532341, - Pid: 28385, - Dest: util.AddressFromString("10.100.0.10"), - DPort: 53, - Type: UDP, + Family: AFINET, + Source: util.AddressFromString("172.29.141.26"), + SPort: 52907, + NetNS: 4026532341, + Pid: 28385, + Dest: util.AddressFromString("10.100.0.10"), + DPort: 53, + Type: UDP, + Direction: OUTGOING, }, // should be rolled up with next connection - Direction: OUTGOING, IntraHost: false, IPTranslation: &IPTranslation{ ReplDstIP: util.AddressFromString("172.29.141.26"), @@ -2497,17 +2497,17 @@ func TestConnectionRollup(t *testing.T) { IsClosed: true, }, {ConnectionTuple: ConnectionTuple{ - Family: AFINET, - Source: util.AddressFromString("172.29.141.26"), - SPort: 52904, - NetNS: 4026532341, - Pid: 28385, - Dest: util.AddressFromString("10.100.0.10"), - DPort: 53, - Type: UDP, + Family: AFINET, + Source: util.AddressFromString("172.29.141.26"), + SPort: 52904, + NetNS: 4026532341, + Pid: 28385, + Dest: util.AddressFromString("10.100.0.10"), + DPort: 53, + Type: UDP, + Direction: OUTGOING, }, // should be rolled up with previous connection - Direction: OUTGOING, IntraHost: false, IPTranslation: &IPTranslation{ ReplDstIP: util.AddressFromString("172.29.141.26"), @@ -2531,17 +2531,17 @@ func TestConnectionRollup(t *testing.T) { IsClosed: true, }, {ConnectionTuple: ConnectionTuple{ - Family: AFINET, - Source: util.AddressFromString("172.29.141.26"), - SPort: 37240, - NetNS: 4026532341, - Pid: 28385, - Dest: util.AddressFromString("10.100.0.10"), - DPort: 53, - Type: UDP, + Family: AFINET, + Source: util.AddressFromString("172.29.141.26"), + SPort: 37240, + NetNS: 4026532341, + Pid: 28385, + Dest: util.AddressFromString("10.100.0.10"), + DPort: 53, + Type: UDP, + Direction: OUTGOING, }, // this should not be rolled up as the duration is > 2 mins - Direction: OUTGOING, IntraHost: false, IPTranslation: &IPTranslation{ ReplDstIP: util.AddressFromString("172.29.141.26"), @@ -2565,14 +2565,15 @@ func TestConnectionRollup(t *testing.T) { IsClosed: true, }, {ConnectionTuple: ConnectionTuple{ - Pid: 5652, - Source: util.AddressFromString("172.29.160.125"), - SPort: 8443, - Dest: util.AddressFromString("172.29.166.243"), - DPort: 38633, - Family: AFINET, - Type: TCP, - NetNS: 4026531992, + Pid: 5652, + Source: util.AddressFromString("172.29.160.125"), + SPort: 8443, + Dest: util.AddressFromString("172.29.166.243"), + DPort: 38633, + Family: AFINET, + Type: TCP, + NetNS: 4026531992, + Direction: INCOMING, }, ContainerID: struct{ Source, Dest *intern.Value }{Source: intern.GetByString("403ca32ba9b1c3955ba79a84039c9de34d81c83aa3a27ece70b19b3df84c9460")}, SPortIsEphemeral: EphemeralFalse, @@ -2584,7 +2585,6 @@ func TestConnectionRollup(t *testing.T) { RecvPackets: 3, TCPEstablished: 1, }, - Direction: INCOMING, RTT: 262, RTTVar: 131, IntraHost: false, @@ -2593,14 +2593,15 @@ func TestConnectionRollup(t *testing.T) { IsClosed: true, }, {ConnectionTuple: ConnectionTuple{ - Pid: 5652, - Source: util.AddressFromString("172.29.160.125"), - SPort: 8443, - Dest: util.AddressFromString("172.29.154.189"), - DPort: 60509, - Family: AFINET, - Type: TCP, - NetNS: 4026531992, + Pid: 5652, + Source: util.AddressFromString("172.29.160.125"), + SPort: 8443, + Dest: util.AddressFromString("172.29.154.189"), + DPort: 60509, + Family: AFINET, + Type: TCP, + NetNS: 4026531992, + Direction: INCOMING, }, ContainerID: struct{ Source, Dest *intern.Value }{Source: intern.GetByString("403ca32ba9b1c3955ba79a84039c9de34d81c83aa3a27ece70b19b3df84c9460")}, SPortIsEphemeral: EphemeralFalse, @@ -2612,7 +2613,6 @@ func TestConnectionRollup(t *testing.T) { RecvPackets: 3, TCPEstablished: 1, }, - Direction: INCOMING, RTT: 254, RTTVar: 127, IntraHost: false, @@ -2621,14 +2621,15 @@ func TestConnectionRollup(t *testing.T) { IsClosed: true, }, {ConnectionTuple: ConnectionTuple{ - Pid: 5652, - Source: util.AddressFromString("172.29.160.125"), - SPort: 8443, - Dest: util.AddressFromString("172.29.166.243"), - DPort: 34715, - Family: AFINET, - Type: TCP, - NetNS: 4026531992, + Pid: 5652, + Source: util.AddressFromString("172.29.160.125"), + SPort: 8443, + Dest: util.AddressFromString("172.29.166.243"), + DPort: 34715, + Family: AFINET, + Type: TCP, + NetNS: 4026531992, + Direction: INCOMING, }, ContainerID: struct{ Source, Dest *intern.Value }{Source: intern.GetByString("403ca32ba9b1c3955ba79a84039c9de34d81c83aa3a27ece70b19b3df84c9460")}, SPortIsEphemeral: EphemeralFalse, @@ -2640,7 +2641,6 @@ func TestConnectionRollup(t *testing.T) { RecvPackets: 8, TCPEstablished: 1, }, - Direction: INCOMING, RTT: 250, RTTVar: 66, IntraHost: false, @@ -2816,31 +2816,31 @@ func TestFilterConnections(t *testing.T) { func TestDNSPIDCollision(t *testing.T) { conns := []ConnectionStats{ {ConnectionTuple: ConnectionTuple{ - Source: util.AddressFromString("10.1.1.1"), - Dest: util.AddressFromString("8.8.8.8"), - Pid: 1, - SPort: 1000, - DPort: 53, - Type: UDP, - Family: AFINET, - }, + Source: util.AddressFromString("10.1.1.1"), + Dest: util.AddressFromString("8.8.8.8"), + Pid: 1, + SPort: 1000, + DPort: 53, + Type: UDP, + Family: AFINET, Direction: LOCAL, - Cookie: 1, + }, + Cookie: 1, Monotonic: StatCounters{ RecvBytes: 2, }, }, {ConnectionTuple: ConnectionTuple{ - Source: util.AddressFromString("10.1.1.1"), - Dest: util.AddressFromString("8.8.8.8"), - Pid: 2, - SPort: 1000, - DPort: 53, - Type: UDP, - Family: AFINET, - }, + Source: util.AddressFromString("10.1.1.1"), + Dest: util.AddressFromString("8.8.8.8"), + Pid: 2, + SPort: 1000, + DPort: 53, + Type: UDP, + Family: AFINET, Direction: LOCAL, - Cookie: 2, + }, + Cookie: 2, Monotonic: StatCounters{ RecvBytes: 2, }, diff --git a/pkg/network/tracer/chain_conntracker.go b/pkg/network/tracer/chain_conntracker.go new file mode 100644 index 0000000000000..9725b1df2143e --- /dev/null +++ b/pkg/network/tracer/chain_conntracker.go @@ -0,0 +1,106 @@ +// 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_bpf + +// Package tracer implements the functionality of the network tracer +package tracer + +import ( + "context" + + "github.com/prometheus/client_golang/prometheus" + + "github.com/DataDog/datadog-agent/pkg/network" + "github.com/DataDog/datadog-agent/pkg/network/netlink" +) + +type chainConntracker struct { + ctks []netlink.Conntracker +} + +func chainConntrackers(ctks ...netlink.Conntracker) netlink.Conntracker { + if len(ctks) == 1 { + return ctks[0] + } + + // filter out no-ops + filtered := ctks[:0] + for _, ctk := range ctks { + if ctk != nil && ctk.GetType() != "" { + filtered = append(filtered, ctk) + } + } + + if len(filtered) == 0 { + return netlink.NewNoOpConntracker() + } + + if len(filtered) == 1 { + return filtered[0] + } + + return &chainConntracker{ + ctks: filtered, + } +} + +// Describe returns all descriptions of the collector +func (ct *chainConntracker) Describe(descs chan<- *prometheus.Desc) { + for _, ctk := range ct.ctks { + ctk.Describe(descs) + } +} + +// Collect returns the current state of all metrics of the collector +func (ct *chainConntracker) Collect(metrics chan<- prometheus.Metric) { + for _, ctk := range ct.ctks { + ctk.Collect(metrics) + } +} + +func (ct *chainConntracker) GetTranslationForConn(c *network.ConnectionTuple) *network.IPTranslation { + for _, ctk := range ct.ctks { + if trans := ctk.GetTranslationForConn(c); trans != nil { + return trans + } + } + + return nil +} + +// GetType returns a string describing whether the conntracker is "ebpf" or "netlink" +func (ct *chainConntracker) GetType() string { + return "chain" +} + +func (ct *chainConntracker) DeleteTranslation(c *network.ConnectionTuple) { + for _, ctk := range ct.ctks { + ctk.DeleteTranslation(c) + } +} + +func (ct *chainConntracker) DumpCachedTable(ctx context.Context) (map[uint32][]netlink.DebugConntrackEntry, error) { + res := map[uint32][]netlink.DebugConntrackEntry{} + for _, ctk := range ct.ctks { + var m map[uint32][]netlink.DebugConntrackEntry + var err error + if m, err = ctk.DumpCachedTable(ctx); err != nil { + return res, err + } + + for k, v := range m { + res[k] = append(res[k], v...) + } + } + + return res, nil +} + +func (ct *chainConntracker) Close() { + for _, ctk := range ct.ctks { + ctk.Close() + } +} diff --git a/pkg/network/tracer/cilium_lb.go b/pkg/network/tracer/cilium_lb.go new file mode 100644 index 0000000000000..ca22db0ce5ab7 --- /dev/null +++ b/pkg/network/tracer/cilium_lb.go @@ -0,0 +1,295 @@ +// 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_bpf + +package tracer + +import ( + "context" + "encoding/binary" + "errors" + "fmt" + "net" + "sync" + "time" + "unsafe" + + "github.com/cilium/ebpf" + "github.com/prometheus/client_golang/prometheus" + "golang.org/x/sys/unix" + + "github.com/DataDog/datadog-agent/pkg/ebpf/maps" + "github.com/DataDog/datadog-agent/pkg/network" + "github.com/DataDog/datadog-agent/pkg/network/config" + "github.com/DataDog/datadog-agent/pkg/network/netlink" + "github.com/DataDog/datadog-agent/pkg/process/util" + "github.com/DataDog/datadog-agent/pkg/telemetry" + "github.com/DataDog/datadog-agent/pkg/util/log" +) + +const ( + //revive:disable + // from github.com/cilium/cilium/pkg/maps/ctmap/lookup.go + TUPLE_F_OUT = 0 + TUPLE_F_IN = 1 + TUPLE_F_RELATED = 2 + TUPLE_F_SERVICE = 4 + //revive:enable +) + +const ciliumConntrackerModuleName = "network_tracer__cilium_conntracker" + +var ciliumConntrackerTelemetry = struct { + getsDuration telemetry.Histogram + getsTotal telemetry.Counter +}{ + telemetry.NewHistogram(ciliumConntrackerModuleName, "gets_duration_nanoseconds", []string{}, "Histogram measuring the time spent retrieving connection tuples from the EBPF map", defaultBuckets), + telemetry.NewCounter(ciliumConntrackerModuleName, "gets_total", []string{}, "Counter measuring the total number of attempts to get connection tuples from the EBPF map"), +} + +type tupleKey4 struct { + DestAddr [4]byte + SourceAddr [4]byte + SourcePort uint16 + DestPort uint16 + NextHeader uint8 + Flags uint8 +} + +type ctEntry struct { + Reserved0 uint64 + BackendID uint64 + Packets uint64 + Bytes uint64 + Lifetime uint32 + Flags uint16 + // RevNAT is in network byte order + RevNAT uint16 + IfIndex uint16 + TxFlagsSeen uint8 + RxFlagsSeen uint8 + SourceSecurityID uint32 + LastTxReport uint32 + LastRxReport uint32 +} + +type backend4KeyV3 struct { + ID uint32 +} + +type backend4ValueV3 struct { + Address [4]byte + Port uint16 + Proto uint8 + Flags uint8 + ClusterID uint16 + Zone uint8 + Pad uint8 +} + +type backend struct { + addr util.Address + port uint16 +} + +type ciliumLoadBalancerConntracker struct { + m sync.Mutex + backends *maps.GenericMap[backend4KeyV3, backend4ValueV3] + ctTCP, ctUDP *maps.GenericMap[tupleKey4, ctEntry] + backendIDToBackend map[uint32]backend + stop chan struct{} + closeOnce sync.Once +} + +func newCiliumLoadBalancerConntracker(cfg *config.Config) (netlink.Conntracker, error) { + if !cfg.EnableCiliumLBConntracker { + return netlink.NewNoOpConntracker(), nil + } + + ctTCP, err := ebpf.LoadPinnedMap("/sys/fs/bpf/tc/globals/cilium_ct4_global", &ebpf.LoadPinOptions{ + ReadOnly: true, + }) + if err != nil { + return nil, fmt.Errorf("error loading pinned ct TCP map: %w", err) + } + + ctUDP, err := ebpf.LoadPinnedMap("/sys/fs/bpf/tc/globals/cilium_ct_any4_global", &ebpf.LoadPinOptions{ + ReadOnly: true, + }) + if err != nil { + return nil, fmt.Errorf("error loading pinned ct UDP map: %w", err) + } + + backends, err := ebpf.LoadPinnedMap("/sys/fs/bpf/tc/globals/cilium_lb4_backends_v3", &ebpf.LoadPinOptions{ + ReadOnly: true, + }) + if err != nil { + return nil, fmt.Errorf("error loading pinned backends map: %w", err) + } + + clb := &ciliumLoadBalancerConntracker{ + backendIDToBackend: make(map[uint32]backend), + } + if clb.ctTCP, err = maps.Map[tupleKey4, ctEntry](ctTCP); err != nil { + return nil, fmt.Errorf("could not make generic map for ct TCP map: %w", err) + } + if clb.ctUDP, err = maps.Map[tupleKey4, ctEntry](ctUDP); err != nil { + return nil, fmt.Errorf("could not make generic map for ct UDP map: %w", err) + } + if clb.backends, err = maps.Map[backend4KeyV3, backend4ValueV3](backends); err != nil { + return nil, fmt.Errorf("could not make generic map for backends map: %w", err) + } + + clb.stop = make(chan struct{}) + go func() { + tick := time.NewTicker(10 * time.Second) + defer tick.Stop() + for { + select { + case <-tick.C: + clb.updateBackends() + case <-clb.stop: + close(clb.stop) + return + } + } + }() + + return clb, nil +} + +func ntohs(n uint16) uint16 { + return binary.BigEndian.Uint16([]byte{byte(n), byte(n >> 8)}) +} + +func htons(n uint16) uint16 { + b := make([]byte, 2) + binary.BigEndian.PutUint16(b, n) + return *(*uint16)(unsafe.Pointer(&b[0])) +} + +func (clb *ciliumLoadBalancerConntracker) updateBackends() { + clb.m.Lock() + defer clb.m.Unlock() + + it := clb.backends.Iterate() + var k backend4KeyV3 + var v backend4ValueV3 + for it.Next(&k, &v) { + clb.backendIDToBackend[k.ID] = backend{ + addr: util.AddressFromNetIP(net.IPv4(v.Address[0], v.Address[1], v.Address[2], v.Address[3])), + port: ntohs(v.Port), + } + } + + if it.Err() != nil { + log.Warnf("error iterating lb backends map: %s", it.Err()) + } +} + +// Describe returns all descriptions of the collector +func (clb *ciliumLoadBalancerConntracker) Describe(chan<- *prometheus.Desc) { +} + +// Collect returns the current state of all metrics of the collector +func (clb *ciliumLoadBalancerConntracker) Collect(chan<- prometheus.Metric) { +} + +// GetTranslationForConn returns the network address translation for a given connection tuple +func (clb *ciliumLoadBalancerConntracker) GetTranslationForConn(c *network.ConnectionTuple) *network.IPTranslation { + // TODO: add ipv6 support + if c.Family != network.AFINET { + return nil + } + + if c.Direction != network.OUTGOING { + return nil + } + + if c.Dest.IsLoopback() { + return nil + } + + startTime := time.Now() + defer func() { + ciliumConntrackerTelemetry.getsTotal.Inc() + ciliumConntrackerTelemetry.getsDuration.Observe(float64(time.Since(startTime).Nanoseconds())) + }() + + queryMap := clb.ctTCP + t := tupleKey4{ + Flags: TUPLE_F_OUT | TUPLE_F_SERVICE, + NextHeader: uint8(unix.IPPROTO_TCP), + SourcePort: htons(c.SPort), + DestPort: htons(c.DPort), + SourceAddr: c.Source.As4(), + DestAddr: c.Dest.As4(), + } + if c.Type == network.UDP { + t.NextHeader = unix.IPPROTO_UDP + queryMap = clb.ctUDP + } + + log.TraceFunc(func() string { + return fmt.Sprintf("looking up tuple %+v in ct map", t) + }) + + var ctEntry ctEntry + var err error + if err = queryMap.Lookup(&t, &ctEntry); err != nil { + if !errors.Is(err, ebpf.ErrKeyNotExist) { + log.Warnf("error looking up %+v in ct map: %s", t, err) + } + + log.TraceFunc(func() string { + return fmt.Sprintf("lookup failed for %+v in ct map", t) + }) + + return nil + } + + log.TraceFunc(func() string { + return fmt.Sprintf("found ct entry for %+v: %+v", t, ctEntry) + }) + + clb.m.Lock() + defer clb.m.Unlock() + + if b, ok := clb.backendIDToBackend[uint32(ctEntry.BackendID)]; ok && (b.addr != c.Dest || b.port != c.DPort) { + return &network.IPTranslation{ + ReplDstIP: c.Source, + ReplDstPort: c.SPort, + ReplSrcIP: b.addr, + ReplSrcPort: b.port, + } + } + + return nil +} + +// GetType returns a string describing the conntracker type +func (clb *ciliumLoadBalancerConntracker) GetType() string { + return "cilium_lb" +} + +// DeleteTranslation delete the network address translation for a tuple +func (clb *ciliumLoadBalancerConntracker) DeleteTranslation(*network.ConnectionTuple) { +} + +// DumpCachedTable dumps the in-memory address translation table +func (clb *ciliumLoadBalancerConntracker) DumpCachedTable(context.Context) (map[uint32][]netlink.DebugConntrackEntry, error) { + return nil, nil +} + +// Close closes the conntracker +func (clb *ciliumLoadBalancerConntracker) Close() { + clb.closeOnce.Do(func() { + clb.stop <- struct{}{} + <-clb.stop + clb.ctTCP.Map().Close() + clb.backends.Map().Close() + }) +} diff --git a/pkg/network/tracer/connection/ebpf_tracer.go b/pkg/network/tracer/connection/ebpf_tracer.go index ba58ada66b19c..5f9284f62ea39 100644 --- a/pkg/network/tracer/connection/ebpf_tracer.go +++ b/pkg/network/tracer/connection/ebpf_tracer.go @@ -17,11 +17,9 @@ import ( manager "github.com/DataDog/ebpf-manager" "github.com/DataDog/ebpf-manager/tracefs" - "github.com/cihub/seelog" "github.com/cilium/ebpf" "github.com/prometheus/client_golang/prometheus" "go.uber.org/atomic" - "golang.org/x/sys/unix" telemetryComponent "github.com/DataDog/datadog-agent/comp/core/telemetry" ddebpf "github.com/DataDog/datadog-agent/pkg/ebpf" @@ -32,6 +30,7 @@ import ( netebpf "github.com/DataDog/datadog-agent/pkg/network/ebpf" "github.com/DataDog/datadog-agent/pkg/network/ebpf/probes" "github.com/DataDog/datadog-agent/pkg/network/protocols" + "github.com/DataDog/datadog-agent/pkg/network/protocols/tls" "github.com/DataDog/datadog-agent/pkg/network/tracer/connection/fentry" "github.com/DataDog/datadog-agent/pkg/network/tracer/connection/kprobe" "github.com/DataDog/datadog-agent/pkg/network/tracer/connection/util" @@ -46,6 +45,7 @@ const ( ) var tcpOngoingConnectMapTTL = 30 * time.Minute.Nanoseconds() +var tlsTagsMapTTL = 3 * time.Minute.Nanoseconds() var EbpfTracerTelemetry = struct { //nolint:revive // TODO connections telemetry.Gauge @@ -151,6 +151,8 @@ type ebpfTracer struct { // periodically clean the ongoing connection pid map ongoingConnectCleaner *ddebpf.MapCleaner[netebpf.SkpConn, netebpf.PidTs] + // periodically clean the enhanced TLS tags map + TLSTagsCleaner *ddebpf.MapCleaner[netebpf.ConnTuple, netebpf.TLSTagsWrapper] removeTuple *netebpf.ConnTuple @@ -171,16 +173,7 @@ func newEbpfTracer(config *config.Config, _ telemetryComponent.Component) (Trace } mgrOptions := manager.Options{ - // Extend RLIMIT_MEMLOCK (8) size - // On some systems, the default for RLIMIT_MEMLOCK may be as low as 64 bytes. - // This will result in an EPERM (Operation not permitted) error, when trying to create an eBPF map - // using bpf(2) with BPF_MAP_CREATE. - // - // We are setting the limit to infinity until we have a better handle on the true requirements. - RLimit: &unix.Rlimit{ - Cur: math.MaxUint64, - Max: math.MaxUint64, - }, + RemoveRlimit: true, MapSpecEditors: map[string]manager.MapSpecEditor{ probes.ConnMap: {MaxEntries: config.MaxTrackedConnections, EditorFlag: manager.EditMaxEntries}, probes.TCPStatsMap: {MaxEntries: config.MaxTrackedConnections, EditorFlag: manager.EditMaxEntries}, @@ -188,6 +181,7 @@ func newEbpfTracer(config *config.Config, _ telemetryComponent.Component) (Trace probes.PortBindingsMap: {MaxEntries: config.MaxTrackedConnections, EditorFlag: manager.EditMaxEntries}, probes.UDPPortBindingsMap: {MaxEntries: config.MaxTrackedConnections, EditorFlag: manager.EditMaxEntries}, probes.ConnectionProtocolMap: {MaxEntries: config.MaxTrackedConnections, EditorFlag: manager.EditMaxEntries}, + probes.EnhancedTLSTagsMap: {MaxEntries: config.MaxTrackedConnections, EditorFlag: manager.EditMaxEntries}, probes.ConnectionTupleToSocketSKBConnMap: {MaxEntries: config.MaxTrackedConnections, EditorFlag: manager.EditMaxEntries}, probes.TCPOngoingConnectPid: {MaxEntries: config.MaxTrackedConnections, EditorFlag: manager.EditMaxEntries}, probes.TCPRecvMsgArgsMap: {MaxEntries: config.MaxTrackedConnections / 32, EditorFlag: manager.EditMaxEntries}, @@ -272,7 +266,7 @@ func newEbpfTracer(config *config.Config, _ telemetryComponent.Component) (Trace ch: newCookieHasher(), } - tr.setupMapCleaner(m) + tr.setupMapCleaners(m) tr.conns, err = maps.GetMap[netebpf.ConnTuple, netebpf.ConnStats](m, probes.ConnMap) if err != nil { @@ -351,6 +345,7 @@ func (t *ebpfTracer) Stop() { _ = t.m.Stop(manager.CleanAll) t.closeConsumer.Stop() t.ongoingConnectCleaner.Stop() + t.TLSTagsCleaner.Stop() if t.closeTracer != nil { t.closeTracer() } @@ -501,7 +496,7 @@ func (t *ebpfTracer) getEBPFTelemetry() *netebpf.Telemetry { if err := mp.Lookup(&zero, tm); err != nil { // This can happen if we haven't initialized the telemetry object yet // so let's just use a trace log - if log.ShouldLog(seelog.TraceLvl) { + if log.ShouldLog(log.TraceLvl) { log.Tracef("error retrieving the telemetry struct: %s", err) } return nil @@ -694,8 +689,14 @@ func (t *ebpfTracer) getTCPStats(stats *netebpf.TCPStats, tuple *netebpf.ConnTup return t.tcpStats.Lookup(tuple, stats) == nil } -// setupMapCleaner sets up a map cleaner for the tcp_ongoing_connect_pid map -func (t *ebpfTracer) setupMapCleaner(m *manager.Manager) { +// setupMapCleaners sets up the map cleaners for the eBPF maps +func (t *ebpfTracer) setupMapCleaners(m *manager.Manager) { + t.setupOngoingConnectMapCleaner(m) + t.setupTLSTagsMapCleaner(m) +} + +// setupOngoingConnectMapCleaner sets up a map cleaner for the tcp_ongoing_connect_pid map +func (t *ebpfTracer) setupOngoingConnectMapCleaner(m *manager.Manager) { tcpOngoingConnectPidMap, _, err := m.GetMap(probes.TCPOngoingConnectPid) if err != nil { log.Errorf("error getting %v map: %s", probes.TCPOngoingConnectPid, err) @@ -719,6 +720,28 @@ func (t *ebpfTracer) setupMapCleaner(m *manager.Manager) { t.ongoingConnectCleaner = tcpOngoingConnectPidCleaner } +// setupTLSTagsMapCleaner sets up a map cleaner for the tls_enhanced_tags map +func (t *ebpfTracer) setupTLSTagsMapCleaner(m *manager.Manager) { + TLSTagsMap, _, err := m.GetMap(probes.EnhancedTLSTagsMap) + if err != nil { + log.Errorf("error getting %v map: %s", probes.EnhancedTLSTagsMap, err) + return + } + + TLSTagsMapCleaner, err := ddebpf.NewMapCleaner[netebpf.ConnTuple, netebpf.TLSTagsWrapper](TLSTagsMap, 1024, probes.EnhancedTLSTagsMap, "npm_tracer") + if err != nil { + log.Errorf("error creating map cleaner: %s", err) + return + } + // slight jitter to avoid all maps being cleaned at the same time + TLSTagsMapCleaner.Clean(time.Second*70, nil, nil, func(now int64, _ netebpf.ConnTuple, val netebpf.TLSTagsWrapper) bool { + ts := int64(val.Updated) + return ts > 0 && now-ts > tlsTagsMapTTL + }) + + t.TLSTagsCleaner = TLSTagsMapCleaner +} + func populateConnStats(stats *network.ConnectionStats, t *netebpf.ConnTuple, s *netebpf.ConnStats, ch *cookieHasher) { *stats = network.ConnectionStats{ConnectionTuple: network.ConnectionTuple{ Pid: t.Pid, @@ -749,6 +772,12 @@ func populateConnStats(stats *network.ConnectionStats, t *netebpf.ConnTuple, s * Encryption: protocols.Encryption(s.Protocol_stack.Encryption), } + stats.TLSTags = tls.Tags{ + ChosenVersion: s.Tls_tags.Chosen_version, + CipherSuite: s.Tls_tags.Cipher_suite, + OfferedVersions: s.Tls_tags.Offered_versions, + } + if t.Type() == netebpf.TCP { stats.Type = network.TCP } else { diff --git a/pkg/network/tracer/connection/ebpfless/map_utils.go b/pkg/network/tracer/connection/ebpfless/map_utils.go new file mode 100644 index 0000000000000..3e41f4832707d --- /dev/null +++ b/pkg/network/tracer/connection/ebpfless/map_utils.go @@ -0,0 +1,19 @@ +// 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 + +package ebpfless + +// WriteMapWithSizeLimit updates a map via m[key] = val. +// However, if the map would overflow sizeLimit, it returns false instead. +func WriteMapWithSizeLimit[Key comparable, Val any](m map[Key]Val, key Key, val Val, sizeLimit int) bool { + _, exists := m[key] + if !exists && len(m) >= sizeLimit { + return false + } + m[key] = val + return true +} diff --git a/pkg/network/tracer/connection/ebpfless/map_utils_test.go b/pkg/network/tracer/connection/ebpfless/map_utils_test.go new file mode 100644 index 0000000000000..e387328d00610 --- /dev/null +++ b/pkg/network/tracer/connection/ebpfless/map_utils_test.go @@ -0,0 +1,38 @@ +// 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 + +package ebpfless + +import ( + "github.com/stretchr/testify/require" + "testing" +) + +func TestWriteMapWithSizeLimit(t *testing.T) { + m := map[string]int{} + + // not full: any write should work + ok := WriteMapWithSizeLimit(m, "foo", 123, 1) + require.True(t, ok) + + expectedFoo := map[string]int{ + "foo": 123, + } + require.Equal(t, expectedFoo, m) + + // full: shouldn't write a new key + ok = WriteMapWithSizeLimit(m, "bar", 456, 1) + require.False(t, ok) + require.Equal(t, expectedFoo, m) + + // full: replacing key should still work + ok = WriteMapWithSizeLimit(m, "foo", 789, 1) + require.True(t, ok) + require.Equal(t, map[string]int{ + "foo": 789, + }, m) +} diff --git a/pkg/network/tracer/connection/ebpfless/tcp_processor.go b/pkg/network/tracer/connection/ebpfless/tcp_processor.go index b312f460269ee..73ea6a1152aa3 100644 --- a/pkg/network/tracer/connection/ebpfless/tcp_processor.go +++ b/pkg/network/tracer/connection/ebpfless/tcp_processor.go @@ -9,6 +9,7 @@ package ebpfless import ( "fmt" + "github.com/DataDog/datadog-agent/pkg/util/log" "syscall" "time" @@ -17,7 +18,7 @@ import ( "github.com/google/gopacket/layers" "github.com/DataDog/datadog-agent/pkg/network" - "github.com/DataDog/datadog-agent/pkg/util/log" + "github.com/DataDog/datadog-agent/pkg/network/config" ) type connectionState struct { @@ -51,18 +52,40 @@ type connectionState struct { // remoteFinSeq is the tcp.Seq number for the incoming FIN (including any payload length) remoteFinSeq uint32 + // rttTracker is used to track round trip times rttTracker rttTracker + + // lastUpdateEpoch contains the last timestamp this connection sent/received a packet + // TODO find a way to combine this with ConnectionStats.lastUpdateEpoch + // This exists because connections in pendingConns don't have a ConnectionStats object yet. + // Can we make all connections in TCPProcessor have a ConnectionStats no matter what, and + // filter them out in GetConnections? + lastUpdateEpoch uint64 +} + +func (st *connectionState) hasMissedHandshake() bool { + return st.localSynState == synStateMissed || st.remoteSynState == synStateMissed } // TCPProcessor encapsulates TCP state tracking for the ebpfless tracer type TCPProcessor struct { - conns map[network.ConnectionTuple]connectionState + cfg *config.Config + // pendingConns contains connections with tcpState == connStatAttempted + pendingConns map[network.ConnectionTuple]*connectionState + // establishedConns contains connections with tcpState == connStatEstablished + establishedConns map[network.ConnectionTuple]*connectionState } +// TODO make this into a config value +const maxPendingConns = 4096 +const pendingConnTimeoutNs = uint64(5 * time.Second) + // NewTCPProcessor constructs an empty TCPProcessor -func NewTCPProcessor() *TCPProcessor { +func NewTCPProcessor(cfg *config.Config) *TCPProcessor { return &TCPProcessor{ - conns: map[network.ConnectionTuple]connectionState{}, + cfg: cfg, + pendingConns: make(map[network.ConnectionTuple]*connectionState, maxPendingConns), + establishedConns: make(map[network.ConnectionTuple]*connectionState, cfg.MaxTrackedConnections), } } @@ -125,9 +148,13 @@ func (t *TCPProcessor) updateSynFlag(conn *network.ConnectionStats, st *connecti updateConnStatsForOpen(conn) } // if both synStates are ack'd, move to established - if st.tcpState == connStatAttempted && st.localSynState == synStateAcked && st.remoteSynState == synStateAcked { + if st.tcpState == connStatAttempted && st.localSynState.isSynAcked() && st.remoteSynState.isSynAcked() { st.tcpState = connStatEstablished - conn.Monotonic.TCPEstablished++ + if st.hasMissedHandshake() { + statsTelemetry.missedTCPHandshakes.Inc() + } else { + conn.Monotonic.TCPEstablished++ + } } } @@ -136,6 +163,7 @@ func (t *TCPProcessor) updateSynFlag(conn *network.ConnectionStats, st *connecti func (t *TCPProcessor) updateTCPStats(conn *network.ConnectionStats, st *connectionState, pktType uint8, tcp *layers.TCP, payloadLen uint16, timestampNs uint64) { nextSeq := calcNextSeq(tcp, payloadLen) + st.lastUpdateEpoch = timestampNs if pktType == unix.PACKET_OUTGOING { conn.Monotonic.SentPackets++ // packetCanRetransmit filters out packets that look like retransmits but aren't, like TCP keepalives @@ -155,7 +183,7 @@ func (t *TCPProcessor) updateTCPStats(conn *network.ConnectionStats, st *connect ackOutdated := !st.hasLocalAck || isSeqBefore(st.lastLocalAck, tcp.Ack) if tcp.ACK && ackOutdated { // wait until data comes in via synStateAcked - if st.hasLocalAck && st.remoteSynState == synStateAcked { + if st.hasLocalAck && st.remoteSynState.isSynAcked() { ackDiff := tcp.Ack - st.lastLocalAck isFinAck := st.hasRemoteFin && tcp.Ack == st.remoteFinSeq if isFinAck { @@ -232,13 +260,13 @@ func (t *TCPProcessor) updateRstFlag(conn *network.ConnectionStats, st *connecti // Process handles a TCP packet, calculating stats and keeping track of its state according to the // TCP state machine. -func (t *TCPProcessor) Process(conn *network.ConnectionStats, timestampNs uint64, pktType uint8, ip4 *layers.IPv4, ip6 *layers.IPv6, tcp *layers.TCP) error { +func (t *TCPProcessor) Process(conn *network.ConnectionStats, timestampNs uint64, pktType uint8, ip4 *layers.IPv4, ip6 *layers.IPv6, tcp *layers.TCP) (ProcessResult, error) { if pktType != unix.PACKET_OUTGOING && pktType != unix.PACKET_HOST { - return fmt.Errorf("TCPProcessor saw invalid pktType: %d", pktType) + return ProcessResultNone, fmt.Errorf("TCPProcessor saw invalid pktType: %d", pktType) } payloadLen, err := TCPPayloadLen(conn.Family, ip4, ip6, tcp) if err != nil { - return err + return ProcessResultNone, err } log.TraceFunc(func() string { @@ -247,16 +275,93 @@ func (t *TCPProcessor) Process(conn *network.ConnectionStats, timestampNs uint64 // skip invalid packets we don't recognize: if checkInvalidTCP(tcp) { - return nil + return ProcessResultNone, nil } - st := t.conns[conn.ConnectionTuple] + st := t.getConn(conn.ConnectionTuple) + origState := st.tcpState - t.updateSynFlag(conn, &st, pktType, tcp, payloadLen) - t.updateTCPStats(conn, &st, pktType, tcp, payloadLen, timestampNs) - t.updateFinFlag(conn, &st, pktType, tcp, payloadLen) - t.updateRstFlag(conn, &st, pktType, tcp, payloadLen) + t.updateSynFlag(conn, st, pktType, tcp, payloadLen) + t.updateTCPStats(conn, st, pktType, tcp, payloadLen, timestampNs) + t.updateFinFlag(conn, st, pktType, tcp, payloadLen) + t.updateRstFlag(conn, st, pktType, tcp, payloadLen) + + stateChanged := st.tcpState != origState + if stateChanged { + ok := t.moveConn(conn.ConnectionTuple, st) + // if the map is full then we are unable to move the connection, report that + if !ok { + return ProcessResultMapFull, nil + } + } + + // if the connection is still established, we should update the connection map + if st.tcpState == connStatEstablished { + return ProcessResultStoreConn, nil + } + // if the connection just closed, store it in the tracer's closeCallback + if st.tcpState == connStatClosed && stateChanged { + return ProcessResultCloseConn, nil + } + return ProcessResultNone, nil +} - t.conns[conn.ConnectionTuple] = st - return nil +func (t *TCPProcessor) getConn(tuple network.ConnectionTuple) *connectionState { + if st, ok := t.establishedConns[tuple]; ok { + return st + } + if st, ok := t.pendingConns[tuple]; ok { + return st + } + // otherwise, create a fresh state object that will be stored by moveConn later + return &connectionState{} +} + +// RemoveConn clears a ConnectionTuple from its internal state. +func (t *TCPProcessor) RemoveConn(tuple network.ConnectionTuple) { + delete(t.pendingConns, tuple) + delete(t.establishedConns, tuple) +} + +// moveConn moves a connection to the correct map based on its tcpState. +// If it had to drop the connection because the target map was full, it returns false. +func (t *TCPProcessor) moveConn(tuple network.ConnectionTuple, st *connectionState) bool { + t.RemoveConn(tuple) + + switch st.tcpState { + // For this case, simply let closed connections disappear. Process() will return + // ProcessResultCloseConn letting the ebpfless tracer know the connection has closed. + case connStatClosed: + case connStatAttempted: + ok := WriteMapWithSizeLimit(t.pendingConns, tuple, st, maxPendingConns) + if !ok { + statsTelemetry.droppedPendingConns.Inc() + } + return ok + case connStatEstablished: + maxTrackedConns := int(t.cfg.MaxTrackedConnections) + ok := WriteMapWithSizeLimit(t.establishedConns, tuple, st, maxTrackedConns) + if !ok { + statsTelemetry.droppedEstablishedConns.Inc() + } + return ok + } + return true +} + +// CleanupExpiredPendingConns iterates through pendingConns and removes those that +// have existed too long - in normal TCP, they should become established right away. +// +// This is only required for pendingConns because the tracer already has logic to remove +// established connections (connections that have ConnectionStats) +func (t *TCPProcessor) CleanupExpiredPendingConns(timestampNs uint64) { + for tuple, st := range t.pendingConns { + timeoutTime := st.lastUpdateEpoch + pendingConnTimeoutNs + + if timeoutTime <= timestampNs { + delete(t.pendingConns, tuple) + + statsTelemetry.expiredPendingConns.Inc() + } + } } diff --git a/pkg/network/tracer/connection/ebpfless/tcp_processor_test.go b/pkg/network/tracer/connection/ebpfless/tcp_processor_test.go index 8656a73463d36..44def44a2860c 100644 --- a/pkg/network/tracer/connection/ebpfless/tcp_processor_test.go +++ b/pkg/network/tracer/connection/ebpfless/tcp_processor_test.go @@ -8,9 +8,11 @@ package ebpfless import ( + "github.com/DataDog/datadog-agent/pkg/network/config" "net" "syscall" "testing" + "time" "golang.org/x/sys/unix" @@ -107,16 +109,16 @@ func makeTCPStates(synPkt testCapture) *network.ConnectionStats { } return &network.ConnectionStats{ ConnectionTuple: network.ConnectionTuple{ - Source: util.AddressFromNetIP(srcIP), - Dest: util.AddressFromNetIP(dstIP), - Pid: 0, // packet capture does not have PID information. - NetNS: defaultNsID, - SPort: uint16(synPkt.tcp.SrcPort), - DPort: uint16(synPkt.tcp.DstPort), - Type: network.TCP, - Family: family, + Source: util.AddressFromNetIP(srcIP), + Dest: util.AddressFromNetIP(dstIP), + Pid: 0, // packet capture does not have PID information. + NetNS: defaultNsID, + SPort: uint16(synPkt.tcp.SrcPort), + DPort: uint16(synPkt.tcp.DstPort), + Type: network.TCP, + Family: family, + Direction: direction, }, - Direction: direction, TCPFailures: make(map[uint16]uint32), } } @@ -166,22 +168,24 @@ func (pb packetBuilder) outgoing(payloadLen uint16, relSeq, relAck uint32, flags } func newTCPTestFixture(t *testing.T) *tcpTestFixture { + cfg := config.New() return &tcpTestFixture{ t: t, - tcp: NewTCPProcessor(), + tcp: NewTCPProcessor(cfg), conn: nil, } } -func (fixture *tcpTestFixture) runPkt(pkt testCapture) { +func (fixture *tcpTestFixture) runPkt(pkt testCapture) ProcessResult { if fixture.conn == nil { fixture.conn = makeTCPStates(pkt) } - err := fixture.tcp.Process(fixture.conn, pkt.timestampNs, pkt.pktType, pkt.ipv4, pkt.ipv6, pkt.tcp) + result, err := fixture.tcp.Process(fixture.conn, pkt.timestampNs, pkt.pktType, pkt.ipv4, pkt.ipv6, pkt.tcp) require.NoError(fixture.t, err) + return result } -func (fixture *tcpTestFixture) runPkts(packets []testCapture) { //nolint:unused // TODO +func (fixture *tcpTestFixture) runPkts(packets []testCapture) { for _, pkt := range packets { fixture.runPkt(pkt) } @@ -197,7 +201,7 @@ func (fixture *tcpTestFixture) runAgainstState(packets []testCapture, expected [ fixture.runPkt(pkt) connTuple := fixture.conn.ConnectionTuple - actual := fixture.tcp.conns[connTuple].tcpState + actual := fixture.tcp.getConn(connTuple).tcpState actualStrs = append(actualStrs, labelForState(actual)) } require.Equal(fixture.t, expectedStrs, actualStrs) @@ -255,6 +259,9 @@ func testBasicHandshake(t *testing.T, pb packetBuilder) { } require.Equal(t, expectedStats, f.conn.Monotonic) + + require.Empty(t, f.tcp.pendingConns) + require.Empty(t, f.tcp.establishedConns) } var lowerSeq uint32 = 2134452051 @@ -322,6 +329,9 @@ func testReversedBasicHandshake(t *testing.T, pb packetBuilder) { TCPClosed: 1, } require.Equal(t, expectedStats, f.conn.Monotonic) + + require.Empty(t, f.tcp.pendingConns) + require.Empty(t, f.tcp.establishedConns) } func TestReversedBasicHandshake(t *testing.T) { @@ -614,9 +624,8 @@ func TestConnReset(t *testing.T) { require.Equal(t, expectedStats, f.conn.Monotonic) } -func TestConnectTwice(t *testing.T) { - // same as TestImmediateFin but everything happens twice - +func TestProcessResult(t *testing.T) { + // same as TestImmediateFin but checks ProcessResult pb := newPacketBuilder(lowerSeq, higherSeq) basicHandshake := []testCapture{ pb.incoming(0, 0, 0, SYN), @@ -628,40 +637,20 @@ func TestConnectTwice(t *testing.T) { pb.outgoing(0, 2, 2, ACK), } - expectedClientStates := []connStatus{ - connStatAttempted, - connStatAttempted, - connStatEstablished, - // active close begins here - connStatEstablished, - connStatEstablished, - connStatClosed, + processResults := []ProcessResult{ + ProcessResultNone, + ProcessResultNone, + ProcessResultStoreConn, + ProcessResultStoreConn, + ProcessResultStoreConn, + ProcessResultCloseConn, } f := newTCPTestFixture(t) - f.runAgainstState(basicHandshake, expectedClientStates) - state := f.tcp.conns[f.conn.ConnectionTuple] - // make sure the TCP state was erased after the connection was closed - require.Equal(t, connectionState{ - tcpState: connStatClosed, - }, state) - - // second connection here - f.runAgainstState(basicHandshake, expectedClientStates) - - require.Empty(t, f.conn.TCPFailures) - - expectedStats := network.StatCounters{ - SentBytes: 0, - RecvBytes: 0, - SentPackets: 3 * 2, - RecvPackets: 3 * 2, - Retransmits: 0, - TCPEstablished: 1 * 2, - TCPClosed: 1 * 2, + for i, pkt := range basicHandshake { + require.Equal(t, processResults[i], f.runPkt(pkt), "packet #%d has the wrong ProcessResult", i) } - require.Equal(t, expectedStats, f.conn.Monotonic) } func TestSimultaneousClose(t *testing.T) { @@ -775,3 +764,54 @@ func TestOpenCloseConn(t *testing.T) { f.runPkt(pb.incoming(0, 0, 0, SYN)) require.False(t, f.conn.IsClosed) } +func TestPreexistingConn(t *testing.T) { + pb := newPacketBuilder(lowerSeq, higherSeq) + + f := newTCPTestFixture(t) + + capture := []testCapture{ + // just sending data, no SYN + pb.outgoing(1, 10, 10, ACK), + pb.incoming(1, 10, 11, ACK), + // active close after sending no data + pb.outgoing(0, 11, 11, FIN|ACK), + pb.incoming(0, 11, 12, FIN|ACK), + pb.outgoing(0, 12, 12, ACK), + } + f.runPkts(capture) + + require.Empty(t, f.conn.TCPFailures) + + expectedStats := network.StatCounters{ + SentBytes: 1, + RecvBytes: 1, + SentPackets: 3, + RecvPackets: 2, + Retransmits: 0, + TCPEstablished: 0, // we missed when it established + TCPClosed: 1, + } + require.Equal(t, expectedStats, f.conn.Monotonic) +} + +func TestPendingConnExpiry(t *testing.T) { + now := uint64(time.Now().UnixNano()) + + pb := newPacketBuilder(lowerSeq, higherSeq) + pkt := pb.outgoing(0, 0, 0, SYN) + pkt.timestampNs = now + + f := newTCPTestFixture(t) + + f.runPkt(pkt) + require.Len(t, f.tcp.pendingConns, 1) + + // if no time has passed, should not remove the connection + f.tcp.CleanupExpiredPendingConns(now) + require.Len(t, f.tcp.pendingConns, 1) + + // if too much time has passed, should remove the connection + tenSecNs := uint64((10 * time.Second).Nanoseconds()) + f.tcp.CleanupExpiredPendingConns(now + tenSecNs) + require.Empty(t, f.tcp.pendingConns) +} diff --git a/pkg/network/tracer/connection/ebpfless/tcp_utils.go b/pkg/network/tracer/connection/ebpfless/tcp_utils.go index 1969fd85a5bc1..7a30737e734ae 100644 --- a/pkg/network/tracer/connection/ebpfless/tcp_utils.go +++ b/pkg/network/tracer/connection/ebpfless/tcp_utils.go @@ -21,18 +21,42 @@ import ( const ebpflessModuleName = "ebpfless_network_tracer" +// ProcessResult represents what the ebpfless tracer should do with ConnectionStats after processing a packet +type ProcessResult uint8 + +const ( + // ProcessResultNone - the updated ConnectionStats should NOT be stored in the connection map. + // Usually, this is because the connection is not established yet. + ProcessResultNone ProcessResult = iota + // ProcessResultStoreConn - the updated ConnectionStats should be stored in the connection map. + // This happens when the connection is established. + ProcessResultStoreConn + // ProcessResultCloseConn - this connection is done and its ConnectionStats should be passed + // to the ebpfless tracer's closed connection handler. + ProcessResultCloseConn + // ProcessResultMapFull - this connection can't be tracked because the TCPProcessor's connection + // map is full. This connection should be removed from the tracer as well. + ProcessResultMapFull +) + var statsTelemetry = struct { - missedTCPConnections telemetry.Counter - missingTCPFlags telemetry.Counter - tcpSynAndFin telemetry.Counter - tcpRstAndSyn telemetry.Counter - tcpRstAndFin telemetry.Counter + expiredPendingConns telemetry.Counter + droppedPendingConns telemetry.Counter + droppedEstablishedConns telemetry.Counter + missedTCPHandshakes telemetry.Counter + missingTCPFlags telemetry.Counter + tcpSynAndFin telemetry.Counter + tcpRstAndSyn telemetry.Counter + tcpRstAndFin telemetry.Counter }{ - telemetry.NewCounter(ebpflessModuleName, "missed_tcp_connections", []string{}, "Counter measuring the number of TCP connections where we missed the SYN handshake"), - telemetry.NewCounter(ebpflessModuleName, "missing_tcp_flags", []string{}, "Counter measuring packets encountered with none of SYN, FIN, ACK, RST set"), - telemetry.NewCounter(ebpflessModuleName, "tcp_syn_and_fin", []string{}, "Counter measuring packets encountered with SYN+FIN together"), - telemetry.NewCounter(ebpflessModuleName, "tcp_rst_and_syn", []string{}, "Counter measuring packets encountered with RST+SYN together"), - telemetry.NewCounter(ebpflessModuleName, "tcp_rst_and_fin", []string{}, "Counter measuring packets encountered with RST+FIN together"), + expiredPendingConns: telemetry.NewCounter(ebpflessModuleName, "expired_pending_conns", nil, "Counter measuring the number of TCP connections which expired because it took too long to complete the handshake"), + droppedPendingConns: telemetry.NewCounter(ebpflessModuleName, "dropped_pending_conns", nil, "Counter measuring the number of TCP connections which were dropped during the handshake (because the map was full)"), + droppedEstablishedConns: telemetry.NewCounter(ebpflessModuleName, "dropped_established_conns", nil, "Counter measuring the number of TCP connections which were dropped while established (because the map was full)"), + missedTCPHandshakes: telemetry.NewCounter(ebpflessModuleName, "missed_tcp_handshakes", nil, "Counter measuring the number of TCP connections where we missed the SYN handshake"), + missingTCPFlags: telemetry.NewCounter(ebpflessModuleName, "missing_tcp_flags", nil, "Counter measuring packets encountered with none of SYN, FIN, ACK, RST set"), + tcpSynAndFin: telemetry.NewCounter(ebpflessModuleName, "tcp_syn_and_fin", nil, "Counter measuring packets encountered with SYN+FIN together"), + tcpRstAndSyn: telemetry.NewCounter(ebpflessModuleName, "tcp_rst_and_syn", nil, "Counter measuring packets encountered with RST+SYN together"), + tcpRstAndFin: telemetry.NewCounter(ebpflessModuleName, "tcp_rst_and_fin", nil, "Counter measuring packets encountered with RST+FIN together"), } const tcpSeqMidpoint = 0x80000000 @@ -54,9 +78,16 @@ var connStatusLabels = []string{ type synState uint8 const ( + // synStateNone - Nothing seen yet (initial state) synStateNone synState = iota + // synStateSent - We have seen the SYN but not its ACK synStateSent + // synStateAcked - SYN is ACK'd for this side of the connection. + // If both sides are synStateAcked, the connection is established. synStateAcked + // synStateMissed is effectively the same as synStateAcked but represents + // capturing a preexisting connection where we didn't get to see the SYN. + synStateMissed ) func (ss *synState) update(synFlag, ackFlag bool) { @@ -68,13 +99,20 @@ func (ss *synState) update(synFlag, ackFlag bool) { if *ss == synStateSent && ackFlag { *ss = synStateAcked } + + // this allows synStateMissed to recover via SYN in order to pass TestUnusualAckSyn + if *ss == synStateMissed && synFlag { + *ss = synStateAcked + } // if we see ACK'd traffic but missed the SYN, assume the connection started before // the datadog-agent starts. if *ss == synStateNone && ackFlag { - statsTelemetry.missedTCPConnections.Inc() - *ss = synStateAcked + *ss = synStateMissed } } +func (ss *synState) isSynAcked() bool { + return *ss == synStateAcked || *ss == synStateMissed +} func labelForState(tcpState connStatus) string { idx := int(tcpState) diff --git a/pkg/network/tracer/connection/ebpfless_tracer.go b/pkg/network/tracer/connection/ebpfless_tracer.go index 8bb0a54f170ec..3eb5a03344b2a 100644 --- a/pkg/network/tracer/connection/ebpfless_tracer.go +++ b/pkg/network/tracer/connection/ebpfless_tracer.go @@ -40,9 +40,11 @@ const ( var ( ebpfLessTracerTelemetry = struct { - skippedPackets telemetry.Counter + skippedPackets telemetry.Counter + droppedConnections telemetry.Counter }{ telemetry.NewCounter(ebpfLessTelemetryPrefix, "skipped_packets", []string{"reason"}, "Counter measuring skipped packets"), + telemetry.NewCounter(ebpfLessTelemetryPrefix, "dropped_connections", nil, "Counter measuring dropped connections"), } ) @@ -81,7 +83,7 @@ func newEbpfLessTracer(cfg *config.Config) (*ebpfLessTracer, error) { exit: make(chan struct{}), scratchConn: &network.ConnectionStats{}, udp: &udpProcessor{}, - tcp: ebpfless.NewTCPProcessor(), + tcp: ebpfless.NewTCPProcessor(cfg), conns: make(map[network.ConnectionTuple]*network.ConnectionStats, cfg.MaxTrackedConnections), boundPorts: ebpfless.NewBoundPorts(cfg), cookieHasher: newCookieHasher(), @@ -96,7 +98,7 @@ func newEbpfLessTracer(cfg *config.Config) (*ebpfLessTracer, error) { } // Start begins collecting network connection data. -func (t *ebpfLessTracer) Start(_ func(*network.ConnectionStats)) error { +func (t *ebpfLessTracer) Start(closeCallback func(*network.ConnectionStats)) error { if err := t.boundPorts.Start(); err != nil { return fmt.Errorf("could not update bound ports: %w", err) } @@ -123,7 +125,7 @@ func (t *ebpfLessTracer) Start(_ func(*network.ConnectionStats)) error { return nil } - if err := t.processConnection(pktType, &ip4, &ip6, &udp, &tcp, decoded); err != nil { + if err := t.processConnection(pktType, &ip4, &ip6, &udp, &tcp, decoded, closeCallback); err != nil { log.Warnf("could not process packet: %s", err) } @@ -147,21 +149,24 @@ func (t *ebpfLessTracer) processConnection( udp *layers.UDP, tcp *layers.TCP, decoded []gopacket.LayerType, + closeCallback func(*network.ConnectionStats), ) error { t.scratchConn.Source, t.scratchConn.Dest = util.Address{}, util.Address{} t.scratchConn.SPort, t.scratchConn.DPort = 0, 0 t.scratchConn.TCPFailures = make(map[uint16]uint32) - var udpPresent, tcpPresent bool + var ip4Present, ip6Present, udpPresent, tcpPresent bool for _, layerType := range decoded { switch layerType { case layers.LayerTypeIPv4: t.scratchConn.Source = util.AddressFromNetIP(ip4.SrcIP) t.scratchConn.Dest = util.AddressFromNetIP(ip4.DstIP) t.scratchConn.Family = network.AFINET + ip4Present = true case layers.LayerTypeIPv6: t.scratchConn.Source = util.AddressFromNetIP(ip6.SrcIP) t.scratchConn.Dest = util.AddressFromNetIP(ip6.DstIP) t.scratchConn.Family = network.AFINET6 + ip6Present = true case layers.LayerTypeTCP: t.scratchConn.SPort = uint16(tcp.SrcPort) t.scratchConn.DPort = uint16(tcp.DstPort) @@ -175,15 +180,15 @@ func (t *ebpfLessTracer) processConnection( } } - // check if have all the basic pieces + // check if we have all the basic pieces if !udpPresent && !tcpPresent { log.Debugf("ignoring packet since its not udp or tcp") ebpfLessTracerTelemetry.skippedPackets.Inc("not_tcp_udp") return nil } - flipSourceDest(t.scratchConn, pktType) t.determineConnectionDirection(t.scratchConn, pktType) + flipSourceDest(t.scratchConn, pktType) t.m.Lock() defer t.m.Unlock() @@ -201,21 +206,25 @@ func (t *ebpfLessTracer) processConnection( if ts, err = ddebpf.NowNanoseconds(); err != nil { return fmt.Errorf("error getting last updated timestamp for connection: %w", err) } + conn.LastUpdateEpoch = uint64(ts) - if ip4 == nil && ip6 == nil { + if !ip4Present && !ip6Present { return nil } + + var result ebpfless.ProcessResult switch conn.Type { case network.UDP: - if (ip4 != nil && !t.config.CollectUDPv4Conns) || (ip6 != nil && !t.config.CollectUDPv6Conns) { + if (ip4Present && !t.config.CollectUDPv4Conns) || (ip6Present && !t.config.CollectUDPv6Conns) { return nil } + result = ebpfless.ProcessResultStoreConn err = t.udp.process(conn, pktType, udp) case network.TCP: - if (ip4 != nil && !t.config.CollectTCPv4Conns) || (ip6 != nil && !t.config.CollectTCPv6Conns) { + if (ip4Present && !t.config.CollectTCPv4Conns) || (ip6Present && !t.config.CollectTCPv6Conns) { return nil } - err = t.tcp.Process(conn, uint64(ts), pktType, ip4, ip6, tcp) + result, err = t.tcp.Process(conn, uint64(ts), pktType, ip4, ip6, tcp) default: err = fmt.Errorf("unsupported connection type %d", conn.Type) } @@ -224,14 +233,30 @@ func (t *ebpfLessTracer) processConnection( return fmt.Errorf("error processing connection: %w", err) } - if conn.Type == network.UDP || conn.Monotonic.TCPEstablished > 0 { - conn.LastUpdateEpoch = uint64(ts) - t.conns[t.scratchConn.ConnectionTuple] = conn - } - log.TraceFunc(func() string { return fmt.Sprintf("connection: %s", conn) }) + + switch result { + case ebpfless.ProcessResultNone: + case ebpfless.ProcessResultStoreConn: + maxTrackedConns := int(t.config.MaxTrackedConnections) + ok := ebpfless.WriteMapWithSizeLimit(t.conns, conn.ConnectionTuple, conn, maxTrackedConns) + if !ok { + // we don't have enough space to add this connection, remove its TCP state tracking + if conn.Type == network.TCP { + t.tcp.RemoveConn(conn.ConnectionTuple) + } + ebpfLessTracerTelemetry.droppedConnections.Inc() + } + case ebpfless.ProcessResultCloseConn: + delete(t.conns, conn.ConnectionTuple) + closeCallback(conn) + case ebpfless.ProcessResultMapFull: + delete(t.conns, conn.ConnectionTuple) + ebpfLessTracerTelemetry.droppedConnections.Inc() + } + return nil } @@ -278,6 +303,12 @@ func (t *ebpfLessTracer) GetConnections(buffer *network.ConnectionBuffer, filter t.m.Lock() defer t.m.Unlock() + // use GetConnections to periodically cleanup pending connections + err := t.cleanupPendingConns() + if err != nil { + return err + } + if len(t.conns) == 0 { return nil } @@ -296,17 +327,35 @@ func (t *ebpfLessTracer) GetConnections(buffer *network.ConnectionBuffer, filter return nil } +// cleanupPendingConns removes pending connections from the TCP tracer. +// For more information, refer to CleanupExpiredPendingConns +func (t *ebpfLessTracer) cleanupPendingConns() error { + ts, err := ddebpf.NowNanoseconds() + if err != nil { + return fmt.Errorf("error getting last updated timestamp for connection: %w", err) + } + t.tcp.CleanupExpiredPendingConns(uint64(ts)) + return nil +} + // FlushPending forces any closed connections waiting for batching to be processed immediately. func (t *ebpfLessTracer) FlushPending() {} +func (t *ebpfLessTracer) remove(conn *network.ConnectionStats) error { + delete(t.conns, conn.ConnectionTuple) + if conn.Type == network.TCP { + t.tcp.RemoveConn(conn.ConnectionTuple) + } + return nil +} + // Remove deletes the connection from tracking state. // It does not prevent the connection from re-appearing later, if additional traffic occurs. func (t *ebpfLessTracer) Remove(conn *network.ConnectionStats) error { t.m.Lock() defer t.m.Unlock() - delete(t.conns, conn.ConnectionTuple) - return nil + return t.remove(conn) } // GetMap returns the underlying named map. This is useful if any maps are shared with other eBPF components. diff --git a/pkg/network/tracer/connection/fentry/tracer.go b/pkg/network/tracer/connection/fentry/tracer.go index 0124ca3436d6c..d44715e8c87e5 100644 --- a/pkg/network/tracer/connection/fentry/tracer.go +++ b/pkg/network/tracer/connection/fentry/tracer.go @@ -36,7 +36,7 @@ func LoadTracer(config *config.Config, mgrOpts manager.Options, connCloseEventHa m := ddebpf.NewManagerWithDefault(&manager.Manager{}, "network", &ebpftelemetry.ErrorsTelemetryModifier{}) err := ddebpf.LoadCOREAsset(netebpf.ModuleFileName("tracer-fentry", config.BPFDebug), func(ar bytecode.AssetReader, o manager.Options) error { - o.RLimit = mgrOpts.RLimit + o.RemoveRlimit = mgrOpts.RemoveRlimit o.MapSpecEditors = mgrOpts.MapSpecEditors o.ConstantEditors = mgrOpts.ConstantEditors diff --git a/pkg/network/tracer/connection/kprobe/config.go b/pkg/network/tracer/connection/kprobe/config.go index 880a2f0a5e838..b7c6bb2ff9986 100644 --- a/pkg/network/tracer/connection/kprobe/config.go +++ b/pkg/network/tracer/connection/kprobe/config.go @@ -58,6 +58,8 @@ func enabledProbes(c *config.Config, runtimeTracer, coreTracer bool) (map[probes if c.CollectTCPv4Conns || c.CollectTCPv6Conns { if ClassificationSupported(c) { enableProbe(enabled, probes.ProtocolClassifierEntrySocketFilter) + enableProbe(enabled, probes.ProtocolClassifierTLSClientSocketFilter) + enableProbe(enabled, probes.ProtocolClassifierTLSServerSocketFilter) enableProbe(enabled, probes.ProtocolClassifierQueuesSocketFilter) enableProbe(enabled, probes.ProtocolClassifierDBsSocketFilter) enableProbe(enabled, probes.ProtocolClassifierGRPCSocketFilter) diff --git a/pkg/network/tracer/connection/kprobe/manager.go b/pkg/network/tracer/connection/kprobe/manager.go index fb2ee4b7bd065..684a0de804638 100644 --- a/pkg/network/tracer/connection/kprobe/manager.go +++ b/pkg/network/tracer/connection/kprobe/manager.go @@ -19,6 +19,8 @@ import ( var mainProbes = []probes.ProbeFuncName{ probes.NetDevQueue, probes.ProtocolClassifierEntrySocketFilter, + probes.ProtocolClassifierTLSClientSocketFilter, + probes.ProtocolClassifierTLSServerSocketFilter, probes.ProtocolClassifierQueuesSocketFilter, probes.ProtocolClassifierDBsSocketFilter, probes.ProtocolClassifierGRPCSocketFilter, diff --git a/pkg/network/tracer/connection/kprobe/tracer.go b/pkg/network/tracer/connection/kprobe/tracer.go index 634642154e881..76e3ff596bcac 100644 --- a/pkg/network/tracer/connection/kprobe/tracer.go +++ b/pkg/network/tracer/connection/kprobe/tracer.go @@ -45,6 +45,22 @@ var ( classificationMinimumKernel = kernel.VersionCode(4, 11, 0) protocolClassificationTailCalls = []manager.TailCallRoute{ + { + ProgArrayName: probes.ClassificationProgsMap, + Key: netebpf.ClassificationTLSClient, + ProbeIdentificationPair: manager.ProbeIdentificationPair{ + EBPFFuncName: probes.ProtocolClassifierTLSClientSocketFilter, + UID: probeUID, + }, + }, + { + ProgArrayName: probes.ClassificationProgsMap, + Key: netebpf.ClassificationTLSServer, + ProbeIdentificationPair: manager.ProbeIdentificationPair{ + EBPFFuncName: probes.ProtocolClassifierTLSServerSocketFilter, + UID: probeUID, + }, + }, { ProgArrayName: probes.ClassificationProgsMap, Key: netebpf.ClassificationQueues, @@ -90,8 +106,8 @@ var ( ) // ClassificationSupported returns true if the current kernel version supports the classification feature. -// The kernel has to be newer than 4.7.0 since we are using bpf_skb_load_bytes (4.5.0+) method to read from the socket -// filter, and a tracepoint (4.7.0+) +// The kernel has to be newer than 4.11.0 since we are using bpf_skb_load_bytes (4.5.0+) method which was added to +// socket filters in 4.11.0, and a tracepoint (4.7.0+) func ClassificationSupported(config *config.Config) bool { if !config.ProtocolClassificationEnabled { return false @@ -275,7 +291,7 @@ func loadCORETracer(config *config.Config, mgrOpts manager.Options, connCloseEve var closeFn func() var err error err = ddebpf.LoadCOREAsset(netebpf.ModuleFileName("tracer", config.BPFDebug), func(ar bytecode.AssetReader, o manager.Options) error { - o.RLimit = mgrOpts.RLimit + o.RemoveRlimit = mgrOpts.RemoveRlimit o.MapSpecEditors = mgrOpts.MapSpecEditors o.ConstantEditors = mgrOpts.ConstantEditors o.DefaultKprobeAttachMethod = mgrOpts.DefaultKprobeAttachMethod diff --git a/pkg/network/tracer/ebpf_conntracker.go b/pkg/network/tracer/ebpf_conntracker.go index 89c34dca9578b..873ee9d453005 100644 --- a/pkg/network/tracer/ebpf_conntracker.go +++ b/pkg/network/tracer/ebpf_conntracker.go @@ -16,7 +16,6 @@ import ( "time" manager "github.com/DataDog/ebpf-manager" - "github.com/cihub/seelog" "github.com/cilium/ebpf" "github.com/cilium/ebpf/features" "github.com/prometheus/client_golang/prometheus" @@ -239,7 +238,7 @@ func (e *ebpfConntracker) GetTranslationForConn(stats *network.ConnectionTuple) defer tuplePool.Put(src) toConntrackTupleFromTuple(src, stats) - if log.ShouldLog(seelog.TraceLvl) { + if log.ShouldLog(log.TraceLvl) { log.Tracef("looking up in conntrack (stats): %s", stats) } @@ -247,14 +246,14 @@ func (e *ebpfConntracker) GetTranslationForConn(stats *network.ConnectionTuple) // NAT rules referencing conntrack are installed there instead // of other network namespaces (for pods, for instance) src.Netns = e.rootNS - if log.ShouldLog(seelog.TraceLvl) { + if log.ShouldLog(log.TraceLvl) { log.Tracef("looking up in conntrack (tuple): %s", src) } dst := e.get(src) if dst == nil && stats.NetNS != e.rootNS { // Perform another lookup, this time using the connection namespace src.Netns = stats.NetNS - if log.ShouldLog(seelog.TraceLvl) { + if log.ShouldLog(log.TraceLvl) { log.Tracef("looking up in conntrack (tuple,netns): %s", src) } dst = e.get(src) @@ -299,7 +298,7 @@ func (e *ebpfConntracker) delete(key *netebpf.ConntrackTuple) { if err := e.ctMap.Delete(key); err != nil { if errors.Is(err, ebpf.ErrKeyNotExist) { - if log.ShouldLog(seelog.TraceLvl) { + if log.ShouldLog(log.TraceLvl) { log.Tracef("connection does not exist in ebpf conntrack map: %s", key) } diff --git a/pkg/network/tracer/offsetguess/offsetguess.go b/pkg/network/tracer/offsetguess/offsetguess.go index 99a111f1dbf74..8889b0e837fd6 100644 --- a/pkg/network/tracer/offsetguess/offsetguess.go +++ b/pkg/network/tracer/offsetguess/offsetguess.go @@ -9,12 +9,9 @@ package offsetguess import ( "fmt" - "math" "sync" "time" - "golang.org/x/sys/unix" - manager "github.com/DataDog/ebpf-manager" ddebpf "github.com/DataDog/datadog-agent/pkg/ebpf" @@ -156,10 +153,7 @@ func setupOffsetGuesser(guesser OffsetGuesser, config *config.Config, buf byteco // Enable kernel probes used for offset guessing. offsetMgr := guesser.Manager() offsetOptions := manager.Options{ - RLimit: &unix.Rlimit{ - Cur: math.MaxUint64, - Max: math.MaxUint64, - }, + RemoveRlimit: true, } enabledProbes, err := guesser.Probes(config) if err != nil { diff --git a/pkg/network/tracer/offsetguess_test.go b/pkg/network/tracer/offsetguess_test.go index 43c27a25cc6e6..a73523d48207b 100644 --- a/pkg/network/tracer/offsetguess_test.go +++ b/pkg/network/tracer/offsetguess_test.go @@ -9,19 +9,17 @@ package tracer import ( "fmt" - "math" "net" "slices" "testing" "time" + manager "github.com/DataDog/ebpf-manager" "github.com/cilium/ebpf" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "golang.org/x/sys/unix" - manager "github.com/DataDog/ebpf-manager" - "github.com/DataDog/datadog-agent/pkg/ebpf/bytecode/runtime" "github.com/DataDog/datadog-agent/pkg/ebpf/ebpftest" "github.com/DataDog/datadog-agent/pkg/ebpf/maps" @@ -38,7 +36,7 @@ import ( //go:generate $GOPATH/bin/include_headers pkg/network/ebpf/c/runtime/offsetguess-test.c pkg/ebpf/bytecode/build/runtime/offsetguess-test.c pkg/ebpf/c pkg/ebpf/c/protocols pkg/network/ebpf/c/runtime pkg/network/ebpf/c //go:generate $GOPATH/bin/integrity pkg/ebpf/bytecode/build/runtime/offsetguess-test.c pkg/ebpf/bytecode/runtime/offsetguess-test.go runtime -type offsetT int +type offsetT uint32 const ( offsetSaddr offsetT = iota @@ -159,17 +157,8 @@ func testOffsetGuess(t *testing.T) { } opts := manager.Options{ - // Extend RLIMIT_MEMLOCK (8) size - // On some systems, the default for RLIMIT_MEMLOCK may be as low as 64 bytes. - // This will result in an EPERM (Operation not permitted) error, when trying to create an eBPF map - // using bpf(2) with BPF_MAP_CREATE. - // - // We are setting the limit to infinity until we have a better handle on the true requirements. - RLimit: &unix.Rlimit{ - Cur: math.MaxUint64, - Max: math.MaxUint64, - }, - MapEditors: make(map[string]*ebpf.Map), + RemoveRlimit: true, + MapEditors: make(map[string]*ebpf.Map), } require.NoError(t, mgr.InitWithOptions(buf, opts)) diff --git a/pkg/network/tracer/process_cache.go b/pkg/network/tracer/process_cache.go index b44eb56f044cc..acfb96bbde0f2 100644 --- a/pkg/network/tracer/process_cache.go +++ b/pkg/network/tracer/process_cache.go @@ -12,7 +12,6 @@ import ( "sync" "time" - "github.com/cihub/seelog" lru "github.com/hashicorp/golang-lru/v2" "github.com/prometheus/client_golang/prometheus" @@ -175,7 +174,7 @@ func (pc *processCache) add(p *events.Process) { pc.mu.Lock() defer pc.mu.Unlock() - if log.ShouldLog(seelog.TraceLvl) { + if log.ShouldLog(log.TraceLvl) { log.Tracef("adding process %+v to process cache", p) } p.Expiry = time.Now().Add(defaultExpiry).Unix() diff --git a/pkg/network/tracer/testutil/proxy/external_unix_proxy_server/external_unix_proxy_server.go b/pkg/network/tracer/testutil/proxy/external_unix_proxy_server/external_unix_proxy_server.go index 8ef7f164ae5b2..1f077d0717746 100644 --- a/pkg/network/tracer/testutil/proxy/external_unix_proxy_server/external_unix_proxy_server.go +++ b/pkg/network/tracer/testutil/proxy/external_unix_proxy_server/external_unix_proxy_server.go @@ -22,11 +22,13 @@ func main() { var unixPath string var useTLS bool var useControl bool + var useSplice bool flag.StringVar(&remoteAddr, "remote", "", "Remote server address to forward connections to") flag.StringVar(&unixPath, "unix", "/tmp/transparent.sock", "A local unix socket to listen on") flag.BoolVar(&useTLS, "tls", false, "Use TLS to connect to the remote server") flag.BoolVar(&useControl, "control", false, "Use control messages") + flag.BoolVar(&useSplice, "splice", false, "Use splice(2) to transfer data") // Parse command-line flags flag.Parse() @@ -34,7 +36,7 @@ func main() { done := make(chan os.Signal, 1) signal.Notify(done, syscall.SIGINT) - srv := proxy.NewUnixTransparentProxyServer(unixPath, remoteAddr, useTLS, useControl) + srv := proxy.NewUnixTransparentProxyServer(unixPath, remoteAddr, useTLS, useControl, useSplice) defer srv.Stop() if err := srv.Run(); err != nil { diff --git a/pkg/network/tracer/testutil/proxy/unix_transparent_proxy.go b/pkg/network/tracer/testutil/proxy/unix_transparent_proxy.go index 0d19319837b2b..9109b9e0d0756 100644 --- a/pkg/network/tracer/testutil/proxy/unix_transparent_proxy.go +++ b/pkg/network/tracer/testutil/proxy/unix_transparent_proxy.go @@ -43,6 +43,8 @@ type UnixTransparentProxyServer struct { useTLS bool // useControl indicates whether the proxy should expect control messages on the client socket useControl bool + // useSplice indicates whether splice(2) should be used to transfer data between the sockets + useSplice bool // isReady is a flag indicating whether the server is ready to accept connections. isReady atomic.Bool // wg is a wait group used to wait for the server to stop. @@ -52,12 +54,13 @@ type UnixTransparentProxyServer struct { } // NewUnixTransparentProxyServer returns a new instance of a UnixTransparentProxyServer. -func NewUnixTransparentProxyServer(unixPath, remoteAddr string, useTLS, useControl bool) *UnixTransparentProxyServer { +func NewUnixTransparentProxyServer(unixPath, remoteAddr string, useTLS, useControl bool, useSplice bool) *UnixTransparentProxyServer { return &UnixTransparentProxyServer{ unixPath: unixPath, remoteAddr: remoteAddr, useTLS: useTLS, useControl: useControl, + useSplice: useSplice, } } @@ -124,6 +127,51 @@ func WaitForConnectionReady(unixSocket string) error { return fmt.Errorf("could not connect %q after %d retries (after %v)", unixSocket, connectionRetries, connectionRetryInterval*connectionRetries) } +// copyWithoutSplice is based on io.copyBuffer() in the standard library with +// the WriteTo/ReadFrom usage removed (to remove the use of splice(2)) and the +// internal errors replaced (since they are inaccessible from here). +func copyWithoutSplice(dst io.Writer, src io.Reader, buf []byte) (written int64, err error) { + if buf == nil { + size := 32 * 1024 + if l, ok := src.(*io.LimitedReader); ok && int64(size) > l.N { + if l.N < 1 { + size = 1 + } else { + size = int(l.N) + } + } + buf = make([]byte, size) + } + for { + nr, er := src.Read(buf) + if nr > 0 { + nw, ew := dst.Write(buf[0:nr]) + if nw < 0 || nr < nw { + nw = 0 + if ew == nil { + ew = errors.New("invalid write result") + } + } + written += int64(nw) + if ew != nil { + err = ew + break + } + if nr != nw { + err = io.ErrShortWrite + break + } + } + if er != nil { + if er != io.EOF { + err = er + } + break + } + } + return written, err +} + // handleConnection handles a new connection, by forwarding all traffic to the remote address. func (p *UnixTransparentProxyServer) handleConnection(unixSocketConn net.Conn) { defer unixSocketConn.Close() @@ -219,7 +267,12 @@ func (p *UnixTransparentProxyServer) handleConnection(unixSocketConn net.Conn) { if cleanup != nil { defer cleanup() } - _, _ = io.Copy(dst, src) + + if p.useSplice { + _, _ = io.Copy(dst, src) + } else { + _, _ = copyWithoutSplice(dst, src, nil) + } } // If the unix socket is closed, we can close the remote as well. diff --git a/pkg/network/tracer/testutil/testdns/test_dns_server.go b/pkg/network/tracer/testutil/testdns/test_dns_server.go index 48c4e2fe670fe..05745479b4073 100644 --- a/pkg/network/tracer/testutil/testdns/test_dns_server.go +++ b/pkg/network/tracer/testutil/testdns/test_dns_server.go @@ -131,8 +131,7 @@ func respond(req *dns.Msg, writer dns.ResponseWriter, record string) { } // SendDNSQueriesOnPort makes a DNS query for every domain provided, on the given serverIP, port, and protocol. -func SendDNSQueriesOnPort(t *testing.T, domains []string, serverIP net.IP, port string, protocol string) (string, int, []*dns.Msg, error) { - t.Helper() +func SendDNSQueriesOnPort(domains []string, serverIP net.IP, port string, protocol string) (string, int, []*dns.Msg, error) { dnsClient := dns.Client{Net: protocol, Timeout: 3 * time.Second} dnsHost := net.JoinHostPort(serverIP.String(), port) conn, err := dnsClient.Dial(dnsHost) @@ -168,24 +167,21 @@ func SendDNSQueriesOnPort(t *testing.T, domains []string, serverIP net.IP, port // SendDNSQueriesAndCheckError is a simple helper that requires no errors to be present when calling SendDNSQueries func SendDNSQueriesAndCheckError( - t *testing.T, + t require.TestingT, domains []string, serverIP net.IP, protocol string, ) (string, int, []*dns.Msg) { - t.Helper() - ip, port, resp, err := SendDNSQueries(t, domains, serverIP, protocol) + ip, port, resp, err := SendDNSQueries(domains, serverIP, protocol) require.NoError(t, err) return ip, port, resp } // SendDNSQueries is a simple helper that calls SendDNSQueriesOnPort with port 53 func SendDNSQueries( - t *testing.T, domains []string, serverIP net.IP, protocol string, ) (string, int, []*dns.Msg, error) { - t.Helper() - return SendDNSQueriesOnPort(t, domains, serverIP, "53", protocol) + return SendDNSQueriesOnPort(domains, serverIP, "53", protocol) } diff --git a/pkg/network/tracer/tracer.go b/pkg/network/tracer/tracer.go index 20e97a49ac3e6..cc10d988a4f48 100644 --- a/pkg/network/tracer/tracer.go +++ b/pkg/network/tracer/tracer.go @@ -16,7 +16,6 @@ import ( "sync" "time" - "github.com/cihub/seelog" "github.com/cilium/ebpf" "go.uber.org/atomic" "go4.org/intern" @@ -251,46 +250,55 @@ func (t *Tracer) start() error { return nil } +func loadEbpfConntracker(cfg *config.Config, telemetryComponent telemetryComponent.Component) (netlink.Conntracker, error) { + if !cfg.EnableEbpfConntracker { + log.Info("ebpf conntracker disabled") + return nil, nil + } + + if err := netlink.LoadNfConntrackKernelModule(cfg); err != nil { + log.Warnf("failed to load conntrack kernel module, though it may already be loaded: %s", err) + } + + return NewEBPFConntracker(cfg, telemetryComponent) +} + func newConntracker(cfg *config.Config, telemetryComponent telemetryComponent.Component) (netlink.Conntracker, error) { if !cfg.EnableConntrack { return netlink.NewNoOpConntracker(), nil } + var clb netlink.Conntracker var c netlink.Conntracker var err error - if !cfg.EnableEbpfless { - ns, err := cfg.GetRootNetNs() - if err != nil { - log.Warnf("error fetching root net namespace, will not attempt to load nf_conntrack_netlink module: %s", err) - } else { - defer ns.Close() - if err = netlink.LoadNfConntrackKernelModule(ns); err != nil { - log.Warnf("failed to load conntrack kernel module, though it may already be loaded: %s", err) - } - } - if cfg.EnableEbpfConntracker { - if c, err = NewEBPFConntracker(cfg, telemetryComponent); err == nil { - return c, nil - } + if c, err = loadEbpfConntracker(cfg, telemetryComponent); err != nil { log.Warnf("error initializing ebpf conntracker: %s", err) - } else { - log.Info("ebpf conntracker disabled") + log.Info("falling back to netlink conntracker") } - log.Info("falling back to netlink conntracker") + if clb, err = newCiliumLoadBalancerConntracker(cfg); err != nil { + log.Warnf("cilium lb conntracker is enabled, but failed to load: %s", err) + } } - if c, err = netlink.NewConntracker(cfg, telemetryComponent); err == nil { - return c, nil + if c == nil { + if c, err = netlink.NewConntracker(cfg, telemetryComponent); err != nil { + if errors.Is(err, netlink.ErrNotPermitted) || cfg.IgnoreConntrackInitFailure { + log.Warnf("could not initialize netlink conntracker: %s", err) + } else { + return nil, fmt.Errorf("error initializing conntracker: %s. set network_config.ignore_conntrack_init_failure to true to ignore conntrack failures on startup", err) + } + } } - if errors.Is(err, netlink.ErrNotPermitted) || cfg.IgnoreConntrackInitFailure { - log.Warnf("could not initialize conntrack, tracer will continue without NAT tracking: %s", err) - return netlink.NewNoOpConntracker(), nil + c = chainConntrackers(c, clb) + if c.GetType() == "" { + // no-op conntracker + log.Warnf("connection tracking is disabled") } - return nil, fmt.Errorf("error initializing conntracker: %s. set network_config.ignore_conntrack_init_failure to true to ignore conntrack failures on startup", err) + return c, nil } func newReverseDNS(c *config.Config, telemetrycomp telemetryComponent.Component) dns.ReverseDNS { @@ -346,7 +354,7 @@ func (t *Tracer) addProcessInfo(c *network.ConnectionStats) { return } - if log.ShouldLog(seelog.TraceLvl) { + if log.ShouldLog(log.TraceLvl) { log.Tracef("got process cache entry for pid %d: %+v", c.Pid, p) } @@ -413,7 +421,7 @@ func (t *Tracer) Stop() { func (t *Tracer) GetActiveConnections(clientID string) (*network.Connections, error) { t.bufferLock.Lock() defer t.bufferLock.Unlock() - if log.ShouldLog(seelog.TraceLvl) { + if log.ShouldLog(log.TraceLvl) { log.Tracef("GetActiveConnections clientID=%s", clientID) } t.ebpfTracer.FlushPending() @@ -611,7 +619,7 @@ func (t *Tracer) removeEntries(entries []network.ConnectionStats) { t.state.RemoveConnections(toRemove) - if log.ShouldLog(seelog.DebugLvl) { + if log.ShouldLog(log.DebugLvl) { log.Debugf("Removed %d connection entries in %s", len(toRemove), time.Since(now)) } } diff --git a/pkg/network/tracer/tracer_linux_test.go b/pkg/network/tracer/tracer_linux_test.go index 5897839fb2c41..3825b9d1bef07 100644 --- a/pkg/network/tracer/tracer_linux_test.go +++ b/pkg/network/tracer/tracer_linux_test.go @@ -11,6 +11,7 @@ import ( "bufio" "bytes" "context" + "crypto/tls" "errors" "fmt" "io" @@ -50,8 +51,12 @@ import ( "github.com/DataDog/datadog-agent/pkg/network/config/sysctl" "github.com/DataDog/datadog-agent/pkg/network/events" netlinktestutil "github.com/DataDog/datadog-agent/pkg/network/netlink/testutil" + "github.com/DataDog/datadog-agent/pkg/network/protocols" + usmtestutil "github.com/DataDog/datadog-agent/pkg/network/protocols/http/testutil" + ddtls "github.com/DataDog/datadog-agent/pkg/network/protocols/tls" "github.com/DataDog/datadog-agent/pkg/network/testutil" "github.com/DataDog/datadog-agent/pkg/network/tracer/connection" + "github.com/DataDog/datadog-agent/pkg/network/tracer/connection/kprobe" "github.com/DataDog/datadog-agent/pkg/network/tracer/offsetguess" tracertestutil "github.com/DataDog/datadog-agent/pkg/network/tracer/testutil" "github.com/DataDog/datadog-agent/pkg/network/tracer/testutil/testdns" @@ -109,7 +114,7 @@ func (s *TracerSuite) TestTCPRemoveEntries() { defer c2.Close() assert.EventuallyWithT(t, func(ct *assert.CollectT) { - conn, ok := findConnection(c2.LocalAddr(), c2.RemoteAddr(), getConnections(t, tr)) + conn, ok := findConnection(c2.LocalAddr(), c2.RemoteAddr(), getConnections(ct, tr)) if !assert.True(ct, ok) { return } @@ -123,9 +128,9 @@ func (s *TracerSuite) TestTCPRemoveEntries() { }, 3*time.Second, 100*time.Millisecond) // Make sure the first connection got cleaned up - assert.Eventually(t, func() bool { - _, ok := findConnection(c.LocalAddr(), c.RemoteAddr(), getConnections(t, tr)) - return !ok + assert.EventuallyWithT(t, func(ct *assert.CollectT) { + _, ok := findConnection(c.LocalAddr(), c.RemoteAddr(), getConnections(ct, tr)) + require.False(ct, ok) }, 5*time.Second, 100*time.Millisecond) } @@ -174,7 +179,7 @@ func (s *TracerSuite) TestTCPRetransmit() { var conn *network.ConnectionStats require.EventuallyWithT(t, func(ct *assert.CollectT) { // Iterate through active connections until we find connection created above, and confirm send + recv counts - connections := getConnections(t, tr) + connections := getConnections(ct, tr) ok := false conn, ok = findConnection(c.LocalAddr(), c.RemoteAddr(), connections) @@ -185,7 +190,7 @@ func (s *TracerSuite) TestTCPRetransmit() { assert.Equal(ct, 100*clientMessageSize, int(conn.Monotonic.SentBytes)) assert.Equal(ct, serverMessageSize, int(conn.Monotonic.RecvBytes)) if !tr.config.EnableEbpfless { - assert.Equal(t, os.Getpid(), int(conn.Pid)) + assert.Equal(ct, os.Getpid(), int(conn.Pid)) } assert.Equal(ct, addrPort(server.Address()), int(conn.DPort)) @@ -308,7 +313,7 @@ func (s *TracerSuite) TestTCPRTT() { require.EventuallyWithT(t, func(ct *assert.CollectT) { // Fetch connection matching source and target address - allConnections := getConnections(t, tr) + allConnections := getConnections(ct, tr) conn, ok := findConnection(c.LocalAddr(), c.RemoteAddr(), allConnections) if !assert.True(ct, ok) { return @@ -478,7 +483,7 @@ func (s *TracerSuite) TestConntrackExpiration() { return } - connections := getConnections(t, tr) + connections := getConnections(collect, tr) t.Log(connections) // for debugging failures var ok bool conn, ok = findConnection(c.LocalAddr(), c.RemoteAddr(), connections) @@ -541,10 +546,11 @@ func (s *TracerSuite) TestConntrackDelays() { _, err = c.Write([]byte("ping")) require.NoError(t, err) - require.Eventually(t, func() bool { - connections := getConnections(t, tr) + require.EventuallyWithT(t, func(collect *assert.CollectT) { + connections := getConnections(collect, tr) conn, ok := findConnection(c.LocalAddr(), c.RemoteAddr(), connections) - return ok && tr.conntracker.GetTranslationForConn(&conn.ConnectionTuple) != nil + require.True(collect, ok) + require.NotNil(collect, tr.conntracker.GetTranslationForConn(&conn.ConnectionTuple)) }, 3*time.Second, 100*time.Millisecond, "failed to find connection with translation") // write newline so server connections will exit @@ -629,7 +635,7 @@ func (s *TracerSuite) TestUnconnectedUDPSendIPv6() { require.NoError(t, err) require.EventuallyWithT(t, func(ct *assert.CollectT) { - connections := getConnections(t, tr) + connections := getConnections(ct, tr) outgoing := network.FilterConnections(connections, func(cs network.ConnectionStats) bool { if cs.Type != network.UDP { return false @@ -726,7 +732,7 @@ func (s *TracerSuite) TestGatewayLookupEnabled() { var clientIP string var clientPort int require.EventuallyWithT(t, func(c *assert.CollectT) { - clientIP, clientPort, _, err = testdns.SendDNSQueries(t, []string{"google.com"}, dnsAddr, "udp") + clientIP, clientPort, _, err = testdns.SendDNSQueries([]string{"google.com"}, dnsAddr, "udp") assert.NoError(c, err) }, 6*time.Second, 100*time.Millisecond, "failed to send dns query") @@ -734,10 +740,10 @@ func (s *TracerSuite) TestGatewayLookupEnabled() { dnsServerAddr := &net.UDPAddr{IP: dnsAddr, Port: 53} var conn *network.ConnectionStats - require.Eventually(t, func() bool { + require.EventuallyWithT(t, func(ct *assert.CollectT) { var ok bool - conn, ok = findConnection(dnsClientAddr, dnsServerAddr, getConnections(t, tr)) - return ok + conn, ok = findConnection(dnsClientAddr, dnsServerAddr, getConnections(ct, tr)) + require.True(ct, ok, "connection not found") }, 3*time.Second, 100*time.Millisecond) require.NotNil(t, conn.Via, "connection is missing via: %s", conn) @@ -783,30 +789,30 @@ func (s *TracerSuite) TestGatewayLookupSubnetLookupError() { var clientIP string var clientPort int require.EventuallyWithT(t, func(c *assert.CollectT) { - clientIP, clientPort, _, err = testdns.SendDNSQueries(t, []string{destDomain}, destAddr, "udp") + clientIP, clientPort, _, err = testdns.SendDNSQueries([]string{destDomain}, destAddr, "udp") assert.NoError(c, err) }, 6*time.Second, 100*time.Millisecond, "failed to send dns query") dnsClientAddr := &net.UDPAddr{IP: net.ParseIP(clientIP), Port: clientPort} dnsServerAddr := &net.UDPAddr{IP: destAddr, Port: 53} var c *network.ConnectionStats - require.Eventually(t, func() bool { + require.EventuallyWithT(t, func(ct *assert.CollectT) { var ok bool - c, ok = findConnection(dnsClientAddr, dnsServerAddr, getConnections(t, tr)) - return ok + c, ok = findConnection(dnsClientAddr, dnsServerAddr, getConnections(ct, tr)) + require.True(ct, ok, "connection not found") }, 3*time.Second, 100*time.Millisecond, "connection not found") require.Nil(t, c.Via) require.EventuallyWithT(t, func(c *assert.CollectT) { - clientIP, clientPort, _, err = testdns.SendDNSQueries(t, []string{destDomain}, destAddr, "udp") + clientIP, clientPort, _, err = testdns.SendDNSQueries([]string{destDomain}, destAddr, "udp") assert.NoError(c, err) }, 6*time.Second, 100*time.Millisecond, "failed to send dns query") dnsClientAddr = &net.UDPAddr{IP: net.ParseIP(clientIP), Port: clientPort} - require.Eventually(t, func() bool { + require.EventuallyWithT(t, func(ct *assert.CollectT) { var ok bool - c, ok = findConnection(dnsClientAddr, dnsServerAddr, getConnections(t, tr)) - return ok + c, ok = findConnection(dnsClientAddr, dnsServerAddr, getConnections(ct, tr)) + require.True(ct, ok, "connection not found") }, 3*time.Second, 100*time.Millisecond, "connection not found") require.Nil(t, c.Via) @@ -906,12 +912,13 @@ func (s *TracerSuite) TestGatewayLookupCrossNamespace() { _, err = c.Write([]byte("foo")) require.NoError(t, err) - require.Eventually(t, func() bool { + require.EventuallyWithT(t, func(collect *assert.CollectT) { var ok bool - conns := getConnections(t, tr) + conns := getConnections(collect, tr) t.Log(conns) conn, ok = findConnection(c.LocalAddr(), c.RemoteAddr(), conns) - return ok && conn.Direction == network.OUTGOING + require.True(collect, ok) + require.Equal(collect, network.OUTGOING, conn.Direction) }, 3*time.Second, 100*time.Millisecond) // conn.Via should be nil, since traffic is local @@ -939,12 +946,13 @@ func (s *TracerSuite) TestGatewayLookupCrossNamespace() { require.NoError(t, err) var conn *network.ConnectionStats - require.Eventually(t, func() bool { + require.EventuallyWithT(t, func(collect *assert.CollectT) { var ok bool - conns := getConnections(t, tr) + conns := getConnections(collect, tr) t.Log(conns) conn, ok = findConnection(c.LocalAddr(), c.RemoteAddr(), conns) - return ok && conn.Direction == network.OUTGOING + require.True(collect, ok) + require.Equal(collect, network.OUTGOING, conn.Direction) }, 3*time.Second, 100*time.Millisecond) // traffic is local, so Via field should not be set @@ -957,7 +965,7 @@ func (s *TracerSuite) TestGatewayLookupCrossNamespace() { var clientPort int require.EventuallyWithT(t, func(c *assert.CollectT) { kernel.WithNS(test2Ns, func() error { - clientIP, clientPort, _, err = testdns.SendDNSQueries(t, []string{"google.com"}, dnsAddr, "udp") + clientIP, clientPort, _, err = testdns.SendDNSQueries([]string{"google.com"}, dnsAddr, "udp") return nil }) assert.NoError(c, err) @@ -969,10 +977,11 @@ func (s *TracerSuite) TestGatewayLookupCrossNamespace() { iif := ipRouteGet(t, "", dnsClientAddr.IP.String(), nil) ifi := ipRouteGet(t, dnsClientAddr.IP.String(), dnsAddr.String(), iif) - require.Eventually(t, func() bool { + require.EventuallyWithT(t, func(collect *assert.CollectT) { var ok bool - conn, ok = findConnection(dnsClientAddr, dnsServerAddr, getConnections(t, tr)) - return ok && conn.Direction == network.OUTGOING + conn, ok = findConnection(dnsClientAddr, dnsServerAddr, getConnections(collect, tr)) + require.True(collect, ok) + require.Equal(collect, network.OUTGOING, conn.Direction) }, 3*time.Second, 100*time.Millisecond) require.NotNil(t, conn.Via) @@ -1012,16 +1021,15 @@ func (s *TracerSuite) TestConnectionAssured() { require.NoError(t, err) } - var conn *network.ConnectionStats - require.Eventually(t, func() bool { - conns := getConnections(t, tr) - var ok bool - conn, ok = findConnection(c.LocalAddr(), c.RemoteAddr(), conns) - return ok && conn.Monotonic.SentBytes > 0 && conn.Monotonic.RecvBytes > 0 + require.EventuallyWithT(t, func(collect *assert.CollectT) { + conns := getConnections(collect, tr) + conn, ok := findConnection(c.LocalAddr(), c.RemoteAddr(), conns) + require.True(collect, ok) + require.Positive(collect, conn.Monotonic.SentBytes) + require.Positive(collect, conn.Monotonic.RecvBytes) + // verify the connection is marked as assured + require.True(collect, conn.IsAssured) }, 3*time.Second, 100*time.Millisecond, "could not find udp connection") - - // verify the connection is marked as assured - require.True(t, conn.IsAssured) } func (s *TracerSuite) TestConnectionNotAssured() { @@ -1047,16 +1055,15 @@ func (s *TracerSuite) TestConnectionNotAssured() { _, err = c.Write(genPayload(clientMessageSize)) require.NoError(t, err) - var conn *network.ConnectionStats - require.Eventually(t, func() bool { - conns := getConnections(t, tr) - var ok bool - conn, ok = findConnection(c.LocalAddr(), c.RemoteAddr(), conns) - return ok && conn.Monotonic.SentBytes > 0 && conn.Monotonic.RecvBytes == 0 + require.EventuallyWithT(t, func(collect *assert.CollectT) { + conns := getConnections(collect, tr) + conn, ok := findConnection(c.LocalAddr(), c.RemoteAddr(), conns) + require.True(collect, ok) + require.Positive(collect, conn.Monotonic.SentBytes) + require.Zero(collect, conn.Monotonic.RecvBytes) + // verify the connection is marked as not assured + require.False(collect, conn.IsAssured) }, 3*time.Second, 100*time.Millisecond, "could not find udp connection") - - // verify the connection is marked as not assured - require.False(t, conn.IsAssured) } func (s *TracerSuite) TestUDPConnExpiryTimeout() { @@ -1111,19 +1118,15 @@ func (s *TracerSuite) TestDNATIntraHostIntegration() { }) var incoming, outgoing *network.ConnectionStats - require.Eventually(t, func() bool { + require.EventuallyWithT(t, func(collect *assert.CollectT) { _, err = conn.Write([]byte("ping")) - if !assert.NoError(t, err, "error writing in client") { - return false - } + require.NoError(collect, err) bs := make([]byte, 4) _, err = conn.Read(bs) - if !assert.NoError(t, err) { - return false - } + require.NoError(collect, err) - conns := getConnections(t, tr) + conns := getConnections(collect, tr) t.Log(conns) outgoing, _ = findConnection(conn.LocalAddr(), conn.RemoteAddr(), conns) @@ -1131,7 +1134,9 @@ func (s *TracerSuite) TestDNATIntraHostIntegration() { t.Logf("incoming: %+v, outgoing: %+v", incoming, outgoing) - return outgoing != nil && incoming != nil && outgoing.IPTranslation != nil + require.NotNil(collect, outgoing) + require.NotNil(collect, incoming) + require.NotNil(collect, outgoing.IPTranslation) }, 3*time.Second, 100*time.Millisecond, "failed to get both incoming and outgoing connection") assert.True(t, outgoing.IntraHost, "did not find outgoing connection classified as local: %v", outgoing) @@ -1175,13 +1180,13 @@ func (s *TracerSuite) TestSelfConnect() { t.Logf("port is %d", port) - require.Eventually(t, func() bool { - conns := network.FilterConnections(getConnections(t, tr), func(cs network.ConnectionStats) bool { + require.EventuallyWithT(t, func(collect *assert.CollectT) { + conns := network.FilterConnections(getConnections(collect, tr), func(cs network.ConnectionStats) bool { return cs.SPort == uint16(port) && cs.DPort == uint16(port) && cs.Source.IsLoopback() && cs.Dest.IsLoopback() }) t.Logf("connections: %v", conns) - return len(conns) == 2 + require.Len(collect, conns, 2) }, 5*time.Second, 100*time.Millisecond, "could not find expected number of tcp connections, expected: 2") } @@ -1277,8 +1282,8 @@ func testUDPPeekCount(t *testing.T, udpnet, ip string) { var incoming *network.ConnectionStats var outgoing *network.ConnectionStats - require.Eventuallyf(t, func() bool { - conns := getConnections(t, tr) + require.EventuallyWithTf(t, func(collect *assert.CollectT) { + conns := getConnections(collect, tr) if outgoing == nil { outgoing, _ = findConnection(c.LocalAddr(), c.RemoteAddr(), conns) } @@ -1286,7 +1291,8 @@ func testUDPPeekCount(t *testing.T, udpnet, ip string) { incoming, _ = findConnection(c.RemoteAddr(), c.LocalAddr(), conns) } - return outgoing != nil && incoming != nil + require.NotNil(collect, outgoing) + require.NotNil(collect, incoming) }, 3*time.Second, 100*time.Millisecond, "couldn't find incoming and outgoing connections matching") m := outgoing.Monotonic @@ -1343,8 +1349,8 @@ func testUDPPacketSumming(t *testing.T, udpnet, ip string) { var incoming *network.ConnectionStats var outgoing *network.ConnectionStats - require.Eventuallyf(t, func() bool { - conns := getConnections(t, tr) + require.EventuallyWithTf(t, func(collect *assert.CollectT) { + conns := getConnections(collect, tr) if outgoing == nil { outgoing, _ = findConnection(c.LocalAddr(), c.RemoteAddr(), conns) } @@ -1352,7 +1358,8 @@ func testUDPPacketSumming(t *testing.T, udpnet, ip string) { incoming, _ = findConnection(c.RemoteAddr(), c.LocalAddr(), conns) } - return outgoing != nil && incoming != nil + require.NotNil(collect, outgoing) + require.NotNil(collect, incoming) }, 3*time.Second, 100*time.Millisecond, "couldn't find incoming and outgoing connections matching") m := outgoing.Monotonic @@ -1407,8 +1414,8 @@ func (s *TracerSuite) TestUDPPythonReusePort() { t.Logf("port is %d", port) conns := map[network.ConnectionTuple]network.ConnectionStats{} - require.Eventually(t, func() bool { - _conns := network.FilterConnections(getConnections(t, tr), func(cs network.ConnectionStats) bool { + require.EventuallyWithT(t, func(collect *assert.CollectT) { + _conns := network.FilterConnections(getConnections(collect, tr), func(cs network.ConnectionStats) bool { return cs.Type == network.UDP && cs.Source.IsLoopback() && cs.Dest.IsLoopback() && @@ -1421,7 +1428,7 @@ func (s *TracerSuite) TestUDPPythonReusePort() { t.Log(conns) - return len(conns) == 4 + require.Len(collect, conns, 4) }, 3*time.Second, 100*time.Millisecond, "could not find expected number of udp connections, expected: 4") var incoming, outgoing []network.ConnectionStats @@ -1527,25 +1534,25 @@ func testUDPReusePort(t *testing.T, udpnet string, ip string) { assert.EventuallyWithT(t, func(ct *assert.CollectT) { //nolint:revive // TODO // use t instead of ct because getConnections uses require (not assert), and we get a better error message that way - connections := getConnections(t, tr) + connections := getConnections(ct, tr) incoming, ok := findConnection(c.RemoteAddr(), c.LocalAddr(), connections) - if assert.True(t, ok, "unable to find incoming connection") { - assert.Equal(t, network.INCOMING, incoming.Direction) + if assert.True(ct, ok, "unable to find incoming connection") { + assert.Equal(ct, network.INCOMING, incoming.Direction) // make sure the inverse values are seen for the other message - assert.Equal(t, serverMessageSize, int(incoming.Monotonic.SentBytes), "incoming sent") - assert.Equal(t, clientMessageSize, int(incoming.Monotonic.RecvBytes), "incoming recv") - assert.True(t, incoming.IntraHost, "incoming intrahost") + assert.Equal(ct, serverMessageSize, int(incoming.Monotonic.SentBytes), "incoming sent") + assert.Equal(ct, clientMessageSize, int(incoming.Monotonic.RecvBytes), "incoming recv") + assert.True(ct, incoming.IntraHost, "incoming intrahost") } outgoing, ok := findConnection(c.LocalAddr(), c.RemoteAddr(), connections) - if assert.True(t, ok, "unable to find outgoing connection") { - assert.Equal(t, network.OUTGOING, outgoing.Direction) + if assert.True(ct, ok, "unable to find outgoing connection") { + assert.Equal(ct, network.OUTGOING, outgoing.Direction) - assert.Equal(t, clientMessageSize, int(outgoing.Monotonic.SentBytes), "outgoing sent") - assert.Equal(t, serverMessageSize, int(outgoing.Monotonic.RecvBytes), "outgoing recv") - assert.True(t, outgoing.IntraHost, "outgoing intrahost") + assert.Equal(ct, clientMessageSize, int(outgoing.Monotonic.SentBytes), "outgoing sent") + assert.Equal(ct, serverMessageSize, int(outgoing.Monotonic.RecvBytes), "outgoing recv") + assert.True(ct, outgoing.IntraHost, "outgoing intrahost") } }, 3*time.Second, 100*time.Millisecond) @@ -1658,8 +1665,8 @@ func (s *TracerSuite) TestSendfileRegression() { t.Logf("looking for connections %+v <-> %+v", c.LocalAddr(), c.RemoteAddr()) var outConn, inConn *network.ConnectionStats - assert.Eventually(t, func() bool { - conns := getConnections(t, tr) + assert.EventuallyWithT(t, func(ct *assert.CollectT) { + conns := getConnections(ct, tr) t.Log(conns) if outConn == nil { outConn = network.FirstConnection(conns, network.ByType(connType), network.ByFamily(family), network.ByTuple(c.LocalAddr(), c.RemoteAddr())) @@ -1667,7 +1674,8 @@ func (s *TracerSuite) TestSendfileRegression() { if inConn == nil { inConn = network.FirstConnection(conns, network.ByType(connType), network.ByFamily(family), network.ByTuple(c.RemoteAddr(), c.LocalAddr())) } - return outConn != nil && inConn != nil + require.NotNil(ct, outConn) + require.NotNil(ct, inConn) }, 3*time.Second, 100*time.Millisecond, "couldn't find connections used by sendfile(2)") if assert.NotNil(t, outConn, "couldn't find outgoing connection used by sendfile(2)") { @@ -1781,15 +1789,12 @@ func (s *TracerSuite) TestSendfileError() { c.Close() - var conn *network.ConnectionStats - require.Eventually(t, func() bool { - conns := getConnections(t, tr) - var ok bool - conn, ok = findConnection(c.LocalAddr(), c.RemoteAddr(), conns) - return ok + require.EventuallyWithT(t, func(collect *assert.CollectT) { + conns := getConnections(collect, tr) + conn, ok := findConnection(c.LocalAddr(), c.RemoteAddr(), conns) + require.True(collect, ok) + require.Equalf(collect, int64(0), int64(conn.Monotonic.SentBytes), "sendfile data wasn't properly traced") }, 3*time.Second, 100*time.Millisecond, "couldn't find connection used by sendfile(2)") - - assert.Equalf(t, int64(0), int64(conn.Monotonic.SentBytes), "sendfile data wasn't properly traced") } func sendFile(t *testing.T, c SyscallConn, f *os.File, offset *int64, count int) (int, error) { @@ -1881,15 +1886,12 @@ func (s *TracerSuite) TestShortWrite() { c, err := net.FileConn(f) require.NoError(t, err) - var conn *network.ConnectionStats - require.Eventually(t, func() bool { - conns := getConnections(t, tr) - var ok bool - conn, ok = findConnection(c.LocalAddr(), c.RemoteAddr(), conns) - return ok + require.EventuallyWithT(t, func(collect *assert.CollectT) { + conns := getConnections(collect, tr) + conn, ok := findConnection(c.LocalAddr(), c.RemoteAddr(), conns) + require.True(collect, ok) + require.Equal(collect, sent, conn.Monotonic.SentBytes) }, 3*time.Second, 100*time.Millisecond, "couldn't find connection used by short write") - - assert.Equal(t, sent, conn.Monotonic.SentBytes) } func (s *TracerSuite) TestKprobeAttachWithKprobeEvents() { @@ -1972,30 +1974,27 @@ func (s *TracerSuite) TestBlockingReadCounts() { assert.Equal(collect, 6, read) }, 10*time.Second, 100*time.Millisecond, "failed to get required bytes") - var conn *network.ConnectionStats - require.Eventually(t, func() bool { - var found bool - conn, found = findConnection(c.(*net.TCPConn).LocalAddr(), c.(*net.TCPConn).RemoteAddr(), getConnections(t, tr)) - return found + require.EventuallyWithT(t, func(collect *assert.CollectT) { + conn, found := findConnection(c.(*net.TCPConn).LocalAddr(), c.(*net.TCPConn).RemoteAddr(), getConnections(collect, tr)) + require.True(collect, found) + require.Equal(collect, uint64(read), conn.Monotonic.RecvBytes) }, 3*time.Second, 100*time.Millisecond) - - assert.Equal(t, uint64(read), conn.Monotonic.RecvBytes) } func (s *TracerSuite) TestPreexistingConnectionDirection() { t := s.T() // Start the client and server before we enable the system probe to test that the tracer picks // up the pre-existing connection - server := tracertestutil.NewTCPServer(func(c net.Conn) { r := bufio.NewReader(c) for { if _, err := r.ReadBytes(byte('\n')); err != nil { assert.ErrorIs(t, err, io.EOF, "exited server loop with error that is not EOF") - return + break } _, _ = c.Write(genPayload(serverMessageSize)) } + c.Close() }) t.Cleanup(server.Shutdown) require.NoError(t, server.Run()) @@ -2020,46 +2019,65 @@ func (s *TracerSuite) TestPreexistingConnectionDirection() { c.Close() var incoming, outgoing *network.ConnectionStats - require.Eventually(t, func() bool { - connections := getConnections(t, tr) + require.EventuallyWithT(t, func(collect *assert.CollectT) { + connections := getConnections(collect, tr) if outgoing == nil { outgoing, _ = findConnection(c.LocalAddr(), c.RemoteAddr(), connections) } if incoming == nil { incoming, _ = findConnection(c.RemoteAddr(), c.LocalAddr(), connections) } - return incoming != nil && outgoing != nil - }, 3*time.Second, 100*time.Millisecond, "could not find connection incoming and outgoing connections") + require.NotNil(collect, outgoing) + require.NotNil(collect, incoming) + if !assert.True(collect, incoming != nil && outgoing != nil) { + return + } - m := outgoing.Monotonic - assert.Equal(t, clientMessageSize, int(m.SentBytes)) - assert.Equal(t, serverMessageSize, int(m.RecvBytes)) - if !tr.config.EnableEbpfless { - assert.Equal(t, os.Getpid(), int(outgoing.Pid)) - } - assert.Equal(t, addrPort(server.Address()), int(outgoing.DPort)) - assert.Equal(t, c.LocalAddr().(*net.TCPAddr).Port, int(outgoing.SPort)) - assert.Equal(t, network.OUTGOING, outgoing.Direction) + m := outgoing.Monotonic + assert.Equal(collect, clientMessageSize, int(m.SentBytes)) + // ebpfless RecvBytes is based off acknowledgements, so it can miss the first + // packet in a pre-existing connection + if !tr.config.EnableEbpfless { + assert.Equal(collect, serverMessageSize, int(m.RecvBytes)) + } + if !tr.config.EnableEbpfless { + assert.Equal(collect, os.Getpid(), int(outgoing.Pid)) + } + assert.Equal(collect, addrPort(server.Address()), int(outgoing.DPort)) + assert.Equal(collect, c.LocalAddr().(*net.TCPAddr).Port, int(outgoing.SPort)) + assert.Equal(collect, network.OUTGOING, outgoing.Direction) + + m = incoming.Monotonic + // ebpfless RecvBytes is based off acknowledgements, so it can miss the first + // packet in a pre-existing connection + if !tr.config.EnableEbpfless { + assert.Equal(collect, clientMessageSize, int(m.RecvBytes)) + } + assert.Equal(collect, serverMessageSize, int(m.SentBytes)) + if !tr.config.EnableEbpfless { + assert.Equal(collect, os.Getpid(), int(incoming.Pid)) + } + assert.Equal(collect, addrPort(server.Address()), int(incoming.SPort)) + assert.Equal(collect, c.LocalAddr().(*net.TCPAddr).Port, int(incoming.DPort)) + assert.Equal(collect, network.INCOMING, incoming.Direction) + }, 3*time.Second, 100*time.Millisecond, "could not find connection incoming and outgoing connections") - m = incoming.Monotonic - assert.Equal(t, clientMessageSize, int(m.RecvBytes)) - assert.Equal(t, serverMessageSize, int(m.SentBytes)) - if !tr.config.EnableEbpfless { - assert.Equal(t, os.Getpid(), int(incoming.Pid)) - } - assert.Equal(t, addrPort(server.Address()), int(incoming.SPort)) - assert.Equal(t, c.LocalAddr().(*net.TCPAddr).Port, int(incoming.DPort)) - assert.Equal(t, network.INCOMING, incoming.Direction) } func (s *TracerSuite) TestPreexistingEmptyIncomingConnectionDirection() { t := s.T() + + // The ebpf tracer uses this to ensure it drops pre-existing connections + // that close empty (with no data), because they are difficult to track. + // However, in ebpfless they are easy to track, so disable this test. + // For more context, see PR #31100 + skipOnEbpflessNotSupported(t, testConfig()) + t.Run("ringbuf_enabled", func(t *testing.T) { if features.HaveMapType(ebpf.RingBuf) != nil { t.Skip("skipping test as ringbuffers are not supported on this kernel") } c := testConfig() - skipOnEbpflessNotSupported(t, c) c.NPMRingbuffersEnabled = true testPreexistingEmptyIncomingConnectionDirection(t, c) }) @@ -2136,14 +2154,12 @@ func (s *TracerSuite) TestUDPIncomingDirectionFix() { raddr, err := net.ResolveUDPAddr("udp", server.address) require.NoError(t, err) - var conn *network.ConnectionStats - require.Eventually(t, func() bool { - conns := getConnections(t, tr) - conn, _ = findConnection(net.UDPAddrFromAddrPort(ap), raddr, conns) - return conn != nil + require.EventuallyWithT(t, func(collect *assert.CollectT) { + conns := getConnections(collect, tr) + conn, _ := findConnection(net.UDPAddrFromAddrPort(ap), raddr, conns) + require.NotNil(collect, conn) + require.Equal(collect, network.OUTGOING, conn.Direction) }, 3*time.Second, 100*time.Millisecond) - - assert.Equal(t, network.OUTGOING, conn.Direction) } func TestEbpfConntrackerFallback(t *testing.T) { @@ -2413,31 +2429,24 @@ LOOP: // get connections, the client connection will still // not be in the closed state, so duration will the // timestamp of when it was created - var conn *network.ConnectionStats require.EventuallyWithT(t, func(collect *assert.CollectT) { - conns := getConnections(t, tr) - var found bool - conn, found = findConnection(c.LocalAddr(), srv.Addr(), conns) - assert.True(collect, found, "could not find connection") - + conns := getConnections(collect, tr) + conn, found := findConnection(c.LocalAddr(), srv.Addr(), conns) + require.True(collect, found, "could not find connection") + // all we can do is verify it is > 0 + require.Greater(collect, conn.Duration, time.Duration(0)) }, 3*time.Second, 100*time.Millisecond, "could not find connection") - // all we can do is verify it is > 0 - assert.Greater(t, conn.Duration, time.Duration(0)) require.NoError(t, c.Close(), "error closing client connection") require.EventuallyWithT(t, func(collect *assert.CollectT) { - var found bool - conn, found = findConnection(c.LocalAddr(), srv.Addr(), getConnections(t, tr)) - if !assert.True(collect, found, "could not find connection") { - return - } - assert.True(collect, conn.IsClosed, "connection should be closed") + conn, found := findConnection(c.LocalAddr(), srv.Addr(), getConnections(collect, tr)) + require.True(collect, found, "could not find connection") + require.True(collect, conn.IsClosed, "connection should be closed") + // after closing the client connection, the duration should be + // updated to a value between 1s and 2s + require.Greater(collect, conn.Duration, time.Second, "connection duration should be between 1 and 2 seconds") + require.Less(collect, conn.Duration, 2*time.Second, "connection duration should be between 1 and 2 seconds") }, 3*time.Second, 100*time.Millisecond, "could not find closed connection") - - // after closing the client connection, the duration should be - // updated to a value between 1s and 2s - assert.Greater(t, conn.Duration, time.Second, "connection duration should be between 1 and 2 seconds") - assert.Less(t, conn.Duration, 2*time.Second, "connection duration should be between 1 and 2 seconds") } var failedConnectionsBuildModes = map[ebpftest.BuildMode]struct{}{ @@ -2503,19 +2512,17 @@ func (s *TracerSuite) TestTCPFailureConnectionTimeout() { localAddr := fmt.Sprintf("127.0.0.1:%d", port) // Check if the connection was recorded as failed due to timeout - var conn *network.ConnectionStats - require.Eventually(t, func() bool { - conns := getConnections(t, tr) + require.EventuallyWithT(t, func(collect *assert.CollectT) { + conns := getConnections(collect, tr) // 110 is the errno for ETIMEDOUT - conn = findFailedConnection(t, localAddr, srvAddr, conns, 110) - return conn != nil + conn := findFailedConnection(t, localAddr, srvAddr, conns, 110) + require.NotNil(collect, conn) + assert.Equal(collect, uint32(0), conn.TCPFailures[104], "expected 0 connection reset") + assert.Equal(collect, uint32(0), conn.TCPFailures[111], "expected 0 connection refused") + assert.Equal(collect, uint32(1), conn.TCPFailures[110], "expected 1 connection timeout") + assert.Equal(collect, uint64(0), conn.Monotonic.SentBytes, "expected 0 bytes sent") + assert.Equal(collect, uint64(0), conn.Monotonic.RecvBytes, "expected 0 bytes received") }, 3*time.Second, 100*time.Millisecond, "Failed connection not recorded properly") - - assert.Equal(t, uint32(0), conn.TCPFailures[104], "expected 0 connection reset") - assert.Equal(t, uint32(0), conn.TCPFailures[111], "expected 0 connection refused") - assert.Equal(t, uint32(1), conn.TCPFailures[110], "expected 1 connection timeout") - assert.Equal(t, uint64(0), conn.Monotonic.SentBytes, "expected 0 bytes sent") - assert.Equal(t, uint64(0), conn.Monotonic.RecvBytes, "expected 0 bytes received") } func (s *TracerSuite) TestTCPFailureConnectionResetWithDNAT() { @@ -2561,10 +2568,11 @@ func (s *TracerSuite) TestTCPFailureConnectionResetWithDNAT() { // Check if the connection was recorded as reset var conn *network.ConnectionStats - require.Eventually(t, func() bool { + require.EventuallyWithT(t, func(collect *assert.CollectT) { // 104 is the errno for ECONNRESET - conn = findFailedConnection(t, c.LocalAddr().String(), serverAddr, getConnections(t, tr), 104) - return conn != nil + // findFailedConnection gets `t` as it needs to log, it does not assert so no conversion is needed. + conn = findFailedConnection(t, c.LocalAddr().String(), serverAddr, getConnections(collect, tr), 104) + require.NotNil(collect, conn) }, 3*time.Second, 100*time.Millisecond, "Failed connection not recorded properly") require.NoError(t, c.Close(), "error closing client connection") @@ -2587,6 +2595,196 @@ func setupDropTrafficRule(tb testing.TB) (ns string) { return } +func (s *TracerSuite) TestTLSClassification() { + t := s.T() + cfg := testConfig() + + if !kprobe.ClassificationSupported(cfg) { + t.Skip("protocol classification not supported") + } + + tr := setupTracer(t, cfg) + + type tlsTest struct { + name string + postTracerSetup func(t *testing.T) (port uint16, scenario uint16) + validation func(t *testing.T, tr *Tracer, port uint16, scenario uint16) + } + + tests := make([]tlsTest, 0) + for _, scenario := range []uint16{tls.VersionTLS10, tls.VersionTLS11, tls.VersionTLS12, tls.VersionTLS13} { + scenario := scenario + tests = append(tests, tlsTest{ + name: strings.Replace(tls.VersionName(scenario), " ", "-", 1), + postTracerSetup: func(t *testing.T) (uint16, uint16) { + srv := usmtestutil.NewTLSServerWithSpecificVersion("localhost:0", func(conn net.Conn) { + defer conn.Close() + _, err := io.Copy(conn, conn) + if err != nil { + fmt.Printf("Failed to echo data: %v\n", err) + return + } + }, scenario) + done := make(chan struct{}) + require.NoError(t, srv.Run(done)) + t.Cleanup(func() { close(done) }) + + // Retrieve the actual port assigned to the server + addr := srv.Address() + _, portStr, err := net.SplitHostPort(addr) + require.NoError(t, err) + portInt, err := strconv.Atoi(portStr) + require.NoError(t, err) + port := uint16(portInt) + + tlsConfig := &tls.Config{ + MinVersion: scenario, + MaxVersion: scenario, + InsecureSkipVerify: true, + SessionTicketsDisabled: true, + ClientSessionCache: nil, + } + conn, err := net.Dial("tcp", addr) + require.NoError(t, err) + defer conn.Close() + + tlsConn := tls.Client(conn, tlsConfig) + require.NoError(t, tlsConn.Handshake()) + + return port, scenario + }, + validation: func(t *testing.T, tr *Tracer, port uint16, scenario uint16) { + require.EventuallyWithT(t, func(ct *assert.CollectT) { + require.True(ct, validateTLSTags(ct, tr, port, scenario), "TLS tags not set") + }, 3*time.Second, 100*time.Millisecond, "couldn't find TLS connection matching: dst port %v", port) + }, + }) + } + tests = append(tests, tlsTest{ + name: "Invalid-TLS-Handshake", + postTracerSetup: func(t *testing.T) (uint16, uint16) { + // server that accepts connections but does not perform TLS handshake + listener, err := net.Listen("tcp", "localhost:0") + require.NoError(t, err) + t.Cleanup(func() { listener.Close() }) + + go func() { + for { + conn, err := listener.Accept() + if err != nil { + return + } + go func(c net.Conn) { + defer c.Close() + buf := make([]byte, 1024) + _, _ = c.Read(buf) + // Do nothing with the data + }(conn) + } + }() + + // Retrieve the actual port from the listener address + addr := listener.Addr().String() + _, portStr, err := net.SplitHostPort(addr) + require.NoError(t, err) + portInt, err := strconv.Atoi(portStr) + require.NoError(t, err) + port := uint16(portInt) + + // Client connects to the server + conn, err := net.Dial("tcp", addr) + require.NoError(t, err) + defer conn.Close() + + // Send invalid TLS handshake data + _, err = conn.Write([]byte("invalid TLS data")) + require.NoError(t, err) + + // Since this is invalid TLS, scenario can be set to something irrelevant, e.g., TLS.VersionTLS12 + // or just 0 since the validation doesn't rely on the scenario for this test. + return port, tls.VersionTLS12 + }, + validation: func(t *testing.T, tr *Tracer, port uint16, _ uint16) { + // Verify that no TLS tags are set for this connection + require.EventuallyWithT(t, func(ct *assert.CollectT) { + payload := getConnections(ct, tr) + for _, c := range payload.Conns { + if c.DPort == port && c.ProtocolStack.Contains(protocols.TLS) { + t.Log("Unexpected TLS protocol detected for invalid handshake") + require.Fail(ct, "unexpected TLS tags") + } + } + }, 3*time.Second, 100*time.Millisecond) + }, + }) + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + if ebpftest.GetBuildMode() == ebpftest.Fentry { + t.Skip("protocol classification not supported for fentry tracer") + } + t.Cleanup(func() { + tr.RemoveClient(clientID) + _ = tr.Pause() + }) + tr.RemoveClient(clientID) + require.NoError(t, tr.RegisterClient(clientID)) + require.NoError(t, tr.Resume(), "enable probes - before post tracer") + port, scenario := tt.postTracerSetup(t) + require.NoError(t, tr.Pause(), "disable probes - after post tracer") + tt.validation(t, tr, port, scenario) + }) + } +} + +func validateTLSTags(t *assert.CollectT, tr *Tracer, port uint16, scenario uint16) bool { + payload := getConnections(t, tr) + for _, c := range payload.Conns { + if c.DPort == port && c.ProtocolStack.Contains(protocols.TLS) && !c.TLSTags.IsEmpty() { + tlsTags := c.TLSTags.GetDynamicTags() + + // Check that the cipher suite ID tag is present + cipherSuiteTagFound := false + for key := range tlsTags { + if strings.HasPrefix(key, ddtls.TagTLSCipherSuiteID) { + cipherSuiteTagFound = true + break + } + } + if !cipherSuiteTagFound { + return false + } + + // Check that the negotiated version tag is present + negotiatedVersionTag := ddtls.VersionTags[scenario] + if _, ok := tlsTags[negotiatedVersionTag]; !ok { + return false + } + + // Check that the client offered version tag is present + clientVersionTag := ddtls.ClientVersionTags[scenario] + if _, ok := tlsTags[clientVersionTag]; !ok { + return false + } + + if scenario == tls.VersionTLS13 { + expectedClientVersions := []string{ + ddtls.ClientVersionTags[tls.VersionTLS12], + ddtls.ClientVersionTags[tls.VersionTLS13], + } + for _, tag := range expectedClientVersions { + if _, ok := tlsTags[tag]; !ok { + return false + } + } + } + + return true + } + } + return false +} + func skipOnEbpflessNotSupported(t *testing.T, cfg *config.Config) { if cfg.EnableEbpfless { t.Skip("not supported on ebpf-less") diff --git a/pkg/network/tracer/tracer_test.go b/pkg/network/tracer/tracer_test.go index b032aabe44c5f..f3117827905fc 100644 --- a/pkg/network/tracer/tracer_test.go +++ b/pkg/network/tracer/tracer_test.go @@ -26,7 +26,6 @@ import ( "testing" "time" - "github.com/cihub/seelog" "github.com/miekg/dns" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -55,7 +54,7 @@ func TestMain(m *testing.M) { if logLevel == "" { logLevel = "warn" } - log.SetupLogger(seelog.Default, logLevel) + log.SetupLogger(log.Default(), logLevel) platformInit() os.Exit(m.Run()) } @@ -198,12 +197,13 @@ func (s *TracerSuite) TestTCPSendAndReceive() { require.NoError(t, err) var conn *network.ConnectionStats - require.Eventually(t, func() bool { + require.EventuallyWithT(t, func(collect *assert.CollectT) { // Iterate through active connections until we find connection created above, and confirm send + recv counts - connections := getConnections(t, tr) + connections := getConnections(collect, tr) var ok bool conn, ok = findConnection(c.LocalAddr(), c.RemoteAddr(), connections) - return conn != nil && ok + require.True(collect, ok) + require.NotNil(collect, conn) }, 3*time.Second, 100*time.Millisecond, "failed to find connection") m := conn.Monotonic @@ -246,10 +246,10 @@ func (s *TracerSuite) TestTCPShortLived() { c.Close() var conn *network.ConnectionStats - require.Eventually(t, func() bool { + require.EventuallyWithT(t, func(collect *assert.CollectT) { var ok bool - conn, ok = findConnection(c.LocalAddr(), c.RemoteAddr(), getConnections(t, tr)) - return ok + conn, ok = findConnection(c.LocalAddr(), c.RemoteAddr(), getConnections(collect, tr)) + require.True(collect, ok) }, 3*time.Second, 100*time.Millisecond, "connection not found") m := conn.Monotonic @@ -399,14 +399,15 @@ func (s *TracerSuite) TestTCPConnsReported() { var reverse *network.ConnectionStats var okForward, okReverse bool // for ebpfless, it takes time for the packet capture to arrive, so poll - require.Eventually(t, func() bool { + require.EventuallyWithT(t, func(collect *assert.CollectT) { // Test - connections := getConnections(t, tr) + connections := getConnections(collect, tr) // Server-side forward, okForward = findConnection(c.RemoteAddr(), c.LocalAddr(), connections) + require.True(collect, okForward) // Client-side reverse, okReverse = findConnection(c.LocalAddr(), c.RemoteAddr(), connections) - return okForward && okReverse + require.True(collect, okReverse) }, 3*time.Second, 100*time.Millisecond, "connection not found") assert.Equal(t, network.INCOMING, forward.Direction) @@ -470,7 +471,7 @@ func testUDPSendAndReceive(t *testing.T, tr *Tracer, addr string) { // Iterate through active connections until we find connection created above, and confirm send + recv counts require.EventuallyWithT(t, func(ct *assert.CollectT) { // use t instead of ct because getConnections uses require (not assert), and we get a better error message - connections := getConnections(t, tr) + connections := getConnections(ct, tr) incoming, ok := findConnection(c.RemoteAddr(), c.LocalAddr(), connections) if assert.True(ct, ok, "unable to find incoming connection") { assert.Equal(ct, network.INCOMING, incoming.Direction) @@ -482,12 +483,12 @@ func testUDPSendAndReceive(t *testing.T, tr *Tracer, addr string) { } outgoing, ok := findConnection(c.LocalAddr(), c.RemoteAddr(), connections) - if assert.True(t, ok, "unable to find outgoing connection") { - assert.Equal(t, network.OUTGOING, outgoing.Direction) + if assert.True(ct, ok, "unable to find outgoing connection") { + assert.Equal(ct, network.OUTGOING, outgoing.Direction) - assert.Equal(t, clientMessageSize, int(outgoing.Monotonic.SentBytes), "outgoing sent") - assert.Equal(t, serverMessageSize, int(outgoing.Monotonic.RecvBytes), "outgoing recv") - assert.True(t, outgoing.IntraHost, "outgoing intrahost") + assert.Equal(ct, clientMessageSize, int(outgoing.Monotonic.SentBytes), "outgoing sent") + assert.Equal(ct, serverMessageSize, int(outgoing.Monotonic.RecvBytes), "outgoing recv") + assert.True(ct, outgoing.IntraHost, "outgoing intrahost") } }, 3*time.Second, 100*time.Millisecond) @@ -579,14 +580,14 @@ func (s *TracerSuite) TestLocalDNSCollectionEnabled() { assert.NoError(t, err) // Iterate through active connections making sure theres at least one connection - require.Eventually(t, func() bool { - for _, c := range getConnections(t, tr).Conns { + require.EventuallyWithT(t, func(collect *assert.CollectT) { + for _, c := range getConnections(collect, tr).Conns { if isLocalDNS(c) { - return true + return } } - return false + require.Fail(collect, "could not find connection") }, 3*time.Second, 100*time.Millisecond, "could not find connection") } @@ -651,15 +652,15 @@ func (s *TracerSuite) TestShouldExcludeEmptyStatsConnection() { assert.NoError(t, err) var zeroConn network.ConnectionStats - require.Eventually(t, func() bool { - cxs := getConnections(t, tr) + require.EventuallyWithT(t, func(collect *assert.CollectT) { + cxs := getConnections(collect, tr) for _, c := range cxs.Conns { if c.Dest.String() == "127.0.0.1" && c.DPort == 80 { zeroConn = c - return true + return } } - return false + require.Fail(collect, "could not find connection") }, 2*time.Second, 100*time.Millisecond) // next call should not have the same connection @@ -1072,7 +1073,6 @@ func (s *TracerSuite) TestDNSStats() { func (s *TracerSuite) TestTCPEstablished() { t := s.T() - // Ensure closed connections are flushed as soon as possible cfg := testConfig() tr := setupTracer(t, cfg) @@ -1094,9 +1094,9 @@ func (s *TracerSuite) TestTCPEstablished() { var ok bool // for ebpfless, wait for the packet capture to appear - require.Eventually(t, func() bool { - conn, ok = findConnection(laddr, raddr, getConnections(t, tr)) - return ok + require.EventuallyWithT(t, func(collect *assert.CollectT) { + conn, ok = findConnection(laddr, raddr, getConnections(collect, tr)) + require.True(collect, ok) }, 3*time.Second, 100*time.Millisecond, "couldn't find connection") require.True(t, ok) @@ -1106,10 +1106,10 @@ func (s *TracerSuite) TestTCPEstablished() { c.Close() // Wait for the connection to be sent from the perf buffer - require.Eventually(t, func() bool { + require.EventuallyWithT(t, func(collect *assert.CollectT) { var ok bool - conn, ok = findConnection(laddr, raddr, getConnections(t, tr)) - return ok + conn, ok = findConnection(laddr, raddr, getConnections(collect, tr)) + require.True(collect, ok) }, 3*time.Second, 100*time.Millisecond, "couldn't find connection") require.True(t, ok) @@ -1129,6 +1129,7 @@ func (s *TracerSuite) TestTCPEstablishedPreExistingConn() { c, err := net.DialTimeout("tcp", server.Address(), 50*time.Millisecond) require.NoError(t, err) laddr, raddr := c.LocalAddr(), c.RemoteAddr() + t.Logf("laddr=%s raddr=%s", laddr, raddr) // Ensure closed connections are flushed as soon as possible cfg := testConfig() @@ -1140,10 +1141,10 @@ func (s *TracerSuite) TestTCPEstablishedPreExistingConn() { // Wait for the connection to be sent from the perf buffer var conn *network.ConnectionStats - require.Eventually(t, func() bool { + require.EventuallyWithT(t, func(collect *assert.CollectT) { var ok bool - conn, ok = findConnection(laddr, raddr, getConnections(t, tr)) - return ok + conn, ok = findConnection(laddr, raddr, getConnections(collect, tr)) + require.True(collect, ok) }, 3*time.Second, 100*time.Millisecond, "couldn't find connection") m := conn.Monotonic @@ -1167,7 +1168,7 @@ func (s *TracerSuite) TestUnconnectedUDPSendIPv4() { require.NoError(t, err) require.EventuallyWithT(t, func(ct *assert.CollectT) { - connections := getConnections(t, tr) + connections := getConnections(ct, tr) outgoing := network.FilterConnections(connections, func(cs network.ConnectionStats) bool { return cs.DPort == uint16(remotePort) }) @@ -1198,7 +1199,7 @@ func (s *TracerSuite) TestConnectedUDPSendIPv6() { var outgoing []network.ConnectionStats require.EventuallyWithT(t, func(ct *assert.CollectT) { - connections := getConnections(t, tr) + connections := getConnections(ct, tr) outgoing = network.FilterConnections(connections, func(cs network.ConnectionStats) bool { return cs.DPort == uint16(remotePort) }) @@ -1247,8 +1248,8 @@ func (s *TracerSuite) TestTCPDirection() { // Iterate through active connections until we find connection created above var outgoingConns []network.ConnectionStats var incomingConns []network.ConnectionStats - require.Eventuallyf(t, func() bool { - conns := getConnections(t, tr) + require.EventuallyWithTf(t, func(collect *assert.CollectT) { + conns := getConnections(collect, tr) if len(outgoingConns) == 0 { outgoingConns = network.FilterConnections(conns, func(cs network.ConnectionStats) bool { return fmt.Sprintf("%s:%d", cs.Dest, cs.DPort) == serverAddr @@ -1260,7 +1261,8 @@ func (s *TracerSuite) TestTCPDirection() { }) } - return len(outgoingConns) == 1 && len(incomingConns) == 1 + require.Len(collect, outgoingConns, 1) + require.Len(collect, incomingConns, 1) }, 3*time.Second, 10*time.Millisecond, "couldn't find incoming and outgoing http connections matching: %s", serverAddr) // Verify connection directions @@ -1290,11 +1292,11 @@ func (s *TracerSuite) TestTCPFailureConnectionRefused() { // Check if the connection was recorded as refused var foundConn *network.ConnectionStats - require.Eventually(t, func() bool { - conns := getConnections(t, tr) + require.EventuallyWithT(t, func(collect *assert.CollectT) { + conns := getConnections(collect, tr) // Check for the refusal record foundConn = findFailedConnectionByRemoteAddr(srvAddr, conns, 111) - return foundConn != nil + require.NotNil(collect, foundConn) }, 3*time.Second, 100*time.Millisecond, "Failed connection not recorded properly") assert.Equal(t, uint32(1), foundConn.TCPFailures[111], "expected 1 connection refused") @@ -1342,10 +1344,11 @@ func (s *TracerSuite) TestTCPFailureConnectionResetWithData() { // Check if the connection was recorded as reset var conn *network.ConnectionStats - require.Eventually(t, func() bool { + require.EventuallyWithT(t, func(collect *assert.CollectT) { // 104 is the errno for ECONNRESET - conn = findFailedConnection(t, c.LocalAddr().String(), serverAddr, getConnections(t, tr), 104) - return conn != nil + // findFailedConnection needs `t` for logging, hence no need to pass `collect`. + conn = findFailedConnection(t, c.LocalAddr().String(), serverAddr, getConnections(collect, tr), 104) + require.NotNil(collect, conn) }, 3*time.Second, 100*time.Millisecond, "Failed connection not recorded properly") require.NoError(t, c.Close(), "error closing client connection") @@ -1391,11 +1394,12 @@ func (s *TracerSuite) TestTCPFailureConnectionResetNoData() { // Check if the connection was recorded as reset var conn *network.ConnectionStats - require.Eventually(t, func() bool { - conns := getConnections(t, tr) + require.EventuallyWithT(t, func(collect *assert.CollectT) { + conns := getConnections(collect, tr) // 104 is the errno for ECONNRESET + // findFailedConnection needs `t` for logging, hence no need to pass `collect`. conn = findFailedConnection(t, c.LocalAddr().String(), serverAddr, conns, 104) - return conn != nil + require.NotNil(collect, conn) }, 3*time.Second, 100*time.Millisecond, "Failed connection not recorded properly") require.NoError(t, c.Close(), "error closing client connection") diff --git a/pkg/network/usm/debugger/README.md b/pkg/network/usm/debugger/README.md new file mode 100644 index 0000000000000..27d71055a8e31 --- /dev/null +++ b/pkg/network/usm/debugger/README.md @@ -0,0 +1,31 @@ +# USM debugger + +A minimal, self-contained build of USM for faster iterations of debugging eBPF +code on remote machines. + +Prepare the build for the target architectures you need (the `foo` KMT stack +does not need to exist). This is needed in order to be able to build the eBPF +object files for a different architecture than your host machine. + +``` +inv -e kmt.prepare system-probe --compile-only --stack=foo --arch=x86_64 +inv -e kmt.prepare system-probe --compile-only --stack=foo --arch=arm64 +``` + +Build the binary with one of the following commands for the architecture of +your target machine: + +``` +inv -e system-probe.build-usm-debugger --arch=x86_64 +inv -e system-probe.build-usm-debugger --arch=arm64 +``` + +Copy the `bin/usm-debugger` to the `system-probe` container in the +`datadog-agent` pod on your target machine. Open a shell in that container and +execute the binary. + +The eBPF programs are always built with debug logs enabled so you can view them +with `cat /sys/kernel/tracing/trace_pipe`. + +If you need to change the system-probe config, edit `cmd/usm_debugger.go` and +rebuild. diff --git a/pkg/network/usm/debugger/cmd/.gitignore b/pkg/network/usm/debugger/cmd/.gitignore new file mode 100644 index 0000000000000..5761abcfdf0c2 --- /dev/null +++ b/pkg/network/usm/debugger/cmd/.gitignore @@ -0,0 +1 @@ +*.o diff --git a/pkg/network/usm/debugger/cmd/ebpf_bytecode.go b/pkg/network/usm/debugger/cmd/ebpf_bytecode.go new file mode 100644 index 0000000000000..e924386d9278d --- /dev/null +++ b/pkg/network/usm/debugger/cmd/ebpf_bytecode.go @@ -0,0 +1,62 @@ +// 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 usm_debugger + +package main + +import ( + _ "embed" + "os" + "path" + + "github.com/DataDog/datadog-agent/pkg/util/log" +) + +// The code below is essentially responsible for embedding the CO-RE artifacts +// during compilation time and writing them to a temporary folder during +// runtime, so they can be loaded by the `usm.Monitor` as regular compilation +// assets. + +//go:embed usm-debug.o +var usmProgram []byte + +//go:embed shared-libraries-debug.o +var sharedLibrariesProgram []byte + +func setupBytecode() func() { + type program struct { + filePath string + bytecode []byte + } + + var ( + bytecodeDir = os.TempDir() + coreDir = path.Join(bytecodeDir, "co-re") + ) + + os.Setenv("DD_SYSTEM_PROBE_BPF_DIR", bytecodeDir) + err := os.MkdirAll(coreDir, os.ModePerm) + checkError(err) + + programs := []program{ + {path.Join(coreDir, "usm-debug.o"), usmProgram}, + {path.Join(coreDir, "shared-libraries-debug.o"), sharedLibrariesProgram}, + } + + for _, p := range programs { + f, err := os.Create(p.filePath) + checkError(err) + _, err = f.Write(p.bytecode) + checkError(err) + log.Debugf("writing ebpf bytecode to %s", p.filePath) + } + + return func() { + for _, p := range programs { + os.Remove(p.filePath) + } + } +} diff --git a/pkg/network/usm/debugger/cmd/usm_debugger.go b/pkg/network/usm/debugger/cmd/usm_debugger.go new file mode 100644 index 0000000000000..70fb985c169be --- /dev/null +++ b/pkg/network/usm/debugger/cmd/usm_debugger.go @@ -0,0 +1,89 @@ +// 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 usm_debugger + +package main + +import ( + "fmt" + "os" + "os/signal" + "syscall" + "time" + + "github.com/DataDog/datadog-agent/cmd/system-probe/config" + pkgconfigsetup "github.com/DataDog/datadog-agent/pkg/config/setup" + networkconfig "github.com/DataDog/datadog-agent/pkg/network/config" + "github.com/DataDog/datadog-agent/pkg/network/usm" + pkglogsetup "github.com/DataDog/datadog-agent/pkg/util/log/setup" +) + +func main() { + err := pkglogsetup.SetupLogger( + "usm-debugger", + "debug", + "", + pkglogsetup.GetSyslogURI(pkgconfigsetup.Datadog()), + false, + true, + false, + pkgconfigsetup.Datadog(), + ) + checkError(err) + + cleanupFn := setupBytecode() + defer cleanupFn() + + monitor, err := usm.NewMonitor(getConfiguration(), nil) + checkError(err) + + err = monitor.Start() + checkError(err) + + go func() { + t := time.NewTicker(10 * time.Second) + for range t.C { + _ = monitor.GetProtocolStats() + } + }() + + defer monitor.Stop() + done := make(chan os.Signal, 1) + signal.Notify(done, syscall.SIGINT, syscall.SIGTERM) + <-done +} + +func checkError(err error) { + if err != nil { + fmt.Fprintf(os.Stderr, "%s", err) + os.Exit(-1) + } +} + +func getConfiguration() *networkconfig.Config { + // done for the purposes of initializing the configuration values + _, err := config.New("", "") + checkError(err) + + c := networkconfig.New() + + // run debug version of the eBPF program + c.BPFDebug = true + c.EnableUSMEventStream = false + + // don't buffer data in userspace + // this is to ensure that we won't inadvertently trigger an OOM kill + // by enabling the debugger inside a system-probe container. + c.MaxHTTPStatsBuffered = 0 + c.MaxKafkaStatsBuffered = 0 + + // make sure we use the CO-RE compilation artifact embedded + // in this build (see `ebpf_bytecode.go`) + c.EnableCORE = true + c.EnableRuntimeCompiler = false + + return c +} diff --git a/pkg/network/usm/ebpf_gotls.go b/pkg/network/usm/ebpf_gotls.go index e12871aa619bf..2c1e31300612a 100644 --- a/pkg/network/usm/ebpf_gotls.go +++ b/pkg/network/usm/ebpf_gotls.go @@ -19,7 +19,6 @@ import ( "time" "unsafe" - "github.com/cihub/seelog" "github.com/cilium/ebpf" "golang.org/x/sys/unix" @@ -355,7 +354,7 @@ func (p *goTLSProgram) AttachPID(pid uint32) error { // Check if the process is datadog's internal process, if so, we don't want to hook the process. if internalProcessRegex.MatchString(binPath) { - if log.ShouldLog(seelog.DebugLvl) { + if log.ShouldLog(log.DebugLvl) { log.Debugf("ignoring pid %d, as it is an internal datadog component (%q)", pid, binPath) } return ErrInternalDDogProcessRejected diff --git a/pkg/network/usm/ebpf_main.go b/pkg/network/usm/ebpf_main.go index 85f9f7123a593..277d4f0e672b2 100644 --- a/pkg/network/usm/ebpf_main.go +++ b/pkg/network/usm/ebpf_main.go @@ -11,14 +11,14 @@ import ( "errors" "fmt" "io" - "math" "slices" "unsafe" - manager "github.com/DataDog/ebpf-manager" "github.com/cilium/ebpf" + "github.com/cilium/ebpf/features" "github.com/davecgh/go-spew/spew" - "golang.org/x/sys/unix" + + manager "github.com/DataDog/ebpf-manager" ddebpf "github.com/DataDog/datadog-agent/pkg/ebpf" "github.com/DataDog/datadog-agent/pkg/ebpf/bytecode" @@ -69,6 +69,9 @@ const ( sockFDLookup = "kprobe__sockfd_lookup_light" sockFDLookupRet = "kretprobe__sockfd_lookup_light" + netifReceiveSkbTp = "tracepoint__net__netif_receive_skb" + netifReceiveSkbRawTp = "raw_tracepoint__net__netif_receive_skb" + tcpCloseProbe = "kprobe__tcp_close" // maxActive configures the maximum number of instances of the @@ -92,6 +95,23 @@ type ebpfProgram struct { } func newEBPFProgram(c *config.Config, connectionProtocolMap *ebpf.Map) (*ebpfProgram, error) { + netifProbe := manager.Probe{ + ProbeIdentificationPair: manager.ProbeIdentificationPair{ + EBPFFuncName: netifReceiveSkbTp, + UID: probeUID, + }, + } + if features.HaveProgramType(ebpf.RawTracepoint) == nil { + netifProbe = manager.Probe{ + ProbeIdentificationPair: manager.ProbeIdentificationPair{ + EBPFFuncName: netifReceiveSkbRawTp, + UID: probeUID, + }, + TracepointCategory: "net", + TracepointName: "netif_receive_skb", + } + } + mgr := &manager.Manager{ Maps: []*manager.Map{ {Name: protocols.TLSDispatcherProgramsMap}, @@ -116,12 +136,7 @@ func newEBPFProgram(c *config.Config, connectionProtocolMap *ebpf.Map) (*ebpfPro UID: probeUID, }, }, - { - ProbeIdentificationPair: manager.ProbeIdentificationPair{ - EBPFFuncName: "tracepoint__net__netif_receive_skb", - UID: probeUID, - }, - }, + &netifProbe, { ProbeIdentificationPair: manager.ProbeIdentificationPair{ EBPFFuncName: protocolDispatcherSocketFilterFunction, @@ -381,10 +396,7 @@ func (e *ebpfProgram) init(buf bytecode.AssetReader, options manager.Options) er kprobeAttachMethod = manager.AttachKprobeWithKprobeEvents } - options.RLimit = &unix.Rlimit{ - Cur: math.MaxUint64, - Max: math.MaxUint64, - } + options.RemoveRlimit = true options.MapSpecEditors = map[string]manager.MapSpecEditor{ connectionStatesMap: { @@ -467,6 +479,13 @@ func (e *ebpfProgram) init(buf bytecode.AssetReader, options manager.Options) er } } + // exclude unused netif_receive_skb probe + if features.HaveProgramType(ebpf.RawTracepoint) == nil { + options.ExcludedFunctions = append(options.ExcludedFunctions, netifReceiveSkbTp) + } else { + options.ExcludedFunctions = append(options.ExcludedFunctions, netifReceiveSkbRawTp) + } + err := e.InitWithOptions(buf, &options) if err != nil { cleanup() diff --git a/pkg/network/usm/ebpf_ssl.go b/pkg/network/usm/ebpf_ssl.go index af4fa84364568..4a7800de41d4b 100644 --- a/pkg/network/usm/ebpf_ssl.go +++ b/pkg/network/usm/ebpf_ssl.go @@ -237,7 +237,8 @@ var gnuTLSProbes = []manager.ProbesSelector{ } const ( - sslSockByCtxMap = "ssl_sock_by_ctx" + sslSockByCtxMap = "ssl_sock_by_ctx" + sslCtxByPIDTGIDMap = "ssl_ctx_by_pid_tgid" ) var ( @@ -271,7 +272,7 @@ var opensslSpec = &protocols.ProtocolSpec{ Name: "fd_by_ssl_bio", }, { - Name: "ssl_ctx_by_pid_tgid", + Name: sslCtxByPIDTGIDMap, }, }, Probes: []*manager.Probe{ @@ -466,10 +467,15 @@ func newSSLProgramProtocolFactory(m *manager.Manager) protocols.ProtocolFactory return nil, fmt.Errorf("error initializing nodejs monitor: %w", err) } + istio, err := newIstioMonitor(c, m) + if err != nil { + return nil, fmt.Errorf("error initializing istio monitor: %w", err) + } + return &sslProgram{ cfg: c, watcher: watcher, - istioMonitor: newIstioMonitor(c, m), + istioMonitor: istio, nodeJSMonitor: nodejs, }, nil } @@ -486,6 +492,10 @@ func (o *sslProgram) ConfigureOptions(_ *manager.Manager, options *manager.Optio MaxEntries: o.cfg.MaxTrackedConnections, EditorFlag: manager.EditMaxEntries, } + options.MapSpecEditors[sslCtxByPIDTGIDMap] = manager.MapSpecEditor{ + MaxEntries: o.cfg.MaxTrackedConnections, + EditorFlag: manager.EditMaxEntries, + } } // PreStart is called before the start of the provided eBPF manager. @@ -547,7 +557,7 @@ func (o *sslProgram) DumpMaps(w io.Writer, mapName string, currentMap *ebpf.Map) spew.Fdump(w, key, value) } - case "ssl_ctx_by_pid_tgid": // maps/ssl_ctx_by_pid_tgid (BPF_MAP_TYPE_HASH), key C.__u64, value uintptr // C.void * + case sslCtxByPIDTGIDMap: // maps/ssl_ctx_by_pid_tgid (BPF_MAP_TYPE_HASH), key C.__u64, value uintptr // C.void * io.WriteString(w, "Map: '"+mapName+"', key: 'C.__u64', value: 'uintptr // C.void *'\n") iter := currentMap.Iterate() var key uint64 diff --git a/pkg/network/usm/istio.go b/pkg/network/usm/istio.go index 6fff6b6fd493b..4abb8c8995869 100644 --- a/pkg/network/usm/istio.go +++ b/pkg/network/usm/istio.go @@ -9,24 +9,22 @@ package usm import ( "fmt" - "os" "strings" - "sync" - "time" manager "github.com/DataDog/ebpf-manager" + "github.com/DataDog/datadog-agent/pkg/ebpf/uprobes" "github.com/DataDog/datadog-agent/pkg/network/config" "github.com/DataDog/datadog-agent/pkg/network/usm/consts" - "github.com/DataDog/datadog-agent/pkg/network/usm/utils" "github.com/DataDog/datadog-agent/pkg/process/monitor" - "github.com/DataDog/datadog-agent/pkg/util/kernel" "github.com/DataDog/datadog-agent/pkg/util/log" ) const ( istioSslReadRetprobe = "istio_uretprobe__SSL_read" istioSslWriteRetprobe = "istio_uretprobe__SSL_write" + + istioAttacherName = "istio" ) var istioProbes = []manager.ProbesSelector{ @@ -83,64 +81,41 @@ var istioProbes = []manager.ProbesSelector{ // because the Envoy binary embedded in the Istio containers have debug symbols // whereas the "vanilla" Envoy images are distributed without them. type istioMonitor struct { - registry *utils.FileRegistry - procRoot string - envoyCmd string - - // `utils.FileRegistry` callbacks - registerCB func(utils.FilePath) error - unregisterCB func(utils.FilePath) error - - // Termination - wg sync.WaitGroup - done chan struct{} + attacher *uprobes.UprobeAttacher + envoyCmd string + processMonitor *monitor.ProcessMonitor } -// Validate that istioMonitor implements the Attacher interface. -var _ utils.Attacher = &istioMonitor{} - -func newIstioMonitor(c *config.Config, mgr *manager.Manager) *istioMonitor { +func newIstioMonitor(c *config.Config, mgr *manager.Manager) (*istioMonitor, error) { if !c.EnableIstioMonitoring { - return nil + return nil, nil } - procRoot := kernel.ProcFSRoot() - return &istioMonitor{ - registry: utils.NewFileRegistry(consts.USMModuleName, "istio"), - procRoot: procRoot, - envoyCmd: c.EnvoyPath, - done: make(chan struct{}), - - // Callbacks - registerCB: addHooks(mgr, procRoot, istioProbes), - unregisterCB: removeHooks(mgr, istioProbes), + m := &istioMonitor{ + envoyCmd: c.EnvoyPath, + attacher: nil, + processMonitor: monitor.GetProcessMonitor(), } -} - -// DetachPID detaches a given pid from the eBPF program -func (m *istioMonitor) DetachPID(pid uint32) error { - return m.registry.Unregister(pid) -} -var ( - // ErrNoEnvoyPath is returned when no envoy path is found for a given PID - ErrNoEnvoyPath = fmt.Errorf("no envoy path found for PID") -) - -// AttachPID attaches a given pid to the eBPF program -func (m *istioMonitor) AttachPID(pid uint32) error { - path := m.getEnvoyPath(pid) - if path == "" { - return ErrNoEnvoyPath + attachCfg := uprobes.AttacherConfig{ + ProcRoot: c.ProcRoot, + Rules: []*uprobes.AttachRule{{ + Targets: uprobes.AttachToExecutable, + ProbesSelector: istioProbes, + ExecutableFilter: m.isIstioBinary, + }}, + EbpfConfig: &c.Config, + ExcludeTargets: uprobes.ExcludeSelf | uprobes.ExcludeInternal | uprobes.ExcludeBuildkit | uprobes.ExcludeContainerdTmp, + EnablePeriodicScanNewProcesses: true, } + attacher, err := uprobes.NewUprobeAttacher(consts.USMModuleName, istioAttacherName, attachCfg, mgr, nil, &uprobes.NativeBinaryInspector{}, m.processMonitor) + if err != nil { + return nil, fmt.Errorf("Cannot create uprobe attacher: %w", err) + } + + m.attacher = attacher - return m.registry.Register( - path, - pid, - m.registerCB, - m.unregisterCB, - utils.IgnoreCB, - ) + return m, nil } // Start the istioMonitor @@ -149,49 +124,16 @@ func (m *istioMonitor) Start() { return } - processMonitor := monitor.GetProcessMonitor() - - // Subscribe to process events - doneExec := processMonitor.SubscribeExec(m.handleProcessExec) - doneExit := processMonitor.SubscribeExit(m.handleProcessExit) - - // Attach to existing processes - m.sync() - - m.wg.Add(1) - go func() { - // This ticker is responsible for controlling the rate at which - // we scrape the whole procFS again in order to ensure that we - // terminate any dangling uprobes and register new processes - // missed by the process monitor stream - processSync := time.NewTicker(scanTerminatedProcessesInterval) - - defer func() { - processSync.Stop() - // Execute process monitor callback termination functions - doneExec() - doneExit() - // Stopping the process monitor (if we're the last instance) - processMonitor.Stop() - // Cleaning up all active hooks - m.registry.Clear() - // marking we're finished. - m.wg.Done() - }() + if m.attacher == nil { + log.Error("istio monitoring is enabled but the attacher is nil") + return + } - for { - select { - case <-m.done: - return - case <-processSync.C: - m.sync() - m.registry.Log() - } - } - }() + if err := m.attacher.Start(); err != nil { + log.Errorf("Cannot start istio attacher: %s", err) + } - utils.AddAttacher(consts.USMModuleName, "istio", m) - log.Info("Istio monitoring enabled") + log.Info("istio monitoring enabled") } // Stop the istioMonitor. @@ -200,62 +142,16 @@ func (m *istioMonitor) Stop() { return } - close(m.done) - m.wg.Wait() -} - -// sync state of istioMonitor with the current state of procFS -// the purpose of this method is two-fold: -// 1) register processes for which we missed exec events (targeted mostly at startup) -// 2) unregister processes for which we missed exit events -func (m *istioMonitor) sync() { - deletionCandidates := m.registry.GetRegisteredProcesses() - - _ = kernel.WithAllProcs(m.procRoot, func(pid int) error { - if _, ok := deletionCandidates[uint32(pid)]; ok { - // We have previously hooked into this process and it remains active, - // so we remove it from the deletionCandidates list, and move on to the next PID - delete(deletionCandidates, uint32(pid)) - return nil - } - - // This is a new PID so we attempt to attach SSL probes to it - _ = m.AttachPID(uint32(pid)) - return nil - }) - - // At this point all entries from deletionCandidates are no longer alive, so - // we should detach our SSL probes from them - for pid := range deletionCandidates { - m.handleProcessExit(pid) + if m.attacher == nil { + log.Error("istio monitoring is enabled but the attacher is nil") + return } -} - -func (m *istioMonitor) handleProcessExit(pid uint32) { - // We avoid filtering PIDs here because it's cheaper to simply do a registry lookup - // instead of fetching a process name in order to determine whether it is an - // envoy process or not (which at the very minimum involves syscalls) - _ = m.DetachPID(pid) -} -func (m *istioMonitor) handleProcessExec(pid uint32) { - _ = m.AttachPID(pid) + m.attacher.Stop() } -// getEnvoyPath returns the executable path of the envoy binary for a given PID. -// It constructs the path to the symbolic link for the executable file of the process with the given PID, -// then resolves this symlink to determine the actual path of the binary. -// -// If the resolved path contains the expected envoy command substring (as defined by m.envoyCmd), -// the function returns this path. If the PID does not correspond to an envoy process or if an error -// occurs during resolution, it returns an empty string. -func (m *istioMonitor) getEnvoyPath(pid uint32) string { - exePath := fmt.Sprintf("%s/%d/exe", m.procRoot, pid) - - envoyPath, err := os.Readlink(exePath) - if err != nil || !strings.Contains(envoyPath, m.envoyCmd) { - return "" - } - - return envoyPath +// isIstioBinary checks whether the given file is an istioBinary, based on the expected envoy +// command substring (as defined by m.envoyCmd). +func (m *istioMonitor) isIstioBinary(path string, _ *uprobes.ProcInfo) bool { + return strings.Contains(path, m.envoyCmd) } diff --git a/pkg/network/usm/istio_test.go b/pkg/network/usm/istio_test.go index 73efaf1a4ef4b..72a4f4fb86fdf 100644 --- a/pkg/network/usm/istio_test.go +++ b/pkg/network/usm/istio_test.go @@ -8,32 +8,32 @@ package usm import ( - "os/exec" + "os" "path/filepath" - "strings" "testing" - "github.com/DataDog/datadog-agent/pkg/network/config" - "github.com/DataDog/datadog-agent/pkg/network/usm/utils" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + + "github.com/DataDog/datadog-agent/pkg/ebpf/uprobes" + "github.com/DataDog/datadog-agent/pkg/network/config" + "github.com/DataDog/datadog-agent/pkg/network/usm/utils" ) const ( defaultEnvoyName = "/bin/envoy" ) -func TestGetEnvoyPath(t *testing.T) { - _, pid := createFakeProcess(t, defaultEnvoyName) - monitor := newIstioTestMonitor(t) +func TestIsIstioBinary(t *testing.T) { + procRoot := uprobes.CreateFakeProcFS(t, []uprobes.FakeProcFSEntry{}) + m := newIstioTestMonitor(t, procRoot) t.Run("an actual envoy process", func(t *testing.T) { - path := monitor.getEnvoyPath(uint32(pid)) - assert.True(t, strings.HasSuffix(path, defaultEnvoyName)) + assert.True(t, m.isIstioBinary(defaultEnvoyName, uprobes.NewProcInfo(procRoot, 1))) }) t.Run("something else", func(t *testing.T) { - path := monitor.getEnvoyPath(uint32(2)) - assert.Empty(t, "", path) + assert.False(t, m.isIstioBinary("", uprobes.NewProcInfo(procRoot, 2))) }) } @@ -43,71 +43,86 @@ func TestGetEnvoyPathWithConfig(t *testing.T) { cfg.EnvoyPath = "/test/envoy" monitor := newIstioTestMonitorWithCFG(t, cfg) - _, pid := createFakeProcess(t, cfg.EnvoyPath) - - path := monitor.getEnvoyPath(uint32(pid)) - assert.True(t, strings.HasSuffix(path, cfg.EnvoyPath)) + assert.True(t, monitor.isIstioBinary(cfg.EnvoyPath, uprobes.NewProcInfo("", 0))) + assert.False(t, monitor.isIstioBinary("something/else/", uprobes.NewProcInfo("", 0))) } func TestIstioSync(t *testing.T) { - t.Run("calling sync multiple times", func(t *testing.T) { - procRoot1, _ := createFakeProcess(t, filepath.Join("test1", defaultEnvoyName)) - procRoot2, _ := createFakeProcess(t, filepath.Join("test2", defaultEnvoyName)) - monitor := newIstioTestMonitor(t) - registerRecorder := new(utils.CallbackRecorder) - - // Setup test callbacks - monitor.registerCB = registerRecorder.Callback() - monitor.unregisterCB = utils.IgnoreCB - - // Calling sync multiple times shouldn't matter. - // Once all envoy process are registered, calling it again shouldn't - // trigger additional callback executions - monitor.sync() - monitor.sync() - - pathID1, err := utils.NewPathIdentifier(procRoot1) - require.NoError(t, err) - - pathID2, err := utils.NewPathIdentifier(procRoot2) - require.NoError(t, err) - - // Each PathID should have triggered a callback exactly once - assert.Equal(t, 2, registerRecorder.TotalCalls()) - assert.Equal(t, 1, registerRecorder.CallsForPathID(pathID1)) - assert.Equal(t, 1, registerRecorder.CallsForPathID(pathID2)) + t.Run("calling sync for the first time", func(tt *testing.T) { + procRoot := uprobes.CreateFakeProcFS(tt, []uprobes.FakeProcFSEntry{ + {Pid: 1, Exe: defaultEnvoyName}, + {Pid: 2, Exe: "/bin/bash"}, + {Pid: 3, Exe: defaultEnvoyName}, + }) + monitor := newIstioTestMonitor(tt, procRoot) + + mockRegistry := &uprobes.MockFileRegistry{} + monitor.attacher.SetRegistry(mockRegistry) + mockRegistry.On("GetRegisteredProcesses").Return(map[uint32]struct{}{}) + mockRegistry.On("Register", defaultEnvoyName, uint32(1), mock.Anything, mock.Anything).Return(nil) + mockRegistry.On("Register", defaultEnvoyName, uint32(3), mock.Anything, mock.Anything).Return(nil) + + // Calling sync should detect the two envoy processes + monitor.attacher.Sync(true, true) + + mockRegistry.AssertExpectations(tt) }) -} - -// createFakeProcess creates a fake process in a temporary location. -// returns the full path of the temporary process and the PID of the fake process. -func createFakeProcess(t *testing.T, processName string) (procRoot string, pid int) { - fakePath := filepath.Join(t.TempDir(), processName) - require.NoError(t, exec.Command("mkdir", "-p", filepath.Dir(fakePath)).Run()) - - // we are using the `yes` command as a fake envoy binary. - require.NoError(t, exec.Command("cp", "/usr/bin/yes", fakePath).Run()) - cmd := exec.Command(fakePath) - require.NoError(t, cmd.Start()) - - // Schedule process termination after the test - t.Cleanup(func() { - _ = cmd.Process.Kill() + t.Run("detecting a dangling process", func(tt *testing.T) { + procRoot := uprobes.CreateFakeProcFS(tt, []uprobes.FakeProcFSEntry{ + {Pid: 1, Exe: defaultEnvoyName}, + {Pid: 2, Exe: "/bin/bash"}, + {Pid: 3, Exe: defaultEnvoyName}, + }) + monitor := newIstioTestMonitor(tt, procRoot) + + mockRegistry := &uprobes.MockFileRegistry{} + monitor.attacher.SetRegistry(mockRegistry) + mockRegistry.On("GetRegisteredProcesses").Return(map[uint32]struct{}{}) + mockRegistry.On("Register", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(nil) // Tell the mock to just say ok to everything, we'll validate later + + monitor.attacher.Sync(true, true) + + mockRegistry.AssertCalled(tt, "Register", defaultEnvoyName, uint32(1), mock.Anything, mock.Anything) + mockRegistry.AssertCalled(tt, "Register", defaultEnvoyName, uint32(3), mock.Anything, mock.Anything) + mockRegistry.AssertCalled(tt, "GetRegisteredProcesses") + + // At this point we should have received: + // * 2 register calls + // * 1 GetRegisteredProcesses call + // * 0 unregister calls + require.Equal(tt, 3, len(mockRegistry.Calls), "calls made: %v", mockRegistry.Calls) + mockRegistry.AssertNotCalled(t, "Unregister", mock.Anything) + + // Now we emulate a process termination for PID 3 by removing it from the fake + // procFS tree + require.NoError(tt, os.RemoveAll(filepath.Join(procRoot, "3"))) + + // Now clear the mock registry expected calls and make it return the state as if the two PIDs were registered + mockRegistry.ExpectedCalls = nil + mockRegistry.On("Register", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(nil) // Tell the mock to just say ok to everything, we'll validate later + mockRegistry.On("GetRegisteredProcesses").Return(map[uint32]struct{}{1: {}, 3: {}}) + mockRegistry.On("Unregister", mock.Anything).Return(nil) + + // Once we call sync() again, PID 3 termination should be detected + // and the unregister callback should be executed + monitor.attacher.Sync(true, true) + mockRegistry.AssertCalled(tt, "Unregister", uint32(3)) }) - - return fakePath, cmd.Process.Pid } -func newIstioTestMonitor(t *testing.T) *istioMonitor { +func newIstioTestMonitor(t *testing.T, procRoot string) *istioMonitor { cfg := utils.NewUSMEmptyConfig() cfg.EnableIstioMonitoring = true + cfg.ProcRoot = procRoot return newIstioTestMonitorWithCFG(t, cfg) } func newIstioTestMonitorWithCFG(t *testing.T, cfg *config.Config) *istioMonitor { - monitor := newIstioMonitor(cfg, nil) + monitor, err := newIstioMonitor(cfg, nil) + require.NoError(t, err) require.NotNil(t, monitor) + return monitor } diff --git a/pkg/network/usm/kafka_monitor_test.go b/pkg/network/usm/kafka_monitor_test.go index 645db1e3bc064..c4f3e30c08ad4 100644 --- a/pkg/network/usm/kafka_monitor_test.go +++ b/pkg/network/usm/kafka_monitor_test.go @@ -521,14 +521,14 @@ func (s *KafkaProtocolParsingSuite) testKafkaProtocolParsing(t *testing.T, tls b require.NoError(t, client.Client.ProduceSync(ctxTimeout, record).FirstErr(), "record had a produce error while synchronously producing") var telemetryMap *kafka.RawKernelTelemetry - require.Eventually(t, func() bool { + require.EventuallyWithT(t, func(collect *assert.CollectT) { telemetryMap, err = kafka.GetKernelTelemetryMap(monitor.ebpfProgram.Manager.Manager) - require.NoError(t, err) + require.NoError(collect, err) // Ensure that the other buckets remain unchanged before verifying the expected bucket. for idx := 0; idx < kafka.TopicNameBuckets; idx++ { if idx != tt.expectedBucketIndex { - require.Equal(t, currentRawKernelTelemetry.Topic_name_size_buckets[idx], + require.Equal(collect, currentRawKernelTelemetry.Topic_name_size_buckets[idx], telemetryMap.Topic_name_size_buckets[idx], "Expected bucket (%d) to remain unchanged", idx) } @@ -536,7 +536,7 @@ func (s *KafkaProtocolParsingSuite) testKafkaProtocolParsing(t *testing.T, tls b // Verify that the expected bucket contains the correct number of occurrences. expectedNumberOfOccurrences := fixCount(2) // (1 produce request + 1 fetch request) - return uint64(expectedNumberOfOccurrences)+currentRawKernelTelemetry.Topic_name_size_buckets[tt.expectedBucketIndex] == telemetryMap.Topic_name_size_buckets[tt.expectedBucketIndex] + require.Equal(collect, uint64(expectedNumberOfOccurrences)+currentRawKernelTelemetry.Topic_name_size_buckets[tt.expectedBucketIndex], telemetryMap.Topic_name_size_buckets[tt.expectedBucketIndex]) }, time.Second*3, time.Millisecond*100) // Update the current raw kernel telemetry for the next iteration diff --git a/pkg/network/usm/monitor_test.go b/pkg/network/usm/monitor_test.go index 402243c2562d1..f899eb6c295b9 100644 --- a/pkg/network/usm/monitor_test.go +++ b/pkg/network/usm/monitor_test.go @@ -24,7 +24,6 @@ import ( "time" manager "github.com/DataDog/ebpf-manager" - "github.com/cihub/seelog" "github.com/cilium/ebpf" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -49,7 +48,7 @@ func TestMain(m *testing.M) { if logLevel == "" { logLevel = "warn" } - log.SetupLogger(seelog.Default, logLevel) + log.SetupLogger(log.Default(), logLevel) os.Exit(m.Run()) } diff --git a/pkg/network/usm/monitor_tls_test.go b/pkg/network/usm/monitor_tls_test.go index 322f9be425da4..44ca4244b07a1 100644 --- a/pkg/network/usm/monitor_tls_test.go +++ b/pkg/network/usm/monitor_tls_test.go @@ -31,7 +31,7 @@ import ( "github.com/DataDog/datadog-agent/pkg/ebpf/ebpftest" "github.com/DataDog/datadog-agent/pkg/ebpf/prebuilt" - eventmonitortestutil "github.com/DataDog/datadog-agent/pkg/eventmonitor/testutil" + consumerstestutil "github.com/DataDog/datadog-agent/pkg/eventmonitor/consumers/testutil" "github.com/DataDog/datadog-agent/pkg/network" "github.com/DataDog/datadog-agent/pkg/network/config" "github.com/DataDog/datadog-agent/pkg/network/protocols" @@ -44,8 +44,7 @@ import ( "github.com/DataDog/datadog-agent/pkg/network/usm/consts" usmtestutil "github.com/DataDog/datadog-agent/pkg/network/usm/testutil" "github.com/DataDog/datadog-agent/pkg/network/usm/utils" - procmontestutil "github.com/DataDog/datadog-agent/pkg/process/monitor/testutil" - secutils "github.com/DataDog/datadog-agent/pkg/security/utils" + "github.com/DataDog/datadog-agent/pkg/process/monitor" globalutils "github.com/DataDog/datadog-agent/pkg/util/testutil" dockerutils "github.com/DataDog/datadog-agent/pkg/util/testutil/docker" ) @@ -870,8 +869,7 @@ func setupUSMTLSMonitor(t *testing.T, cfg *config.Config) *Monitor { require.NoError(t, err) require.NoError(t, usmMonitor.Start()) if cfg.EnableUSMEventStream && usmconfig.NeedProcessMonitor(cfg) { - secutils.SetCachedHostname("test-hostname") - eventmonitortestutil.StartEventMonitor(t, procmontestutil.RegisterProcessMonitorEventConsumer) + monitor.InitializeEventConsumer(consumerstestutil.NewTestProcessConsumer(t)) } t.Cleanup(usmMonitor.Stop) t.Cleanup(utils.ResetDebugger) diff --git a/pkg/network/usm/postgres_monitor_test.go b/pkg/network/usm/postgres_monitor_test.go index 76c616beff5bd..9198448f99468 100644 --- a/pkg/network/usm/postgres_monitor_test.go +++ b/pkg/network/usm/postgres_monitor_test.go @@ -16,8 +16,10 @@ import ( "sync" "testing" "time" + "unsafe" "github.com/jackc/pgx/v5/pgproto3" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" @@ -47,7 +49,6 @@ const ( alterTableQuery = "ALTER TABLE dummy ADD test VARCHAR(255);" truncateTableQuery = "TRUNCATE TABLE dummy" showQuery = "SHOW search_path" - maxSupportedMessages = protocols.PostgresMaxMessagesPerTailCall * protocols.PostgresMaxTailCalls ) var ( @@ -591,7 +592,7 @@ func testDecoding(t *testing.T, isTLS bool) { }, // The purpose of this test is to validate the POSTGRES_MAX_MESSAGES_PER_TAIL_CALL * POSTGRES_MAX_TAIL_CALLS_FOR_MAX_MESSAGES limit. { - name: "validate supporting max supported messages limit", + name: "validate max supported messages limit", preMonitorSetup: func(t *testing.T, ctx pgTestContext) { pg, err := postgres.NewPGXClient(postgres.ConnectionOptions{ ServerAddress: ctx.serverAddress, @@ -607,7 +608,7 @@ func testDecoding(t *testing.T, isTLS bool) { ctx.extras["pg"] = pg require.NoError(t, pg.RunQuery(createTableQuery)) // We reduce the limit by 2 messages because the protocol adds messages at the beginning of the maximum message response. - require.NoError(t, pg.RunQuery(createInsertQuery(generateTestValues(1, maxSupportedMessages-3)...))) + require.NoError(t, pg.RunQuery(createInsertQuery(generateTestValues(1, protocols.PostgresMaxTotalMessages-3)...))) require.NoError(t, pg.RunQuery(selectAllQuery)) }, validation: func(t *testing.T, _ pgTestContext, monitor *Monitor) { @@ -623,7 +624,7 @@ func testDecoding(t *testing.T, isTLS bool) { // This test validates that when we exceed the POSTGRES_MAX_MESSAGES_PER_TAIL_CALL * POSTGRES_MAX_TAIL_CALLS_FOR_MAX_MESSAGES limit, // the request is not captured as we will miss the response.In this case, it applies to the SELECT query. { - name: "validate exceeding max supported messages limit is not supported", + name: "exceeding max supported messages limit", preMonitorSetup: func(t *testing.T, ctx pgTestContext) { pg, err := postgres.NewPGXClient(postgres.ConnectionOptions{ ServerAddress: ctx.serverAddress, @@ -638,7 +639,7 @@ func testDecoding(t *testing.T, isTLS bool) { require.NoError(t, pg.Ping()) ctx.extras["pg"] = pg require.NoError(t, pg.RunQuery(createTableQuery)) - require.NoError(t, pg.RunQuery(createInsertQuery(generateTestValues(1, maxSupportedMessages+1)...))) + require.NoError(t, pg.RunQuery(createInsertQuery(generateTestValues(1, protocols.PostgresMaxTotalMessages+1)...))) require.NoError(t, pg.RunQuery(selectAllQuery)) }, validation: func(t *testing.T, _ pgTestContext, monitor *Monitor) { @@ -890,3 +891,169 @@ func createFragment(fragment []byte) [ebpf.BufferSize]byte { copy(b[:], fragment) return b } + +func (s *postgresProtocolParsingSuite) TestKernelTelemetry() { + t := s.T() + tests := []struct { + name string + isTLS bool + }{ + { + name: "without TLS", + isTLS: false, + }, + { + name: "with TLS", + isTLS: true, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + if tt.isTLS && !gotlstestutil.GoTLSSupported(t, config.New()) { + t.Skip("GoTLS not supported for this setup") + } + testKernelMessagesCount(t, tt.isTLS) + }) + } +} + +// testKernelMessagesCount check postgres kernel messages count. +func testKernelMessagesCount(t *testing.T, isTLS bool) { + serverHost := "127.0.0.1" + serverAddress := net.JoinHostPort(serverHost, postgresPort) + require.NoError(t, postgres.RunServer(t, serverHost, postgresPort, isTLS)) + waitForPostgresServer(t, serverAddress, isTLS) + + monitor := setupUSMTLSMonitor(t, getPostgresDefaultTestConfiguration(isTLS)) + if isTLS { + utils.WaitForProgramsToBeTraced(t, consts.USMModuleName, GoTLSAttacherName, os.Getpid(), utils.ManualTracingFallbackEnabled) + } + pgClient := setupPGClient(t, serverAddress, isTLS) + t.Cleanup(func() { + if pgClient != nil { + _ = pgClient.RunQuery(dropTableQuery) + pgClient.Close() + pgClient = nil + } + }) + + createLargeTable(t, pgClient, ebpf.MsgCountFirstBucket+ebpf.MsgCountBucketSize*ebpf.MsgCountNumBuckets) + expectedBuckets := [ebpf.MsgCountNumBuckets]bool{} + + for i := 0; i < ebpf.MsgCountNumBuckets; i++ { + testName := fmt.Sprintf("kernel messages count bucket[%d]", i) + t.Run(testName, func(t *testing.T) { + + expectedBuckets[i] = true + cleanProtocolMaps(t, "postgres", monitor.ebpfProgram.Manager.Manager) + + require.NoError(t, monitor.Resume()) + if i == 0 { + // first bucket, it counts upto ebpf.MsgCountFirstBucketMax messages + // subtract three messages ('bind', 'row description' and 'ready') + require.NoError(t, pgClient.RunQuery(generateSelectLimitQuery(ebpf.MsgCountFirstBucket-3))) + } else { + limitCount := ebpf.MsgCountFirstBucket + i*ebpf.MsgCountBucketSize - 3 + require.NoError(t, pgClient.RunQuery(generateSelectLimitQuery(limitCount))) + } + require.NoError(t, monitor.Pause()) + + validateKernelBuckets(t, monitor, isTLS, expectedBuckets) + if i > 0 { + // clear current bucket except the first one, which is always non-empty. + expectedBuckets[i] = false + } + }) + } + + t.Run("exceed max buckets", func(t *testing.T) { + + cleanProtocolMaps(t, "postgres", monitor.ebpfProgram.Manager.Manager) + require.NoError(t, monitor.Resume()) + + require.NoError(t, pgClient.RunQuery(generateSelectLimitQuery(ebpf.MsgCountMaxTotal))) + require.NoError(t, monitor.Pause()) + + validateKernelExceedingMax(t, monitor, isTLS) + }) +} + +func setupPGClient(t *testing.T, serverAddress string, isTLS bool) *postgres.PGXClient { + pg, err := postgres.NewPGXClient(postgres.ConnectionOptions{ + ServerAddress: serverAddress, + EnableTLS: isTLS, + }) + require.NoError(t, err) + require.NoError(t, pg.Ping()) + return pg +} + +// createLargeTable runs a postgres query to create a table large enough to retrieve long responses later. +func createLargeTable(t *testing.T, pg *postgres.PGXClient, tableValuesCount int) { + require.NoError(t, pg.RunQuery(createTableQuery)) + require.NoError(t, pg.RunQuery(createInsertQuery(generateTestValues(0, tableValuesCount)...))) +} + +// validateKernel Checking telemetry data received for a postgres query +func validateKernelBuckets(t *testing.T, monitor *Monitor, tls bool, expected [ebpf.MsgCountNumBuckets]bool) { + var actual *ebpf.PostgresKernelMsgCount + assert.Eventually(t, func() bool { + found, err := getKernelTelemetry(monitor, tls) + if err != nil { + return false + } + actual = found + return compareMessagesCount(found, expected) + }, time.Second*2, time.Millisecond*100) + if t.Failed() { + t.Logf("expected telemetry:\n %+v;\nactual telemetry:\n %+v", expected, actual) + ebpftest.DumpMapsTestHelper(t, monitor.DumpMaps, postgres.KernelTelemetryMap) + } +} + +// getKernelTelemetry returns statistics obtained from the kernel +func getKernelTelemetry(monitor *Monitor, isTLS bool) (*ebpf.PostgresKernelMsgCount, error) { + pgKernelTelemetry := &ebpf.PostgresKernelMsgCount{} + mapName := postgres.KernelTelemetryMap + key := uint32(0) + if isTLS { + key = uint32(1) + } + mp, _, err := monitor.ebpfProgram.GetMap(mapName) + if err != nil { + return nil, fmt.Errorf("unable to get %q map: %s", mapName, err) + } + if err := mp.Lookup(unsafe.Pointer(&key), unsafe.Pointer(pgKernelTelemetry)); err != nil { + return nil, fmt.Errorf("unable to lookup %q map: %s", mapName, err) + } + return pgKernelTelemetry, nil +} + +// compareMessagesCount returns true if the expected bucket is non-empty +func compareMessagesCount(found *ebpf.PostgresKernelMsgCount, expected [ebpf.MsgCountNumBuckets]bool) bool { + for i := range expected { + if expected[i] && found.Msg_count_buckets[i] == 0 { + return false + } + if !expected[i] && found.Msg_count_buckets[i] > 0 { + return false + } + } + return true +} + +// validateKernelExceedingMax check for exceeding the maximum number of buckets +func validateKernelExceedingMax(t *testing.T, monitor *Monitor, tls bool) { + var actual *ebpf.PostgresKernelMsgCount + assert.Eventually(t, func() bool { + found, err := getKernelTelemetry(monitor, tls) + if err != nil { + return false + } + actual = found + return found.Reached_max_messages > 0 + }, time.Second*2, time.Millisecond*100) + if t.Failed() { + t.Logf("expected non-zero max messages, actual telemetry:\n %+v", actual) + } +} diff --git a/pkg/network/usm/sharedlibraries/ebpf.go b/pkg/network/usm/sharedlibraries/ebpf.go index ec5db8dd3cac4..e583b6886c0f9 100644 --- a/pkg/network/usm/sharedlibraries/ebpf.go +++ b/pkg/network/usm/sharedlibraries/ebpf.go @@ -10,14 +10,12 @@ package sharedlibraries import ( "errors" "fmt" - "math" "os" "runtime" "strings" "sync" manager "github.com/DataDog/ebpf-manager" - "golang.org/x/sys/unix" ddebpf "github.com/DataDog/datadog-agent/pkg/ebpf" "github.com/DataDog/datadog-agent/pkg/ebpf/bytecode" @@ -480,10 +478,7 @@ func (e *EbpfProgram) stopImpl() { } func (e *EbpfProgram) init(buf bytecode.AssetReader, options manager.Options) error { - options.RLimit = &unix.Rlimit{ - Cur: math.MaxUint64, - Max: math.MaxUint64, - } + options.RemoveRlimit = true for _, probe := range e.Probes { options.ActivatedProbes = append(options.ActivatedProbes, diff --git a/pkg/network/usm/sharedlibraries/testutil/fmapper/.gitignore b/pkg/network/usm/sharedlibraries/testutil/fmapper/.gitignore index c7a40853e7ac3..03c02565fb7ff 100644 --- a/pkg/network/usm/sharedlibraries/testutil/fmapper/.gitignore +++ b/pkg/network/usm/sharedlibraries/testutil/fmapper/.gitignore @@ -1 +1,3 @@ fmapper +dotnet +python diff --git a/pkg/network/usm/sharedlibraries/types_linux.go b/pkg/network/usm/sharedlibraries/types_linux.go index 3240185a07632..6b52394ef4c37 100644 --- a/pkg/network/usm/sharedlibraries/types_linux.go +++ b/pkg/network/usm/sharedlibraries/types_linux.go @@ -6,9 +6,9 @@ package sharedlibraries type LibPath struct { Pid uint32 Len uint32 - Buf [120]byte + Buf [220]byte } const ( - LibPathMaxSize = 0x78 + LibPathMaxSize = 0xdc ) diff --git a/pkg/network/usm/sharedlibraries/watcher.go b/pkg/network/usm/sharedlibraries/watcher.go index f23673fc6c24e..f13548414a017 100644 --- a/pkg/network/usm/sharedlibraries/watcher.go +++ b/pkg/network/usm/sharedlibraries/watcher.go @@ -26,9 +26,10 @@ import ( "github.com/DataDog/datadog-agent/pkg/util/log" ) -const ( +var ( // The interval of the periodic scan for terminated processes. Increasing the interval, might cause larger spikes in cpu - // and lowering it might cause constant cpu usage. + // and lowering it might cause constant cpu usage. This is a var instead of a const only because the test code changes + // this value to speed up test execution. scanTerminatedProcessesInterval = 30 * time.Second ) @@ -55,6 +56,7 @@ type Rule struct { // Watcher provides a way to tie callback functions to the lifecycle of shared libraries type Watcher struct { + syncMutex sync.RWMutex wg sync.WaitGroup done chan struct{} procRoot string @@ -64,6 +66,7 @@ type Watcher struct { ebpfProgram *EbpfProgram libset Libset thisPID int + scannedPIDs map[uint32]int // telemetry libHits *telemetry.Counter @@ -90,6 +93,7 @@ func NewWatcher(cfg *config.Config, libset Libset, rules ...Rule) (*Watcher, err processMonitor: monitor.GetProcessMonitor(), ebpfProgram: ebpfProgram, registry: utils.NewFileRegistry(consts.USMModuleName, "shared_libraries"), + scannedPIDs: make(map[uint32]int), libHits: telemetry.NewCounter("usm.so_watcher.hits", telemetry.OptPrometheus), libMatches: telemetry.NewCounter("usm.so_watcher.matches", telemetry.OptPrometheus), @@ -274,11 +278,7 @@ func (w *Watcher) Start() { case <-w.done: return case <-processSync.C: - processSet := w.registry.GetRegisteredProcesses() - deletedPids := findDeletedProcesses(processSet) - for deletedPid := range deletedPids { - _ = w.registry.Unregister(deletedPid) - } + w.sync() } } }() @@ -291,28 +291,60 @@ func (w *Watcher) Start() { utils.AddAttacher(consts.USMModuleName, "native", w) } -// findDeletedProcesses returns the terminated PIDs from the given map. -func findDeletedProcesses[V any](pids map[uint32]V) map[uint32]struct{} { - existingPids := make(map[uint32]struct{}, len(pids)) +// sync unregisters from any terminated processes which we missed the exit +// callback for, and also attempts to register to running processes to ensure +// that we don't miss any process. +func (w *Watcher) sync() { + // The mutex is only used for protection with the test code which reads the + // scannedPIDs map. + w.syncMutex.Lock() + defer w.syncMutex.Unlock() + + deletionCandidates := w.registry.GetRegisteredProcesses() + alivePIDs := make(map[uint32]struct{}) - procIter := func(pid int) error { - if _, exists := pids[uint32(pid)]; exists { - existingPids[uint32(pid)] = struct{}{} + _ = kernel.WithAllProcs(kernel.ProcFSRoot(), func(origPid int) error { + if origPid == w.thisPID { // don't scan ourselves + return nil } + + pid := uint32(origPid) + alivePIDs[pid] = struct{}{} + + if _, ok := deletionCandidates[pid]; ok { + // We have previously hooked into this process and it remains + // active, so we remove it from the deletionCandidates list, and + // move on to the next PID + delete(deletionCandidates, pid) + return nil + } + + scanned := w.scannedPIDs[pid] + + // Try to scan twice. This is because we may happen to scan the process + // just after it has been exec'd and before it has opened its shared + // libraries. Scanning twice with the sync interval reduce this risk of + // missing shared libraries due to this. + if scanned < 2 { + w.scannedPIDs[pid]++ + err := w.AttachPID(pid) + if err == nil { + log.Debugf("watcher attached to %v via periodic scan", pid) + w.scannedPIDs[pid] = 2 + } + } + return nil - } - // Scanning already running processes - if err := kernel.WithAllProcs(kernel.ProcFSRoot(), procIter); err != nil { - return nil - } + }) - res := make(map[uint32]struct{}, len(pids)-len(existingPids)) - for pid := range pids { - if _, exists := existingPids[pid]; exists { - continue + // Clean up dead processes from the list of scanned PIDs + for pid := range w.scannedPIDs { + if _, alive := alivePIDs[pid]; !alive { + delete(w.scannedPIDs, pid) } - res[pid] = struct{}{} } - return res + for pid := range deletionCandidates { + _ = w.registry.Unregister(pid) + } } diff --git a/pkg/network/usm/sharedlibraries/watcher_test.go b/pkg/network/usm/sharedlibraries/watcher_test.go index ca401e180fc50..d55635fd2ecc7 100644 --- a/pkg/network/usm/sharedlibraries/watcher_test.go +++ b/pkg/network/usm/sharedlibraries/watcher_test.go @@ -26,13 +26,11 @@ import ( "github.com/DataDog/datadog-agent/pkg/ebpf/ebpftest" "github.com/DataDog/datadog-agent/pkg/ebpf/prebuilt" - eventmonitortestutil "github.com/DataDog/datadog-agent/pkg/eventmonitor/testutil" + "github.com/DataDog/datadog-agent/pkg/eventmonitor/consumers/testutil" usmconfig "github.com/DataDog/datadog-agent/pkg/network/usm/config" fileopener "github.com/DataDog/datadog-agent/pkg/network/usm/sharedlibraries/testutil" "github.com/DataDog/datadog-agent/pkg/network/usm/utils" "github.com/DataDog/datadog-agent/pkg/process/monitor" - procmontestutil "github.com/DataDog/datadog-agent/pkg/process/monitor/testutil" - secutils "github.com/DataDog/datadog-agent/pkg/security/utils" "github.com/DataDog/datadog-agent/pkg/util/kernel" "github.com/DataDog/datadog-agent/pkg/util/log" ) @@ -42,8 +40,7 @@ func launchProcessMonitor(t *testing.T, useEventStream bool) { t.Cleanup(pm.Stop) require.NoError(t, pm.Initialize(useEventStream)) if useEventStream { - secutils.SetCachedHostname("test-hostname") - eventmonitortestutil.StartEventMonitor(t, procmontestutil.RegisterProcessMonitorEventConsumer) + monitor.InitializeEventConsumer(testutil.NewTestProcessConsumer(t)) } } @@ -107,6 +104,183 @@ func (s *SharedLibrarySuite) TestSharedLibraryDetection() { }, time.Second*10, 100*time.Millisecond) } +// Test that shared library files opened for writing only are ignored. +func (s *SharedLibrarySuite) TestSharedLibraryIgnoreWrite() { + t := s.T() + + // Since we want to detect that the write _hasn't_ been detected, verify the + // read too to try to ensure that test isn't broken and failing to detect + // the write due to some bug in the test itself. + readPath, readPathID := createTempTestFile(t, "read-foo-libssl.so") + writePath, writePathID := createTempTestFile(t, "write-foo-libssl.so") + + registerRecorder := new(utils.CallbackRecorder) + unregisterRecorder := new(utils.CallbackRecorder) + + watcher, err := NewWatcher(utils.NewUSMEmptyConfig(), LibsetCrypto, + Rule{ + Re: regexp.MustCompile(`foo-libssl.so`), + RegisterCB: registerRecorder.Callback(), + UnregisterCB: unregisterRecorder.Callback(), + }, + ) + require.NoError(t, err) + watcher.Start() + t.Cleanup(watcher.Stop) + + // Use a sleep 1 as in TestSharedLibraryDetectionWithPIDAndRootNamespace + // below to give the watcher a chance to detect the process. + _, err = exec.Command("sh", "-c", + fmt.Sprintf("sleep 1 < %s > %s", readPath, writePath)).CombinedOutput() + require.NoError(t, err) + + require.EventuallyWithT(t, func(c *assert.CollectT) { + assert.Equal(c, 1, registerRecorder.CallsForPathID(readPathID)) + assert.Equal(c, 0, registerRecorder.CallsForPathID(writePathID)) + }, time.Second*5, 10*time.Millisecond) +} + +func (s *SharedLibrarySuite) TestLongPath() { + t := s.T() + + const ( + fileName = "foo-libssl.so" + nullTerminatorLength = len("\x00") + ) + padLength := LibPathMaxSize - len(fileName) - len(t.TempDir()) - len("_") - len(string(filepath.Separator)) - nullTerminatorLength + fooPath1, fooPathID1 := createTempTestFile(t, strings.Repeat("a", padLength)+"_"+fileName) + // fooPath2 is longer than the limit we have, thus it will be ignored. + fooPath2, fooPathID2 := createTempTestFile(t, strings.Repeat("a", padLength+1)+"_"+fileName) + + registerRecorder := new(utils.CallbackRecorder) + unregisterRecorder := new(utils.CallbackRecorder) + + watcher, err := NewWatcher(utils.NewUSMEmptyConfig(), LibsetCrypto, + Rule{ + Re: regexp.MustCompile(`foo-libssl.so`), + RegisterCB: registerRecorder.Callback(), + UnregisterCB: unregisterRecorder.Callback(), + }, + ) + require.NoError(t, err) + watcher.Start() + t.Cleanup(watcher.Stop) + + // create files + command1, err := fileopener.OpenFromAnotherProcess(t, fooPath1) + require.NoError(t, err) + + command2, err := fileopener.OpenFromAnotherProcess(t, fooPath2) + require.NoError(t, err) + + require.Eventuallyf(t, func() bool { + return registerRecorder.CallsForPathID(fooPathID1) == 1 && + registerRecorder.CallsForPathID(fooPathID2) == 0 + }, time.Second*10, 100*time.Millisecond, "") + + require.NoError(t, command1.Process.Kill()) + require.NoError(t, command2.Process.Kill()) + + require.Eventually(t, func() bool { + return unregisterRecorder.CallsForPathID(fooPathID1) == 1 && + unregisterRecorder.CallsForPathID(fooPathID2) == 0 + }, time.Second*10, 100*time.Millisecond) +} + +// Tests that the periodic scan is able to detect processes which are missed by +// the eBPF-based watcher. +func (s *SharedLibrarySuite) TestSharedLibraryDetectionPeriodic() { + t := s.T() + + // Construct a large path to exceed the limits of the eBPF-based watcher + // (LIB_PATH_MAX_SIZE). 255 is the max filename size of ext4. The path + // size will also include the directories leading up to this filename so the + // total size will be more. + var b strings.Builder + final := "foo-libssl.so" + for i := 0; i < 255-len(final); i++ { + b.WriteByte('x') + } + b.WriteString(final) + filename := b.String() + + // Reduce interval to speed up test + orig := scanTerminatedProcessesInterval + t.Cleanup(func() { scanTerminatedProcessesInterval = orig }) + scanTerminatedProcessesInterval = 10 * time.Millisecond + + fooPath1, fooPathID1 := createTempTestFile(t, filename) + errPath, errorPathID := createTempTestFile(t, strings.Replace(filename, "xfoo", "yfoo", 1)) + + registerRecorder := new(utils.CallbackRecorder) + unregisterRecorder := new(utils.CallbackRecorder) + + registerCallback := registerRecorder.Callback() + + watcher, err := NewWatcher(utils.NewUSMEmptyConfig(), LibsetCrypto, + Rule{ + Re: regexp.MustCompile(`foo-libssl.so`), + RegisterCB: func(fp utils.FilePath) error { + registerCallback(fp) + if fp.ID == errorPathID { + return utils.ErrEnvironment + } + return nil + }, + UnregisterCB: unregisterRecorder.Callback(), + }, + ) + require.NoError(t, err) + watcher.Start() + t.Cleanup(watcher.Stop) + + // create files + command1, err := fileopener.OpenFromAnotherProcess(t, fooPath1) + pid := command1.Process.Pid + require.NoError(t, err) + + command2, err := fileopener.OpenFromAnotherProcess(t, errPath) + pid2 := command2.Process.Pid + require.NoError(t, err) + + require.EventuallyWithT(t, func(c *assert.CollectT) { + assert.Equal(c, registerRecorder.CallsForPathID(fooPathID1), 1) + + // Check that we tried to attach to the process twice. See w.sync() for + // why we do it. We don't actually need to attempt the registration + // twice, we just need to ensure that the maps were scanned twice but we + // don't have a hook for that so this check should be good enough. + assert.Equal(c, registerRecorder.CallsForPathID(errorPathID), 2) + }, time.Second*10, 100*time.Millisecond, "") + + require.EventuallyWithT(t, func(c *assert.CollectT) { + watcher.syncMutex.Lock() + defer watcher.syncMutex.Unlock() + + assert.Contains(c, watcher.scannedPIDs, uint32(pid)) + assert.Contains(c, watcher.scannedPIDs, uint32(pid2)) + }, time.Second*10, 100*time.Millisecond) + + require.NoError(t, command1.Process.Kill()) + require.NoError(t, command2.Process.Kill()) + + command1.Process.Wait() + command2.Process.Wait() + + require.EventuallyWithT(t, func(c *assert.CollectT) { + assert.Equal(c, unregisterRecorder.CallsForPathID(fooPathID1), 1) + }, time.Second*10, 100*time.Millisecond) + + // Check that clean up of dead processes works. + require.EventuallyWithT(t, func(c *assert.CollectT) { + watcher.syncMutex.Lock() + defer watcher.syncMutex.Unlock() + + assert.NotContains(c, watcher.scannedPIDs, uint32(pid)) + assert.NotContains(c, watcher.scannedPIDs, uint32(pid2)) + }, time.Second*10, 100*time.Millisecond) +} + func (s *SharedLibrarySuite) TestSharedLibraryDetectionWithPIDAndRootNamespace() { t := s.T() _, err := os.Stat("/usr/bin/busybox") @@ -150,9 +324,10 @@ func (s *SharedLibrarySuite) TestSharedLibraryDetectionWithPIDAndRootNamespace() t.Cleanup(watcher.Stop) time.Sleep(10 * time.Millisecond) - // simulate a slow (1 second) : open, write, close of the file + // simulate a slow (1 second) : open, read, close of the file // in a new pid and mount namespaces - o, err := exec.Command("unshare", "--fork", "--pid", "-R", root, "/ash", "-c", fmt.Sprintf("sleep 1 > %s", libpath)).CombinedOutput() + o, err := exec.Command("unshare", "--fork", "--pid", "-R", root, "/ash", "-c", + fmt.Sprintf("touch foo && mv foo %s && sleep 1 < %s", libpath, libpath)).CombinedOutput() if err != nil { t.Log(err, string(o)) } diff --git a/pkg/network/usm/tests/tracer_classification_test.go b/pkg/network/usm/tests/tracer_classification_test.go index fb167ab7e093c..1ddaa35bed5a5 100644 --- a/pkg/network/usm/tests/tracer_classification_test.go +++ b/pkg/network/usm/tests/tracer_classification_test.go @@ -20,7 +20,6 @@ import ( "testing" "time" - "github.com/cihub/seelog" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -44,7 +43,7 @@ func TestMain(m *testing.M) { if logLevel == "" { logLevel = "warn" } - log.SetupLogger(seelog.Default, logLevel) + log.SetupLogger(log.Default(), logLevel) platformInit() os.Exit(m.Run()) } diff --git a/pkg/network/usm/tests/tracer_usm_linux_test.go b/pkg/network/usm/tests/tracer_usm_linux_test.go index cb7cf47e30e4a..5cbbef2763777 100644 --- a/pkg/network/usm/tests/tracer_usm_linux_test.go +++ b/pkg/network/usm/tests/tracer_usm_linux_test.go @@ -429,15 +429,15 @@ func (s *USMSuite) TestIgnoreTLSClassificationIfApplicationProtocolWasDetected() // Perform the TLS handshake require.NoError(t, tlsConn.Handshake()) - - require.Eventually(t, func() bool { - payload := getConnections(t, tr) + require.EventuallyWithT(t, func(collect *assert.CollectT) { + payload := getConnections(collect, tr) for _, c := range payload.Conns { if c.DPort == srvPortU16 || c.SPort == srvPortU16 { - return c.ProtocolStack.Contains(protocols.TLS) == tt.shouldBeTLS + require.Equal(collect, c.ProtocolStack.Contains(protocols.TLS), tt.shouldBeTLS) + return } } - return false + require.Fail(collect, "") }, 10*time.Second, 100*time.Millisecond) }) } @@ -502,14 +502,14 @@ func (s *USMSuite) TestTLSClassification() { }, validation: func(t *testing.T, tr *tracer.Tracer) { // Iterate through active connections until we find connection created above - require.Eventuallyf(t, func() bool { - payload := getConnections(t, tr) + require.EventuallyWithTf(t, func(collect *assert.CollectT) { + payload := getConnections(collect, tr) for _, c := range payload.Conns { if c.DPort == port && c.ProtocolStack.Contains(protocols.TLS) { - return true + return } } - return false + require.Fail(collect, "") }, 4*time.Second, 100*time.Millisecond, "couldn't find TLS connection matching: dst port %v", portAsString) }, }) @@ -574,8 +574,8 @@ func (s *USMSuite) TestTLSClassificationAlreadyRunning() { // Iterate through active connections until we find connection created above var foundIncoming, foundOutgoing bool - require.Eventuallyf(t, func() bool { - payload := getConnections(t, tr) + require.EventuallyWithTf(t, func(collect *assert.CollectT) { + payload := getConnections(collect, tr) for _, c := range payload.Conns { if !foundIncoming && c.DPort == uint16(portAsValue) && c.ProtocolStack.Contains(protocols.TLS) { @@ -586,7 +586,8 @@ func (s *USMSuite) TestTLSClassificationAlreadyRunning() { foundOutgoing = true } } - return foundIncoming && foundOutgoing + require.True(collect, foundIncoming) + require.True(collect, foundOutgoing) }, 4*time.Second, 100*time.Millisecond, "couldn't find matching TLS connection") } diff --git a/pkg/network/usm/usm_http2_monitor_test.go b/pkg/network/usm/usm_http2_monitor_test.go index 438dd4cf8ccd4..ffeb78a706f69 100644 --- a/pkg/network/usm/usm_http2_monitor_test.go +++ b/pkg/network/usm/usm_http2_monitor_test.go @@ -1351,9 +1351,9 @@ func (s *usmHTTP2Suite) TestDynamicTable() { } } -// TestRemainderTable tests the remainder table map. -// We would like to make sure that the remainder table map is being updated correctly. -func (s *usmHTTP2Suite) TestRemainderTable() { +// TestIncompleteFrameTable tests the http2_incomplete_frame table map. +// We would like to make sure the incomplete_frame table map is being updated correctly. +func (s *usmHTTP2Suite) TestIncompleteFrameTable() { t := s.T() cfg := s.getCfg() @@ -1416,7 +1416,7 @@ func (s *usmHTTP2Suite) TestRemainderTable() { require.NoError(t, writeInput(c, 500*time.Millisecond, tt.messageBuilder()...)) assert.Eventually(t, func() bool { - require.Len(t, getRemainderTableMapKeys(t, usmMonitor.ebpfProgram), tt.mapSize) + require.Len(t, getIncompleteFrameTableMapKeys(t, usmMonitor.ebpfProgram), tt.mapSize) return true }, time.Second*5, time.Millisecond*100, "") if t.Failed() { @@ -1877,14 +1877,14 @@ func validateDynamicTableMap(t *testing.T, ebpfProgram *ebpfProgram, expectedDyn require.EqualValues(t, expectedDynamicTablePathIndexes, resultIndexes) } -// getRemainderTableMapKeys returns the keys of the remainder table map. -func getRemainderTableMapKeys(t *testing.T, ebpfProgram *ebpfProgram) []usmhttp.ConnTuple { - remainderMap, _, err := ebpfProgram.GetMap("http2_remainder") +// getIncompleteFrameTableMapKeys returns the keys of the incomplete frame table map. +func getIncompleteFrameTableMapKeys(t *testing.T, ebpfProgram *ebpfProgram) []usmhttp.ConnTuple { + incompleteFrameMap, _, err := ebpfProgram.GetMap("http2_incomplete_frames") require.NoError(t, err) resultIndexes := make([]usmhttp.ConnTuple, 0) var key usmhttp2.ConnTuple - var value usmhttp2.HTTP2RemainderEntry - iterator := remainderMap.Iterate() + var value usmhttp2.HTTP2IncompleteFrameEntry + iterator := incompleteFrameMap.Iterate() for iterator.Next(&key, &value) { resultIndexes = append(resultIndexes, key) diff --git a/pkg/network/usm/utils/debugger.go b/pkg/network/usm/utils/debugger.go index 4da685bf2fbc9..9f2ec2632b9be 100644 --- a/pkg/network/usm/utils/debugger.go +++ b/pkg/network/usm/utils/debugger.go @@ -31,6 +31,7 @@ type Attacher interface { type TracedProgram struct { ProgramType string FilePath string + PathID PathIdentifier PIDs []uint32 } @@ -44,6 +45,7 @@ type BlockedProcess struct { type PathIdentifierWithSamplePath struct { PathIdentifier SamplePath string + Reason string } // GetTracedProgramsEndpoint returns a callback for the given module name, that @@ -131,6 +133,7 @@ func (d *tlsDebugger) GetTracedPrograms(moduleName string) []TracedProgram { program.ProgramType = programType program.FilePath = registration.sampleFilePath + program.PathID = pathID } registry.m.Unlock() @@ -211,11 +214,12 @@ func (d *tlsDebugger) GetBlockedPathIDsWithSamplePath(moduleName, programType st blockedIDsWithSampleFile := make([]PathIdentifierWithSamplePath, 0, len(registry.blocklistByID.Keys())) for _, pathIdentifier := range registry.blocklistByID.Keys() { - samplePath, ok := registry.blocklistByID.Get(pathIdentifier) + entry, ok := registry.blocklistByID.Get(pathIdentifier) if ok { blockedIDsWithSampleFile = append(blockedIDsWithSampleFile, PathIdentifierWithSamplePath{ PathIdentifier: pathIdentifier, - SamplePath: samplePath}) + SamplePath: entry.Path, + Reason: entry.Reason}) } } diff --git a/pkg/network/usm/utils/file_registry.go b/pkg/network/usm/utils/file_registry.go index 177a4ac7c5857..2b20410088188 100644 --- a/pkg/network/usm/utils/file_registry.go +++ b/pkg/network/usm/utils/file_registry.go @@ -13,13 +13,14 @@ import ( "os" "sync" - "github.com/cihub/seelog" "github.com/hashicorp/golang-lru/v2/simplelru" "go.uber.org/atomic" + "github.com/DataDog/datadog-agent/pkg/network/go/binversion" "github.com/DataDog/datadog-agent/pkg/network/protocols/telemetry" "github.com/DataDog/datadog-agent/pkg/util/kernel" "github.com/DataDog/datadog-agent/pkg/util/log" + "github.com/DataDog/datadog-agent/pkg/util/safeelf" ) // FileRegistry is responsible for tracking open files and executing callbacks @@ -49,11 +50,17 @@ type FileRegistry struct { byPID map[uint32]pathIdentifierSet // if we can't execute a callback for a given file we don't try more than once - blocklistByID *simplelru.LRU[PathIdentifier, string] + blocklistByID *simplelru.LRU[PathIdentifier, BlockListEntry] telemetry registryTelemetry } +// BlockListEntry represents an enty in the block list +type BlockListEntry struct { + Path string + Reason string +} + // FilePath represents the location of a file from the *root* namespace view type FilePath struct { HostPath string @@ -91,7 +98,7 @@ var ErrEnvironment = errors.New("Environment error, path will not be blocked") // NewFileRegistry creates a new `FileRegistry` instance func NewFileRegistry(moduleName, programName string) *FileRegistry { - blocklistByID, err := simplelru.NewLRU[PathIdentifier, string](2000, nil) + blocklistByID, err := simplelru.NewLRU[PathIdentifier, BlockListEntry](2000, nil) if err != nil { log.Warnf("running without block cache list, creation error: %s", err) blocklistByID = nil @@ -122,6 +129,22 @@ var ( ErrPathIsAlreadyRegistered = errors.New("path is already registered") ) +// getBlockReason creates a string specifying the reason for the block based on +// the error received. To reduce memory usage of this debugging feature, for +// very common errors we store a summary instead of the full error string, +// leaving the latter for more interesting errors. +func getBlockReason(error error) string { + if errors.Is(error, binversion.ErrNotGoExe) { + return "not-go" + } + + if errors.Is(error, safeelf.ErrNoSymbols) { + return "no-symbols" + } + + return error.Error() +} + // Register inserts or updates a new file registration within to the `FileRegistry`; // // If no current registration exists for the given `PathIdentifier`, we execute @@ -194,7 +217,7 @@ func (r *FileRegistry) Register(namespacedPath string, pid uint32, activationCB, if r.blocklistByID != nil { // add `pathID` to blocklist so we don't attempt to re-register files // that are problematic for some reason - r.blocklistByID.Add(pathID, path.HostPath) + r.blocklistByID.Add(pathID, BlockListEntry{Path: path.HostPath, Reason: getBlockReason(err)}) } r.telemetry.fileHookFailed.Add(1) return err @@ -263,7 +286,7 @@ func (r *FileRegistry) GetRegisteredProcesses() map[uint32]struct{} { // Log state of `FileRegistry` func (r *FileRegistry) Log() { - if log.ShouldLog(seelog.DebugLvl) { + if log.ShouldLog(log.DebugLvl) { log.Debugf("file_registry summary: program=%s %s", r.telemetry.programName, r.telemetry.metricGroup.Summary()) } } diff --git a/pkg/network/usm/utils/file_registry_test.go b/pkg/network/usm/utils/file_registry_test.go index 67b7c0984f313..292e2fe58e7a6 100644 --- a/pkg/network/usm/utils/file_registry_test.go +++ b/pkg/network/usm/utils/file_registry_test.go @@ -244,6 +244,9 @@ func TestFailedRegistration(t *testing.T) { assert.Equal(t, 1, registerRecorder.CallsForPathID(pathID)) assert.Contains(t, debugger.GetBlockedPathIDs(testModuleName, ""), pathID) + info := debugger.GetBlockedPathIDsWithSamplePath(testModuleName, "") + require.Len(t, info, 1) + assert.Equal(t, registerRecorder.ReturnError.Error(), info[0].Reason) debugger.ClearBlocked(testModuleName) assert.Empty(t, debugger.GetBlockedPathIDs(testModuleName, "")) } diff --git a/pkg/networkdevice/metadata/payload.go b/pkg/networkdevice/metadata/payload.go index 54b2f45eb0996..5f67824728cbe 100644 --- a/pkg/networkdevice/metadata/payload.go +++ b/pkg/networkdevice/metadata/payload.go @@ -131,10 +131,11 @@ type TopologyLinkSide struct { // TopologyLinkMetadata contains topology interface to interface links metadata type TopologyLinkMetadata struct { - ID string `json:"id"` - SourceType string `json:"source_type"` - Local *TopologyLinkSide `json:"local"` - Remote *TopologyLinkSide `json:"remote"` + ID string `json:"id"` + SourceType string `json:"source_type"` + Integration string `json:"integration,omitempty"` + Local *TopologyLinkSide `json:"local"` + Remote *TopologyLinkSide `json:"remote"` } // NetflowExporter contains netflow exporters info 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/common/common.go b/pkg/networkpath/traceroute/common/common.go new file mode 100644 index 0000000000000..c7622fa391891 --- /dev/null +++ b/pkg/networkpath/traceroute/common/common.go @@ -0,0 +1,160 @@ +// 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 contains common functionality for both TCP and UDP +// traceroute implementations +package common + +import ( + "fmt" + "net" + "strconv" + "time" + + "github.com/DataDog/datadog-agent/pkg/util/log" + "github.com/google/gopacket" + "github.com/google/gopacket/layers" + "golang.org/x/net/ipv4" +) + +const ( + // IPProtoICMP is the IP protocol number for ICMP + // we create our own constant here because there are + // different imports for the constant in different + // operating systems + IPProtoICMP = 1 +) + +type ( + // Results encapsulates a response from the + // traceroute + Results struct { + Source net.IP + SourcePort uint16 + Target net.IP + DstPort uint16 + Hops []*Hop + } + + // Hop encapsulates information about a single + // hop in a traceroute + Hop struct { + IP net.IP + Port uint16 + ICMPType layers.ICMPv4TypeCode + RTT time.Duration + IsDest bool + } + + // CanceledError is sent when a listener + // is canceled + CanceledError string + + // ICMPResponse encapsulates the data from + // an ICMP response packet needed for matching + ICMPResponse struct { + SrcIP net.IP + DstIP net.IP + TypeCode layers.ICMPv4TypeCode + InnerSrcIP net.IP + InnerDstIP net.IP + InnerSrcPort uint16 + InnerDstPort uint16 + InnerSeqNum uint32 + } +) + +func (c CanceledError) Error() string { + return string(c) +} + +// LocalAddrForHost takes in a destionation IP and port and returns the local +// address that should be used to connect to the destination +func LocalAddrForHost(destIP net.IP, destPort uint16) (*net.UDPAddr, error) { + // this is a quick way to get the local address for connecting to the host + // using UDP as the network type to avoid actually creating a connection to + // the host, just get the OS to give us a local IP and local ephemeral port + conn, err := net.Dial("udp4", net.JoinHostPort(destIP.String(), strconv.Itoa(int(destPort)))) + if err != nil { + return nil, err + } + defer conn.Close() + localAddr := conn.LocalAddr() + + localUDPAddr, ok := localAddr.(*net.UDPAddr) + if !ok { + return nil, fmt.Errorf("invalid address type for %s: want %T, got %T", localAddr, localUDPAddr, localAddr) + } + + return localUDPAddr, nil +} + +// ParseICMP takes in an IPv4 header and payload and tries to convert to an ICMP +// message, it returns all the fields from the packet we need to validate it's the response +// we're looking for +func ParseICMP(header *ipv4.Header, payload []byte) (*ICMPResponse, error) { + // in addition to parsing, it is probably not a bad idea to do some validation + // so we can ignore the ICMP packets we don't care about + icmpResponse := ICMPResponse{} + + if header.Protocol != IPProtoICMP || header.Version != 4 || + header.Src == nil || header.Dst == nil { + return nil, fmt.Errorf("invalid IP header for ICMP packet: %+v", header) + } + icmpResponse.SrcIP = header.Src + icmpResponse.DstIP = header.Dst + + var icmpv4Layer layers.ICMPv4 + decoded := []gopacket.LayerType{} + icmpParser := gopacket.NewDecodingLayerParser(layers.LayerTypeICMPv4, &icmpv4Layer) + icmpParser.IgnoreUnsupported = true // ignore unsupported layers, we will decode them in the next step + if err := icmpParser.DecodeLayers(payload, &decoded); err != nil { + return nil, fmt.Errorf("failed to decode ICMP packet: %w", err) + } + // since we ignore unsupported layers, we need to check if we actually decoded + // anything + if len(decoded) < 1 { + return nil, fmt.Errorf("failed to decode ICMP packet, no layers decoded") + } + icmpResponse.TypeCode = icmpv4Layer.TypeCode + + var icmpPayload []byte + if len(icmpv4Layer.Payload) < 40 { + log.Tracef("Payload length %d is less than 40, extending...\n", len(icmpv4Layer.Payload)) + icmpPayload = make([]byte, 40) + copy(icmpPayload, icmpv4Layer.Payload) + // we have to set this in order for the TCP + // parser to work + icmpPayload[32] = 5 << 4 // set data offset + } else { + icmpPayload = icmpv4Layer.Payload + } + + // a separate parser is needed to decode the inner IP and TCP headers because + // gopacket doesn't support this type of nesting in a single decoder + var innerIPLayer layers.IPv4 + var innerTCPLayer layers.TCP + innerIPParser := gopacket.NewDecodingLayerParser(layers.LayerTypeIPv4, &innerIPLayer, &innerTCPLayer) + if err := innerIPParser.DecodeLayers(icmpPayload, &decoded); err != nil { + return nil, fmt.Errorf("failed to decode inner ICMP payload: %w", err) + } + icmpResponse.InnerSrcIP = innerIPLayer.SrcIP + icmpResponse.InnerDstIP = innerIPLayer.DstIP + icmpResponse.InnerSrcPort = uint16(innerTCPLayer.SrcPort) + icmpResponse.InnerDstPort = uint16(innerTCPLayer.DstPort) + icmpResponse.InnerSeqNum = innerTCPLayer.Seq + + return &icmpResponse, nil +} + +// ICMPMatch checks if an ICMP response matches the expected response +// based on the local and remote IP, port, and sequence number +func ICMPMatch(localIP net.IP, localPort uint16, remoteIP net.IP, remotePort uint16, seqNum uint32, response *ICMPResponse) bool { + return localIP.Equal(response.InnerSrcIP) && + remoteIP.Equal(response.InnerDstIP) && + localPort == response.InnerSrcPort && + remotePort == response.InnerDstPort && + seqNum == response.InnerSeqNum +} diff --git a/pkg/networkpath/traceroute/common/common_test.go b/pkg/networkpath/traceroute/common/common_test.go new file mode 100644 index 0000000000000..aa6f6cfdf24cb --- /dev/null +++ b/pkg/networkpath/traceroute/common/common_test.go @@ -0,0 +1,117 @@ +// 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 test + +package common + +import ( + "net" + "testing" + + "github.com/DataDog/datadog-agent/pkg/networkpath/traceroute/testutils" + "github.com/google/gopacket/layers" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "golang.org/x/net/ipv4" +) + +var ( + srcIP = net.ParseIP("1.2.3.4") + dstIP = net.ParseIP("5.6.7.8") + + innerSrcIP = net.ParseIP("10.0.0.1") + innerDstIP = net.ParseIP("192.168.1.1") +) + +func Test_parseICMP(t *testing.T) { + ipv4Header := testutils.CreateMockIPv4Header(srcIP, dstIP, 1) + icmpLayer := testutils.CreateMockICMPLayer(layers.ICMPv4CodeTTLExceeded) + innerIPv4Layer := testutils.CreateMockIPv4Layer(innerSrcIP, innerDstIP, layers.IPProtocolTCP) + innerTCPLayer := testutils.CreateMockTCPLayer(12345, 443, 28394, 12737, true, true, true) + + tt := []struct { + description string + inHeader *ipv4.Header + inPayload []byte + expected *ICMPResponse + errMsg string + }{ + { + description: "empty IPv4 layer should return an error", + inHeader: &ipv4.Header{}, + inPayload: []byte{}, + expected: nil, + errMsg: "invalid IP header for ICMP packet", + }, + { + description: "missing ICMP layer should return an error", + inHeader: ipv4Header, + inPayload: []byte{}, + expected: nil, + errMsg: "failed to decode ICMP packet", + }, + { + description: "missing inner layers should return an error", + inHeader: ipv4Header, + inPayload: testutils.CreateMockICMPPacket(nil, icmpLayer, nil, nil, false), + expected: nil, + errMsg: "failed to decode inner ICMP payload", + }, + { + description: "ICMP packet with partial TCP header should create icmpResponse", + inHeader: ipv4Header, + inPayload: testutils.CreateMockICMPPacket(nil, icmpLayer, innerIPv4Layer, innerTCPLayer, true), + expected: &ICMPResponse{ + SrcIP: srcIP, + DstIP: dstIP, + InnerSrcIP: innerSrcIP, + InnerDstIP: innerDstIP, + InnerSrcPort: 12345, + InnerDstPort: 443, + InnerSeqNum: 28394, + }, + errMsg: "", + }, + { + description: "full ICMP packet should create icmpResponse", + inHeader: ipv4Header, + inPayload: testutils.CreateMockICMPPacket(nil, icmpLayer, innerIPv4Layer, innerTCPLayer, true), + expected: &ICMPResponse{ + SrcIP: srcIP, + DstIP: dstIP, + InnerSrcIP: innerSrcIP, + InnerDstIP: innerDstIP, + InnerSrcPort: 12345, + InnerDstPort: 443, + InnerSeqNum: 28394, + }, + errMsg: "", + }, + } + + for _, test := range tt { + t.Run(test.description, func(t *testing.T) { + actual, err := ParseICMP(test.inHeader, test.inPayload) + if test.errMsg != "" { + require.Error(t, err) + assert.Contains(t, err.Error(), test.errMsg) + assert.Nil(t, actual) + return + } + require.Nil(t, err) + require.NotNil(t, actual) + // assert.Equal doesn't handle net.IP well + assert.Equal(t, testutils.StructFieldCount(test.expected), testutils.StructFieldCount(actual)) + assert.Truef(t, test.expected.SrcIP.Equal(actual.SrcIP), "mismatch source IPs: expected %s, got %s", test.expected.SrcIP.String(), actual.SrcIP.String()) + assert.Truef(t, test.expected.DstIP.Equal(actual.DstIP), "mismatch dest IPs: expected %s, got %s", test.expected.DstIP.String(), actual.DstIP.String()) + assert.Truef(t, test.expected.InnerSrcIP.Equal(actual.InnerSrcIP), "mismatch inner source IPs: expected %s, got %s", test.expected.InnerSrcIP.String(), actual.InnerSrcIP.String()) + assert.Truef(t, test.expected.InnerDstIP.Equal(actual.InnerDstIP), "mismatch inner dest IPs: expected %s, got %s", test.expected.InnerDstIP.String(), actual.InnerDstIP.String()) + assert.Equal(t, test.expected.InnerSrcPort, actual.InnerSrcPort) + assert.Equal(t, test.expected.InnerDstPort, actual.InnerDstPort) + assert.Equal(t, test.expected.InnerSeqNum, actual.InnerSeqNum) + }) + } +} diff --git a/pkg/networkpath/traceroute/runner/runner.go b/pkg/networkpath/traceroute/runner/runner.go index 9087b66b4eb8a..b8240ee6db3cd 100644 --- a/pkg/networkpath/traceroute/runner/runner.go +++ b/pkg/networkpath/traceroute/runner/runner.go @@ -24,6 +24,7 @@ import ( "github.com/DataDog/datadog-agent/pkg/config/setup" "github.com/DataDog/datadog-agent/pkg/network" "github.com/DataDog/datadog-agent/pkg/networkpath/payload" + "github.com/DataDog/datadog-agent/pkg/networkpath/traceroute/common" "github.com/DataDog/datadog-agent/pkg/networkpath/traceroute/config" "github.com/DataDog/datadog-agent/pkg/networkpath/traceroute/tcp" "github.com/DataDog/datadog-agent/pkg/process/util" @@ -222,7 +223,7 @@ func (r *Runner) runTCP(cfg config.Config, hname string, target net.IP, maxTTL u return pathResult, nil } -func (r *Runner) processTCPResults(res *tcp.Results, hname string, destinationHost string, destinationPort uint16, destinationIP net.IP) (payload.NetworkPath, error) { +func (r *Runner) processTCPResults(res *common.Results, hname string, destinationHost string, destinationPort uint16, destinationIP net.IP) (payload.NetworkPath, error) { traceroutePath := payload.NetworkPath{ AgentVersion: version.AgentVersion, PathtraceID: payload.NewPathtraceID(), 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/tcp/tcpv4.go b/pkg/networkpath/traceroute/tcp/tcpv4.go index 64484f9c0ad60..ca38edf21cf4c 100644 --- a/pkg/networkpath/traceroute/tcp/tcpv4.go +++ b/pkg/networkpath/traceroute/tcp/tcpv4.go @@ -9,8 +9,6 @@ package tcp import ( "net" "time" - - "github.com/google/gopacket/layers" ) type ( @@ -27,26 +25,6 @@ type ( Delay time.Duration // delay between sending packets (not applicable if we go the serial send/receive route) Timeout time.Duration // full timeout for all packets } - - // Results encapsulates a response from the TCP - // traceroute - Results struct { - Source net.IP - SourcePort uint16 - Target net.IP - DstPort uint16 - Hops []*Hop - } - - // Hop encapsulates information about a single - // hop in a TCP traceroute - Hop struct { - IP net.IP - Port uint16 - ICMPType layers.ICMPv4TypeCode - RTT time.Duration - IsDest bool - } ) // Close doesn't to anything yet, but we should diff --git a/pkg/networkpath/traceroute/tcp/tcpv4_unix.go b/pkg/networkpath/traceroute/tcp/tcpv4_unix.go index 32cf7e19ee11e..f5859d056e00e 100644 --- a/pkg/networkpath/traceroute/tcp/tcpv4_unix.go +++ b/pkg/networkpath/traceroute/tcp/tcpv4_unix.go @@ -16,15 +16,16 @@ import ( "golang.org/x/net/ipv4" + "github.com/DataDog/datadog-agent/pkg/networkpath/traceroute/common" "github.com/DataDog/datadog-agent/pkg/util/log" ) // TracerouteSequential runs a traceroute sequentially where a packet is // sent and we wait for a response before sending the next packet -func (t *TCPv4) TracerouteSequential() (*Results, error) { +func (t *TCPv4) TracerouteSequential() (*common.Results, error) { // Get local address for the interface that connects to this // host and store in in the probe - addr, err := localAddrForHost(t.Target, t.DestPort) + addr, err := common.LocalAddrForHost(t.Target, t.DestPort) if err != nil { return nil, fmt.Errorf("failed to get local address for target: %w", err) } @@ -71,7 +72,7 @@ func (t *TCPv4) TracerouteSequential() (*Results, error) { } // hops should be of length # of hops - hops := make([]*Hop, 0, t.MaxTTL-t.MinTTL) + hops := make([]*common.Hop, 0, t.MaxTTL-t.MinTTL) for i := int(t.MinTTL); i <= int(t.MaxTTL); i++ { seqNumber := rand.Uint32() @@ -88,7 +89,7 @@ func (t *TCPv4) TracerouteSequential() (*Results, error) { } } - return &Results{ + return &common.Results{ Source: t.srcIP, SourcePort: t.srcPort, Target: t.Target, @@ -97,7 +98,7 @@ func (t *TCPv4) TracerouteSequential() (*Results, error) { }, nil } -func (t *TCPv4) sendAndReceive(rawIcmpConn *ipv4.RawConn, rawTCPConn *ipv4.RawConn, ttl int, seqNum uint32, timeout time.Duration) (*Hop, error) { +func (t *TCPv4) sendAndReceive(rawIcmpConn *ipv4.RawConn, rawTCPConn *ipv4.RawConn, ttl int, seqNum uint32, timeout time.Duration) (*common.Hop, error) { tcpHeader, tcpPacket, err := createRawTCPSyn(t.srcIP, t.srcPort, t.Target, t.DestPort, seqNum, ttl) if err != nil { log.Errorf("failed to create TCP packet with TTL: %d, error: %s", ttl, err.Error()) @@ -122,7 +123,7 @@ func (t *TCPv4) sendAndReceive(rawIcmpConn *ipv4.RawConn, rawTCPConn *ipv4.RawCo rtt = end.Sub(start) } - return &Hop{ + return &common.Hop{ IP: hopIP, Port: hopPort, ICMPType: icmpType, diff --git a/pkg/networkpath/traceroute/tcp/tcpv4_windows.go b/pkg/networkpath/traceroute/tcp/tcpv4_windows.go index 3067695b0e559..e9eb74cae702f 100644 --- a/pkg/networkpath/traceroute/tcp/tcpv4_windows.go +++ b/pkg/networkpath/traceroute/tcp/tcpv4_windows.go @@ -14,6 +14,7 @@ import ( "golang.org/x/sys/windows" + "github.com/DataDog/datadog-agent/pkg/networkpath/traceroute/common" "github.com/DataDog/datadog-agent/pkg/util/log" ) @@ -67,14 +68,14 @@ func createRawSocket() (*winrawsocket, error) { // TracerouteSequential runs a traceroute sequentially where a packet is // sent and we wait for a response before sending the next packet -func (t *TCPv4) TracerouteSequential() (*Results, error) { +func (t *TCPv4) TracerouteSequential() (*common.Results, error) { log.Debugf("Running traceroute to %+v", t) // Get local address for the interface that connects to this // host and store in in the probe // // TODO: do this once for the probe and hang on to the // listener until we decide to close the probe - addr, err := localAddrForHost(t.Target, t.DestPort) + addr, err := common.LocalAddrForHost(t.Target, t.DestPort) if err != nil { return nil, fmt.Errorf("failed to get local address for target: %w", err) } @@ -87,7 +88,7 @@ func (t *TCPv4) TracerouteSequential() (*Results, error) { } defer rs.close() - hops := make([]*Hop, 0, int(t.MaxTTL-t.MinTTL)+1) + hops := make([]*common.Hop, 0, int(t.MaxTTL-t.MinTTL)+1) for i := int(t.MinTTL); i <= int(t.MaxTTL); i++ { seqNumber := rand.Uint32() @@ -104,7 +105,7 @@ func (t *TCPv4) TracerouteSequential() (*Results, error) { } } - return &Results{ + return &common.Results{ Source: t.srcIP, SourcePort: t.srcPort, Target: t.Target, @@ -113,7 +114,7 @@ func (t *TCPv4) TracerouteSequential() (*Results, error) { }, nil } -func (t *TCPv4) sendAndReceive(rs *winrawsocket, ttl int, seqNum uint32, timeout time.Duration) (*Hop, error) { +func (t *TCPv4) sendAndReceive(rs *winrawsocket, ttl int, seqNum uint32, timeout time.Duration) (*common.Hop, error) { _, buffer, _, err := createRawTCPSynBuffer(t.srcIP, t.srcPort, t.Target, t.DestPort, seqNum, ttl) if err != nil { log.Errorf("failed to create TCP packet with TTL: %d, error: %s", ttl, err.Error()) @@ -138,7 +139,7 @@ func (t *TCPv4) sendAndReceive(rs *winrawsocket, ttl int, seqNum uint32, timeout rtt = end.Sub(start) } - return &Hop{ + return &common.Hop{ IP: hopIP, Port: hopPort, ICMPType: icmpType, diff --git a/pkg/networkpath/traceroute/tcp/utils.go b/pkg/networkpath/traceroute/tcp/utils.go index ae7d507f23940..3bd9e437e90c7 100644 --- a/pkg/networkpath/traceroute/tcp/utils.go +++ b/pkg/networkpath/traceroute/tcp/utils.go @@ -8,46 +8,14 @@ package tcp import ( "fmt" "net" - "strconv" + "syscall" - "github.com/DataDog/datadog-agent/pkg/util/log" "github.com/google/gopacket" "github.com/google/gopacket/layers" "golang.org/x/net/ipv4" ) -const ( - // ACK is the acknowledge TCP flag - ACK = 1 << 4 - // RST is the reset TCP flag - RST = 1 << 2 - // SYN is the synchronization TCP flag - SYN = 1 << 1 - - // IPProtoICMP is the ICMP protocol number - IPProtoICMP = 1 - // IPProtoTCP is the TCP protocol number - IPProtoTCP = 6 -) - type ( - // canceledError is sent when a listener - // is canceled - canceledError string - - // icmpResponse encapsulates the data from - // an ICMP response packet needed for matching - icmpResponse struct { - SrcIP net.IP - DstIP net.IP - TypeCode layers.ICMPv4TypeCode - InnerSrcIP net.IP - InnerDstIP net.IP - InnerSrcPort uint16 - InnerDstPort uint16 - InnerSeqNum uint32 - } - // tcpResponse encapsulates the data from a // TCP response needed for matching tcpResponse struct { @@ -57,25 +25,6 @@ type ( } ) -func localAddrForHost(destIP net.IP, destPort uint16) (*net.UDPAddr, error) { - // this is a quick way to get the local address for connecting to the host - // using UDP as the network type to avoid actually creating a connection to - // the host, just get the OS to give us a local IP and local ephemeral port - conn, err := net.Dial("udp4", net.JoinHostPort(destIP.String(), strconv.Itoa(int(destPort)))) - if err != nil { - return nil, err - } - defer conn.Close() - localAddr := conn.LocalAddr() - - localUDPAddr, ok := localAddr.(*net.UDPAddr) - if !ok { - return nil, fmt.Errorf("invalid address type for %s: want %T, got %T", localAddr, localUDPAddr, localAddr) - } - - return localUDPAddr, nil -} - // reserveLocalPort reserves an ephemeral TCP port // and returns both the listener and port because the // listener should be held until the port is no longer @@ -145,64 +94,6 @@ func createRawTCPSynBuffer(sourceIP net.IP, sourcePort uint16, destIP net.IP, de return &ipHdr, packet, 20, nil } -// parseICMP takes in an IPv4 header and payload and tries to convert to an ICMP -// message, it returns all the fields from the packet we need to validate it's the response -// we're looking for -func parseICMP(header *ipv4.Header, payload []byte) (*icmpResponse, error) { - // in addition to parsing, it is probably not a bad idea to do some validation - // so we can ignore the ICMP packets we don't care about - icmpResponse := icmpResponse{} - - if header.Protocol != IPProtoICMP || header.Version != 4 || - header.Src == nil || header.Dst == nil { - return nil, fmt.Errorf("invalid IP header for ICMP packet: %+v", header) - } - icmpResponse.SrcIP = header.Src - icmpResponse.DstIP = header.Dst - - var icmpv4Layer layers.ICMPv4 - decoded := []gopacket.LayerType{} - icmpParser := gopacket.NewDecodingLayerParser(layers.LayerTypeICMPv4, &icmpv4Layer) - icmpParser.IgnoreUnsupported = true // ignore unsupported layers, we will decode them in the next step - if err := icmpParser.DecodeLayers(payload, &decoded); err != nil { - return nil, fmt.Errorf("failed to decode ICMP packet: %w", err) - } - // since we ignore unsupported layers, we need to check if we actually decoded - // anything - if len(decoded) < 1 { - return nil, fmt.Errorf("failed to decode ICMP packet, no layers decoded") - } - icmpResponse.TypeCode = icmpv4Layer.TypeCode - - var icmpPayload []byte - if len(icmpv4Layer.Payload) < 40 { - log.Tracef("Payload length %d is less than 40, extending...\n", len(icmpv4Layer.Payload)) - icmpPayload = make([]byte, 40) - copy(icmpPayload, icmpv4Layer.Payload) - // we have to set this in order for the TCP - // parser to work - icmpPayload[32] = 5 << 4 // set data offset - } else { - icmpPayload = icmpv4Layer.Payload - } - - // a separate parser is needed to decode the inner IP and TCP headers because - // gopacket doesn't support this type of nesting in a single decoder - var innerIPLayer layers.IPv4 - var innerTCPLayer layers.TCP - innerIPParser := gopacket.NewDecodingLayerParser(layers.LayerTypeIPv4, &innerIPLayer, &innerTCPLayer) - if err := innerIPParser.DecodeLayers(icmpPayload, &decoded); err != nil { - return nil, fmt.Errorf("failed to decode inner ICMP payload: %w", err) - } - icmpResponse.InnerSrcIP = innerIPLayer.SrcIP - icmpResponse.InnerDstIP = innerIPLayer.DstIP - icmpResponse.InnerSrcPort = uint16(innerTCPLayer.SrcPort) - icmpResponse.InnerDstPort = uint16(innerTCPLayer.DstPort) - icmpResponse.InnerSeqNum = innerTCPLayer.Seq - - return &icmpResponse, nil -} - type tcpParser struct { layer layers.TCP decoded []gopacket.LayerType @@ -216,7 +107,7 @@ func newTCPParser() *tcpParser { } func (tp *tcpParser) parseTCP(header *ipv4.Header, payload []byte) (*tcpResponse, error) { - if header.Protocol != IPProtoTCP || header.Version != 4 || + if header.Protocol != syscall.IPPROTO_TCP || header.Version != 4 || header.Src == nil || header.Dst == nil { return nil, fmt.Errorf("invalid IP header for TCP packet: %+v", header) } @@ -236,14 +127,6 @@ func (tp *tcpParser) parseTCP(header *ipv4.Header, payload []byte) (*tcpResponse return resp, nil } -func icmpMatch(localIP net.IP, localPort uint16, remoteIP net.IP, remotePort uint16, seqNum uint32, response *icmpResponse) bool { - return localIP.Equal(response.InnerSrcIP) && - remoteIP.Equal(response.InnerDstIP) && - localPort == response.InnerSrcPort && - remotePort == response.InnerDstPort && - seqNum == response.InnerSeqNum -} - func tcpMatch(localIP net.IP, localPort uint16, remoteIP net.IP, remotePort uint16, seqNum uint32, response *tcpResponse) bool { flagsCheck := (response.TCPResponse.SYN && response.TCPResponse.ACK) || response.TCPResponse.RST sourcePort := uint16(response.TCPResponse.SrcPort) @@ -256,7 +139,3 @@ func tcpMatch(localIP net.IP, localPort uint16, remoteIP net.IP, remotePort uint seqNum == response.TCPResponse.Ack-1 && flagsCheck } - -func (c canceledError) Error() string { - return string(c) -} diff --git a/pkg/networkpath/traceroute/tcp/utils_test.go b/pkg/networkpath/traceroute/tcp/utils_test.go index d79cda12ac5da..5b344df71ec16 100644 --- a/pkg/networkpath/traceroute/tcp/utils_test.go +++ b/pkg/networkpath/traceroute/tcp/utils_test.go @@ -10,15 +10,14 @@ package tcp import ( "fmt" "net" - "reflect" "runtime" "testing" - "github.com/google/gopacket" - "github.com/google/gopacket/layers" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "golang.org/x/net/ipv4" + + "github.com/DataDog/datadog-agent/pkg/networkpath/traceroute/testutils" ) var ( @@ -113,102 +112,12 @@ func Test_createRawTCPSynBuffer(t *testing.T) { assert.Equal(t, expectedPktBytes, pktBytes) } -func Test_parseICMP(t *testing.T) { - ipv4Header := createMockIPv4Header(srcIP, dstIP, 1) - icmpLayer := createMockICMPLayer(layers.ICMPv4CodeTTLExceeded) - innerIPv4Layer := createMockIPv4Layer(innerSrcIP, innerDstIP, layers.IPProtocolTCP) - innerTCPLayer := createMockTCPLayer(12345, 443, 28394, 12737, true, true, true) - - tt := []struct { - description string - inHeader *ipv4.Header - inPayload []byte - expected *icmpResponse - errMsg string - }{ - { - description: "empty IPv4 layer should return an error", - inHeader: &ipv4.Header{}, - inPayload: []byte{}, - expected: nil, - errMsg: "invalid IP header for ICMP packet", - }, - { - description: "missing ICMP layer should return an error", - inHeader: ipv4Header, - inPayload: []byte{}, - expected: nil, - errMsg: "failed to decode ICMP packet", - }, - { - description: "missing inner layers should return an error", - inHeader: ipv4Header, - inPayload: createMockICMPPacket(nil, icmpLayer, nil, nil, false), - expected: nil, - errMsg: "failed to decode inner ICMP payload", - }, - { - description: "ICMP packet with partial TCP header should create icmpResponse", - inHeader: ipv4Header, - inPayload: createMockICMPPacket(nil, icmpLayer, innerIPv4Layer, innerTCPLayer, true), - expected: &icmpResponse{ - SrcIP: srcIP, - DstIP: dstIP, - InnerSrcIP: innerSrcIP, - InnerDstIP: innerDstIP, - InnerSrcPort: 12345, - InnerDstPort: 443, - InnerSeqNum: 28394, - }, - errMsg: "", - }, - { - description: "full ICMP packet should create icmpResponse", - inHeader: ipv4Header, - inPayload: createMockICMPPacket(nil, icmpLayer, innerIPv4Layer, innerTCPLayer, true), - expected: &icmpResponse{ - SrcIP: srcIP, - DstIP: dstIP, - InnerSrcIP: innerSrcIP, - InnerDstIP: innerDstIP, - InnerSrcPort: 12345, - InnerDstPort: 443, - InnerSeqNum: 28394, - }, - errMsg: "", - }, - } - - for _, test := range tt { - t.Run(test.description, func(t *testing.T) { - actual, err := parseICMP(test.inHeader, test.inPayload) - if test.errMsg != "" { - require.Error(t, err) - assert.Contains(t, err.Error(), test.errMsg) - assert.Nil(t, actual) - return - } - require.Nil(t, err) - require.NotNil(t, actual) - // assert.Equal doesn't handle net.IP well - assert.Equal(t, structFieldCount(test.expected), structFieldCount(actual)) - assert.Truef(t, test.expected.SrcIP.Equal(actual.SrcIP), "mismatch source IPs: expected %s, got %s", test.expected.SrcIP.String(), actual.SrcIP.String()) - assert.Truef(t, test.expected.DstIP.Equal(actual.DstIP), "mismatch dest IPs: expected %s, got %s", test.expected.DstIP.String(), actual.DstIP.String()) - assert.Truef(t, test.expected.InnerSrcIP.Equal(actual.InnerSrcIP), "mismatch inner source IPs: expected %s, got %s", test.expected.InnerSrcIP.String(), actual.InnerSrcIP.String()) - assert.Truef(t, test.expected.InnerDstIP.Equal(actual.InnerDstIP), "mismatch inner dest IPs: expected %s, got %s", test.expected.InnerDstIP.String(), actual.InnerDstIP.String()) - assert.Equal(t, test.expected.InnerSrcPort, actual.InnerSrcPort) - assert.Equal(t, test.expected.InnerDstPort, actual.InnerDstPort) - assert.Equal(t, test.expected.InnerSeqNum, actual.InnerSeqNum) - }) - } -} - func Test_parseTCP(t *testing.T) { - ipv4Header := createMockIPv4Header(srcIP, dstIP, 6) // 6 is TCP - tcpLayer := createMockTCPLayer(12345, 443, 28394, 12737, true, true, true) + ipv4Header := testutils.CreateMockIPv4Header(srcIP, dstIP, 6) // 6 is TCP + tcpLayer := testutils.CreateMockTCPLayer(12345, 443, 28394, 12737, true, true, true) // full packet - encodedTCPLayer, fullTCPPacket := createMockTCPPacket(ipv4Header, tcpLayer, false) + encodedTCPLayer, fullTCPPacket := testutils.CreateMockTCPPacket(ipv4Header, tcpLayer, false) tt := []struct { description string @@ -257,7 +166,7 @@ func Test_parseTCP(t *testing.T) { require.Nil(t, err) require.NotNil(t, actual) // assert.Equal doesn't handle net.IP well - assert.Equal(t, structFieldCount(test.expected), structFieldCount(actual)) + assert.Equal(t, testutils.StructFieldCount(test.expected), testutils.StructFieldCount(actual)) assert.Truef(t, test.expected.SrcIP.Equal(actual.SrcIP), "mismatch source IPs: expected %s, got %s", test.expected.SrcIP.String(), actual.SrcIP.String()) assert.Truef(t, test.expected.DstIP.Equal(actual.DstIP), "mismatch dest IPs: expected %s, got %s", test.expected.DstIP.String(), actual.DstIP.String()) assert.Equal(t, test.expected.TCPResponse, actual.TCPResponse) @@ -266,11 +175,11 @@ func Test_parseTCP(t *testing.T) { } func BenchmarkParseTCP(b *testing.B) { - ipv4Header := createMockIPv4Header(srcIP, dstIP, 6) // 6 is TCP - tcpLayer := createMockTCPLayer(12345, 443, 28394, 12737, true, true, true) + ipv4Header := testutils.CreateMockIPv4Header(srcIP, dstIP, 6) // 6 is TCP + tcpLayer := testutils.CreateMockTCPLayer(12345, 443, 28394, 12737, true, true, true) // full packet - _, fullTCPPacket := createMockTCPPacket(ipv4Header, tcpLayer, false) + _, fullTCPPacket := testutils.CreateMockTCPPacket(ipv4Header, tcpLayer, false) tp := newTCPParser() @@ -282,129 +191,3 @@ func BenchmarkParseTCP(b *testing.B) { } } } - -func createMockIPv4Header(srcIP, dstIP net.IP, protocol int) *ipv4.Header { - return &ipv4.Header{ - Version: 4, - Src: srcIP, - Dst: dstIP, - Protocol: protocol, - TTL: 64, - Len: 8, - } -} - -func createMockICMPPacket(ipLayer *layers.IPv4, icmpLayer *layers.ICMPv4, innerIP *layers.IPv4, innerTCP *layers.TCP, partialTCPHeader bool) []byte { - innerBuf := gopacket.NewSerializeBuffer() - opts := gopacket.SerializeOptions{FixLengths: true, ComputeChecksums: true} - - innerLayers := make([]gopacket.SerializableLayer, 0, 2) - if innerIP != nil { - innerLayers = append(innerLayers, innerIP) - } - if innerTCP != nil { - innerLayers = append(innerLayers, innerTCP) - if innerIP != nil { - innerTCP.SetNetworkLayerForChecksum(innerIP) - } - } - - gopacket.SerializeLayers(innerBuf, opts, - innerLayers..., - ) - payload := innerBuf.Bytes() - - // if partialTCP is set, truncate - // the payload to include only the - // first 8 bytes of the TCP header - if partialTCPHeader { - payload = payload[:32] - } - - buf := gopacket.NewSerializeBuffer() - gopacket.SerializeLayers(buf, opts, - icmpLayer, - gopacket.Payload(payload), - ) - - icmpBytes := buf.Bytes() - if ipLayer == nil { - return icmpBytes - } - - buf = gopacket.NewSerializeBuffer() - gopacket.SerializeLayers(buf, opts, - ipLayer, - gopacket.Payload(icmpBytes), - ) - - return buf.Bytes() -} - -func createMockTCPPacket(ipHeader *ipv4.Header, tcpLayer *layers.TCP, includeHeader bool) (*layers.TCP, []byte) { - ipLayer := &layers.IPv4{ - Version: 4, - SrcIP: ipHeader.Src, - DstIP: ipHeader.Dst, - Protocol: layers.IPProtocol(ipHeader.Protocol), - TTL: 64, - Length: 8, - } - tcpLayer.SetNetworkLayerForChecksum(ipLayer) - buf := gopacket.NewSerializeBuffer() - opts := gopacket.SerializeOptions{FixLengths: true, ComputeChecksums: true} - if includeHeader { - gopacket.SerializeLayers(buf, opts, - ipLayer, - tcpLayer, - ) - } else { - gopacket.SerializeLayers(buf, opts, - tcpLayer, - ) - } - - pkt := gopacket.NewPacket(buf.Bytes(), layers.LayerTypeTCP, gopacket.Default) - - // return encoded TCP layer here - return pkt.Layer(layers.LayerTypeTCP).(*layers.TCP), buf.Bytes() -} - -func createMockIPv4Layer(srcIP, dstIP net.IP, protocol layers.IPProtocol) *layers.IPv4 { - return &layers.IPv4{ - SrcIP: srcIP, - DstIP: dstIP, - Version: 4, - Protocol: protocol, - } -} - -func createMockICMPLayer(typeCode layers.ICMPv4TypeCode) *layers.ICMPv4 { - return &layers.ICMPv4{ - TypeCode: typeCode, - } -} - -func createMockTCPLayer(srcPort uint16, dstPort uint16, seqNum uint32, ackNum uint32, syn bool, ack bool, rst bool) *layers.TCP { - return &layers.TCP{ - SrcPort: layers.TCPPort(srcPort), - DstPort: layers.TCPPort(dstPort), - Seq: seqNum, - Ack: ackNum, - SYN: syn, - ACK: ack, - RST: rst, - } -} - -func structFieldCount(v interface{}) int { - val := reflect.ValueOf(v) - if val.Kind() == reflect.Ptr { - val = val.Elem() - } - if val.Kind() != reflect.Struct { - return -1 - } - - return val.NumField() -} diff --git a/pkg/networkpath/traceroute/tcp/utils_unix.go b/pkg/networkpath/traceroute/tcp/utils_unix.go index 2a52e5f8bea88..4fd1b2e4b251d 100644 --- a/pkg/networkpath/traceroute/tcp/utils_unix.go +++ b/pkg/networkpath/traceroute/tcp/utils_unix.go @@ -14,6 +14,7 @@ import ( "sync" "time" + "github.com/DataDog/datadog-agent/pkg/networkpath/traceroute/common" "github.com/DataDog/datadog-agent/pkg/util/log" "github.com/google/gopacket/layers" "go.uber.org/multierr" @@ -68,8 +69,8 @@ func listenPackets(icmpConn rawConnWrapper, tcpConn rawConnWrapper, timeout time wg.Wait() if tcpErr != nil && icmpErr != nil { - _, tcpCanceled := tcpErr.(canceledError) - _, icmpCanceled := icmpErr.(canceledError) + _, tcpCanceled := tcpErr.(common.CanceledError) + _, icmpCanceled := icmpErr.(common.CanceledError) if icmpCanceled && tcpCanceled { log.Trace("timed out waiting for responses") return net.IP{}, 0, 0, time.Time{}, nil @@ -103,7 +104,7 @@ func handlePackets(ctx context.Context, conn rawConnWrapper, listener string, lo for { select { case <-ctx.Done(): - return net.IP{}, 0, 0, time.Time{}, canceledError("listener canceled") + return net.IP{}, 0, 0, time.Time{}, common.CanceledError("listener canceled") default: } now := time.Now() @@ -127,12 +128,12 @@ func handlePackets(ctx context.Context, conn rawConnWrapper, listener string, lo // TODO: remove listener constraint and parse all packets // in the same function return a succinct struct here if listener == "icmp" { - icmpResponse, err := parseICMP(header, packet) + icmpResponse, err := common.ParseICMP(header, packet) if err != nil { log.Tracef("failed to parse ICMP packet: %s", err) continue } - if icmpMatch(localIP, localPort, remoteIP, remotePort, seqNum, icmpResponse) { + if common.ICMPMatch(localIP, localPort, remoteIP, remotePort, seqNum, icmpResponse) { return icmpResponse.SrcIP, 0, icmpResponse.TypeCode, received, nil } } else if listener == "tcp" { diff --git a/pkg/networkpath/traceroute/tcp/utils_unix_test.go b/pkg/networkpath/traceroute/tcp/utils_unix_test.go index 731f5affe1380..db78310723d28 100644 --- a/pkg/networkpath/traceroute/tcp/utils_unix_test.go +++ b/pkg/networkpath/traceroute/tcp/utils_unix_test.go @@ -19,6 +19,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "golang.org/x/net/ipv4" + + "github.com/DataDog/datadog-agent/pkg/networkpath/traceroute/testutils" ) type ( @@ -40,7 +42,7 @@ type ( ) func Test_handlePackets(t *testing.T) { - _, tcpBytes := createMockTCPPacket(createMockIPv4Header(dstIP, srcIP, 6), createMockTCPLayer(443, 12345, 28394, 28395, true, true, true), false) + _, tcpBytes := testutils.CreateMockTCPPacket(testutils.CreateMockIPv4Header(dstIP, srcIP, 6), testutils.CreateMockTCPLayer(443, 12345, 28394, 28395, true, true, true), false) tt := []struct { description string @@ -120,8 +122,8 @@ func Test_handlePackets(t *testing.T) { description: "successful ICMP parsing returns IP, port, and type code", ctxTimeout: 500 * time.Millisecond, conn: &mockRawConn{ - header: createMockIPv4Header(srcIP, dstIP, 1), - payload: createMockICMPPacket(nil, createMockICMPLayer(layers.ICMPv4CodeTTLExceeded), createMockIPv4Layer(innerSrcIP, innerDstIP, layers.IPProtocolTCP), createMockTCPLayer(12345, 443, 28394, 12737, true, true, true), false), + header: testutils.CreateMockIPv4Header(srcIP, dstIP, 1), + payload: testutils.CreateMockICMPPacket(nil, testutils.CreateMockICMPLayer(layers.ICMPv4CodeTTLExceeded), testutils.CreateMockIPv4Layer(innerSrcIP, innerDstIP, layers.IPProtocolTCP), testutils.CreateMockTCPLayer(12345, 443, 28394, 12737, true, true, true), false), }, localIP: innerSrcIP, localPort: 12345, @@ -137,7 +139,7 @@ func Test_handlePackets(t *testing.T) { description: "successful TCP parsing returns IP, port, and type code", ctxTimeout: 500 * time.Millisecond, conn: &mockRawConn{ - header: createMockIPv4Header(dstIP, srcIP, 6), + header: testutils.CreateMockIPv4Header(dstIP, srcIP, 6), payload: tcpBytes, }, localIP: srcIP, diff --git a/pkg/networkpath/traceroute/tcp/utils_windows.go b/pkg/networkpath/traceroute/tcp/utils_windows.go index 077495f43203e..483167109b6e4 100644 --- a/pkg/networkpath/traceroute/tcp/utils_windows.go +++ b/pkg/networkpath/traceroute/tcp/utils_windows.go @@ -16,6 +16,7 @@ import ( "golang.org/x/net/ipv4" "golang.org/x/sys/windows" + "github.com/DataDog/datadog-agent/pkg/networkpath/traceroute/common" "github.com/DataDog/datadog-agent/pkg/util/log" "github.com/google/gopacket/layers" ) @@ -49,7 +50,7 @@ func (w *winrawsocket) listenPackets(timeout time.Duration, localIP net.IP, loca wg.Wait() if icmpErr != nil { - _, icmpCanceled := icmpErr.(canceledError) + _, icmpCanceled := icmpErr.(common.CanceledError) if icmpCanceled { log.Trace("timed out waiting for responses") return net.IP{}, 0, 0, time.Time{}, nil @@ -74,7 +75,7 @@ func (w *winrawsocket) handlePackets(ctx context.Context, localIP net.IP, localP for { select { case <-ctx.Done(): - return net.IP{}, 0, 0, time.Time{}, canceledError("listener canceled") + return net.IP{}, 0, 0, time.Time{}, common.CanceledError("listener canceled") default: } @@ -110,12 +111,12 @@ func (w *winrawsocket) handlePackets(ctx context.Context, localIP net.IP, localP // TODO: remove listener constraint and parse all packets // in the same function return a succinct struct here if header.Protocol == windows.IPPROTO_ICMP { - icmpResponse, err := parseICMP(header, packet) + icmpResponse, err := common.ParseICMP(header, packet) if err != nil { log.Tracef("failed to parse ICMP packet: %s", err.Error()) continue } - if icmpMatch(localIP, localPort, remoteIP, remotePort, seqNum, icmpResponse) { + if common.ICMPMatch(localIP, localPort, remoteIP, remotePort, seqNum, icmpResponse) { return icmpResponse.SrcIP, 0, icmpResponse.TypeCode, received, nil } } else if header.Protocol == windows.IPPROTO_TCP { diff --git a/pkg/networkpath/traceroute/tcp/utils_windows_test.go b/pkg/networkpath/traceroute/tcp/utils_windows_test.go index 6e5b2a1c81ba4..6fbd7d0cc860b 100644 --- a/pkg/networkpath/traceroute/tcp/utils_windows_test.go +++ b/pkg/networkpath/traceroute/tcp/utils_windows_test.go @@ -18,6 +18,7 @@ import ( "golang.org/x/sys/windows" + "github.com/DataDog/datadog-agent/pkg/networkpath/traceroute/testutils" "github.com/google/gopacket/layers" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -34,7 +35,7 @@ type ( ) func Test_handlePackets(t *testing.T) { - _, tcpBytes := createMockTCPPacket(createMockIPv4Header(dstIP, srcIP, 6), createMockTCPLayer(443, 12345, 28394, 28395, true, true, true), true) + _, tcpBytes := testutils.CreateMockTCPPacket(testutils.CreateMockIPv4Header(dstIP, srcIP, 6), testutils.CreateMockTCPLayer(443, 12345, 28394, 28395, true, true, true), true) tt := []struct { description string @@ -92,7 +93,7 @@ func Test_handlePackets(t *testing.T) { description: "successful ICMP parsing returns IP, port, and type code", ctxTimeout: 500 * time.Millisecond, conn: &mockRawConn{ - payload: createMockICMPPacket(createMockIPv4Layer(srcIP, dstIP, layers.IPProtocolICMPv4), createMockICMPLayer(layers.ICMPv4CodeTTLExceeded), createMockIPv4Layer(innerSrcIP, innerDstIP, layers.IPProtocolTCP), createMockTCPLayer(12345, 443, 28394, 12737, true, true, true), false), + payload: testutils.CreateMockICMPPacket(testutils.CreateMockIPv4Layer(srcIP, dstIP, layers.IPProtocolICMPv4), testutils.CreateMockICMPLayer(layers.ICMPv4CodeTTLExceeded), testutils.CreateMockIPv4Layer(innerSrcIP, innerDstIP, layers.IPProtocolTCP), testutils.CreateMockTCPLayer(12345, 443, 28394, 12737, true, true, true), false), }, localIP: innerSrcIP, localPort: 12345, diff --git a/pkg/networkpath/traceroute/testutils/doc.go b/pkg/networkpath/traceroute/testutils/doc.go new file mode 100644 index 0000000000000..2a31e324c585c --- /dev/null +++ b/pkg/networkpath/traceroute/testutils/doc.go @@ -0,0 +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. + +// Package testutils contains utilities for testing traceroute code +package testutils diff --git a/pkg/networkpath/traceroute/testutils/testutils.go b/pkg/networkpath/traceroute/testutils/testutils.go new file mode 100644 index 0000000000000..e412d8971372b --- /dev/null +++ b/pkg/networkpath/traceroute/testutils/testutils.go @@ -0,0 +1,150 @@ +// 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 test + +package testutils + +import ( + "net" + "reflect" + + "github.com/google/gopacket" + "github.com/google/gopacket/layers" + "golang.org/x/net/ipv4" +) + +// CreateMockIPv4Header creates a mock IPv4 header for testing +func CreateMockIPv4Header(srcIP, dstIP net.IP, protocol int) *ipv4.Header { + return &ipv4.Header{ + Version: 4, + Src: srcIP, + Dst: dstIP, + Protocol: protocol, + TTL: 64, + Len: 8, + } +} + +// CreateMockICMPPacket creates a mock ICMP packet for testing +func CreateMockICMPPacket(ipLayer *layers.IPv4, icmpLayer *layers.ICMPv4, innerIP *layers.IPv4, innerTCP *layers.TCP, partialTCPHeader bool) []byte { + innerBuf := gopacket.NewSerializeBuffer() + opts := gopacket.SerializeOptions{FixLengths: true, ComputeChecksums: true} + + innerLayers := make([]gopacket.SerializableLayer, 0, 2) + if innerIP != nil { + innerLayers = append(innerLayers, innerIP) + } + if innerTCP != nil { + innerLayers = append(innerLayers, innerTCP) + if innerIP != nil { + innerTCP.SetNetworkLayerForChecksum(innerIP) // nolint: errcheck + } + } + + gopacket.SerializeLayers(innerBuf, opts, // nolint: errcheck + innerLayers..., + ) + payload := innerBuf.Bytes() + + // if partialTCP is set, truncate + // the payload to include only the + // first 8 bytes of the TCP header + if partialTCPHeader { + payload = payload[:32] + } + + buf := gopacket.NewSerializeBuffer() + gopacket.SerializeLayers(buf, opts, // nolint: errcheck + icmpLayer, + gopacket.Payload(payload), + ) + + icmpBytes := buf.Bytes() + if ipLayer == nil { + return icmpBytes + } + + buf = gopacket.NewSerializeBuffer() + gopacket.SerializeLayers(buf, opts, // nolint: errcheck + ipLayer, + gopacket.Payload(icmpBytes), + ) + + return buf.Bytes() +} + +// CreateMockTCPPacket creates a mock TCP packet for testing +func CreateMockTCPPacket(ipHeader *ipv4.Header, tcpLayer *layers.TCP, includeHeader bool) (*layers.TCP, []byte) { + ipLayer := &layers.IPv4{ + Version: 4, + SrcIP: ipHeader.Src, + DstIP: ipHeader.Dst, + Protocol: layers.IPProtocol(ipHeader.Protocol), + TTL: 64, + Length: 8, + } + tcpLayer.SetNetworkLayerForChecksum(ipLayer) // nolint: errcheck + buf := gopacket.NewSerializeBuffer() + opts := gopacket.SerializeOptions{FixLengths: true, ComputeChecksums: true} + if includeHeader { + gopacket.SerializeLayers(buf, opts, // nolint: errcheck + ipLayer, + tcpLayer, + ) + } else { + gopacket.SerializeLayers(buf, opts, // nolint: errcheck + tcpLayer, + ) + } + + pkt := gopacket.NewPacket(buf.Bytes(), layers.LayerTypeTCP, gopacket.Default) + + // return encoded TCP layer here + return pkt.Layer(layers.LayerTypeTCP).(*layers.TCP), buf.Bytes() +} + +// CreateMockIPv4Layer creates a mock IPv4 layer for testing +func CreateMockIPv4Layer(srcIP, dstIP net.IP, protocol layers.IPProtocol) *layers.IPv4 { + return &layers.IPv4{ + SrcIP: srcIP, + DstIP: dstIP, + Version: 4, + Protocol: protocol, + } +} + +// CreateMockICMPLayer creates a mock ICMP layer for testing +func CreateMockICMPLayer(typeCode layers.ICMPv4TypeCode) *layers.ICMPv4 { + return &layers.ICMPv4{ + TypeCode: typeCode, + } +} + +// CreateMockTCPLayer creates a mock TCP layer for testing +func CreateMockTCPLayer(srcPort uint16, dstPort uint16, seqNum uint32, ackNum uint32, syn bool, ack bool, rst bool) *layers.TCP { + return &layers.TCP{ + SrcPort: layers.TCPPort(srcPort), + DstPort: layers.TCPPort(dstPort), + Seq: seqNum, + Ack: ackNum, + SYN: syn, + ACK: ack, + RST: rst, + } +} + +// StructFieldCount returns the number of fields in a struct +func StructFieldCount(v interface{}) int { + val := reflect.ValueOf(v) + if val.Kind() == reflect.Ptr { + val = val.Elem() + } + if val.Kind() != reflect.Struct { + return -1 + } + + return val.NumField() +} 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/obfuscate/go.mod b/pkg/obfuscate/go.mod index 198c5c2fc5cfe..df547c8beb777 100644 --- a/pkg/obfuscate/go.mod +++ b/pkg/obfuscate/go.mod @@ -3,7 +3,7 @@ module github.com/DataDog/datadog-agent/pkg/obfuscate go 1.22.0 require ( - github.com/DataDog/datadog-go/v5 v5.5.0 + github.com/DataDog/datadog-go/v5 v5.6.0 github.com/DataDog/go-sqllexer v0.0.17 github.com/outcaste-io/ristretto v0.2.3 github.com/stretchr/testify v1.10.0 @@ -20,8 +20,8 @@ require ( github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/rogpeppe/go-internal v1.13.1 // indirect - golang.org/x/net v0.31.0 // indirect - golang.org/x/sys v0.27.0 // indirect + golang.org/x/net v0.33.0 // indirect + golang.org/x/sys v0.28.0 // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/pkg/obfuscate/go.sum b/pkg/obfuscate/go.sum index 7a042c0a114ed..87558fb1a5f79 100644 --- a/pkg/obfuscate/go.sum +++ b/pkg/obfuscate/go.sum @@ -1,5 +1,5 @@ -github.com/DataDog/datadog-go/v5 v5.5.0 h1:G5KHeB8pWBNXT4Jtw0zAkhdxEAWSpWH00geHI6LDrKU= -github.com/DataDog/datadog-go/v5 v5.5.0/go.mod h1:K9kcYBlxkcPP8tvvjZZKs/m1edNAUFzBbdpTUKfCsuw= +github.com/DataDog/datadog-go/v5 v5.6.0 h1:2oCLxjF/4htd55piM75baflj/KoE6VYS7alEUqFvRDw= +github.com/DataDog/datadog-go/v5 v5.6.0/go.mod h1:K9kcYBlxkcPP8tvvjZZKs/m1edNAUFzBbdpTUKfCsuw= github.com/DataDog/go-sqllexer v0.0.17 h1:u47fJAVg/+5DA74ZW3w0Qu+3qXHd3GtnA8ZBYixdPrM= github.com/DataDog/go-sqllexer v0.0.17/go.mod h1:KwkYhpFEVIq+BfobkTC1vfqm4gTi65skV/DpDBXtexc= github.com/Microsoft/go-winio v0.5.0/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= @@ -62,8 +62,8 @@ golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.31.0 h1:68CPQngjLL0r2AlUKiSxtQFKvzRVbnzLwMUn5SzcLHo= -golang.org/x/net v0.31.0/go.mod h1:P4fl1q7dY2hnZFxEk4pPSkDHF+QqjitcnDjUQyMM+pM= +golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= +golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -74,8 +74,8 @@ golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220627191245-f75cf1eec38b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.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= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= diff --git a/pkg/obfuscate/obfuscate.go b/pkg/obfuscate/obfuscate.go index dcccacbbb7210..84a0f38b2ec78 100644 --- a/pkg/obfuscate/obfuscate.go +++ b/pkg/obfuscate/obfuscate.go @@ -70,32 +70,32 @@ type Config struct { SQL SQLConfig // ES holds the obfuscation configuration for ElasticSearch bodies. - ES JSONConfig + ES JSONConfig `mapstructure:"elasticsearch"` // OpenSearch holds the obfuscation configuration for OpenSearch bodies. - OpenSearch JSONConfig + OpenSearch JSONConfig `mapstructure:"opensearch"` // Mongo holds the obfuscation configuration for MongoDB queries. - Mongo JSONConfig + Mongo JSONConfig `mapstructure:"mongodb"` // SQLExecPlan holds the obfuscation configuration for SQL Exec Plans. This is strictly for safety related obfuscation, // not normalization. Normalization of exec plans is configured in SQLExecPlanNormalize. - SQLExecPlan JSONConfig + SQLExecPlan JSONConfig `mapstructure:"sql_exec_plan"` // SQLExecPlanNormalize holds the normalization configuration for SQL Exec Plans. - SQLExecPlanNormalize JSONConfig + SQLExecPlanNormalize JSONConfig `mapstructure:"sql_exec_plan_normalize"` // HTTP holds the obfuscation settings for HTTP URLs. - HTTP HTTPConfig + HTTP HTTPConfig `mapstructure:"http"` // Redis holds the obfuscation settings for Redis commands. - Redis RedisConfig + Redis RedisConfig `mapstructure:"redis"` // Memcached holds the obfuscation settings for Memcached commands. - Memcached MemcachedConfig + Memcached MemcachedConfig `mapstructure:"memcached"` // Memcached holds the obfuscation settings for obfuscation of CC numbers in meta. - CreditCard CreditCardsConfig + CreditCard CreditCardsConfig `mapstructure:"credit_cards"` // Statsd specifies the statsd client to use for reporting metrics. Statsd StatsClient @@ -105,7 +105,7 @@ type Config struct { Logger Logger // Cache enables the query cache for obfuscation for SQL and MongoDB queries. - Cache CacheConfig + Cache CacheConfig `mapstructure:"cache"` } // StatsClient implementations are able to emit stats. diff --git a/pkg/orchestrator/model/go.mod b/pkg/orchestrator/model/go.mod index 1ae7dce9631db..f941c7960e5ae 100644 --- a/pkg/orchestrator/model/go.mod +++ b/pkg/orchestrator/model/go.mod @@ -14,8 +14,10 @@ require ( 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/kr/text v0.2.0 // indirect go.uber.org/atomic v1.11.0 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect ) + +replace github.com/DataDog/datadog-agent/pkg/version => ../../version diff --git a/pkg/orchestrator/model/go.sum b/pkg/orchestrator/model/go.sum index a1eb366cd0a06..01c4e89a188d8 100644 --- a/pkg/orchestrator/model/go.sum +++ b/pkg/orchestrator/model/go.sum @@ -1,6 +1,5 @@ github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 h1:kHaBemcxl8o/pQ5VM1c8PVE1PubbNx3mjUr09OqWGCs= github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575/go.mod h1:9d6lWj8KzO/fd/NrVaLscBKmPigpZpn5YawRPw+e3Yo= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= 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/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= @@ -20,7 +19,5 @@ go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0 gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 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/metadata/parser/service.go b/pkg/process/metadata/parser/service.go index a2ef465a410a7..bacff8563b51c 100644 --- a/pkg/process/metadata/parser/service.go +++ b/pkg/process/metadata/parser/service.go @@ -14,7 +14,6 @@ import ( "unicode" "github.com/Masterminds/semver" - "github.com/cihub/seelog" "github.com/DataDog/datadog-agent/pkg/process/metadata" javaparser "github.com/DataDog/datadog-agent/pkg/process/metadata/parser/java" @@ -109,7 +108,7 @@ func (d *ServiceExtractor) Extract(processes map[int32]*procutil.Process) { } } meta := d.extractServiceMetadata(proc) - if meta != nil && log.ShouldLog(seelog.TraceLvl) { + if meta != nil && log.ShouldLog(log.TraceLvl) { log.Tracef("detected service metadata: %v", meta) } serviceByPID[proc.Pid] = meta @@ -132,7 +131,7 @@ func (d *ServiceExtractor) GetServiceContext(pid int32) []string { // Service tag was found from the SCM, return it. if len(tags) > 0 { - if log.ShouldLog(seelog.TraceLvl) { + if log.ShouldLog(log.TraceLvl) { log.Tracef("Found process_context from SCM for pid:%v service tags:%v", pid, tags) } return tags diff --git a/pkg/process/monitor/process_monitor.go b/pkg/process/monitor/process_monitor.go index 8710aa63e324f..cdc1770ddb488 100644 --- a/pkg/process/monitor/process_monitor.go +++ b/pkg/process/monitor/process_monitor.go @@ -14,14 +14,12 @@ import ( "sync" "time" - "github.com/cihub/seelog" "github.com/vishvananda/netlink" "go.uber.org/atomic" - "github.com/DataDog/datadog-agent/pkg/eventmonitor" + "github.com/DataDog/datadog-agent/pkg/eventmonitor/consumers" "github.com/DataDog/datadog-agent/pkg/network/protocols/telemetry" "github.com/DataDog/datadog-agent/pkg/runtime" - "github.com/DataDog/datadog-agent/pkg/security/secl/model" "github.com/DataDog/datadog-agent/pkg/util/kernel" "github.com/DataDog/datadog-agent/pkg/util/log" ) @@ -177,7 +175,7 @@ func (pm *ProcessMonitor) handleProcessExec(pid uint32) { continue default: pm.tel.processExecChannelIsFull.Add(1) - if log.ShouldLog(seelog.DebugLvl) && pm.oversizedLogLimit.ShouldLog() { + if log.ShouldLog(log.DebugLvl) && pm.oversizedLogLimit.ShouldLog() { log.Debug("can't send exec callback to callbackRunner, channel is full") } } @@ -197,7 +195,7 @@ func (pm *ProcessMonitor) handleProcessExit(pid uint32) { continue default: pm.tel.processExitChannelIsFull.Add(1) - if log.ShouldLog(seelog.DebugLvl) && pm.oversizedLogLimit.ShouldLog() { + if log.ShouldLog(log.DebugLvl) && pm.oversizedLogLimit.ShouldLog() { log.Debug("can't send exit callback to callbackRunner, channel is full") } } @@ -221,7 +219,10 @@ func (pm *ProcessMonitor) initNetlinkProcessEventMonitor() error { // initCallbackRunner runs multiple workers that run tasks sent over a queue. func (pm *ProcessMonitor) initCallbackRunner() { - cpuNum := runtime.NumVCPU() + cpuNum, err := kernel.PossibleCPUs() + if err != nil { + cpuNum = runtime.NumVCPU() + } pm.callbackRunner = make(chan func(), pendingCallbacksQueueSize) pm.callbackRunnerStopChannel = make(chan struct{}) pm.callbackRunnersWG.Add(cpuNum) @@ -487,76 +488,20 @@ func (pm *ProcessMonitor) Stop() { pm.processExitCallbacksMutex.Unlock() } -// Event defines the event used by the process monitor -type Event struct { - Type model.EventType - Pid uint32 -} - -// EventConsumer defines an event consumer to handle event monitor events in the -// process monitor -type EventConsumer struct{} - -// NewProcessMonitorEventConsumer returns a new process monitor event consumer -func NewProcessMonitorEventConsumer(em *eventmonitor.EventMonitor) (*EventConsumer, error) { - consumer := &EventConsumer{} - err := em.AddEventConsumerHandler(consumer) - return consumer, err -} - -// ChanSize returns the channel size used by this consumer -func (ec *EventConsumer) ChanSize() int { - return 500 -} - -// ID returns the ID of this consumer -func (ec *EventConsumer) ID() string { - return "PROCESS_MONITOR" -} - -// Start the consumer -func (ec *EventConsumer) Start() error { - return nil -} - -// Stop the consumer -func (ec *EventConsumer) Stop() { -} - -// EventTypes returns the event types handled by this consumer -func (ec *EventConsumer) EventTypes() []model.EventType { - return []model.EventType{ - model.ExecEventType, - model.ExitEventType, - } -} - -// HandleEvent handles events received from the event monitor -func (ec *EventConsumer) HandleEvent(event any) { - sevent, ok := event.(*Event) - if !ok { - return - } - - processMonitor.tel.events.Add(1) - switch sevent.Type { - case model.ExecEventType: +// InitializeEventConsumer initializes the event consumer with the event handling. +func InitializeEventConsumer(consumer *consumers.ProcessConsumer) { + consumer.SubscribeExec(func(pid uint32) { + processMonitor.tel.events.Add(1) processMonitor.tel.exec.Add(1) if processMonitor.hasExecCallbacks.Load() { - processMonitor.handleProcessExec(sevent.Pid) + processMonitor.handleProcessExec(pid) } - case model.ExitEventType: + }) + consumer.SubscribeExit(func(pid uint32) { + processMonitor.tel.events.Add(1) processMonitor.tel.exit.Add(1) if processMonitor.hasExitCallbacks.Load() { - processMonitor.handleProcessExit(sevent.Pid) + processMonitor.handleProcessExit(pid) } - } -} - -// Copy should copy the given event or return nil to discard it -func (ec *EventConsumer) Copy(event *model.Event) any { - return &Event{ - Type: event.GetEventType(), - Pid: event.GetProcessPid(), - } + }) } diff --git a/pkg/process/monitor/process_monitor_test.go b/pkg/process/monitor/process_monitor_test.go index 0fe9e80bd21cb..c03cf721aaafc 100644 --- a/pkg/process/monitor/process_monitor_test.go +++ b/pkg/process/monitor/process_monitor_test.go @@ -19,13 +19,10 @@ import ( "github.com/vishvananda/netns" "go.uber.org/atomic" - "github.com/DataDog/datadog-agent/pkg/eventmonitor" - eventmonitortestutil "github.com/DataDog/datadog-agent/pkg/eventmonitor/testutil" + "github.com/DataDog/datadog-agent/pkg/eventmonitor/consumers/testutil" "github.com/DataDog/datadog-agent/pkg/network/protocols/telemetry" - "github.com/DataDog/datadog-agent/pkg/security/utils" "github.com/DataDog/datadog-agent/pkg/util" "github.com/DataDog/datadog-agent/pkg/util/kernel" - "github.com/DataDog/datadog-agent/pkg/util/log" ) func getProcessMonitor(t *testing.T) *ProcessMonitor { @@ -40,12 +37,12 @@ func getProcessMonitor(t *testing.T) *ProcessMonitor { func waitForProcessMonitor(t *testing.T, pm *ProcessMonitor) { execCounter := atomic.NewInt32(0) execCallback := func(_ uint32) { execCounter.Inc() } - registerCallback(t, pm, true, (*ProcessCallback)(&execCallback)) + registerCallback(t, pm, true, &execCallback) exitCounter := atomic.NewInt32(0) // Sanity subscribing a callback. exitCallback := func(_ uint32) { exitCounter.Inc() } - registerCallback(t, pm, false, (*ProcessCallback)(&exitCallback)) + registerCallback(t, pm, false, &exitCallback) require.Eventually(t, func() bool { _ = exec.Command("/bin/echo").Run() @@ -56,14 +53,7 @@ func waitForProcessMonitor(t *testing.T, pm *ProcessMonitor) { func initializePM(t *testing.T, pm *ProcessMonitor, useEventStream bool) { require.NoError(t, pm.Initialize(useEventStream)) if useEventStream { - utils.SetCachedHostname("test-hostname") - eventmonitortestutil.StartEventMonitor(t, func(t *testing.T, evm *eventmonitor.EventMonitor) { - // Can't use the implementation in procmontestutil due to import cycles - procmonconsumer, err := NewProcessMonitorEventConsumer(evm) - require.NoError(t, err) - evm.RegisterEventConsumer(procmonconsumer) - log.Info("process monitoring test consumer initialized") - }) + InitializeEventConsumer(testutil.NewTestProcessConsumer(t)) } waitForProcessMonitor(t, pm) } @@ -113,7 +103,7 @@ func (s *processMonitorSuite) TestProcessMonitorSanity() { defer execsMutex.Unlock() execs[pid] = struct{}{} } - registerCallback(t, pm, true, (*ProcessCallback)(&callback)) + registerCallback(t, pm, true, &callback) exitMutex := sync.RWMutex{} exits := make(map[uint32]struct{}) @@ -122,7 +112,7 @@ func (s *processMonitorSuite) TestProcessMonitorSanity() { defer exitMutex.Unlock() exits[pid] = struct{}{} } - registerCallback(t, pm, false, (*ProcessCallback)(&exitCallback)) + registerCallback(t, pm, false, &exitCallback) initializePM(t, pm, s.useEventStream) cmd := exec.Command(testBinaryPath, "test") @@ -182,7 +172,7 @@ func (s *processMonitorSuite) TestProcessRegisterMultipleCallbacks() { defer execCountersMutexes[i].Unlock() c[pid] = struct{}{} } - registerCallback(t, pm, true, (*ProcessCallback)(&callback)) + registerCallback(t, pm, true, &callback) exitCountersMutexes[i] = sync.RWMutex{} exitCounters[i] = make(map[uint32]struct{}) @@ -193,7 +183,7 @@ func (s *processMonitorSuite) TestProcessRegisterMultipleCallbacks() { defer exitCountersMutexes[i].Unlock() exitc[pid] = struct{}{} } - registerCallback(t, pm, false, (*ProcessCallback)(&exitCallback)) + registerCallback(t, pm, false, &exitCallback) } initializePM(t, pm, s.useEventStream) @@ -252,10 +242,10 @@ func (s *processMonitorSuite) TestProcessMonitorInNamespace() { pm := getProcessMonitor(t) callback := func(pid uint32) { execSet.Store(pid, struct{}{}) } - registerCallback(t, pm, true, (*ProcessCallback)(&callback)) + registerCallback(t, pm, true, &callback) exitCallback := func(pid uint32) { exitSet.Store(pid, struct{}{}) } - registerCallback(t, pm, false, (*ProcessCallback)(&exitCallback)) + registerCallback(t, pm, false, &exitCallback) monNs, err := netns.New() require.NoError(t, err, "could not create network namespace for process monitor") diff --git a/pkg/process/monitor/testutil/testutil.go b/pkg/process/monitor/testutil/testutil.go deleted file mode 100644 index d270faec3968f..0000000000000 --- a/pkg/process/monitor/testutil/testutil.go +++ /dev/null @@ -1,27 +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 && test - -// Package testutil provides utilities for testing the process monitor -package testutil - -import ( - "testing" - - "github.com/stretchr/testify/require" - - "github.com/DataDog/datadog-agent/pkg/eventmonitor" - procmon "github.com/DataDog/datadog-agent/pkg/process/monitor" - "github.com/DataDog/datadog-agent/pkg/util/log" -) - -// RegisterProcessMonitorEventConsumer registers the process monitor consumer to an EventMonitor -func RegisterProcessMonitorEventConsumer(t *testing.T, evm *eventmonitor.EventMonitor) { - procmonconsumer, err := procmon.NewProcessMonitorEventConsumer(evm) - require.NoError(t, err) - evm.RegisterEventConsumer(procmonconsumer) - log.Info("process monitoring test consumer initialized") -} 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_linux_test.go b/pkg/process/procutil/process_linux_test.go index 7684ed119720e..646984befc8c6 100644 --- a/pkg/process/procutil/process_linux_test.go +++ b/pkg/process/procutil/process_linux_test.go @@ -16,6 +16,7 @@ import ( "testing" "time" + //nolint:depguard // disable logs from DataDog/gopsutil "github.com/cihub/seelog" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" 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/process/util/api/go.mod b/pkg/process/util/api/go.mod index 1dd6ead89c7a2..f76e70cb9ee0f 100644 --- a/pkg/process/util/api/go.mod +++ b/pkg/process/util/api/go.mod @@ -11,7 +11,7 @@ replace ( ) require ( - github.com/DataDog/agent-payload/v5 v5.0.137 + github.com/DataDog/agent-payload/v5 v5.0.138 github.com/DataDog/datadog-agent/pkg/telemetry v0.56.0-rc.3 github.com/gogo/protobuf v1.3.2 github.com/stretchr/testify v1.10.0 @@ -43,7 +43,7 @@ require ( go.uber.org/fx v1.23.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect - golang.org/x/sys v0.27.0 // indirect + golang.org/x/sys v0.28.0 // indirect google.golang.org/protobuf v1.35.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/pkg/process/util/api/go.sum b/pkg/process/util/api/go.sum index fbced0de8d3fe..7343a1cf6d04e 100644 --- a/pkg/process/util/api/go.sum +++ b/pkg/process/util/api/go.sum @@ -1,5 +1,5 @@ -github.com/DataDog/agent-payload/v5 v5.0.137 h1:nV02RrYj6AwlQBGIEv6yG23CuxGtG0YWoFZAVE6vwxY= -github.com/DataDog/agent-payload/v5 v5.0.137/go.mod h1:lxh9lb5xYrBXjblpIWYUi4deJqVbkIfkjwesi5nskDc= +github.com/DataDog/agent-payload/v5 v5.0.138 h1:Wg7hmWuoLC/o0X3zZ+uGcfRHPyaytljudgSY9O59zjc= +github.com/DataDog/agent-payload/v5 v5.0.138/go.mod h1:lxh9lb5xYrBXjblpIWYUi4deJqVbkIfkjwesi5nskDc= 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/zstd v1.5.6 h1:LbEglqepa/ipmmQJUDnSsfvA8e8IStVcGaFWDuxvGOY= @@ -79,8 +79,8 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.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/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= diff --git a/pkg/process/util/containers/containers.go b/pkg/process/util/containers/containers.go index 2beafeced27f5..c5ad7cae1c9b3 100644 --- a/pkg/process/util/containers/containers.go +++ b/pkg/process/util/containers/containers.go @@ -120,7 +120,7 @@ func (p *containerProvider) GetContainers(cacheValidity time.Duration, previousC annotations = pod.Annotations } - if p.filter != nil && p.filter.IsExcluded(annotations, container.Name, container.Image.Name, container.Labels[kubernetes.CriContainerNamespaceLabel]) { + if p.filter != nil && p.filter.IsExcluded(annotations, container.Name, container.Image.RawName, container.Labels[kubernetes.CriContainerNamespaceLabel]) { continue } @@ -209,7 +209,7 @@ func (p *containerProvider) GetPidToCid(cacheValidity time.Duration) map[int]str annotations = pod.Annotations } - if p.filter != nil && p.filter.IsExcluded(annotations, container.Name, container.Image.Name, container.Labels[kubernetes.CriContainerNamespaceLabel]) { + if p.filter != nil && p.filter.IsExcluded(annotations, container.Name, container.Image.RawName, container.Labels[kubernetes.CriContainerNamespaceLabel]) { continue } diff --git a/pkg/proto/datadog/api/v1/api.proto b/pkg/proto/datadog/api/v1/api.proto index f6c16ff4cc45e..2d03883d00cf0 100644 --- a/pkg/proto/datadog/api/v1/api.proto +++ b/pkg/proto/datadog/api/v1/api.proto @@ -6,6 +6,7 @@ import "datadog/model/v1/model.proto"; import "datadog/remoteagent/remoteagent.proto"; import "datadog/remoteconfig/remoteconfig.proto"; import "datadog/workloadmeta/workloadmeta.proto"; +import "datadog/autodiscovery/autodiscovery.proto"; import "google/api/annotations.proto"; import "google/protobuf/empty.proto"; @@ -50,6 +51,22 @@ service AgentSecure { }; }; + // Generates a container ID from Origin Info. + // can be called through the HTTP gateway, and entity will be returned as JSON: + // $ curl -H "authorization: Bearer $(cat /etc/datadog-agent/auth_token)" \ + // -XPOST -k -H "Content-Type: application/json" \ + // --data '{"externalData": {"init": false,"containerName": "dd-trace-py","podUID": "c4b45c6a-b296-4bd5-88df-7c2d6bcaabef"}}' \ + // https://localhost:5001/v1/grpc/tagger/generate_container_id_from_origin_info + // { + // "containerID":"c9fd60251b5237467462dad48999815eb0025f367c6e1abe91e0bd787d5915fc" + // } + rpc TaggerGenerateContainerIDFromOriginInfo(datadog.model.v1.GenerateContainerIDFromOriginInfoRequest) returns (datadog.model.v1.GenerateContainerIDFromOriginInfoResponse) { + option (google.api.http) = { + post: "/v1/grpc/tagger/generate_container_id_from_origin_info" + body: "*" + }; + }; + // fetches an entity from the Tagger with the desired cardinality tags. // can be called through the HTTP gateway, and entity will be returned as JSON: // $ curl -H "authorization: Bearer $(cat /etc/datadog-agent/auth_token)" \ @@ -153,6 +170,14 @@ service AgentSecure { body: "*" }; }; + + // Subscribes to autodiscovery config updates + rpc AutodiscoveryStreamConfig(google.protobuf.Empty) returns (stream datadog.autodiscovery.AutodiscoveryStreamResponse) { + option (google.api.http) = { + post: "/v1/grpc/autodiscovery/stream_configs" + body: "*" + }; + }; } // Service exposed by remote agents to allow querying by the Core Agent. diff --git a/pkg/proto/datadog/autodiscovery/autodiscovery.proto b/pkg/proto/datadog/autodiscovery/autodiscovery.proto new file mode 100644 index 0000000000000..2419747504513 --- /dev/null +++ b/pkg/proto/datadog/autodiscovery/autodiscovery.proto @@ -0,0 +1,44 @@ +syntax = "proto3"; + +package datadog.autodiscovery; + +option go_package = "pkg/proto/pbgo/core"; // golang\ + +enum ConfigEventType { + SCHEDULE = 0; + UNSCHEDULE = 1; +} + +message KubeNamespacedName { + string name = 1; + string namespace = 2; +} + +message AdvancedADIdentifier { + KubeNamespacedName kubeService = 1; + KubeNamespacedName kubeEndpoints = 2; +} + +message Config { + string name = 1; + repeated bytes instances = 2; + bytes initConfig = 3; + bytes metricConfig = 4; + bytes logsConfig = 5; + repeated string adIdentifiers = 6; + repeated AdvancedADIdentifier advancedAdIdentifiers = 7; + string provider = 8; + string serviceId = 9; + string taggerEntity = 10; + bool clusterCheck = 11; + string nodeName = 12; + string source = 13; + bool ignoreAutodiscoveryTags = 14; + bool metricsExcluded = 15; + bool logsExcluded = 16; + ConfigEventType eventType = 17; +} + +message AutodiscoveryStreamResponse { + repeated Config configs = 1; +} diff --git a/pkg/proto/datadog/model/v1/model.proto b/pkg/proto/datadog/model/v1/model.proto index 506f90fa95702..2d4f96d208483 100644 --- a/pkg/proto/datadog/model/v1/model.proto +++ b/pkg/proto/datadog/model/v1/model.proto @@ -73,6 +73,30 @@ message Entity { repeated string standardTags = 6; } +message GenerateContainerIDFromOriginInfoRequest { + // Nested message for the local data + message LocalData { + optional uint32 processID = 1; // Process ID of the container process on the host. + optional string containerID = 2; // Container ID send from the client. + optional uint64 inode = 3; // Cgroup inode of the container. + optional string podUID = 4; // Pod UID send from the client. + } + + // Nested message for the external data + message ExternalData { + optional bool init = 1; // Init is true if the container is an init container. + optional string containerName = 2; // Container name in the Kubernetes Pod spec. + optional string podUID = 3; // Pod UID in the Kubernetes Pod spec. + } + + optional LocalData localData = 1; // Local data for the container, generated by the client. + optional ExternalData externalData = 2; // External data for the container, generated by the Admission Controller. +} + +message GenerateContainerIDFromOriginInfoResponse { + string containerID = 1; +} + message FetchEntityRequest { EntityId id = 1; TagCardinality cardinality = 2; diff --git a/pkg/proto/go.mod b/pkg/proto/go.mod index a32e4765c7eef..890f1f5360dcf 100644 --- a/pkg/proto/go.mod +++ b/pkg/proto/go.mod @@ -9,6 +9,7 @@ require ( github.com/golang/protobuf v1.5.4 github.com/google/gofuzz v1.2.0 github.com/grpc-ecosystem/grpc-gateway v1.16.0 + github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 github.com/stretchr/testify v1.10.0 github.com/tinylib/msgp v1.2.4 github.com/vmihailenco/msgpack/v4 v4.3.13 @@ -24,9 +25,9 @@ require ( github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/rogpeppe/go-internal v1.13.1 // indirect github.com/vmihailenco/tagparser v0.1.2 // indirect - golang.org/x/net v0.31.0 // indirect - golang.org/x/sys v0.27.0 // indirect - golang.org/x/text v0.20.0 // indirect + golang.org/x/net v0.33.0 // indirect + golang.org/x/sys v0.28.0 // indirect + golang.org/x/text v0.21.0 // indirect google.golang.org/appengine v1.6.8 // indirect google.golang.org/genproto v0.0.0-20240903143218-8af14fe29dc1 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect diff --git a/pkg/proto/go.sum b/pkg/proto/go.sum index f8c2e6a2fb3ba..bbbf81762e92d 100644 --- a/pkg/proto/go.sum +++ b/pkg/proto/go.sum @@ -48,6 +48,8 @@ github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/philhofer/fwd v1.1.3-0.20240916144458-20a13a1f6b7c h1:dAMKvw0MlJT1GshSTtih8C2gDs04w8dReiOGXrGLNoY= github.com/philhofer/fwd v1.1.3-0.20240916144458-20a13a1f6b7c/go.mod h1:RqIHx9QI14HlwKwm98g9Re5prTQ6LdeRQn+gXJFxsJM= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= +github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 h1:GFCKgmp0tecUJ0sJuv4pzYCqS9+RGSn52M3FUwPs+uo= +github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10/go.mod h1:t/avpk3KcrXxUnYOhZhMXJlSEyie6gQbtLq5NM3loB8= 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/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -89,8 +91,8 @@ golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.31.0 h1:68CPQngjLL0r2AlUKiSxtQFKvzRVbnzLwMUn5SzcLHo= -golang.org/x/net v0.31.0/go.mod h1:P4fl1q7dY2hnZFxEk4pPSkDHF+QqjitcnDjUQyMM+pM= +golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= +golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -109,8 +111,8 @@ golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.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= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -118,8 +120,8 @@ golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= -golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= -golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= diff --git a/pkg/proto/pbgo/core/api.pb.go b/pkg/proto/pbgo/core/api.pb.go index 87ed4b2b3620e..86c3b100390c1 100644 --- a/pkg/proto/pbgo/core/api.pb.go +++ b/pkg/proto/pbgo/core/api.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.0 +// protoc-gen-go v1.35.2 // protoc v5.26.1 // source: datadog/api/v1/api.proto @@ -40,183 +40,217 @@ var file_datadog_api_v1_api_proto_rawDesc = []byte{ 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x27, 0x64, 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, 0x2f, 0x77, 0x6f, 0x72, 0x6b, 0x6c, 0x6f, 0x61, 0x64, 0x6d, 0x65, 0x74, 0x61, 0x2f, 0x77, 0x6f, 0x72, 0x6b, 0x6c, 0x6f, 0x61, 0x64, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, - 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, - 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0x71, 0x0a, 0x05, - 0x41, 0x67, 0x65, 0x6e, 0x74, 0x12, 0x68, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x48, 0x6f, 0x73, 0x74, - 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x21, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, 0x2e, 0x6d, - 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x64, 0x6f, - 0x67, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x6f, 0x73, 0x74, 0x6e, - 0x61, 0x6d, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x15, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0f, - 0x12, 0x0d, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x68, 0x6f, 0x73, 0x74, 0x32, - 0xe2, 0x0b, 0x0a, 0x0b, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x53, 0x65, 0x63, 0x75, 0x72, 0x65, 0x12, - 0x8f, 0x01, 0x0a, 0x14, 0x54, 0x61, 0x67, 0x67, 0x65, 0x72, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, - 0x45, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x12, 0x23, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x64, + 0x6f, 0x1a, 0x29, 0x64, 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, 0x2f, 0x61, 0x75, 0x74, 0x6f, 0x64, + 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2f, 0x61, 0x75, 0x74, 0x6f, 0x64, 0x69, 0x73, + 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, + 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0x71, 0x0a, 0x05, 0x41, 0x67, 0x65, 0x6e, 0x74, + 0x12, 0x68, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x48, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x12, + 0x21, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, + 0x76, 0x31, 0x2e, 0x48, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, 0x2e, 0x6d, 0x6f, 0x64, + 0x65, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x65, + 0x70, 0x6c, 0x79, 0x22, 0x15, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0f, 0x12, 0x0d, 0x2f, 0x76, 0x31, + 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x68, 0x6f, 0x73, 0x74, 0x32, 0xe8, 0x0e, 0x0a, 0x0b, 0x41, + 0x67, 0x65, 0x6e, 0x74, 0x53, 0x65, 0x63, 0x75, 0x72, 0x65, 0x12, 0x8f, 0x01, 0x0a, 0x14, 0x54, + 0x61, 0x67, 0x67, 0x65, 0x72, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x45, 0x6e, 0x74, 0x69, 0x74, + 0x69, 0x65, 0x73, 0x12, 0x23, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, 0x2e, 0x6d, 0x6f, + 0x64, 0x65, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x54, 0x61, 0x67, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x72, 0x65, - 0x61, 0x6d, 0x54, 0x61, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, - 0x64, 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x76, 0x31, - 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x54, 0x61, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x2a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x24, 0x3a, 0x01, 0x2a, 0x22, 0x1f, - 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x61, 0x67, 0x67, 0x65, 0x72, 0x2f, - 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x5f, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x30, - 0x01, 0x12, 0x89, 0x01, 0x0a, 0x11, 0x54, 0x61, 0x67, 0x67, 0x65, 0x72, 0x46, 0x65, 0x74, 0x63, - 0x68, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x24, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x64, 0x6f, - 0x67, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x65, 0x74, 0x63, 0x68, - 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, - 0x64, 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x76, 0x31, - 0x2e, 0x46, 0x65, 0x74, 0x63, 0x68, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x27, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x21, 0x3a, 0x01, 0x2a, 0x22, - 0x1c, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x61, 0x67, 0x67, 0x65, 0x72, - 0x2f, 0x66, 0x65, 0x74, 0x63, 0x68, 0x5f, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x9b, 0x01, - 0x0a, 0x17, 0x44, 0x6f, 0x67, 0x73, 0x74, 0x61, 0x74, 0x73, 0x64, 0x43, 0x61, 0x70, 0x74, 0x75, - 0x72, 0x65, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x12, 0x27, 0x2e, 0x64, 0x61, 0x74, 0x61, - 0x64, 0x6f, 0x67, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x70, - 0x74, 0x75, 0x72, 0x65, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, 0x2e, 0x6d, 0x6f, 0x64, - 0x65, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x70, 0x74, 0x75, 0x72, 0x65, 0x54, 0x72, 0x69, - 0x67, 0x67, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2d, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x27, 0x3a, 0x01, 0x2a, 0x22, 0x22, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x72, 0x70, - 0x63, 0x2f, 0x64, 0x6f, 0x67, 0x73, 0x74, 0x61, 0x74, 0x73, 0x64, 0x2f, 0x63, 0x61, 0x70, 0x74, - 0x75, 0x72, 0x65, 0x2f, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x12, 0x8c, 0x01, 0x0a, 0x17, - 0x44, 0x6f, 0x67, 0x73, 0x74, 0x61, 0x74, 0x73, 0x64, 0x53, 0x65, 0x74, 0x54, 0x61, 0x67, 0x67, - 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x1d, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x64, 0x6f, - 0x67, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x61, 0x67, 0x67, 0x65, - 0x72, 0x53, 0x74, 0x61, 0x74, 0x65, 0x1a, 0x25, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, - 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x61, 0x67, 0x67, 0x65, 0x72, - 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2b, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x25, 0x3a, 0x01, 0x2a, 0x22, 0x20, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x72, - 0x70, 0x63, 0x2f, 0x64, 0x6f, 0x67, 0x73, 0x74, 0x61, 0x74, 0x73, 0x64, 0x2f, 0x63, 0x61, 0x70, - 0x74, 0x75, 0x72, 0x65, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x8f, 0x01, 0x0a, 0x10, 0x43, - 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x12, - 0x27, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x64, - 0x6f, 0x67, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, - 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x28, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x3a, 0x01, 0x2a, 0x22, 0x1d, 0x2f, - 0x76, 0x31, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x63, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x12, 0x78, 0x0a, 0x0e, - 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x16, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x26, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, - 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, - 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x26, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x3a, 0x01, 0x2a, 0x22, 0x1b, 0x2f, 0x76, 0x31, 0x2f, 0x67, - 0x72, 0x70, 0x63, 0x2f, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x2f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x94, 0x01, 0x0a, 0x12, 0x43, 0x6c, 0x69, 0x65, 0x6e, - 0x74, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x48, 0x41, 0x12, 0x27, 0x2e, - 0x64, 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x43, - 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, - 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x47, 0x65, - 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x61, 0x6d, 0x54, 0x61, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2a, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x24, 0x3a, 0x01, 0x2a, 0x22, 0x1f, 0x2f, 0x76, 0x31, 0x2f, 0x67, + 0x72, 0x70, 0x63, 0x2f, 0x74, 0x61, 0x67, 0x67, 0x65, 0x72, 0x2f, 0x73, 0x74, 0x72, 0x65, 0x61, + 0x6d, 0x5f, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x30, 0x01, 0x12, 0xe5, 0x01, 0x0a, + 0x27, 0x54, 0x61, 0x67, 0x67, 0x65, 0x72, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x43, + 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x44, 0x46, 0x72, 0x6f, 0x6d, 0x4f, 0x72, + 0x69, 0x67, 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x3a, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x64, + 0x6f, 0x67, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x6e, 0x65, + 0x72, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x44, 0x46, + 0x72, 0x6f, 0x6d, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3b, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, 0x2e, 0x6d, + 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, + 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x44, 0x46, 0x72, 0x6f, 0x6d, 0x4f, + 0x72, 0x69, 0x67, 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x41, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3b, 0x3a, 0x01, 0x2a, 0x22, 0x36, 0x2f, 0x76, + 0x31, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x61, 0x67, 0x67, 0x65, 0x72, 0x2f, 0x67, 0x65, + 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, + 0x5f, 0x69, 0x64, 0x5f, 0x66, 0x72, 0x6f, 0x6d, 0x5f, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x5f, + 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x89, 0x01, 0x0a, 0x11, 0x54, 0x61, 0x67, 0x67, 0x65, 0x72, 0x46, + 0x65, 0x74, 0x63, 0x68, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x24, 0x2e, 0x64, 0x61, 0x74, + 0x61, 0x64, 0x6f, 0x67, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x65, + 0x74, 0x63, 0x68, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x25, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, + 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x65, 0x74, 0x63, 0x68, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x27, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x21, 0x3a, + 0x01, 0x2a, 0x22, 0x1c, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x74, 0x61, 0x67, + 0x67, 0x65, 0x72, 0x2f, 0x66, 0x65, 0x74, 0x63, 0x68, 0x5f, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, + 0x12, 0x9b, 0x01, 0x0a, 0x17, 0x44, 0x6f, 0x67, 0x73, 0x74, 0x61, 0x74, 0x73, 0x64, 0x43, 0x61, + 0x70, 0x74, 0x75, 0x72, 0x65, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x12, 0x27, 0x2e, 0x64, + 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x76, 0x31, 0x2e, + 0x43, 0x61, 0x70, 0x74, 0x75, 0x72, 0x65, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, 0x2e, + 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x70, 0x74, 0x75, 0x72, 0x65, + 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x2d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x27, 0x3a, 0x01, 0x2a, 0x22, 0x22, 0x2f, 0x76, 0x31, 0x2f, + 0x67, 0x72, 0x70, 0x63, 0x2f, 0x64, 0x6f, 0x67, 0x73, 0x74, 0x61, 0x74, 0x73, 0x64, 0x2f, 0x63, + 0x61, 0x70, 0x74, 0x75, 0x72, 0x65, 0x2f, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x12, 0x8c, + 0x01, 0x0a, 0x17, 0x44, 0x6f, 0x67, 0x73, 0x74, 0x61, 0x74, 0x73, 0x64, 0x53, 0x65, 0x74, 0x54, + 0x61, 0x67, 0x67, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x1d, 0x2e, 0x64, 0x61, 0x74, + 0x61, 0x64, 0x6f, 0x67, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x61, + 0x67, 0x67, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x65, 0x1a, 0x25, 0x2e, 0x64, 0x61, 0x74, 0x61, + 0x64, 0x6f, 0x67, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x61, 0x67, + 0x67, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x25, 0x3a, 0x01, 0x2a, 0x22, 0x20, 0x2f, 0x76, 0x31, - 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x63, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x5f, 0x68, 0x61, 0x12, 0x7d, 0x0a, - 0x10, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x53, 0x74, 0x61, 0x74, 0x65, 0x48, - 0x41, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x64, 0x6f, 0x67, 0x73, 0x74, 0x61, 0x74, 0x73, 0x64, 0x2f, + 0x63, 0x61, 0x70, 0x74, 0x75, 0x72, 0x65, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x8f, 0x01, + 0x0a, 0x10, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x73, 0x12, 0x27, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, 0x2e, 0x63, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x64, 0x61, + 0x74, 0x61, 0x64, 0x6f, 0x67, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x43, 0x6c, 0x69, + 0x65, 0x6e, 0x74, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x28, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x3a, 0x01, 0x2a, + 0x22, 0x1d, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x72, 0x65, 0x6d, 0x6f, 0x74, + 0x65, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x12, + 0x78, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x53, 0x74, 0x61, 0x74, + 0x65, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x26, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x29, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x23, 0x3a, 0x01, 0x2a, 0x22, 0x1e, 0x2f, 0x76, + 0x65, 0x22, 0x26, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x3a, 0x01, 0x2a, 0x22, 0x1b, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x63, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x68, 0x61, 0x12, 0xb3, 0x01, 0x0a, - 0x1a, 0x57, 0x6f, 0x72, 0x6b, 0x6c, 0x6f, 0x61, 0x64, 0x6d, 0x65, 0x74, 0x61, 0x53, 0x74, 0x72, - 0x65, 0x61, 0x6d, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x12, 0x2f, 0x2e, 0x64, 0x61, - 0x74, 0x61, 0x64, 0x6f, 0x67, 0x2e, 0x77, 0x6f, 0x72, 0x6b, 0x6c, 0x6f, 0x61, 0x64, 0x6d, 0x65, - 0x74, 0x61, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x6c, 0x6f, 0x61, 0x64, 0x6d, 0x65, 0x74, 0x61, 0x53, - 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x64, - 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, 0x2e, 0x77, 0x6f, 0x72, 0x6b, 0x6c, 0x6f, 0x61, 0x64, 0x6d, - 0x65, 0x74, 0x61, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x6c, 0x6f, 0x61, 0x64, 0x6d, 0x65, 0x74, 0x61, - 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x30, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2a, 0x3a, 0x01, 0x2a, 0x22, 0x25, 0x2f, 0x76, 0x31, 0x2f, 0x67, - 0x72, 0x70, 0x63, 0x2f, 0x77, 0x6f, 0x72, 0x6b, 0x6c, 0x6f, 0x61, 0x64, 0x6d, 0x65, 0x74, 0x61, - 0x2f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x5f, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, - 0x30, 0x01, 0x12, 0xaf, 0x01, 0x0a, 0x13, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, - 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x12, 0x2f, 0x2e, 0x64, 0x61, 0x74, - 0x61, 0x64, 0x6f, 0x67, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x61, 0x67, 0x65, 0x6e, 0x74, - 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x41, - 0x67, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x64, 0x61, - 0x74, 0x61, 0x64, 0x6f, 0x67, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x61, 0x67, 0x65, 0x6e, - 0x74, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, - 0x41, 0x67, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x35, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x2f, 0x3a, 0x01, 0x2a, 0x22, 0x2a, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x72, - 0x70, 0x63, 0x2f, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2f, 0x72, - 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x5f, 0x61, - 0x67, 0x65, 0x6e, 0x74, 0x32, 0xe6, 0x01, 0x0a, 0x0b, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x41, - 0x67, 0x65, 0x6e, 0x74, 0x12, 0x6f, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x12, 0x2c, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x64, - 0x6f, 0x67, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x47, - 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, - 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x47, 0x65, 0x74, - 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x66, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x46, 0x6c, 0x61, 0x72, - 0x65, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x12, 0x29, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, - 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x47, 0x65, 0x74, - 0x46, 0x6c, 0x61, 0x72, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x2a, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, 0x2e, 0x72, 0x65, 0x6d, 0x6f, - 0x74, 0x65, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x47, 0x65, 0x74, 0x46, 0x6c, 0x61, 0x72, 0x65, - 0x46, 0x69, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x15, 0x5a, - 0x13, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x62, 0x67, 0x6f, 0x2f, - 0x63, 0x6f, 0x72, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var file_datadog_api_v1_api_proto_goTypes = []interface{}{ - (*HostnameRequest)(nil), // 0: datadog.model.v1.HostnameRequest - (*StreamTagsRequest)(nil), // 1: datadog.model.v1.StreamTagsRequest - (*FetchEntityRequest)(nil), // 2: datadog.model.v1.FetchEntityRequest - (*CaptureTriggerRequest)(nil), // 3: datadog.model.v1.CaptureTriggerRequest - (*TaggerState)(nil), // 4: datadog.model.v1.TaggerState - (*ClientGetConfigsRequest)(nil), // 5: datadog.config.ClientGetConfigsRequest - (*empty.Empty)(nil), // 6: google.protobuf.Empty - (*WorkloadmetaStreamRequest)(nil), // 7: datadog.workloadmeta.WorkloadmetaStreamRequest - (*RegisterRemoteAgentRequest)(nil), // 8: datadog.remoteagent.RegisterRemoteAgentRequest - (*GetStatusDetailsRequest)(nil), // 9: datadog.remoteagent.GetStatusDetailsRequest - (*GetFlareFilesRequest)(nil), // 10: datadog.remoteagent.GetFlareFilesRequest - (*HostnameReply)(nil), // 11: datadog.model.v1.HostnameReply - (*StreamTagsResponse)(nil), // 12: datadog.model.v1.StreamTagsResponse - (*FetchEntityResponse)(nil), // 13: datadog.model.v1.FetchEntityResponse - (*CaptureTriggerResponse)(nil), // 14: datadog.model.v1.CaptureTriggerResponse - (*TaggerStateResponse)(nil), // 15: datadog.model.v1.TaggerStateResponse - (*ClientGetConfigsResponse)(nil), // 16: datadog.config.ClientGetConfigsResponse - (*GetStateConfigResponse)(nil), // 17: datadog.config.GetStateConfigResponse - (*WorkloadmetaStreamResponse)(nil), // 18: datadog.workloadmeta.WorkloadmetaStreamResponse - (*RegisterRemoteAgentResponse)(nil), // 19: datadog.remoteagent.RegisterRemoteAgentResponse - (*GetStatusDetailsResponse)(nil), // 20: datadog.remoteagent.GetStatusDetailsResponse - (*GetFlareFilesResponse)(nil), // 21: datadog.remoteagent.GetFlareFilesResponse + 0x66, 0x69, 0x67, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x94, 0x01, 0x0a, 0x12, 0x43, 0x6c, + 0x69, 0x65, 0x6e, 0x74, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x48, 0x41, + 0x12, 0x27, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x64, 0x61, 0x74, 0x61, + 0x64, 0x6f, 0x67, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, + 0x74, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x2b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x25, 0x3a, 0x01, 0x2a, 0x22, 0x20, + 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x63, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x5f, 0x68, 0x61, + 0x12, 0x7d, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x53, 0x74, 0x61, + 0x74, 0x65, 0x48, 0x41, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x26, 0x2e, 0x64, + 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x47, 0x65, + 0x74, 0x53, 0x74, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x29, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x23, 0x3a, 0x01, 0x2a, 0x22, + 0x1e, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x68, 0x61, 0x12, + 0xb3, 0x01, 0x0a, 0x1a, 0x57, 0x6f, 0x72, 0x6b, 0x6c, 0x6f, 0x61, 0x64, 0x6d, 0x65, 0x74, 0x61, + 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x12, 0x2f, + 0x2e, 0x64, 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, 0x2e, 0x77, 0x6f, 0x72, 0x6b, 0x6c, 0x6f, 0x61, + 0x64, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x6c, 0x6f, 0x61, 0x64, 0x6d, 0x65, + 0x74, 0x61, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x30, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, 0x2e, 0x77, 0x6f, 0x72, 0x6b, 0x6c, 0x6f, + 0x61, 0x64, 0x6d, 0x65, 0x74, 0x61, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x6c, 0x6f, 0x61, 0x64, 0x6d, + 0x65, 0x74, 0x61, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x30, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2a, 0x3a, 0x01, 0x2a, 0x22, 0x25, 0x2f, 0x76, + 0x31, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x77, 0x6f, 0x72, 0x6b, 0x6c, 0x6f, 0x61, 0x64, 0x6d, + 0x65, 0x74, 0x61, 0x2f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x5f, 0x65, 0x6e, 0x74, 0x69, 0x74, + 0x69, 0x65, 0x73, 0x30, 0x01, 0x12, 0xaf, 0x01, 0x0a, 0x13, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, + 0x65, 0x72, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x12, 0x2f, 0x2e, + 0x64, 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x61, 0x67, + 0x65, 0x6e, 0x74, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x6d, 0x6f, + 0x74, 0x65, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, + 0x2e, 0x64, 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x61, + 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x6d, + 0x6f, 0x74, 0x65, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x35, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2f, 0x3a, 0x01, 0x2a, 0x22, 0x2a, 0x2f, 0x76, 0x31, + 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x61, 0x67, 0x65, 0x6e, + 0x74, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x72, 0x65, 0x6d, 0x6f, 0x74, + 0x65, 0x5f, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x12, 0x9b, 0x01, 0x0a, 0x19, 0x41, 0x75, 0x74, 0x6f, + 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x32, 0x2e, + 0x64, 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, 0x2e, 0x61, 0x75, 0x74, 0x6f, 0x64, 0x69, 0x73, 0x63, + 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x41, 0x75, 0x74, 0x6f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, + 0x65, 0x72, 0x79, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x30, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2a, 0x3a, 0x01, 0x2a, 0x22, 0x25, 0x2f, 0x76, + 0x31, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x61, 0x75, 0x74, 0x6f, 0x64, 0x69, 0x73, 0x63, 0x6f, + 0x76, 0x65, 0x72, 0x79, 0x2f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x5f, 0x63, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x73, 0x30, 0x01, 0x32, 0xe6, 0x01, 0x0a, 0x0b, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, + 0x41, 0x67, 0x65, 0x6e, 0x74, 0x12, 0x6f, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x12, 0x2c, 0x2e, 0x64, 0x61, 0x74, 0x61, + 0x64, 0x6f, 0x67, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, + 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x64, 0x6f, + 0x67, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x47, 0x65, + 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x66, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x46, 0x6c, 0x61, + 0x72, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x12, 0x29, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x64, 0x6f, + 0x67, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x47, 0x65, + 0x74, 0x46, 0x6c, 0x61, 0x72, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, 0x2e, 0x72, 0x65, 0x6d, + 0x6f, 0x74, 0x65, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2e, 0x47, 0x65, 0x74, 0x46, 0x6c, 0x61, 0x72, + 0x65, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x15, + 0x5a, 0x13, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x62, 0x67, 0x6f, + 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var file_datadog_api_v1_api_proto_goTypes = []any{ + (*HostnameRequest)(nil), // 0: datadog.model.v1.HostnameRequest + (*StreamTagsRequest)(nil), // 1: datadog.model.v1.StreamTagsRequest + (*GenerateContainerIDFromOriginInfoRequest)(nil), // 2: datadog.model.v1.GenerateContainerIDFromOriginInfoRequest + (*FetchEntityRequest)(nil), // 3: datadog.model.v1.FetchEntityRequest + (*CaptureTriggerRequest)(nil), // 4: datadog.model.v1.CaptureTriggerRequest + (*TaggerState)(nil), // 5: datadog.model.v1.TaggerState + (*ClientGetConfigsRequest)(nil), // 6: datadog.config.ClientGetConfigsRequest + (*empty.Empty)(nil), // 7: google.protobuf.Empty + (*WorkloadmetaStreamRequest)(nil), // 8: datadog.workloadmeta.WorkloadmetaStreamRequest + (*RegisterRemoteAgentRequest)(nil), // 9: datadog.remoteagent.RegisterRemoteAgentRequest + (*GetStatusDetailsRequest)(nil), // 10: datadog.remoteagent.GetStatusDetailsRequest + (*GetFlareFilesRequest)(nil), // 11: datadog.remoteagent.GetFlareFilesRequest + (*HostnameReply)(nil), // 12: datadog.model.v1.HostnameReply + (*StreamTagsResponse)(nil), // 13: datadog.model.v1.StreamTagsResponse + (*GenerateContainerIDFromOriginInfoResponse)(nil), // 14: datadog.model.v1.GenerateContainerIDFromOriginInfoResponse + (*FetchEntityResponse)(nil), // 15: datadog.model.v1.FetchEntityResponse + (*CaptureTriggerResponse)(nil), // 16: datadog.model.v1.CaptureTriggerResponse + (*TaggerStateResponse)(nil), // 17: datadog.model.v1.TaggerStateResponse + (*ClientGetConfigsResponse)(nil), // 18: datadog.config.ClientGetConfigsResponse + (*GetStateConfigResponse)(nil), // 19: datadog.config.GetStateConfigResponse + (*WorkloadmetaStreamResponse)(nil), // 20: datadog.workloadmeta.WorkloadmetaStreamResponse + (*RegisterRemoteAgentResponse)(nil), // 21: datadog.remoteagent.RegisterRemoteAgentResponse + (*AutodiscoveryStreamResponse)(nil), // 22: datadog.autodiscovery.AutodiscoveryStreamResponse + (*GetStatusDetailsResponse)(nil), // 23: datadog.remoteagent.GetStatusDetailsResponse + (*GetFlareFilesResponse)(nil), // 24: datadog.remoteagent.GetFlareFilesResponse } var file_datadog_api_v1_api_proto_depIdxs = []int32{ 0, // 0: datadog.api.v1.Agent.GetHostname:input_type -> datadog.model.v1.HostnameRequest 1, // 1: datadog.api.v1.AgentSecure.TaggerStreamEntities:input_type -> datadog.model.v1.StreamTagsRequest - 2, // 2: datadog.api.v1.AgentSecure.TaggerFetchEntity:input_type -> datadog.model.v1.FetchEntityRequest - 3, // 3: datadog.api.v1.AgentSecure.DogstatsdCaptureTrigger:input_type -> datadog.model.v1.CaptureTriggerRequest - 4, // 4: datadog.api.v1.AgentSecure.DogstatsdSetTaggerState:input_type -> datadog.model.v1.TaggerState - 5, // 5: datadog.api.v1.AgentSecure.ClientGetConfigs:input_type -> datadog.config.ClientGetConfigsRequest - 6, // 6: datadog.api.v1.AgentSecure.GetConfigState:input_type -> google.protobuf.Empty - 5, // 7: datadog.api.v1.AgentSecure.ClientGetConfigsHA:input_type -> datadog.config.ClientGetConfigsRequest - 6, // 8: datadog.api.v1.AgentSecure.GetConfigStateHA:input_type -> google.protobuf.Empty - 7, // 9: datadog.api.v1.AgentSecure.WorkloadmetaStreamEntities:input_type -> datadog.workloadmeta.WorkloadmetaStreamRequest - 8, // 10: datadog.api.v1.AgentSecure.RegisterRemoteAgent:input_type -> datadog.remoteagent.RegisterRemoteAgentRequest - 9, // 11: datadog.api.v1.RemoteAgent.GetStatusDetails:input_type -> datadog.remoteagent.GetStatusDetailsRequest - 10, // 12: datadog.api.v1.RemoteAgent.GetFlareFiles:input_type -> datadog.remoteagent.GetFlareFilesRequest - 11, // 13: datadog.api.v1.Agent.GetHostname:output_type -> datadog.model.v1.HostnameReply - 12, // 14: datadog.api.v1.AgentSecure.TaggerStreamEntities:output_type -> datadog.model.v1.StreamTagsResponse - 13, // 15: datadog.api.v1.AgentSecure.TaggerFetchEntity:output_type -> datadog.model.v1.FetchEntityResponse - 14, // 16: datadog.api.v1.AgentSecure.DogstatsdCaptureTrigger:output_type -> datadog.model.v1.CaptureTriggerResponse - 15, // 17: datadog.api.v1.AgentSecure.DogstatsdSetTaggerState:output_type -> datadog.model.v1.TaggerStateResponse - 16, // 18: datadog.api.v1.AgentSecure.ClientGetConfigs:output_type -> datadog.config.ClientGetConfigsResponse - 17, // 19: datadog.api.v1.AgentSecure.GetConfigState:output_type -> datadog.config.GetStateConfigResponse - 16, // 20: datadog.api.v1.AgentSecure.ClientGetConfigsHA:output_type -> datadog.config.ClientGetConfigsResponse - 17, // 21: datadog.api.v1.AgentSecure.GetConfigStateHA:output_type -> datadog.config.GetStateConfigResponse - 18, // 22: datadog.api.v1.AgentSecure.WorkloadmetaStreamEntities:output_type -> datadog.workloadmeta.WorkloadmetaStreamResponse - 19, // 23: datadog.api.v1.AgentSecure.RegisterRemoteAgent:output_type -> datadog.remoteagent.RegisterRemoteAgentResponse - 20, // 24: datadog.api.v1.RemoteAgent.GetStatusDetails:output_type -> datadog.remoteagent.GetStatusDetailsResponse - 21, // 25: datadog.api.v1.RemoteAgent.GetFlareFiles:output_type -> datadog.remoteagent.GetFlareFilesResponse - 13, // [13:26] is the sub-list for method output_type - 0, // [0:13] is the sub-list for method input_type + 2, // 2: datadog.api.v1.AgentSecure.TaggerGenerateContainerIDFromOriginInfo:input_type -> datadog.model.v1.GenerateContainerIDFromOriginInfoRequest + 3, // 3: datadog.api.v1.AgentSecure.TaggerFetchEntity:input_type -> datadog.model.v1.FetchEntityRequest + 4, // 4: datadog.api.v1.AgentSecure.DogstatsdCaptureTrigger:input_type -> datadog.model.v1.CaptureTriggerRequest + 5, // 5: datadog.api.v1.AgentSecure.DogstatsdSetTaggerState:input_type -> datadog.model.v1.TaggerState + 6, // 6: datadog.api.v1.AgentSecure.ClientGetConfigs:input_type -> datadog.config.ClientGetConfigsRequest + 7, // 7: datadog.api.v1.AgentSecure.GetConfigState:input_type -> google.protobuf.Empty + 6, // 8: datadog.api.v1.AgentSecure.ClientGetConfigsHA:input_type -> datadog.config.ClientGetConfigsRequest + 7, // 9: datadog.api.v1.AgentSecure.GetConfigStateHA:input_type -> google.protobuf.Empty + 8, // 10: datadog.api.v1.AgentSecure.WorkloadmetaStreamEntities:input_type -> datadog.workloadmeta.WorkloadmetaStreamRequest + 9, // 11: datadog.api.v1.AgentSecure.RegisterRemoteAgent:input_type -> datadog.remoteagent.RegisterRemoteAgentRequest + 7, // 12: datadog.api.v1.AgentSecure.AutodiscoveryStreamConfig:input_type -> google.protobuf.Empty + 10, // 13: datadog.api.v1.RemoteAgent.GetStatusDetails:input_type -> datadog.remoteagent.GetStatusDetailsRequest + 11, // 14: datadog.api.v1.RemoteAgent.GetFlareFiles:input_type -> datadog.remoteagent.GetFlareFilesRequest + 12, // 15: datadog.api.v1.Agent.GetHostname:output_type -> datadog.model.v1.HostnameReply + 13, // 16: datadog.api.v1.AgentSecure.TaggerStreamEntities:output_type -> datadog.model.v1.StreamTagsResponse + 14, // 17: datadog.api.v1.AgentSecure.TaggerGenerateContainerIDFromOriginInfo:output_type -> datadog.model.v1.GenerateContainerIDFromOriginInfoResponse + 15, // 18: datadog.api.v1.AgentSecure.TaggerFetchEntity:output_type -> datadog.model.v1.FetchEntityResponse + 16, // 19: datadog.api.v1.AgentSecure.DogstatsdCaptureTrigger:output_type -> datadog.model.v1.CaptureTriggerResponse + 17, // 20: datadog.api.v1.AgentSecure.DogstatsdSetTaggerState:output_type -> datadog.model.v1.TaggerStateResponse + 18, // 21: datadog.api.v1.AgentSecure.ClientGetConfigs:output_type -> datadog.config.ClientGetConfigsResponse + 19, // 22: datadog.api.v1.AgentSecure.GetConfigState:output_type -> datadog.config.GetStateConfigResponse + 18, // 23: datadog.api.v1.AgentSecure.ClientGetConfigsHA:output_type -> datadog.config.ClientGetConfigsResponse + 19, // 24: datadog.api.v1.AgentSecure.GetConfigStateHA:output_type -> datadog.config.GetStateConfigResponse + 20, // 25: datadog.api.v1.AgentSecure.WorkloadmetaStreamEntities:output_type -> datadog.workloadmeta.WorkloadmetaStreamResponse + 21, // 26: datadog.api.v1.AgentSecure.RegisterRemoteAgent:output_type -> datadog.remoteagent.RegisterRemoteAgentResponse + 22, // 27: datadog.api.v1.AgentSecure.AutodiscoveryStreamConfig:output_type -> datadog.autodiscovery.AutodiscoveryStreamResponse + 23, // 28: datadog.api.v1.RemoteAgent.GetStatusDetails:output_type -> datadog.remoteagent.GetStatusDetailsResponse + 24, // 29: datadog.api.v1.RemoteAgent.GetFlareFiles:output_type -> datadog.remoteagent.GetFlareFilesResponse + 15, // [15:30] is the sub-list for method output_type + 0, // [0:15] is the sub-list for method input_type 0, // [0:0] is the sub-list for extension type_name 0, // [0:0] is the sub-list for extension extendee 0, // [0:0] is the sub-list for field type_name @@ -231,6 +265,7 @@ func file_datadog_api_v1_api_proto_init() { file_datadog_remoteagent_remoteagent_proto_init() file_datadog_remoteconfig_remoteconfig_proto_init() file_datadog_workloadmeta_workloadmeta_proto_init() + file_datadog_autodiscovery_autodiscovery_proto_init() type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ @@ -358,6 +393,17 @@ type AgentSecureClient interface { // } // } TaggerStreamEntities(ctx context.Context, in *StreamTagsRequest, opts ...grpc.CallOption) (AgentSecure_TaggerStreamEntitiesClient, error) + // Generates a container ID from Origin Info. + // can be called through the HTTP gateway, and entity will be returned as JSON: + // + // $ curl -H "authorization: Bearer $(cat /etc/datadog-agent/auth_token)" \ + // -XPOST -k -H "Content-Type: application/json" \ + // --data '{"externalData": {"init": false,"containerName": "dd-trace-py","podUID": "c4b45c6a-b296-4bd5-88df-7c2d6bcaabef"}}' \ + // https://localhost:5001/v1/grpc/tagger/generate_container_id_from_origin_info + // { + // "containerID":"c9fd60251b5237467462dad48999815eb0025f367c6e1abe91e0bd787d5915fc" + // } + TaggerGenerateContainerIDFromOriginInfo(ctx context.Context, in *GenerateContainerIDFromOriginInfoRequest, opts ...grpc.CallOption) (*GenerateContainerIDFromOriginInfoResponse, error) // fetches an entity from the Tagger with the desired cardinality tags. // can be called through the HTTP gateway, and entity will be returned as JSON: // @@ -416,6 +462,8 @@ type AgentSecureClient interface { WorkloadmetaStreamEntities(ctx context.Context, in *WorkloadmetaStreamRequest, opts ...grpc.CallOption) (AgentSecure_WorkloadmetaStreamEntitiesClient, error) // Registers a remote agent. RegisterRemoteAgent(ctx context.Context, in *RegisterRemoteAgentRequest, opts ...grpc.CallOption) (*RegisterRemoteAgentResponse, error) + // Subscribes to autodiscovery config updates + AutodiscoveryStreamConfig(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (AgentSecure_AutodiscoveryStreamConfigClient, error) } type agentSecureClient struct { @@ -458,6 +506,15 @@ func (x *agentSecureTaggerStreamEntitiesClient) Recv() (*StreamTagsResponse, err return m, nil } +func (c *agentSecureClient) TaggerGenerateContainerIDFromOriginInfo(ctx context.Context, in *GenerateContainerIDFromOriginInfoRequest, opts ...grpc.CallOption) (*GenerateContainerIDFromOriginInfoResponse, error) { + out := new(GenerateContainerIDFromOriginInfoResponse) + err := c.cc.Invoke(ctx, "/datadog.api.v1.AgentSecure/TaggerGenerateContainerIDFromOriginInfo", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *agentSecureClient) TaggerFetchEntity(ctx context.Context, in *FetchEntityRequest, opts ...grpc.CallOption) (*FetchEntityResponse, error) { out := new(FetchEntityResponse) err := c.cc.Invoke(ctx, "/datadog.api.v1.AgentSecure/TaggerFetchEntity", in, out, opts...) @@ -562,6 +619,38 @@ func (c *agentSecureClient) RegisterRemoteAgent(ctx context.Context, in *Registe return out, nil } +func (c *agentSecureClient) AutodiscoveryStreamConfig(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (AgentSecure_AutodiscoveryStreamConfigClient, error) { + stream, err := c.cc.NewStream(ctx, &_AgentSecure_serviceDesc.Streams[2], "/datadog.api.v1.AgentSecure/AutodiscoveryStreamConfig", opts...) + if err != nil { + return nil, err + } + x := &agentSecureAutodiscoveryStreamConfigClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type AgentSecure_AutodiscoveryStreamConfigClient interface { + Recv() (*AutodiscoveryStreamResponse, error) + grpc.ClientStream +} + +type agentSecureAutodiscoveryStreamConfigClient struct { + grpc.ClientStream +} + +func (x *agentSecureAutodiscoveryStreamConfigClient) Recv() (*AutodiscoveryStreamResponse, error) { + m := new(AutodiscoveryStreamResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + // AgentSecureServer is the server API for AgentSecure service. type AgentSecureServer interface { // subscribes to added, removed, or changed entities in the Tagger @@ -586,6 +675,17 @@ type AgentSecureServer interface { // } // } TaggerStreamEntities(*StreamTagsRequest, AgentSecure_TaggerStreamEntitiesServer) error + // Generates a container ID from Origin Info. + // can be called through the HTTP gateway, and entity will be returned as JSON: + // + // $ curl -H "authorization: Bearer $(cat /etc/datadog-agent/auth_token)" \ + // -XPOST -k -H "Content-Type: application/json" \ + // --data '{"externalData": {"init": false,"containerName": "dd-trace-py","podUID": "c4b45c6a-b296-4bd5-88df-7c2d6bcaabef"}}' \ + // https://localhost:5001/v1/grpc/tagger/generate_container_id_from_origin_info + // { + // "containerID":"c9fd60251b5237467462dad48999815eb0025f367c6e1abe91e0bd787d5915fc" + // } + TaggerGenerateContainerIDFromOriginInfo(context.Context, *GenerateContainerIDFromOriginInfoRequest) (*GenerateContainerIDFromOriginInfoResponse, error) // fetches an entity from the Tagger with the desired cardinality tags. // can be called through the HTTP gateway, and entity will be returned as JSON: // @@ -644,6 +744,8 @@ type AgentSecureServer interface { WorkloadmetaStreamEntities(*WorkloadmetaStreamRequest, AgentSecure_WorkloadmetaStreamEntitiesServer) error // Registers a remote agent. RegisterRemoteAgent(context.Context, *RegisterRemoteAgentRequest) (*RegisterRemoteAgentResponse, error) + // Subscribes to autodiscovery config updates + AutodiscoveryStreamConfig(*empty.Empty, AgentSecure_AutodiscoveryStreamConfigServer) error } // UnimplementedAgentSecureServer can be embedded to have forward compatible implementations. @@ -653,6 +755,9 @@ type UnimplementedAgentSecureServer struct { func (*UnimplementedAgentSecureServer) TaggerStreamEntities(*StreamTagsRequest, AgentSecure_TaggerStreamEntitiesServer) error { return status.Errorf(codes.Unimplemented, "method TaggerStreamEntities not implemented") } +func (*UnimplementedAgentSecureServer) TaggerGenerateContainerIDFromOriginInfo(context.Context, *GenerateContainerIDFromOriginInfoRequest) (*GenerateContainerIDFromOriginInfoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method TaggerGenerateContainerIDFromOriginInfo not implemented") +} func (*UnimplementedAgentSecureServer) TaggerFetchEntity(context.Context, *FetchEntityRequest) (*FetchEntityResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method TaggerFetchEntity not implemented") } @@ -680,6 +785,9 @@ func (*UnimplementedAgentSecureServer) WorkloadmetaStreamEntities(*WorkloadmetaS func (*UnimplementedAgentSecureServer) RegisterRemoteAgent(context.Context, *RegisterRemoteAgentRequest) (*RegisterRemoteAgentResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method RegisterRemoteAgent not implemented") } +func (*UnimplementedAgentSecureServer) AutodiscoveryStreamConfig(*empty.Empty, AgentSecure_AutodiscoveryStreamConfigServer) error { + return status.Errorf(codes.Unimplemented, "method AutodiscoveryStreamConfig not implemented") +} func RegisterAgentSecureServer(s *grpc.Server, srv AgentSecureServer) { s.RegisterService(&_AgentSecure_serviceDesc, srv) @@ -706,6 +814,24 @@ func (x *agentSecureTaggerStreamEntitiesServer) Send(m *StreamTagsResponse) erro return x.ServerStream.SendMsg(m) } +func _AgentSecure_TaggerGenerateContainerIDFromOriginInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GenerateContainerIDFromOriginInfoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AgentSecureServer).TaggerGenerateContainerIDFromOriginInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/datadog.api.v1.AgentSecure/TaggerGenerateContainerIDFromOriginInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AgentSecureServer).TaggerGenerateContainerIDFromOriginInfo(ctx, req.(*GenerateContainerIDFromOriginInfoRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _AgentSecure_TaggerFetchEntity_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(FetchEntityRequest) if err := dec(in); err != nil { @@ -871,10 +997,35 @@ func _AgentSecure_RegisterRemoteAgent_Handler(srv interface{}, ctx context.Conte return interceptor(ctx, in, info, handler) } +func _AgentSecure_AutodiscoveryStreamConfig_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(empty.Empty) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(AgentSecureServer).AutodiscoveryStreamConfig(m, &agentSecureAutodiscoveryStreamConfigServer{stream}) +} + +type AgentSecure_AutodiscoveryStreamConfigServer interface { + Send(*AutodiscoveryStreamResponse) error + grpc.ServerStream +} + +type agentSecureAutodiscoveryStreamConfigServer struct { + grpc.ServerStream +} + +func (x *agentSecureAutodiscoveryStreamConfigServer) Send(m *AutodiscoveryStreamResponse) error { + return x.ServerStream.SendMsg(m) +} + var _AgentSecure_serviceDesc = grpc.ServiceDesc{ ServiceName: "datadog.api.v1.AgentSecure", HandlerType: (*AgentSecureServer)(nil), Methods: []grpc.MethodDesc{ + { + MethodName: "TaggerGenerateContainerIDFromOriginInfo", + Handler: _AgentSecure_TaggerGenerateContainerIDFromOriginInfo_Handler, + }, { MethodName: "TaggerFetchEntity", Handler: _AgentSecure_TaggerFetchEntity_Handler, @@ -919,6 +1070,11 @@ var _AgentSecure_serviceDesc = grpc.ServiceDesc{ Handler: _AgentSecure_WorkloadmetaStreamEntities_Handler, ServerStreams: true, }, + { + StreamName: "AutodiscoveryStreamConfig", + Handler: _AgentSecure_AutodiscoveryStreamConfig_Handler, + ServerStreams: true, + }, }, Metadata: "datadog/api/v1/api.proto", } diff --git a/pkg/proto/pbgo/core/api.pb.gw.go b/pkg/proto/pbgo/core/api.pb.gw.go index fb843e96988c3..7be078c4eb534 100644 --- a/pkg/proto/pbgo/core/api.pb.gw.go +++ b/pkg/proto/pbgo/core/api.pb.gw.go @@ -21,6 +21,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" ) @@ -31,6 +32,7 @@ var _ status.Status var _ = runtime.String var _ = utilities.NewDoubleArray var _ = descriptor.ForMessage +var _ = metadata.Join func request_Agent_GetHostname_0(ctx context.Context, marshaler runtime.Marshaler, client AgentClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq HostnameRequest @@ -75,6 +77,40 @@ func request_AgentSecure_TaggerStreamEntities_0(ctx context.Context, marshaler r } +func request_AgentSecure_TaggerGenerateContainerIDFromOriginInfo_0(ctx context.Context, marshaler runtime.Marshaler, client AgentSecureClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GenerateContainerIDFromOriginInfoRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.TaggerGenerateContainerIDFromOriginInfo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_AgentSecure_TaggerGenerateContainerIDFromOriginInfo_0(ctx context.Context, marshaler runtime.Marshaler, server AgentSecureServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GenerateContainerIDFromOriginInfoRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.TaggerGenerateContainerIDFromOriginInfo(ctx, &protoReq) + return msg, metadata, err + +} + func request_AgentSecure_TaggerFetchEntity_0(ctx context.Context, marshaler runtime.Marshaler, client AgentSecureClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq FetchEntityRequest var metadata runtime.ServerMetadata @@ -372,14 +408,42 @@ func local_request_AgentSecure_RegisterRemoteAgent_0(ctx context.Context, marsha } +func request_AgentSecure_AutodiscoveryStreamConfig_0(ctx context.Context, marshaler runtime.Marshaler, client AgentSecureClient, req *http.Request, pathParams map[string]string) (AgentSecure_AutodiscoveryStreamConfigClient, runtime.ServerMetadata, error) { + var protoReq empty.Empty + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + stream, err := client.AutodiscoveryStreamConfig(ctx, &protoReq) + if err != nil { + return nil, metadata, err + } + header, err := stream.Header() + if err != nil { + return nil, metadata, err + } + metadata.HeaderMD = header + return stream, metadata, nil + +} + // RegisterAgentHandlerServer registers the http handlers for service Agent to "mux". // UnaryRPC :call AgentServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterAgentHandlerFromEndpoint instead. func RegisterAgentHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AgentServer) error { mux.Handle("GET", pattern_Agent_GetHostname_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -387,6 +451,7 @@ func RegisterAgentHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Agent_GetHostname_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -403,6 +468,7 @@ func RegisterAgentHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv // RegisterAgentSecureHandlerServer registers the http handlers for service AgentSecure to "mux". // UnaryRPC :call AgentSecureServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterAgentSecureHandlerFromEndpoint instead. func RegisterAgentSecureHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AgentSecureServer) error { mux.Handle("POST", pattern_AgentSecure_TaggerStreamEntities_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { @@ -412,9 +478,34 @@ func RegisterAgentSecureHandlerServer(ctx context.Context, mux *runtime.ServeMux return }) + mux.Handle("POST", pattern_AgentSecure_TaggerGenerateContainerIDFromOriginInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_AgentSecure_TaggerGenerateContainerIDFromOriginInfo_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_AgentSecure_TaggerGenerateContainerIDFromOriginInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("POST", pattern_AgentSecure_TaggerFetchEntity_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -422,6 +513,7 @@ func RegisterAgentSecureHandlerServer(ctx context.Context, mux *runtime.ServeMux return } resp, md, err := local_request_AgentSecure_TaggerFetchEntity_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -435,6 +527,8 @@ func RegisterAgentSecureHandlerServer(ctx context.Context, mux *runtime.ServeMux mux.Handle("POST", pattern_AgentSecure_DogstatsdCaptureTrigger_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -442,6 +536,7 @@ func RegisterAgentSecureHandlerServer(ctx context.Context, mux *runtime.ServeMux return } resp, md, err := local_request_AgentSecure_DogstatsdCaptureTrigger_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -455,6 +550,8 @@ func RegisterAgentSecureHandlerServer(ctx context.Context, mux *runtime.ServeMux mux.Handle("POST", pattern_AgentSecure_DogstatsdSetTaggerState_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -462,6 +559,7 @@ func RegisterAgentSecureHandlerServer(ctx context.Context, mux *runtime.ServeMux return } resp, md, err := local_request_AgentSecure_DogstatsdSetTaggerState_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -475,6 +573,8 @@ func RegisterAgentSecureHandlerServer(ctx context.Context, mux *runtime.ServeMux mux.Handle("POST", pattern_AgentSecure_ClientGetConfigs_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -482,6 +582,7 @@ func RegisterAgentSecureHandlerServer(ctx context.Context, mux *runtime.ServeMux return } resp, md, err := local_request_AgentSecure_ClientGetConfigs_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -495,6 +596,8 @@ func RegisterAgentSecureHandlerServer(ctx context.Context, mux *runtime.ServeMux mux.Handle("POST", pattern_AgentSecure_GetConfigState_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -502,6 +605,7 @@ func RegisterAgentSecureHandlerServer(ctx context.Context, mux *runtime.ServeMux return } resp, md, err := local_request_AgentSecure_GetConfigState_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -515,6 +619,8 @@ func RegisterAgentSecureHandlerServer(ctx context.Context, mux *runtime.ServeMux mux.Handle("POST", pattern_AgentSecure_ClientGetConfigsHA_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -522,6 +628,7 @@ func RegisterAgentSecureHandlerServer(ctx context.Context, mux *runtime.ServeMux return } resp, md, err := local_request_AgentSecure_ClientGetConfigsHA_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -535,6 +642,8 @@ func RegisterAgentSecureHandlerServer(ctx context.Context, mux *runtime.ServeMux mux.Handle("POST", pattern_AgentSecure_GetConfigStateHA_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -542,6 +651,7 @@ func RegisterAgentSecureHandlerServer(ctx context.Context, mux *runtime.ServeMux return } resp, md, err := local_request_AgentSecure_GetConfigStateHA_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -562,6 +672,8 @@ func RegisterAgentSecureHandlerServer(ctx context.Context, mux *runtime.ServeMux mux.Handle("POST", pattern_AgentSecure_RegisterRemoteAgent_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -569,6 +681,7 @@ func RegisterAgentSecureHandlerServer(ctx context.Context, mux *runtime.ServeMux return } resp, md, err := local_request_AgentSecure_RegisterRemoteAgent_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -579,6 +692,13 @@ func RegisterAgentSecureHandlerServer(ctx context.Context, mux *runtime.ServeMux }) + mux.Handle("POST", pattern_AgentSecure_AutodiscoveryStreamConfig_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + err := status.Error(codes.Unimplemented, "streaming calls are not yet supported in the in-process transport") + _, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + }) + return nil } @@ -709,6 +829,26 @@ func RegisterAgentSecureHandlerClient(ctx context.Context, mux *runtime.ServeMux }) + mux.Handle("POST", pattern_AgentSecure_TaggerGenerateContainerIDFromOriginInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_AgentSecure_TaggerGenerateContainerIDFromOriginInfo_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_AgentSecure_TaggerGenerateContainerIDFromOriginInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("POST", pattern_AgentSecure_TaggerFetchEntity_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -889,12 +1029,34 @@ func RegisterAgentSecureHandlerClient(ctx context.Context, mux *runtime.ServeMux }) + mux.Handle("POST", pattern_AgentSecure_AutodiscoveryStreamConfig_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_AgentSecure_AutodiscoveryStreamConfig_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_AgentSecure_AutodiscoveryStreamConfig_0(ctx, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...) + + }) + return nil } var ( pattern_AgentSecure_TaggerStreamEntities_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "grpc", "tagger", "stream_entities"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_AgentSecure_TaggerGenerateContainerIDFromOriginInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "grpc", "tagger", "generate_container_id_from_origin_info"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_AgentSecure_TaggerFetchEntity_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "grpc", "tagger", "fetch_entity"}, "", runtime.AssumeColonVerbOpt(true))) pattern_AgentSecure_DogstatsdCaptureTrigger_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"v1", "grpc", "dogstatsd", "capture", "trigger"}, "", runtime.AssumeColonVerbOpt(true))) @@ -912,11 +1074,15 @@ var ( pattern_AgentSecure_WorkloadmetaStreamEntities_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "grpc", "workloadmeta", "stream_entities"}, "", runtime.AssumeColonVerbOpt(true))) pattern_AgentSecure_RegisterRemoteAgent_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "grpc", "remoteagent", "register_remote_agent"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_AgentSecure_AutodiscoveryStreamConfig_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "grpc", "autodiscovery", "stream_configs"}, "", runtime.AssumeColonVerbOpt(true))) ) var ( forward_AgentSecure_TaggerStreamEntities_0 = runtime.ForwardResponseStream + forward_AgentSecure_TaggerGenerateContainerIDFromOriginInfo_0 = runtime.ForwardResponseMessage + forward_AgentSecure_TaggerFetchEntity_0 = runtime.ForwardResponseMessage forward_AgentSecure_DogstatsdCaptureTrigger_0 = runtime.ForwardResponseMessage @@ -934,4 +1100,6 @@ var ( forward_AgentSecure_WorkloadmetaStreamEntities_0 = runtime.ForwardResponseStream forward_AgentSecure_RegisterRemoteAgent_0 = runtime.ForwardResponseMessage + + forward_AgentSecure_AutodiscoveryStreamConfig_0 = runtime.ForwardResponseStream ) diff --git a/pkg/proto/pbgo/core/autodiscovery.pb.go b/pkg/proto/pbgo/core/autodiscovery.pb.go new file mode 100644 index 0000000000000..898df3ccfe4af --- /dev/null +++ b/pkg/proto/pbgo/core/autodiscovery.pb.go @@ -0,0 +1,530 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.35.2 +// protoc v5.26.1 +// source: datadog/autodiscovery/autodiscovery.proto + +package core + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type ConfigEventType int32 + +const ( + ConfigEventType_SCHEDULE ConfigEventType = 0 + ConfigEventType_UNSCHEDULE ConfigEventType = 1 +) + +// Enum value maps for ConfigEventType. +var ( + ConfigEventType_name = map[int32]string{ + 0: "SCHEDULE", + 1: "UNSCHEDULE", + } + ConfigEventType_value = map[string]int32{ + "SCHEDULE": 0, + "UNSCHEDULE": 1, + } +) + +func (x ConfigEventType) Enum() *ConfigEventType { + p := new(ConfigEventType) + *p = x + return p +} + +func (x ConfigEventType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ConfigEventType) Descriptor() protoreflect.EnumDescriptor { + return file_datadog_autodiscovery_autodiscovery_proto_enumTypes[0].Descriptor() +} + +func (ConfigEventType) Type() protoreflect.EnumType { + return &file_datadog_autodiscovery_autodiscovery_proto_enumTypes[0] +} + +func (x ConfigEventType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ConfigEventType.Descriptor instead. +func (ConfigEventType) EnumDescriptor() ([]byte, []int) { + return file_datadog_autodiscovery_autodiscovery_proto_rawDescGZIP(), []int{0} +} + +type KubeNamespacedName struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"` +} + +func (x *KubeNamespacedName) Reset() { + *x = KubeNamespacedName{} + mi := &file_datadog_autodiscovery_autodiscovery_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *KubeNamespacedName) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*KubeNamespacedName) ProtoMessage() {} + +func (x *KubeNamespacedName) ProtoReflect() protoreflect.Message { + mi := &file_datadog_autodiscovery_autodiscovery_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use KubeNamespacedName.ProtoReflect.Descriptor instead. +func (*KubeNamespacedName) Descriptor() ([]byte, []int) { + return file_datadog_autodiscovery_autodiscovery_proto_rawDescGZIP(), []int{0} +} + +func (x *KubeNamespacedName) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *KubeNamespacedName) GetNamespace() string { + if x != nil { + return x.Namespace + } + return "" +} + +type AdvancedADIdentifier struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + KubeService *KubeNamespacedName `protobuf:"bytes,1,opt,name=kubeService,proto3" json:"kubeService,omitempty"` + KubeEndpoints *KubeNamespacedName `protobuf:"bytes,2,opt,name=kubeEndpoints,proto3" json:"kubeEndpoints,omitempty"` +} + +func (x *AdvancedADIdentifier) Reset() { + *x = AdvancedADIdentifier{} + mi := &file_datadog_autodiscovery_autodiscovery_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AdvancedADIdentifier) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AdvancedADIdentifier) ProtoMessage() {} + +func (x *AdvancedADIdentifier) ProtoReflect() protoreflect.Message { + mi := &file_datadog_autodiscovery_autodiscovery_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AdvancedADIdentifier.ProtoReflect.Descriptor instead. +func (*AdvancedADIdentifier) Descriptor() ([]byte, []int) { + return file_datadog_autodiscovery_autodiscovery_proto_rawDescGZIP(), []int{1} +} + +func (x *AdvancedADIdentifier) GetKubeService() *KubeNamespacedName { + if x != nil { + return x.KubeService + } + return nil +} + +func (x *AdvancedADIdentifier) GetKubeEndpoints() *KubeNamespacedName { + if x != nil { + return x.KubeEndpoints + } + return nil +} + +type Config struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Instances [][]byte `protobuf:"bytes,2,rep,name=instances,proto3" json:"instances,omitempty"` + InitConfig []byte `protobuf:"bytes,3,opt,name=initConfig,proto3" json:"initConfig,omitempty"` + MetricConfig []byte `protobuf:"bytes,4,opt,name=metricConfig,proto3" json:"metricConfig,omitempty"` + LogsConfig []byte `protobuf:"bytes,5,opt,name=logsConfig,proto3" json:"logsConfig,omitempty"` + AdIdentifiers []string `protobuf:"bytes,6,rep,name=adIdentifiers,proto3" json:"adIdentifiers,omitempty"` + AdvancedAdIdentifiers []*AdvancedADIdentifier `protobuf:"bytes,7,rep,name=advancedAdIdentifiers,proto3" json:"advancedAdIdentifiers,omitempty"` + Provider string `protobuf:"bytes,8,opt,name=provider,proto3" json:"provider,omitempty"` + ServiceId string `protobuf:"bytes,9,opt,name=serviceId,proto3" json:"serviceId,omitempty"` + TaggerEntity string `protobuf:"bytes,10,opt,name=taggerEntity,proto3" json:"taggerEntity,omitempty"` + ClusterCheck bool `protobuf:"varint,11,opt,name=clusterCheck,proto3" json:"clusterCheck,omitempty"` + NodeName string `protobuf:"bytes,12,opt,name=nodeName,proto3" json:"nodeName,omitempty"` + Source string `protobuf:"bytes,13,opt,name=source,proto3" json:"source,omitempty"` + IgnoreAutodiscoveryTags bool `protobuf:"varint,14,opt,name=ignoreAutodiscoveryTags,proto3" json:"ignoreAutodiscoveryTags,omitempty"` + MetricsExcluded bool `protobuf:"varint,15,opt,name=metricsExcluded,proto3" json:"metricsExcluded,omitempty"` + LogsExcluded bool `protobuf:"varint,16,opt,name=logsExcluded,proto3" json:"logsExcluded,omitempty"` + EventType ConfigEventType `protobuf:"varint,17,opt,name=eventType,proto3,enum=datadog.autodiscovery.ConfigEventType" json:"eventType,omitempty"` +} + +func (x *Config) Reset() { + *x = Config{} + mi := &file_datadog_autodiscovery_autodiscovery_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Config) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Config) ProtoMessage() {} + +func (x *Config) ProtoReflect() protoreflect.Message { + mi := &file_datadog_autodiscovery_autodiscovery_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Config.ProtoReflect.Descriptor instead. +func (*Config) Descriptor() ([]byte, []int) { + return file_datadog_autodiscovery_autodiscovery_proto_rawDescGZIP(), []int{2} +} + +func (x *Config) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Config) GetInstances() [][]byte { + if x != nil { + return x.Instances + } + return nil +} + +func (x *Config) GetInitConfig() []byte { + if x != nil { + return x.InitConfig + } + return nil +} + +func (x *Config) GetMetricConfig() []byte { + if x != nil { + return x.MetricConfig + } + return nil +} + +func (x *Config) GetLogsConfig() []byte { + if x != nil { + return x.LogsConfig + } + return nil +} + +func (x *Config) GetAdIdentifiers() []string { + if x != nil { + return x.AdIdentifiers + } + return nil +} + +func (x *Config) GetAdvancedAdIdentifiers() []*AdvancedADIdentifier { + if x != nil { + return x.AdvancedAdIdentifiers + } + return nil +} + +func (x *Config) GetProvider() string { + if x != nil { + return x.Provider + } + return "" +} + +func (x *Config) GetServiceId() string { + if x != nil { + return x.ServiceId + } + return "" +} + +func (x *Config) GetTaggerEntity() string { + if x != nil { + return x.TaggerEntity + } + return "" +} + +func (x *Config) GetClusterCheck() bool { + if x != nil { + return x.ClusterCheck + } + return false +} + +func (x *Config) GetNodeName() string { + if x != nil { + return x.NodeName + } + return "" +} + +func (x *Config) GetSource() string { + if x != nil { + return x.Source + } + return "" +} + +func (x *Config) GetIgnoreAutodiscoveryTags() bool { + if x != nil { + return x.IgnoreAutodiscoveryTags + } + return false +} + +func (x *Config) GetMetricsExcluded() bool { + if x != nil { + return x.MetricsExcluded + } + return false +} + +func (x *Config) GetLogsExcluded() bool { + if x != nil { + return x.LogsExcluded + } + return false +} + +func (x *Config) GetEventType() ConfigEventType { + if x != nil { + return x.EventType + } + return ConfigEventType_SCHEDULE +} + +type AutodiscoveryStreamResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Configs []*Config `protobuf:"bytes,1,rep,name=configs,proto3" json:"configs,omitempty"` +} + +func (x *AutodiscoveryStreamResponse) Reset() { + *x = AutodiscoveryStreamResponse{} + mi := &file_datadog_autodiscovery_autodiscovery_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AutodiscoveryStreamResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AutodiscoveryStreamResponse) ProtoMessage() {} + +func (x *AutodiscoveryStreamResponse) ProtoReflect() protoreflect.Message { + mi := &file_datadog_autodiscovery_autodiscovery_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AutodiscoveryStreamResponse.ProtoReflect.Descriptor instead. +func (*AutodiscoveryStreamResponse) Descriptor() ([]byte, []int) { + return file_datadog_autodiscovery_autodiscovery_proto_rawDescGZIP(), []int{3} +} + +func (x *AutodiscoveryStreamResponse) GetConfigs() []*Config { + if x != nil { + return x.Configs + } + return nil +} + +var File_datadog_autodiscovery_autodiscovery_proto protoreflect.FileDescriptor + +var file_datadog_autodiscovery_autodiscovery_proto_rawDesc = []byte{ + 0x0a, 0x29, 0x64, 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, 0x2f, 0x61, 0x75, 0x74, 0x6f, 0x64, 0x69, + 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2f, 0x61, 0x75, 0x74, 0x6f, 0x64, 0x69, 0x73, 0x63, + 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x15, 0x64, 0x61, 0x74, + 0x61, 0x64, 0x6f, 0x67, 0x2e, 0x61, 0x75, 0x74, 0x6f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, + 0x72, 0x79, 0x22, 0x46, 0x0a, 0x12, 0x4b, 0x75, 0x62, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, + 0x61, 0x63, 0x65, 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, + 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x22, 0xb4, 0x01, 0x0a, 0x14, 0x41, + 0x64, 0x76, 0x61, 0x6e, 0x63, 0x65, 0x64, 0x41, 0x44, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, + 0x69, 0x65, 0x72, 0x12, 0x4b, 0x0a, 0x0b, 0x6b, 0x75, 0x62, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x64, + 0x6f, 0x67, 0x2e, 0x61, 0x75, 0x74, 0x6f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, + 0x2e, 0x4b, 0x75, 0x62, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x64, 0x4e, + 0x61, 0x6d, 0x65, 0x52, 0x0b, 0x6b, 0x75, 0x62, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x12, 0x4f, 0x0a, 0x0d, 0x6b, 0x75, 0x62, 0x65, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, + 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x64, 0x6f, + 0x67, 0x2e, 0x61, 0x75, 0x74, 0x6f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, + 0x4b, 0x75, 0x62, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x64, 0x4e, 0x61, + 0x6d, 0x65, 0x52, 0x0d, 0x6b, 0x75, 0x62, 0x65, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, + 0x73, 0x22, 0xab, 0x05, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x12, 0x0a, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x1c, 0x0a, 0x09, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x18, 0x02, 0x20, + 0x03, 0x28, 0x0c, 0x52, 0x09, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x1e, + 0x0a, 0x0a, 0x69, 0x6e, 0x69, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x0a, 0x69, 0x6e, 0x69, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x22, + 0x0a, 0x0c, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x12, 0x1e, 0x0a, 0x0a, 0x6c, 0x6f, 0x67, 0x73, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x6c, 0x6f, 0x67, 0x73, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x12, 0x24, 0x0a, 0x0d, 0x61, 0x64, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, + 0x65, 0x72, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x61, 0x64, 0x49, 0x64, 0x65, + 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x73, 0x12, 0x61, 0x0a, 0x15, 0x61, 0x64, 0x76, 0x61, + 0x6e, 0x63, 0x65, 0x64, 0x41, 0x64, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, + 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x64, 0x6f, + 0x67, 0x2e, 0x61, 0x75, 0x74, 0x6f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, + 0x41, 0x64, 0x76, 0x61, 0x6e, 0x63, 0x65, 0x64, 0x41, 0x44, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, + 0x66, 0x69, 0x65, 0x72, 0x52, 0x15, 0x61, 0x64, 0x76, 0x61, 0x6e, 0x63, 0x65, 0x64, 0x41, 0x64, + 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x70, + 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, + 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x49, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x49, 0x64, 0x12, 0x22, 0x0a, 0x0c, 0x74, 0x61, 0x67, 0x67, 0x65, 0x72, 0x45, + 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x74, 0x61, 0x67, + 0x67, 0x65, 0x72, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x22, 0x0a, 0x0c, 0x63, 0x6c, 0x75, + 0x73, 0x74, 0x65, 0x72, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x0c, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x12, 0x1a, 0x0a, + 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x12, 0x38, 0x0a, 0x17, 0x69, 0x67, 0x6e, 0x6f, 0x72, 0x65, 0x41, 0x75, 0x74, 0x6f, 0x64, + 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x54, 0x61, 0x67, 0x73, 0x18, 0x0e, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x17, 0x69, 0x67, 0x6e, 0x6f, 0x72, 0x65, 0x41, 0x75, 0x74, 0x6f, 0x64, 0x69, + 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x54, 0x61, 0x67, 0x73, 0x12, 0x28, 0x0a, 0x0f, 0x6d, + 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x45, 0x78, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x64, 0x18, 0x0f, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x45, 0x78, 0x63, + 0x6c, 0x75, 0x64, 0x65, 0x64, 0x12, 0x22, 0x0a, 0x0c, 0x6c, 0x6f, 0x67, 0x73, 0x45, 0x78, 0x63, + 0x6c, 0x75, 0x64, 0x65, 0x64, 0x18, 0x10, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x6c, 0x6f, 0x67, + 0x73, 0x45, 0x78, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x64, 0x12, 0x44, 0x0a, 0x09, 0x65, 0x76, 0x65, + 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x26, 0x2e, 0x64, + 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, 0x2e, 0x61, 0x75, 0x74, 0x6f, 0x64, 0x69, 0x73, 0x63, 0x6f, + 0x76, 0x65, 0x72, 0x79, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x45, 0x76, 0x65, 0x6e, 0x74, + 0x54, 0x79, 0x70, 0x65, 0x52, 0x09, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x22, + 0x56, 0x0a, 0x1b, 0x41, 0x75, 0x74, 0x6f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, + 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x37, + 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x1d, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, 0x2e, 0x61, 0x75, 0x74, 0x6f, 0x64, 0x69, + 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x07, + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x2a, 0x2f, 0x0a, 0x0f, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0c, 0x0a, 0x08, 0x53, 0x43, + 0x48, 0x45, 0x44, 0x55, 0x4c, 0x45, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x55, 0x4e, 0x53, 0x43, + 0x48, 0x45, 0x44, 0x55, 0x4c, 0x45, 0x10, 0x01, 0x42, 0x15, 0x5a, 0x13, 0x70, 0x6b, 0x67, 0x2f, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x62, 0x67, 0x6f, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_datadog_autodiscovery_autodiscovery_proto_rawDescOnce sync.Once + file_datadog_autodiscovery_autodiscovery_proto_rawDescData = file_datadog_autodiscovery_autodiscovery_proto_rawDesc +) + +func file_datadog_autodiscovery_autodiscovery_proto_rawDescGZIP() []byte { + file_datadog_autodiscovery_autodiscovery_proto_rawDescOnce.Do(func() { + file_datadog_autodiscovery_autodiscovery_proto_rawDescData = protoimpl.X.CompressGZIP(file_datadog_autodiscovery_autodiscovery_proto_rawDescData) + }) + return file_datadog_autodiscovery_autodiscovery_proto_rawDescData +} + +var file_datadog_autodiscovery_autodiscovery_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_datadog_autodiscovery_autodiscovery_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_datadog_autodiscovery_autodiscovery_proto_goTypes = []any{ + (ConfigEventType)(0), // 0: datadog.autodiscovery.ConfigEventType + (*KubeNamespacedName)(nil), // 1: datadog.autodiscovery.KubeNamespacedName + (*AdvancedADIdentifier)(nil), // 2: datadog.autodiscovery.AdvancedADIdentifier + (*Config)(nil), // 3: datadog.autodiscovery.Config + (*AutodiscoveryStreamResponse)(nil), // 4: datadog.autodiscovery.AutodiscoveryStreamResponse +} +var file_datadog_autodiscovery_autodiscovery_proto_depIdxs = []int32{ + 1, // 0: datadog.autodiscovery.AdvancedADIdentifier.kubeService:type_name -> datadog.autodiscovery.KubeNamespacedName + 1, // 1: datadog.autodiscovery.AdvancedADIdentifier.kubeEndpoints:type_name -> datadog.autodiscovery.KubeNamespacedName + 2, // 2: datadog.autodiscovery.Config.advancedAdIdentifiers:type_name -> datadog.autodiscovery.AdvancedADIdentifier + 0, // 3: datadog.autodiscovery.Config.eventType:type_name -> datadog.autodiscovery.ConfigEventType + 3, // 4: datadog.autodiscovery.AutodiscoveryStreamResponse.configs:type_name -> datadog.autodiscovery.Config + 5, // [5:5] is the sub-list for method output_type + 5, // [5:5] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name +} + +func init() { file_datadog_autodiscovery_autodiscovery_proto_init() } +func file_datadog_autodiscovery_autodiscovery_proto_init() { + if File_datadog_autodiscovery_autodiscovery_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_datadog_autodiscovery_autodiscovery_proto_rawDesc, + NumEnums: 1, + NumMessages: 4, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_datadog_autodiscovery_autodiscovery_proto_goTypes, + DependencyIndexes: file_datadog_autodiscovery_autodiscovery_proto_depIdxs, + EnumInfos: file_datadog_autodiscovery_autodiscovery_proto_enumTypes, + MessageInfos: file_datadog_autodiscovery_autodiscovery_proto_msgTypes, + }.Build() + File_datadog_autodiscovery_autodiscovery_proto = out.File + file_datadog_autodiscovery_autodiscovery_proto_rawDesc = nil + file_datadog_autodiscovery_autodiscovery_proto_goTypes = nil + file_datadog_autodiscovery_autodiscovery_proto_depIdxs = nil +} diff --git a/pkg/proto/pbgo/core/model.pb.go b/pkg/proto/pbgo/core/model.pb.go index cd3ae8350b00d..9262b4dc43a5a 100644 --- a/pkg/proto/pbgo/core/model.pb.go +++ b/pkg/proto/pbgo/core/model.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.0 +// protoc-gen-go v1.35.2 // protoc v5.26.1 // source: datadog/model/v1/model.proto @@ -126,11 +126,9 @@ type HostnameRequest struct { func (x *HostnameRequest) Reset() { *x = HostnameRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_model_v1_model_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_model_v1_model_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *HostnameRequest) String() string { @@ -141,7 +139,7 @@ func (*HostnameRequest) ProtoMessage() {} func (x *HostnameRequest) ProtoReflect() protoreflect.Message { mi := &file_datadog_model_v1_model_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -167,11 +165,9 @@ type HostnameReply struct { func (x *HostnameReply) Reset() { *x = HostnameReply{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_model_v1_model_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_model_v1_model_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *HostnameReply) String() string { @@ -182,7 +178,7 @@ func (*HostnameReply) ProtoMessage() {} func (x *HostnameReply) ProtoReflect() protoreflect.Message { mi := &file_datadog_model_v1_model_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -217,11 +213,9 @@ type CaptureTriggerRequest struct { func (x *CaptureTriggerRequest) Reset() { *x = CaptureTriggerRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_model_v1_model_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_model_v1_model_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *CaptureTriggerRequest) String() string { @@ -232,7 +226,7 @@ func (*CaptureTriggerRequest) ProtoMessage() {} func (x *CaptureTriggerRequest) ProtoReflect() protoreflect.Message { mi := &file_datadog_model_v1_model_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -278,11 +272,9 @@ type CaptureTriggerResponse struct { func (x *CaptureTriggerResponse) Reset() { *x = CaptureTriggerResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_model_v1_model_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_model_v1_model_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *CaptureTriggerResponse) String() string { @@ -293,7 +285,7 @@ func (*CaptureTriggerResponse) ProtoMessage() {} func (x *CaptureTriggerResponse) ProtoReflect() protoreflect.Message { mi := &file_datadog_model_v1_model_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -329,11 +321,9 @@ type StreamTagsRequest struct { func (x *StreamTagsRequest) Reset() { *x = StreamTagsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_model_v1_model_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_model_v1_model_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *StreamTagsRequest) String() string { @@ -344,7 +334,7 @@ func (*StreamTagsRequest) ProtoMessage() {} func (x *StreamTagsRequest) ProtoReflect() protoreflect.Message { mi := &file_datadog_model_v1_model_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -404,11 +394,9 @@ type StreamTagsResponse struct { func (x *StreamTagsResponse) Reset() { *x = StreamTagsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_model_v1_model_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_model_v1_model_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *StreamTagsResponse) String() string { @@ -419,7 +407,7 @@ func (*StreamTagsResponse) ProtoMessage() {} func (x *StreamTagsResponse) ProtoReflect() protoreflect.Message { mi := &file_datadog_model_v1_model_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -452,11 +440,9 @@ type StreamTagsEvent struct { func (x *StreamTagsEvent) Reset() { *x = StreamTagsEvent{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_model_v1_model_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_model_v1_model_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *StreamTagsEvent) String() string { @@ -467,7 +453,7 @@ func (*StreamTagsEvent) ProtoMessage() {} func (x *StreamTagsEvent) ProtoReflect() protoreflect.Message { mi := &file_datadog_model_v1_model_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -508,11 +494,9 @@ type DeprecatedFilter struct { func (x *DeprecatedFilter) Reset() { *x = DeprecatedFilter{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_model_v1_model_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_model_v1_model_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *DeprecatedFilter) String() string { @@ -523,7 +507,7 @@ func (*DeprecatedFilter) ProtoMessage() {} func (x *DeprecatedFilter) ProtoReflect() protoreflect.Message { mi := &file_datadog_model_v1_model_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -574,11 +558,9 @@ type Entity struct { func (x *Entity) Reset() { *x = Entity{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_model_v1_model_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_model_v1_model_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Entity) String() string { @@ -589,7 +571,7 @@ func (*Entity) ProtoMessage() {} func (x *Entity) ProtoReflect() protoreflect.Message { mi := &file_datadog_model_v1_model_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -646,6 +628,104 @@ func (x *Entity) GetStandardTags() []string { return nil } +type GenerateContainerIDFromOriginInfoRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + LocalData *GenerateContainerIDFromOriginInfoRequest_LocalData `protobuf:"bytes,1,opt,name=localData,proto3,oneof" json:"localData,omitempty"` // Local data for the container, generated by the client. + ExternalData *GenerateContainerIDFromOriginInfoRequest_ExternalData `protobuf:"bytes,2,opt,name=externalData,proto3,oneof" json:"externalData,omitempty"` // External data for the container, generated by the Admission Controller. +} + +func (x *GenerateContainerIDFromOriginInfoRequest) Reset() { + *x = GenerateContainerIDFromOriginInfoRequest{} + mi := &file_datadog_model_v1_model_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GenerateContainerIDFromOriginInfoRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GenerateContainerIDFromOriginInfoRequest) ProtoMessage() {} + +func (x *GenerateContainerIDFromOriginInfoRequest) ProtoReflect() protoreflect.Message { + mi := &file_datadog_model_v1_model_proto_msgTypes[9] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GenerateContainerIDFromOriginInfoRequest.ProtoReflect.Descriptor instead. +func (*GenerateContainerIDFromOriginInfoRequest) Descriptor() ([]byte, []int) { + return file_datadog_model_v1_model_proto_rawDescGZIP(), []int{9} +} + +func (x *GenerateContainerIDFromOriginInfoRequest) GetLocalData() *GenerateContainerIDFromOriginInfoRequest_LocalData { + if x != nil { + return x.LocalData + } + return nil +} + +func (x *GenerateContainerIDFromOriginInfoRequest) GetExternalData() *GenerateContainerIDFromOriginInfoRequest_ExternalData { + if x != nil { + return x.ExternalData + } + return nil +} + +type GenerateContainerIDFromOriginInfoResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ContainerID string `protobuf:"bytes,1,opt,name=containerID,proto3" json:"containerID,omitempty"` +} + +func (x *GenerateContainerIDFromOriginInfoResponse) Reset() { + *x = GenerateContainerIDFromOriginInfoResponse{} + mi := &file_datadog_model_v1_model_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GenerateContainerIDFromOriginInfoResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GenerateContainerIDFromOriginInfoResponse) ProtoMessage() {} + +func (x *GenerateContainerIDFromOriginInfoResponse) ProtoReflect() protoreflect.Message { + mi := &file_datadog_model_v1_model_proto_msgTypes[10] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GenerateContainerIDFromOriginInfoResponse.ProtoReflect.Descriptor instead. +func (*GenerateContainerIDFromOriginInfoResponse) Descriptor() ([]byte, []int) { + return file_datadog_model_v1_model_proto_rawDescGZIP(), []int{10} +} + +func (x *GenerateContainerIDFromOriginInfoResponse) GetContainerID() string { + if x != nil { + return x.ContainerID + } + return "" +} + type FetchEntityRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -657,11 +737,9 @@ type FetchEntityRequest struct { func (x *FetchEntityRequest) Reset() { *x = FetchEntityRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_model_v1_model_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_model_v1_model_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *FetchEntityRequest) String() string { @@ -671,8 +749,8 @@ func (x *FetchEntityRequest) String() string { func (*FetchEntityRequest) ProtoMessage() {} func (x *FetchEntityRequest) ProtoReflect() protoreflect.Message { - mi := &file_datadog_model_v1_model_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { + mi := &file_datadog_model_v1_model_proto_msgTypes[11] + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -684,7 +762,7 @@ func (x *FetchEntityRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use FetchEntityRequest.ProtoReflect.Descriptor instead. func (*FetchEntityRequest) Descriptor() ([]byte, []int) { - return file_datadog_model_v1_model_proto_rawDescGZIP(), []int{9} + return file_datadog_model_v1_model_proto_rawDescGZIP(), []int{11} } func (x *FetchEntityRequest) GetId() *EntityId { @@ -713,11 +791,9 @@ type FetchEntityResponse struct { func (x *FetchEntityResponse) Reset() { *x = FetchEntityResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_model_v1_model_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_model_v1_model_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *FetchEntityResponse) String() string { @@ -727,8 +803,8 @@ func (x *FetchEntityResponse) String() string { func (*FetchEntityResponse) ProtoMessage() {} func (x *FetchEntityResponse) ProtoReflect() protoreflect.Message { - mi := &file_datadog_model_v1_model_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { + mi := &file_datadog_model_v1_model_proto_msgTypes[12] + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -740,7 +816,7 @@ func (x *FetchEntityResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use FetchEntityResponse.ProtoReflect.Descriptor instead. func (*FetchEntityResponse) Descriptor() ([]byte, []int) { - return file_datadog_model_v1_model_proto_rawDescGZIP(), []int{10} + return file_datadog_model_v1_model_proto_rawDescGZIP(), []int{12} } func (x *FetchEntityResponse) GetId() *EntityId { @@ -775,11 +851,9 @@ type EntityId struct { func (x *EntityId) Reset() { *x = EntityId{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_model_v1_model_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_model_v1_model_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *EntityId) String() string { @@ -789,8 +863,8 @@ func (x *EntityId) String() string { func (*EntityId) ProtoMessage() {} func (x *EntityId) ProtoReflect() protoreflect.Message { - mi := &file_datadog_model_v1_model_proto_msgTypes[11] - if protoimpl.UnsafeEnabled && x != nil { + mi := &file_datadog_model_v1_model_proto_msgTypes[13] + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -802,7 +876,7 @@ func (x *EntityId) ProtoReflect() protoreflect.Message { // Deprecated: Use EntityId.ProtoReflect.Descriptor instead. func (*EntityId) Descriptor() ([]byte, []int) { - return file_datadog_model_v1_model_proto_rawDescGZIP(), []int{11} + return file_datadog_model_v1_model_proto_rawDescGZIP(), []int{13} } func (x *EntityId) GetPrefix() string { @@ -836,11 +910,9 @@ type UnixDogstatsdMsg struct { func (x *UnixDogstatsdMsg) Reset() { *x = UnixDogstatsdMsg{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_model_v1_model_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_model_v1_model_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *UnixDogstatsdMsg) String() string { @@ -850,8 +922,8 @@ func (x *UnixDogstatsdMsg) String() string { func (*UnixDogstatsdMsg) ProtoMessage() {} func (x *UnixDogstatsdMsg) ProtoReflect() protoreflect.Message { - mi := &file_datadog_model_v1_model_proto_msgTypes[12] - if protoimpl.UnsafeEnabled && x != nil { + mi := &file_datadog_model_v1_model_proto_msgTypes[14] + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -863,7 +935,7 @@ func (x *UnixDogstatsdMsg) ProtoReflect() protoreflect.Message { // Deprecated: Use UnixDogstatsdMsg.ProtoReflect.Descriptor instead. func (*UnixDogstatsdMsg) Descriptor() ([]byte, []int) { - return file_datadog_model_v1_model_proto_rawDescGZIP(), []int{12} + return file_datadog_model_v1_model_proto_rawDescGZIP(), []int{14} } func (x *UnixDogstatsdMsg) GetTimestamp() int64 { @@ -919,11 +991,9 @@ type TaggerState struct { func (x *TaggerState) Reset() { *x = TaggerState{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_model_v1_model_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_model_v1_model_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *TaggerState) String() string { @@ -933,8 +1003,8 @@ func (x *TaggerState) String() string { func (*TaggerState) ProtoMessage() {} func (x *TaggerState) ProtoReflect() protoreflect.Message { - mi := &file_datadog_model_v1_model_proto_msgTypes[13] - if protoimpl.UnsafeEnabled && x != nil { + mi := &file_datadog_model_v1_model_proto_msgTypes[15] + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -946,7 +1016,7 @@ func (x *TaggerState) ProtoReflect() protoreflect.Message { // Deprecated: Use TaggerState.ProtoReflect.Descriptor instead. func (*TaggerState) Descriptor() ([]byte, []int) { - return file_datadog_model_v1_model_proto_rawDescGZIP(), []int{13} + return file_datadog_model_v1_model_proto_rawDescGZIP(), []int{15} } func (x *TaggerState) GetState() map[string]*Entity { @@ -973,11 +1043,9 @@ type TaggerStateResponse struct { func (x *TaggerStateResponse) Reset() { *x = TaggerStateResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_model_v1_model_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_model_v1_model_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *TaggerStateResponse) String() string { @@ -987,8 +1055,8 @@ func (x *TaggerStateResponse) String() string { func (*TaggerStateResponse) ProtoMessage() {} func (x *TaggerStateResponse) ProtoReflect() protoreflect.Message { - mi := &file_datadog_model_v1_model_proto_msgTypes[14] - if protoimpl.UnsafeEnabled && x != nil { + mi := &file_datadog_model_v1_model_proto_msgTypes[16] + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1000,7 +1068,7 @@ func (x *TaggerStateResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use TaggerStateResponse.ProtoReflect.Descriptor instead. func (*TaggerStateResponse) Descriptor() ([]byte, []int) { - return file_datadog_model_v1_model_proto_rawDescGZIP(), []int{14} + return file_datadog_model_v1_model_proto_rawDescGZIP(), []int{16} } func (x *TaggerStateResponse) GetLoaded() bool { @@ -1010,6 +1078,138 @@ func (x *TaggerStateResponse) GetLoaded() bool { return false } +// Nested message for the local data +type GenerateContainerIDFromOriginInfoRequest_LocalData struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ProcessID *uint32 `protobuf:"varint,1,opt,name=processID,proto3,oneof" json:"processID,omitempty"` // Process ID of the container process on the host. + ContainerID *string `protobuf:"bytes,2,opt,name=containerID,proto3,oneof" json:"containerID,omitempty"` // Container ID send from the client. + Inode *uint64 `protobuf:"varint,3,opt,name=inode,proto3,oneof" json:"inode,omitempty"` // Cgroup inode of the container. + PodUID *string `protobuf:"bytes,4,opt,name=podUID,proto3,oneof" json:"podUID,omitempty"` // Pod UID send from the client. +} + +func (x *GenerateContainerIDFromOriginInfoRequest_LocalData) Reset() { + *x = GenerateContainerIDFromOriginInfoRequest_LocalData{} + mi := &file_datadog_model_v1_model_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GenerateContainerIDFromOriginInfoRequest_LocalData) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GenerateContainerIDFromOriginInfoRequest_LocalData) ProtoMessage() {} + +func (x *GenerateContainerIDFromOriginInfoRequest_LocalData) ProtoReflect() protoreflect.Message { + mi := &file_datadog_model_v1_model_proto_msgTypes[17] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GenerateContainerIDFromOriginInfoRequest_LocalData.ProtoReflect.Descriptor instead. +func (*GenerateContainerIDFromOriginInfoRequest_LocalData) Descriptor() ([]byte, []int) { + return file_datadog_model_v1_model_proto_rawDescGZIP(), []int{9, 0} +} + +func (x *GenerateContainerIDFromOriginInfoRequest_LocalData) GetProcessID() uint32 { + if x != nil && x.ProcessID != nil { + return *x.ProcessID + } + return 0 +} + +func (x *GenerateContainerIDFromOriginInfoRequest_LocalData) GetContainerID() string { + if x != nil && x.ContainerID != nil { + return *x.ContainerID + } + return "" +} + +func (x *GenerateContainerIDFromOriginInfoRequest_LocalData) GetInode() uint64 { + if x != nil && x.Inode != nil { + return *x.Inode + } + return 0 +} + +func (x *GenerateContainerIDFromOriginInfoRequest_LocalData) GetPodUID() string { + if x != nil && x.PodUID != nil { + return *x.PodUID + } + return "" +} + +// Nested message for the external data +type GenerateContainerIDFromOriginInfoRequest_ExternalData struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Init *bool `protobuf:"varint,1,opt,name=init,proto3,oneof" json:"init,omitempty"` // Init is true if the container is an init container. + ContainerName *string `protobuf:"bytes,2,opt,name=containerName,proto3,oneof" json:"containerName,omitempty"` // Container name in the Kubernetes Pod spec. + PodUID *string `protobuf:"bytes,3,opt,name=podUID,proto3,oneof" json:"podUID,omitempty"` // Pod UID in the Kubernetes Pod spec. +} + +func (x *GenerateContainerIDFromOriginInfoRequest_ExternalData) Reset() { + *x = GenerateContainerIDFromOriginInfoRequest_ExternalData{} + mi := &file_datadog_model_v1_model_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GenerateContainerIDFromOriginInfoRequest_ExternalData) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GenerateContainerIDFromOriginInfoRequest_ExternalData) ProtoMessage() {} + +func (x *GenerateContainerIDFromOriginInfoRequest_ExternalData) ProtoReflect() protoreflect.Message { + mi := &file_datadog_model_v1_model_proto_msgTypes[18] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GenerateContainerIDFromOriginInfoRequest_ExternalData.ProtoReflect.Descriptor instead. +func (*GenerateContainerIDFromOriginInfoRequest_ExternalData) Descriptor() ([]byte, []int) { + return file_datadog_model_v1_model_proto_rawDescGZIP(), []int{9, 1} +} + +func (x *GenerateContainerIDFromOriginInfoRequest_ExternalData) GetInit() bool { + if x != nil && x.Init != nil { + return *x.Init + } + return false +} + +func (x *GenerateContainerIDFromOriginInfoRequest_ExternalData) GetContainerName() string { + if x != nil && x.ContainerName != nil { + return *x.ContainerName + } + return "" +} + +func (x *GenerateContainerIDFromOriginInfoRequest_ExternalData) GetPodUID() string { + if x != nil && x.PodUID != nil { + return *x.PodUID + } + return "" +} + var File_datadog_model_v1_model_proto protoreflect.FileDescriptor var file_datadog_model_v1_model_proto_rawDesc = []byte{ @@ -1085,70 +1285,115 @@ var file_datadog_model_v1_model_proto_rawDesc = []byte{ 0x43, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x54, 0x61, 0x67, 0x73, 0x12, 0x22, 0x0a, 0x0c, 0x73, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x54, 0x61, 0x67, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, 0x73, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x54, - 0x61, 0x67, 0x73, 0x22, 0x84, 0x01, 0x0a, 0x12, 0x46, 0x65, 0x74, 0x63, 0x68, 0x45, 0x6e, 0x74, - 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x02, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, - 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, - 0x49, 0x64, 0x52, 0x02, 0x69, 0x64, 0x12, 0x42, 0x0a, 0x0b, 0x63, 0x61, 0x72, 0x64, 0x69, 0x6e, - 0x61, 0x6c, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x64, 0x61, - 0x74, 0x61, 0x64, 0x6f, 0x67, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x54, - 0x61, 0x67, 0x43, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x0b, 0x63, - 0x61, 0x72, 0x64, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x22, 0x99, 0x01, 0x0a, 0x13, 0x46, - 0x65, 0x74, 0x63, 0x68, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x2a, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, - 0x2e, 0x64, 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x76, - 0x31, 0x2e, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x49, 0x64, 0x52, 0x02, 0x69, 0x64, 0x12, 0x42, - 0x0a, 0x0b, 0x63, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, 0x2e, 0x6d, 0x6f, - 0x64, 0x65, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x61, 0x67, 0x43, 0x61, 0x72, 0x64, 0x69, 0x6e, - 0x61, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x0b, 0x63, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x61, 0x6c, 0x69, - 0x74, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x61, 0x67, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, - 0x52, 0x04, 0x74, 0x61, 0x67, 0x73, 0x22, 0x34, 0x0a, 0x08, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, - 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x06, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, - 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x22, 0xc2, 0x01, 0x0a, - 0x10, 0x55, 0x6e, 0x69, 0x78, 0x44, 0x6f, 0x67, 0x73, 0x74, 0x61, 0x74, 0x73, 0x64, 0x4d, 0x73, - 0x67, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, - 0x20, 0x0a, 0x0b, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x53, 0x69, 0x7a, - 0x65, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x70, - 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x70, 0x69, 0x64, 0x12, 0x24, 0x0a, - 0x0d, 0x61, 0x6e, 0x63, 0x69, 0x6c, 0x6c, 0x61, 0x72, 0x79, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x61, 0x6e, 0x63, 0x69, 0x6c, 0x6c, 0x61, 0x72, 0x79, 0x53, - 0x69, 0x7a, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x6e, 0x63, 0x69, 0x6c, 0x6c, 0x61, 0x72, 0x79, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x61, 0x6e, 0x63, 0x69, 0x6c, 0x6c, 0x61, 0x72, - 0x79, 0x22, 0x9f, 0x02, 0x0a, 0x0b, 0x54, 0x61, 0x67, 0x67, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, - 0x65, 0x12, 0x3e, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x28, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, - 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x61, 0x67, 0x67, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x65, 0x2e, - 0x53, 0x74, 0x61, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, - 0x65, 0x12, 0x41, 0x0a, 0x06, 0x70, 0x69, 0x64, 0x4d, 0x61, 0x70, 0x18, 0x02, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x29, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, 0x2e, 0x6d, 0x6f, 0x64, 0x65, + 0x61, 0x67, 0x73, 0x22, 0xff, 0x04, 0x0a, 0x28, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, + 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x44, 0x46, 0x72, 0x6f, 0x6d, 0x4f, + 0x72, 0x69, 0x67, 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x67, 0x0a, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x44, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x44, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, 0x2e, 0x6d, 0x6f, + 0x64, 0x65, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x43, + 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x44, 0x46, 0x72, 0x6f, 0x6d, 0x4f, 0x72, + 0x69, 0x67, 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, + 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x44, 0x61, 0x74, 0x61, 0x48, 0x00, 0x52, 0x09, 0x6c, 0x6f, 0x63, + 0x61, 0x6c, 0x44, 0x61, 0x74, 0x61, 0x88, 0x01, 0x01, 0x12, 0x70, 0x0a, 0x0c, 0x65, 0x78, 0x74, + 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x44, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x47, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, + 0x76, 0x31, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, + 0x69, 0x6e, 0x65, 0x72, 0x49, 0x44, 0x46, 0x72, 0x6f, 0x6d, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, + 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x45, 0x78, 0x74, 0x65, + 0x72, 0x6e, 0x61, 0x6c, 0x44, 0x61, 0x74, 0x61, 0x48, 0x01, 0x52, 0x0c, 0x65, 0x78, 0x74, 0x65, + 0x72, 0x6e, 0x61, 0x6c, 0x44, 0x61, 0x74, 0x61, 0x88, 0x01, 0x01, 0x1a, 0xc0, 0x01, 0x0a, 0x09, + 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x44, 0x61, 0x74, 0x61, 0x12, 0x21, 0x0a, 0x09, 0x70, 0x72, 0x6f, + 0x63, 0x65, 0x73, 0x73, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x00, 0x52, 0x09, + 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x49, 0x44, 0x88, 0x01, 0x01, 0x12, 0x25, 0x0a, 0x0b, + 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x48, 0x01, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x44, + 0x88, 0x01, 0x01, 0x12, 0x19, 0x0a, 0x05, 0x69, 0x6e, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x04, 0x48, 0x02, 0x52, 0x05, 0x69, 0x6e, 0x6f, 0x64, 0x65, 0x88, 0x01, 0x01, 0x12, 0x1b, + 0x0a, 0x06, 0x70, 0x6f, 0x64, 0x55, 0x49, 0x44, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x48, 0x03, + 0x52, 0x06, 0x70, 0x6f, 0x64, 0x55, 0x49, 0x44, 0x88, 0x01, 0x01, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, + 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x49, 0x44, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x63, 0x6f, + 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x44, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x69, 0x6e, + 0x6f, 0x64, 0x65, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x70, 0x6f, 0x64, 0x55, 0x49, 0x44, 0x1a, 0x95, + 0x01, 0x0a, 0x0c, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x44, 0x61, 0x74, 0x61, 0x12, + 0x17, 0x0a, 0x04, 0x69, 0x6e, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, + 0x04, 0x69, 0x6e, 0x69, 0x74, 0x88, 0x01, 0x01, 0x12, 0x29, 0x0a, 0x0d, 0x63, 0x6f, 0x6e, 0x74, + 0x61, 0x69, 0x6e, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, + 0x01, 0x52, 0x0d, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, + 0x88, 0x01, 0x01, 0x12, 0x1b, 0x0a, 0x06, 0x70, 0x6f, 0x64, 0x55, 0x49, 0x44, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x48, 0x02, 0x52, 0x06, 0x70, 0x6f, 0x64, 0x55, 0x49, 0x44, 0x88, 0x01, 0x01, + 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x69, 0x6e, 0x69, 0x74, 0x42, 0x10, 0x0a, 0x0e, 0x5f, 0x63, 0x6f, + 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x42, 0x09, 0x0a, 0x07, 0x5f, + 0x70, 0x6f, 0x64, 0x55, 0x49, 0x44, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x6c, 0x6f, 0x63, 0x61, 0x6c, + 0x44, 0x61, 0x74, 0x61, 0x42, 0x0f, 0x0a, 0x0d, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, + 0x6c, 0x44, 0x61, 0x74, 0x61, 0x22, 0x4d, 0x0a, 0x29, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, + 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x44, 0x46, 0x72, 0x6f, 0x6d, + 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, + 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, + 0x65, 0x72, 0x49, 0x44, 0x22, 0x84, 0x01, 0x0a, 0x12, 0x46, 0x65, 0x74, 0x63, 0x68, 0x45, 0x6e, + 0x74, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x02, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x64, 0x6f, + 0x67, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6e, 0x74, 0x69, 0x74, + 0x79, 0x49, 0x64, 0x52, 0x02, 0x69, 0x64, 0x12, 0x42, 0x0a, 0x0b, 0x63, 0x61, 0x72, 0x64, 0x69, + 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x64, + 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x76, 0x31, 0x2e, + 0x54, 0x61, 0x67, 0x43, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x0b, + 0x63, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x22, 0x99, 0x01, 0x0a, 0x13, + 0x46, 0x65, 0x74, 0x63, 0x68, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x2a, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1a, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, + 0x76, 0x31, 0x2e, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x49, 0x64, 0x52, 0x02, 0x69, 0x64, 0x12, + 0x42, 0x0a, 0x0b, 0x63, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, 0x2e, 0x6d, + 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x61, 0x67, 0x43, 0x61, 0x72, 0x64, 0x69, + 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x0b, 0x63, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x61, 0x6c, + 0x69, 0x74, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x61, 0x67, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x04, 0x74, 0x61, 0x67, 0x73, 0x22, 0x34, 0x0a, 0x08, 0x45, 0x6e, 0x74, 0x69, 0x74, + 0x79, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x12, 0x10, 0x0a, 0x03, 0x75, + 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x22, 0xc2, 0x01, + 0x0a, 0x10, 0x55, 0x6e, 0x69, 0x78, 0x44, 0x6f, 0x67, 0x73, 0x74, 0x61, 0x74, 0x73, 0x64, 0x4d, + 0x73, 0x67, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x53, 0x69, 0x7a, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x53, 0x69, + 0x7a, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x10, 0x0a, 0x03, + 0x70, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x70, 0x69, 0x64, 0x12, 0x24, + 0x0a, 0x0d, 0x61, 0x6e, 0x63, 0x69, 0x6c, 0x6c, 0x61, 0x72, 0x79, 0x53, 0x69, 0x7a, 0x65, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x61, 0x6e, 0x63, 0x69, 0x6c, 0x6c, 0x61, 0x72, 0x79, + 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x6e, 0x63, 0x69, 0x6c, 0x6c, 0x61, 0x72, + 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x61, 0x6e, 0x63, 0x69, 0x6c, 0x6c, 0x61, + 0x72, 0x79, 0x22, 0x9f, 0x02, 0x0a, 0x0b, 0x54, 0x61, 0x67, 0x67, 0x65, 0x72, 0x53, 0x74, 0x61, + 0x74, 0x65, 0x12, 0x3e, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x28, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x61, 0x67, 0x67, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x65, - 0x2e, 0x50, 0x69, 0x64, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x70, 0x69, - 0x64, 0x4d, 0x61, 0x70, 0x1a, 0x52, 0x0a, 0x0a, 0x53, 0x74, 0x61, 0x74, 0x65, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2e, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, 0x2e, 0x6d, 0x6f, - 0x64, 0x65, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x39, 0x0a, 0x0b, 0x50, 0x69, 0x64, 0x4d, - 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, - 0x02, 0x38, 0x01, 0x22, 0x2d, 0x0a, 0x13, 0x54, 0x61, 0x67, 0x67, 0x65, 0x72, 0x53, 0x74, 0x61, - 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6c, 0x6f, - 0x61, 0x64, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x6c, 0x6f, 0x61, 0x64, - 0x65, 0x64, 0x2a, 0x31, 0x0a, 0x09, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, - 0x09, 0x0a, 0x05, 0x41, 0x44, 0x44, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x4d, 0x4f, - 0x44, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x45, 0x4c, 0x45, - 0x54, 0x45, 0x44, 0x10, 0x02, 0x2a, 0x35, 0x0a, 0x0e, 0x54, 0x61, 0x67, 0x43, 0x61, 0x72, 0x64, - 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x07, 0x0a, 0x03, 0x4c, 0x4f, 0x57, 0x10, 0x00, - 0x12, 0x10, 0x0a, 0x0c, 0x4f, 0x52, 0x43, 0x48, 0x45, 0x53, 0x54, 0x52, 0x41, 0x54, 0x4f, 0x52, - 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x48, 0x49, 0x47, 0x48, 0x10, 0x02, 0x42, 0x15, 0x5a, 0x13, - 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x62, 0x67, 0x6f, 0x2f, 0x63, - 0x6f, 0x72, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x73, 0x74, 0x61, + 0x74, 0x65, 0x12, 0x41, 0x0a, 0x06, 0x70, 0x69, 0x64, 0x4d, 0x61, 0x70, 0x18, 0x02, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, 0x2e, 0x6d, 0x6f, 0x64, + 0x65, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x61, 0x67, 0x67, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, + 0x65, 0x2e, 0x50, 0x69, 0x64, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x70, + 0x69, 0x64, 0x4d, 0x61, 0x70, 0x1a, 0x52, 0x0a, 0x0a, 0x53, 0x74, 0x61, 0x74, 0x65, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2e, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x64, 0x6f, 0x67, 0x2e, 0x6d, + 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x39, 0x0a, 0x0b, 0x50, 0x69, 0x64, + 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x3a, 0x02, 0x38, 0x01, 0x22, 0x2d, 0x0a, 0x13, 0x54, 0x61, 0x67, 0x67, 0x65, 0x72, 0x53, 0x74, + 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6c, + 0x6f, 0x61, 0x64, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x6c, 0x6f, 0x61, + 0x64, 0x65, 0x64, 0x2a, 0x31, 0x0a, 0x09, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, + 0x12, 0x09, 0x0a, 0x05, 0x41, 0x44, 0x44, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x4d, + 0x4f, 0x44, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x45, 0x4c, + 0x45, 0x54, 0x45, 0x44, 0x10, 0x02, 0x2a, 0x35, 0x0a, 0x0e, 0x54, 0x61, 0x67, 0x43, 0x61, 0x72, + 0x64, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x07, 0x0a, 0x03, 0x4c, 0x4f, 0x57, 0x10, + 0x00, 0x12, 0x10, 0x0a, 0x0c, 0x4f, 0x52, 0x43, 0x48, 0x45, 0x53, 0x54, 0x52, 0x41, 0x54, 0x4f, + 0x52, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x48, 0x49, 0x47, 0x48, 0x10, 0x02, 0x42, 0x15, 0x5a, + 0x13, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x62, 0x67, 0x6f, 0x2f, + 0x63, 0x6f, 0x72, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1164,27 +1409,31 @@ func file_datadog_model_v1_model_proto_rawDescGZIP() []byte { } var file_datadog_model_v1_model_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_datadog_model_v1_model_proto_msgTypes = make([]protoimpl.MessageInfo, 17) -var file_datadog_model_v1_model_proto_goTypes = []interface{}{ - (EventType)(0), // 0: datadog.model.v1.EventType - (TagCardinality)(0), // 1: datadog.model.v1.TagCardinality - (*HostnameRequest)(nil), // 2: datadog.model.v1.HostnameRequest - (*HostnameReply)(nil), // 3: datadog.model.v1.HostnameReply - (*CaptureTriggerRequest)(nil), // 4: datadog.model.v1.CaptureTriggerRequest - (*CaptureTriggerResponse)(nil), // 5: datadog.model.v1.CaptureTriggerResponse - (*StreamTagsRequest)(nil), // 6: datadog.model.v1.StreamTagsRequest - (*StreamTagsResponse)(nil), // 7: datadog.model.v1.StreamTagsResponse - (*StreamTagsEvent)(nil), // 8: datadog.model.v1.StreamTagsEvent - (*DeprecatedFilter)(nil), // 9: datadog.model.v1.DeprecatedFilter - (*Entity)(nil), // 10: datadog.model.v1.Entity - (*FetchEntityRequest)(nil), // 11: datadog.model.v1.FetchEntityRequest - (*FetchEntityResponse)(nil), // 12: datadog.model.v1.FetchEntityResponse - (*EntityId)(nil), // 13: datadog.model.v1.EntityId - (*UnixDogstatsdMsg)(nil), // 14: datadog.model.v1.UnixDogstatsdMsg - (*TaggerState)(nil), // 15: datadog.model.v1.TaggerState - (*TaggerStateResponse)(nil), // 16: datadog.model.v1.TaggerStateResponse - nil, // 17: datadog.model.v1.TaggerState.StateEntry - nil, // 18: datadog.model.v1.TaggerState.PidMapEntry +var file_datadog_model_v1_model_proto_msgTypes = make([]protoimpl.MessageInfo, 21) +var file_datadog_model_v1_model_proto_goTypes = []any{ + (EventType)(0), // 0: datadog.model.v1.EventType + (TagCardinality)(0), // 1: datadog.model.v1.TagCardinality + (*HostnameRequest)(nil), // 2: datadog.model.v1.HostnameRequest + (*HostnameReply)(nil), // 3: datadog.model.v1.HostnameReply + (*CaptureTriggerRequest)(nil), // 4: datadog.model.v1.CaptureTriggerRequest + (*CaptureTriggerResponse)(nil), // 5: datadog.model.v1.CaptureTriggerResponse + (*StreamTagsRequest)(nil), // 6: datadog.model.v1.StreamTagsRequest + (*StreamTagsResponse)(nil), // 7: datadog.model.v1.StreamTagsResponse + (*StreamTagsEvent)(nil), // 8: datadog.model.v1.StreamTagsEvent + (*DeprecatedFilter)(nil), // 9: datadog.model.v1.DeprecatedFilter + (*Entity)(nil), // 10: datadog.model.v1.Entity + (*GenerateContainerIDFromOriginInfoRequest)(nil), // 11: datadog.model.v1.GenerateContainerIDFromOriginInfoRequest + (*GenerateContainerIDFromOriginInfoResponse)(nil), // 12: datadog.model.v1.GenerateContainerIDFromOriginInfoResponse + (*FetchEntityRequest)(nil), // 13: datadog.model.v1.FetchEntityRequest + (*FetchEntityResponse)(nil), // 14: datadog.model.v1.FetchEntityResponse + (*EntityId)(nil), // 15: datadog.model.v1.EntityId + (*UnixDogstatsdMsg)(nil), // 16: datadog.model.v1.UnixDogstatsdMsg + (*TaggerState)(nil), // 17: datadog.model.v1.TaggerState + (*TaggerStateResponse)(nil), // 18: datadog.model.v1.TaggerStateResponse + (*GenerateContainerIDFromOriginInfoRequest_LocalData)(nil), // 19: datadog.model.v1.GenerateContainerIDFromOriginInfoRequest.LocalData + (*GenerateContainerIDFromOriginInfoRequest_ExternalData)(nil), // 20: datadog.model.v1.GenerateContainerIDFromOriginInfoRequest.ExternalData + nil, // 21: datadog.model.v1.TaggerState.StateEntry + nil, // 22: datadog.model.v1.TaggerState.PidMapEntry } var file_datadog_model_v1_model_proto_depIdxs = []int32{ 1, // 0: datadog.model.v1.StreamTagsRequest.cardinality:type_name -> datadog.model.v1.TagCardinality @@ -1193,19 +1442,21 @@ var file_datadog_model_v1_model_proto_depIdxs = []int32{ 8, // 3: datadog.model.v1.StreamTagsResponse.events:type_name -> datadog.model.v1.StreamTagsEvent 0, // 4: datadog.model.v1.StreamTagsEvent.type:type_name -> datadog.model.v1.EventType 10, // 5: datadog.model.v1.StreamTagsEvent.entity:type_name -> datadog.model.v1.Entity - 13, // 6: datadog.model.v1.Entity.id:type_name -> datadog.model.v1.EntityId - 13, // 7: datadog.model.v1.FetchEntityRequest.id:type_name -> datadog.model.v1.EntityId - 1, // 8: datadog.model.v1.FetchEntityRequest.cardinality:type_name -> datadog.model.v1.TagCardinality - 13, // 9: datadog.model.v1.FetchEntityResponse.id:type_name -> datadog.model.v1.EntityId - 1, // 10: datadog.model.v1.FetchEntityResponse.cardinality:type_name -> datadog.model.v1.TagCardinality - 17, // 11: datadog.model.v1.TaggerState.state:type_name -> datadog.model.v1.TaggerState.StateEntry - 18, // 12: datadog.model.v1.TaggerState.pidMap:type_name -> datadog.model.v1.TaggerState.PidMapEntry - 10, // 13: datadog.model.v1.TaggerState.StateEntry.value:type_name -> datadog.model.v1.Entity - 14, // [14:14] is the sub-list for method output_type - 14, // [14:14] is the sub-list for method input_type - 14, // [14:14] is the sub-list for extension type_name - 14, // [14:14] is the sub-list for extension extendee - 0, // [0:14] is the sub-list for field type_name + 15, // 6: datadog.model.v1.Entity.id:type_name -> datadog.model.v1.EntityId + 19, // 7: datadog.model.v1.GenerateContainerIDFromOriginInfoRequest.localData:type_name -> datadog.model.v1.GenerateContainerIDFromOriginInfoRequest.LocalData + 20, // 8: datadog.model.v1.GenerateContainerIDFromOriginInfoRequest.externalData:type_name -> datadog.model.v1.GenerateContainerIDFromOriginInfoRequest.ExternalData + 15, // 9: datadog.model.v1.FetchEntityRequest.id:type_name -> datadog.model.v1.EntityId + 1, // 10: datadog.model.v1.FetchEntityRequest.cardinality:type_name -> datadog.model.v1.TagCardinality + 15, // 11: datadog.model.v1.FetchEntityResponse.id:type_name -> datadog.model.v1.EntityId + 1, // 12: datadog.model.v1.FetchEntityResponse.cardinality:type_name -> datadog.model.v1.TagCardinality + 21, // 13: datadog.model.v1.TaggerState.state:type_name -> datadog.model.v1.TaggerState.StateEntry + 22, // 14: datadog.model.v1.TaggerState.pidMap:type_name -> datadog.model.v1.TaggerState.PidMapEntry + 10, // 15: datadog.model.v1.TaggerState.StateEntry.value:type_name -> datadog.model.v1.Entity + 16, // [16:16] is the sub-list for method output_type + 16, // [16:16] is the sub-list for method input_type + 16, // [16:16] is the sub-list for extension type_name + 16, // [16:16] is the sub-list for extension extendee + 0, // [0:16] is the sub-list for field type_name } func init() { file_datadog_model_v1_model_proto_init() } @@ -1213,195 +1464,16 @@ func file_datadog_model_v1_model_proto_init() { if File_datadog_model_v1_model_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_datadog_model_v1_model_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HostnameRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_datadog_model_v1_model_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HostnameReply); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_datadog_model_v1_model_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CaptureTriggerRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_datadog_model_v1_model_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CaptureTriggerResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_datadog_model_v1_model_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StreamTagsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_datadog_model_v1_model_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StreamTagsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_datadog_model_v1_model_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StreamTagsEvent); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_datadog_model_v1_model_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeprecatedFilter); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_datadog_model_v1_model_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Entity); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_datadog_model_v1_model_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FetchEntityRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_datadog_model_v1_model_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FetchEntityResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_datadog_model_v1_model_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EntityId); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_datadog_model_v1_model_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UnixDogstatsdMsg); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_datadog_model_v1_model_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TaggerState); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_datadog_model_v1_model_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TaggerStateResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } + file_datadog_model_v1_model_proto_msgTypes[9].OneofWrappers = []any{} + file_datadog_model_v1_model_proto_msgTypes[17].OneofWrappers = []any{} + file_datadog_model_v1_model_proto_msgTypes[18].OneofWrappers = []any{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_datadog_model_v1_model_proto_rawDesc, NumEnums: 2, - NumMessages: 17, + NumMessages: 21, NumExtensions: 0, NumServices: 0, }, diff --git a/pkg/proto/pbgo/core/remoteagent.pb.go b/pkg/proto/pbgo/core/remoteagent.pb.go index 0893ee22f3ec9..4e048d389b713 100644 --- a/pkg/proto/pbgo/core/remoteagent.pb.go +++ b/pkg/proto/pbgo/core/remoteagent.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.0 +// protoc-gen-go v1.35.2 // protoc v5.26.1 // source: datadog/remoteagent/remoteagent.proto @@ -30,11 +30,9 @@ type StatusSection struct { func (x *StatusSection) Reset() { *x = StatusSection{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_remoteagent_remoteagent_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_remoteagent_remoteagent_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *StatusSection) String() string { @@ -45,7 +43,7 @@ func (*StatusSection) ProtoMessage() {} func (x *StatusSection) ProtoReflect() protoreflect.Message { mi := &file_datadog_remoteagent_remoteagent_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -98,11 +96,9 @@ type RegisterRemoteAgentRequest struct { func (x *RegisterRemoteAgentRequest) Reset() { *x = RegisterRemoteAgentRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_remoteagent_remoteagent_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_remoteagent_remoteagent_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *RegisterRemoteAgentRequest) String() string { @@ -113,7 +109,7 @@ func (*RegisterRemoteAgentRequest) ProtoMessage() {} func (x *RegisterRemoteAgentRequest) ProtoReflect() protoreflect.Message { mi := &file_datadog_remoteagent_remoteagent_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -172,11 +168,9 @@ type RegisterRemoteAgentResponse struct { func (x *RegisterRemoteAgentResponse) Reset() { *x = RegisterRemoteAgentResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_remoteagent_remoteagent_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_remoteagent_remoteagent_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *RegisterRemoteAgentResponse) String() string { @@ -187,7 +181,7 @@ func (*RegisterRemoteAgentResponse) ProtoMessage() {} func (x *RegisterRemoteAgentResponse) ProtoReflect() protoreflect.Message { mi := &file_datadog_remoteagent_remoteagent_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -217,11 +211,9 @@ type GetStatusDetailsRequest struct { func (x *GetStatusDetailsRequest) Reset() { *x = GetStatusDetailsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_remoteagent_remoteagent_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_remoteagent_remoteagent_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetStatusDetailsRequest) String() string { @@ -232,7 +224,7 @@ func (*GetStatusDetailsRequest) ProtoMessage() {} func (x *GetStatusDetailsRequest) ProtoReflect() protoreflect.Message { mi := &file_datadog_remoteagent_remoteagent_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -264,11 +256,9 @@ type GetStatusDetailsResponse struct { func (x *GetStatusDetailsResponse) Reset() { *x = GetStatusDetailsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_remoteagent_remoteagent_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_remoteagent_remoteagent_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetStatusDetailsResponse) String() string { @@ -279,7 +269,7 @@ func (*GetStatusDetailsResponse) ProtoMessage() {} func (x *GetStatusDetailsResponse) ProtoReflect() protoreflect.Message { mi := &file_datadog_remoteagent_remoteagent_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -316,11 +306,9 @@ type GetFlareFilesRequest struct { func (x *GetFlareFilesRequest) Reset() { *x = GetFlareFilesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_remoteagent_remoteagent_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_remoteagent_remoteagent_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetFlareFilesRequest) String() string { @@ -331,7 +319,7 @@ func (*GetFlareFilesRequest) ProtoMessage() {} func (x *GetFlareFilesRequest) ProtoReflect() protoreflect.Message { mi := &file_datadog_remoteagent_remoteagent_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -363,11 +351,9 @@ type GetFlareFilesResponse struct { func (x *GetFlareFilesResponse) Reset() { *x = GetFlareFilesResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_remoteagent_remoteagent_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_remoteagent_remoteagent_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetFlareFilesResponse) String() string { @@ -378,7 +364,7 @@ func (*GetFlareFilesResponse) ProtoMessage() {} func (x *GetFlareFilesResponse) ProtoReflect() protoreflect.Message { mi := &file_datadog_remoteagent_remoteagent_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -482,7 +468,7 @@ func file_datadog_remoteagent_remoteagent_proto_rawDescGZIP() []byte { } var file_datadog_remoteagent_remoteagent_proto_msgTypes = make([]protoimpl.MessageInfo, 10) -var file_datadog_remoteagent_remoteagent_proto_goTypes = []interface{}{ +var file_datadog_remoteagent_remoteagent_proto_goTypes = []any{ (*StatusSection)(nil), // 0: datadog.remoteagent.StatusSection (*RegisterRemoteAgentRequest)(nil), // 1: datadog.remoteagent.RegisterRemoteAgentRequest (*RegisterRemoteAgentResponse)(nil), // 2: datadog.remoteagent.RegisterRemoteAgentResponse @@ -512,92 +498,6 @@ func file_datadog_remoteagent_remoteagent_proto_init() { if File_datadog_remoteagent_remoteagent_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_datadog_remoteagent_remoteagent_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StatusSection); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_datadog_remoteagent_remoteagent_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RegisterRemoteAgentRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_datadog_remoteagent_remoteagent_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RegisterRemoteAgentResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_datadog_remoteagent_remoteagent_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetStatusDetailsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_datadog_remoteagent_remoteagent_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetStatusDetailsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_datadog_remoteagent_remoteagent_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetFlareFilesRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_datadog_remoteagent_remoteagent_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetFlareFilesResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/pkg/proto/pbgo/core/remoteconfig.pb.go b/pkg/proto/pbgo/core/remoteconfig.pb.go index 37f3f8aea7592..cfd551d59b690 100644 --- a/pkg/proto/pbgo/core/remoteconfig.pb.go +++ b/pkg/proto/pbgo/core/remoteconfig.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.2 -// protoc v5.28.3 +// protoc-gen-go v1.35.2 +// protoc v5.26.1 // source: datadog/remoteconfig/remoteconfig.proto package core @@ -89,11 +89,9 @@ type ConfigMetas struct { func (x *ConfigMetas) Reset() { *x = ConfigMetas{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ConfigMetas) String() string { @@ -104,7 +102,7 @@ func (*ConfigMetas) ProtoMessage() {} func (x *ConfigMetas) ProtoReflect() protoreflect.Message { mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -167,11 +165,9 @@ type DirectorMetas struct { func (x *DirectorMetas) Reset() { *x = DirectorMetas{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *DirectorMetas) String() string { @@ -182,7 +178,7 @@ func (*DirectorMetas) ProtoMessage() {} func (x *DirectorMetas) ProtoReflect() protoreflect.Message { mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -237,11 +233,9 @@ type DelegatedMeta struct { func (x *DelegatedMeta) Reset() { *x = DelegatedMeta{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *DelegatedMeta) String() string { @@ -252,7 +246,7 @@ func (*DelegatedMeta) ProtoMessage() {} func (x *DelegatedMeta) ProtoReflect() protoreflect.Message { mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -299,11 +293,9 @@ type TopMeta struct { func (x *TopMeta) Reset() { *x = TopMeta{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *TopMeta) String() string { @@ -314,7 +306,7 @@ func (*TopMeta) ProtoMessage() {} func (x *TopMeta) ProtoReflect() protoreflect.Message { mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -354,11 +346,9 @@ type File struct { func (x *File) Reset() { *x = File{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *File) String() string { @@ -369,7 +359,7 @@ func (*File) ProtoMessage() {} func (x *File) ProtoReflect() protoreflect.Message { mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -423,11 +413,9 @@ type LatestConfigsRequest struct { func (x *LatestConfigsRequest) Reset() { *x = LatestConfigsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *LatestConfigsRequest) String() string { @@ -438,7 +426,7 @@ func (*LatestConfigsRequest) ProtoMessage() {} func (x *LatestConfigsRequest) ProtoReflect() protoreflect.Message { mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -570,11 +558,9 @@ type LatestConfigsResponse struct { func (x *LatestConfigsResponse) Reset() { *x = LatestConfigsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *LatestConfigsResponse) String() string { @@ -585,7 +571,7 @@ func (*LatestConfigsResponse) ProtoMessage() {} func (x *LatestConfigsResponse) ProtoReflect() protoreflect.Message { mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -631,11 +617,9 @@ type OrgDataResponse struct { func (x *OrgDataResponse) Reset() { *x = OrgDataResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *OrgDataResponse) String() string { @@ -646,7 +630,7 @@ func (*OrgDataResponse) ProtoMessage() {} func (x *OrgDataResponse) ProtoReflect() protoreflect.Message { mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -679,11 +663,9 @@ type OrgStatusResponse struct { func (x *OrgStatusResponse) Reset() { *x = OrgStatusResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *OrgStatusResponse) String() string { @@ -694,7 +676,7 @@ func (*OrgStatusResponse) ProtoMessage() {} func (x *OrgStatusResponse) ProtoReflect() protoreflect.Message { mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -743,11 +725,9 @@ type Client struct { func (x *Client) Reset() { *x = Client{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Client) String() string { @@ -758,7 +738,7 @@ func (*Client) ProtoMessage() {} func (x *Client) ProtoReflect() protoreflect.Message { mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -867,11 +847,9 @@ type ClientTracer struct { func (x *ClientTracer) Reset() { *x = ClientTracer{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ClientTracer) String() string { @@ -882,7 +860,7 @@ func (*ClientTracer) ProtoMessage() {} func (x *ClientTracer) ProtoReflect() protoreflect.Message { mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -967,11 +945,9 @@ type ClientAgent struct { func (x *ClientAgent) Reset() { *x = ClientAgent{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ClientAgent) String() string { @@ -982,7 +958,7 @@ func (*ClientAgent) ProtoMessage() {} func (x *ClientAgent) ProtoReflect() protoreflect.Message { mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[11] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1044,11 +1020,9 @@ type ClientUpdater struct { func (x *ClientUpdater) Reset() { *x = ClientUpdater{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ClientUpdater) String() string { @@ -1059,7 +1033,7 @@ func (*ClientUpdater) ProtoMessage() {} func (x *ClientUpdater) ProtoReflect() protoreflect.Message { mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[12] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1111,11 +1085,9 @@ type PackageState struct { func (x *PackageState) Reset() { *x = PackageState{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *PackageState) String() string { @@ -1126,7 +1098,7 @@ func (*PackageState) ProtoMessage() {} func (x *PackageState) ProtoReflect() protoreflect.Message { mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[13] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1201,11 +1173,9 @@ type PoliciesState struct { func (x *PoliciesState) Reset() { *x = PoliciesState{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *PoliciesState) String() string { @@ -1216,7 +1186,7 @@ func (*PoliciesState) ProtoMessage() {} func (x *PoliciesState) ProtoReflect() protoreflect.Message { mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[14] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1257,11 +1227,9 @@ type PackageStateTask struct { func (x *PackageStateTask) Reset() { *x = PackageStateTask{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *PackageStateTask) String() string { @@ -1272,7 +1240,7 @@ func (*PackageStateTask) ProtoMessage() {} func (x *PackageStateTask) ProtoReflect() protoreflect.Message { mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[15] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1319,11 +1287,9 @@ type TaskError struct { func (x *TaskError) Reset() { *x = TaskError{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *TaskError) String() string { @@ -1334,7 +1300,7 @@ func (*TaskError) ProtoMessage() {} func (x *TaskError) ProtoReflect() protoreflect.Message { mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[16] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1377,11 +1343,9 @@ type ConfigState struct { func (x *ConfigState) Reset() { *x = ConfigState{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[17] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ConfigState) String() string { @@ -1392,7 +1356,7 @@ func (*ConfigState) ProtoMessage() {} func (x *ConfigState) ProtoReflect() protoreflect.Message { mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[17] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1457,11 +1421,9 @@ type ClientState struct { func (x *ClientState) Reset() { *x = ClientState{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[18] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ClientState) String() string { @@ -1472,7 +1434,7 @@ func (*ClientState) ProtoMessage() {} func (x *ClientState) ProtoReflect() protoreflect.Message { mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[18] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1540,11 +1502,9 @@ type TargetFileHash struct { func (x *TargetFileHash) Reset() { *x = TargetFileHash{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[19] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *TargetFileHash) String() string { @@ -1555,7 +1515,7 @@ func (*TargetFileHash) ProtoMessage() {} func (x *TargetFileHash) ProtoReflect() protoreflect.Message { mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[19] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1596,11 +1556,9 @@ type TargetFileMeta struct { func (x *TargetFileMeta) Reset() { *x = TargetFileMeta{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[20] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *TargetFileMeta) String() string { @@ -1611,7 +1569,7 @@ func (*TargetFileMeta) ProtoMessage() {} func (x *TargetFileMeta) ProtoReflect() protoreflect.Message { mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[20] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1658,11 +1616,9 @@ type ClientGetConfigsRequest struct { func (x *ClientGetConfigsRequest) Reset() { *x = ClientGetConfigsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[21] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ClientGetConfigsRequest) String() string { @@ -1673,7 +1629,7 @@ func (*ClientGetConfigsRequest) ProtoMessage() {} func (x *ClientGetConfigsRequest) ProtoReflect() protoreflect.Message { mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[21] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1715,11 +1671,9 @@ type ClientGetConfigsResponse struct { func (x *ClientGetConfigsResponse) Reset() { *x = ClientGetConfigsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[22] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ClientGetConfigsResponse) String() string { @@ -1730,7 +1684,7 @@ func (*ClientGetConfigsResponse) ProtoMessage() {} func (x *ClientGetConfigsResponse) ProtoReflect() protoreflect.Message { mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[22] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1784,11 +1738,9 @@ type FileMetaState struct { func (x *FileMetaState) Reset() { *x = FileMetaState{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[23] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *FileMetaState) String() string { @@ -1799,7 +1751,7 @@ func (*FileMetaState) ProtoMessage() {} func (x *FileMetaState) ProtoReflect() protoreflect.Message { mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[23] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1841,11 +1793,9 @@ type GetStateConfigResponse struct { func (x *GetStateConfigResponse) Reset() { *x = GetStateConfigResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[24] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetStateConfigResponse) String() string { @@ -1856,7 +1806,7 @@ func (*GetStateConfigResponse) ProtoMessage() {} func (x *GetStateConfigResponse) ProtoReflect() protoreflect.Message { mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[24] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1915,11 +1865,9 @@ type TracerPredicateV1 struct { func (x *TracerPredicateV1) Reset() { *x = TracerPredicateV1{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[25] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *TracerPredicateV1) String() string { @@ -1930,7 +1878,7 @@ func (*TracerPredicateV1) ProtoMessage() {} func (x *TracerPredicateV1) ProtoReflect() protoreflect.Message { mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[25] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -2004,11 +1952,9 @@ type TracerPredicates struct { func (x *TracerPredicates) Reset() { *x = TracerPredicates{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[26] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *TracerPredicates) String() string { @@ -2019,7 +1965,7 @@ func (*TracerPredicates) ProtoMessage() {} func (x *TracerPredicates) ProtoReflect() protoreflect.Message { mi := &file_datadog_remoteconfig_remoteconfig_proto_msgTypes[26] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -2492,332 +2438,6 @@ func file_datadog_remoteconfig_remoteconfig_proto_init() { if File_datadog_remoteconfig_remoteconfig_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_datadog_remoteconfig_remoteconfig_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*ConfigMetas); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_datadog_remoteconfig_remoteconfig_proto_msgTypes[1].Exporter = func(v any, i int) any { - switch v := v.(*DirectorMetas); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_datadog_remoteconfig_remoteconfig_proto_msgTypes[2].Exporter = func(v any, i int) any { - switch v := v.(*DelegatedMeta); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_datadog_remoteconfig_remoteconfig_proto_msgTypes[3].Exporter = func(v any, i int) any { - switch v := v.(*TopMeta); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_datadog_remoteconfig_remoteconfig_proto_msgTypes[4].Exporter = func(v any, i int) any { - switch v := v.(*File); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_datadog_remoteconfig_remoteconfig_proto_msgTypes[5].Exporter = func(v any, i int) any { - switch v := v.(*LatestConfigsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_datadog_remoteconfig_remoteconfig_proto_msgTypes[6].Exporter = func(v any, i int) any { - switch v := v.(*LatestConfigsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_datadog_remoteconfig_remoteconfig_proto_msgTypes[7].Exporter = func(v any, i int) any { - switch v := v.(*OrgDataResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_datadog_remoteconfig_remoteconfig_proto_msgTypes[8].Exporter = func(v any, i int) any { - switch v := v.(*OrgStatusResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_datadog_remoteconfig_remoteconfig_proto_msgTypes[9].Exporter = func(v any, i int) any { - switch v := v.(*Client); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_datadog_remoteconfig_remoteconfig_proto_msgTypes[10].Exporter = func(v any, i int) any { - switch v := v.(*ClientTracer); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_datadog_remoteconfig_remoteconfig_proto_msgTypes[11].Exporter = func(v any, i int) any { - switch v := v.(*ClientAgent); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_datadog_remoteconfig_remoteconfig_proto_msgTypes[12].Exporter = func(v any, i int) any { - switch v := v.(*ClientUpdater); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_datadog_remoteconfig_remoteconfig_proto_msgTypes[13].Exporter = func(v any, i int) any { - switch v := v.(*PackageState); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_datadog_remoteconfig_remoteconfig_proto_msgTypes[14].Exporter = func(v any, i int) any { - switch v := v.(*PoliciesState); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_datadog_remoteconfig_remoteconfig_proto_msgTypes[15].Exporter = func(v any, i int) any { - switch v := v.(*PackageStateTask); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_datadog_remoteconfig_remoteconfig_proto_msgTypes[16].Exporter = func(v any, i int) any { - switch v := v.(*TaskError); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_datadog_remoteconfig_remoteconfig_proto_msgTypes[17].Exporter = func(v any, i int) any { - switch v := v.(*ConfigState); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_datadog_remoteconfig_remoteconfig_proto_msgTypes[18].Exporter = func(v any, i int) any { - switch v := v.(*ClientState); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_datadog_remoteconfig_remoteconfig_proto_msgTypes[19].Exporter = func(v any, i int) any { - switch v := v.(*TargetFileHash); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_datadog_remoteconfig_remoteconfig_proto_msgTypes[20].Exporter = func(v any, i int) any { - switch v := v.(*TargetFileMeta); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_datadog_remoteconfig_remoteconfig_proto_msgTypes[21].Exporter = func(v any, i int) any { - switch v := v.(*ClientGetConfigsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_datadog_remoteconfig_remoteconfig_proto_msgTypes[22].Exporter = func(v any, i int) any { - switch v := v.(*ClientGetConfigsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_datadog_remoteconfig_remoteconfig_proto_msgTypes[23].Exporter = func(v any, i int) any { - switch v := v.(*FileMetaState); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_datadog_remoteconfig_remoteconfig_proto_msgTypes[24].Exporter = func(v any, i int) any { - switch v := v.(*GetStateConfigResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_datadog_remoteconfig_remoteconfig_proto_msgTypes[25].Exporter = func(v any, i int) any { - switch v := v.(*TracerPredicateV1); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_datadog_remoteconfig_remoteconfig_proto_msgTypes[26].Exporter = func(v any, i int) any { - switch v := v.(*TracerPredicates); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/pkg/proto/pbgo/core/workloadmeta.pb.go b/pkg/proto/pbgo/core/workloadmeta.pb.go index 1cd608ebe19d1..a6299b85850fb 100644 --- a/pkg/proto/pbgo/core/workloadmeta.pb.go +++ b/pkg/proto/pbgo/core/workloadmeta.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.0 +// protoc-gen-go v1.35.2 // protoc v5.26.1 // source: datadog/workloadmeta/workloadmeta.proto @@ -393,11 +393,9 @@ type WorkloadmetaFilter struct { func (x *WorkloadmetaFilter) Reset() { *x = WorkloadmetaFilter{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_workloadmeta_workloadmeta_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_workloadmeta_workloadmeta_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *WorkloadmetaFilter) String() string { @@ -408,7 +406,7 @@ func (*WorkloadmetaFilter) ProtoMessage() {} func (x *WorkloadmetaFilter) ProtoReflect() protoreflect.Message { mi := &file_datadog_workloadmeta_workloadmeta_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -454,11 +452,9 @@ type WorkloadmetaStreamRequest struct { func (x *WorkloadmetaStreamRequest) Reset() { *x = WorkloadmetaStreamRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_workloadmeta_workloadmeta_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_workloadmeta_workloadmeta_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *WorkloadmetaStreamRequest) String() string { @@ -469,7 +465,7 @@ func (*WorkloadmetaStreamRequest) ProtoMessage() {} func (x *WorkloadmetaStreamRequest) ProtoReflect() protoreflect.Message { mi := &file_datadog_workloadmeta_workloadmeta_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -502,11 +498,9 @@ type WorkloadmetaEntityId struct { func (x *WorkloadmetaEntityId) Reset() { *x = WorkloadmetaEntityId{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_workloadmeta_workloadmeta_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_workloadmeta_workloadmeta_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *WorkloadmetaEntityId) String() string { @@ -517,7 +511,7 @@ func (*WorkloadmetaEntityId) ProtoMessage() {} func (x *WorkloadmetaEntityId) ProtoReflect() protoreflect.Message { mi := &file_datadog_workloadmeta_workloadmeta_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -559,11 +553,9 @@ type EntityMeta struct { func (x *EntityMeta) Reset() { *x = EntityMeta{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_workloadmeta_workloadmeta_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_workloadmeta_workloadmeta_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *EntityMeta) String() string { @@ -574,7 +566,7 @@ func (*EntityMeta) ProtoMessage() {} func (x *EntityMeta) ProtoReflect() protoreflect.Message { mi := &file_datadog_workloadmeta_workloadmeta_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -632,11 +624,9 @@ type ContainerImage struct { func (x *ContainerImage) Reset() { *x = ContainerImage{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_workloadmeta_workloadmeta_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_workloadmeta_workloadmeta_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ContainerImage) String() string { @@ -647,7 +637,7 @@ func (*ContainerImage) ProtoMessage() {} func (x *ContainerImage) ProtoReflect() protoreflect.Message { mi := &file_datadog_workloadmeta_workloadmeta_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -716,11 +706,9 @@ type ContainerPort struct { func (x *ContainerPort) Reset() { *x = ContainerPort{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_workloadmeta_workloadmeta_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_workloadmeta_workloadmeta_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ContainerPort) String() string { @@ -731,7 +719,7 @@ func (*ContainerPort) ProtoMessage() {} func (x *ContainerPort) ProtoReflect() protoreflect.Message { mi := &file_datadog_workloadmeta_workloadmeta_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -783,11 +771,9 @@ type ContainerState struct { func (x *ContainerState) Reset() { *x = ContainerState{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_workloadmeta_workloadmeta_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_workloadmeta_workloadmeta_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ContainerState) String() string { @@ -798,7 +784,7 @@ func (*ContainerState) ProtoMessage() {} func (x *ContainerState) ProtoReflect() protoreflect.Message { mi := &file_datadog_workloadmeta_workloadmeta_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -883,11 +869,9 @@ type Container struct { func (x *Container) Reset() { *x = Container{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_workloadmeta_workloadmeta_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_workloadmeta_workloadmeta_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Container) String() string { @@ -898,7 +882,7 @@ func (*Container) ProtoMessage() {} func (x *Container) ProtoReflect() protoreflect.Message { mi := &file_datadog_workloadmeta_workloadmeta_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1009,11 +993,9 @@ type KubernetesPodOwner struct { func (x *KubernetesPodOwner) Reset() { *x = KubernetesPodOwner{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_workloadmeta_workloadmeta_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_workloadmeta_workloadmeta_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *KubernetesPodOwner) String() string { @@ -1024,7 +1006,7 @@ func (*KubernetesPodOwner) ProtoMessage() {} func (x *KubernetesPodOwner) ProtoReflect() protoreflect.Message { mi := &file_datadog_workloadmeta_workloadmeta_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1072,11 +1054,9 @@ type OrchestratorContainer struct { func (x *OrchestratorContainer) Reset() { *x = OrchestratorContainer{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_workloadmeta_workloadmeta_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_workloadmeta_workloadmeta_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *OrchestratorContainer) String() string { @@ -1087,7 +1067,7 @@ func (*OrchestratorContainer) ProtoMessage() {} func (x *OrchestratorContainer) ProtoReflect() protoreflect.Message { mi := &file_datadog_workloadmeta_workloadmeta_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1146,11 +1126,9 @@ type KubernetesPod struct { func (x *KubernetesPod) Reset() { *x = KubernetesPod{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_workloadmeta_workloadmeta_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_workloadmeta_workloadmeta_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *KubernetesPod) String() string { @@ -1161,7 +1139,7 @@ func (*KubernetesPod) ProtoMessage() {} func (x *KubernetesPod) ProtoReflect() protoreflect.Message { mi := &file_datadog_workloadmeta_workloadmeta_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1295,11 +1273,9 @@ type ECSTask struct { func (x *ECSTask) Reset() { *x = ECSTask{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_workloadmeta_workloadmeta_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_workloadmeta_workloadmeta_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ECSTask) String() string { @@ -1310,7 +1286,7 @@ func (*ECSTask) ProtoMessage() {} func (x *ECSTask) ProtoReflect() protoreflect.Message { mi := &file_datadog_workloadmeta_workloadmeta_proto_msgTypes[11] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1422,11 +1398,9 @@ type WorkloadmetaEvent struct { func (x *WorkloadmetaEvent) Reset() { *x = WorkloadmetaEvent{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_workloadmeta_workloadmeta_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_workloadmeta_workloadmeta_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *WorkloadmetaEvent) String() string { @@ -1437,7 +1411,7 @@ func (*WorkloadmetaEvent) ProtoMessage() {} func (x *WorkloadmetaEvent) ProtoReflect() protoreflect.Message { mi := &file_datadog_workloadmeta_workloadmeta_proto_msgTypes[12] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1490,11 +1464,9 @@ type WorkloadmetaStreamResponse struct { func (x *WorkloadmetaStreamResponse) Reset() { *x = WorkloadmetaStreamResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_workloadmeta_workloadmeta_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_workloadmeta_workloadmeta_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *WorkloadmetaStreamResponse) String() string { @@ -1505,7 +1477,7 @@ func (*WorkloadmetaStreamResponse) ProtoMessage() {} func (x *WorkloadmetaStreamResponse) ProtoReflect() protoreflect.Message { mi := &file_datadog_workloadmeta_workloadmeta_proto_msgTypes[13] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1862,7 +1834,7 @@ func file_datadog_workloadmeta_workloadmeta_proto_rawDescGZIP() []byte { var file_datadog_workloadmeta_workloadmeta_proto_enumTypes = make([]protoimpl.EnumInfo, 7) var file_datadog_workloadmeta_workloadmeta_proto_msgTypes = make([]protoimpl.MessageInfo, 21) -var file_datadog_workloadmeta_workloadmeta_proto_goTypes = []interface{}{ +var file_datadog_workloadmeta_workloadmeta_proto_goTypes = []any{ (WorkloadmetaKind)(0), // 0: datadog.workloadmeta.WorkloadmetaKind (WorkloadmetaSource)(0), // 1: datadog.workloadmeta.WorkloadmetaSource (WorkloadmetaEventType)(0), // 2: datadog.workloadmeta.WorkloadmetaEventType @@ -1940,176 +1912,6 @@ func file_datadog_workloadmeta_workloadmeta_proto_init() { if File_datadog_workloadmeta_workloadmeta_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_datadog_workloadmeta_workloadmeta_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*WorkloadmetaFilter); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_datadog_workloadmeta_workloadmeta_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*WorkloadmetaStreamRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_datadog_workloadmeta_workloadmeta_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*WorkloadmetaEntityId); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_datadog_workloadmeta_workloadmeta_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EntityMeta); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_datadog_workloadmeta_workloadmeta_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ContainerImage); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_datadog_workloadmeta_workloadmeta_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ContainerPort); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_datadog_workloadmeta_workloadmeta_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ContainerState); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_datadog_workloadmeta_workloadmeta_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Container); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_datadog_workloadmeta_workloadmeta_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*KubernetesPodOwner); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_datadog_workloadmeta_workloadmeta_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*OrchestratorContainer); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_datadog_workloadmeta_workloadmeta_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*KubernetesPod); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_datadog_workloadmeta_workloadmeta_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ECSTask); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_datadog_workloadmeta_workloadmeta_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*WorkloadmetaEvent); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_datadog_workloadmeta_workloadmeta_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*WorkloadmetaStreamResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/pkg/proto/pbgo/languagedetection/api.pb.go b/pkg/proto/pbgo/languagedetection/api.pb.go index f2c09323e3822..8b0005ef541f8 100644 --- a/pkg/proto/pbgo/languagedetection/api.pb.go +++ b/pkg/proto/pbgo/languagedetection/api.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.0 +// protoc-gen-go v1.35.2 // protoc v5.26.1 // source: datadog/languagedetection/api.proto @@ -32,11 +32,9 @@ type Process struct { func (x *Process) Reset() { *x = Process{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_languagedetection_api_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_languagedetection_api_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Process) String() string { @@ -47,7 +45,7 @@ func (*Process) ProtoMessage() {} func (x *Process) ProtoReflect() protoreflect.Message { mi := &file_datadog_languagedetection_api_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -95,11 +93,9 @@ type Language struct { func (x *Language) Reset() { *x = Language{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_languagedetection_api_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_languagedetection_api_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Language) String() string { @@ -110,7 +106,7 @@ func (*Language) ProtoMessage() {} func (x *Language) ProtoReflect() protoreflect.Message { mi := &file_datadog_languagedetection_api_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -149,11 +145,9 @@ type DetectLanguageRequest struct { func (x *DetectLanguageRequest) Reset() { *x = DetectLanguageRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_languagedetection_api_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_languagedetection_api_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *DetectLanguageRequest) String() string { @@ -164,7 +158,7 @@ func (*DetectLanguageRequest) ProtoMessage() {} func (x *DetectLanguageRequest) ProtoReflect() protoreflect.Message { mi := &file_datadog_languagedetection_api_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -196,11 +190,9 @@ type DetectLanguageResponse struct { func (x *DetectLanguageResponse) Reset() { *x = DetectLanguageResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_languagedetection_api_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_languagedetection_api_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *DetectLanguageResponse) String() string { @@ -211,7 +203,7 @@ func (*DetectLanguageResponse) ProtoMessage() {} func (x *DetectLanguageResponse) ProtoReflect() protoreflect.Message { mi := &file_datadog_languagedetection_api_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -278,7 +270,7 @@ func file_datadog_languagedetection_api_proto_rawDescGZIP() []byte { } var file_datadog_languagedetection_api_proto_msgTypes = make([]protoimpl.MessageInfo, 4) -var file_datadog_languagedetection_api_proto_goTypes = []interface{}{ +var file_datadog_languagedetection_api_proto_goTypes = []any{ (*Process)(nil), // 0: datadog.languagedetection.Process (*Language)(nil), // 1: datadog.languagedetection.Language (*DetectLanguageRequest)(nil), // 2: datadog.languagedetection.DetectLanguageRequest @@ -299,56 +291,6 @@ func file_datadog_languagedetection_api_proto_init() { if File_datadog_languagedetection_api_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_datadog_languagedetection_api_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Process); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_datadog_languagedetection_api_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Language); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_datadog_languagedetection_api_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DetectLanguageRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_datadog_languagedetection_api_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DetectLanguageResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/pkg/proto/pbgo/mocks/core/api_mockgen.pb.go b/pkg/proto/pbgo/mocks/core/api_mockgen.pb.go index f63731fc7bb98..a28d85a34a874 100644 --- a/pkg/proto/pbgo/mocks/core/api_mockgen.pb.go +++ b/pkg/proto/pbgo/mocks/core/api_mockgen.pb.go @@ -119,6 +119,26 @@ func (m *MockAgentSecureClient) EXPECT() *MockAgentSecureClientMockRecorder { return m.recorder } +// AutodiscoveryStreamConfig mocks base method. +func (m *MockAgentSecureClient) AutodiscoveryStreamConfig(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (core.AgentSecure_AutodiscoveryStreamConfigClient, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, in} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "AutodiscoveryStreamConfig", varargs...) + ret0, _ := ret[0].(core.AgentSecure_AutodiscoveryStreamConfigClient) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// AutodiscoveryStreamConfig indicates an expected call of AutodiscoveryStreamConfig. +func (mr *MockAgentSecureClientMockRecorder) AutodiscoveryStreamConfig(ctx, in interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, in}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AutodiscoveryStreamConfig", reflect.TypeOf((*MockAgentSecureClient)(nil).AutodiscoveryStreamConfig), varargs...) +} + // ClientGetConfigs mocks base method. func (m *MockAgentSecureClient) ClientGetConfigs(ctx context.Context, in *core.ClientGetConfigsRequest, opts ...grpc.CallOption) (*core.ClientGetConfigsResponse, error) { m.ctrl.T.Helper() @@ -279,6 +299,26 @@ func (mr *MockAgentSecureClientMockRecorder) TaggerFetchEntity(ctx, in interface return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TaggerFetchEntity", reflect.TypeOf((*MockAgentSecureClient)(nil).TaggerFetchEntity), varargs...) } +// TaggerGenerateContainerIDFromOriginInfo mocks base method. +func (m *MockAgentSecureClient) TaggerGenerateContainerIDFromOriginInfo(ctx context.Context, in *core.GenerateContainerIDFromOriginInfoRequest, opts ...grpc.CallOption) (*core.GenerateContainerIDFromOriginInfoResponse, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, in} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "TaggerGenerateContainerIDFromOriginInfo", varargs...) + ret0, _ := ret[0].(*core.GenerateContainerIDFromOriginInfoResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// TaggerGenerateContainerIDFromOriginInfo indicates an expected call of TaggerGenerateContainerIDFromOriginInfo. +func (mr *MockAgentSecureClientMockRecorder) TaggerGenerateContainerIDFromOriginInfo(ctx, in interface{}, opts ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, in}, opts...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TaggerGenerateContainerIDFromOriginInfo", reflect.TypeOf((*MockAgentSecureClient)(nil).TaggerGenerateContainerIDFromOriginInfo), varargs...) +} + // TaggerStreamEntities mocks base method. func (m *MockAgentSecureClient) TaggerStreamEntities(ctx context.Context, in *core.StreamTagsRequest, opts ...grpc.CallOption) (core.AgentSecure_TaggerStreamEntitiesClient, error) { m.ctrl.T.Helper() @@ -565,6 +605,129 @@ func (mr *MockAgentSecure_WorkloadmetaStreamEntitiesClientMockRecorder) Trailer( return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Trailer", reflect.TypeOf((*MockAgentSecure_WorkloadmetaStreamEntitiesClient)(nil).Trailer)) } +// MockAgentSecure_AutodiscoveryStreamConfigClient is a mock of AgentSecure_AutodiscoveryStreamConfigClient interface. +type MockAgentSecure_AutodiscoveryStreamConfigClient struct { + ctrl *gomock.Controller + recorder *MockAgentSecure_AutodiscoveryStreamConfigClientMockRecorder +} + +// MockAgentSecure_AutodiscoveryStreamConfigClientMockRecorder is the mock recorder for MockAgentSecure_AutodiscoveryStreamConfigClient. +type MockAgentSecure_AutodiscoveryStreamConfigClientMockRecorder struct { + mock *MockAgentSecure_AutodiscoveryStreamConfigClient +} + +// NewMockAgentSecure_AutodiscoveryStreamConfigClient creates a new mock instance. +func NewMockAgentSecure_AutodiscoveryStreamConfigClient(ctrl *gomock.Controller) *MockAgentSecure_AutodiscoveryStreamConfigClient { + mock := &MockAgentSecure_AutodiscoveryStreamConfigClient{ctrl: ctrl} + mock.recorder = &MockAgentSecure_AutodiscoveryStreamConfigClientMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockAgentSecure_AutodiscoveryStreamConfigClient) EXPECT() *MockAgentSecure_AutodiscoveryStreamConfigClientMockRecorder { + return m.recorder +} + +// CloseSend mocks base method. +func (m *MockAgentSecure_AutodiscoveryStreamConfigClient) CloseSend() error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CloseSend") + ret0, _ := ret[0].(error) + return ret0 +} + +// CloseSend indicates an expected call of CloseSend. +func (mr *MockAgentSecure_AutodiscoveryStreamConfigClientMockRecorder) CloseSend() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CloseSend", reflect.TypeOf((*MockAgentSecure_AutodiscoveryStreamConfigClient)(nil).CloseSend)) +} + +// Context mocks base method. +func (m *MockAgentSecure_AutodiscoveryStreamConfigClient) Context() context.Context { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Context") + ret0, _ := ret[0].(context.Context) + return ret0 +} + +// Context indicates an expected call of Context. +func (mr *MockAgentSecure_AutodiscoveryStreamConfigClientMockRecorder) Context() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Context", reflect.TypeOf((*MockAgentSecure_AutodiscoveryStreamConfigClient)(nil).Context)) +} + +// Header mocks base method. +func (m *MockAgentSecure_AutodiscoveryStreamConfigClient) Header() (metadata.MD, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Header") + ret0, _ := ret[0].(metadata.MD) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Header indicates an expected call of Header. +func (mr *MockAgentSecure_AutodiscoveryStreamConfigClientMockRecorder) Header() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Header", reflect.TypeOf((*MockAgentSecure_AutodiscoveryStreamConfigClient)(nil).Header)) +} + +// Recv mocks base method. +func (m *MockAgentSecure_AutodiscoveryStreamConfigClient) Recv() (*core.AutodiscoveryStreamResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Recv") + ret0, _ := ret[0].(*core.AutodiscoveryStreamResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Recv indicates an expected call of Recv. +func (mr *MockAgentSecure_AutodiscoveryStreamConfigClientMockRecorder) Recv() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Recv", reflect.TypeOf((*MockAgentSecure_AutodiscoveryStreamConfigClient)(nil).Recv)) +} + +// RecvMsg mocks base method. +func (m_2 *MockAgentSecure_AutodiscoveryStreamConfigClient) RecvMsg(m any) error { + m_2.ctrl.T.Helper() + ret := m_2.ctrl.Call(m_2, "RecvMsg", m) + ret0, _ := ret[0].(error) + return ret0 +} + +// RecvMsg indicates an expected call of RecvMsg. +func (mr *MockAgentSecure_AutodiscoveryStreamConfigClientMockRecorder) RecvMsg(m interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RecvMsg", reflect.TypeOf((*MockAgentSecure_AutodiscoveryStreamConfigClient)(nil).RecvMsg), m) +} + +// SendMsg mocks base method. +func (m_2 *MockAgentSecure_AutodiscoveryStreamConfigClient) SendMsg(m any) error { + m_2.ctrl.T.Helper() + ret := m_2.ctrl.Call(m_2, "SendMsg", m) + ret0, _ := ret[0].(error) + return ret0 +} + +// SendMsg indicates an expected call of SendMsg. +func (mr *MockAgentSecure_AutodiscoveryStreamConfigClientMockRecorder) SendMsg(m interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendMsg", reflect.TypeOf((*MockAgentSecure_AutodiscoveryStreamConfigClient)(nil).SendMsg), m) +} + +// Trailer mocks base method. +func (m *MockAgentSecure_AutodiscoveryStreamConfigClient) Trailer() metadata.MD { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Trailer") + ret0, _ := ret[0].(metadata.MD) + return ret0 +} + +// Trailer indicates an expected call of Trailer. +func (mr *MockAgentSecure_AutodiscoveryStreamConfigClientMockRecorder) Trailer() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Trailer", reflect.TypeOf((*MockAgentSecure_AutodiscoveryStreamConfigClient)(nil).Trailer)) +} + // MockAgentSecureServer is a mock of AgentSecureServer interface. type MockAgentSecureServer struct { ctrl *gomock.Controller @@ -588,6 +751,20 @@ func (m *MockAgentSecureServer) EXPECT() *MockAgentSecureServerMockRecorder { return m.recorder } +// AutodiscoveryStreamConfig mocks base method. +func (m *MockAgentSecureServer) AutodiscoveryStreamConfig(arg0 *empty.Empty, arg1 core.AgentSecure_AutodiscoveryStreamConfigServer) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "AutodiscoveryStreamConfig", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// AutodiscoveryStreamConfig indicates an expected call of AutodiscoveryStreamConfig. +func (mr *MockAgentSecureServerMockRecorder) AutodiscoveryStreamConfig(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AutodiscoveryStreamConfig", reflect.TypeOf((*MockAgentSecureServer)(nil).AutodiscoveryStreamConfig), arg0, arg1) +} + // ClientGetConfigs mocks base method. func (m *MockAgentSecureServer) ClientGetConfigs(arg0 context.Context, arg1 *core.ClientGetConfigsRequest) (*core.ClientGetConfigsResponse, error) { m.ctrl.T.Helper() @@ -708,6 +885,21 @@ func (mr *MockAgentSecureServerMockRecorder) TaggerFetchEntity(arg0, arg1 interf return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TaggerFetchEntity", reflect.TypeOf((*MockAgentSecureServer)(nil).TaggerFetchEntity), arg0, arg1) } +// TaggerGenerateContainerIDFromOriginInfo mocks base method. +func (m *MockAgentSecureServer) TaggerGenerateContainerIDFromOriginInfo(arg0 context.Context, arg1 *core.GenerateContainerIDFromOriginInfoRequest) (*core.GenerateContainerIDFromOriginInfoResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "TaggerGenerateContainerIDFromOriginInfo", arg0, arg1) + ret0, _ := ret[0].(*core.GenerateContainerIDFromOriginInfoResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// TaggerGenerateContainerIDFromOriginInfo indicates an expected call of TaggerGenerateContainerIDFromOriginInfo. +func (mr *MockAgentSecureServerMockRecorder) TaggerGenerateContainerIDFromOriginInfo(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TaggerGenerateContainerIDFromOriginInfo", reflect.TypeOf((*MockAgentSecureServer)(nil).TaggerGenerateContainerIDFromOriginInfo), arg0, arg1) +} + // TaggerStreamEntities mocks base method. func (m *MockAgentSecureServer) TaggerStreamEntities(arg0 *core.StreamTagsRequest, arg1 core.AgentSecure_TaggerStreamEntitiesServer) error { m.ctrl.T.Helper() @@ -974,6 +1166,125 @@ func (mr *MockAgentSecure_WorkloadmetaStreamEntitiesServerMockRecorder) SetTrail return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetTrailer", reflect.TypeOf((*MockAgentSecure_WorkloadmetaStreamEntitiesServer)(nil).SetTrailer), arg0) } +// MockAgentSecure_AutodiscoveryStreamConfigServer is a mock of AgentSecure_AutodiscoveryStreamConfigServer interface. +type MockAgentSecure_AutodiscoveryStreamConfigServer struct { + ctrl *gomock.Controller + recorder *MockAgentSecure_AutodiscoveryStreamConfigServerMockRecorder +} + +// MockAgentSecure_AutodiscoveryStreamConfigServerMockRecorder is the mock recorder for MockAgentSecure_AutodiscoveryStreamConfigServer. +type MockAgentSecure_AutodiscoveryStreamConfigServerMockRecorder struct { + mock *MockAgentSecure_AutodiscoveryStreamConfigServer +} + +// NewMockAgentSecure_AutodiscoveryStreamConfigServer creates a new mock instance. +func NewMockAgentSecure_AutodiscoveryStreamConfigServer(ctrl *gomock.Controller) *MockAgentSecure_AutodiscoveryStreamConfigServer { + mock := &MockAgentSecure_AutodiscoveryStreamConfigServer{ctrl: ctrl} + mock.recorder = &MockAgentSecure_AutodiscoveryStreamConfigServerMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockAgentSecure_AutodiscoveryStreamConfigServer) EXPECT() *MockAgentSecure_AutodiscoveryStreamConfigServerMockRecorder { + return m.recorder +} + +// Context mocks base method. +func (m *MockAgentSecure_AutodiscoveryStreamConfigServer) Context() context.Context { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Context") + ret0, _ := ret[0].(context.Context) + return ret0 +} + +// Context indicates an expected call of Context. +func (mr *MockAgentSecure_AutodiscoveryStreamConfigServerMockRecorder) Context() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Context", reflect.TypeOf((*MockAgentSecure_AutodiscoveryStreamConfigServer)(nil).Context)) +} + +// RecvMsg mocks base method. +func (m_2 *MockAgentSecure_AutodiscoveryStreamConfigServer) RecvMsg(m any) error { + m_2.ctrl.T.Helper() + ret := m_2.ctrl.Call(m_2, "RecvMsg", m) + ret0, _ := ret[0].(error) + return ret0 +} + +// RecvMsg indicates an expected call of RecvMsg. +func (mr *MockAgentSecure_AutodiscoveryStreamConfigServerMockRecorder) RecvMsg(m interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RecvMsg", reflect.TypeOf((*MockAgentSecure_AutodiscoveryStreamConfigServer)(nil).RecvMsg), m) +} + +// Send mocks base method. +func (m *MockAgentSecure_AutodiscoveryStreamConfigServer) Send(arg0 *core.AutodiscoveryStreamResponse) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Send", arg0) + ret0, _ := ret[0].(error) + return ret0 +} + +// Send indicates an expected call of Send. +func (mr *MockAgentSecure_AutodiscoveryStreamConfigServerMockRecorder) Send(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Send", reflect.TypeOf((*MockAgentSecure_AutodiscoveryStreamConfigServer)(nil).Send), arg0) +} + +// SendHeader mocks base method. +func (m *MockAgentSecure_AutodiscoveryStreamConfigServer) SendHeader(arg0 metadata.MD) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SendHeader", arg0) + ret0, _ := ret[0].(error) + return ret0 +} + +// SendHeader indicates an expected call of SendHeader. +func (mr *MockAgentSecure_AutodiscoveryStreamConfigServerMockRecorder) SendHeader(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendHeader", reflect.TypeOf((*MockAgentSecure_AutodiscoveryStreamConfigServer)(nil).SendHeader), arg0) +} + +// SendMsg mocks base method. +func (m_2 *MockAgentSecure_AutodiscoveryStreamConfigServer) SendMsg(m any) error { + m_2.ctrl.T.Helper() + ret := m_2.ctrl.Call(m_2, "SendMsg", m) + ret0, _ := ret[0].(error) + return ret0 +} + +// SendMsg indicates an expected call of SendMsg. +func (mr *MockAgentSecure_AutodiscoveryStreamConfigServerMockRecorder) SendMsg(m interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendMsg", reflect.TypeOf((*MockAgentSecure_AutodiscoveryStreamConfigServer)(nil).SendMsg), m) +} + +// SetHeader mocks base method. +func (m *MockAgentSecure_AutodiscoveryStreamConfigServer) SetHeader(arg0 metadata.MD) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SetHeader", arg0) + ret0, _ := ret[0].(error) + return ret0 +} + +// SetHeader indicates an expected call of SetHeader. +func (mr *MockAgentSecure_AutodiscoveryStreamConfigServerMockRecorder) SetHeader(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetHeader", reflect.TypeOf((*MockAgentSecure_AutodiscoveryStreamConfigServer)(nil).SetHeader), arg0) +} + +// SetTrailer mocks base method. +func (m *MockAgentSecure_AutodiscoveryStreamConfigServer) SetTrailer(arg0 metadata.MD) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "SetTrailer", arg0) +} + +// SetTrailer indicates an expected call of SetTrailer. +func (mr *MockAgentSecure_AutodiscoveryStreamConfigServerMockRecorder) SetTrailer(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetTrailer", reflect.TypeOf((*MockAgentSecure_AutodiscoveryStreamConfigServer)(nil).SetTrailer), arg0) +} + // MockRemoteAgentClient is a mock of RemoteAgentClient interface. type MockRemoteAgentClient struct { ctrl *gomock.Controller diff --git a/pkg/proto/pbgo/process/process.pb.go b/pkg/proto/pbgo/process/process.pb.go index f1c158d390062..cd13a446613b4 100644 --- a/pkg/proto/pbgo/process/process.pb.go +++ b/pkg/proto/pbgo/process/process.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.0 +// protoc-gen-go v1.35.2 // protoc v5.26.1 // source: datadog/process/process.proto @@ -31,11 +31,9 @@ type ProcessStatRequest struct { func (x *ProcessStatRequest) Reset() { *x = ProcessStatRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_process_process_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_process_process_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ProcessStatRequest) String() string { @@ -46,7 +44,7 @@ func (*ProcessStatRequest) ProtoMessage() {} func (x *ProcessStatRequest) ProtoReflect() protoreflect.Message { mi := &file_datadog_process_process_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -94,7 +92,7 @@ func file_datadog_process_process_proto_rawDescGZIP() []byte { } var file_datadog_process_process_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_datadog_process_process_proto_goTypes = []interface{}{ +var file_datadog_process_process_proto_goTypes = []any{ (*ProcessStatRequest)(nil), // 0: datadog.process.ProcessStatRequest } var file_datadog_process_process_proto_depIdxs = []int32{ @@ -110,20 +108,6 @@ func file_datadog_process_process_proto_init() { if File_datadog_process_process_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_datadog_process_process_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProcessStatRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/pkg/proto/pbgo/process/workloadmeta_process.pb.go b/pkg/proto/pbgo/process/workloadmeta_process.pb.go index 7fc2e0b03f3a6..3c5d2ddd71152 100644 --- a/pkg/proto/pbgo/process/workloadmeta_process.pb.go +++ b/pkg/proto/pbgo/process/workloadmeta_process.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.0 +// protoc-gen-go v1.35.2 // protoc v5.26.1 // source: datadog/process/workloadmeta_process.proto @@ -36,11 +36,9 @@ type ProcessStreamResponse struct { func (x *ProcessStreamResponse) Reset() { *x = ProcessStreamResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_process_workloadmeta_process_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_process_workloadmeta_process_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ProcessStreamResponse) String() string { @@ -51,7 +49,7 @@ func (*ProcessStreamResponse) ProtoMessage() {} func (x *ProcessStreamResponse) ProtoReflect() protoreflect.Message { mi := &file_datadog_process_workloadmeta_process_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -101,11 +99,9 @@ type ProcessEventSet struct { func (x *ProcessEventSet) Reset() { *x = ProcessEventSet{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_process_workloadmeta_process_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_process_workloadmeta_process_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ProcessEventSet) String() string { @@ -116,7 +112,7 @@ func (*ProcessEventSet) ProtoMessage() {} func (x *ProcessEventSet) ProtoReflect() protoreflect.Message { mi := &file_datadog_process_workloadmeta_process_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -176,11 +172,9 @@ type ProcessEventUnset struct { func (x *ProcessEventUnset) Reset() { *x = ProcessEventUnset{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_process_workloadmeta_process_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_process_workloadmeta_process_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ProcessEventUnset) String() string { @@ -191,7 +185,7 @@ func (*ProcessEventUnset) ProtoMessage() {} func (x *ProcessEventUnset) ProtoReflect() protoreflect.Message { mi := &file_datadog_process_workloadmeta_process_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -223,11 +217,9 @@ type Language struct { func (x *Language) Reset() { *x = Language{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_process_workloadmeta_process_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_process_workloadmeta_process_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Language) String() string { @@ -238,7 +230,7 @@ func (*Language) ProtoMessage() {} func (x *Language) ProtoReflect() protoreflect.Message { mi := &file_datadog_process_workloadmeta_process_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -268,11 +260,9 @@ type ProcessStreamEntitiesRequest struct { func (x *ProcessStreamEntitiesRequest) Reset() { *x = ProcessStreamEntitiesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_process_workloadmeta_process_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_process_workloadmeta_process_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ProcessStreamEntitiesRequest) String() string { @@ -283,7 +273,7 @@ func (*ProcessStreamEntitiesRequest) ProtoMessage() {} func (x *ProcessStreamEntitiesRequest) ProtoReflect() protoreflect.Message { mi := &file_datadog_process_workloadmeta_process_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -310,11 +300,9 @@ type ParentLanguageAnnotationRequest struct { func (x *ParentLanguageAnnotationRequest) Reset() { *x = ParentLanguageAnnotationRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_process_workloadmeta_process_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_process_workloadmeta_process_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ParentLanguageAnnotationRequest) String() string { @@ -325,7 +313,7 @@ func (*ParentLanguageAnnotationRequest) ProtoMessage() {} func (x *ParentLanguageAnnotationRequest) ProtoReflect() protoreflect.Message { mi := &file_datadog_process_workloadmeta_process_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -362,11 +350,9 @@ type PodLanguageDetails struct { func (x *PodLanguageDetails) Reset() { *x = PodLanguageDetails{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_process_workloadmeta_process_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_process_workloadmeta_process_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *PodLanguageDetails) String() string { @@ -377,7 +363,7 @@ func (*PodLanguageDetails) ProtoMessage() {} func (x *PodLanguageDetails) ProtoReflect() protoreflect.Message { mi := &file_datadog_process_workloadmeta_process_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -439,11 +425,9 @@ type ContainerLanguageDetails struct { func (x *ContainerLanguageDetails) Reset() { *x = ContainerLanguageDetails{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_process_workloadmeta_process_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_process_workloadmeta_process_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ContainerLanguageDetails) String() string { @@ -454,7 +438,7 @@ func (*ContainerLanguageDetails) ProtoMessage() {} func (x *ContainerLanguageDetails) ProtoReflect() protoreflect.Message { mi := &file_datadog_process_workloadmeta_process_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -496,11 +480,9 @@ type KubeOwnerInfo struct { func (x *KubeOwnerInfo) Reset() { *x = KubeOwnerInfo{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_process_workloadmeta_process_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_process_workloadmeta_process_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *KubeOwnerInfo) String() string { @@ -511,7 +493,7 @@ func (*KubeOwnerInfo) ProtoMessage() {} func (x *KubeOwnerInfo) ProtoReflect() protoreflect.Message { mi := &file_datadog_process_workloadmeta_process_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -648,7 +630,7 @@ func file_datadog_process_workloadmeta_process_proto_rawDescGZIP() []byte { } var file_datadog_process_workloadmeta_process_proto_msgTypes = make([]protoimpl.MessageInfo, 9) -var file_datadog_process_workloadmeta_process_proto_goTypes = []interface{}{ +var file_datadog_process_workloadmeta_process_proto_goTypes = []any{ (*ProcessStreamResponse)(nil), // 0: datadog.process.ProcessStreamResponse (*ProcessEventSet)(nil), // 1: datadog.process.ProcessEventSet (*ProcessEventUnset)(nil), // 2: datadog.process.ProcessEventUnset @@ -682,116 +664,6 @@ func file_datadog_process_workloadmeta_process_proto_init() { if File_datadog_process_workloadmeta_process_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_datadog_process_workloadmeta_process_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProcessStreamResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_datadog_process_workloadmeta_process_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProcessEventSet); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_datadog_process_workloadmeta_process_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProcessEventUnset); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_datadog_process_workloadmeta_process_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Language); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_datadog_process_workloadmeta_process_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProcessStreamEntitiesRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_datadog_process_workloadmeta_process_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ParentLanguageAnnotationRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_datadog_process_workloadmeta_process_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PodLanguageDetails); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_datadog_process_workloadmeta_process_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ContainerLanguageDetails); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_datadog_process_workloadmeta_process_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*KubeOwnerInfo); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/pkg/proto/pbgo/trace/agent_payload.pb.go b/pkg/proto/pbgo/trace/agent_payload.pb.go index 5d803ea9b4019..30a8415307f40 100644 --- a/pkg/proto/pbgo/trace/agent_payload.pb.go +++ b/pkg/proto/pbgo/trace/agent_payload.pb.go @@ -2,7 +2,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.0 +// protoc-gen-go v1.35.2 // protoc v5.26.1 // source: datadog/trace/agent_payload.proto @@ -48,11 +48,9 @@ type AgentPayload struct { func (x *AgentPayload) Reset() { *x = AgentPayload{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_trace_agent_payload_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_trace_agent_payload_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *AgentPayload) String() string { @@ -63,7 +61,7 @@ func (*AgentPayload) ProtoMessage() {} func (x *AgentPayload) ProtoReflect() protoreflect.Message { mi := &file_datadog_trace_agent_payload_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -184,7 +182,7 @@ func file_datadog_trace_agent_payload_proto_rawDescGZIP() []byte { } var file_datadog_trace_agent_payload_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_datadog_trace_agent_payload_proto_goTypes = []interface{}{ +var file_datadog_trace_agent_payload_proto_goTypes = []any{ (*AgentPayload)(nil), // 0: datadog.trace.AgentPayload nil, // 1: datadog.trace.AgentPayload.TagsEntry (*TracerPayload)(nil), // 2: datadog.trace.TracerPayload @@ -205,20 +203,6 @@ func file_datadog_trace_agent_payload_proto_init() { return } file_datadog_trace_tracer_payload_proto_init() - if !protoimpl.UnsafeEnabled { - file_datadog_trace_agent_payload_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AgentPayload); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/pkg/proto/pbgo/trace/agent_payload_vtproto.pb.go b/pkg/proto/pbgo/trace/agent_payload_vtproto.pb.go index e4d4f171bf7a2..9433b709b7da8 100644 --- a/pkg/proto/pbgo/trace/agent_payload_vtproto.pb.go +++ b/pkg/proto/pbgo/trace/agent_payload_vtproto.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-go-vtproto. DO NOT EDIT. -// protoc-gen-go-vtproto version: v0.4.0 +// protoc-gen-go-vtproto version: v0.6.1-0.20240319094008-0393e58bdf10 // source: datadog/trace/agent_payload.proto package trace @@ -7,6 +7,7 @@ package trace import ( binary "encoding/binary" fmt "fmt" + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" protoimpl "google.golang.org/protobuf/runtime/protoimpl" io "io" math "math" @@ -74,7 +75,7 @@ func (m *AgentPayload) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.AgentVersion) > 0 { i -= len(m.AgentVersion) copy(dAtA[i:], m.AgentVersion) - i = encodeVarint(dAtA, i, uint64(len(m.AgentVersion))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.AgentVersion))) i-- dAtA[i] = 0x3a } @@ -84,15 +85,15 @@ func (m *AgentPayload) MarshalToSizedBufferVT(dAtA []byte) (int, error) { baseI := i i -= len(v) copy(dAtA[i:], v) - i = encodeVarint(dAtA, i, uint64(len(v))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(v))) i-- dAtA[i] = 0x12 i -= len(k) copy(dAtA[i:], k) - i = encodeVarint(dAtA, i, uint64(len(k))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(k))) i-- dAtA[i] = 0xa - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x32 } @@ -104,7 +105,7 @@ func (m *AgentPayload) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x2a } @@ -112,14 +113,14 @@ func (m *AgentPayload) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.Env) > 0 { i -= len(m.Env) copy(dAtA[i:], m.Env) - i = encodeVarint(dAtA, i, uint64(len(m.Env))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Env))) i-- dAtA[i] = 0x12 } if len(m.HostName) > 0 { i -= len(m.HostName) copy(dAtA[i:], m.HostName) - i = encodeVarint(dAtA, i, uint64(len(m.HostName))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.HostName))) i-- dAtA[i] = 0xa } @@ -134,29 +135,29 @@ func (m *AgentPayload) SizeVT() (n int) { _ = l l = len(m.HostName) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.Env) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if len(m.TracerPayloads) > 0 { for _, e := range m.TracerPayloads { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } if len(m.Tags) > 0 { for k, v := range m.Tags { _ = k _ = v - mapEntrySize := 1 + len(k) + sov(uint64(len(k))) + 1 + len(v) + sov(uint64(len(v))) - n += mapEntrySize + 1 + sov(uint64(mapEntrySize)) + mapEntrySize := 1 + len(k) + protohelpers.SizeOfVarint(uint64(len(k))) + 1 + len(v) + protohelpers.SizeOfVarint(uint64(len(v))) + n += mapEntrySize + 1 + protohelpers.SizeOfVarint(uint64(mapEntrySize)) } } l = len(m.AgentVersion) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.TargetTPS != 0 { n += 9 @@ -179,7 +180,7 @@ func (m *AgentPayload) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -207,7 +208,7 @@ func (m *AgentPayload) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -221,11 +222,11 @@ func (m *AgentPayload) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -239,7 +240,7 @@ func (m *AgentPayload) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -253,11 +254,11 @@ func (m *AgentPayload) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -271,7 +272,7 @@ func (m *AgentPayload) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -284,11 +285,11 @@ func (m *AgentPayload) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -305,7 +306,7 @@ func (m *AgentPayload) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -318,11 +319,11 @@ func (m *AgentPayload) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -337,7 +338,7 @@ func (m *AgentPayload) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -354,7 +355,7 @@ func (m *AgentPayload) UnmarshalVT(dAtA []byte) error { var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -368,11 +369,11 @@ func (m *AgentPayload) UnmarshalVT(dAtA []byte) error { } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF @@ -383,7 +384,7 @@ func (m *AgentPayload) UnmarshalVT(dAtA []byte) error { var stringLenmapvalue uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -397,11 +398,11 @@ func (m *AgentPayload) UnmarshalVT(dAtA []byte) error { } intStringLenmapvalue := int(stringLenmapvalue) if intStringLenmapvalue < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postStringIndexmapvalue := iNdEx + intStringLenmapvalue if postStringIndexmapvalue < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postStringIndexmapvalue > l { return io.ErrUnexpectedEOF @@ -410,12 +411,12 @@ func (m *AgentPayload) UnmarshalVT(dAtA []byte) error { iNdEx = postStringIndexmapvalue } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -432,7 +433,7 @@ func (m *AgentPayload) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -446,11 +447,11 @@ func (m *AgentPayload) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -486,7 +487,7 @@ func (m *AgentPayload) UnmarshalVT(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -501,12 +502,12 @@ func (m *AgentPayload) UnmarshalVT(dAtA []byte) error { m.RareSamplerEnabled = bool(v != 0) default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF diff --git a/pkg/proto/pbgo/trace/span.pb.go b/pkg/proto/pbgo/trace/span.pb.go index be7ee2bdadb77..1d0ad90af6351 100644 --- a/pkg/proto/pbgo/trace/span.pb.go +++ b/pkg/proto/pbgo/trace/span.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.0 +// protoc-gen-go v1.35.2 // protoc v5.26.1 // source: datadog/trace/span.proto @@ -41,11 +41,9 @@ type SpanLink struct { func (x *SpanLink) Reset() { *x = SpanLink{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_trace_span_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_trace_span_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *SpanLink) String() string { @@ -56,7 +54,7 @@ func (*SpanLink) ProtoMessage() {} func (x *SpanLink) ProtoReflect() protoreflect.Message { mi := &file_datadog_trace_span_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -164,11 +162,9 @@ type Span struct { func (x *Span) Reset() { *x = Span{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_trace_span_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_trace_span_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Span) String() string { @@ -179,7 +175,7 @@ func (*Span) ProtoMessage() {} func (x *Span) ProtoReflect() protoreflect.Message { mi := &file_datadog_trace_span_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -375,7 +371,7 @@ func file_datadog_trace_span_proto_rawDescGZIP() []byte { } var file_datadog_trace_span_proto_msgTypes = make([]protoimpl.MessageInfo, 6) -var file_datadog_trace_span_proto_goTypes = []interface{}{ +var file_datadog_trace_span_proto_goTypes = []any{ (*SpanLink)(nil), // 0: datadog.trace.SpanLink (*Span)(nil), // 1: datadog.trace.Span nil, // 2: datadog.trace.SpanLink.AttributesEntry @@ -401,32 +397,6 @@ func file_datadog_trace_span_proto_init() { if File_datadog_trace_span_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_datadog_trace_span_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SpanLink); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_datadog_trace_span_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Span); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/pkg/proto/pbgo/trace/span_gen.go b/pkg/proto/pbgo/trace/span_gen.go index f08192b31b01b..0ebaf789abc63 100644 --- a/pkg/proto/pbgo/trace/span_gen.go +++ b/pkg/proto/pbgo/trace/span_gen.go @@ -9,9 +9,10 @@ import ( // MarshalMsg implements msgp.Marshaler func (z *Span) MarshalMsg(b []byte) (o []byte, err error) { o = msgp.Require(b, z.Msgsize()) - // omitempty: check for empty values + // check for omitted fields zb0001Len := uint32(14) var zb0001Mask uint16 /* 14 bits */ + _ = zb0001Mask if z.Meta == nil { zb0001Len-- zb0001Mask |= 0x200 @@ -30,78 +31,79 @@ func (z *Span) MarshalMsg(b []byte) (o []byte, err error) { } // variable map header, size zb0001Len o = append(o, 0x80|uint8(zb0001Len)) - if zb0001Len == 0 { - return - } - // string "service" - o = append(o, 0xa7, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65) - o = msgp.AppendString(o, z.Service) - // string "name" - o = append(o, 0xa4, 0x6e, 0x61, 0x6d, 0x65) - o = msgp.AppendString(o, z.Name) - // string "resource" - o = append(o, 0xa8, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65) - o = msgp.AppendString(o, z.Resource) - // string "trace_id" - o = append(o, 0xa8, 0x74, 0x72, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64) - o = msgp.AppendUint64(o, z.TraceID) - // string "span_id" - o = append(o, 0xa7, 0x73, 0x70, 0x61, 0x6e, 0x5f, 0x69, 0x64) - o = msgp.AppendUint64(o, z.SpanID) - // string "parent_id" - o = append(o, 0xa9, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64) - o = msgp.AppendUint64(o, z.ParentID) - // string "start" - o = append(o, 0xa5, 0x73, 0x74, 0x61, 0x72, 0x74) - o = msgp.AppendInt64(o, z.Start) - // string "duration" - o = append(o, 0xa8, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e) - o = msgp.AppendInt64(o, z.Duration) - // string "error" - o = append(o, 0xa5, 0x65, 0x72, 0x72, 0x6f, 0x72) - o = msgp.AppendInt32(o, z.Error) - if (zb0001Mask & 0x200) == 0 { // if not empty - // string "meta" - o = append(o, 0xa4, 0x6d, 0x65, 0x74, 0x61) - o = msgp.AppendMapHeader(o, uint32(len(z.Meta))) - for za0001, za0002 := range z.Meta { - o = msgp.AppendString(o, za0001) - o = msgp.AppendString(o, za0002) + + // skip if no fields are to be emitted + if zb0001Len != 0 { + // string "service" + o = append(o, 0xa7, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65) + o = msgp.AppendString(o, z.Service) + // string "name" + o = append(o, 0xa4, 0x6e, 0x61, 0x6d, 0x65) + o = msgp.AppendString(o, z.Name) + // string "resource" + o = append(o, 0xa8, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65) + o = msgp.AppendString(o, z.Resource) + // string "trace_id" + o = append(o, 0xa8, 0x74, 0x72, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64) + o = msgp.AppendUint64(o, z.TraceID) + // string "span_id" + o = append(o, 0xa7, 0x73, 0x70, 0x61, 0x6e, 0x5f, 0x69, 0x64) + o = msgp.AppendUint64(o, z.SpanID) + // string "parent_id" + o = append(o, 0xa9, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64) + o = msgp.AppendUint64(o, z.ParentID) + // string "start" + o = append(o, 0xa5, 0x73, 0x74, 0x61, 0x72, 0x74) + o = msgp.AppendInt64(o, z.Start) + // string "duration" + o = append(o, 0xa8, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e) + o = msgp.AppendInt64(o, z.Duration) + // string "error" + o = append(o, 0xa5, 0x65, 0x72, 0x72, 0x6f, 0x72) + o = msgp.AppendInt32(o, z.Error) + if (zb0001Mask & 0x200) == 0 { // if not omitted + // string "meta" + o = append(o, 0xa4, 0x6d, 0x65, 0x74, 0x61) + o = msgp.AppendMapHeader(o, uint32(len(z.Meta))) + for za0001, za0002 := range z.Meta { + o = msgp.AppendString(o, za0001) + o = msgp.AppendString(o, za0002) + } } - } - if (zb0001Mask & 0x400) == 0 { // if not empty - // string "metrics" - o = append(o, 0xa7, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73) - o = msgp.AppendMapHeader(o, uint32(len(z.Metrics))) - for za0003, za0004 := range z.Metrics { - o = msgp.AppendString(o, za0003) - o = msgp.AppendFloat64(o, za0004) + if (zb0001Mask & 0x400) == 0 { // if not omitted + // string "metrics" + o = append(o, 0xa7, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73) + o = msgp.AppendMapHeader(o, uint32(len(z.Metrics))) + for za0003, za0004 := range z.Metrics { + o = msgp.AppendString(o, za0003) + o = msgp.AppendFloat64(o, za0004) + } } - } - // string "type" - o = append(o, 0xa4, 0x74, 0x79, 0x70, 0x65) - o = msgp.AppendString(o, z.Type) - if (zb0001Mask & 0x1000) == 0 { // if not empty - // string "meta_struct" - o = append(o, 0xab, 0x6d, 0x65, 0x74, 0x61, 0x5f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74) - o = msgp.AppendMapHeader(o, uint32(len(z.MetaStruct))) - for za0005, za0006 := range z.MetaStruct { - o = msgp.AppendString(o, za0005) - o = msgp.AppendBytes(o, za0006) + // string "type" + o = append(o, 0xa4, 0x74, 0x79, 0x70, 0x65) + o = msgp.AppendString(o, z.Type) + if (zb0001Mask & 0x1000) == 0 { // if not omitted + // string "meta_struct" + o = append(o, 0xab, 0x6d, 0x65, 0x74, 0x61, 0x5f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74) + o = msgp.AppendMapHeader(o, uint32(len(z.MetaStruct))) + for za0005, za0006 := range z.MetaStruct { + o = msgp.AppendString(o, za0005) + o = msgp.AppendBytes(o, za0006) + } } - } - if (zb0001Mask & 0x2000) == 0 { // if not empty - // string "span_links" - o = append(o, 0xaa, 0x73, 0x70, 0x61, 0x6e, 0x5f, 0x6c, 0x69, 0x6e, 0x6b, 0x73) - o = msgp.AppendArrayHeader(o, uint32(len(z.SpanLinks))) - for za0007 := range z.SpanLinks { - if z.SpanLinks[za0007] == nil { - o = msgp.AppendNil(o) - } else { - o, err = z.SpanLinks[za0007].MarshalMsg(o) - if err != nil { - err = msgp.WrapError(err, "SpanLinks", za0007) - return + if (zb0001Mask & 0x2000) == 0 { // if not omitted + // string "span_links" + o = append(o, 0xaa, 0x73, 0x70, 0x61, 0x6e, 0x5f, 0x6c, 0x69, 0x6e, 0x6b, 0x73) + o = msgp.AppendArrayHeader(o, uint32(len(z.SpanLinks))) + for za0007 := range z.SpanLinks { + if z.SpanLinks[za0007] == nil { + o = msgp.AppendNil(o) + } else { + o, err = z.SpanLinks[za0007].MarshalMsg(o) + if err != nil { + err = msgp.WrapError(err, "SpanLinks", za0007) + return + } } } } @@ -416,9 +418,10 @@ func (z *Span) Msgsize() (s int) { // MarshalMsg implements msgp.Marshaler func (z *SpanLink) MarshalMsg(b []byte) (o []byte, err error) { o = msgp.Require(b, z.Msgsize()) - // omitempty: check for empty values + // check for omitted fields zb0001Len := uint32(6) var zb0001Mask uint8 /* 6 bits */ + _ = zb0001Mask if z.TraceIDHigh == 0 { zb0001Len-- zb0001Mask |= 0x2 @@ -437,38 +440,39 @@ func (z *SpanLink) MarshalMsg(b []byte) (o []byte, err error) { } // variable map header, size zb0001Len o = append(o, 0x80|uint8(zb0001Len)) - if zb0001Len == 0 { - return - } - // string "trace_id" - o = append(o, 0xa8, 0x74, 0x72, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64) - o = msgp.AppendUint64(o, z.TraceID) - if (zb0001Mask & 0x2) == 0 { // if not empty - // string "trace_id_high" - o = append(o, 0xad, 0x74, 0x72, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x5f, 0x68, 0x69, 0x67, 0x68) - o = msgp.AppendUint64(o, z.TraceIDHigh) - } - // string "span_id" - o = append(o, 0xa7, 0x73, 0x70, 0x61, 0x6e, 0x5f, 0x69, 0x64) - o = msgp.AppendUint64(o, z.SpanID) - if (zb0001Mask & 0x8) == 0 { // if not empty - // string "attributes" - o = append(o, 0xaa, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73) - o = msgp.AppendMapHeader(o, uint32(len(z.Attributes))) - for za0001, za0002 := range z.Attributes { - o = msgp.AppendString(o, za0001) - o = msgp.AppendString(o, za0002) + + // skip if no fields are to be emitted + if zb0001Len != 0 { + // string "trace_id" + o = append(o, 0xa8, 0x74, 0x72, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64) + o = msgp.AppendUint64(o, z.TraceID) + if (zb0001Mask & 0x2) == 0 { // if not omitted + // string "trace_id_high" + o = append(o, 0xad, 0x74, 0x72, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x5f, 0x68, 0x69, 0x67, 0x68) + o = msgp.AppendUint64(o, z.TraceIDHigh) + } + // string "span_id" + o = append(o, 0xa7, 0x73, 0x70, 0x61, 0x6e, 0x5f, 0x69, 0x64) + o = msgp.AppendUint64(o, z.SpanID) + if (zb0001Mask & 0x8) == 0 { // if not omitted + // string "attributes" + o = append(o, 0xaa, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73) + o = msgp.AppendMapHeader(o, uint32(len(z.Attributes))) + for za0001, za0002 := range z.Attributes { + o = msgp.AppendString(o, za0001) + o = msgp.AppendString(o, za0002) + } + } + if (zb0001Mask & 0x10) == 0 { // if not omitted + // string "tracestate" + o = append(o, 0xaa, 0x74, 0x72, 0x61, 0x63, 0x65, 0x73, 0x74, 0x61, 0x74, 0x65) + o = msgp.AppendString(o, z.Tracestate) + } + if (zb0001Mask & 0x20) == 0 { // if not omitted + // string "flags" + o = append(o, 0xa5, 0x66, 0x6c, 0x61, 0x67, 0x73) + o = msgp.AppendUint32(o, z.Flags) } - } - if (zb0001Mask & 0x10) == 0 { // if not empty - // string "tracestate" - o = append(o, 0xaa, 0x74, 0x72, 0x61, 0x63, 0x65, 0x73, 0x74, 0x61, 0x74, 0x65) - o = msgp.AppendString(o, z.Tracestate) - } - if (zb0001Mask & 0x20) == 0 { // if not empty - // string "flags" - o = append(o, 0xa5, 0x66, 0x6c, 0x61, 0x67, 0x73) - o = msgp.AppendUint32(o, z.Flags) } return } diff --git a/pkg/proto/pbgo/trace/span_vtproto.pb.go b/pkg/proto/pbgo/trace/span_vtproto.pb.go index 7b6a7a0308785..d975f7ffae1f2 100644 --- a/pkg/proto/pbgo/trace/span_vtproto.pb.go +++ b/pkg/proto/pbgo/trace/span_vtproto.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-go-vtproto. DO NOT EDIT. -// protoc-gen-go-vtproto version: v0.4.0 +// protoc-gen-go-vtproto version: v0.6.1-0.20240319094008-0393e58bdf10 // source: datadog/trace/span.proto package trace @@ -7,10 +7,10 @@ package trace import ( binary "encoding/binary" fmt "fmt" + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" protoimpl "google.golang.org/protobuf/runtime/protoimpl" io "io" math "math" - bits "math/bits" ) const ( @@ -51,14 +51,14 @@ func (m *SpanLink) MarshalToSizedBufferVT(dAtA []byte) (int, error) { copy(dAtA[i:], m.unknownFields) } if m.Flags != 0 { - i = encodeVarint(dAtA, i, uint64(m.Flags)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Flags)) i-- dAtA[i] = 0x30 } if len(m.Tracestate) > 0 { i -= len(m.Tracestate) copy(dAtA[i:], m.Tracestate) - i = encodeVarint(dAtA, i, uint64(len(m.Tracestate))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Tracestate))) i-- dAtA[i] = 0x2a } @@ -68,31 +68,31 @@ func (m *SpanLink) MarshalToSizedBufferVT(dAtA []byte) (int, error) { baseI := i i -= len(v) copy(dAtA[i:], v) - i = encodeVarint(dAtA, i, uint64(len(v))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(v))) i-- dAtA[i] = 0x12 i -= len(k) copy(dAtA[i:], k) - i = encodeVarint(dAtA, i, uint64(len(k))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(k))) i-- dAtA[i] = 0xa - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x22 } } if m.SpanID != 0 { - i = encodeVarint(dAtA, i, uint64(m.SpanID)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.SpanID)) i-- dAtA[i] = 0x18 } if m.TraceIDHigh != 0 { - i = encodeVarint(dAtA, i, uint64(m.TraceIDHigh)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.TraceIDHigh)) i-- dAtA[i] = 0x10 } if m.TraceID != 0 { - i = encodeVarint(dAtA, i, uint64(m.TraceID)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.TraceID)) i-- dAtA[i] = 0x8 } @@ -136,7 +136,7 @@ func (m *Span) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x72 } @@ -147,15 +147,15 @@ func (m *Span) MarshalToSizedBufferVT(dAtA []byte) (int, error) { baseI := i i -= len(v) copy(dAtA[i:], v) - i = encodeVarint(dAtA, i, uint64(len(v))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(v))) i-- dAtA[i] = 0x12 i -= len(k) copy(dAtA[i:], k) - i = encodeVarint(dAtA, i, uint64(len(k))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(k))) i-- dAtA[i] = 0xa - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x6a } @@ -163,7 +163,7 @@ func (m *Span) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.Type) > 0 { i -= len(m.Type) copy(dAtA[i:], m.Type) - i = encodeVarint(dAtA, i, uint64(len(m.Type))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Type))) i-- dAtA[i] = 0x62 } @@ -177,10 +177,10 @@ func (m *Span) MarshalToSizedBufferVT(dAtA []byte) (int, error) { dAtA[i] = 0x11 i -= len(k) copy(dAtA[i:], k) - i = encodeVarint(dAtA, i, uint64(len(k))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(k))) i-- dAtA[i] = 0xa - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x5a } @@ -191,84 +191,73 @@ func (m *Span) MarshalToSizedBufferVT(dAtA []byte) (int, error) { baseI := i i -= len(v) copy(dAtA[i:], v) - i = encodeVarint(dAtA, i, uint64(len(v))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(v))) i-- dAtA[i] = 0x12 i -= len(k) copy(dAtA[i:], k) - i = encodeVarint(dAtA, i, uint64(len(k))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(k))) i-- dAtA[i] = 0xa - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x52 } } if m.Error != 0 { - i = encodeVarint(dAtA, i, uint64(m.Error)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Error)) i-- dAtA[i] = 0x48 } if m.Duration != 0 { - i = encodeVarint(dAtA, i, uint64(m.Duration)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Duration)) i-- dAtA[i] = 0x40 } if m.Start != 0 { - i = encodeVarint(dAtA, i, uint64(m.Start)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Start)) i-- dAtA[i] = 0x38 } if m.ParentID != 0 { - i = encodeVarint(dAtA, i, uint64(m.ParentID)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.ParentID)) i-- dAtA[i] = 0x30 } if m.SpanID != 0 { - i = encodeVarint(dAtA, i, uint64(m.SpanID)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.SpanID)) i-- dAtA[i] = 0x28 } if m.TraceID != 0 { - i = encodeVarint(dAtA, i, uint64(m.TraceID)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.TraceID)) i-- dAtA[i] = 0x20 } if len(m.Resource) > 0 { i -= len(m.Resource) copy(dAtA[i:], m.Resource) - i = encodeVarint(dAtA, i, uint64(len(m.Resource))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Resource))) i-- dAtA[i] = 0x1a } if len(m.Name) > 0 { i -= len(m.Name) copy(dAtA[i:], m.Name) - i = encodeVarint(dAtA, i, uint64(len(m.Name))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Name))) i-- dAtA[i] = 0x12 } if len(m.Service) > 0 { i -= len(m.Service) copy(dAtA[i:], m.Service) - i = encodeVarint(dAtA, i, uint64(len(m.Service))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Service))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func encodeVarint(dAtA []byte, offset int, v uint64) int { - offset -= sov(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} func (m *SpanLink) SizeVT() (n int) { if m == nil { return 0 @@ -276,28 +265,28 @@ func (m *SpanLink) SizeVT() (n int) { var l int _ = l if m.TraceID != 0 { - n += 1 + sov(uint64(m.TraceID)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.TraceID)) } if m.TraceIDHigh != 0 { - n += 1 + sov(uint64(m.TraceIDHigh)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.TraceIDHigh)) } if m.SpanID != 0 { - n += 1 + sov(uint64(m.SpanID)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.SpanID)) } if len(m.Attributes) > 0 { for k, v := range m.Attributes { _ = k _ = v - mapEntrySize := 1 + len(k) + sov(uint64(len(k))) + 1 + len(v) + sov(uint64(len(v))) - n += mapEntrySize + 1 + sov(uint64(mapEntrySize)) + mapEntrySize := 1 + len(k) + protohelpers.SizeOfVarint(uint64(len(k))) + 1 + len(v) + protohelpers.SizeOfVarint(uint64(len(v))) + n += mapEntrySize + 1 + protohelpers.SizeOfVarint(uint64(mapEntrySize)) } } l = len(m.Tracestate) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.Flags != 0 { - n += 1 + sov(uint64(m.Flags)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Flags)) } n += len(m.unknownFields) return n @@ -311,79 +300,73 @@ func (m *Span) SizeVT() (n int) { _ = l l = len(m.Service) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.Name) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.Resource) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.TraceID != 0 { - n += 1 + sov(uint64(m.TraceID)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.TraceID)) } if m.SpanID != 0 { - n += 1 + sov(uint64(m.SpanID)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.SpanID)) } if m.ParentID != 0 { - n += 1 + sov(uint64(m.ParentID)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.ParentID)) } if m.Start != 0 { - n += 1 + sov(uint64(m.Start)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Start)) } if m.Duration != 0 { - n += 1 + sov(uint64(m.Duration)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Duration)) } if m.Error != 0 { - n += 1 + sov(uint64(m.Error)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Error)) } if len(m.Meta) > 0 { for k, v := range m.Meta { _ = k _ = v - mapEntrySize := 1 + len(k) + sov(uint64(len(k))) + 1 + len(v) + sov(uint64(len(v))) - n += mapEntrySize + 1 + sov(uint64(mapEntrySize)) + mapEntrySize := 1 + len(k) + protohelpers.SizeOfVarint(uint64(len(k))) + 1 + len(v) + protohelpers.SizeOfVarint(uint64(len(v))) + n += mapEntrySize + 1 + protohelpers.SizeOfVarint(uint64(mapEntrySize)) } } if len(m.Metrics) > 0 { for k, v := range m.Metrics { _ = k _ = v - mapEntrySize := 1 + len(k) + sov(uint64(len(k))) + 1 + 8 - n += mapEntrySize + 1 + sov(uint64(mapEntrySize)) + mapEntrySize := 1 + len(k) + protohelpers.SizeOfVarint(uint64(len(k))) + 1 + 8 + n += mapEntrySize + 1 + protohelpers.SizeOfVarint(uint64(mapEntrySize)) } } l = len(m.Type) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if len(m.MetaStruct) > 0 { for k, v := range m.MetaStruct { _ = k _ = v - l = 1 + len(v) + sov(uint64(len(v))) - mapEntrySize := 1 + len(k) + sov(uint64(len(k))) + l - n += mapEntrySize + 1 + sov(uint64(mapEntrySize)) + l = 1 + len(v) + protohelpers.SizeOfVarint(uint64(len(v))) + mapEntrySize := 1 + len(k) + protohelpers.SizeOfVarint(uint64(len(k))) + l + n += mapEntrySize + 1 + protohelpers.SizeOfVarint(uint64(mapEntrySize)) } } if len(m.SpanLinks) > 0 { for _, e := range m.SpanLinks { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } n += len(m.unknownFields) return n } -func sov(x uint64) (n int) { - return (bits.Len64(x|1) + 6) / 7 -} -func soz(x uint64) (n int) { - return sov(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} func (m *SpanLink) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -392,7 +375,7 @@ func (m *SpanLink) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -420,7 +403,7 @@ func (m *SpanLink) UnmarshalVT(dAtA []byte) error { m.TraceID = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -439,7 +422,7 @@ func (m *SpanLink) UnmarshalVT(dAtA []byte) error { m.TraceIDHigh = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -458,7 +441,7 @@ func (m *SpanLink) UnmarshalVT(dAtA []byte) error { m.SpanID = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -477,7 +460,7 @@ func (m *SpanLink) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -490,11 +473,11 @@ func (m *SpanLink) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -509,7 +492,7 @@ func (m *SpanLink) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -526,7 +509,7 @@ func (m *SpanLink) UnmarshalVT(dAtA []byte) error { var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -540,11 +523,11 @@ func (m *SpanLink) UnmarshalVT(dAtA []byte) error { } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF @@ -555,7 +538,7 @@ func (m *SpanLink) UnmarshalVT(dAtA []byte) error { var stringLenmapvalue uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -569,11 +552,11 @@ func (m *SpanLink) UnmarshalVT(dAtA []byte) error { } intStringLenmapvalue := int(stringLenmapvalue) if intStringLenmapvalue < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postStringIndexmapvalue := iNdEx + intStringLenmapvalue if postStringIndexmapvalue < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postStringIndexmapvalue > l { return io.ErrUnexpectedEOF @@ -582,12 +565,12 @@ func (m *SpanLink) UnmarshalVT(dAtA []byte) error { iNdEx = postStringIndexmapvalue } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -604,7 +587,7 @@ func (m *SpanLink) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -618,11 +601,11 @@ func (m *SpanLink) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -636,7 +619,7 @@ func (m *SpanLink) UnmarshalVT(dAtA []byte) error { m.Flags = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -650,12 +633,12 @@ func (m *SpanLink) UnmarshalVT(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -678,7 +661,7 @@ func (m *Span) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -706,7 +689,7 @@ func (m *Span) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -720,11 +703,11 @@ func (m *Span) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -738,7 +721,7 @@ func (m *Span) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -752,11 +735,11 @@ func (m *Span) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -770,7 +753,7 @@ func (m *Span) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -784,11 +767,11 @@ func (m *Span) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -802,7 +785,7 @@ func (m *Span) UnmarshalVT(dAtA []byte) error { m.TraceID = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -821,7 +804,7 @@ func (m *Span) UnmarshalVT(dAtA []byte) error { m.SpanID = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -840,7 +823,7 @@ func (m *Span) UnmarshalVT(dAtA []byte) error { m.ParentID = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -859,7 +842,7 @@ func (m *Span) UnmarshalVT(dAtA []byte) error { m.Start = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -878,7 +861,7 @@ func (m *Span) UnmarshalVT(dAtA []byte) error { m.Duration = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -897,7 +880,7 @@ func (m *Span) UnmarshalVT(dAtA []byte) error { m.Error = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -916,7 +899,7 @@ func (m *Span) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -929,11 +912,11 @@ func (m *Span) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -948,7 +931,7 @@ func (m *Span) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -965,7 +948,7 @@ func (m *Span) UnmarshalVT(dAtA []byte) error { var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -979,11 +962,11 @@ func (m *Span) UnmarshalVT(dAtA []byte) error { } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF @@ -994,7 +977,7 @@ func (m *Span) UnmarshalVT(dAtA []byte) error { var stringLenmapvalue uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1008,11 +991,11 @@ func (m *Span) UnmarshalVT(dAtA []byte) error { } intStringLenmapvalue := int(stringLenmapvalue) if intStringLenmapvalue < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postStringIndexmapvalue := iNdEx + intStringLenmapvalue if postStringIndexmapvalue < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postStringIndexmapvalue > l { return io.ErrUnexpectedEOF @@ -1021,12 +1004,12 @@ func (m *Span) UnmarshalVT(dAtA []byte) error { iNdEx = postStringIndexmapvalue } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -1043,7 +1026,7 @@ func (m *Span) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1056,11 +1039,11 @@ func (m *Span) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1075,7 +1058,7 @@ func (m *Span) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1092,7 +1075,7 @@ func (m *Span) UnmarshalVT(dAtA []byte) error { var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1106,11 +1089,11 @@ func (m *Span) UnmarshalVT(dAtA []byte) error { } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF @@ -1127,12 +1110,12 @@ func (m *Span) UnmarshalVT(dAtA []byte) error { mapvalue = math.Float64frombits(mapvaluetemp) } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -1149,7 +1132,7 @@ func (m *Span) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1163,11 +1146,11 @@ func (m *Span) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1181,7 +1164,7 @@ func (m *Span) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1194,11 +1177,11 @@ func (m *Span) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1213,7 +1196,7 @@ func (m *Span) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1230,7 +1213,7 @@ func (m *Span) UnmarshalVT(dAtA []byte) error { var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1244,11 +1227,11 @@ func (m *Span) UnmarshalVT(dAtA []byte) error { } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF @@ -1259,7 +1242,7 @@ func (m *Span) UnmarshalVT(dAtA []byte) error { var mapbyteLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1273,11 +1256,11 @@ func (m *Span) UnmarshalVT(dAtA []byte) error { } intMapbyteLen := int(mapbyteLen) if intMapbyteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postbytesIndex := iNdEx + intMapbyteLen if postbytesIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postbytesIndex > l { return io.ErrUnexpectedEOF @@ -1287,12 +1270,12 @@ func (m *Span) UnmarshalVT(dAtA []byte) error { iNdEx = postbytesIndex } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -1309,7 +1292,7 @@ func (m *Span) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1322,11 +1305,11 @@ func (m *Span) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1338,12 +1321,12 @@ func (m *Span) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1358,88 +1341,3 @@ func (m *Span) UnmarshalVT(dAtA []byte) error { } return nil } - -func skip(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflow - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLength - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroup - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLength - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLength = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflow = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroup = fmt.Errorf("proto: unexpected end of group") -) diff --git a/pkg/proto/pbgo/trace/stats.pb.go b/pkg/proto/pbgo/trace/stats.pb.go index 52d51fff5f75b..c2dc1cfbbe86c 100644 --- a/pkg/proto/pbgo/trace/stats.pb.go +++ b/pkg/proto/pbgo/trace/stats.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.0 +// protoc-gen-go v1.35.2 // protoc v5.26.1 // source: datadog/trace/stats.proto @@ -138,11 +138,9 @@ type StatsPayload struct { func (x *StatsPayload) Reset() { *x = StatsPayload{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_trace_stats_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_trace_stats_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *StatsPayload) String() string { @@ -153,7 +151,7 @@ func (*StatsPayload) ProtoMessage() {} func (x *StatsPayload) ProtoReflect() protoreflect.Message { mi := &file_datadog_trace_stats_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -248,11 +246,9 @@ type ClientStatsPayload struct { func (x *ClientStatsPayload) Reset() { *x = ClientStatsPayload{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_trace_stats_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_trace_stats_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ClientStatsPayload) String() string { @@ -263,7 +259,7 @@ func (*ClientStatsPayload) ProtoMessage() {} func (x *ClientStatsPayload) ProtoReflect() protoreflect.Message { mi := &file_datadog_trace_stats_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -393,11 +389,9 @@ type ClientStatsBucket struct { func (x *ClientStatsBucket) Reset() { *x = ClientStatsBucket{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_trace_stats_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_trace_stats_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ClientStatsBucket) String() string { @@ -408,7 +402,7 @@ func (*ClientStatsBucket) ProtoMessage() {} func (x *ClientStatsBucket) ProtoReflect() protoreflect.Message { mi := &file_datadog_trace_stats_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -479,11 +473,9 @@ type ClientGroupedStats struct { func (x *ClientGroupedStats) Reset() { *x = ClientGroupedStats{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_trace_stats_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_trace_stats_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ClientGroupedStats) String() string { @@ -494,7 +486,7 @@ func (*ClientGroupedStats) ProtoMessage() {} func (x *ClientGroupedStats) ProtoReflect() protoreflect.Message { mi := &file_datadog_trace_stats_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -740,7 +732,7 @@ func file_datadog_trace_stats_proto_rawDescGZIP() []byte { var file_datadog_trace_stats_proto_enumTypes = make([]protoimpl.EnumInfo, 2) var file_datadog_trace_stats_proto_msgTypes = make([]protoimpl.MessageInfo, 4) -var file_datadog_trace_stats_proto_goTypes = []interface{}{ +var file_datadog_trace_stats_proto_goTypes = []any{ (Trilean)(0), // 0: datadog.trace.Trilean (TraceRootFlag)(0), // 1: datadog.trace.TraceRootFlag (*StatsPayload)(nil), // 2: datadog.trace.StatsPayload @@ -765,56 +757,6 @@ func file_datadog_trace_stats_proto_init() { if File_datadog_trace_stats_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_datadog_trace_stats_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StatsPayload); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_datadog_trace_stats_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ClientStatsPayload); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_datadog_trace_stats_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ClientStatsBucket); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_datadog_trace_stats_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ClientGroupedStats); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/pkg/proto/pbgo/trace/stats_gen.go b/pkg/proto/pbgo/trace/stats_gen.go index 0747621c2d0c6..3607062d3f2c2 100644 --- a/pkg/proto/pbgo/trace/stats_gen.go +++ b/pkg/proto/pbgo/trace/stats_gen.go @@ -612,9 +612,10 @@ func (z *ClientStatsBucket) DecodeMsg(dc *msgp.Reader) (err error) { // EncodeMsg implements msgp.Encodable func (z *ClientStatsBucket) EncodeMsg(en *msgp.Writer) (err error) { - // omitempty: check for empty values + // check for omitted fields zb0001Len := uint32(4) var zb0001Mask uint8 /* 4 bits */ + _ = zb0001Mask if z.Stats == nil { zb0001Len-- zb0001Mask |= 0x4 @@ -624,64 +625,65 @@ func (z *ClientStatsBucket) EncodeMsg(en *msgp.Writer) (err error) { if err != nil { return } - if zb0001Len == 0 { - return - } - // write "Start" - err = en.Append(0xa5, 0x53, 0x74, 0x61, 0x72, 0x74) - if err != nil { - return - } - err = en.WriteUint64(z.Start) - if err != nil { - err = msgp.WrapError(err, "Start") - return - } - // write "Duration" - err = en.Append(0xa8, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e) - if err != nil { - return - } - err = en.WriteUint64(z.Duration) - if err != nil { - err = msgp.WrapError(err, "Duration") - return - } - if (zb0001Mask & 0x4) == 0 { // if not empty - // write "Stats" - err = en.Append(0xa5, 0x53, 0x74, 0x61, 0x74, 0x73) + + // skip if no fields are to be emitted + if zb0001Len != 0 { + // write "Start" + err = en.Append(0xa5, 0x53, 0x74, 0x61, 0x72, 0x74) if err != nil { return } - err = en.WriteArrayHeader(uint32(len(z.Stats))) + err = en.WriteUint64(z.Start) if err != nil { - err = msgp.WrapError(err, "Stats") + err = msgp.WrapError(err, "Start") return } - for za0001 := range z.Stats { - if z.Stats[za0001] == nil { - err = en.WriteNil() - if err != nil { - return - } - } else { - err = z.Stats[za0001].EncodeMsg(en) - if err != nil { - err = msgp.WrapError(err, "Stats", za0001) - return + // write "Duration" + err = en.Append(0xa8, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e) + if err != nil { + return + } + err = en.WriteUint64(z.Duration) + if err != nil { + err = msgp.WrapError(err, "Duration") + return + } + if (zb0001Mask & 0x4) == 0 { // if not omitted + // write "Stats" + err = en.Append(0xa5, 0x53, 0x74, 0x61, 0x74, 0x73) + if err != nil { + return + } + err = en.WriteArrayHeader(uint32(len(z.Stats))) + if err != nil { + err = msgp.WrapError(err, "Stats") + return + } + for za0001 := range z.Stats { + if z.Stats[za0001] == nil { + err = en.WriteNil() + if err != nil { + return + } + } else { + err = z.Stats[za0001].EncodeMsg(en) + if err != nil { + err = msgp.WrapError(err, "Stats", za0001) + return + } } } } - } - // write "AgentTimeShift" - err = en.Append(0xae, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x53, 0x68, 0x69, 0x66, 0x74) - if err != nil { - return - } - err = en.WriteInt64(z.AgentTimeShift) - if err != nil { - err = msgp.WrapError(err, "AgentTimeShift") - return + // write "AgentTimeShift" + err = en.Append(0xae, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x53, 0x68, 0x69, 0x66, 0x74) + if err != nil { + return + } + err = en.WriteInt64(z.AgentTimeShift) + if err != nil { + err = msgp.WrapError(err, "AgentTimeShift") + return + } } return } @@ -689,43 +691,45 @@ func (z *ClientStatsBucket) EncodeMsg(en *msgp.Writer) (err error) { // MarshalMsg implements msgp.Marshaler func (z *ClientStatsBucket) MarshalMsg(b []byte) (o []byte, err error) { o = msgp.Require(b, z.Msgsize()) - // omitempty: check for empty values + // check for omitted fields zb0001Len := uint32(4) var zb0001Mask uint8 /* 4 bits */ + _ = zb0001Mask if z.Stats == nil { zb0001Len-- zb0001Mask |= 0x4 } // variable map header, size zb0001Len o = append(o, 0x80|uint8(zb0001Len)) - if zb0001Len == 0 { - return - } - // string "Start" - o = append(o, 0xa5, 0x53, 0x74, 0x61, 0x72, 0x74) - o = msgp.AppendUint64(o, z.Start) - // string "Duration" - o = append(o, 0xa8, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e) - o = msgp.AppendUint64(o, z.Duration) - if (zb0001Mask & 0x4) == 0 { // if not empty - // string "Stats" - o = append(o, 0xa5, 0x53, 0x74, 0x61, 0x74, 0x73) - o = msgp.AppendArrayHeader(o, uint32(len(z.Stats))) - for za0001 := range z.Stats { - if z.Stats[za0001] == nil { - o = msgp.AppendNil(o) - } else { - o, err = z.Stats[za0001].MarshalMsg(o) - if err != nil { - err = msgp.WrapError(err, "Stats", za0001) - return + + // skip if no fields are to be emitted + if zb0001Len != 0 { + // string "Start" + o = append(o, 0xa5, 0x53, 0x74, 0x61, 0x72, 0x74) + o = msgp.AppendUint64(o, z.Start) + // string "Duration" + o = append(o, 0xa8, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e) + o = msgp.AppendUint64(o, z.Duration) + if (zb0001Mask & 0x4) == 0 { // if not omitted + // string "Stats" + o = append(o, 0xa5, 0x53, 0x74, 0x61, 0x74, 0x73) + o = msgp.AppendArrayHeader(o, uint32(len(z.Stats))) + for za0001 := range z.Stats { + if z.Stats[za0001] == nil { + o = msgp.AppendNil(o) + } else { + o, err = z.Stats[za0001].MarshalMsg(o) + if err != nil { + err = msgp.WrapError(err, "Stats", za0001) + return + } } } } + // string "AgentTimeShift" + o = append(o, 0xae, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x53, 0x68, 0x69, 0x66, 0x74) + o = msgp.AppendInt64(o, z.AgentTimeShift) } - // string "AgentTimeShift" - o = append(o, 0xae, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x53, 0x68, 0x69, 0x66, 0x74) - o = msgp.AppendInt64(o, z.AgentTimeShift) return } @@ -974,9 +978,10 @@ func (z *ClientStatsPayload) DecodeMsg(dc *msgp.Reader) (err error) { // EncodeMsg implements msgp.Encodable func (z *ClientStatsPayload) EncodeMsg(en *msgp.Writer) (err error) { - // omitempty: check for empty values + // check for omitted fields zb0001Len := uint32(14) var zb0001Mask uint16 /* 14 bits */ + _ = zb0001Mask if z.Stats == nil { zb0001Len-- zb0001Mask |= 0x8 @@ -986,171 +991,172 @@ func (z *ClientStatsPayload) EncodeMsg(en *msgp.Writer) (err error) { if err != nil { return } - if zb0001Len == 0 { - return - } - // write "Hostname" - err = en.Append(0xa8, 0x48, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65) - if err != nil { - return - } - err = en.WriteString(z.Hostname) - if err != nil { - err = msgp.WrapError(err, "Hostname") - return - } - // write "Env" - err = en.Append(0xa3, 0x45, 0x6e, 0x76) - if err != nil { - return - } - err = en.WriteString(z.Env) - if err != nil { - err = msgp.WrapError(err, "Env") - return - } - // write "Version" - err = en.Append(0xa7, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e) - if err != nil { - return - } - err = en.WriteString(z.Version) - if err != nil { - err = msgp.WrapError(err, "Version") - return - } - if (zb0001Mask & 0x8) == 0 { // if not empty - // write "Stats" - err = en.Append(0xa5, 0x53, 0x74, 0x61, 0x74, 0x73) + + // skip if no fields are to be emitted + if zb0001Len != 0 { + // write "Hostname" + err = en.Append(0xa8, 0x48, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65) if err != nil { return } - err = en.WriteArrayHeader(uint32(len(z.Stats))) + err = en.WriteString(z.Hostname) if err != nil { - err = msgp.WrapError(err, "Stats") + err = msgp.WrapError(err, "Hostname") return } - for za0001 := range z.Stats { - if z.Stats[za0001] == nil { - err = en.WriteNil() - if err != nil { - return - } - } else { - err = z.Stats[za0001].EncodeMsg(en) - if err != nil { - err = msgp.WrapError(err, "Stats", za0001) - return + // write "Env" + err = en.Append(0xa3, 0x45, 0x6e, 0x76) + if err != nil { + return + } + err = en.WriteString(z.Env) + if err != nil { + err = msgp.WrapError(err, "Env") + return + } + // write "Version" + err = en.Append(0xa7, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e) + if err != nil { + return + } + err = en.WriteString(z.Version) + if err != nil { + err = msgp.WrapError(err, "Version") + return + } + if (zb0001Mask & 0x8) == 0 { // if not omitted + // write "Stats" + err = en.Append(0xa5, 0x53, 0x74, 0x61, 0x74, 0x73) + if err != nil { + return + } + err = en.WriteArrayHeader(uint32(len(z.Stats))) + if err != nil { + err = msgp.WrapError(err, "Stats") + return + } + for za0001 := range z.Stats { + if z.Stats[za0001] == nil { + err = en.WriteNil() + if err != nil { + return + } + } else { + err = z.Stats[za0001].EncodeMsg(en) + if err != nil { + err = msgp.WrapError(err, "Stats", za0001) + return + } } } } - } - // write "Lang" - err = en.Append(0xa4, 0x4c, 0x61, 0x6e, 0x67) - if err != nil { - return - } - err = en.WriteString(z.Lang) - if err != nil { - err = msgp.WrapError(err, "Lang") - return - } - // write "TracerVersion" - err = en.Append(0xad, 0x54, 0x72, 0x61, 0x63, 0x65, 0x72, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e) - if err != nil { - return - } - err = en.WriteString(z.TracerVersion) - if err != nil { - err = msgp.WrapError(err, "TracerVersion") - return - } - // write "RuntimeID" - err = en.Append(0xa9, 0x52, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x49, 0x44) - if err != nil { - return - } - err = en.WriteString(z.RuntimeID) - if err != nil { - err = msgp.WrapError(err, "RuntimeID") - return - } - // write "Sequence" - err = en.Append(0xa8, 0x53, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65) - if err != nil { - return - } - err = en.WriteUint64(z.Sequence) - if err != nil { - err = msgp.WrapError(err, "Sequence") - return - } - // write "AgentAggregation" - err = en.Append(0xb0, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e) - if err != nil { - return - } - err = en.WriteString(z.AgentAggregation) - if err != nil { - err = msgp.WrapError(err, "AgentAggregation") - return - } - // write "Service" - err = en.Append(0xa7, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65) - if err != nil { - return - } - err = en.WriteString(z.Service) - if err != nil { - err = msgp.WrapError(err, "Service") - return - } - // write "ContainerID" - err = en.Append(0xab, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x44) - if err != nil { - return - } - err = en.WriteString(z.ContainerID) - if err != nil { - err = msgp.WrapError(err, "ContainerID") - return - } - // write "Tags" - err = en.Append(0xa4, 0x54, 0x61, 0x67, 0x73) - if err != nil { - return - } - err = en.WriteArrayHeader(uint32(len(z.Tags))) - if err != nil { - err = msgp.WrapError(err, "Tags") - return - } - for za0002 := range z.Tags { - err = en.WriteString(z.Tags[za0002]) + // write "Lang" + err = en.Append(0xa4, 0x4c, 0x61, 0x6e, 0x67) if err != nil { - err = msgp.WrapError(err, "Tags", za0002) return } - } - // write "GitCommitSha" - err = en.Append(0xac, 0x47, 0x69, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x53, 0x68, 0x61) - if err != nil { - return - } - err = en.WriteString(z.GitCommitSha) - if err != nil { - err = msgp.WrapError(err, "GitCommitSha") - return - } - // write "ImageTag" - err = en.Append(0xa8, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x54, 0x61, 0x67) - if err != nil { - return - } - err = en.WriteString(z.ImageTag) - if err != nil { - err = msgp.WrapError(err, "ImageTag") - return + err = en.WriteString(z.Lang) + if err != nil { + err = msgp.WrapError(err, "Lang") + return + } + // write "TracerVersion" + err = en.Append(0xad, 0x54, 0x72, 0x61, 0x63, 0x65, 0x72, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e) + if err != nil { + return + } + err = en.WriteString(z.TracerVersion) + if err != nil { + err = msgp.WrapError(err, "TracerVersion") + return + } + // write "RuntimeID" + err = en.Append(0xa9, 0x52, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x49, 0x44) + if err != nil { + return + } + err = en.WriteString(z.RuntimeID) + if err != nil { + err = msgp.WrapError(err, "RuntimeID") + return + } + // write "Sequence" + err = en.Append(0xa8, 0x53, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65) + if err != nil { + return + } + err = en.WriteUint64(z.Sequence) + if err != nil { + err = msgp.WrapError(err, "Sequence") + return + } + // write "AgentAggregation" + err = en.Append(0xb0, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e) + if err != nil { + return + } + err = en.WriteString(z.AgentAggregation) + if err != nil { + err = msgp.WrapError(err, "AgentAggregation") + return + } + // write "Service" + err = en.Append(0xa7, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65) + if err != nil { + return + } + err = en.WriteString(z.Service) + if err != nil { + err = msgp.WrapError(err, "Service") + return + } + // write "ContainerID" + err = en.Append(0xab, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x44) + if err != nil { + return + } + err = en.WriteString(z.ContainerID) + if err != nil { + err = msgp.WrapError(err, "ContainerID") + return + } + // write "Tags" + err = en.Append(0xa4, 0x54, 0x61, 0x67, 0x73) + if err != nil { + return + } + err = en.WriteArrayHeader(uint32(len(z.Tags))) + if err != nil { + err = msgp.WrapError(err, "Tags") + return + } + for za0002 := range z.Tags { + err = en.WriteString(z.Tags[za0002]) + if err != nil { + err = msgp.WrapError(err, "Tags", za0002) + return + } + } + // write "GitCommitSha" + err = en.Append(0xac, 0x47, 0x69, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x53, 0x68, 0x61) + if err != nil { + return + } + err = en.WriteString(z.GitCommitSha) + if err != nil { + err = msgp.WrapError(err, "GitCommitSha") + return + } + // write "ImageTag" + err = en.Append(0xa8, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x54, 0x61, 0x67) + if err != nil { + return + } + err = en.WriteString(z.ImageTag) + if err != nil { + err = msgp.WrapError(err, "ImageTag") + return + } } return } @@ -1158,76 +1164,78 @@ func (z *ClientStatsPayload) EncodeMsg(en *msgp.Writer) (err error) { // MarshalMsg implements msgp.Marshaler func (z *ClientStatsPayload) MarshalMsg(b []byte) (o []byte, err error) { o = msgp.Require(b, z.Msgsize()) - // omitempty: check for empty values + // check for omitted fields zb0001Len := uint32(14) var zb0001Mask uint16 /* 14 bits */ + _ = zb0001Mask if z.Stats == nil { zb0001Len-- zb0001Mask |= 0x8 } // variable map header, size zb0001Len o = append(o, 0x80|uint8(zb0001Len)) - if zb0001Len == 0 { - return - } - // string "Hostname" - o = append(o, 0xa8, 0x48, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65) - o = msgp.AppendString(o, z.Hostname) - // string "Env" - o = append(o, 0xa3, 0x45, 0x6e, 0x76) - o = msgp.AppendString(o, z.Env) - // string "Version" - o = append(o, 0xa7, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e) - o = msgp.AppendString(o, z.Version) - if (zb0001Mask & 0x8) == 0 { // if not empty - // string "Stats" - o = append(o, 0xa5, 0x53, 0x74, 0x61, 0x74, 0x73) - o = msgp.AppendArrayHeader(o, uint32(len(z.Stats))) - for za0001 := range z.Stats { - if z.Stats[za0001] == nil { - o = msgp.AppendNil(o) - } else { - o, err = z.Stats[za0001].MarshalMsg(o) - if err != nil { - err = msgp.WrapError(err, "Stats", za0001) - return + + // skip if no fields are to be emitted + if zb0001Len != 0 { + // string "Hostname" + o = append(o, 0xa8, 0x48, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65) + o = msgp.AppendString(o, z.Hostname) + // string "Env" + o = append(o, 0xa3, 0x45, 0x6e, 0x76) + o = msgp.AppendString(o, z.Env) + // string "Version" + o = append(o, 0xa7, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e) + o = msgp.AppendString(o, z.Version) + if (zb0001Mask & 0x8) == 0 { // if not omitted + // string "Stats" + o = append(o, 0xa5, 0x53, 0x74, 0x61, 0x74, 0x73) + o = msgp.AppendArrayHeader(o, uint32(len(z.Stats))) + for za0001 := range z.Stats { + if z.Stats[za0001] == nil { + o = msgp.AppendNil(o) + } else { + o, err = z.Stats[za0001].MarshalMsg(o) + if err != nil { + err = msgp.WrapError(err, "Stats", za0001) + return + } } } } + // string "Lang" + o = append(o, 0xa4, 0x4c, 0x61, 0x6e, 0x67) + o = msgp.AppendString(o, z.Lang) + // string "TracerVersion" + o = append(o, 0xad, 0x54, 0x72, 0x61, 0x63, 0x65, 0x72, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e) + o = msgp.AppendString(o, z.TracerVersion) + // string "RuntimeID" + o = append(o, 0xa9, 0x52, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x49, 0x44) + o = msgp.AppendString(o, z.RuntimeID) + // string "Sequence" + o = append(o, 0xa8, 0x53, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65) + o = msgp.AppendUint64(o, z.Sequence) + // string "AgentAggregation" + o = append(o, 0xb0, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e) + o = msgp.AppendString(o, z.AgentAggregation) + // string "Service" + o = append(o, 0xa7, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65) + o = msgp.AppendString(o, z.Service) + // string "ContainerID" + o = append(o, 0xab, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x44) + o = msgp.AppendString(o, z.ContainerID) + // string "Tags" + o = append(o, 0xa4, 0x54, 0x61, 0x67, 0x73) + o = msgp.AppendArrayHeader(o, uint32(len(z.Tags))) + for za0002 := range z.Tags { + o = msgp.AppendString(o, z.Tags[za0002]) + } + // string "GitCommitSha" + o = append(o, 0xac, 0x47, 0x69, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x53, 0x68, 0x61) + o = msgp.AppendString(o, z.GitCommitSha) + // string "ImageTag" + o = append(o, 0xa8, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x54, 0x61, 0x67) + o = msgp.AppendString(o, z.ImageTag) } - // string "Lang" - o = append(o, 0xa4, 0x4c, 0x61, 0x6e, 0x67) - o = msgp.AppendString(o, z.Lang) - // string "TracerVersion" - o = append(o, 0xad, 0x54, 0x72, 0x61, 0x63, 0x65, 0x72, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e) - o = msgp.AppendString(o, z.TracerVersion) - // string "RuntimeID" - o = append(o, 0xa9, 0x52, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x49, 0x44) - o = msgp.AppendString(o, z.RuntimeID) - // string "Sequence" - o = append(o, 0xa8, 0x53, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65) - o = msgp.AppendUint64(o, z.Sequence) - // string "AgentAggregation" - o = append(o, 0xb0, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e) - o = msgp.AppendString(o, z.AgentAggregation) - // string "Service" - o = append(o, 0xa7, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65) - o = msgp.AppendString(o, z.Service) - // string "ContainerID" - o = append(o, 0xab, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x44) - o = msgp.AppendString(o, z.ContainerID) - // string "Tags" - o = append(o, 0xa4, 0x54, 0x61, 0x67, 0x73) - o = msgp.AppendArrayHeader(o, uint32(len(z.Tags))) - for za0002 := range z.Tags { - o = msgp.AppendString(o, z.Tags[za0002]) - } - // string "GitCommitSha" - o = append(o, 0xac, 0x47, 0x69, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x53, 0x68, 0x61) - o = msgp.AppendString(o, z.GitCommitSha) - // string "ImageTag" - o = append(o, 0xa8, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x54, 0x61, 0x67) - o = msgp.AppendString(o, z.ImageTag) return } @@ -1492,9 +1500,10 @@ func (z *StatsPayload) DecodeMsg(dc *msgp.Reader) (err error) { // EncodeMsg implements msgp.Encodable func (z *StatsPayload) EncodeMsg(en *msgp.Writer) (err error) { - // omitempty: check for empty values + // check for omitted fields zb0001Len := uint32(6) var zb0001Mask uint8 /* 6 bits */ + _ = zb0001Mask if z.Stats == nil { zb0001Len-- zb0001Mask |= 0x4 @@ -1504,84 +1513,85 @@ func (z *StatsPayload) EncodeMsg(en *msgp.Writer) (err error) { if err != nil { return } - if zb0001Len == 0 { - return - } - // write "AgentHostname" - err = en.Append(0xad, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x48, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65) - if err != nil { - return - } - err = en.WriteString(z.AgentHostname) - if err != nil { - err = msgp.WrapError(err, "AgentHostname") - return - } - // write "AgentEnv" - err = en.Append(0xa8, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x45, 0x6e, 0x76) - if err != nil { - return - } - err = en.WriteString(z.AgentEnv) - if err != nil { - err = msgp.WrapError(err, "AgentEnv") - return - } - if (zb0001Mask & 0x4) == 0 { // if not empty - // write "Stats" - err = en.Append(0xa5, 0x53, 0x74, 0x61, 0x74, 0x73) + + // skip if no fields are to be emitted + if zb0001Len != 0 { + // write "AgentHostname" + err = en.Append(0xad, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x48, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65) if err != nil { return } - err = en.WriteArrayHeader(uint32(len(z.Stats))) + err = en.WriteString(z.AgentHostname) if err != nil { - err = msgp.WrapError(err, "Stats") + err = msgp.WrapError(err, "AgentHostname") return } - for za0001 := range z.Stats { - if z.Stats[za0001] == nil { - err = en.WriteNil() - if err != nil { - return - } - } else { - err = z.Stats[za0001].EncodeMsg(en) - if err != nil { - err = msgp.WrapError(err, "Stats", za0001) - return + // write "AgentEnv" + err = en.Append(0xa8, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x45, 0x6e, 0x76) + if err != nil { + return + } + err = en.WriteString(z.AgentEnv) + if err != nil { + err = msgp.WrapError(err, "AgentEnv") + return + } + if (zb0001Mask & 0x4) == 0 { // if not omitted + // write "Stats" + err = en.Append(0xa5, 0x53, 0x74, 0x61, 0x74, 0x73) + if err != nil { + return + } + err = en.WriteArrayHeader(uint32(len(z.Stats))) + if err != nil { + err = msgp.WrapError(err, "Stats") + return + } + for za0001 := range z.Stats { + if z.Stats[za0001] == nil { + err = en.WriteNil() + if err != nil { + return + } + } else { + err = z.Stats[za0001].EncodeMsg(en) + if err != nil { + err = msgp.WrapError(err, "Stats", za0001) + return + } } } } - } - // write "AgentVersion" - err = en.Append(0xac, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e) - if err != nil { - return - } - err = en.WriteString(z.AgentVersion) - if err != nil { - err = msgp.WrapError(err, "AgentVersion") - return - } - // write "ClientComputed" - err = en.Append(0xae, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x64) - if err != nil { - return - } - err = en.WriteBool(z.ClientComputed) - if err != nil { - err = msgp.WrapError(err, "ClientComputed") - return - } - // write "SplitPayload" - err = en.Append(0xac, 0x53, 0x70, 0x6c, 0x69, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64) - if err != nil { - return - } - err = en.WriteBool(z.SplitPayload) - if err != nil { - err = msgp.WrapError(err, "SplitPayload") - return + // write "AgentVersion" + err = en.Append(0xac, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e) + if err != nil { + return + } + err = en.WriteString(z.AgentVersion) + if err != nil { + err = msgp.WrapError(err, "AgentVersion") + return + } + // write "ClientComputed" + err = en.Append(0xae, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x64) + if err != nil { + return + } + err = en.WriteBool(z.ClientComputed) + if err != nil { + err = msgp.WrapError(err, "ClientComputed") + return + } + // write "SplitPayload" + err = en.Append(0xac, 0x53, 0x70, 0x6c, 0x69, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64) + if err != nil { + return + } + err = en.WriteBool(z.SplitPayload) + if err != nil { + err = msgp.WrapError(err, "SplitPayload") + return + } } return } @@ -1589,49 +1599,51 @@ func (z *StatsPayload) EncodeMsg(en *msgp.Writer) (err error) { // MarshalMsg implements msgp.Marshaler func (z *StatsPayload) MarshalMsg(b []byte) (o []byte, err error) { o = msgp.Require(b, z.Msgsize()) - // omitempty: check for empty values + // check for omitted fields zb0001Len := uint32(6) var zb0001Mask uint8 /* 6 bits */ + _ = zb0001Mask if z.Stats == nil { zb0001Len-- zb0001Mask |= 0x4 } // variable map header, size zb0001Len o = append(o, 0x80|uint8(zb0001Len)) - if zb0001Len == 0 { - return - } - // string "AgentHostname" - o = append(o, 0xad, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x48, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65) - o = msgp.AppendString(o, z.AgentHostname) - // string "AgentEnv" - o = append(o, 0xa8, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x45, 0x6e, 0x76) - o = msgp.AppendString(o, z.AgentEnv) - if (zb0001Mask & 0x4) == 0 { // if not empty - // string "Stats" - o = append(o, 0xa5, 0x53, 0x74, 0x61, 0x74, 0x73) - o = msgp.AppendArrayHeader(o, uint32(len(z.Stats))) - for za0001 := range z.Stats { - if z.Stats[za0001] == nil { - o = msgp.AppendNil(o) - } else { - o, err = z.Stats[za0001].MarshalMsg(o) - if err != nil { - err = msgp.WrapError(err, "Stats", za0001) - return + + // skip if no fields are to be emitted + if zb0001Len != 0 { + // string "AgentHostname" + o = append(o, 0xad, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x48, 0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65) + o = msgp.AppendString(o, z.AgentHostname) + // string "AgentEnv" + o = append(o, 0xa8, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x45, 0x6e, 0x76) + o = msgp.AppendString(o, z.AgentEnv) + if (zb0001Mask & 0x4) == 0 { // if not omitted + // string "Stats" + o = append(o, 0xa5, 0x53, 0x74, 0x61, 0x74, 0x73) + o = msgp.AppendArrayHeader(o, uint32(len(z.Stats))) + for za0001 := range z.Stats { + if z.Stats[za0001] == nil { + o = msgp.AppendNil(o) + } else { + o, err = z.Stats[za0001].MarshalMsg(o) + if err != nil { + err = msgp.WrapError(err, "Stats", za0001) + return + } } } } + // string "AgentVersion" + o = append(o, 0xac, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e) + o = msgp.AppendString(o, z.AgentVersion) + // string "ClientComputed" + o = append(o, 0xae, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x64) + o = msgp.AppendBool(o, z.ClientComputed) + // string "SplitPayload" + o = append(o, 0xac, 0x53, 0x70, 0x6c, 0x69, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64) + o = msgp.AppendBool(o, z.SplitPayload) } - // string "AgentVersion" - o = append(o, 0xac, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e) - o = msgp.AppendString(o, z.AgentVersion) - // string "ClientComputed" - o = append(o, 0xae, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x64) - o = msgp.AppendBool(o, z.ClientComputed) - // string "SplitPayload" - o = append(o, 0xac, 0x53, 0x70, 0x6c, 0x69, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64) - o = msgp.AppendBool(o, z.SplitPayload) return } diff --git a/pkg/proto/pbgo/trace/stats_vtproto.pb.go b/pkg/proto/pbgo/trace/stats_vtproto.pb.go index 002bfad30e09e..96141ab5f2164 100644 --- a/pkg/proto/pbgo/trace/stats_vtproto.pb.go +++ b/pkg/proto/pbgo/trace/stats_vtproto.pb.go @@ -1,11 +1,12 @@ // Code generated by protoc-gen-go-vtproto. DO NOT EDIT. -// protoc-gen-go-vtproto version: v0.4.0 +// protoc-gen-go-vtproto version: v0.6.1-0.20240319094008-0393e58bdf10 // source: datadog/trace/stats.proto package trace import ( fmt "fmt" + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" protoimpl "google.golang.org/protobuf/runtime/protoimpl" io "io" ) @@ -70,7 +71,7 @@ func (m *StatsPayload) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.AgentVersion) > 0 { i -= len(m.AgentVersion) copy(dAtA[i:], m.AgentVersion) - i = encodeVarint(dAtA, i, uint64(len(m.AgentVersion))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.AgentVersion))) i-- dAtA[i] = 0x22 } @@ -81,7 +82,7 @@ func (m *StatsPayload) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x1a } @@ -89,14 +90,14 @@ func (m *StatsPayload) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.AgentEnv) > 0 { i -= len(m.AgentEnv) copy(dAtA[i:], m.AgentEnv) - i = encodeVarint(dAtA, i, uint64(len(m.AgentEnv))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.AgentEnv))) i-- dAtA[i] = 0x12 } if len(m.AgentHostname) > 0 { i -= len(m.AgentHostname) copy(dAtA[i:], m.AgentHostname) - i = encodeVarint(dAtA, i, uint64(len(m.AgentHostname))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.AgentHostname))) i-- dAtA[i] = 0xa } @@ -136,14 +137,14 @@ func (m *ClientStatsPayload) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.ImageTag) > 0 { i -= len(m.ImageTag) copy(dAtA[i:], m.ImageTag) - i = encodeVarint(dAtA, i, uint64(len(m.ImageTag))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.ImageTag))) i-- dAtA[i] = 0x72 } if len(m.GitCommitSha) > 0 { i -= len(m.GitCommitSha) copy(dAtA[i:], m.GitCommitSha) - i = encodeVarint(dAtA, i, uint64(len(m.GitCommitSha))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.GitCommitSha))) i-- dAtA[i] = 0x6a } @@ -151,7 +152,7 @@ func (m *ClientStatsPayload) MarshalToSizedBufferVT(dAtA []byte) (int, error) { for iNdEx := len(m.Tags) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.Tags[iNdEx]) copy(dAtA[i:], m.Tags[iNdEx]) - i = encodeVarint(dAtA, i, uint64(len(m.Tags[iNdEx]))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Tags[iNdEx]))) i-- dAtA[i] = 0x62 } @@ -159,47 +160,47 @@ func (m *ClientStatsPayload) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.ContainerID) > 0 { i -= len(m.ContainerID) copy(dAtA[i:], m.ContainerID) - i = encodeVarint(dAtA, i, uint64(len(m.ContainerID))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.ContainerID))) i-- dAtA[i] = 0x5a } if len(m.Service) > 0 { i -= len(m.Service) copy(dAtA[i:], m.Service) - i = encodeVarint(dAtA, i, uint64(len(m.Service))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Service))) i-- dAtA[i] = 0x52 } if len(m.AgentAggregation) > 0 { i -= len(m.AgentAggregation) copy(dAtA[i:], m.AgentAggregation) - i = encodeVarint(dAtA, i, uint64(len(m.AgentAggregation))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.AgentAggregation))) i-- dAtA[i] = 0x4a } if m.Sequence != 0 { - i = encodeVarint(dAtA, i, uint64(m.Sequence)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Sequence)) i-- dAtA[i] = 0x40 } if len(m.RuntimeID) > 0 { i -= len(m.RuntimeID) copy(dAtA[i:], m.RuntimeID) - i = encodeVarint(dAtA, i, uint64(len(m.RuntimeID))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.RuntimeID))) i-- dAtA[i] = 0x3a } if len(m.TracerVersion) > 0 { i -= len(m.TracerVersion) copy(dAtA[i:], m.TracerVersion) - i = encodeVarint(dAtA, i, uint64(len(m.TracerVersion))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.TracerVersion))) i-- dAtA[i] = 0x32 } if len(m.Lang) > 0 { i -= len(m.Lang) copy(dAtA[i:], m.Lang) - i = encodeVarint(dAtA, i, uint64(len(m.Lang))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Lang))) i-- dAtA[i] = 0x2a } @@ -210,7 +211,7 @@ func (m *ClientStatsPayload) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x22 } @@ -218,21 +219,21 @@ func (m *ClientStatsPayload) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.Version) > 0 { i -= len(m.Version) copy(dAtA[i:], m.Version) - i = encodeVarint(dAtA, i, uint64(len(m.Version))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Version))) i-- dAtA[i] = 0x1a } if len(m.Env) > 0 { i -= len(m.Env) copy(dAtA[i:], m.Env) - i = encodeVarint(dAtA, i, uint64(len(m.Env))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Env))) i-- dAtA[i] = 0x12 } if len(m.Hostname) > 0 { i -= len(m.Hostname) copy(dAtA[i:], m.Hostname) - i = encodeVarint(dAtA, i, uint64(len(m.Hostname))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Hostname))) i-- dAtA[i] = 0xa } @@ -270,7 +271,7 @@ func (m *ClientStatsBucket) MarshalToSizedBufferVT(dAtA []byte) (int, error) { copy(dAtA[i:], m.unknownFields) } if m.AgentTimeShift != 0 { - i = encodeVarint(dAtA, i, uint64(m.AgentTimeShift)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.AgentTimeShift)) i-- dAtA[i] = 0x20 } @@ -281,18 +282,18 @@ func (m *ClientStatsBucket) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x1a } } if m.Duration != 0 { - i = encodeVarint(dAtA, i, uint64(m.Duration)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Duration)) i-- dAtA[i] = 0x10 } if m.Start != 0 { - i = encodeVarint(dAtA, i, uint64(m.Start)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Start)) i-- dAtA[i] = 0x8 } @@ -330,7 +331,7 @@ func (m *ClientGroupedStats) MarshalToSizedBufferVT(dAtA []byte) (int, error) { copy(dAtA[i:], m.unknownFields) } if m.IsTraceRoot != 0 { - i = encodeVarint(dAtA, i, uint64(m.IsTraceRoot)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.IsTraceRoot)) i-- dAtA[i] = 0x1 i-- @@ -340,7 +341,7 @@ func (m *ClientGroupedStats) MarshalToSizedBufferVT(dAtA []byte) (int, error) { for iNdEx := len(m.PeerTags) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.PeerTags[iNdEx]) copy(dAtA[i:], m.PeerTags[iNdEx]) - i = encodeVarint(dAtA, i, uint64(len(m.PeerTags[iNdEx]))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.PeerTags[iNdEx]))) i-- dAtA[i] = 0x1 i-- @@ -350,12 +351,12 @@ func (m *ClientGroupedStats) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.SpanKind) > 0 { i -= len(m.SpanKind) copy(dAtA[i:], m.SpanKind) - i = encodeVarint(dAtA, i, uint64(len(m.SpanKind))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.SpanKind))) i-- dAtA[i] = 0x7a } if m.TopLevelHits != 0 { - i = encodeVarint(dAtA, i, uint64(m.TopLevelHits)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.TopLevelHits)) i-- dAtA[i] = 0x68 } @@ -372,69 +373,69 @@ func (m *ClientGroupedStats) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.ErrorSummary) > 0 { i -= len(m.ErrorSummary) copy(dAtA[i:], m.ErrorSummary) - i = encodeVarint(dAtA, i, uint64(len(m.ErrorSummary))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.ErrorSummary))) i-- dAtA[i] = 0x5a } if len(m.OkSummary) > 0 { i -= len(m.OkSummary) copy(dAtA[i:], m.OkSummary) - i = encodeVarint(dAtA, i, uint64(len(m.OkSummary))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.OkSummary))) i-- dAtA[i] = 0x52 } if m.Duration != 0 { - i = encodeVarint(dAtA, i, uint64(m.Duration)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Duration)) i-- dAtA[i] = 0x48 } if m.Errors != 0 { - i = encodeVarint(dAtA, i, uint64(m.Errors)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Errors)) i-- dAtA[i] = 0x40 } if m.Hits != 0 { - i = encodeVarint(dAtA, i, uint64(m.Hits)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Hits)) i-- dAtA[i] = 0x38 } if len(m.DBType) > 0 { i -= len(m.DBType) copy(dAtA[i:], m.DBType) - i = encodeVarint(dAtA, i, uint64(len(m.DBType))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.DBType))) i-- dAtA[i] = 0x32 } if len(m.Type) > 0 { i -= len(m.Type) copy(dAtA[i:], m.Type) - i = encodeVarint(dAtA, i, uint64(len(m.Type))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Type))) i-- dAtA[i] = 0x2a } if m.HTTPStatusCode != 0 { - i = encodeVarint(dAtA, i, uint64(m.HTTPStatusCode)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.HTTPStatusCode)) i-- dAtA[i] = 0x20 } if len(m.Resource) > 0 { i -= len(m.Resource) copy(dAtA[i:], m.Resource) - i = encodeVarint(dAtA, i, uint64(len(m.Resource))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Resource))) i-- dAtA[i] = 0x1a } if len(m.Name) > 0 { i -= len(m.Name) copy(dAtA[i:], m.Name) - i = encodeVarint(dAtA, i, uint64(len(m.Name))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Name))) i-- dAtA[i] = 0x12 } if len(m.Service) > 0 { i -= len(m.Service) copy(dAtA[i:], m.Service) - i = encodeVarint(dAtA, i, uint64(len(m.Service))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Service))) i-- dAtA[i] = 0xa } @@ -449,21 +450,21 @@ func (m *StatsPayload) SizeVT() (n int) { _ = l l = len(m.AgentHostname) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.AgentEnv) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if len(m.Stats) > 0 { for _, e := range m.Stats { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } l = len(m.AgentVersion) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.ClientComputed { n += 2 @@ -483,62 +484,62 @@ func (m *ClientStatsPayload) SizeVT() (n int) { _ = l l = len(m.Hostname) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.Env) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.Version) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if len(m.Stats) > 0 { for _, e := range m.Stats { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } l = len(m.Lang) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.TracerVersion) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.RuntimeID) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.Sequence != 0 { - n += 1 + sov(uint64(m.Sequence)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Sequence)) } l = len(m.AgentAggregation) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.Service) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.ContainerID) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if len(m.Tags) > 0 { for _, s := range m.Tags { l = len(s) - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } l = len(m.GitCommitSha) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.ImageTag) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -551,19 +552,19 @@ func (m *ClientStatsBucket) SizeVT() (n int) { var l int _ = l if m.Start != 0 { - n += 1 + sov(uint64(m.Start)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Start)) } if m.Duration != 0 { - n += 1 + sov(uint64(m.Duration)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Duration)) } if len(m.Stats) > 0 { for _, e := range m.Stats { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } if m.AgentTimeShift != 0 { - n += 1 + sov(uint64(m.AgentTimeShift)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.AgentTimeShift)) } n += len(m.unknownFields) return n @@ -577,62 +578,62 @@ func (m *ClientGroupedStats) SizeVT() (n int) { _ = l l = len(m.Service) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.Name) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.Resource) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.HTTPStatusCode != 0 { - n += 1 + sov(uint64(m.HTTPStatusCode)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.HTTPStatusCode)) } l = len(m.Type) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.DBType) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.Hits != 0 { - n += 1 + sov(uint64(m.Hits)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Hits)) } if m.Errors != 0 { - n += 1 + sov(uint64(m.Errors)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Errors)) } if m.Duration != 0 { - n += 1 + sov(uint64(m.Duration)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Duration)) } l = len(m.OkSummary) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.ErrorSummary) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if m.Synthetics { n += 2 } if m.TopLevelHits != 0 { - n += 1 + sov(uint64(m.TopLevelHits)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.TopLevelHits)) } l = len(m.SpanKind) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if len(m.PeerTags) > 0 { for _, s := range m.PeerTags { l = len(s) - n += 2 + l + sov(uint64(l)) + n += 2 + l + protohelpers.SizeOfVarint(uint64(l)) } } if m.IsTraceRoot != 0 { - n += 2 + sov(uint64(m.IsTraceRoot)) + n += 2 + protohelpers.SizeOfVarint(uint64(m.IsTraceRoot)) } n += len(m.unknownFields) return n @@ -646,7 +647,7 @@ func (m *StatsPayload) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -674,7 +675,7 @@ func (m *StatsPayload) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -688,11 +689,11 @@ func (m *StatsPayload) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -706,7 +707,7 @@ func (m *StatsPayload) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -720,11 +721,11 @@ func (m *StatsPayload) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -738,7 +739,7 @@ func (m *StatsPayload) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -751,11 +752,11 @@ func (m *StatsPayload) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -772,7 +773,7 @@ func (m *StatsPayload) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -786,11 +787,11 @@ func (m *StatsPayload) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -804,7 +805,7 @@ func (m *StatsPayload) UnmarshalVT(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -824,7 +825,7 @@ func (m *StatsPayload) UnmarshalVT(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -839,12 +840,12 @@ func (m *StatsPayload) UnmarshalVT(dAtA []byte) error { m.SplitPayload = bool(v != 0) default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -867,7 +868,7 @@ func (m *ClientStatsPayload) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -895,7 +896,7 @@ func (m *ClientStatsPayload) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -909,11 +910,11 @@ func (m *ClientStatsPayload) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -927,7 +928,7 @@ func (m *ClientStatsPayload) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -941,11 +942,11 @@ func (m *ClientStatsPayload) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -959,7 +960,7 @@ func (m *ClientStatsPayload) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -973,11 +974,11 @@ func (m *ClientStatsPayload) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -991,7 +992,7 @@ func (m *ClientStatsPayload) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1004,11 +1005,11 @@ func (m *ClientStatsPayload) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1025,7 +1026,7 @@ func (m *ClientStatsPayload) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1039,11 +1040,11 @@ func (m *ClientStatsPayload) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1057,7 +1058,7 @@ func (m *ClientStatsPayload) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1071,11 +1072,11 @@ func (m *ClientStatsPayload) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1089,7 +1090,7 @@ func (m *ClientStatsPayload) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1103,11 +1104,11 @@ func (m *ClientStatsPayload) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1121,7 +1122,7 @@ func (m *ClientStatsPayload) UnmarshalVT(dAtA []byte) error { m.Sequence = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1140,7 +1141,7 @@ func (m *ClientStatsPayload) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1154,11 +1155,11 @@ func (m *ClientStatsPayload) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1172,7 +1173,7 @@ func (m *ClientStatsPayload) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1186,11 +1187,11 @@ func (m *ClientStatsPayload) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1204,7 +1205,7 @@ func (m *ClientStatsPayload) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1218,11 +1219,11 @@ func (m *ClientStatsPayload) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1236,7 +1237,7 @@ func (m *ClientStatsPayload) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1250,11 +1251,11 @@ func (m *ClientStatsPayload) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1268,7 +1269,7 @@ func (m *ClientStatsPayload) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1282,11 +1283,11 @@ func (m *ClientStatsPayload) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1300,7 +1301,7 @@ func (m *ClientStatsPayload) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1314,11 +1315,11 @@ func (m *ClientStatsPayload) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1327,12 +1328,12 @@ func (m *ClientStatsPayload) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1355,7 +1356,7 @@ func (m *ClientStatsBucket) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1383,7 +1384,7 @@ func (m *ClientStatsBucket) UnmarshalVT(dAtA []byte) error { m.Start = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1402,7 +1403,7 @@ func (m *ClientStatsBucket) UnmarshalVT(dAtA []byte) error { m.Duration = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1421,7 +1422,7 @@ func (m *ClientStatsBucket) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1434,11 +1435,11 @@ func (m *ClientStatsBucket) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1455,7 +1456,7 @@ func (m *ClientStatsBucket) UnmarshalVT(dAtA []byte) error { m.AgentTimeShift = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1469,12 +1470,12 @@ func (m *ClientStatsBucket) UnmarshalVT(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1497,7 +1498,7 @@ func (m *ClientGroupedStats) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1525,7 +1526,7 @@ func (m *ClientGroupedStats) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1539,11 +1540,11 @@ func (m *ClientGroupedStats) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1557,7 +1558,7 @@ func (m *ClientGroupedStats) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1571,11 +1572,11 @@ func (m *ClientGroupedStats) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1589,7 +1590,7 @@ func (m *ClientGroupedStats) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1603,11 +1604,11 @@ func (m *ClientGroupedStats) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1621,7 +1622,7 @@ func (m *ClientGroupedStats) UnmarshalVT(dAtA []byte) error { m.HTTPStatusCode = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1640,7 +1641,7 @@ func (m *ClientGroupedStats) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1654,11 +1655,11 @@ func (m *ClientGroupedStats) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1672,7 +1673,7 @@ func (m *ClientGroupedStats) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1686,11 +1687,11 @@ func (m *ClientGroupedStats) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1704,7 +1705,7 @@ func (m *ClientGroupedStats) UnmarshalVT(dAtA []byte) error { m.Hits = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1723,7 +1724,7 @@ func (m *ClientGroupedStats) UnmarshalVT(dAtA []byte) error { m.Errors = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1742,7 +1743,7 @@ func (m *ClientGroupedStats) UnmarshalVT(dAtA []byte) error { m.Duration = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1761,7 +1762,7 @@ func (m *ClientGroupedStats) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1774,11 +1775,11 @@ func (m *ClientGroupedStats) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1795,7 +1796,7 @@ func (m *ClientGroupedStats) UnmarshalVT(dAtA []byte) error { var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1808,11 +1809,11 @@ func (m *ClientGroupedStats) UnmarshalVT(dAtA []byte) error { } } if byteLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + byteLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1829,7 +1830,7 @@ func (m *ClientGroupedStats) UnmarshalVT(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1849,7 +1850,7 @@ func (m *ClientGroupedStats) UnmarshalVT(dAtA []byte) error { m.TopLevelHits = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1868,7 +1869,7 @@ func (m *ClientGroupedStats) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1882,11 +1883,11 @@ func (m *ClientGroupedStats) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1900,7 +1901,7 @@ func (m *ClientGroupedStats) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1914,11 +1915,11 @@ func (m *ClientGroupedStats) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1932,7 +1933,7 @@ func (m *ClientGroupedStats) UnmarshalVT(dAtA []byte) error { m.IsTraceRoot = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1946,12 +1947,12 @@ func (m *ClientGroupedStats) UnmarshalVT(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF diff --git a/pkg/proto/pbgo/trace/tracer_payload.pb.go b/pkg/proto/pbgo/trace/tracer_payload.pb.go index 7e7e2b0cc278e..0420fc5b12ca2 100644 --- a/pkg/proto/pbgo/trace/tracer_payload.pb.go +++ b/pkg/proto/pbgo/trace/tracer_payload.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.0 +// protoc-gen-go v1.35.2 // protoc v5.26.1 // source: datadog/trace/tracer_payload.proto @@ -45,11 +45,9 @@ type TraceChunk struct { func (x *TraceChunk) Reset() { *x = TraceChunk{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_trace_tracer_payload_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_trace_tracer_payload_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *TraceChunk) String() string { @@ -60,7 +58,7 @@ func (*TraceChunk) ProtoMessage() {} func (x *TraceChunk) ProtoReflect() protoreflect.Message { mi := &file_datadog_trace_tracer_payload_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -150,11 +148,9 @@ type TracerPayload struct { func (x *TracerPayload) Reset() { *x = TracerPayload{} - if protoimpl.UnsafeEnabled { - mi := &file_datadog_trace_tracer_payload_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_datadog_trace_tracer_payload_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *TracerPayload) String() string { @@ -165,7 +161,7 @@ func (*TracerPayload) ProtoMessage() {} func (x *TracerPayload) ProtoReflect() protoreflect.Message { mi := &file_datadog_trace_tracer_payload_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -319,7 +315,7 @@ func file_datadog_trace_tracer_payload_proto_rawDescGZIP() []byte { } var file_datadog_trace_tracer_payload_proto_msgTypes = make([]protoimpl.MessageInfo, 4) -var file_datadog_trace_tracer_payload_proto_goTypes = []interface{}{ +var file_datadog_trace_tracer_payload_proto_goTypes = []any{ (*TraceChunk)(nil), // 0: datadog.trace.TraceChunk (*TracerPayload)(nil), // 1: datadog.trace.TracerPayload nil, // 2: datadog.trace.TraceChunk.TagsEntry @@ -344,32 +340,6 @@ func file_datadog_trace_tracer_payload_proto_init() { return } file_datadog_trace_span_proto_init() - if !protoimpl.UnsafeEnabled { - file_datadog_trace_tracer_payload_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TraceChunk); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_datadog_trace_tracer_payload_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TracerPayload); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/pkg/proto/pbgo/trace/tracer_payload_vtproto.pb.go b/pkg/proto/pbgo/trace/tracer_payload_vtproto.pb.go index b1544fa221ae2..b63a2fd37b2c2 100644 --- a/pkg/proto/pbgo/trace/tracer_payload_vtproto.pb.go +++ b/pkg/proto/pbgo/trace/tracer_payload_vtproto.pb.go @@ -1,11 +1,12 @@ // Code generated by protoc-gen-go-vtproto. DO NOT EDIT. -// protoc-gen-go-vtproto version: v0.4.0 +// protoc-gen-go-vtproto version: v0.6.1-0.20240319094008-0393e58bdf10 // source: datadog/trace/tracer_payload.proto package trace import ( fmt "fmt" + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" protoimpl "google.golang.org/protobuf/runtime/protoimpl" io "io" ) @@ -63,15 +64,15 @@ func (m *TraceChunk) MarshalToSizedBufferVT(dAtA []byte) (int, error) { baseI := i i -= len(v) copy(dAtA[i:], v) - i = encodeVarint(dAtA, i, uint64(len(v))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(v))) i-- dAtA[i] = 0x12 i -= len(k) copy(dAtA[i:], k) - i = encodeVarint(dAtA, i, uint64(len(k))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(k))) i-- dAtA[i] = 0xa - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x22 } @@ -83,7 +84,7 @@ func (m *TraceChunk) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x1a } @@ -91,12 +92,12 @@ func (m *TraceChunk) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.Origin) > 0 { i -= len(m.Origin) copy(dAtA[i:], m.Origin) - i = encodeVarint(dAtA, i, uint64(len(m.Origin))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Origin))) i-- dAtA[i] = 0x12 } if m.Priority != 0 { - i = encodeVarint(dAtA, i, uint64(m.Priority)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.Priority)) i-- dAtA[i] = 0x8 } @@ -136,21 +137,21 @@ func (m *TracerPayload) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.AppVersion) > 0 { i -= len(m.AppVersion) copy(dAtA[i:], m.AppVersion) - i = encodeVarint(dAtA, i, uint64(len(m.AppVersion))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.AppVersion))) i-- dAtA[i] = 0x52 } if len(m.Hostname) > 0 { i -= len(m.Hostname) copy(dAtA[i:], m.Hostname) - i = encodeVarint(dAtA, i, uint64(len(m.Hostname))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Hostname))) i-- dAtA[i] = 0x4a } if len(m.Env) > 0 { i -= len(m.Env) copy(dAtA[i:], m.Env) - i = encodeVarint(dAtA, i, uint64(len(m.Env))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Env))) i-- dAtA[i] = 0x42 } @@ -160,15 +161,15 @@ func (m *TracerPayload) MarshalToSizedBufferVT(dAtA []byte) (int, error) { baseI := i i -= len(v) copy(dAtA[i:], v) - i = encodeVarint(dAtA, i, uint64(len(v))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(v))) i-- dAtA[i] = 0x12 i -= len(k) copy(dAtA[i:], k) - i = encodeVarint(dAtA, i, uint64(len(k))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(k))) i-- dAtA[i] = 0xa - i = encodeVarint(dAtA, i, uint64(baseI-i)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x3a } @@ -180,7 +181,7 @@ func (m *TracerPayload) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return 0, err } i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x32 } @@ -188,35 +189,35 @@ func (m *TracerPayload) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if len(m.RuntimeID) > 0 { i -= len(m.RuntimeID) copy(dAtA[i:], m.RuntimeID) - i = encodeVarint(dAtA, i, uint64(len(m.RuntimeID))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.RuntimeID))) i-- dAtA[i] = 0x2a } if len(m.TracerVersion) > 0 { i -= len(m.TracerVersion) copy(dAtA[i:], m.TracerVersion) - i = encodeVarint(dAtA, i, uint64(len(m.TracerVersion))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.TracerVersion))) i-- dAtA[i] = 0x22 } if len(m.LanguageVersion) > 0 { i -= len(m.LanguageVersion) copy(dAtA[i:], m.LanguageVersion) - i = encodeVarint(dAtA, i, uint64(len(m.LanguageVersion))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.LanguageVersion))) i-- dAtA[i] = 0x1a } if len(m.LanguageName) > 0 { i -= len(m.LanguageName) copy(dAtA[i:], m.LanguageName) - i = encodeVarint(dAtA, i, uint64(len(m.LanguageName))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.LanguageName))) i-- dAtA[i] = 0x12 } if len(m.ContainerID) > 0 { i -= len(m.ContainerID) copy(dAtA[i:], m.ContainerID) - i = encodeVarint(dAtA, i, uint64(len(m.ContainerID))) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.ContainerID))) i-- dAtA[i] = 0xa } @@ -230,24 +231,24 @@ func (m *TraceChunk) SizeVT() (n int) { var l int _ = l if m.Priority != 0 { - n += 1 + sov(uint64(m.Priority)) + n += 1 + protohelpers.SizeOfVarint(uint64(m.Priority)) } l = len(m.Origin) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if len(m.Spans) > 0 { for _, e := range m.Spans { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } if len(m.Tags) > 0 { for k, v := range m.Tags { _ = k _ = v - mapEntrySize := 1 + len(k) + sov(uint64(len(k))) + 1 + len(v) + sov(uint64(len(v))) - n += mapEntrySize + 1 + sov(uint64(mapEntrySize)) + mapEntrySize := 1 + len(k) + protohelpers.SizeOfVarint(uint64(len(k))) + 1 + len(v) + protohelpers.SizeOfVarint(uint64(len(v))) + n += mapEntrySize + 1 + protohelpers.SizeOfVarint(uint64(mapEntrySize)) } } if m.DroppedTrace { @@ -265,49 +266,49 @@ func (m *TracerPayload) SizeVT() (n int) { _ = l l = len(m.ContainerID) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.LanguageName) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.LanguageVersion) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.TracerVersion) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.RuntimeID) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } if len(m.Chunks) > 0 { for _, e := range m.Chunks { l = e.SizeVT() - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } } if len(m.Tags) > 0 { for k, v := range m.Tags { _ = k _ = v - mapEntrySize := 1 + len(k) + sov(uint64(len(k))) + 1 + len(v) + sov(uint64(len(v))) - n += mapEntrySize + 1 + sov(uint64(mapEntrySize)) + mapEntrySize := 1 + len(k) + protohelpers.SizeOfVarint(uint64(len(k))) + 1 + len(v) + protohelpers.SizeOfVarint(uint64(len(v))) + n += mapEntrySize + 1 + protohelpers.SizeOfVarint(uint64(mapEntrySize)) } } l = len(m.Env) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.Hostname) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } l = len(m.AppVersion) if l > 0 { - n += 1 + l + sov(uint64(l)) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } n += len(m.unknownFields) return n @@ -321,7 +322,7 @@ func (m *TraceChunk) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -349,7 +350,7 @@ func (m *TraceChunk) UnmarshalVT(dAtA []byte) error { m.Priority = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -368,7 +369,7 @@ func (m *TraceChunk) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -382,11 +383,11 @@ func (m *TraceChunk) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -400,7 +401,7 @@ func (m *TraceChunk) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -413,11 +414,11 @@ func (m *TraceChunk) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -434,7 +435,7 @@ func (m *TraceChunk) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -447,11 +448,11 @@ func (m *TraceChunk) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -466,7 +467,7 @@ func (m *TraceChunk) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -483,7 +484,7 @@ func (m *TraceChunk) UnmarshalVT(dAtA []byte) error { var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -497,11 +498,11 @@ func (m *TraceChunk) UnmarshalVT(dAtA []byte) error { } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF @@ -512,7 +513,7 @@ func (m *TraceChunk) UnmarshalVT(dAtA []byte) error { var stringLenmapvalue uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -526,11 +527,11 @@ func (m *TraceChunk) UnmarshalVT(dAtA []byte) error { } intStringLenmapvalue := int(stringLenmapvalue) if intStringLenmapvalue < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postStringIndexmapvalue := iNdEx + intStringLenmapvalue if postStringIndexmapvalue < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postStringIndexmapvalue > l { return io.ErrUnexpectedEOF @@ -539,12 +540,12 @@ func (m *TraceChunk) UnmarshalVT(dAtA []byte) error { iNdEx = postStringIndexmapvalue } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -561,7 +562,7 @@ func (m *TraceChunk) UnmarshalVT(dAtA []byte) error { var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -576,12 +577,12 @@ func (m *TraceChunk) UnmarshalVT(dAtA []byte) error { m.DroppedTrace = bool(v != 0) default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -604,7 +605,7 @@ func (m *TracerPayload) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -632,7 +633,7 @@ func (m *TracerPayload) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -646,11 +647,11 @@ func (m *TracerPayload) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -664,7 +665,7 @@ func (m *TracerPayload) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -678,11 +679,11 @@ func (m *TracerPayload) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -696,7 +697,7 @@ func (m *TracerPayload) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -710,11 +711,11 @@ func (m *TracerPayload) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -728,7 +729,7 @@ func (m *TracerPayload) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -742,11 +743,11 @@ func (m *TracerPayload) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -760,7 +761,7 @@ func (m *TracerPayload) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -774,11 +775,11 @@ func (m *TracerPayload) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -792,7 +793,7 @@ func (m *TracerPayload) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -805,11 +806,11 @@ func (m *TracerPayload) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -826,7 +827,7 @@ func (m *TracerPayload) UnmarshalVT(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -839,11 +840,11 @@ func (m *TracerPayload) UnmarshalVT(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + msglen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -858,7 +859,7 @@ func (m *TracerPayload) UnmarshalVT(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -875,7 +876,7 @@ func (m *TracerPayload) UnmarshalVT(dAtA []byte) error { var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -889,11 +890,11 @@ func (m *TracerPayload) UnmarshalVT(dAtA []byte) error { } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF @@ -904,7 +905,7 @@ func (m *TracerPayload) UnmarshalVT(dAtA []byte) error { var stringLenmapvalue uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -918,11 +919,11 @@ func (m *TracerPayload) UnmarshalVT(dAtA []byte) error { } intStringLenmapvalue := int(stringLenmapvalue) if intStringLenmapvalue < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postStringIndexmapvalue := iNdEx + intStringLenmapvalue if postStringIndexmapvalue < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postStringIndexmapvalue > l { return io.ErrUnexpectedEOF @@ -931,12 +932,12 @@ func (m *TracerPayload) UnmarshalVT(dAtA []byte) error { iNdEx = postStringIndexmapvalue } else { iNdEx = entryPreIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF @@ -953,7 +954,7 @@ func (m *TracerPayload) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -967,11 +968,11 @@ func (m *TracerPayload) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -985,7 +986,7 @@ func (m *TracerPayload) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -999,11 +1000,11 @@ func (m *TracerPayload) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1017,7 +1018,7 @@ func (m *TracerPayload) UnmarshalVT(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflow + return protohelpers.ErrIntOverflow } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1031,11 +1032,11 @@ func (m *TracerPayload) UnmarshalVT(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } postIndex := iNdEx + intStringLen if postIndex < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF @@ -1044,12 +1045,12 @@ func (m *TracerPayload) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skip(dAtA[iNdEx:]) + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLength + return protohelpers.ErrInvalidLength } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF diff --git a/pkg/remoteconfig/state/go.mod b/pkg/remoteconfig/state/go.mod index 70621d8c5107a..d9fead6f8ede8 100644 --- a/pkg/remoteconfig/state/go.mod +++ b/pkg/remoteconfig/state/go.mod @@ -14,6 +14,6 @@ require ( github.com/kr/pretty v0.3.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/rogpeppe/go-internal v1.13.1 // indirect - golang.org/x/crypto v0.29.0 // indirect + golang.org/x/crypto v0.31.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/pkg/remoteconfig/state/go.sum b/pkg/remoteconfig/state/go.sum index 3f95fd21b0871..d86844e767b4e 100644 --- a/pkg/remoteconfig/state/go.sum +++ b/pkg/remoteconfig/state/go.sum @@ -21,10 +21,10 @@ github.com/secure-systems-lab/go-securesystemslib v0.8.0 h1:mr5An6X45Kb2nddcFlbm github.com/secure-systems-lab/go-securesystemslib v0.8.0/go.mod h1:UH2VZVuJfCYR8WgMlCU1uFsOUU+KeyrTWcSS73NBOzU= github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -golang.org/x/crypto v0.29.0 h1:L5SG1JTTXupVV3n6sUqMTeWbjAyfPwoda2DLX8J8FrQ= -golang.org/x/crypto v0.29.0/go.mod h1:+F4F4N5hv6v38hfeYwTdx20oUvLLc+QfrE9Ax9HtgRg= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U= +golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= +golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= +golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= diff --git a/pkg/sbom/collectors/host/host.go b/pkg/sbom/collectors/host/host.go index 969dff47ba3a7..6798fb4790f58 100644 --- a/pkg/sbom/collectors/host/host.go +++ b/pkg/sbom/collectors/host/host.go @@ -16,7 +16,6 @@ import ( workloadmeta "github.com/DataDog/datadog-agent/comp/core/workloadmeta/def" "github.com/DataDog/datadog-agent/pkg/sbom" "github.com/DataDog/datadog-agent/pkg/sbom/collectors" - "github.com/DataDog/datadog-agent/pkg/util/flavor" "github.com/DataDog/datadog-agent/pkg/util/log" "github.com/DataDog/datadog-agent/pkg/util/optional" "github.com/DataDog/datadog-agent/pkg/util/trivy" @@ -43,11 +42,7 @@ func (c *Collector) Init(cfg config.Component, wmeta optional.Option[workloadmet return err } c.trivyCollector = trivyCollector - if flavor.GetFlavor() == flavor.SecurityAgent { - c.opts = sbom.ScanOptions{Analyzers: []string{trivy.OSAnalyzers}, Fast: false, CollectFiles: true} - } else { - c.opts = sbom.ScanOptionsFromConfig(cfg, false) - } + c.opts = sbom.ScanOptionsFromConfig(cfg, false) return nil } @@ -59,7 +54,7 @@ func (c *Collector) Scan(ctx context.Context, request sbom.ScanRequest) sbom.Sca } log.Infof("host scan request [%v]", hostScanRequest.ID()) - report, err := c.trivyCollector.ScanFilesystem(ctx, hostScanRequest.FS, hostScanRequest.Path, c.opts) + report, err := c.trivyCollector.ScanFilesystem(ctx, hostScanRequest.Path, c.opts) return sbom.ScanResult{ Error: err, Report: report, 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/sbom/collectors/host/request.go b/pkg/sbom/collectors/host/request.go index c30cb453ceab9..e88e54890131b 100644 --- a/pkg/sbom/collectors/host/request.go +++ b/pkg/sbom/collectors/host/request.go @@ -6,9 +6,7 @@ package host import ( - "io/fs" "os" - "path/filepath" "github.com/DataDog/datadog-agent/pkg/config/env" "github.com/DataDog/datadog-agent/pkg/sbom/types" @@ -18,34 +16,11 @@ import ( // hashable to be pushed in the work queue for processing. type scanRequest struct { Path string - FS fs.FS -} - -type relFS struct { - root string - fs fs.FS -} - -func newFS(root string) fs.FS { - fs := os.DirFS(root) - return &relFS{root: "/", fs: fs} -} - -func (f *relFS) Open(name string) (fs.File, error) { - if filepath.IsAbs(name) { - var err error - name, err = filepath.Rel(f.root, name) - if err != nil { - return nil, err - } - } - - return f.fs.Open(name) } // NewScanRequest creates a new scan request -func NewScanRequest(path string, fs fs.FS) types.ScanRequest { - return scanRequest{Path: path, FS: fs} +func NewScanRequest(path string) types.ScanRequest { + return scanRequest{Path: path} } // NewHostScanRequest creates a new scan request for the root filesystem @@ -54,7 +29,7 @@ func NewHostScanRequest() types.ScanRequest { if hostRoot := os.Getenv("HOST_ROOT"); env.IsContainerized() && hostRoot != "" { scanPath = hostRoot } - return NewScanRequest(scanPath, newFS("/")) + return NewScanRequest(scanPath) } // Collector returns the collector name diff --git a/pkg/sbom/types/types.go b/pkg/sbom/types/types.go index 8b5989cd5ed23..0e18db96da20b 100644 --- a/pkg/sbom/types/types.go +++ b/pkg/sbom/types/types.go @@ -23,7 +23,6 @@ type ScanOptions struct { Timeout time.Duration WaitAfter time.Duration Fast bool - CollectFiles bool UseMount bool OverlayFsScan bool } diff --git a/pkg/security/agent/agent_nix.go b/pkg/security/agent/agent_nix.go index bc444d6f049fe..8083e3259b87e 100644 --- a/pkg/security/agent/agent_nix.go +++ b/pkg/security/agent/agent_nix.go @@ -12,9 +12,10 @@ import ( "go.uber.org/atomic" + "github.com/DataDog/datadog-go/v5/statsd" + workloadmeta "github.com/DataDog/datadog-agent/comp/core/workloadmeta/def" "github.com/DataDog/datadog-agent/pkg/security/security_profile/dump" - "github.com/DataDog/datadog-go/v5/statsd" ) // NewRuntimeSecurityAgent instantiates a new RuntimeSecurityAgent @@ -30,7 +31,7 @@ func NewRuntimeSecurityAgent(statsdClient statsd.ClientInterface, hostname strin } // on windows do no storage manager - storage, err := dump.NewAgentStorageManager() + storage, err := dump.NewAgentStorageManager(statsdClient) if err != nil { return nil, err } diff --git a/pkg/security/agent/client.go b/pkg/security/agent/client.go index 81e2cf630b549..bb0c1714bd039 100644 --- a/pkg/security/agent/client.go +++ b/pkg/security/agent/client.go @@ -35,7 +35,7 @@ type SecurityModuleClientWrapper interface { DumpProcessCache(withArgs bool, format string) (string, error) GenerateActivityDump(request *api.ActivityDumpParams) (*api.ActivityDumpMessage, error) ListActivityDumps() (*api.ActivityDumpListMessage, error) - StopActivityDump(name, containerid string) (*api.ActivityDumpStopMessage, error) + StopActivityDump(name, container, cgroup string) (*api.ActivityDumpStopMessage, error) GenerateEncoding(request *api.TranscodingRequestParams) (*api.TranscodingRequestMessage, error) DumpNetworkNamespace(snapshotInterfaces bool) (*api.DumpNetworkNamespaceMessage, error) GetConfig() (*api.SecurityConfigMessage, error) @@ -81,10 +81,11 @@ func (c *RuntimeSecurityClient) GenerateActivityDump(request *api.ActivityDumpPa } // StopActivityDump stops an active dump if it exists -func (c *RuntimeSecurityClient) StopActivityDump(name, containerid string) (*api.ActivityDumpStopMessage, error) { +func (c *RuntimeSecurityClient) StopActivityDump(name, container, cgroup string) (*api.ActivityDumpStopMessage, error) { return c.apiClient.StopActivityDump(context.Background(), &api.ActivityDumpStopParams{ Name: name, - ContainerID: containerid, + ContainerID: container, + CGroupID: cgroup, }) } diff --git a/pkg/security/agent/mocks/security_module_client_wrapper.go b/pkg/security/agent/mocks/security_module_client_wrapper.go index 227b6c2072121..c31eae478f235 100644 --- a/pkg/security/agent/mocks/security_module_client_wrapper.go +++ b/pkg/security/agent/mocks/security_module_client_wrapper.go @@ -463,9 +463,9 @@ func (_m *SecurityModuleClientWrapper) SaveSecurityProfile(name string, tag stri return r0, r1 } -// StopActivityDump provides a mock function with given fields: name, containerid -func (_m *SecurityModuleClientWrapper) StopActivityDump(name string, containerid string) (*api.ActivityDumpStopMessage, error) { - ret := _m.Called(name, containerid) +// StopActivityDump provides a mock function with given fields: name, container, cgroup +func (_m *SecurityModuleClientWrapper) StopActivityDump(name string, container string, cgroup string) (*api.ActivityDumpStopMessage, error) { + ret := _m.Called(name, container, cgroup) if len(ret) == 0 { panic("no return value specified for StopActivityDump") @@ -473,19 +473,19 @@ func (_m *SecurityModuleClientWrapper) StopActivityDump(name string, containerid var r0 *api.ActivityDumpStopMessage var r1 error - if rf, ok := ret.Get(0).(func(string, string) (*api.ActivityDumpStopMessage, error)); ok { - return rf(name, containerid) + if rf, ok := ret.Get(0).(func(string, string, string) (*api.ActivityDumpStopMessage, error)); ok { + return rf(name, container, cgroup) } - if rf, ok := ret.Get(0).(func(string, string) *api.ActivityDumpStopMessage); ok { - r0 = rf(name, containerid) + if rf, ok := ret.Get(0).(func(string, string, string) *api.ActivityDumpStopMessage); ok { + r0 = rf(name, container, cgroup) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*api.ActivityDumpStopMessage) } } - if rf, ok := ret.Get(1).(func(string, string) error); ok { - r1 = rf(name, containerid) + if rf, ok := ret.Get(1).(func(string, string, string) error); ok { + r1 = rf(name, container, cgroup) } else { r1 = ret.Error(1) } diff --git a/pkg/security/config/config.go b/pkg/security/config/config.go index ab6b0b6b591e1..9d165a4ae1900 100644 --- a/pkg/security/config/config.go +++ b/pkg/security/config/config.go @@ -101,6 +101,9 @@ type RuntimeSecurityConfig struct { // ActivityDumpTracedCgroupsCount defines the maximum count of cgroups that should be monitored concurrently. Leave this parameter to 0 to prevent the generation // of activity dumps based on cgroups. ActivityDumpTracedCgroupsCount int + // ActivityDumpCgroupsManagers defines the cgroup managers we generate dumps for. + ActivityDumpCgroupsManagers []string + // ActivityDumpTracedEventTypes defines the list of events that should be captured in an activity dump. Leave this // parameter empty to monitor all event types. If not already present, the `exec` event will automatically be added // to this list. @@ -368,6 +371,7 @@ func NewRuntimeSecurityConfig() (*RuntimeSecurityConfig, error) { ActivityDumpLoadControlPeriod: pkgconfigsetup.SystemProbe().GetDuration("runtime_security_config.activity_dump.load_controller_period"), ActivityDumpLoadControlMinDumpTimeout: pkgconfigsetup.SystemProbe().GetDuration("runtime_security_config.activity_dump.min_timeout"), ActivityDumpTracedCgroupsCount: pkgconfigsetup.SystemProbe().GetInt("runtime_security_config.activity_dump.traced_cgroups_count"), + ActivityDumpCgroupsManagers: pkgconfigsetup.SystemProbe().GetStringSlice("runtime_security_config.activity_dump.cgroup_managers"), ActivityDumpTracedEventTypes: parseEventTypeStringSlice(pkgconfigsetup.SystemProbe().GetStringSlice("runtime_security_config.activity_dump.traced_event_types")), ActivityDumpCgroupDumpTimeout: pkgconfigsetup.SystemProbe().GetDuration("runtime_security_config.activity_dump.dump_duration"), ActivityDumpRateLimiter: pkgconfigsetup.SystemProbe().GetInt("runtime_security_config.activity_dump.rate_limiter"), diff --git a/pkg/security/ebpf/c/include/constants/custom.h b/pkg/security/ebpf/c/include/constants/custom.h index 88be17fa3c80b..1e2311bf8fc7e 100644 --- a/pkg/security/ebpf/c/include/constants/custom.h +++ b/pkg/security/ebpf/c/include/constants/custom.h @@ -196,4 +196,8 @@ static __attribute__((always_inline)) u64 get_imds_ip() { #define CGROUP_MANAGER_CRI 4 #define CGROUP_MANAGER_SYSTEMD 5 +#define CGROUP_MANAGER_MASK 0b111 +#define CGROUP_SYSTEMD_SERVICE (0 << 8) +#define CGROUP_SYSTEMD_SCOPE (1 << 8) + #endif diff --git a/pkg/security/ebpf/c/include/constants/offsets/filesystem.h b/pkg/security/ebpf/c/include/constants/offsets/filesystem.h index 496927e2fd8eb..797070a8534e7 100644 --- a/pkg/security/ebpf/c/include/constants/offsets/filesystem.h +++ b/pkg/security/ebpf/c/include/constants/offsets/filesystem.h @@ -9,8 +9,11 @@ struct mount; unsigned long __attribute__((always_inline)) get_inode_ino(struct inode *inode) { + u64 inode_ino_offset; + LOAD_CONSTANT("inode_ino_offset", inode_ino_offset); + unsigned long ino; - bpf_probe_read(&ino, sizeof(inode), &inode->i_ino); + bpf_probe_read(&ino, sizeof(inode), (void *)inode + inode_ino_offset); return ino; } @@ -23,9 +26,12 @@ dev_t __attribute__((always_inline)) get_inode_dev(struct inode *inode) { } dev_t __attribute__((always_inline)) get_dentry_dev(struct dentry *dentry) { + u64 offset; + LOAD_CONSTANT("dentry_d_sb_offset", offset); + dev_t dev; struct super_block *sb; - bpf_probe_read(&sb, sizeof(sb), &dentry->d_sb); + bpf_probe_read(&sb, sizeof(sb), (char *)dentry + offset); bpf_probe_read(&dev, sizeof(dev), &sb->s_dev); return dev; } diff --git a/pkg/security/ebpf/c/include/helpers/activity_dump.h b/pkg/security/ebpf/c/include/helpers/activity_dump.h index 82ed6834e10fb..7505c923b7748 100644 --- a/pkg/security/ebpf/c/include/helpers/activity_dump.h +++ b/pkg/security/ebpf/c/include/helpers/activity_dump.h @@ -10,6 +10,7 @@ #include "container.h" #include "events.h" #include "process.h" +#include "rate_limiter.h" __attribute__((always_inline)) struct activity_dump_config *lookup_or_delete_traced_pid(u32 pid, u64 now, u64 *cookie) { if (cookie == NULL) { @@ -53,10 +54,16 @@ __attribute__((always_inline)) struct cgroup_tracing_event_t *get_cgroup_tracing return evt; } -__attribute__((always_inline)) bool reserve_traced_cgroup_spot(container_id_t cgroup, u64 now, u64 cookie, struct activity_dump_config *config) { +__attribute__((always_inline)) u32 is_cgroup_activity_dumps_supported(struct cgroup_context_t *cgroup) { + u32 cgroup_manager = cgroup->cgroup_flags & CGROUP_MANAGER_MASK; + u32 supported = (cgroup->cgroup_flags != 0) && (bpf_map_lookup_elem(&activity_dump_config_defaults, &cgroup_manager) != NULL); + return supported; +} + +__attribute__((always_inline)) bool reserve_traced_cgroup_spot(struct cgroup_context_t *cgroup, u64 now, u64 cookie, struct activity_dump_config *config) { // insert dump config defaults - u32 defaults_key = 0; - struct activity_dump_config *defaults = bpf_map_lookup_elem(&activity_dump_config_defaults, &defaults_key); + u32 cgroup_flags = cgroup->cgroup_flags; + struct activity_dump_config *defaults = bpf_map_lookup_elem(&activity_dump_config_defaults, &cgroup_flags); if (defaults == NULL) { // should never happen, ignore return false; @@ -72,7 +79,9 @@ __attribute__((always_inline)) bool reserve_traced_cgroup_spot(container_id_t cg return false; } - ret = bpf_map_update_elem(&traced_cgroups, &cgroup[0], &cookie, BPF_NOEXIST); + struct path_key_t path_key; + path_key = cgroup->cgroup_file; + ret = bpf_map_update_elem(&traced_cgroups, &path_key, &cookie, BPF_NOEXIST); if (ret < 0) { // we didn't get a lock, skip this cgroup for now and go back to it later bpf_map_delete_elem(&activity_dumps_config, &cookie); @@ -80,15 +89,15 @@ __attribute__((always_inline)) bool reserve_traced_cgroup_spot(container_id_t cg } // we're tracing a new cgroup, update its wait list timeout - bpf_map_update_elem(&cgroup_wait_list, &cgroup[0], &config->wait_list_timestamp, BPF_ANY); + bpf_map_update_elem(&cgroup_wait_list, &path_key, &config->wait_list_timestamp, BPF_ANY); return true; } -__attribute__((always_inline)) u64 trace_new_cgroup(void *ctx, u64 now, container_id_t container_id, struct cgroup_context_t *cgroup) { +__attribute__((always_inline)) u64 trace_new_cgroup(void *ctx, u64 now, struct container_context_t *container) { u64 cookie = rand64(); struct activity_dump_config config = {}; - if (!reserve_traced_cgroup_spot(container_id, now, cookie, &config)) { + if (!reserve_traced_cgroup_spot(&container->cgroup_context, now, cookie, &config)) { // we're already tracing too many cgroups concurrently, ignore this one for now return 0; } @@ -100,35 +109,38 @@ __attribute__((always_inline)) u64 trace_new_cgroup(void *ctx, u64 now, containe return 0; } - if ((cgroup->cgroup_flags & 0b111) == CGROUP_MANAGER_SYSTEMD) { + if (!is_cgroup_activity_dumps_supported(&container->cgroup_context)) { return 0; } - copy_container_id(container_id, evt->container.container_id); - evt->container.cgroup_context = *cgroup; + if ((container->cgroup_context.cgroup_flags&CGROUP_MANAGER_MASK) != CGROUP_MANAGER_SYSTEMD) { + copy_container_id(container->container_id, evt->container.container_id); + } else { + evt->container.container_id[0] = '\0'; + } + evt->container.cgroup_context = container->cgroup_context; evt->cookie = cookie; evt->config = config; send_event_ptr(ctx, EVENT_CGROUP_TRACING, evt); - // return cookie return cookie; } __attribute__((always_inline)) u64 should_trace_new_process_cgroup(void *ctx, u64 now, u32 pid, struct container_context_t *container) { // should we start tracing this cgroup ? - container_id_t container_id; - bpf_probe_read(&container_id, sizeof(container_id), &container->container_id[0]); + struct cgroup_context_t cgroup_context; + bpf_probe_read(&cgroup_context, sizeof(cgroup_context), &container->cgroup_context); - if (is_cgroup_activity_dumps_enabled() && container_id[0] != 0) { + if (is_cgroup_activity_dumps_enabled() && is_cgroup_activity_dumps_supported(&cgroup_context)) { // is this cgroup traced ? - u64 *cookie = bpf_map_lookup_elem(&traced_cgroups, &container_id[0]); + u64 *cookie = bpf_map_lookup_elem(&traced_cgroups, &cgroup_context.cgroup_file); if (cookie) { u64 cookie_val = *cookie; struct activity_dump_config *config = bpf_map_lookup_elem(&activity_dumps_config, &cookie_val); if (config == NULL) { // delete expired cgroup entry - bpf_map_delete_elem(&traced_cgroups, &container_id[0]); + bpf_map_delete_elem(&traced_cgroups, &cgroup_context.cgroup_file); return 0; } @@ -144,7 +156,7 @@ __attribute__((always_inline)) u64 should_trace_new_process_cgroup(void *ctx, u6 if (now > config->end_timestamp) { // delete expired cgroup entry - bpf_map_delete_elem(&traced_cgroups, &container_id[0]); + bpf_map_delete_elem(&traced_cgroups, &cgroup_context.cgroup_file); // delete config bpf_map_delete_elem(&activity_dumps_config, &cookie_val); return 0; @@ -156,11 +168,11 @@ __attribute__((always_inline)) u64 should_trace_new_process_cgroup(void *ctx, u6 } else { // have we seen this cgroup before ? - u64 *wait_timeout = bpf_map_lookup_elem(&cgroup_wait_list, &container_id[0]); + u64 *wait_timeout = bpf_map_lookup_elem(&cgroup_wait_list, &cgroup_context.cgroup_file); if (wait_timeout) { if (now > *wait_timeout) { // delete expired wait_list entry - bpf_map_delete_elem(&cgroup_wait_list, &container_id[0]); + bpf_map_delete_elem(&cgroup_wait_list, &cgroup_context.cgroup_file); } // this cgroup is on the wait list, do not start tracing it @@ -168,7 +180,7 @@ __attribute__((always_inline)) u64 should_trace_new_process_cgroup(void *ctx, u6 } // can we start tracing this cgroup ? - u64 cookie_val = trace_new_cgroup(ctx, now, container_id, &container->cgroup_context); + u64 cookie_val = trace_new_cgroup(ctx, now, container); if (cookie_val == 0) { return 0; } @@ -233,127 +245,6 @@ __attribute__((always_inline)) void cleanup_traced_state(u32 pid) { bpf_map_delete_elem(&traced_pids, &pid); } -enum rate_limiter_algo_ids -{ - RL_ALGO_BASIC = 0, - RL_ALGO_BASIC_HALF, - RL_ALGO_DECREASING_DROPRATE, - RL_ALGO_INCREASING_DROPRATE, - RL_ALGO_TOTAL_NUMBER, -}; - -__attribute__((always_inline)) u8 activity_dump_rate_limiter_reset_period(u64 now, struct activity_dump_rate_limiter_ctx *rate_ctx_p) { - rate_ctx_p->current_period = now; - rate_ctx_p->counter = 0; -#ifndef __BALOUM__ // do not change algo during unit tests - rate_ctx_p->algo_id = now % RL_ALGO_TOTAL_NUMBER; -#endif /* __BALOUM__ */ - return 1; -} - -__attribute__((always_inline)) u8 activity_dump_rate_limiter_allow_basic(struct activity_dump_config *config, u64 now, struct activity_dump_rate_limiter_ctx *rate_ctx_p, u64 delta) { - if (delta > 1000000000) { // if more than 1 sec ellapsed we reset the period - return activity_dump_rate_limiter_reset_period(now, rate_ctx_p); - } - - if (rate_ctx_p->counter >= config->events_rate) { // if we already allowed more than rate - return 0; - } else { - return 1; - } -} - -__attribute__((always_inline)) u8 activity_dump_rate_limiter_allow_basic_half(struct activity_dump_config *config, u64 now, struct activity_dump_rate_limiter_ctx *rate_ctx_p, u64 delta) { - if (delta > 1000000000 / 2) { // if more than 0.5 sec ellapsed we reset the period - return activity_dump_rate_limiter_reset_period(now, rate_ctx_p); - } - - if (rate_ctx_p->counter >= config->events_rate / 2) { // if we already allowed more than rate / 2 - return 0; - } else { - return 1; - } -} - -__attribute__((always_inline)) u8 activity_dump_rate_limiter_allow_decreasing_droprate(struct activity_dump_config *config, u64 now, struct activity_dump_rate_limiter_ctx *rate_ctx_p, u64 delta) { - if (delta > 1000000000) { // if more than 1 sec ellapsed we reset the period - return activity_dump_rate_limiter_reset_period(now, rate_ctx_p); - } - - if (rate_ctx_p->counter >= config->events_rate) { // if we already allowed more than rate - return 0; - } else if (rate_ctx_p->counter < (config->events_rate / 4)) { // first 1/4 is not rate limited - return 1; - } - - // if we are between rate / 4 and rate, apply a decreasing rate of: - // (counter * 100) / (rate) % - else if (now % ((rate_ctx_p->counter * 100) / config->events_rate) == 0) { - return 1; - } - return 0; -} - -__attribute__((always_inline)) u8 activity_dump_rate_limiter_allow_increasing_droprate(struct activity_dump_config *config, u64 now, struct activity_dump_rate_limiter_ctx *rate_ctx_p, u64 delta) { - if (delta > 1000000000) { // if more than 1 sec ellapsed we reset the period - return activity_dump_rate_limiter_reset_period(now, rate_ctx_p); - } - - if (rate_ctx_p->counter >= config->events_rate) { // if we already allowed more than rate - return 0; - } else if (rate_ctx_p->counter < (config->events_rate / 4)) { // first 1/4 is not rate limited - return 1; - } - - // if we are between rate / 4 and rate, apply an increasing rate of: - // 100 - ((counter * 100) / (rate)) % - else if (now % (100 - ((rate_ctx_p->counter * 100) / config->events_rate)) == 0) { - return 1; - } - return 0; -} - -__attribute__((always_inline)) u8 activity_dump_rate_limiter_allow(struct activity_dump_config *config, u64 cookie, u64 now, u8 should_count) { - struct activity_dump_rate_limiter_ctx *rate_ctx_p = bpf_map_lookup_elem(&activity_dump_rate_limiters, &cookie); - if (rate_ctx_p == NULL) { - struct activity_dump_rate_limiter_ctx rate_ctx = { - .current_period = now, - .counter = should_count, - .algo_id = now % RL_ALGO_TOTAL_NUMBER, - }; - bpf_map_update_elem(&activity_dump_rate_limiters, &cookie, &rate_ctx, BPF_ANY); - return 1; - } - - if (now < rate_ctx_p->current_period) { // this should never happen, ignore - return 0; - } - u64 delta = now - rate_ctx_p->current_period; - - u8 allow; - switch (rate_ctx_p->algo_id) { - case RL_ALGO_BASIC: - allow = activity_dump_rate_limiter_allow_basic(config, now, rate_ctx_p, delta); - break; - case RL_ALGO_BASIC_HALF: - allow = activity_dump_rate_limiter_allow_basic_half(config, now, rate_ctx_p, delta); - break; - case RL_ALGO_DECREASING_DROPRATE: - allow = activity_dump_rate_limiter_allow_decreasing_droprate(config, now, rate_ctx_p, delta); - break; - case RL_ALGO_INCREASING_DROPRATE: - allow = activity_dump_rate_limiter_allow_increasing_droprate(config, now, rate_ctx_p, delta); - break; - default: // should never happen, ignore - return 0; - } - - if (allow && should_count) { - __sync_fetch_and_add(&rate_ctx_p->counter, 1); - } - return (allow); -} - __attribute__((always_inline)) u32 is_activity_dump_running(void *ctx, u32 pid, u64 now, u32 event_type) { u64 cookie = 0; struct activity_dump_config *config = NULL; @@ -388,7 +279,7 @@ __attribute__((always_inline)) u32 is_activity_dump_running(void *ctx, u32 pid, return 0; } - if (!activity_dump_rate_limiter_allow(config, cookie, now, 1)) { + if (!activity_dump_rate_limiter_allow(config->events_rate, cookie, now, 1)) { return 0; } diff --git a/pkg/security/ebpf/c/include/helpers/approvers.h b/pkg/security/ebpf/c/include/helpers/approvers.h index d3b68a4d9282f..d7c4f5fd0df95 100644 --- a/pkg/security/ebpf/c/include/helpers/approvers.h +++ b/pkg/security/ebpf/c/include/helpers/approvers.h @@ -3,6 +3,7 @@ #include "constants/enums.h" #include "maps.h" +#include "rate_limiter.h" void __attribute__((always_inline)) monitor_event_approved(u64 event_type, u32 approver_type) { struct bpf_map_def *approver_stats = select_buffer(&fb_approver_stats, &bb_approver_stats, APPROVER_MONITOR_KEY); @@ -355,7 +356,7 @@ enum SYSCALL_STATE __attribute__((always_inline)) approve_syscall(struct syscall struct activity_dump_config *config = lookup_or_delete_traced_pid(tgid, now, cookie); if (config != NULL) { // is this event type traced ? - if (mask_has_event(config->event_mask, syscall->type) && activity_dump_rate_limiter_allow(config, *cookie, now, 0)) { + if (mask_has_event(config->event_mask, syscall->type) && activity_dump_rate_limiter_allow(config->events_rate, *cookie, now, 0)) { if (syscall->state == DISCARDED) { syscall->resolver.flags |= SAVED_BY_ACTIVITY_DUMP; } diff --git a/pkg/security/ebpf/c/include/helpers/filesystem.h b/pkg/security/ebpf/c/include/helpers/filesystem.h index 07ca0431d7382..94210013c123e 100644 --- a/pkg/security/ebpf/c/include/helpers/filesystem.h +++ b/pkg/security/ebpf/c/include/helpers/filesystem.h @@ -102,10 +102,15 @@ void __attribute__((always_inline)) fill_file(struct dentry *dentry, struct file file->dev = get_dentry_dev(dentry); - bpf_probe_read(&file->metadata.nlink, sizeof(file->metadata.nlink), (void *)&d_inode->i_nlink); + u64 inode_nlink_offset; + LOAD_CONSTANT("inode_nlink_offset", inode_nlink_offset); + u64 inode_gid_offset; + LOAD_CONSTANT("inode_gid_offset", inode_gid_offset); + + bpf_probe_read(&file->metadata.nlink, sizeof(file->metadata.nlink), (void *)d_inode + inode_nlink_offset); bpf_probe_read(&file->metadata.mode, sizeof(file->metadata.mode), &d_inode->i_mode); bpf_probe_read(&file->metadata.uid, sizeof(file->metadata.uid), &d_inode->i_uid); - bpf_probe_read(&file->metadata.gid, sizeof(file->metadata.gid), &d_inode->i_gid); + bpf_probe_read(&file->metadata.gid, sizeof(file->metadata.gid), (void *)d_inode + inode_gid_offset); u64 inode_ctime_sec_offset; LOAD_CONSTANT("inode_ctime_sec_offset", inode_ctime_sec_offset); @@ -118,10 +123,10 @@ void __attribute__((always_inline)) fill_file(struct dentry *dentry, struct file bpf_probe_read(&nsec, sizeof(nsec), (void *)d_inode + inode_ctime_nsec_offset); file->metadata.ctime.tv_nsec = nsec; } else { -#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 6, 0) - bpf_probe_read(&file->metadata.ctime, sizeof(file->metadata.ctime), &d_inode->i_ctime); -#elif LINUX_VERSION_CODE < KERNEL_VERSION(6, 11, 0) - bpf_probe_read(&file->metadata.ctime, sizeof(file->metadata.ctime), &d_inode->__i_ctime); +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 11, 0) + u64 inode_ctime_offset; + LOAD_CONSTANT("inode_ctime_offset", inode_ctime_offset); + bpf_probe_read(&file->metadata.ctime, sizeof(file->metadata.ctime), (void *)d_inode + inode_ctime_offset); #else bpf_probe_read(&file->metadata.ctime.tv_sec, sizeof(file->metadata.ctime.tv_sec), &d_inode->i_ctime_sec); bpf_probe_read(&file->metadata.ctime.tv_nsec, sizeof(file->metadata.ctime.tv_nsec), &d_inode->i_ctime_nsec); @@ -139,10 +144,10 @@ void __attribute__((always_inline)) fill_file(struct dentry *dentry, struct file bpf_probe_read(&nsec, sizeof(nsec), (void *)d_inode + inode_mtime_nsec_offset); file->metadata.mtime.tv_nsec = nsec; } else { -#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 7, 0) - bpf_probe_read(&file->metadata.mtime, sizeof(file->metadata.mtime), &d_inode->i_mtime); -#elif LINUX_VERSION_CODE < KERNEL_VERSION(6, 11, 0) - bpf_probe_read(&file->metadata.mtime, sizeof(file->metadata.mtime), &d_inode->__i_mtime); +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 11, 0) + u64 inode_mtime_offset; + LOAD_CONSTANT("inode_mtime_offset", inode_mtime_offset); + bpf_probe_read(&file->metadata.mtime, sizeof(file->metadata.mtime), (void *)d_inode + inode_mtime_offset); #else bpf_probe_read(&file->metadata.mtime.tv_sec, sizeof(file->metadata.mtime.tv_sec), &d_inode->i_mtime_sec); bpf_probe_read(&file->metadata.mtime.tv_nsec, sizeof(file->metadata.mtime.tv_nsec), &d_inode->i_mtime_nsec); diff --git a/pkg/security/ebpf/c/include/helpers/rate_limiter.h b/pkg/security/ebpf/c/include/helpers/rate_limiter.h new file mode 100644 index 0000000000000..a72cb2d37c102 --- /dev/null +++ b/pkg/security/ebpf/c/include/helpers/rate_limiter.h @@ -0,0 +1,83 @@ +#ifndef _RATE_LIMITER_H_ +#define _RATE_LIMITER_H_ + +#include "maps.h" +#include "constants/macros.h" +#include "structs/rate_limiter.h" + +__attribute__((always_inline)) u8 rate_limiter_reset_period(u64 now, struct rate_limiter_ctx *rate_ctx_p) { + rate_ctx_p->current_period = now; + rate_ctx_p->counter = 0; + return 1; +} + +__attribute__((always_inline)) u8 rate_limiter_allow_basic(u32 rate, u64 now, struct rate_limiter_ctx *rate_ctx_p, u64 delta) { + if (delta > SEC_TO_NS(1)) { // if more than 1 sec ellapsed we reset the period + return rate_limiter_reset_period(now, rate_ctx_p); + } + + if (rate_ctx_p->counter >= rate) { // if we already allowed more than rate + return 0; + } else { + return 1; + } +} + +__attribute__((always_inline)) u8 rate_limiter_allow_gen(struct rate_limiter_ctx *rate_ctx_p, u32 rate, u64 now, u8 should_count) { + if (now < rate_ctx_p->current_period) { // this should never happen, ignore + return 0; + } + u64 delta = now - rate_ctx_p->current_period; + u8 allow = rate_limiter_allow_basic(rate, now, rate_ctx_p, delta); + if (allow && should_count) { + __sync_fetch_and_add(&rate_ctx_p->counter, 1); + } + return (allow); +} + +// For now the generic rate is staticaly defined +// TODO: put it configurable +#define GENERIC_RATE_LIMITER_RATE 100 + +__attribute__((always_inline)) u8 rate_limiter_allow(u32 pid, u64 now, u8 should_count) { + if (now == 0) { + now = bpf_ktime_get_ns(); + } + if (pid == 0) { + pid = bpf_get_current_pid_tgid() >> 32; + } + + struct rate_limiter_ctx *rate_ctx_p = bpf_map_lookup_elem(&rate_limiters, &pid); + if (rate_ctx_p == NULL) { + struct rate_limiter_ctx rate_ctx = { + .current_period = now, + .counter = should_count, + }; + bpf_map_update_elem(&rate_limiters, &pid, &rate_ctx, BPF_ANY); + return 1; + } + + u32 rate = GENERIC_RATE_LIMITER_RATE; + return rate_limiter_allow_gen(rate_ctx_p, rate, now, should_count); +} +#define rate_limiter_allow_simple() rate_limiter_allow(0, 0, 1) + +__attribute__((always_inline)) u8 activity_dump_rate_limiter_allow(u32 rate, u64 cookie, u64 now, u8 should_count) { + if (now == 0) { + now = bpf_ktime_get_ns(); + } + + struct rate_limiter_ctx *rate_ctx_p = bpf_map_lookup_elem(&activity_dump_rate_limiters, &cookie); + if (rate_ctx_p == NULL) { + struct rate_limiter_ctx rate_ctx = { + .current_period = now, + .counter = should_count, + }; + bpf_map_update_elem(&activity_dump_rate_limiters, &cookie, &rate_ctx, BPF_ANY); + return 1; + } + + return rate_limiter_allow_gen(rate_ctx_p, rate, now, should_count); +} + +#endif /* _RATE_LIMITER_H_ */ diff --git a/pkg/security/ebpf/c/include/hooks/cgroup.h b/pkg/security/ebpf/c/include/hooks/cgroup.h index a231142b8f90a..b7ce66a870b92 100644 --- a/pkg/security/ebpf/c/include/hooks/cgroup.h +++ b/pkg/security/ebpf/c/include/hooks/cgroup.h @@ -189,13 +189,13 @@ static __attribute__((always_inline)) int trace__cgroup_write(ctx_t *ctx) { #endif int length = bpf_probe_read_str(prefix, sizeof(cgroup_prefix_t), container_id) & 0xff; - if (cgroup_flags == 0 && ( - (length >= 9 && (*prefix)[length-9] == '.' && (*prefix)[length-8] == 's' && (*prefix)[length-7] == 'e' && (*prefix)[length-6] == 'r' && (*prefix)[length-5] == 'v' && (*prefix)[length-4] == 'i' && (*prefix)[length-3] == 'c' && (*prefix)[length-2] == 'e') - || - (length >= 7 && (*prefix)[length-7] == '.' && (*prefix)[length-6] == 's' && (*prefix)[length-5] == 'c' && (*prefix)[length-4] == 'o' && (*prefix)[length-3] == 'p' && (*prefix)[length-2] == 'e') - )) { - cgroup_flags = CGROUP_MANAGER_SYSTEMD; - } else if (cgroup_flags != 0) { + if (cgroup_flags == 0) { + if (length >= 9 && (*prefix)[length-9] == '.' && (*prefix)[length-8] == 's' && (*prefix)[length-7] == 'e' && (*prefix)[length-6] == 'r' && (*prefix)[length-5] == 'v' && (*prefix)[length-4] == 'i' && (*prefix)[length-3] == 'c' && (*prefix)[length-2] == 'e') { + cgroup_flags = CGROUP_MANAGER_SYSTEMD | CGROUP_SYSTEMD_SERVICE; + } else if (length >= 7 && (*prefix)[length-7] == '.' && (*prefix)[length-6] == 's' && (*prefix)[length-5] == 'c' && (*prefix)[length-4] == 'o' && (*prefix)[length-3] == 'p' && (*prefix)[length-2] == 'e') { + cgroup_flags = CGROUP_MANAGER_SYSTEMD | CGROUP_SYSTEMD_SCOPE; + } + } else { bpf_probe_read(&new_entry.container.container_id, sizeof(new_entry.container.container_id), container_id); } diff --git a/pkg/security/ebpf/c/include/hooks/ptrace.h b/pkg/security/ebpf/c/include/hooks/ptrace.h index 187d424665b4b..e2c2e2bbf9e91 100644 --- a/pkg/security/ebpf/c/include/hooks/ptrace.h +++ b/pkg/security/ebpf/c/include/hooks/ptrace.h @@ -5,7 +5,29 @@ #include "helpers/discarders.h" #include "helpers/syscalls.h" +// list of requests we don't want to rate limit +const int important_reqs[] = { + PTRACE_ATTACH, + PTRACE_DETACH, + PTRACE_TRACEME, + PTRACE_SEIZE, + PTRACE_KILL, + PTRACE_SETOPTIONS, +}; + HOOK_SYSCALL_ENTRY3(ptrace, u32, request, pid_t, pid, void *, addr) { + u8 found = 0; + for (int i = 0; i < sizeof(important_reqs) / sizeof(int); i++) { + if (request == important_reqs[i]) { + found = 1; + break; + } + } + if (!found && !rate_limiter_allow_simple()) { + // for other requests types than a define list, rate limit the events + return 0; + } + struct syscall_cache_t syscall = { .type = EVENT_PTRACE, .ptrace = { diff --git a/pkg/security/ebpf/c/include/hooks/signal.h b/pkg/security/ebpf/c/include/hooks/signal.h index 92dbd145d7992..325cf249c249c 100644 --- a/pkg/security/ebpf/c/include/hooks/signal.h +++ b/pkg/security/ebpf/c/include/hooks/signal.h @@ -10,18 +10,25 @@ HOOK_SYSCALL_ENTRY2(kill, int, pid, int, type) { return 0; } - /* TODO: implement the event for pid equal to 0 or -1. */ - if (pid < 1) { - return 0; - } - struct syscall_cache_t syscall = { .type = EVENT_SIGNAL, .signal = { - .pid = 0, // 0 in case the root ns pid resolution failed .type = type, }, }; + + if (pid < 1) { + /* + in case kill is called with pid 0 or -1 and targets multiple processes, it + may not go through the kill_permission callpath; but still is valuable to track + */ + syscall.signal.need_target_resolution = 0; + syscall.signal.pid = pid; + } else { + syscall.signal.need_target_resolution = 1; + syscall.signal.pid = 0; // it will be resolved later on by check_kill_permission + } + cache_syscall(&syscall); return 0; } @@ -29,7 +36,7 @@ HOOK_SYSCALL_ENTRY2(kill, int, pid, int, type) { HOOK_ENTRY("check_kill_permission") int hook_check_kill_permission(ctx_t *ctx) { struct syscall_cache_t *syscall = peek_syscall(EVENT_SIGNAL); - if (!syscall) { + if (!syscall || syscall->signal.need_target_resolution == 0) { return 0; } diff --git a/pkg/security/ebpf/c/include/maps.h b/pkg/security/ebpf/c/include/maps.h index 2019c630c6f4c..56f38dd7688d1 100644 --- a/pkg/security/ebpf/c/include/maps.h +++ b/pkg/security/ebpf/c/include/maps.h @@ -28,9 +28,9 @@ BPF_ARRAY_MAP(syscall_ctx_gen_id, u32, 1) BPF_ARRAY_MAP(syscall_ctx, char[MAX_SYSCALL_CTX_SIZE], MAX_SYSCALL_CTX_ENTRIES) BPF_HASH_MAP(activity_dumps_config, u64, struct activity_dump_config, 1) // max entries will be overridden at runtime -BPF_HASH_MAP(activity_dump_config_defaults, u32, struct activity_dump_config, 1) -BPF_HASH_MAP(traced_cgroups, container_id_t, u64, 1) // max entries will be overridden at runtime -BPF_HASH_MAP(cgroup_wait_list, container_id_t, u64, 1) // max entries will be overridden at runtime +BPF_HASH_MAP(activity_dump_config_defaults, u32, struct activity_dump_config, 5) +BPF_HASH_MAP(traced_cgroups, struct path_key_t, u64, 1) // max entries will be overridden at runtime +BPF_HASH_MAP(cgroup_wait_list, struct path_key_t, u64, 1) // max entries will be overridden at runtime BPF_HASH_MAP(traced_pids, u32, u64, 8192) // max entries will be overridden at runtime BPF_HASH_MAP(basename_approvers, struct basename_t, struct event_mask_filter_t, 255) BPF_HASH_MAP(register_netdevice_cache, u64, struct register_netdevice_cache_t, 1024) @@ -41,7 +41,8 @@ BPF_HASH_MAP(secprofs_syscalls, u64, struct security_profile_syscalls_t, 1) // m BPF_HASH_MAP(auid_approvers, u32, struct event_mask_filter_t, 128) BPF_HASH_MAP(auid_range_approvers, u32, struct u32_range_filter_t, EVENT_MAX) -BPF_LRU_MAP(activity_dump_rate_limiters, u64, struct activity_dump_rate_limiter_ctx, 1) // max entries will be overridden at runtime +BPF_LRU_MAP(activity_dump_rate_limiters, u64, struct rate_limiter_ctx, 1) // max entries will be overridden at runtime +BPF_LRU_MAP(rate_limiters, u32, struct rate_limiter_ctx, 1) // max entries will be overridden at runtime BPF_LRU_MAP(mount_ref, u32, struct mount_ref_t, 64000) BPF_LRU_MAP(bpf_maps, u32, struct bpf_map_t, 4096) BPF_LRU_MAP(bpf_progs, u32, struct bpf_prog_t, 4096) diff --git a/pkg/security/ebpf/c/include/structs/activity_dump.h b/pkg/security/ebpf/c/include/structs/activity_dump.h index 6fa4d3149d60e..bde48d185111e 100644 --- a/pkg/security/ebpf/c/include/structs/activity_dump.h +++ b/pkg/security/ebpf/c/include/structs/activity_dump.h @@ -1,13 +1,6 @@ #ifndef _STRUCTS_ACTIVITY_DUMP_H_ #define _STRUCTS_ACTIVITY_DUMP_H_ -struct activity_dump_rate_limiter_ctx { - u64 current_period; - u32 counter; - u8 algo_id; - u8 padding[3]; -}; - struct activity_dump_config { u64 event_mask; u64 timeout; diff --git a/pkg/security/ebpf/c/include/structs/rate_limiter.h b/pkg/security/ebpf/c/include/structs/rate_limiter.h new file mode 100644 index 0000000000000..9b22f346084bc --- /dev/null +++ b/pkg/security/ebpf/c/include/structs/rate_limiter.h @@ -0,0 +1,11 @@ +#ifndef _STRUCTS_RATE_LIMITER_H_ +#define _STRUCTS_RATE_LIMITER_H_ + +struct rate_limiter_ctx { + u64 current_period; + u32 counter; + u32 padding; +}; + + +#endif /* _STRUCTS_RATE_LIMITER_H_ */ diff --git a/pkg/security/ebpf/c/include/structs/syscalls.h b/pkg/security/ebpf/c/include/structs/syscalls.h index 9515fa07df56b..47aad2b07bb9d 100644 --- a/pkg/security/ebpf/c/include/structs/syscalls.h +++ b/pkg/security/ebpf/c/include/structs/syscalls.h @@ -191,6 +191,7 @@ struct syscall_cache_t { struct { u32 pid; u32 type; + u32 need_target_resolution; } signal; struct { diff --git a/pkg/security/ebpf/c/include/tests/activity_dump_ratelimiter_test.h b/pkg/security/ebpf/c/include/tests/activity_dump_ratelimiter_test.h index 6d6ab486f8011..a9ffc8ebbb17e 100644 --- a/pkg/security/ebpf/c/include/tests/activity_dump_ratelimiter_test.h +++ b/pkg/security/ebpf/c/include/tests/activity_dump_ratelimiter_test.h @@ -8,115 +8,36 @@ #define AD_RL_TEST_RATE 500 #define NUMBER_OF_PERIOD_PER_TEST 10 -SEC("test/ad_ratelimiter_basic") -int test_ad_ratelimiter_basic() { +SEC("test/ad_ratelimiter") +int test_ad_ratelimiter() { u64 now = bpf_ktime_get_ns(); - struct activity_dump_config config; - config.events_rate = AD_RL_TEST_RATE; + u32 rate = AD_RL_TEST_RATE; - struct activity_dump_rate_limiter_ctx ctx; + struct rate_limiter_ctx ctx; ctx.counter = 0; ctx.current_period = now; - ctx.algo_id = RL_ALGO_BASIC; // force algo basic u64 cookie = 0; bpf_map_update_elem(&activity_dump_rate_limiters, &cookie, &ctx, BPF_ANY); for (int period_cpt = 0; period_cpt < NUMBER_OF_PERIOD_PER_TEST; period_cpt++, now += SEC_TO_NS(2)) { - assert_not_zero(activity_dump_rate_limiter_allow(&config, cookie, now, 0), + assert_not_zero(activity_dump_rate_limiter_allow(rate, cookie, now, 0), "event not allowed which should be"); for (int i = 0; i < AD_RL_TEST_RATE; i++) { - assert_not_zero(activity_dump_rate_limiter_allow(&config, cookie, now + i, 1), + assert_not_zero(activity_dump_rate_limiter_allow(rate, cookie, now + i, 1), "event not allowed which should be"); } - assert_zero(activity_dump_rate_limiter_allow(&config, cookie, now, 0), + assert_zero(activity_dump_rate_limiter_allow(rate, cookie, now, 0), "event allowed which should not be"); for (int i = 0; i < AD_RL_TEST_RATE; i++) { - assert_zero(activity_dump_rate_limiter_allow(&config, cookie, now + i, 1), + assert_zero(activity_dump_rate_limiter_allow(rate, cookie, now + i, 1), "event allowed which should not be"); } - assert_zero(activity_dump_rate_limiter_allow(&config, cookie, now, 0), + assert_zero(activity_dump_rate_limiter_allow(rate, cookie, now, 0), "event allowed which should not be"); } return 1; } -SEC("test/ad_ratelimiter_basic_half") -int test_ad_ratelimiter_basic_half() { - u64 now = bpf_ktime_get_ns(); - - struct activity_dump_config config; - config.events_rate = AD_RL_TEST_RATE; - - struct activity_dump_rate_limiter_ctx ctx; - ctx.counter = 0; - ctx.current_period = now; - ctx.algo_id = RL_ALGO_BASIC_HALF; // force algo basic half - u64 cookie = 0; - bpf_map_update_elem(&activity_dump_rate_limiters, &cookie, &ctx, BPF_ANY); - - for (int period_cpt = 0; period_cpt < NUMBER_OF_PERIOD_PER_TEST; period_cpt++, now += SEC_TO_NS(1)) { - assert_not_zero(activity_dump_rate_limiter_allow(&config, cookie, now, 0), - "event not allowed which should be"); - for (int i = 0; i < AD_RL_TEST_RATE / 2; i++) { - assert_not_zero(activity_dump_rate_limiter_allow(&config, cookie, now + i, 1), - "event not allowed which should be"); - } - - assert_zero(activity_dump_rate_limiter_allow(&config, cookie, now, 0), - "event allowed which should not be"); - for (int i = 0; i < AD_RL_TEST_RATE / 2; i++) { - assert_zero(activity_dump_rate_limiter_allow(&config, cookie, now + i, 1), - "event allowed which should not be"); - } - assert_zero(activity_dump_rate_limiter_allow(&config, cookie, now, 0), - "event allowed which should not be"); - } - return 1; -} - -__attribute__((always_inline)) int test_ad_ratelimiter_variable_droprate(int algo) { - u64 now = bpf_ktime_get_ns(); - - struct activity_dump_config config; - config.events_rate = AD_RL_TEST_RATE; - - struct activity_dump_rate_limiter_ctx ctx; - ctx.counter = 0; - ctx.current_period = now; - ctx.algo_id = algo; // force algo - u64 cookie = 0; - bpf_map_update_elem(&activity_dump_rate_limiters, &cookie, &ctx, BPF_ANY); - - for (int period_cpt = 0; period_cpt < NUMBER_OF_PERIOD_PER_TEST; period_cpt++, now += SEC_TO_NS(2)) { - assert_not_zero(activity_dump_rate_limiter_allow(&config, cookie, now, 0), - "event not allowed which should be"); - for (int i = 0; i < AD_RL_TEST_RATE / 4; i++) { - assert_not_zero(activity_dump_rate_limiter_allow(&config, cookie, now + i, 1), - "event not allowed which should be"); - } - - int total_allowed = 0; - for (int i = 0; i < AD_RL_TEST_RATE * 10; i++) { - if (activity_dump_rate_limiter_allow(&config, cookie, now + i, 1)) { - total_allowed++; - } - } - assert_greater_than(total_allowed, AD_RL_TEST_RATE * 3 / 4, "nope"); - assert_lesser_than(total_allowed, AD_RL_TEST_RATE / 10, "nope"); - } - return 1; -} - -SEC("test/ad_ratelimiter_decreasing_droprate") -int test_ad_ratelimiter_decreasing_droprate() { - return test_ad_ratelimiter_variable_droprate(RL_ALGO_DECREASING_DROPRATE); -} - -SEC("test/ad_ratelimiter_increasing_droprate") -int test_ad_ratelimiter_increasing_droprate() { - return test_ad_ratelimiter_variable_droprate(RL_ALGO_INCREASING_DROPRATE); -} - #endif /* _ACTIVITY_DUMP_RATELIMITER_TEST_H_ */ diff --git a/pkg/security/ebpf/kernel/kernel.go b/pkg/security/ebpf/kernel/kernel.go index 65170a4d53c0f..646163b104936 100644 --- a/pkg/security/ebpf/kernel/kernel.go +++ b/pkg/security/ebpf/kernel/kernel.go @@ -103,6 +103,8 @@ var ( Kernel6_5 = kernel.VersionCode(6, 5, 0) // Kernel6_6 is the KernelVersion representation of kernel version 6.6 Kernel6_6 = kernel.VersionCode(6, 6, 0) + // Kernel6_7 is the KernelVersion representation of kernel version 6.7 + Kernel6_7 = kernel.VersionCode(6, 7, 0) // Kernel6_10 is the KernelVersion representation of kernel version 6.10 Kernel6_10 = kernel.VersionCode(6, 10, 0) // Kernel6_11 is the KernelVersion representation of kernel version 6.11 @@ -251,6 +253,11 @@ func (k *Version) IsRH9_3Kernel() bool { return k.IsRH9Kernel() && strings.HasPrefix(k.OsRelease["VERSION_ID"], "9.3") } +// IsRH9_4Kernel returns whether the kernel is a rh9.3 kernel +func (k *Version) IsRH9_4Kernel() bool { + return k.IsRH9Kernel() && strings.HasPrefix(k.OsRelease["VERSION_ID"], "9.4") +} + // IsSuseKernel returns whether the kernel is a suse kernel func (k *Version) IsSuseKernel() bool { return k.IsSLESKernel() || k.OsRelease["ID"] == "opensuse-leap" diff --git a/pkg/security/ebpf/manager.go b/pkg/security/ebpf/manager.go index 779d3a572f4c5..835c92595d9e7 100644 --- a/pkg/security/ebpf/manager.go +++ b/pkg/security/ebpf/manager.go @@ -9,10 +9,7 @@ package ebpf import ( - "math" - manager "github.com/DataDog/ebpf-manager" - "golang.org/x/sys/unix" "github.com/DataDog/datadog-agent/pkg/security/ebpf/probes" ) @@ -25,16 +22,7 @@ func NewDefaultOptions() manager.Options { DefaultPerfRingBufferSize: probes.EventsPerfRingBufferSize, - // Extend RLIMIT_MEMLOCK (8) size - // On some systems, the default for RLIMIT_MEMLOCK may be as low as 64 bytes. - // This will result in an EPERM (Operation not permitted) error, when trying to create an eBPF map - // using bpf(2) with BPF_MAP_CREATE. - // - // We are setting the limit to infinity until we have a better handle on the true requirements. - RLimit: &unix.Rlimit{ - Cur: math.MaxUint64, - Max: math.MaxUint64, - }, + RemoveRlimit: true, } } diff --git a/pkg/security/ebpf/probes/all.go b/pkg/security/ebpf/probes/all.go index 770d883b64dd7..777630d1cb688 100644 --- a/pkg/security/ebpf/probes/all.go +++ b/pkg/security/ebpf/probes/all.go @@ -177,6 +177,10 @@ func AllMapSpecEditors(numCPU int, opts MapSpecEditorOpts) map[string]manager.Ma MaxEntries: procPidCacheMaxEntries, EditorFlag: manager.EditMaxEntries, }, + "rate_limiters": { + MaxEntries: procPidCacheMaxEntries, + EditorFlag: manager.EditMaxEntries, + }, "activity_dumps_config": { MaxEntries: model.MaxTracedCgroupsCount, diff --git a/pkg/security/ebpf/tests/activity_dump_ratelimiter_test.go b/pkg/security/ebpf/tests/activity_dump_ratelimiter_test.go index 06a30a1a3ce1a..a2f41c5e14108 100644 --- a/pkg/security/ebpf/tests/activity_dump_ratelimiter_test.go +++ b/pkg/security/ebpf/tests/activity_dump_ratelimiter_test.go @@ -16,31 +16,7 @@ import ( func TestActivityDumpRateLimiterBasic(t *testing.T) { var ctx baloum.StdContext - code, err := newVM(t).RunProgram(&ctx, "test/ad_ratelimiter_basic") - if err != nil || code != 1 { - t.Errorf("unexpected error: %v, %d", err, code) - } -} - -func TestActivityDumpRateLimiterBasicHalf(t *testing.T) { - var ctx baloum.StdContext - code, err := newVM(t).RunProgram(&ctx, "test/ad_ratelimiter_basic_half") - if err != nil || code != 1 { - t.Errorf("unexpected error: %v, %d", err, code) - } -} - -func TestActivityDumpRateLimiterDecreasingDroprate(t *testing.T) { - var ctx baloum.StdContext - code, err := newVM(t).RunProgram(&ctx, "test/ad_ratelimiter_decreasing_droprate") - if err != nil || code != 1 { - t.Errorf("unexpected error: %v, %d", err, code) - } -} - -func TestActivityDumpRateLimiterIncreasingDroprate(t *testing.T) { - var ctx baloum.StdContext - code, err := newVM(t).RunProgram(&ctx, "test/ad_ratelimiter_increasing_droprate") + code, err := newVM(t).RunProgram(&ctx, "test/ad_ratelimiter") if err != nil || code != 1 { t.Errorf("unexpected error: %v, %d", err, code) } diff --git a/pkg/security/events/event.go b/pkg/security/events/event.go index 71d1c46696b5c..94735ca5cb0cc 100644 --- a/pkg/security/events/event.go +++ b/pkg/security/events/event.go @@ -28,6 +28,8 @@ type AgentContext struct { OS string `json:"os,omitempty"` Arch string `json:"arch,omitempty"` Origin string `json:"origin,omitempty"` + KernelVersion string `json:"kernel_version,omitempty"` + Distribution string `json:"distribution,omitempty"` } // BackendEvent - Rule event wrapper used to send an event to the backend diff --git a/pkg/security/events/event_easyjson.go b/pkg/security/events/event_easyjson.go index fbeebfad6fe49..bf220f70d1ca3 100644 --- a/pkg/security/events/event_easyjson.go +++ b/pkg/security/events/event_easyjson.go @@ -136,6 +136,10 @@ func easyjsonF642ad3eDecodeGithubComDataDogDatadogAgentPkgSecurityEvents1(in *jl out.Arch = string(in.String()) case "origin": out.Origin = string(in.String()) + case "kernel_version": + out.KernelVersion = string(in.String()) + case "distribution": + out.Distribution = string(in.String()) default: in.SkipRecursive() } @@ -204,6 +208,16 @@ func easyjsonF642ad3eEncodeGithubComDataDogDatadogAgentPkgSecurityEvents1(out *j out.RawString(prefix) out.String(string(in.Origin)) } + if in.KernelVersion != "" { + const prefix string = ",\"kernel_version\":" + out.RawString(prefix) + out.String(string(in.KernelVersion)) + } + if in.Distribution != "" { + const prefix string = ",\"distribution\":" + out.RawString(prefix) + out.String(string(in.Distribution)) + } out.RawByte('}') } diff --git a/pkg/security/module/server.go b/pkg/security/module/server.go index 207525cd4909f..3f2e2faf75c36 100644 --- a/pkg/security/module/server.go +++ b/pkg/security/module/server.go @@ -128,6 +128,10 @@ type APIServer struct { policiesStatus []*api.PolicyStatus msgSender MsgSender + // os release data + kernelVersion string + distribution string + stopChan chan struct{} stopper startstop.Stopper } @@ -314,12 +318,14 @@ func (a *APIServer) SendEvent(rule *rules.Rule, event events.Event, extTagsCb fu backendEvent := events.BackendEvent{ Title: rule.Def.Description, AgentContext: events.AgentContext{ - RuleID: rule.Def.ID, - RuleVersion: rule.Def.Version, - Version: version.AgentVersion, - OS: runtime.GOOS, - Arch: utils.RuntimeArch(), - Origin: a.probe.Origin(), + RuleID: rule.Def.ID, + RuleVersion: rule.Def.Version, + Version: version.AgentVersion, + OS: runtime.GOOS, + Arch: utils.RuntimeArch(), + Origin: a.probe.Origin(), + KernelVersion: a.kernelVersion, + Distribution: a.distribution, }, } @@ -576,6 +582,8 @@ func NewAPIServer(cfg *config.RuntimeSecurityConfig, probe *sprobe.Probe, msgSen msgSender: msgSender, } + as.collectOSReleaseData() + if as.msgSender == nil { if pkgconfigsetup.SystemProbe().GetBool("runtime_security_config.direct_send_from_system_probe") { msgSender, err := NewDirectMsgSender(stopper) diff --git a/pkg/security/module/server_linux.go b/pkg/security/module/server_linux.go index 2ffde0ce911e2..53ac089890280 100644 --- a/pkg/security/module/server_linux.go +++ b/pkg/security/module/server_linux.go @@ -267,3 +267,15 @@ func (a *APIServer) RunSelfTest(_ context.Context, _ *api.RunSelfTestParams) (*a Error: "", }, nil } + +func (a *APIServer) collectOSReleaseData() { + p, ok := a.probe.PlatformProbe.(*probe.EBPFProbe) + if !ok { + return + } + + kv := p.GetKernelVersion() + + a.kernelVersion = kv.Code.String() + a.distribution = fmt.Sprintf("%s - %s", kv.OsRelease["ID"], kv.OsRelease["VERSION_ID"]) +} diff --git a/pkg/collector/corechecks/system/cpu/cpu/cpu_ctx_switches.go b/pkg/security/module/server_other.go similarity index 61% rename from pkg/collector/corechecks/system/cpu/cpu/cpu_ctx_switches.go rename to pkg/security/module/server_other.go index 21a57e5ac4cde..2c7a7e9811877 100644 --- a/pkg/collector/corechecks/system/cpu/cpu/cpu_ctx_switches.go +++ b/pkg/security/module/server_other.go @@ -2,13 +2,9 @@ // 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 && !windows -package cpu +//go:build !linux && !windows -import "github.com/DataDog/datadog-agent/pkg/aggregator/sender" +package module -func collectCtxSwitches(_ sender.Sender) error { - // On non-linux systems, do nothing - return nil -} +func (a *APIServer) collectOSReleaseData() {} diff --git a/pkg/security/module/server_windows.go b/pkg/security/module/server_windows.go index 3a5b66538ae43..7978103c1bb8f 100644 --- a/pkg/security/module/server_windows.go +++ b/pkg/security/module/server_windows.go @@ -88,3 +88,5 @@ func (a *APIServer) RunSelfTest(_ context.Context, _ *api.RunSelfTestParams) (*a Error: "", }, nil } + +func (a *APIServer) collectOSReleaseData() {} diff --git a/pkg/security/probe/config/config.go b/pkg/security/probe/config/config.go index c312bbdea3181..c597eebe84e0e 100644 --- a/pkg/security/probe/config/config.go +++ b/pkg/security/probe/config/config.go @@ -101,12 +101,6 @@ type Config struct { // RuntimeCompilationEnabled defines if the runtime-compilation is enabled RuntimeCompilationEnabled bool - // EnableRuntimeCompiledConstants defines if the runtime compilation based constant fetcher is enabled - RuntimeCompiledConstantsEnabled bool - - // RuntimeCompiledConstantsIsSet is set if the runtime compiled constants option is user-set - RuntimeCompiledConstantsIsSet bool - // NetworkLazyInterfacePrefixes is the list of interfaces prefix that aren't explicitly deleted by the container // runtime, and that are lazily deleted by the kernel when a network namespace is cleaned up. This list helps the // agent detect when a network namespace should be purged from all caches. @@ -190,9 +184,7 @@ func NewConfig() (*Config, error) { EventServerBurst: pkgconfigsetup.SystemProbe().GetInt(join(evNS, "event_server.burst")), // runtime compilation - RuntimeCompilationEnabled: getBool("runtime_compilation.enabled"), - RuntimeCompiledConstantsEnabled: getBool("runtime_compilation.compiled_constants_enabled"), - RuntimeCompiledConstantsIsSet: isSet("runtime_compilation.compiled_constants_enabled"), + RuntimeCompilationEnabled: getBool("runtime_compilation.enabled"), } if err := c.sanitize(); err != nil { @@ -225,10 +217,6 @@ func (c *Config) sanitize() error { c.RuntimeCompilationEnabled = false } - if !c.RuntimeCompilationEnabled { - c.RuntimeCompiledConstantsEnabled = false - } - if c.EventStreamBufferSize%os.Getpagesize() != 0 || c.EventStreamBufferSize&(c.EventStreamBufferSize-1) != 0 { return fmt.Errorf("runtime_security_config.event_stream.buffer_size must be a power of 2 and a multiple of %d", os.Getpagesize()) } diff --git a/pkg/security/probe/constantfetch/available.go b/pkg/security/probe/constantfetch/available.go index bdbb9edcf4620..1035fb497e600 100644 --- a/pkg/security/probe/constantfetch/available.go +++ b/pkg/security/probe/constantfetch/available.go @@ -12,7 +12,6 @@ import ( "errors" "fmt" - "github.com/DataDog/datadog-go/v5/statsd" "github.com/cilium/ebpf/btf" pkgebpf "github.com/DataDog/datadog-agent/pkg/ebpf" @@ -22,18 +21,13 @@ import ( ) // GetAvailableConstantFetchers returns available constant fetchers -func GetAvailableConstantFetchers(config *config.Config, kv *kernel.Version, statsdClient statsd.ClientInterface) []ConstantFetcher { +func GetAvailableConstantFetchers(config *config.Config, kv *kernel.Version) []ConstantFetcher { fetchers := make([]ConstantFetcher, 0) if coreFetcher, err := NewBTFConstantFetcherFromCurrentKernel(); err == nil { fetchers = append(fetchers, coreFetcher) } - if config.RuntimeCompiledConstantsEnabled { - rcConstantFetcher := NewRuntimeCompilationConstantFetcher(&config.Config, statsdClient) - fetchers = append(fetchers, rcConstantFetcher) - } - btfhubFetcher, err := NewBTFHubConstantFetcher(kv) if err != nil { seclog.Debugf("failed to create btfhub constant fetcher: %v", err) diff --git a/pkg/security/probe/constantfetch/available_unsupported.go b/pkg/security/probe/constantfetch/available_unsupported.go index 3e003cbc28601..6195452074bbc 100644 --- a/pkg/security/probe/constantfetch/available_unsupported.go +++ b/pkg/security/probe/constantfetch/available_unsupported.go @@ -11,15 +11,13 @@ package constantfetch import ( "errors" - "github.com/DataDog/datadog-go/v5/statsd" - "github.com/DataDog/datadog-agent/pkg/security/ebpf/kernel" "github.com/DataDog/datadog-agent/pkg/security/probe/config" "github.com/DataDog/datadog-agent/pkg/security/seclog" ) // GetAvailableConstantFetchers returns available constant fetchers -func GetAvailableConstantFetchers(_ *config.Config, kv *kernel.Version, _ statsd.ClientInterface) []ConstantFetcher { +func GetAvailableConstantFetchers(_ *config.Config, kv *kernel.Version) []ConstantFetcher { fetchers := make([]ConstantFetcher, 0) btfhubFetcher, err := NewBTFHubConstantFetcher(kv) diff --git a/pkg/security/probe/constantfetch/btfhub.go b/pkg/security/probe/constantfetch/btfhub.go index c81a2ee968153..bc67299b013e1 100644 --- a/pkg/security/probe/constantfetch/btfhub.go +++ b/pkg/security/probe/constantfetch/btfhub.go @@ -79,12 +79,12 @@ func (f *BTFHubConstantFetcher) appendRequest(id string) { } // AppendSizeofRequest appends a sizeof request -func (f *BTFHubConstantFetcher) AppendSizeofRequest(id, _, _ string) { +func (f *BTFHubConstantFetcher) AppendSizeofRequest(id, _ string) { f.appendRequest(id) } // AppendOffsetofRequest appends an offset request -func (f *BTFHubConstantFetcher) AppendOffsetofRequest(id, _, _, _ string) { +func (f *BTFHubConstantFetcher) AppendOffsetofRequest(id, _ string, _ ...string) { f.appendRequest(id) } diff --git a/pkg/security/probe/constantfetch/btfhub/constants.json b/pkg/security/probe/constantfetch/btfhub/constants.json index c8e007fa9ae5c..90238609bab82 100644 --- a/pkg/security/probe/constantfetch/btfhub/constants.json +++ b/pkg/security/probe/constantfetch/btfhub/constants.json @@ -11,6 +11,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1320, "file_f_inode_offset": 32, @@ -19,6 +20,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -56,6 +62,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1320, "file_f_inode_offset": 32, @@ -64,6 +71,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -101,6 +113,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1320, "file_f_inode_offset": 32, @@ -109,6 +122,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -146,6 +164,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 44, "creds_uid_offset": 8, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1320, "file_f_inode_offset": 32, @@ -154,6 +173,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -191,6 +215,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1320, "file_f_inode_offset": 32, @@ -199,6 +224,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -236,6 +266,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -244,6 +275,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -281,6 +317,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -289,6 +326,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -326,6 +368,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -334,6 +377,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -371,6 +419,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 44, "creds_uid_offset": 8, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -379,6 +428,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -416,6 +470,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -424,6 +479,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -458,6 +518,7 @@ "bpf_prog_type_offset": 8, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -466,6 +527,11 @@ "flowi4_uli_offset": 40, "flowi6_saddr_offset": 48, "flowi6_uli_offset": 68, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -500,6 +566,7 @@ "bpf_prog_type_offset": 8, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -508,6 +575,11 @@ "flowi4_uli_offset": 40, "flowi6_saddr_offset": 48, "flowi6_uli_offset": 68, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -545,6 +617,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -553,6 +626,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -590,6 +668,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -598,6 +677,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -635,6 +719,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -643,6 +728,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -680,6 +770,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 44, "creds_uid_offset": 8, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -688,6 +779,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -725,6 +821,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -733,6 +830,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -766,6 +868,7 @@ "bpf_prog_aux_offset": 16, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1128, "file_f_inode_offset": 32, @@ -774,6 +877,11 @@ "flowi4_uli_offset": 28, "flowi6_saddr_offset": 36, "flowi6_uli_offset": 56, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -806,6 +914,7 @@ "bpf_prog_aux_offset": 16, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1128, "file_f_inode_offset": 32, @@ -814,6 +923,11 @@ "flowi4_uli_offset": 28, "flowi6_saddr_offset": 36, "flowi6_uli_offset": 56, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -845,6 +959,7 @@ "bpf_prog_aux_offset": 16, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1128, "file_f_inode_offset": 32, @@ -853,6 +968,11 @@ "flowi4_uli_offset": 28, "flowi6_saddr_offset": 36, "flowi6_uli_offset": 56, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -886,6 +1006,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1192, "file_f_inode_offset": 32, @@ -894,6 +1015,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -929,6 +1055,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1320, "file_f_inode_offset": 32, @@ -937,6 +1064,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -972,6 +1104,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1320, "file_f_inode_offset": 32, @@ -980,6 +1113,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -1018,6 +1156,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1288, "file_f_inode_offset": 32, @@ -1026,6 +1165,11 @@ "flowi4_uli_offset": 64, "flowi6_saddr_offset": 72, "flowi6_uli_offset": 92, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 320, "linux_binprm_envc_offset": 324, "linux_binprm_p_offset": 280, @@ -1062,6 +1206,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1288, "file_f_inode_offset": 32, @@ -1070,6 +1215,11 @@ "flowi4_uli_offset": 64, "flowi6_saddr_offset": 72, "flowi6_uli_offset": 92, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 320, "linux_binprm_envc_offset": 324, "linux_binprm_p_offset": 280, @@ -1106,6 +1256,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1288, "file_f_inode_offset": 32, @@ -1114,6 +1265,11 @@ "flowi4_uli_offset": 64, "flowi6_saddr_offset": 72, "flowi6_uli_offset": 92, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 320, "linux_binprm_envc_offset": 324, "linux_binprm_p_offset": 280, @@ -1150,6 +1306,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1288, "file_f_inode_offset": 32, @@ -1158,6 +1315,11 @@ "flowi4_uli_offset": 64, "flowi6_saddr_offset": 72, "flowi6_uli_offset": 92, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 320, "linux_binprm_envc_offset": 324, "linux_binprm_p_offset": 280, @@ -1194,6 +1356,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1288, "file_f_inode_offset": 32, @@ -1202,6 +1365,11 @@ "flowi4_uli_offset": 64, "flowi6_saddr_offset": 72, "flowi6_uli_offset": 92, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 320, "linux_binprm_envc_offset": 324, "linux_binprm_p_offset": 280, @@ -1240,6 +1408,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -1248,6 +1417,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -1285,6 +1459,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -1293,6 +1468,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -1324,6 +1504,7 @@ "bpf_prog_type_offset": 8, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1160, "file_f_inode_offset": 32, @@ -1332,6 +1513,11 @@ "flowi4_uli_offset": 28, "flowi6_saddr_offset": 36, "flowi6_uli_offset": 56, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -1364,6 +1550,7 @@ "bpf_prog_type_offset": 8, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1240, "file_f_inode_offset": 32, @@ -1372,6 +1559,11 @@ "flowi4_uli_offset": 40, "flowi6_saddr_offset": 48, "flowi6_uli_offset": 68, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -1410,6 +1602,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1264, "file_f_inode_offset": 32, @@ -1418,6 +1611,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 80, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 88, @@ -1456,6 +1654,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -1464,6 +1663,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 96, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 72, @@ -1502,6 +1706,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1000, "file_f_inode_offset": 32, @@ -1510,6 +1715,11 @@ "flowi4_uli_offset": 28, "flowi6_saddr_offset": 36, "flowi6_uli_offset": 56, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -1548,6 +1758,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1000, "file_f_inode_offset": 32, @@ -1556,6 +1767,11 @@ "flowi4_uli_offset": 28, "flowi6_saddr_offset": 36, "flowi6_uli_offset": 56, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -1595,6 +1811,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -1603,6 +1820,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -1640,6 +1862,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -1648,6 +1871,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -1685,6 +1913,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -1693,6 +1922,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 96, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 72, @@ -1732,6 +1966,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1288, "file_f_inode_offset": 32, @@ -1740,6 +1975,11 @@ "flowi4_uli_offset": 64, "flowi6_saddr_offset": 72, "flowi6_uli_offset": 92, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 320, "linux_binprm_envc_offset": 324, "linux_binprm_p_offset": 280, @@ -1778,6 +2018,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1288, "file_f_inode_offset": 32, @@ -1786,6 +2027,11 @@ "flowi4_uli_offset": 64, "flowi6_saddr_offset": 72, "flowi6_uli_offset": 92, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 320, "linux_binprm_envc_offset": 324, "linux_binprm_p_offset": 280, @@ -1826,6 +2072,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1288, "file_f_inode_offset": 32, @@ -1834,6 +2081,11 @@ "flowi4_uli_offset": 64, "flowi6_saddr_offset": 72, "flowi6_uli_offset": 92, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 320, "linux_binprm_envc_offset": 324, "linux_binprm_p_offset": 280, @@ -1874,6 +2126,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -1882,6 +2135,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -1921,6 +2179,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 152, "dentry_sb_offset": 152, "device_nd_net_net_offset": 1368, "file_f_inode_offset": 32, @@ -1929,6 +2188,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -1968,6 +2232,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -1976,6 +2241,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -2015,6 +2285,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 152, "dentry_sb_offset": 152, "device_nd_net_net_offset": 1368, "file_f_inode_offset": 32, @@ -2023,6 +2294,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -2062,6 +2338,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -2070,6 +2347,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -2109,6 +2391,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 152, "dentry_sb_offset": 152, "device_nd_net_net_offset": 1368, "file_f_inode_offset": 32, @@ -2117,6 +2400,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -2156,6 +2444,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 44, "creds_uid_offset": 8, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -2164,6 +2453,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -2203,6 +2497,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 44, "creds_uid_offset": 8, + "dentry_d_sb_offset": 152, "dentry_sb_offset": 152, "device_nd_net_net_offset": 1368, "file_f_inode_offset": 32, @@ -2211,6 +2506,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -2250,6 +2550,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 152, "dentry_sb_offset": 152, "device_nd_net_net_offset": 1368, "file_f_inode_offset": 32, @@ -2258,6 +2559,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -2297,6 +2603,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1264, "file_f_inode_offset": 32, @@ -2305,6 +2612,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 80, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 88, @@ -2345,6 +2657,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 168, "dentry_sb_offset": 168, "device_nd_net_net_offset": 1376, "file_f_inode_offset": 32, @@ -2353,6 +2666,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 80, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 88, @@ -2393,6 +2711,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 44, "creds_uid_offset": 8, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1264, "file_f_inode_offset": 32, @@ -2401,6 +2720,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 80, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 88, @@ -2441,6 +2765,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 44, "creds_uid_offset": 8, + "dentry_d_sb_offset": 168, "dentry_sb_offset": 168, "device_nd_net_net_offset": 1376, "file_f_inode_offset": 32, @@ -2449,6 +2774,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 80, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 88, @@ -2489,6 +2819,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -2497,6 +2828,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -2536,6 +2872,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 152, "dentry_sb_offset": 152, "device_nd_net_net_offset": 1368, "file_f_inode_offset": 32, @@ -2544,6 +2881,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -2583,6 +2925,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -2591,6 +2934,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -2630,6 +2978,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 152, "dentry_sb_offset": 152, "device_nd_net_net_offset": 1368, "file_f_inode_offset": 32, @@ -2638,6 +2987,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -2677,6 +3031,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -2685,6 +3040,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -2724,6 +3084,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 152, "dentry_sb_offset": 152, "device_nd_net_net_offset": 1368, "file_f_inode_offset": 32, @@ -2732,6 +3093,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -2771,6 +3137,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 44, "creds_uid_offset": 8, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -2779,6 +3146,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -2818,6 +3190,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 44, "creds_uid_offset": 8, + "dentry_d_sb_offset": 152, "dentry_sb_offset": 152, "device_nd_net_net_offset": 1368, "file_f_inode_offset": 32, @@ -2826,6 +3199,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -2865,6 +3243,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 152, "dentry_sb_offset": 152, "device_nd_net_net_offset": 1368, "file_f_inode_offset": 32, @@ -2873,6 +3252,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -2912,6 +3296,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1264, "file_f_inode_offset": 32, @@ -2920,6 +3305,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 80, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 88, @@ -2960,6 +3350,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 168, "dentry_sb_offset": 168, "device_nd_net_net_offset": 1376, "file_f_inode_offset": 32, @@ -2968,6 +3359,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 80, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 88, @@ -3008,6 +3404,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 44, "creds_uid_offset": 8, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1264, "file_f_inode_offset": 32, @@ -3016,6 +3413,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 80, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 88, @@ -3056,6 +3458,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 44, "creds_uid_offset": 8, + "dentry_d_sb_offset": 168, "dentry_sb_offset": 168, "device_nd_net_net_offset": 1376, "file_f_inode_offset": 32, @@ -3064,6 +3467,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 80, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 88, @@ -3098,6 +3506,7 @@ "bpf_prog_type_offset": 8, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1320, "file_f_inode_offset": 32, @@ -3106,6 +3515,11 @@ "flowi4_uli_offset": 40, "flowi6_saddr_offset": 48, "flowi6_uli_offset": 68, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -3140,6 +3554,7 @@ "bpf_prog_type_offset": 8, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -3148,6 +3563,11 @@ "flowi4_uli_offset": 40, "flowi6_saddr_offset": 48, "flowi6_uli_offset": 68, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -3182,6 +3602,7 @@ "bpf_prog_type_offset": 8, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 152, "dentry_sb_offset": 152, "device_nd_net_net_offset": 1368, "file_f_inode_offset": 32, @@ -3190,6 +3611,11 @@ "flowi4_uli_offset": 40, "flowi6_saddr_offset": 48, "flowi6_uli_offset": 68, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -3225,6 +3651,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -3233,6 +3660,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -3267,6 +3699,7 @@ "bpf_prog_type_offset": 8, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1176, "file_f_inode_offset": 32, @@ -3275,6 +3708,11 @@ "flowi4_uli_offset": 40, "flowi6_saddr_offset": 48, "flowi6_uli_offset": 68, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -3312,6 +3750,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -3320,6 +3759,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -3354,6 +3798,7 @@ "bpf_prog_type_offset": 8, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1224, "file_f_inode_offset": 32, @@ -3362,6 +3807,11 @@ "flowi4_uli_offset": 40, "flowi6_saddr_offset": 48, "flowi6_uli_offset": 68, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -3397,6 +3847,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -3405,6 +3856,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -3444,6 +3900,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1248, "file_f_inode_offset": 32, @@ -3452,6 +3909,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -3492,6 +3954,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1248, "file_f_inode_offset": 32, @@ -3500,6 +3963,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -3539,6 +4007,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1312, "file_f_inode_offset": 32, @@ -3547,6 +4016,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -3587,6 +4061,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -3595,6 +4070,11 @@ "flowi4_uli_offset": 40, "flowi6_saddr_offset": 48, "flowi6_uli_offset": 68, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 200, "linux_binprm_envc_offset": 204, "linux_binprm_p_offset": 152, @@ -3633,6 +4113,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1248, "file_f_inode_offset": 32, @@ -3641,6 +4122,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -3681,6 +4167,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -3689,6 +4176,11 @@ "flowi4_uli_offset": 40, "flowi6_saddr_offset": 48, "flowi6_uli_offset": 68, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 200, "linux_binprm_envc_offset": 204, "linux_binprm_p_offset": 152, @@ -3728,6 +4220,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1248, "file_f_inode_offset": 32, @@ -3736,6 +4229,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -3776,6 +4274,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -3784,6 +4283,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 88, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 72, @@ -3825,6 +4329,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -3833,6 +4338,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 88, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 72, @@ -3874,6 +4384,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1264, "file_f_inode_offset": 32, @@ -3882,6 +4393,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 88, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 72, @@ -3922,6 +4438,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1264, "file_f_inode_offset": 32, @@ -3930,6 +4447,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 88, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 72, @@ -3970,6 +4492,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -3978,6 +4501,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 88, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 72, @@ -4019,6 +4547,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -4027,6 +4556,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 88, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 72, @@ -4065,6 +4599,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1320, "file_f_inode_offset": 32, @@ -4073,6 +4608,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -4113,6 +4653,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -4121,6 +4662,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 96, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 72, @@ -4162,6 +4708,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1288, "file_f_inode_offset": 32, @@ -4170,6 +4717,11 @@ "flowi4_uli_offset": 64, "flowi6_saddr_offset": 72, "flowi6_uli_offset": 92, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 96, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 72, @@ -4211,6 +4763,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1288, "file_f_inode_offset": 32, @@ -4219,6 +4772,11 @@ "flowi4_uli_offset": 64, "flowi6_saddr_offset": 72, "flowi6_uli_offset": 92, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 80, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 72, @@ -4257,6 +4815,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1000, "file_f_inode_offset": 32, @@ -4265,6 +4824,11 @@ "flowi4_uli_offset": 28, "flowi6_saddr_offset": 36, "flowi6_uli_offset": 56, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -4298,6 +4862,7 @@ "bpf_prog_type_offset": 8, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1160, "file_f_inode_offset": 32, @@ -4306,6 +4871,11 @@ "flowi4_uli_offset": 28, "flowi6_saddr_offset": 36, "flowi6_uli_offset": 56, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -4343,6 +4913,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -4351,6 +4922,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -4388,6 +4964,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -4396,6 +4973,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -4436,6 +5018,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -4444,6 +5027,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 96, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 72, @@ -4485,6 +5073,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -4493,6 +5082,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 96, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 72, @@ -4534,6 +5128,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1288, "file_f_inode_offset": 32, @@ -4542,6 +5137,11 @@ "flowi4_uli_offset": 64, "flowi6_saddr_offset": 72, "flowi6_uli_offset": 92, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 96, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 72, @@ -4583,6 +5183,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1288, "file_f_inode_offset": 32, @@ -4591,6 +5192,11 @@ "flowi4_uli_offset": 64, "flowi6_saddr_offset": 72, "flowi6_uli_offset": 92, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 80, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 72, @@ -4632,6 +5238,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1288, "file_f_inode_offset": 32, @@ -4640,6 +5247,11 @@ "flowi4_uli_offset": 64, "flowi6_saddr_offset": 72, "flowi6_uli_offset": 92, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 320, "linux_binprm_envc_offset": 324, "linux_binprm_p_offset": 280, @@ -4678,6 +5290,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1288, "file_f_inode_offset": 32, @@ -4686,6 +5299,11 @@ "flowi4_uli_offset": 64, "flowi6_saddr_offset": 72, "flowi6_uli_offset": 92, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 320, "linux_binprm_envc_offset": 324, "linux_binprm_p_offset": 280, @@ -4726,6 +5344,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1288, "file_f_inode_offset": 32, @@ -4734,6 +5353,11 @@ "flowi4_uli_offset": 64, "flowi6_saddr_offset": 72, "flowi6_uli_offset": 92, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 96, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 72, @@ -4775,6 +5399,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1288, "file_f_inode_offset": 32, @@ -4783,6 +5408,11 @@ "flowi4_uli_offset": 64, "flowi6_saddr_offset": 72, "flowi6_uli_offset": 92, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 320, "linux_binprm_envc_offset": 324, "linux_binprm_p_offset": 280, @@ -4821,6 +5451,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1288, "file_f_inode_offset": 32, @@ -4829,6 +5460,11 @@ "flowi4_uli_offset": 64, "flowi6_saddr_offset": 72, "flowi6_uli_offset": 92, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 320, "linux_binprm_envc_offset": 324, "linux_binprm_p_offset": 280, @@ -4869,6 +5505,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1288, "file_f_inode_offset": 32, @@ -4877,6 +5514,11 @@ "flowi4_uli_offset": 64, "flowi6_saddr_offset": 72, "flowi6_uli_offset": 92, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 96, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 72, @@ -4915,6 +5557,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1320, "file_f_inode_offset": 32, @@ -4923,6 +5566,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -4960,6 +5608,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -4968,6 +5617,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -5005,6 +5659,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1120, "file_f_inode_offset": 32, @@ -5013,6 +5668,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -5051,6 +5711,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1264, "file_f_inode_offset": 32, @@ -5059,6 +5720,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -5097,6 +5763,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1264, "file_f_inode_offset": 32, @@ -5105,6 +5772,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -5143,6 +5815,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1128, "file_f_inode_offset": 32, @@ -5151,6 +5824,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -5191,6 +5869,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -5199,6 +5878,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 88, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 72, @@ -5240,6 +5924,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -5248,6 +5933,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 88, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 72, @@ -5289,6 +5979,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1056, "file_f_inode_offset": 32, @@ -5297,6 +5988,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 88, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 72, @@ -5338,6 +6034,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1264, "file_f_inode_offset": 32, @@ -5346,6 +6043,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 88, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 72, @@ -5387,6 +6089,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1264, "file_f_inode_offset": 32, @@ -5395,6 +6098,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 88, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 72, @@ -5436,6 +6144,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1128, "file_f_inode_offset": 32, @@ -5444,6 +6153,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 88, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 72, @@ -5480,6 +6194,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1192, "file_f_inode_offset": 32, @@ -5488,6 +6203,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -5523,6 +6243,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1320, "file_f_inode_offset": 32, @@ -5531,6 +6252,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -5568,6 +6294,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1000, "file_f_inode_offset": 32, @@ -5576,6 +6303,11 @@ "flowi4_uli_offset": 28, "flowi6_saddr_offset": 36, "flowi6_uli_offset": 56, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -5614,6 +6346,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1000, "file_f_inode_offset": 32, @@ -5622,6 +6355,11 @@ "flowi4_uli_offset": 28, "flowi6_saddr_offset": 36, "flowi6_uli_offset": 56, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -5661,6 +6399,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1288, "file_f_inode_offset": 32, @@ -5669,6 +6408,11 @@ "flowi4_uli_offset": 64, "flowi6_saddr_offset": 72, "flowi6_uli_offset": 92, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 320, "linux_binprm_envc_offset": 324, "linux_binprm_p_offset": 280, @@ -5707,6 +6451,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1288, "file_f_inode_offset": 32, @@ -5715,6 +6460,11 @@ "flowi4_uli_offset": 64, "flowi6_saddr_offset": 72, "flowi6_uli_offset": 92, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 320, "linux_binprm_envc_offset": 324, "linux_binprm_p_offset": 280, @@ -5755,6 +6505,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1288, "file_f_inode_offset": 32, @@ -5763,6 +6514,11 @@ "flowi4_uli_offset": 64, "flowi6_saddr_offset": 72, "flowi6_uli_offset": 92, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 320, "linux_binprm_envc_offset": 324, "linux_binprm_p_offset": 280, @@ -5797,6 +6553,7 @@ "bpf_prog_type_offset": 8, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1160, "file_f_inode_offset": 32, @@ -5805,6 +6562,11 @@ "flowi4_uli_offset": 40, "flowi6_saddr_offset": 48, "flowi6_uli_offset": 68, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -5839,6 +6601,7 @@ "bpf_prog_type_offset": 8, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1160, "file_f_inode_offset": 32, @@ -5847,6 +6610,11 @@ "flowi4_uli_offset": 40, "flowi6_saddr_offset": 48, "flowi6_uli_offset": 68, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -5884,6 +6652,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -5892,6 +6661,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -5929,6 +6703,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -5937,6 +6712,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -5975,6 +6755,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1264, "file_f_inode_offset": 32, @@ -5983,6 +6764,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -6020,6 +6806,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1320, "file_f_inode_offset": 32, @@ -6028,6 +6815,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -6066,6 +6858,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1264, "file_f_inode_offset": 32, @@ -6074,6 +6867,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -6114,6 +6912,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -6122,6 +6921,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 88, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 72, @@ -6163,6 +6967,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -6171,6 +6976,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 88, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 72, @@ -6212,6 +7022,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1264, "file_f_inode_offset": 32, @@ -6220,6 +7031,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 88, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 72, @@ -6261,6 +7077,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1264, "file_f_inode_offset": 32, @@ -6269,6 +7086,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 88, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 72, @@ -6305,6 +7127,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1280, "file_f_inode_offset": 32, @@ -6313,6 +7136,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -6348,6 +7176,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1280, "file_f_inode_offset": 32, @@ -6356,6 +7185,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -6391,6 +7225,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -6399,6 +7234,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -6434,6 +7274,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -6442,6 +7283,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -6479,6 +7325,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -6487,6 +7334,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -6526,6 +7378,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1248, "file_f_inode_offset": 32, @@ -6534,6 +7387,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -6573,6 +7431,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1248, "file_f_inode_offset": 32, @@ -6581,6 +7440,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -6620,6 +7484,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1248, "file_f_inode_offset": 32, @@ -6628,6 +7493,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -6667,6 +7537,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1248, "file_f_inode_offset": 32, @@ -6675,6 +7546,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -6714,6 +7590,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -6722,6 +7599,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -6761,6 +7643,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -6769,6 +7652,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -6808,6 +7696,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1248, "file_f_inode_offset": 32, @@ -6816,6 +7705,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -6856,6 +7750,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1248, "file_f_inode_offset": 32, @@ -6864,6 +7759,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -6898,6 +7798,7 @@ "bpf_prog_type_offset": 8, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1160, "file_f_inode_offset": 32, @@ -6906,6 +7807,11 @@ "flowi4_uli_offset": 28, "flowi6_saddr_offset": 36, "flowi6_uli_offset": 56, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -6940,6 +7846,7 @@ "bpf_prog_type_offset": 8, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1160, "file_f_inode_offset": 32, @@ -6948,6 +7855,11 @@ "flowi4_uli_offset": 40, "flowi6_saddr_offset": 48, "flowi6_uli_offset": 68, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -6982,6 +7894,7 @@ "bpf_prog_type_offset": 8, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1160, "file_f_inode_offset": 32, @@ -6990,6 +7903,11 @@ "flowi4_uli_offset": 40, "flowi6_saddr_offset": 48, "flowi6_uli_offset": 68, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -7024,6 +7942,7 @@ "bpf_prog_type_offset": 8, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1160, "file_f_inode_offset": 32, @@ -7032,6 +7951,11 @@ "flowi4_uli_offset": 40, "flowi6_saddr_offset": 48, "flowi6_uli_offset": 68, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -7066,6 +7990,7 @@ "bpf_prog_type_offset": 8, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1160, "file_f_inode_offset": 32, @@ -7074,6 +7999,11 @@ "flowi4_uli_offset": 40, "flowi6_saddr_offset": 48, "flowi6_uli_offset": 68, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -7108,6 +8038,7 @@ "bpf_prog_type_offset": 8, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1160, "file_f_inode_offset": 32, @@ -7116,6 +8047,11 @@ "flowi4_uli_offset": 40, "flowi6_saddr_offset": 48, "flowi6_uli_offset": 68, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -7150,6 +8086,7 @@ "bpf_prog_type_offset": 8, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1160, "file_f_inode_offset": 32, @@ -7158,6 +8095,11 @@ "flowi4_uli_offset": 40, "flowi6_saddr_offset": 48, "flowi6_uli_offset": 68, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -7192,6 +8134,7 @@ "bpf_prog_type_offset": 8, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1160, "file_f_inode_offset": 32, @@ -7200,6 +8143,11 @@ "flowi4_uli_offset": 40, "flowi6_saddr_offset": 48, "flowi6_uli_offset": 68, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -7234,6 +8182,7 @@ "bpf_prog_type_offset": 8, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1128, "file_f_inode_offset": 32, @@ -7242,6 +8191,11 @@ "flowi4_uli_offset": 40, "flowi6_saddr_offset": 48, "flowi6_uli_offset": 68, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -7276,6 +8230,7 @@ "bpf_prog_type_offset": 8, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1160, "file_f_inode_offset": 32, @@ -7284,6 +8239,11 @@ "flowi4_uli_offset": 40, "flowi6_saddr_offset": 48, "flowi6_uli_offset": 68, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -7318,6 +8278,7 @@ "bpf_prog_type_offset": 8, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1160, "file_f_inode_offset": 32, @@ -7326,6 +8287,11 @@ "flowi4_uli_offset": 40, "flowi6_saddr_offset": 48, "flowi6_uli_offset": 68, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -7360,6 +8326,7 @@ "bpf_prog_type_offset": 8, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1160, "file_f_inode_offset": 32, @@ -7368,6 +8335,11 @@ "flowi4_uli_offset": 40, "flowi6_saddr_offset": 48, "flowi6_uli_offset": 68, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -7402,6 +8374,7 @@ "bpf_prog_type_offset": 8, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1160, "file_f_inode_offset": 32, @@ -7410,6 +8383,11 @@ "flowi4_uli_offset": 40, "flowi6_saddr_offset": 48, "flowi6_uli_offset": 68, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -7444,6 +8422,7 @@ "bpf_prog_type_offset": 8, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1128, "file_f_inode_offset": 32, @@ -7452,6 +8431,11 @@ "flowi4_uli_offset": 40, "flowi6_saddr_offset": 48, "flowi6_uli_offset": 68, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -7486,6 +8470,7 @@ "bpf_prog_type_offset": 8, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1160, "file_f_inode_offset": 32, @@ -7494,6 +8479,11 @@ "flowi4_uli_offset": 40, "flowi6_saddr_offset": 48, "flowi6_uli_offset": 68, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -7528,6 +8518,7 @@ "bpf_prog_type_offset": 8, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1224, "file_f_inode_offset": 32, @@ -7536,6 +8527,11 @@ "flowi4_uli_offset": 40, "flowi6_saddr_offset": 48, "flowi6_uli_offset": 68, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -7570,6 +8566,7 @@ "bpf_prog_type_offset": 8, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1224, "file_f_inode_offset": 32, @@ -7578,6 +8575,11 @@ "flowi4_uli_offset": 40, "flowi6_saddr_offset": 48, "flowi6_uli_offset": 68, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -7615,6 +8617,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1320, "file_f_inode_offset": 32, @@ -7623,6 +8626,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -7662,6 +8670,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1312, "file_f_inode_offset": 32, @@ -7670,6 +8679,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -7709,6 +8723,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1312, "file_f_inode_offset": 32, @@ -7717,6 +8732,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -7757,6 +8777,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1312, "file_f_inode_offset": 32, @@ -7765,6 +8786,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -7805,6 +8831,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1320, "file_f_inode_offset": 32, @@ -7813,6 +8840,11 @@ "flowi4_uli_offset": 40, "flowi6_saddr_offset": 48, "flowi6_uli_offset": 68, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 200, "linux_binprm_envc_offset": 204, "linux_binprm_p_offset": 152, @@ -7852,6 +8884,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1320, "file_f_inode_offset": 32, @@ -7860,6 +8893,11 @@ "flowi4_uli_offset": 40, "flowi6_saddr_offset": 48, "flowi6_uli_offset": 68, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 200, "linux_binprm_envc_offset": 204, "linux_binprm_p_offset": 152, @@ -7899,6 +8937,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1320, "file_f_inode_offset": 32, @@ -7907,6 +8946,11 @@ "flowi4_uli_offset": 40, "flowi6_saddr_offset": 48, "flowi6_uli_offset": 68, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 200, "linux_binprm_envc_offset": 204, "linux_binprm_p_offset": 152, @@ -7946,6 +8990,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -7954,6 +8999,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 88, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 72, @@ -7995,6 +9045,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -8003,6 +9054,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 88, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 72, @@ -8044,6 +9100,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -8052,6 +9109,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 80, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 72, @@ -8093,6 +9155,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -8101,6 +9164,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 88, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 72, @@ -8142,6 +9210,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -8150,6 +9219,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 96, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 72, @@ -8188,6 +9262,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -8196,6 +9271,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -8235,6 +9315,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1248, "file_f_inode_offset": 32, @@ -8243,6 +9324,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -8282,6 +9368,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1248, "file_f_inode_offset": 32, @@ -8290,6 +9377,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -8329,6 +9421,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1248, "file_f_inode_offset": 32, @@ -8337,6 +9430,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -8376,6 +9474,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -8384,6 +9483,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -8423,6 +9527,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -8431,6 +9536,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -8470,6 +9580,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1248, "file_f_inode_offset": 32, @@ -8478,6 +9589,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -8518,6 +9634,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1312, "file_f_inode_offset": 32, @@ -8526,6 +9643,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -8566,6 +9688,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1248, "file_f_inode_offset": 32, @@ -8574,6 +9697,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -8614,6 +9742,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1248, "file_f_inode_offset": 32, @@ -8622,6 +9751,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 192, "linux_binprm_envc_offset": 196, "linux_binprm_p_offset": 152, @@ -8662,6 +9796,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1320, "file_f_inode_offset": 32, @@ -8670,6 +9805,11 @@ "flowi4_uli_offset": 40, "flowi6_saddr_offset": 48, "flowi6_uli_offset": 68, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 200, "linux_binprm_envc_offset": 204, "linux_binprm_p_offset": 152, @@ -8709,6 +9849,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -8717,6 +9858,11 @@ "flowi4_uli_offset": 40, "flowi6_saddr_offset": 48, "flowi6_uli_offset": 68, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 200, "linux_binprm_envc_offset": 204, "linux_binprm_p_offset": 152, @@ -8756,6 +9902,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1320, "file_f_inode_offset": 32, @@ -8764,6 +9911,11 @@ "flowi4_uli_offset": 40, "flowi6_saddr_offset": 48, "flowi6_uli_offset": 68, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 200, "linux_binprm_envc_offset": 204, "linux_binprm_p_offset": 152, @@ -8803,6 +9955,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -8811,6 +9964,11 @@ "flowi4_uli_offset": 40, "flowi6_saddr_offset": 48, "flowi6_uli_offset": 68, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 200, "linux_binprm_envc_offset": 204, "linux_binprm_p_offset": 152, @@ -8850,6 +10008,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1320, "file_f_inode_offset": 32, @@ -8858,6 +10017,11 @@ "flowi4_uli_offset": 40, "flowi6_saddr_offset": 48, "flowi6_uli_offset": 68, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "linux_binprm_argc_offset": 200, "linux_binprm_envc_offset": 204, "linux_binprm_p_offset": 152, @@ -8897,6 +10061,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -8905,6 +10070,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 88, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 72, @@ -8946,6 +10116,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -8954,6 +10125,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 88, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 72, @@ -8995,6 +10171,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -9003,6 +10180,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 88, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 72, @@ -9044,6 +10226,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -9052,6 +10235,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 88, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 72, @@ -9093,6 +10281,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -9101,6 +10290,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 88, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 72, @@ -9142,6 +10336,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -9150,6 +10345,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 88, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 72, @@ -9191,6 +10391,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -9199,6 +10400,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 88, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 72, @@ -9240,6 +10446,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -9248,6 +10455,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 88, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 72, @@ -9289,6 +10501,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -9297,6 +10510,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 80, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 72, @@ -9338,6 +10556,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -9346,6 +10565,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 88, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 72, @@ -9387,6 +10611,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -9395,6 +10620,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 96, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 72, @@ -9436,6 +10666,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -9444,6 +10675,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 96, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 72, @@ -9485,6 +10721,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -9493,6 +10730,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 96, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 72, @@ -9534,6 +10776,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1328, "file_f_inode_offset": 32, @@ -9542,6 +10785,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 80, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 88, @@ -9582,6 +10830,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1264, "file_f_inode_offset": 32, @@ -9590,6 +10839,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 80, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 88, @@ -9630,6 +10884,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -9638,6 +10893,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 80, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 72, @@ -9679,6 +10939,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -9687,6 +10948,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 88, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 72, @@ -9728,6 +10994,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -9736,6 +11003,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 96, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 72, @@ -9777,6 +11049,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -9785,6 +11058,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 96, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 72, @@ -9826,6 +11104,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -9834,6 +11113,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 96, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 72, @@ -9875,6 +11159,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1264, "file_f_inode_offset": 32, @@ -9883,6 +11168,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 80, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 88, @@ -9923,6 +11213,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1264, "file_f_inode_offset": 32, @@ -9931,6 +11222,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 80, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 88, @@ -9971,6 +11267,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1264, "file_f_inode_offset": 32, @@ -9979,6 +11276,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 80, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 88, @@ -10019,6 +11321,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1328, "file_f_inode_offset": 32, @@ -10027,6 +11330,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 80, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 88, @@ -10067,6 +11375,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1328, "file_f_inode_offset": 32, @@ -10075,6 +11384,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 80, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 88, @@ -10115,6 +11429,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -10123,6 +11438,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 80, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 72, @@ -10164,6 +11484,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -10172,6 +11493,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 80, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 72, @@ -10213,6 +11539,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -10221,6 +11548,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 80, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 72, @@ -10262,6 +11594,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -10270,6 +11603,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 88, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 72, @@ -10311,6 +11649,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -10319,6 +11658,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 88, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 72, @@ -10360,6 +11704,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -10368,6 +11713,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 88, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 72, @@ -10409,6 +11759,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -10417,6 +11768,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 96, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 72, @@ -10458,6 +11814,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -10466,6 +11823,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 96, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 72, @@ -10507,6 +11869,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -10515,6 +11878,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 96, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 72, @@ -10556,6 +11924,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -10564,6 +11933,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 96, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 72, @@ -10605,6 +11979,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -10613,6 +11988,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 96, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 72, @@ -10654,6 +12034,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -10662,6 +12043,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 96, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 72, @@ -10703,6 +12089,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -10711,6 +12098,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 96, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 72, @@ -10752,6 +12144,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -10760,6 +12153,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 96, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 72, @@ -10801,6 +12199,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1256, "file_f_inode_offset": 32, @@ -10809,6 +12208,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 96, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 72, @@ -10850,6 +12254,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1264, "file_f_inode_offset": 32, @@ -10858,6 +12263,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 80, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 88, @@ -10898,6 +12308,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1264, "file_f_inode_offset": 32, @@ -10906,6 +12317,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 80, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 88, @@ -10946,6 +12362,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1264, "file_f_inode_offset": 32, @@ -10954,6 +12371,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 80, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 88, @@ -10994,6 +12416,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1264, "file_f_inode_offset": 32, @@ -11002,6 +12425,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 80, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 88, @@ -11042,6 +12470,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1264, "file_f_inode_offset": 32, @@ -11050,6 +12479,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 80, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 88, @@ -11090,6 +12524,7 @@ "bpf_prog_type_offset": 4, "creds_cap_inheritable_offset": 40, "creds_uid_offset": 4, + "dentry_d_sb_offset": 104, "dentry_sb_offset": 104, "device_nd_net_net_offset": 1264, "file_f_inode_offset": 32, @@ -11098,6 +12533,11 @@ "flowi4_uli_offset": 48, "flowi6_saddr_offset": 56, "flowi6_uli_offset": 76, + "inode_ctime_offset": 120, + "inode_gid_offset": 8, + "inode_ino_offset": 64, + "inode_mtime_offset": 104, + "inode_nlink_offset": 72, "iokiocb_ctx_offset": 80, "kernel_clone_args_exit_signal_offset": 32, "linux_binprm_argc_offset": 88, @@ -18344,6 +19784,13 @@ "uname_release": "4.14.35-2047.542.2.el7uek.aarch64", "cindex": 89 }, + { + "distrib": "ol", + "version": "7", + "arch": "arm64", + "uname_release": "4.14.35-2047.543.3.el7uek.aarch64", + "cindex": 89 + }, { "distrib": "ol", "version": "7", diff --git a/pkg/security/probe/constantfetch/constant_names.go b/pkg/security/probe/constantfetch/constant_names.go index c5ee88a4452f6..80d8b57c04a25 100644 --- a/pkg/security/probe/constantfetch/constant_names.go +++ b/pkg/security/probe/constantfetch/constant_names.go @@ -28,8 +28,16 @@ const ( OffsetNameKernelCloneArgsExitSignal = "kernel_clone_args_exit_signal_offset" OffsetNameFileFinode = "file_f_inode_offset" OffsetNameFileFpath = "file_f_path_offset" + OffsetNameDentryDSb = "dentry_d_sb_offset" OffsetNameMountMntID = "mount_id_offset" + // inode + OffsetInodeIno = "inode_ino_offset" + OffsetInodeNlink = "inode_nlink_offset" + OffsetInodeGid = "inode_gid_offset" + OffsetInodeMtime = "inode_mtime_offset" + OffsetInodeCtime = "inode_ctime_offset" + // inode times OffsetNameInodeCtimeSec = "inode_ctime_sec_offset" OffsetNameInodeCtimeNsec = "inode_ctime_nsec_offset" diff --git a/pkg/security/probe/constantfetch/core.go b/pkg/security/probe/constantfetch/core.go index eba5beaea450f..39c0c794190ac 100644 --- a/pkg/security/probe/constantfetch/core.go +++ b/pkg/security/probe/constantfetch/core.go @@ -11,6 +11,7 @@ package constantfetch import ( "errors" "io" + "slices" "strings" "github.com/cilium/ebpf/btf" @@ -56,9 +57,10 @@ func (f *BTFConstantFetcher) String() string { } type constantRequest struct { - id string - sizeof bool - typeName, fieldName string + id string + sizeof bool + typeName string + fieldNames []string } func (f *BTFConstantFetcher) runRequest(r constantRequest) { @@ -89,7 +91,7 @@ func (f *BTFConstantFetcher) runRequest(r constantRequest) { } // AppendSizeofRequest appends a sizeof request -func (f *BTFConstantFetcher) AppendSizeofRequest(id, typeName, _ string) { +func (f *BTFConstantFetcher) AppendSizeofRequest(id, typeName string) { f.runRequest(constantRequest{ id: id, sizeof: true, @@ -98,12 +100,12 @@ func (f *BTFConstantFetcher) AppendSizeofRequest(id, typeName, _ string) { } // AppendOffsetofRequest appends an offset request -func (f *BTFConstantFetcher) AppendOffsetofRequest(id, typeName, fieldName, _ string) { +func (f *BTFConstantFetcher) AppendOffsetofRequest(id, typeName string, fieldNames ...string) { f.runRequest(constantRequest{ - id: id, - sizeof: false, - typeName: getActualTypeName(typeName), - fieldName: fieldName, + id: id, + sizeof: false, + typeName: getActualTypeName(typeName), + fieldNames: fieldNames, }) } @@ -150,7 +152,7 @@ func runRequestOnBTFTypeStructOrUnion(r constantRequest, size uint32, members [] } } - if m.Name == r.fieldName { + if slices.Contains(r.fieldNames, m.Name) { return uint64(m.Offset.Bytes()) } } diff --git a/pkg/security/probe/constantfetch/fallback.go b/pkg/security/probe/constantfetch/fallback.go index 468a5f54c84d4..cc47a7b378133 100644 --- a/pkg/security/probe/constantfetch/fallback.go +++ b/pkg/security/probe/constantfetch/fallback.go @@ -139,23 +139,35 @@ func (f *FallbackConstantFetcher) appendRequest(id string) { value = getFileFinodeOffset(f.kernelVersion) case OffsetNameFileFpath: value = getFileFpathOffset(f.kernelVersion) + case OffsetNameDentryDSb: + value = getDentryDsbOffset(f.kernelVersion) case OffsetNameMountMntID: value = getMountIDOffset(f.kernelVersion) case OffsetNameRenameStructOldDentry: value = getRenameStructOldDentryOffset(f.kernelVersion) case OffsetNameRenameStructNewDentry: value = getRenameStructNewDentryOffset(f.kernelVersion) + case OffsetInodeIno: + value = getInodeInoOffset(f.kernelVersion) + case OffsetInodeGid: + value = getInodeGIDOffset(f.kernelVersion) + case OffsetInodeNlink: + value = getInodeNlinkOffset(f.kernelVersion) + case OffsetInodeMtime: + value = getInodeMtimeOffset(f.kernelVersion) + case OffsetInodeCtime: + value = getInodeCtimeOffset(f.kernelVersion) } f.res[id] = value } // AppendSizeofRequest appends a sizeof request -func (f *FallbackConstantFetcher) AppendSizeofRequest(id, _, _ string) { +func (f *FallbackConstantFetcher) AppendSizeofRequest(id, _ string) { f.appendRequest(id) } // AppendOffsetofRequest appends an offset request -func (f *FallbackConstantFetcher) AppendOffsetofRequest(id, _, _, _ string) { +func (f *FallbackConstantFetcher) AppendOffsetofRequest(id, _ string, _ ...string) { f.appendRequest(id) } @@ -234,6 +246,26 @@ func getSizeOfStructInode(kv *kernel.Version) uint64 { return sizeOf } +func getInodeInoOffset(_ *kernel.Version) uint64 { + return uint64(64) +} + +func getInodeGIDOffset(_ *kernel.Version) uint64 { + return uint64(8) +} + +func getInodeNlinkOffset(_ *kernel.Version) uint64 { + return uint64(72) +} + +func getInodeMtimeOffset(_ *kernel.Version) uint64 { + return uint64(104) +} + +func getInodeCtimeOffset(_ *kernel.Version) uint64 { + return uint64(120) +} + func getSuperBlockFlagsOffset(_ *kernel.Version) uint64 { return uint64(80) } @@ -1013,6 +1045,10 @@ func getFileFpathOffset(kv *kernel.Version) uint64 { } } +func getDentryDsbOffset(_ *kernel.Version) uint64 { + return 104 +} + func getMountIDOffset(kv *kernel.Version) uint64 { switch { case kv.IsSuseKernel() || kv.Code >= kernel.Kernel5_12: diff --git a/pkg/security/probe/constantfetch/fetcher.go b/pkg/security/probe/constantfetch/fetcher.go index cfde02df17e2f..f3b5c4445976d 100644 --- a/pkg/security/probe/constantfetch/fetcher.go +++ b/pkg/security/probe/constantfetch/fetcher.go @@ -26,8 +26,8 @@ const ErrorSentinel uint64 = ^uint64(0) // eBPF relocations type ConstantFetcher interface { fmt.Stringer - AppendSizeofRequest(id, typeName, headerName string) - AppendOffsetofRequest(id, typeName, fieldName, headerName string) + AppendSizeofRequest(id, typeName string) + AppendOffsetofRequest(id, typeName string, fieldName ...string) FinishAndGetResults() (map[string]uint64, error) } @@ -56,30 +56,28 @@ func (f *ComposeConstantFetcher) appendRequest(req *composeRequest) { f.requests = append(f.requests, req) _, _ = io.WriteString(f.hasher, req.id) _, _ = io.WriteString(f.hasher, req.typeName) - _, _ = io.WriteString(f.hasher, req.fieldName) - _, _ = io.WriteString(f.hasher, req.headerName) + for _, fn := range req.fieldNames { + _, _ = io.WriteString(f.hasher, fn) + } } // AppendSizeofRequest appends a sizeof request -func (f *ComposeConstantFetcher) AppendSizeofRequest(id, typeName, headerName string) { +func (f *ComposeConstantFetcher) AppendSizeofRequest(id, typeName string) { f.appendRequest(&composeRequest{ - id: id, - sizeof: true, - typeName: typeName, - fieldName: "", - headerName: headerName, - value: ErrorSentinel, + id: id, + sizeof: true, + typeName: typeName, + value: ErrorSentinel, }) } // AppendOffsetofRequest appends an offset request -func (f *ComposeConstantFetcher) AppendOffsetofRequest(id, typeName, fieldName, headerName string) { +func (f *ComposeConstantFetcher) AppendOffsetofRequest(id, typeName string, fieldNames ...string) { f.appendRequest(&composeRequest{ id: id, sizeof: false, typeName: typeName, - fieldName: fieldName, - headerName: headerName, + fieldNames: fieldNames, value: ErrorSentinel, }) } @@ -98,9 +96,9 @@ func (f *ComposeConstantFetcher) fillConstantCacheIfNeeded() { for _, req := range f.requests { if req.value == ErrorSentinel { if req.sizeof { - fetcher.AppendSizeofRequest(req.id, req.typeName, req.headerName) + fetcher.AppendSizeofRequest(req.id, req.typeName) } else { - fetcher.AppendOffsetofRequest(req.id, req.typeName, req.fieldName, req.headerName) + fetcher.AppendOffsetofRequest(req.id, req.typeName, req.fieldNames...) } } } @@ -163,12 +161,12 @@ type ConstantFetcherStatus struct { } type composeRequest struct { - id string - sizeof bool - typeName, fieldName string - headerName string - value uint64 - fetcherName string + id string + sizeof bool + typeName string + fieldNames []string + value uint64 + fetcherName string } // CreateConstantEditors creates constant editors based on the constants fetched diff --git a/pkg/security/probe/constantfetch/offset_guesser.go b/pkg/security/probe/constantfetch/offset_guesser.go index 903aa95b81a52..22634f17cedf2 100644 --- a/pkg/security/probe/constantfetch/offset_guesser.go +++ b/pkg/security/probe/constantfetch/offset_guesser.go @@ -10,12 +10,10 @@ package constantfetch import ( "errors" - "math" "os" "os/exec" manager "github.com/DataDog/ebpf-manager" - "golang.org/x/sys/unix" ddebpf "github.com/DataDog/datadog-agent/pkg/ebpf" "github.com/DataDog/datadog-agent/pkg/security/ebpf" @@ -160,11 +158,11 @@ func (og *OffsetGuesser) guess(id string) error { } // AppendSizeofRequest appends a sizeof request -func (og *OffsetGuesser) AppendSizeofRequest(_, _, _ string) { +func (og *OffsetGuesser) AppendSizeofRequest(_, _ string) { } // AppendOffsetofRequest appends an offset request -func (og *OffsetGuesser) AppendOffsetofRequest(id, _, _, _ string) { +func (og *OffsetGuesser) AppendOffsetofRequest(id, _ string, _ ...string) { og.res[id] = ErrorSentinel } @@ -186,10 +184,7 @@ func (og *OffsetGuesser) FinishAndGetResults() (map[string]uint64, error) { Value: uint64(utils.Getpid()), }, }, - RLimit: &unix.Rlimit{ - Cur: math.MaxUint64, - Max: math.MaxUint64, - }, + RemoveRlimit: true, } for _, probe := range probes.AllProbes(true) { diff --git a/pkg/security/probe/constantfetch/runtime_compiled.go b/pkg/security/probe/constantfetch/runtime_compiled.go deleted file mode 100644 index c847ab821e9a4..0000000000000 --- a/pkg/security/probe/constantfetch/runtime_compiled.go +++ /dev/null @@ -1,178 +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 && linux_bpf - -// Package constantfetch holds constantfetch related files -package constantfetch - -import ( - "bytes" - "errors" - "fmt" - "sort" - "text/template" - - "github.com/DataDog/datadog-go/v5/statsd" - - "github.com/DataDog/datadog-agent/pkg/ebpf" - "github.com/DataDog/datadog-agent/pkg/ebpf/bytecode/runtime" - "github.com/DataDog/datadog-agent/pkg/security/seclog" - "github.com/DataDog/datadog-agent/pkg/util/safeelf" -) - -type rcSymbolPair struct { - ID string - Operation string -} - -// RuntimeCompilationConstantFetcher is a constant fetcher utilizing runtime compilation -type RuntimeCompilationConstantFetcher struct { - config *ebpf.Config - statsdClient statsd.ClientInterface - headers []string - symbolPairs []rcSymbolPair - result map[string]uint64 -} - -// NewRuntimeCompilationConstantFetcher creates a RuntimeCompilationConstantFetcher -func NewRuntimeCompilationConstantFetcher(config *ebpf.Config, statsdClient statsd.ClientInterface) *RuntimeCompilationConstantFetcher { - return &RuntimeCompilationConstantFetcher{ - config: config, - statsdClient: statsdClient, - result: make(map[string]uint64), - } -} - -func (cf *RuntimeCompilationConstantFetcher) String() string { - return "runtime-compilation" -} - -// AppendSizeofRequest appends a sizeof request -func (cf *RuntimeCompilationConstantFetcher) AppendSizeofRequest(id, typeName, headerName string) { - cf.result[id] = ErrorSentinel - if headerName == "" { - return - } - - cf.headers = append(cf.headers, headerName) - cf.symbolPairs = append(cf.symbolPairs, rcSymbolPair{ - ID: id, - Operation: fmt.Sprintf("sizeof(%s)", typeName), - }) -} - -// AppendOffsetofRequest appends an offset request -func (cf *RuntimeCompilationConstantFetcher) AppendOffsetofRequest(id, typeName, fieldName, headerName string) { - cf.result[id] = ErrorSentinel - if headerName == "" { - return - } - - cf.headers = append(cf.headers, headerName) - cf.symbolPairs = append(cf.symbolPairs, rcSymbolPair{ - ID: id, - Operation: fmt.Sprintf("offsetof(%s, %s)", typeName, fieldName), - }) -} - -const runtimeCompilationTemplate = ` -#include -#ifdef CONFIG_HAVE_ARCH_COMPILER_H -#include -#endif -{{ range .headers }} -#include <{{ . }}> -{{ end }} - -{{ range .symbols }} -size_t {{.ID}} = {{.Operation}}; -{{ end }} -` - -func (cf *RuntimeCompilationConstantFetcher) getCCode() (string, error) { - headers := sortAndDedup(cf.headers) - tmpl, err := template.New("runtimeCompilationTemplate").Parse(runtimeCompilationTemplate) - if err != nil { - return "", err - } - - var buffer bytes.Buffer - if err := tmpl.Execute(&buffer, map[string]interface{}{ - "headers": headers, - "symbols": cf.symbolPairs, - }); err != nil { - return "", err - } - - return buffer.String(), nil -} - -// FinishAndGetResults returns the results -func (cf *RuntimeCompilationConstantFetcher) FinishAndGetResults() (map[string]uint64, error) { - cCode, err := cf.getCCode() - if err != nil { - return nil, err - } - - elfFile, err := runtime.ConstantFetcher.Compile(cf.config, cCode, nil, cf.statsdClient) - if err != nil { - return nil, err - } - - f, err := safeelf.NewFile(elfFile) - if err != nil { - return nil, err - } - - symbols, err := f.Symbols() - if err != nil { - return nil, err - } - for _, sym := range symbols { - if _, present := cf.result[sym.Name]; !present { - continue - } - - section := f.Sections[sym.Section] - if section.ReaderAt == nil { - return nil, errors.New("section not available in random-access form") - } - buf := make([]byte, sym.Size) - if _, err := section.ReadAt(buf, int64(sym.Value)); err != nil { - return nil, fmt.Errorf("unable to read section at %d: %s", int64(sym.Value), err) - } - - var value uint64 - switch sym.Size { - case 4: - value = uint64(f.ByteOrder.Uint32(buf)) - case 8: - value = f.ByteOrder.Uint64(buf) - default: - return nil, fmt.Errorf("unexpected symbol size: `%v`", sym.Size) - } - - cf.result[sym.Name] = value - } - - seclog.Infof("runtime compiled constants: %v", cf.result) - return cf.result, nil -} - -func sortAndDedup(in []string) []string { - // sort and dedup headers - set := make(map[string]bool) - for _, value := range in { - set[value] = true - } - - out := make([]string, 0, len(in)) - for value := range set { - out = append(out, value) - } - sort.Strings(out) - return out -} diff --git a/pkg/security/probe/field_handlers_ebpf.go b/pkg/security/probe/field_handlers_ebpf.go index 36acd3a33d5a2..63215156e4a19 100644 --- a/pkg/security/probe/field_handlers_ebpf.go +++ b/pkg/security/probe/field_handlers_ebpf.go @@ -20,7 +20,7 @@ import ( "github.com/DataDog/datadog-agent/pkg/security/resolvers" sprocess "github.com/DataDog/datadog-agent/pkg/security/resolvers/process" "github.com/DataDog/datadog-agent/pkg/security/secl/containerutils" - "github.com/DataDog/datadog-agent/pkg/security/seclog" + "github.com/DataDog/datadog-agent/pkg/security/utils" "github.com/DataDog/datadog-agent/pkg/security/secl/args" "github.com/DataDog/datadog-agent/pkg/security/secl/model" @@ -231,7 +231,7 @@ func (fh *EBPFFieldHandlers) ResolveRights(_ *model.Event, e *model.FileFields) return int(e.Mode) & (syscall.S_ISUID | syscall.S_ISGID | syscall.S_ISVTX | syscall.S_IRWXU | syscall.S_IRWXG | syscall.S_IRWXO) } -// ResolveChownUID resolves the ResolveProcessCacheEntry id of a chown event to a username +// ResolveChownUID resolves the user id of a chown event to a username func (fh *EBPFFieldHandlers) ResolveChownUID(ev *model.Event, e *model.ChownEvent) string { if len(e.User) == 0 { e.User, _ = fh.resolvers.UserGroupResolver.ResolveUser(int(e.UID), ev.ContainerContext.ContainerID) @@ -516,11 +516,9 @@ func (fh *EBPFFieldHandlers) ResolveCGroupID(ev *model.Event, e *model.CGroupCon return string(entry.CGroup.CGroupID) } - if err := fh.resolvers.ResolveCGroup(entry, e.CGroupFile, e.CGroupFlags); err != nil { - seclog.Debugf("Failed to resolve cgroup: %s", err) + if cgroupContext, err := fh.resolvers.ResolveCGroupContext(e.CGroupFile, e.CGroupFlags); err == nil { + *e = *cgroupContext } - - e.CGroupID = entry.CGroup.CGroupID } } @@ -734,3 +732,17 @@ func (fh *EBPFFieldHandlers) ResolveOnDemandArg4Str(_ *model.Event, e *model.OnD func (fh *EBPFFieldHandlers) ResolveOnDemandArg4Uint(_ *model.Event, e *model.OnDemandEvent) int { return int(binary.NativeEndian.Uint64(e.Data[192 : 192+8])) } + +// ResolveProcessNSID resolves the process namespace ID +func (fh *EBPFFieldHandlers) ResolveProcessNSID(e *model.Event) (uint64, error) { + if e.ProcessCacheEntry.Process.NSID != 0 { + return e.ProcessCacheEntry.Process.NSID, nil + } + + nsid, err := utils.GetProcessPidNamespace(e.ProcessCacheEntry.Process.Pid) + if err != nil { + return 0, err + } + e.ProcessCacheEntry.Process.NSID = nsid + return nsid, nil +} 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_ebpf.go b/pkg/security/probe/probe_ebpf.go index c51e920adf851..399d04870e67e 100644 --- a/pkg/security/probe/probe_ebpf.go +++ b/pkg/security/probe/probe_ebpf.go @@ -818,7 +818,14 @@ func (p *EBPFProbe) handleEvent(CPU int, data []byte) { return } - p.profileManagers.activityDumpManager.HandleCGroupTracingEvent(&event.CgroupTracing) + cgroupContext, err := p.Resolvers.ResolveCGroupContext(event.CgroupTracing.CGroupContext.CGroupFile, containerutils.CGroupFlags(event.CgroupTracing.CGroupContext.CGroupFlags)) + if err != nil { + seclog.Debugf("Failed to resolve cgroup: %s", err) + } else { + event.CgroupTracing.CGroupContext = *cgroupContext + p.profileManagers.activityDumpManager.HandleCGroupTracingEvent(&event.CgroupTracing) + } + return case model.CgroupWriteEventType: if _, err = event.CgroupWrite.UnmarshalBinary(data[offset:]); err != nil { @@ -828,10 +835,21 @@ func (p *EBPFProbe) handleEvent(CPU int, data []byte) { pce := p.Resolvers.ProcessResolver.Resolve(event.CgroupWrite.Pid, event.CgroupWrite.Pid, 0, false, newEntryCb) if pce != nil { - if err := p.Resolvers.ResolveCGroup(pce, event.CgroupWrite.File.PathKey, containerutils.CGroupFlags(event.CgroupWrite.CGroupFlags)); err != nil { + cgroupContext, err := p.Resolvers.ResolveCGroupContext(event.CgroupWrite.File.PathKey, containerutils.CGroupFlags(event.CgroupWrite.CGroupFlags)) + if err != nil { seclog.Debugf("Failed to resolve cgroup: %s", err) + } else { + pce.Process.CGroup = *cgroupContext + pce.CGroup = *cgroupContext + + if cgroupContext.CGroupFlags.IsContainer() { + containerID, _ := containerutils.FindContainerID(cgroupContext.CGroupID) + pce.ContainerID = containerID + pce.Process.ContainerID = containerID + } } } + return case model.UnshareMountNsEventType: if _, err = event.UnshareMountNS.UnmarshalBinary(data[offset:]); err != nil { @@ -864,14 +882,10 @@ func (p *EBPFProbe) handleEvent(CPU int, data []byte) { return } - if process.IsKThread(event.ProcessCacheEntry.PPid, event.ProcessCacheEntry.Pid) { + if err := p.Resolvers.ProcessResolver.AddForkEntry(event, newEntryCb); err != nil { + seclog.Errorf("failed to insert fork event: %s (pid %d, offset %d, len %d)", err, event.PIDContext.Pid, offset, len(data)) return } - - p.Resolvers.ProcessResolver.ApplyBootTime(event.ProcessCacheEntry) - event.ProcessCacheEntry.SetSpan(event.SpanContext.SpanID, event.SpanContext.TraceID) - - p.Resolvers.ProcessResolver.AddForkEntry(event.ProcessCacheEntry, event.PIDContext.ExecInode, newEntryCb) case model.ExecEventType: // unmarshal and fill event.processCacheEntry if _, err = p.unmarshalProcessCacheEntry(event, data[offset:]); err != nil { @@ -879,18 +893,12 @@ func (p *EBPFProbe) handleEvent(CPU int, data []byte) { return } - if err = p.Resolvers.ProcessResolver.ResolveNewProcessCacheEntry(event.ProcessCacheEntry, event.ContainerContext); err != nil { - seclog.Debugf("failed to resolve new process cache entry context for pid %d: %s", event.PIDContext.Pid, err) - - var errResolution *path.ErrPathResolution - if errors.As(err, &errResolution) { - event.SetPathResolutionError(&event.ProcessCacheEntry.FileEvent, err) - } - } else { - p.Resolvers.ProcessResolver.AddExecEntry(event.ProcessCacheEntry, event.PIDContext.ExecInode) + err = p.Resolvers.ProcessResolver.AddExecEntry(event) + if err != nil { + seclog.Errorf("failed to insert exec event: %s (pid %d, offset %d, len %d)", err, event.PIDContext.Pid, offset, len(data)) + return } - event.Exec.Process = &event.ProcessCacheEntry.Process } if !p.setProcessContext(eventType, event, newEntryCb) { @@ -1001,26 +1009,13 @@ func (p *EBPFProbe) handleEvent(CPU int, data []byte) { seclog.Errorf("failed to decode exit event: %s (offset %d, len %d)", err, offset, len(data)) return } - - var exists bool - event.ProcessCacheEntry, exists = p.fieldHandlers.GetProcessCacheEntry(event, newEntryCb) - if !exists { - // no need to dispatch an exit event that don't have the corresponding cache entry - return + exists := p.Resolvers.ProcessResolver.ApplyExitEntry(event, newEntryCb) + if exists { + p.Resolvers.MountResolver.DelPid(event.Exit.Pid) + // update action reports + p.processKiller.HandleProcessExited(event) + p.fileHasher.HandleProcessExited(event) } - - // Use the event timestamp as exit time - // The local process cache hasn't been updated yet with the exit time when the exit event is first seen - // The pid_cache kernel map has the exit_time but it's only accessed if there's a local miss - event.ProcessCacheEntry.Process.ExitTime = p.fieldHandlers.ResolveEventTime(event, &event.BaseEvent) - event.Exit.Process = &event.ProcessCacheEntry.Process - - // update mount pid mapping - p.Resolvers.MountResolver.DelPid(event.Exit.Pid) - - // update action reports - p.processKiller.HandleProcessExited(event) - p.fileHasher.HandleProcessExited(event) case model.SetuidEventType: // the process context may be incorrect, do not modify it if event.Error != nil { @@ -1095,9 +1090,17 @@ func (p *EBPFProbe) handleEvent(CPU int, data []byte) { if containerID == "" && event.PTrace.Request != unix.PTRACE_ATTACH { pidToResolve = event.PTrace.NSPID } else { - pid, err := utils.TryToResolveTraceePid(event.ProcessContext.Process.Pid, event.PTrace.NSPID) + nsid, err := p.fieldHandlers.ResolveProcessNSID(event) + if err != nil { + seclog.Debugf("PTrace NSID resolution error for process %s in container %s: %v", + event.ProcessContext.Process.FileEvent.PathnameStr, containerID, err) + return + } + + pid, err := utils.TryToResolveTraceePid(event.ProcessContext.Process.Pid, nsid, event.PTrace.NSPID) if err != nil { - seclog.Errorf("PTrace err: %v", err) + seclog.Debugf("PTrace tracee resolution error for process %s in container %s: %v", + event.ProcessContext.Process.FileEvent.PathnameStr, containerID, err) return } pidToResolve = pid @@ -1991,8 +1994,6 @@ func NewEBPFProbe(probe *Probe, config *config.Config, opts Opts) (*EBPFProbe, e p.supportsBPFSendSignal = p.kernelVersion.SupportBPFSendSignal() - p.ensureConfigDefaults() - p.monitors = NewEBPFMonitors(p) p.numCPU, err = utils.NumCPU() @@ -2249,13 +2250,6 @@ func (p *EBPFProbe) GetProfileManagers() *SecurityProfileManagers { return p.profileManagers } -func (p *EBPFProbe) ensureConfigDefaults() { - // enable runtime compiled constants on COS by default - if !p.config.Probe.RuntimeCompiledConstantsIsSet && p.kernelVersion.IsCOSKernel() { - p.config.Probe.RuntimeCompiledConstantsEnabled = true - } -} - const ( netStructHasProcINum uint64 = 0 netStructHasNS uint64 = 1 @@ -2338,6 +2332,10 @@ func getOvlPathInOvlInode(kernelVersion *kernel.Version) uint64 { return 2 } + if kernelVersion.IsInRangeCloseOpen(kernel.Kernel5_14, kernel.Kernel5_15) && kernelVersion.IsRH9_4Kernel() { + return 2 + } + // https://github.com/torvalds/linux/commit/ffa5723c6d259b3191f851a50a98d0352b345b39 // changes a bit how the lower dentry/inode is stored in `ovl_inode`. To check if we // are in this configuration we first probe the kernel version, then we check for the @@ -2380,123 +2378,131 @@ func getCGroupWriteConstants() manager.ConstantEditor { // GetOffsetConstants returns the offsets and struct sizes constants func (p *EBPFProbe) GetOffsetConstants() (map[string]uint64, error) { - constantFetcher := constantfetch.ComposeConstantFetchers(constantfetch.GetAvailableConstantFetchers(p.config.Probe, p.kernelVersion, p.statsdClient)) + constantFetcher := constantfetch.ComposeConstantFetchers(constantfetch.GetAvailableConstantFetchers(p.config.Probe, p.kernelVersion)) AppendProbeRequestsToFetcher(constantFetcher, p.kernelVersion) return constantFetcher.FinishAndGetResults() } // GetConstantFetcherStatus returns the status of the constant fetcher associated with this probe func (p *EBPFProbe) GetConstantFetcherStatus() (*constantfetch.ConstantFetcherStatus, error) { - constantFetcher := constantfetch.ComposeConstantFetchers(constantfetch.GetAvailableConstantFetchers(p.config.Probe, p.kernelVersion, p.statsdClient)) + constantFetcher := constantfetch.ComposeConstantFetchers(constantfetch.GetAvailableConstantFetchers(p.config.Probe, p.kernelVersion)) AppendProbeRequestsToFetcher(constantFetcher, p.kernelVersion) return constantFetcher.FinishAndGetStatus() } // AppendProbeRequestsToFetcher returns the offsets and struct sizes constants, from a constant fetcher func AppendProbeRequestsToFetcher(constantFetcher constantfetch.ConstantFetcher, kv *kernel.Version) { - constantFetcher.AppendSizeofRequest(constantfetch.SizeOfInode, "struct inode", "linux/fs.h") - constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameSuperBlockStructSFlags, "struct super_block", "s_flags", "linux/fs.h") - constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameSuperBlockStructSMagic, "struct super_block", "s_magic", "linux/fs.h") - constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameDentryStructDSB, "struct dentry", "d_sb", "linux/dcache.h") - constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameSignalStructStructTTY, "struct signal_struct", "tty", "linux/sched/signal.h") - constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameTTYStructStructName, "struct tty_struct", "name", "linux/tty.h") - constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameCredStructUID, "struct cred", "uid", "linux/cred.h") - constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameCredStructCapInheritable, "struct cred", "cap_inheritable", "linux/cred.h") - constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameLinuxBinprmP, "struct linux_binprm", "p", "linux/binfmts.h") - constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameLinuxBinprmArgc, "struct linux_binprm", "argc", "linux/binfmts.h") - constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameLinuxBinprmEnvc, "struct linux_binprm", "envc", "linux/binfmts.h") - constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameVMAreaStructFlags, "struct vm_area_struct", "vm_flags", "linux/mm_types.h") - constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameFileFinode, "struct file", "f_inode", "linux/fs.h") - constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameFileFpath, "struct file", "f_path", "linux/fs.h") - constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameMountMntID, "struct mount", "mnt_id", "") + constantFetcher.AppendSizeofRequest(constantfetch.SizeOfInode, "struct inode") + constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameSuperBlockStructSFlags, "struct super_block", "s_flags") + constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameSuperBlockStructSMagic, "struct super_block", "s_magic") + constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameDentryStructDSB, "struct dentry", "d_sb") + constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameSignalStructStructTTY, "struct signal_struct", "tty") + constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameTTYStructStructName, "struct tty_struct", "name") + constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameCredStructUID, "struct cred", "uid") + constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameCredStructCapInheritable, "struct cred", "cap_inheritable") + constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameLinuxBinprmP, "struct linux_binprm", "p") + constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameLinuxBinprmArgc, "struct linux_binprm", "argc") + constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameLinuxBinprmEnvc, "struct linux_binprm", "envc") + constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameVMAreaStructFlags, "struct vm_area_struct", "vm_flags") + constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameFileFinode, "struct file", "f_inode") + constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameFileFpath, "struct file", "f_path") + constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameDentryDSb, "struct dentry", "d_sb") + constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameMountMntID, "struct mount", "mnt_id") if kv.Code >= kernel.Kernel5_3 { - constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameKernelCloneArgsExitSignal, "struct kernel_clone_args", "exit_signal", "linux/sched/task.h") + constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameKernelCloneArgsExitSignal, "struct kernel_clone_args", "exit_signal") } // inode time offsets // no runtime compilation for those, we expect them to default to 0 if not there and use the fallback // in the eBPF code itself in that case if kv.Code >= kernel.Kernel6_11 { - constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameInodeCtimeSec, "struct inode", "i_ctime_sec", "") - constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameInodeCtimeNsec, "struct inode", "i_ctime_nsec", "") - constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameInodeMtimeSec, "struct inode", "i_mtime_sec", "") - constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameInodeMtimeNsec, "struct inode", "i_mtime_nsec", "") + constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameInodeCtimeSec, "struct inode", "i_ctime_sec") + constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameInodeCtimeNsec, "struct inode", "i_ctime_nsec") + constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameInodeMtimeSec, "struct inode", "i_mtime_sec") + constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameInodeMtimeNsec, "struct inode", "i_mtime_nsec") } // rename offsets if kv.Code >= kernel.Kernel5_12 || (kv.IsInRangeCloseOpen(kernel.Kernel5_10, kernel.Kernel5_11) && kv.Code.Patch() >= 220) { - constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameRenameStructOldDentry, "struct renamedata", "old_dentry", "linux/fs.h") - constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameRenameStructNewDentry, "struct renamedata", "new_dentry", "linux/fs.h") + constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameRenameStructOldDentry, "struct renamedata", "old_dentry") + constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameRenameStructNewDentry, "struct renamedata", "new_dentry") } // bpf offsets - constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameBPFMapStructID, "struct bpf_map", "id", "linux/bpf.h") + constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameBPFMapStructID, "struct bpf_map", "id") if kv.Code != 0 && (kv.Code >= kernel.Kernel4_15 || kv.IsRH7Kernel()) { - constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameBPFMapStructName, "struct bpf_map", "name", "linux/bpf.h") + constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameBPFMapStructName, "struct bpf_map", "name") } - constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameBPFMapStructMapType, "struct bpf_map", "map_type", "linux/bpf.h") - constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameBPFProgAuxStructID, "struct bpf_prog_aux", "id", "linux/bpf.h") + constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameBPFMapStructMapType, "struct bpf_map", "map_type") + constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameBPFProgAuxStructID, "struct bpf_prog_aux", "id") if kv.Code != 0 && (kv.Code >= kernel.Kernel4_15 || kv.IsRH7Kernel()) { - constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameBPFProgAuxStructName, "struct bpf_prog_aux", "name", "linux/bpf.h") + constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameBPFProgAuxStructName, "struct bpf_prog_aux", "name") } - constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameBPFProgStructTag, "struct bpf_prog", "tag", "linux/filter.h") - constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameBPFProgStructAux, "struct bpf_prog", "aux", "linux/filter.h") - constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameBPFProgStructType, "struct bpf_prog", "type", "linux/filter.h") + constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameBPFProgStructTag, "struct bpf_prog", "tag") + constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameBPFProgStructAux, "struct bpf_prog", "aux") + constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameBPFProgStructType, "struct bpf_prog", "type") if kv.Code != 0 && (kv.Code > kernel.Kernel4_16 || kv.IsSuse12Kernel() || kv.IsSuse15Kernel()) { - constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameBPFProgStructExpectedAttachType, "struct bpf_prog", "expected_attach_type", "linux/filter.h") + constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameBPFProgStructExpectedAttachType, "struct bpf_prog", "expected_attach_type") } // namespace nr offsets - constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNamePIDStructLevel, "struct pid", "level", "linux/pid.h") - constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNamePIDStructNumbers, "struct pid", "numbers", "linux/pid.h") - constantFetcher.AppendSizeofRequest(constantfetch.SizeOfUPID, "struct upid", "linux/pid.h") + constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNamePIDStructLevel, "struct pid", "level") + constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNamePIDStructNumbers, "struct pid", "numbers") + constantFetcher.AppendSizeofRequest(constantfetch.SizeOfUPID, "struct upid") if kv.HavePIDLinkStruct() { - constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameTaskStructPIDLink, "struct task_struct", "pids", "linux/sched.h") - constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNamePIDLinkStructPID, "struct pid_link", "pid", "linux/pid.h") + constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameTaskStructPIDLink, "struct task_struct", "pids") + constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNamePIDLinkStructPID, "struct pid_link", "pid") } else { - constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameTaskStructPID, "struct task_struct", "thread_pid", "linux/sched.h") + constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameTaskStructPID, "struct task_struct", "thread_pid") } // splice event - constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNamePipeInodeInfoStructBufs, "struct pipe_inode_info", "bufs", "linux/pipe_fs_i.h") + constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNamePipeInodeInfoStructBufs, "struct pipe_inode_info", "bufs") if kv.HaveLegacyPipeInodeInfoStruct() { - constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNamePipeInodeInfoStructNrbufs, "struct pipe_inode_info", "nrbufs", "linux/pipe_fs_i.h") - constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNamePipeInodeInfoStructCurbuf, "struct pipe_inode_info", "curbuf", "linux/pipe_fs_i.h") - constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNamePipeInodeInfoStructBuffers, "struct pipe_inode_info", "buffers", "linux/pipe_fs_i.h") + constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNamePipeInodeInfoStructNrbufs, "struct pipe_inode_info", "nrbufs") + constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNamePipeInodeInfoStructCurbuf, "struct pipe_inode_info", "curbuf") + constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNamePipeInodeInfoStructBuffers, "struct pipe_inode_info", "buffers") } else { - constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNamePipeInodeInfoStructHead, "struct pipe_inode_info", "head", "linux/pipe_fs_i.h") - constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNamePipeInodeInfoStructRingsize, "struct pipe_inode_info", "ring_size", "linux/pipe_fs_i.h") + constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNamePipeInodeInfoStructHead, "struct pipe_inode_info", "head") + constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNamePipeInodeInfoStructRingsize, "struct pipe_inode_info", "ring_size") } // network related constants - constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameNetDeviceStructIfIndex, "struct net_device", "ifindex", "linux/netdevice.h") - constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameNetDeviceStructName, "struct net_device", "name", "linux/netdevice.h") - constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameDeviceStructNdNet, "struct net_device", "nd_net", "linux/netdevice.h") - constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameSockCommonStructSKCNet, "struct sock_common", "skc_net", "net/sock.h") - constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameSockCommonStructSKCFamily, "struct sock_common", "skc_family", "net/sock.h") - constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameFlowI4StructSADDR, "struct flowi4", "saddr", "net/flow.h") - constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameFlowI4StructULI, "struct flowi4", "uli", "net/flow.h") - constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameFlowI6StructSADDR, "struct flowi6", "saddr", "net/flow.h") - constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameFlowI6StructULI, "struct flowi6", "uli", "net/flow.h") - constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameSocketStructSK, "struct socket", "sk", "linux/net.h") + constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameNetDeviceStructIfIndex, "struct net_device", "ifindex") + constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameNetDeviceStructName, "struct net_device", "name") + constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameDeviceStructNdNet, "struct net_device", "nd_net") + constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameSockCommonStructSKCNet, "struct sock_common", "skc_net") + constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameSockCommonStructSKCFamily, "struct sock_common", "skc_family") + constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameFlowI4StructSADDR, "struct flowi4", "saddr") + constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameFlowI4StructULI, "struct flowi4", "uli") + constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameFlowI6StructSADDR, "struct flowi6", "saddr") + constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameFlowI6StructULI, "struct flowi6", "uli") + constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameSocketStructSK, "struct socket", "sk") // Interpreter constants - constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameLinuxBinprmStructFile, "struct linux_binprm", "file", "linux/binfmts.h") + constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameLinuxBinprmStructFile, "struct linux_binprm", "file") if !kv.IsRH7Kernel() { - constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameNFConnStructCTNet, "struct nf_conn", "ct_net", "net/netfilter/nf_conntrack.h") + constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameNFConnStructCTNet, "struct nf_conn", "ct_net") } if getNetStructType(kv) == netStructHasProcINum { - constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameNetStructProcInum, "struct net", "proc_inum", "net/net_namespace.h") + constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameNetStructProcInum, "struct net", "proc_inum") } else { - constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameNetStructNS, "struct net", "ns", "net/net_namespace.h") + constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameNetStructNS, "struct net", "ns") } // iouring if kv.Code != 0 && (kv.Code >= kernel.Kernel5_1) { - constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameIoKiocbStructCtx, "struct io_kiocb", "ctx", "") + constantFetcher.AppendOffsetofRequest(constantfetch.OffsetNameIoKiocbStructCtx, "struct io_kiocb", "ctx") } + + // inode + constantFetcher.AppendOffsetofRequest(constantfetch.OffsetInodeIno, "struct inode", "i_ino") + constantFetcher.AppendOffsetofRequest(constantfetch.OffsetInodeGid, "struct inode", "i_gid") + constantFetcher.AppendOffsetofRequest(constantfetch.OffsetInodeNlink, "struct inode", "i_nlink") + constantFetcher.AppendOffsetofRequest(constantfetch.OffsetInodeMtime, "struct inode", "i_mtime", "__i_mtime") + constantFetcher.AppendOffsetofRequest(constantfetch.OffsetInodeCtime, "struct inode", "i_ctime", "__i_ctime") } // HandleActions handles the rule actions 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/process_list/process_list.go b/pkg/security/process_list/process_list.go index 1fdb4a80bd70b..64c76705a553f 100644 --- a/pkg/security/process_list/process_list.go +++ b/pkg/security/process_list/process_list.go @@ -14,9 +14,8 @@ import ( "io" "sync" - cgroupModel "github.com/DataDog/datadog-agent/pkg/security/resolvers/cgroup/model" - "github.com/DataDog/datadog-agent/pkg/process/procutil" + cgroupModel "github.com/DataDog/datadog-agent/pkg/security/resolvers/cgroup/model" "github.com/DataDog/datadog-agent/pkg/security/secl/model" "github.com/DataDog/datadog-go/v5/statsd" "golang.org/x/exp/slices" diff --git a/pkg/security/process_list/process_resolver/process_resolver_test.go b/pkg/security/process_list/process_resolver/process_resolver_test.go index 600e0c03bc8a9..1c062c45c0f99 100644 --- a/pkg/security/process_list/process_resolver/process_resolver_test.go +++ b/pkg/security/process_list/process_resolver/process_resolver_test.go @@ -141,7 +141,8 @@ func isProcessOrExecPresent(pl *processlist.ProcessList, pc *ProcessResolver, ev func TestFork1st(t *testing.T) { pc := NewProcessResolver() - processList := processlist.NewProcessList(cgroupModel.WorkloadSelector{Image: "*", Tag: "*"}, + selector, _ := cgroupModel.NewWorkloadSelector("*", "*") + processList := processlist.NewProcessList(selector, []model.EventType{model.ExecEventType, model.ForkEventType, model.ExitEventType}, pc /* ,nil */, nil, nil) stats := testStats{} diff --git a/pkg/security/proto/api/api.pb.go b/pkg/security/proto/api/api.pb.go index 60cc167d246f9..e8fd80f24c5c8 100644 --- a/pkg/security/proto/api/api.pb.go +++ b/pkg/security/proto/api/api.pb.go @@ -1594,6 +1594,7 @@ type ActivityDumpParams struct { DifferentiateArgs bool `protobuf:"varint,2,opt,name=DifferentiateArgs,proto3" json:"DifferentiateArgs,omitempty"` Storage *StorageRequestParams `protobuf:"bytes,3,opt,name=Storage,proto3" json:"Storage,omitempty"` ContainerID string `protobuf:"bytes,4,opt,name=ContainerID,proto3" json:"ContainerID,omitempty"` + CGroupID string `protobuf:"bytes,5,opt,name=CGroupID,proto3" json:"CGroupID,omitempty"` } func (x *ActivityDumpParams) Reset() { @@ -1656,6 +1657,13 @@ func (x *ActivityDumpParams) GetContainerID() string { return "" } +func (x *ActivityDumpParams) GetCGroupID() string { + if x != nil { + return x.CGroupID + } + return "" +} + type MetadataMessage struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1676,6 +1684,7 @@ type MetadataMessage struct { Timeout string `protobuf:"bytes,12,opt,name=Timeout,proto3" json:"Timeout,omitempty"` Size uint64 `protobuf:"varint,13,opt,name=Size,proto3" json:"Size,omitempty"` Serialization string `protobuf:"bytes,14,opt,name=Serialization,proto3" json:"Serialization,omitempty"` + CGroupID string `protobuf:"bytes,15,opt,name=CGroupID,proto3" json:"CGroupID,omitempty"` } func (x *MetadataMessage) Reset() { @@ -1809,6 +1818,13 @@ func (x *MetadataMessage) GetSerialization() string { return "" } +func (x *MetadataMessage) GetCGroupID() string { + if x != nil { + return x.CGroupID + } + return "" +} + type StorageRequestMessage struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -2091,6 +2107,7 @@ type ActivityDumpStopParams struct { Name string `protobuf:"bytes,1,opt,name=Name,proto3" json:"Name,omitempty"` ContainerID string `protobuf:"bytes,2,opt,name=ContainerID,proto3" json:"ContainerID,omitempty"` + CGroupID string `protobuf:"bytes,3,opt,name=CGroupID,proto3" json:"CGroupID,omitempty"` } func (x *ActivityDumpStopParams) Reset() { @@ -2139,6 +2156,13 @@ func (x *ActivityDumpStopParams) GetContainerID() string { return "" } +func (x *ActivityDumpStopParams) GetCGroupID() string { + if x != nil { + return x.CGroupID + } + return "" +} + type ActivityDumpStopMessage struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -3298,7 +3322,7 @@ var file_pkg_security_proto_api_api_proto_rawDesc = []byte{ 0x0a, 0x18, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x18, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x43, - 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xb3, 0x01, 0x0a, 0x12, 0x41, + 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xcf, 0x01, 0x0a, 0x12, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x44, 0x75, 0x6d, 0x70, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x2c, 0x0a, 0x11, 0x44, @@ -3310,312 +3334,317 @@ var file_pkg_security_proto_api_api_proto_rawDesc = []byte{ 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x07, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x44, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x44, - 0x22, 0xcf, 0x03, 0x0a, 0x0f, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x4d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x56, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x41, 0x67, 0x65, 0x6e, - 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x41, 0x67, 0x65, 0x6e, - 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x41, - 0x67, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x12, 0x24, 0x0a, 0x0d, 0x4b, 0x65, - 0x72, 0x6e, 0x65, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0d, 0x4b, 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, - 0x12, 0x2c, 0x0a, 0x11, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, - 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x4c, 0x69, 0x6e, - 0x75, 0x78, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, - 0x0a, 0x04, 0x41, 0x72, 0x63, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x41, 0x72, - 0x63, 0x68, 0x12, 0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x28, 0x0a, 0x0f, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0f, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, - 0x12, 0x2c, 0x0a, 0x11, 0x44, 0x69, 0x66, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x74, - 0x65, 0x41, 0x72, 0x67, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x44, 0x69, 0x66, - 0x66, 0x65, 0x72, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x74, 0x65, 0x41, 0x72, 0x67, 0x73, 0x12, 0x16, - 0x0a, 0x04, 0x43, 0x6f, 0x6d, 0x6d, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x42, 0x02, 0x18, 0x01, - 0x52, 0x04, 0x43, 0x6f, 0x6d, 0x6d, 0x12, 0x20, 0x0a, 0x0b, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, - 0x6e, 0x65, 0x72, 0x49, 0x44, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x43, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x44, 0x12, 0x14, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x72, - 0x74, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x18, - 0x0a, 0x07, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x53, 0x69, 0x7a, 0x65, - 0x18, 0x0d, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x24, 0x0a, 0x0d, - 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0e, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0d, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x22, 0x79, 0x0a, 0x15, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x54, - 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, - 0x16, 0x0a, 0x06, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x06, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x43, 0x6f, 0x6d, 0x70, 0x72, - 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x43, 0x6f, - 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x46, 0x69, 0x6c, - 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x46, 0x69, 0x6c, 0x65, 0x22, 0xbe, 0x02, - 0x0a, 0x13, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x44, 0x75, 0x6d, 0x70, 0x4d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x48, 0x6f, 0x73, 0x74, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x48, 0x6f, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x53, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x53, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x12, 0x18, 0x0a, 0x07, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x07, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x54, - 0x61, 0x67, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x54, 0x61, 0x67, 0x73, 0x12, - 0x34, 0x0a, 0x07, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x1a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x07, 0x53, 0x74, - 0x6f, 0x72, 0x61, 0x67, 0x65, 0x12, 0x30, 0x0a, 0x08, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, - 0x61, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4d, 0x65, - 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x08, 0x4d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x14, 0x0a, 0x05, 0x45, 0x72, 0x72, 0x6f, 0x72, - 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x1a, 0x0a, - 0x08, 0x44, 0x4e, 0x53, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x09, 0x52, - 0x08, 0x44, 0x4e, 0x53, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x12, 0x33, 0x0a, 0x05, 0x53, 0x74, 0x61, - 0x74, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x41, - 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x54, 0x72, 0x65, 0x65, 0x53, 0x74, 0x61, 0x74, 0x73, - 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x05, 0x53, 0x74, 0x61, 0x74, 0x73, 0x22, 0x18, - 0x0a, 0x16, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x44, 0x75, 0x6d, 0x70, 0x4c, 0x69, - 0x73, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x5f, 0x0a, 0x17, 0x41, 0x63, 0x74, 0x69, - 0x76, 0x69, 0x74, 0x79, 0x44, 0x75, 0x6d, 0x70, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x12, 0x2e, 0x0a, 0x05, 0x44, 0x75, 0x6d, 0x70, 0x73, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, - 0x79, 0x44, 0x75, 0x6d, 0x70, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x05, 0x44, 0x75, - 0x6d, 0x70, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x05, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x4e, 0x0a, 0x16, 0x41, 0x63, 0x74, - 0x69, 0x76, 0x69, 0x74, 0x79, 0x44, 0x75, 0x6d, 0x70, 0x53, 0x74, 0x6f, 0x70, 0x50, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x43, 0x6f, 0x6e, 0x74, 0x61, - 0x69, 0x6e, 0x65, 0x72, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x43, 0x6f, - 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x44, 0x22, 0x2f, 0x0a, 0x17, 0x41, 0x63, 0x74, - 0x69, 0x76, 0x69, 0x74, 0x79, 0x44, 0x75, 0x6d, 0x70, 0x53, 0x74, 0x6f, 0x70, 0x4d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x05, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x7b, 0x0a, 0x18, 0x54, 0x72, - 0x61, 0x6e, 0x73, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x2a, 0x0a, 0x10, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, - 0x74, 0x79, 0x44, 0x75, 0x6d, 0x70, 0x46, 0x69, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x10, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x44, 0x75, 0x6d, 0x70, 0x46, 0x69, - 0x6c, 0x65, 0x12, 0x33, 0x0a, 0x07, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x07, - 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x22, 0x67, 0x0a, 0x19, 0x54, 0x72, 0x61, 0x6e, 0x73, - 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x05, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x34, 0x0a, 0x07, 0x53, 0x74, - 0x6f, 0x72, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x07, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, - 0x22, 0x1a, 0x0a, 0x18, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x44, 0x75, 0x6d, 0x70, - 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x5d, 0x0a, 0x19, - 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x44, 0x75, 0x6d, 0x70, 0x53, 0x74, 0x72, 0x65, - 0x61, 0x6d, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x2c, 0x0a, 0x04, 0x44, 0x75, 0x6d, - 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x41, 0x63, - 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x44, 0x75, 0x6d, 0x70, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x52, 0x04, 0x44, 0x75, 0x6d, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x44, 0x61, 0x74, 0x61, 0x22, 0x3f, 0x0a, 0x17, 0x57, - 0x6f, 0x72, 0x6b, 0x6c, 0x6f, 0x61, 0x64, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x4d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x54, 0x61, - 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x54, 0x61, 0x67, 0x22, 0x87, 0x01, 0x0a, - 0x1b, 0x4c, 0x61, 0x73, 0x74, 0x41, 0x6e, 0x6f, 0x6d, 0x61, 0x6c, 0x79, 0x54, 0x69, 0x6d, 0x65, - 0x73, 0x74, 0x61, 0x6d, 0x70, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x1c, 0x0a, 0x09, - 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x09, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x54, 0x69, - 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x54, - 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x2c, 0x0a, 0x11, 0x49, 0x73, 0x53, 0x74, - 0x61, 0x62, 0x6c, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x11, 0x49, 0x73, 0x53, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x45, 0x76, 0x65, - 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x22, 0x47, 0x0a, 0x0f, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, - 0x63, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x43, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, - 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x44, 0x12, 0x12, 0x0a, 0x04, 0x54, - 0x61, 0x67, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x54, 0x61, 0x67, 0x73, 0x22, - 0xec, 0x01, 0x0a, 0x18, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x54, 0x72, 0x65, 0x65, - 0x53, 0x74, 0x61, 0x74, 0x73, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x2c, 0x0a, 0x11, - 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x43, 0x6f, 0x75, 0x6e, - 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x11, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, - 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x26, 0x0a, 0x0e, 0x46, 0x69, - 0x6c, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x0e, 0x46, 0x69, 0x6c, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x43, 0x6f, 0x75, - 0x6e, 0x74, 0x12, 0x24, 0x0a, 0x0d, 0x44, 0x4e, 0x53, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x43, 0x6f, - 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x44, 0x4e, 0x53, 0x4e, 0x6f, - 0x64, 0x65, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2a, 0x0a, 0x10, 0x53, 0x6f, 0x63, 0x6b, - 0x65, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x10, 0x53, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x43, - 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x28, 0x0a, 0x0f, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x78, 0x69, 0x6d, - 0x61, 0x74, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x41, - 0x70, 0x70, 0x72, 0x6f, 0x78, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x22, 0x6e, - 0x0a, 0x10, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x5f, 0x73, 0x74, 0x61, - 0x74, 0x65, 0x12, 0x2a, 0x0a, 0x11, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x61, 0x6e, 0x6f, 0x6d, 0x61, - 0x6c, 0x79, 0x5f, 0x6e, 0x61, 0x6e, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0f, 0x6c, - 0x61, 0x73, 0x74, 0x41, 0x6e, 0x6f, 0x6d, 0x61, 0x6c, 0x79, 0x4e, 0x61, 0x6e, 0x6f, 0x12, 0x2e, - 0x0a, 0x13, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x5f, - 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x65, 0x76, 0x65, - 0x6e, 0x74, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x22, 0x9b, - 0x02, 0x0a, 0x15, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, - 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x66, 0x69, 0x72, 0x73, - 0x74, 0x5f, 0x73, 0x65, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x66, 0x69, - 0x72, 0x73, 0x74, 0x53, 0x65, 0x65, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x61, 0x73, 0x74, 0x5f, - 0x73, 0x65, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x6c, 0x61, 0x73, 0x74, - 0x53, 0x65, 0x65, 0x6e, 0x12, 0x58, 0x0a, 0x10, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x79, - 0x70, 0x65, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2e, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x43, 0x6f, 0x6e, 0x74, - 0x65, 0x78, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, - 0x54, 0x79, 0x70, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0e, - 0x65, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x12, - 0x0a, 0x04, 0x74, 0x61, 0x67, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x74, 0x61, - 0x67, 0x73, 0x1a, 0x58, 0x0a, 0x13, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x53, - 0x74, 0x61, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2b, 0x0a, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x5f, 0x73, 0x74, 0x61, 0x74, - 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xa0, 0x06, 0x0a, - 0x16, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, - 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x26, 0x0a, 0x0e, 0x4c, 0x6f, 0x61, 0x64, 0x65, - 0x64, 0x49, 0x6e, 0x4b, 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x0e, 0x4c, 0x6f, 0x61, 0x64, 0x65, 0x64, 0x49, 0x6e, 0x4b, 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x12, - 0x38, 0x0a, 0x17, 0x4c, 0x6f, 0x61, 0x64, 0x65, 0x64, 0x49, 0x6e, 0x4b, 0x65, 0x72, 0x6e, 0x65, - 0x6c, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x17, 0x4c, 0x6f, 0x61, 0x64, 0x65, 0x64, 0x49, 0x6e, 0x4b, 0x65, 0x72, 0x6e, 0x65, 0x6c, - 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x38, 0x0a, 0x08, 0x53, 0x65, 0x6c, - 0x65, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x6c, 0x6f, 0x61, 0x64, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, - 0x6f, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x08, 0x53, 0x65, 0x6c, 0x65, 0x63, - 0x74, 0x6f, 0x72, 0x12, 0x24, 0x0a, 0x0d, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x43, 0x6f, - 0x6f, 0x6b, 0x69, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x50, 0x72, 0x6f, 0x66, - 0x69, 0x6c, 0x65, 0x43, 0x6f, 0x6f, 0x6b, 0x69, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x45, 0x76, 0x65, - 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x45, - 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x73, 0x12, 0x4a, 0x0a, 0x0d, 0x4c, 0x61, 0x73, - 0x74, 0x41, 0x6e, 0x6f, 0x6d, 0x61, 0x6c, 0x69, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x20, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4c, 0x61, 0x73, 0x74, 0x41, 0x6e, 0x6f, 0x6d, 0x61, - 0x6c, 0x79, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x4d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x42, 0x02, 0x18, 0x01, 0x52, 0x0d, 0x4c, 0x61, 0x73, 0x74, 0x41, 0x6e, 0x6f, 0x6d, - 0x61, 0x6c, 0x69, 0x65, 0x73, 0x12, 0x32, 0x0a, 0x09, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, - 0x65, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x49, - 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x09, - 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x1a, 0x0a, 0x06, 0x53, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x42, 0x02, 0x18, 0x01, 0x52, 0x06, 0x53, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1c, 0x0a, 0x07, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, - 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x42, 0x02, 0x18, 0x01, 0x52, 0x07, 0x56, 0x65, 0x72, 0x73, - 0x69, 0x6f, 0x6e, 0x12, 0x30, 0x0a, 0x08, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, - 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x08, 0x4d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x16, 0x0a, 0x04, 0x54, 0x61, 0x67, 0x73, 0x18, 0x0b, 0x20, - 0x03, 0x28, 0x09, 0x42, 0x02, 0x18, 0x01, 0x52, 0x04, 0x54, 0x61, 0x67, 0x73, 0x12, 0x33, 0x0a, - 0x05, 0x53, 0x74, 0x61, 0x74, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x54, 0x72, 0x65, 0x65, 0x53, - 0x74, 0x61, 0x74, 0x73, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x05, 0x53, 0x74, 0x61, - 0x74, 0x73, 0x12, 0x2e, 0x0a, 0x12, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x47, 0x6c, 0x6f, - 0x62, 0x61, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, - 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x53, 0x74, 0x61, - 0x74, 0x65, 0x12, 0x5b, 0x0a, 0x10, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x63, 0x6f, - 0x6e, 0x74, 0x65, 0x78, 0x74, 0x73, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x66, 0x69, - 0x6c, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, - 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0f, - 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x73, 0x1a, - 0x5e, 0x0a, 0x14, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, - 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x30, 0x0a, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x50, - 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x4d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, - 0x3f, 0x0a, 0x19, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x66, 0x69, - 0x6c, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x22, 0x0a, 0x0c, - 0x49, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x43, 0x61, 0x63, 0x68, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x0c, 0x49, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x43, 0x61, 0x63, 0x68, 0x65, - 0x22, 0x6b, 0x0a, 0x1a, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x66, - 0x69, 0x6c, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x37, - 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x1b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x50, - 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x08, 0x50, - 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x45, 0x72, 0x72, 0x6f, 0x72, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x55, 0x0a, - 0x19, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, - 0x53, 0x61, 0x76, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x38, 0x0a, 0x08, 0x53, 0x65, - 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x6c, 0x6f, 0x61, 0x64, 0x53, 0x65, 0x6c, 0x65, 0x63, - 0x74, 0x6f, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x08, 0x53, 0x65, 0x6c, 0x65, - 0x63, 0x74, 0x6f, 0x72, 0x22, 0x46, 0x0a, 0x1a, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, - 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x53, 0x61, 0x76, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x05, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x46, 0x69, 0x6c, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x46, 0x69, 0x6c, 0x65, 0x32, 0x8a, 0x0a, 0x0a, - 0x0e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, - 0x3f, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x13, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x1a, 0x19, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, - 0x45, 0x76, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x00, 0x30, 0x01, - 0x12, 0x57, 0x0a, 0x10, 0x44, 0x75, 0x6d, 0x70, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x43, - 0x61, 0x63, 0x68, 0x65, 0x12, 0x1b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x75, 0x6d, 0x70, 0x50, - 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x43, 0x61, 0x63, 0x68, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x1a, 0x24, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, - 0x44, 0x75, 0x6d, 0x70, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x43, 0x61, 0x63, 0x68, 0x65, - 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x00, 0x12, 0x3f, 0x0a, 0x09, 0x47, 0x65, 0x74, - 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x14, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, 0x74, - 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x1a, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x00, 0x12, 0x30, 0x0a, 0x09, 0x47, 0x65, - 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x14, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, - 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x0b, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x00, 0x12, 0x4b, 0x0a, 0x0b, - 0x52, 0x75, 0x6e, 0x53, 0x65, 0x6c, 0x66, 0x54, 0x65, 0x73, 0x74, 0x12, 0x16, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x52, 0x75, 0x6e, 0x53, 0x65, 0x6c, 0x66, 0x54, 0x65, 0x73, 0x74, 0x50, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x1a, 0x22, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, - 0x74, 0x79, 0x53, 0x65, 0x6c, 0x66, 0x54, 0x65, 0x73, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, - 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x00, 0x12, 0x55, 0x0a, 0x10, 0x47, 0x65, 0x74, - 0x52, 0x75, 0x6c, 0x65, 0x53, 0x65, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x1b, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x75, 0x6c, 0x65, 0x53, 0x65, 0x74, 0x52, 0x65, - 0x70, 0x6f, 0x72, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x22, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x47, 0x65, 0x74, 0x52, 0x75, 0x6c, 0x65, 0x53, 0x65, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x72, - 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x00, - 0x12, 0x4f, 0x0a, 0x0e, 0x52, 0x65, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, - 0x65, 0x73, 0x12, 0x19, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x6c, 0x6f, 0x61, 0x64, 0x50, - 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x20, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, - 0x65, 0x73, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, - 0x00, 0x12, 0x5b, 0x0a, 0x14, 0x44, 0x75, 0x6d, 0x70, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, - 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x1f, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x44, 0x75, 0x6d, 0x70, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x73, - 0x70, 0x61, 0x63, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x20, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x44, 0x75, 0x6d, 0x70, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x4e, 0x61, 0x6d, 0x65, - 0x73, 0x70, 0x61, 0x63, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x00, 0x12, 0x49, - 0x0a, 0x0e, 0x44, 0x75, 0x6d, 0x70, 0x44, 0x69, 0x73, 0x63, 0x61, 0x72, 0x64, 0x65, 0x72, 0x73, - 0x12, 0x19, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x75, 0x6d, 0x70, 0x44, 0x69, 0x73, 0x63, 0x61, - 0x72, 0x64, 0x65, 0x72, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x1a, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x44, 0x75, 0x6d, 0x70, 0x44, 0x69, 0x73, 0x63, 0x61, 0x72, 0x64, 0x65, 0x72, 0x73, - 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x00, 0x12, 0x43, 0x0a, 0x0c, 0x44, 0x75, 0x6d, - 0x70, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x12, 0x17, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x44, 0x75, 0x6d, 0x70, 0x50, 0x61, 0x72, 0x61, - 0x6d, 0x73, 0x1a, 0x18, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, - 0x79, 0x44, 0x75, 0x6d, 0x70, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x00, 0x12, 0x50, - 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x44, 0x75, - 0x6d, 0x70, 0x73, 0x12, 0x1b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, + 0x12, 0x1a, 0x0a, 0x08, 0x43, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x44, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x43, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x44, 0x22, 0xeb, 0x03, 0x0a, + 0x0f, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x12, 0x22, 0x0a, 0x0c, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x56, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6d, + 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x41, 0x67, 0x65, 0x6e, 0x74, + 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x12, 0x24, 0x0a, 0x0d, 0x4b, 0x65, 0x72, 0x6e, 0x65, 0x6c, + 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x4b, + 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x2c, 0x0a, 0x11, + 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x4c, 0x69, 0x6e, 0x75, 0x78, 0x44, 0x69, + 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x41, 0x72, + 0x63, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x41, 0x72, 0x63, 0x68, 0x12, 0x12, + 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x4e, 0x61, + 0x6d, 0x65, 0x12, 0x28, 0x0a, 0x0f, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x56, 0x65, + 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x2c, 0x0a, 0x11, + 0x44, 0x69, 0x66, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x74, 0x65, 0x41, 0x72, 0x67, + 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x44, 0x69, 0x66, 0x66, 0x65, 0x72, 0x65, + 0x6e, 0x74, 0x69, 0x61, 0x74, 0x65, 0x41, 0x72, 0x67, 0x73, 0x12, 0x16, 0x0a, 0x04, 0x43, 0x6f, + 0x6d, 0x6d, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x42, 0x02, 0x18, 0x01, 0x52, 0x04, 0x43, 0x6f, + 0x6d, 0x6d, 0x12, 0x20, 0x0a, 0x0b, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, + 0x44, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, + 0x65, 0x72, 0x49, 0x44, 0x12, 0x14, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x72, 0x74, 0x18, 0x0b, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x54, 0x69, + 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x54, 0x69, 0x6d, + 0x65, 0x6f, 0x75, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x0d, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x04, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x24, 0x0a, 0x0d, 0x53, 0x65, 0x72, 0x69, + 0x61, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0d, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1a, + 0x0a, 0x08, 0x43, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x44, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x08, 0x43, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x44, 0x22, 0x79, 0x0a, 0x15, 0x53, 0x74, + 0x6f, 0x72, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x46, 0x6f, 0x72, 0x6d, 0x61, + 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, + 0x20, 0x0a, 0x0b, 0x43, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x43, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x46, 0x69, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x46, 0x69, 0x6c, 0x65, 0x22, 0xbe, 0x02, 0x0a, 0x13, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, + 0x74, 0x79, 0x44, 0x75, 0x6d, 0x70, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, + 0x04, 0x48, 0x6f, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x48, 0x6f, 0x73, + 0x74, 0x12, 0x16, 0x0a, 0x06, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x54, 0x61, 0x67, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x04, 0x54, 0x61, 0x67, 0x73, 0x12, 0x34, 0x0a, 0x07, 0x53, 0x74, 0x6f, 0x72, 0x61, + 0x67, 0x65, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, + 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x52, 0x07, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x12, 0x30, 0x0a, + 0x08, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x14, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x4d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x08, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, + 0x14, 0x0a, 0x05, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x44, 0x4e, 0x53, 0x4e, 0x61, 0x6d, 0x65, + 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x44, 0x4e, 0x53, 0x4e, 0x61, 0x6d, 0x65, + 0x73, 0x12, 0x33, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1d, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x54, + 0x72, 0x65, 0x65, 0x53, 0x74, 0x61, 0x74, 0x73, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, + 0x05, 0x53, 0x74, 0x61, 0x74, 0x73, 0x22, 0x18, 0x0a, 0x16, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x44, 0x75, 0x6d, 0x70, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x1a, 0x1c, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x44, - 0x75, 0x6d, 0x70, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x00, - 0x12, 0x4f, 0x0a, 0x10, 0x53, 0x74, 0x6f, 0x70, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, - 0x44, 0x75, 0x6d, 0x70, 0x12, 0x1b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x76, - 0x69, 0x74, 0x79, 0x44, 0x75, 0x6d, 0x70, 0x53, 0x74, 0x6f, 0x70, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x1a, 0x1c, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, - 0x44, 0x75, 0x6d, 0x70, 0x53, 0x74, 0x6f, 0x70, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, - 0x00, 0x12, 0x55, 0x0a, 0x12, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x54, 0x72, - 0x61, 0x6e, 0x73, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x1e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x54, 0x72, 0x61, - 0x6e, 0x73, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x00, 0x12, 0x5a, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x41, - 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x44, 0x75, 0x6d, 0x70, 0x53, 0x74, 0x72, 0x65, 0x61, - 0x6d, 0x12, 0x1d, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, + 0x22, 0x5f, 0x0a, 0x17, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x44, 0x75, 0x6d, 0x70, + 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x2e, 0x0a, 0x05, 0x44, + 0x75, 0x6d, 0x70, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x44, 0x75, 0x6d, 0x70, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x52, 0x05, 0x44, 0x75, 0x6d, 0x70, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x45, + 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x45, 0x72, 0x72, 0x6f, + 0x72, 0x22, 0x6a, 0x0a, 0x16, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x44, 0x75, 0x6d, + 0x70, 0x53, 0x74, 0x6f, 0x70, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x4e, + 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x12, + 0x20, 0x0a, 0x0b, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x44, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, + 0x44, 0x12, 0x1a, 0x0a, 0x08, 0x43, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x44, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x43, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x44, 0x22, 0x2f, 0x0a, + 0x17, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x44, 0x75, 0x6d, 0x70, 0x53, 0x74, 0x6f, + 0x70, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x45, 0x72, 0x72, 0x6f, + 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x7b, + 0x0a, 0x18, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x2a, 0x0a, 0x10, 0x41, 0x63, + 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x44, 0x75, 0x6d, 0x70, 0x46, 0x69, 0x6c, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x44, 0x75, + 0x6d, 0x70, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x33, 0x0a, 0x07, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x74, + 0x6f, 0x72, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x52, 0x07, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x22, 0x67, 0x0a, 0x19, 0x54, + 0x72, 0x61, 0x6e, 0x73, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x45, 0x72, 0x72, 0x6f, + 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x34, + 0x0a, 0x07, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x1a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x07, 0x53, 0x74, 0x6f, + 0x72, 0x61, 0x67, 0x65, 0x22, 0x1a, 0x0a, 0x18, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x44, 0x75, 0x6d, 0x70, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x1a, 0x1e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x44, - 0x75, 0x6d, 0x70, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x22, 0x00, 0x30, 0x01, 0x12, 0x59, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x63, 0x75, - 0x72, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x12, 0x1e, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x66, 0x69, - 0x6c, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x1f, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x66, 0x69, - 0x6c, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x00, 0x12, - 0x58, 0x0a, 0x13, 0x53, 0x61, 0x76, 0x65, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x50, - 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x12, 0x1e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x65, 0x63, - 0x75, 0x72, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x53, 0x61, 0x76, 0x65, - 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x1f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x65, 0x63, - 0x75, 0x72, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x53, 0x61, 0x76, 0x65, - 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x00, 0x42, 0x18, 0x5a, 0x16, 0x70, 0x6b, 0x67, - 0x2f, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, - 0x61, 0x70, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x22, 0x5d, 0x0a, 0x19, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x44, 0x75, 0x6d, 0x70, + 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x2c, 0x0a, + 0x04, 0x44, 0x75, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x44, 0x75, 0x6d, 0x70, 0x4d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x04, 0x44, 0x75, 0x6d, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x44, + 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x44, 0x61, 0x74, 0x61, 0x22, + 0x3f, 0x0a, 0x17, 0x57, 0x6f, 0x72, 0x6b, 0x6c, 0x6f, 0x61, 0x64, 0x53, 0x65, 0x6c, 0x65, 0x63, + 0x74, 0x6f, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x4e, 0x61, + 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x10, + 0x0a, 0x03, 0x54, 0x61, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x54, 0x61, 0x67, + 0x22, 0x87, 0x01, 0x0a, 0x1b, 0x4c, 0x61, 0x73, 0x74, 0x41, 0x6e, 0x6f, 0x6d, 0x61, 0x6c, 0x79, + 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x12, 0x1c, 0x0a, 0x09, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x09, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1c, + 0x0a, 0x09, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x09, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x2c, 0x0a, 0x11, + 0x49, 0x73, 0x53, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x49, 0x73, 0x53, 0x74, 0x61, 0x62, 0x6c, + 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x22, 0x47, 0x0a, 0x0f, 0x49, 0x6e, + 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x20, 0x0a, + 0x0b, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0b, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x44, 0x12, + 0x12, 0x0a, 0x04, 0x54, 0x61, 0x67, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x54, + 0x61, 0x67, 0x73, 0x22, 0xec, 0x01, 0x0a, 0x18, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, + 0x54, 0x72, 0x65, 0x65, 0x53, 0x74, 0x61, 0x74, 0x73, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x12, 0x2c, 0x0a, 0x11, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x4e, 0x6f, 0x64, 0x65, 0x73, + 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x11, 0x50, 0x72, 0x6f, + 0x63, 0x65, 0x73, 0x73, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x26, + 0x0a, 0x0e, 0x46, 0x69, 0x6c, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x46, 0x69, 0x6c, 0x65, 0x4e, 0x6f, 0x64, 0x65, + 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x24, 0x0a, 0x0d, 0x44, 0x4e, 0x53, 0x4e, 0x6f, 0x64, + 0x65, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x44, + 0x4e, 0x53, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2a, 0x0a, 0x10, + 0x53, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x10, 0x53, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x4e, 0x6f, + 0x64, 0x65, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x28, 0x0a, 0x0f, 0x41, 0x70, 0x70, 0x72, + 0x6f, 0x78, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x0f, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x78, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x53, 0x69, + 0x7a, 0x65, 0x22, 0x6e, 0x0a, 0x10, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, + 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x2a, 0x0a, 0x11, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x61, + 0x6e, 0x6f, 0x6d, 0x61, 0x6c, 0x79, 0x5f, 0x6e, 0x61, 0x6e, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x0f, 0x6c, 0x61, 0x73, 0x74, 0x41, 0x6e, 0x6f, 0x6d, 0x61, 0x6c, 0x79, 0x4e, 0x61, + 0x6e, 0x6f, 0x12, 0x2e, 0x0a, 0x13, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x66, + 0x69, 0x6c, 0x65, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x11, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x53, 0x74, 0x61, + 0x74, 0x65, 0x22, 0x9b, 0x02, 0x0a, 0x15, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x43, 0x6f, + 0x6e, 0x74, 0x65, 0x78, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x1d, 0x0a, 0x0a, + 0x66, 0x69, 0x72, 0x73, 0x74, 0x5f, 0x73, 0x65, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x09, 0x66, 0x69, 0x72, 0x73, 0x74, 0x53, 0x65, 0x65, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x6c, + 0x61, 0x73, 0x74, 0x5f, 0x73, 0x65, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, + 0x6c, 0x61, 0x73, 0x74, 0x53, 0x65, 0x65, 0x6e, 0x12, 0x58, 0x0a, 0x10, 0x65, 0x76, 0x65, 0x6e, + 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, + 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x45, + 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x52, 0x0e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x53, 0x74, 0x61, + 0x74, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x61, 0x67, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, + 0x52, 0x04, 0x74, 0x61, 0x67, 0x73, 0x1a, 0x58, 0x0a, 0x13, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, + 0x79, 0x70, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, + 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, + 0x2b, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x5f, + 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, + 0x22, 0xa0, 0x06, 0x0a, 0x16, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, + 0x66, 0x69, 0x6c, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x26, 0x0a, 0x0e, 0x4c, + 0x6f, 0x61, 0x64, 0x65, 0x64, 0x49, 0x6e, 0x4b, 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x0e, 0x4c, 0x6f, 0x61, 0x64, 0x65, 0x64, 0x49, 0x6e, 0x4b, 0x65, 0x72, + 0x6e, 0x65, 0x6c, 0x12, 0x38, 0x0a, 0x17, 0x4c, 0x6f, 0x61, 0x64, 0x65, 0x64, 0x49, 0x6e, 0x4b, + 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x17, 0x4c, 0x6f, 0x61, 0x64, 0x65, 0x64, 0x49, 0x6e, 0x4b, 0x65, + 0x72, 0x6e, 0x65, 0x6c, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x38, 0x0a, + 0x08, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1c, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x6c, 0x6f, 0x61, 0x64, 0x53, 0x65, + 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x08, 0x53, + 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x24, 0x0a, 0x0d, 0x50, 0x72, 0x6f, 0x66, 0x69, + 0x6c, 0x65, 0x43, 0x6f, 0x6f, 0x6b, 0x69, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, + 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x43, 0x6f, 0x6f, 0x6b, 0x69, 0x65, 0x12, 0x1e, 0x0a, + 0x0a, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x0a, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x73, 0x12, 0x4a, 0x0a, + 0x0d, 0x4c, 0x61, 0x73, 0x74, 0x41, 0x6e, 0x6f, 0x6d, 0x61, 0x6c, 0x69, 0x65, 0x73, 0x18, 0x06, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4c, 0x61, 0x73, 0x74, 0x41, + 0x6e, 0x6f, 0x6d, 0x61, 0x6c, 0x79, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x4d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x02, 0x18, 0x01, 0x52, 0x0d, 0x4c, 0x61, 0x73, 0x74, + 0x41, 0x6e, 0x6f, 0x6d, 0x61, 0x6c, 0x69, 0x65, 0x73, 0x12, 0x32, 0x0a, 0x09, 0x49, 0x6e, 0x73, + 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x52, 0x09, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x1a, 0x0a, + 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x42, 0x02, 0x18, + 0x01, 0x52, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1c, 0x0a, 0x07, 0x56, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x42, 0x02, 0x18, 0x01, 0x52, 0x07, + 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x30, 0x0a, 0x08, 0x4d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, + 0x08, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x16, 0x0a, 0x04, 0x54, 0x61, 0x67, + 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x09, 0x42, 0x02, 0x18, 0x01, 0x52, 0x04, 0x54, 0x61, 0x67, + 0x73, 0x12, 0x33, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1d, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x54, + 0x72, 0x65, 0x65, 0x53, 0x74, 0x61, 0x74, 0x73, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, + 0x05, 0x53, 0x74, 0x61, 0x74, 0x73, 0x12, 0x2e, 0x0a, 0x12, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, + 0x65, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x65, 0x18, 0x0d, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x12, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x47, 0x6c, 0x6f, 0x62, 0x61, + 0x6c, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x5b, 0x0a, 0x10, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, + 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x73, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x30, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x50, + 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x50, 0x72, + 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x73, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x52, 0x0f, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, + 0x78, 0x74, 0x73, 0x1a, 0x5e, 0x0a, 0x14, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x43, 0x6f, + 0x6e, 0x74, 0x65, 0x78, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, + 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x30, 0x0a, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, + 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, + 0x02, 0x38, 0x01, 0x22, 0x3f, 0x0a, 0x19, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x50, + 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x12, 0x22, 0x0a, 0x0c, 0x49, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x43, 0x61, 0x63, 0x68, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x49, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x43, + 0x61, 0x63, 0x68, 0x65, 0x22, 0x6b, 0x0a, 0x1a, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, + 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x12, 0x37, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x65, 0x63, 0x75, 0x72, + 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x52, 0x08, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x45, + 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x45, 0x72, 0x72, 0x6f, + 0x72, 0x22, 0x55, 0x0a, 0x19, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, + 0x66, 0x69, 0x6c, 0x65, 0x53, 0x61, 0x76, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x38, + 0x0a, 0x08, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1c, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x6c, 0x6f, 0x61, 0x64, 0x53, + 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x08, + 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x22, 0x46, 0x0a, 0x1a, 0x53, 0x65, 0x63, 0x75, + 0x72, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x53, 0x61, 0x76, 0x65, 0x4d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x12, 0x0a, 0x04, + 0x46, 0x69, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x46, 0x69, 0x6c, 0x65, + 0x32, 0x8a, 0x0a, 0x0a, 0x0e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x4d, 0x6f, 0x64, + 0x75, 0x6c, 0x65, 0x12, 0x3f, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, + 0x12, 0x13, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x19, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x65, 0x63, 0x75, + 0x72, 0x69, 0x74, 0x79, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x22, 0x00, 0x30, 0x01, 0x12, 0x57, 0x0a, 0x10, 0x44, 0x75, 0x6d, 0x70, 0x50, 0x72, 0x6f, 0x63, + 0x65, 0x73, 0x73, 0x43, 0x61, 0x63, 0x68, 0x65, 0x12, 0x1b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, + 0x75, 0x6d, 0x70, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x43, 0x61, 0x63, 0x68, 0x65, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x24, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x65, 0x63, 0x75, + 0x72, 0x69, 0x74, 0x79, 0x44, 0x75, 0x6d, 0x70, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x43, + 0x61, 0x63, 0x68, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x00, 0x12, 0x3f, 0x0a, + 0x09, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x14, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x1a, 0x1a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x00, 0x12, 0x30, + 0x0a, 0x09, 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x14, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x1a, 0x0b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x00, + 0x12, 0x4b, 0x0a, 0x0b, 0x52, 0x75, 0x6e, 0x53, 0x65, 0x6c, 0x66, 0x54, 0x65, 0x73, 0x74, 0x12, + 0x16, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x75, 0x6e, 0x53, 0x65, 0x6c, 0x66, 0x54, 0x65, 0x73, + 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x22, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x65, + 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x53, 0x65, 0x6c, 0x66, 0x54, 0x65, 0x73, 0x74, 0x52, 0x65, + 0x73, 0x75, 0x6c, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x00, 0x12, 0x55, 0x0a, + 0x10, 0x47, 0x65, 0x74, 0x52, 0x75, 0x6c, 0x65, 0x53, 0x65, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x72, + 0x74, 0x12, 0x1b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x75, 0x6c, 0x65, 0x53, + 0x65, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x22, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x75, 0x6c, 0x65, 0x53, 0x65, 0x74, 0x52, + 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x22, 0x00, 0x12, 0x4f, 0x0a, 0x0e, 0x52, 0x65, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x6f, + 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x12, 0x19, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x6c, + 0x6f, 0x61, 0x64, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x1a, 0x20, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x6f, + 0x6c, 0x69, 0x63, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x22, 0x00, 0x12, 0x5b, 0x0a, 0x14, 0x44, 0x75, 0x6d, 0x70, 0x4e, 0x65, 0x74, + 0x77, 0x6f, 0x72, 0x6b, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x1f, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x44, 0x75, 0x6d, 0x70, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x4e, + 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x20, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x75, 0x6d, 0x70, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, + 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x22, 0x00, 0x12, 0x49, 0x0a, 0x0e, 0x44, 0x75, 0x6d, 0x70, 0x44, 0x69, 0x73, 0x63, 0x61, 0x72, + 0x64, 0x65, 0x72, 0x73, 0x12, 0x19, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x75, 0x6d, 0x70, 0x44, + 0x69, 0x73, 0x63, 0x61, 0x72, 0x64, 0x65, 0x72, 0x73, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, + 0x1a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x75, 0x6d, 0x70, 0x44, 0x69, 0x73, 0x63, 0x61, 0x72, + 0x64, 0x65, 0x72, 0x73, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x00, 0x12, 0x43, 0x0a, + 0x0c, 0x44, 0x75, 0x6d, 0x70, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x12, 0x17, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x44, 0x75, 0x6d, 0x70, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x18, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x41, 0x63, 0x74, + 0x69, 0x76, 0x69, 0x74, 0x79, 0x44, 0x75, 0x6d, 0x70, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x22, 0x00, 0x12, 0x50, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, + 0x74, 0x79, 0x44, 0x75, 0x6d, 0x70, 0x73, 0x12, 0x1b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x41, 0x63, + 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x44, 0x75, 0x6d, 0x70, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x1c, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x76, + 0x69, 0x74, 0x79, 0x44, 0x75, 0x6d, 0x70, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x22, 0x00, 0x12, 0x4f, 0x0a, 0x10, 0x53, 0x74, 0x6f, 0x70, 0x41, 0x63, 0x74, 0x69, + 0x76, 0x69, 0x74, 0x79, 0x44, 0x75, 0x6d, 0x70, 0x12, 0x1b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x41, + 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x44, 0x75, 0x6d, 0x70, 0x53, 0x74, 0x6f, 0x70, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x1c, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x41, 0x63, 0x74, 0x69, + 0x76, 0x69, 0x74, 0x79, 0x44, 0x75, 0x6d, 0x70, 0x53, 0x74, 0x6f, 0x70, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x22, 0x00, 0x12, 0x55, 0x0a, 0x12, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x63, 0x6f, + 0x64, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x1e, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x00, 0x12, 0x5a, 0x0a, 0x15, + 0x47, 0x65, 0x74, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x44, 0x75, 0x6d, 0x70, 0x53, + 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x1d, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x41, 0x63, 0x74, 0x69, + 0x76, 0x69, 0x74, 0x79, 0x44, 0x75, 0x6d, 0x70, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x1e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x76, + 0x69, 0x74, 0x79, 0x44, 0x75, 0x6d, 0x70, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, 0x59, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, + 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x73, + 0x12, 0x1e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x50, + 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x1a, 0x1f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x50, + 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x22, 0x00, 0x12, 0x58, 0x0a, 0x13, 0x53, 0x61, 0x76, 0x65, 0x53, 0x65, 0x63, 0x75, 0x72, + 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x12, 0x1e, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, + 0x53, 0x61, 0x76, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x1f, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, + 0x53, 0x61, 0x76, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x00, 0x42, 0x18, 0x5a, + 0x16, 0x70, 0x6b, 0x67, 0x2f, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x2f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/pkg/security/proto/api/api.proto b/pkg/security/proto/api/api.proto index dc3e16fecb4b2..7032834f238c3 100644 --- a/pkg/security/proto/api/api.proto +++ b/pkg/security/proto/api/api.proto @@ -147,6 +147,7 @@ message ActivityDumpParams { bool DifferentiateArgs = 2; StorageRequestParams Storage = 3; string ContainerID = 4; + string CGroupID = 5; } message MetadataMessage { @@ -165,6 +166,7 @@ message MetadataMessage { string Timeout = 12; uint64 Size = 13; string Serialization = 14; + string CGroupID = 15; } message StorageRequestMessage { @@ -196,6 +198,7 @@ message ActivityDumpListMessage { message ActivityDumpStopParams { string Name = 1; string ContainerID = 2; + string CGroupID = 3; } message ActivityDumpStopMessage { diff --git a/pkg/security/proto/api/api_vtproto.pb.go b/pkg/security/proto/api/api_vtproto.pb.go index 462ad4782938c..8ebccda5994a0 100644 --- a/pkg/security/proto/api/api_vtproto.pb.go +++ b/pkg/security/proto/api/api_vtproto.pb.go @@ -1468,6 +1468,13 @@ func (m *ActivityDumpParams) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } + if len(m.CGroupID) > 0 { + i -= len(m.CGroupID) + copy(dAtA[i:], m.CGroupID) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.CGroupID))) + i-- + dAtA[i] = 0x2a + } if len(m.ContainerID) > 0 { i -= len(m.ContainerID) copy(dAtA[i:], m.ContainerID) @@ -1535,6 +1542,13 @@ func (m *MetadataMessage) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } + if len(m.CGroupID) > 0 { + i -= len(m.CGroupID) + copy(dAtA[i:], m.CGroupID) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.CGroupID))) + i-- + dAtA[i] = 0x7a + } if len(m.Serialization) > 0 { i -= len(m.Serialization) copy(dAtA[i:], m.Serialization) @@ -1927,6 +1941,13 @@ func (m *ActivityDumpStopParams) MarshalToSizedBufferVT(dAtA []byte) (int, error i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } + if len(m.CGroupID) > 0 { + i -= len(m.CGroupID) + copy(dAtA[i:], m.CGroupID) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.CGroupID))) + i-- + dAtA[i] = 0x1a + } if len(m.ContainerID) > 0 { i -= len(m.ContainerID) copy(dAtA[i:], m.ContainerID) @@ -3396,6 +3417,10 @@ func (m *ActivityDumpParams) SizeVT() (n int) { if l > 0 { n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } + l = len(m.CGroupID) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } n += len(m.unknownFields) return n } @@ -3460,6 +3485,10 @@ func (m *MetadataMessage) SizeVT() (n int) { if l > 0 { n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } + l = len(m.CGroupID) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } n += len(m.unknownFields) return n } @@ -3585,6 +3614,10 @@ func (m *ActivityDumpStopParams) SizeVT() (n int) { if l > 0 { n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } + l = len(m.CGroupID) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } n += len(m.unknownFields) return n } @@ -7212,6 +7245,38 @@ func (m *ActivityDumpParams) UnmarshalVT(dAtA []byte) error { } m.ContainerID = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CGroupID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CGroupID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := protohelpers.Skip(dAtA[iNdEx:]) @@ -7686,6 +7751,38 @@ func (m *MetadataMessage) UnmarshalVT(dAtA []byte) error { } m.Serialization = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 15: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CGroupID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CGroupID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := protohelpers.Skip(dAtA[iNdEx:]) @@ -8485,6 +8582,38 @@ func (m *ActivityDumpStopParams) UnmarshalVT(dAtA []byte) error { } m.ContainerID = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CGroupID", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CGroupID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := protohelpers.Skip(dAtA[iNdEx:]) 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/reporter/reporter.go b/pkg/security/reporter/reporter.go index 1c8a4f71bf5a0..227f94ac456ed 100644 --- a/pkg/security/reporter/reporter.go +++ b/pkg/security/reporter/reporter.go @@ -52,7 +52,7 @@ func newReporter(hostname string, stopper startstop.Stopper, sourceName, sourceT stopper.Add(auditor) // setup the pipeline provider that provides pairs of processor and sender - pipelineProvider := pipeline.NewProvider(logsconfig.NumberOfPipelines, auditor, &diagnostic.NoopMessageReceiver{}, nil, endpoints, context, agentimpl.NewStatusProvider(), hostnameimpl.NewHostnameService(), pkgconfigsetup.Datadog()) + pipelineProvider := pipeline.NewProvider(4, auditor, &diagnostic.NoopMessageReceiver{}, nil, endpoints, context, agentimpl.NewStatusProvider(), hostnameimpl.NewHostnameService(), pkgconfigsetup.Datadog()) pipelineProvider.Start() stopper.Add(pipelineProvider) diff --git a/pkg/security/resolvers/cgroup/model/model.go b/pkg/security/resolvers/cgroup/model/model.go index c916e45477876..1bde78216970f 100644 --- a/pkg/security/resolvers/cgroup/model/model.go +++ b/pkg/security/resolvers/cgroup/model/model.go @@ -15,7 +15,6 @@ import ( "github.com/DataDog/datadog-agent/pkg/security/secl/containerutils" "github.com/DataDog/datadog-agent/pkg/security/secl/model" - "github.com/DataDog/datadog-agent/pkg/security/utils" ) // CacheEntry cgroup resolver cache entry @@ -23,9 +22,8 @@ type CacheEntry struct { model.CGroupContext model.ContainerContext sync.RWMutex - Deleted *atomic.Bool - WorkloadSelector WorkloadSelector - PIDs map[uint32]bool + Deleted *atomic.Bool + PIDs map[uint32]bool } // NewCacheEntry returns a new instance of a CacheEntry @@ -78,27 +76,3 @@ func (cgce *CacheEntry) AddPID(pid uint32) { cgce.PIDs[pid] = true } - -// SetTags sets the tags for the provided workload -func (cgce *CacheEntry) SetTags(tags []string) { - cgce.Lock() - defer cgce.Unlock() - - cgce.Tags = tags - cgce.WorkloadSelector.Image = utils.GetTagValue("image_name", tags) - cgce.WorkloadSelector.Tag = utils.GetTagValue("image_tag", tags) - if len(cgce.WorkloadSelector.Image) != 0 && len(cgce.WorkloadSelector.Tag) == 0 { - cgce.WorkloadSelector.Tag = "latest" - } -} - -// GetWorkloadSelectorCopy returns a copy of the workload selector of this cgroup -func (cgce *CacheEntry) GetWorkloadSelectorCopy() *WorkloadSelector { - cgce.Lock() - defer cgce.Unlock() - - return &WorkloadSelector{ - Image: cgce.WorkloadSelector.Image, - Tag: cgce.WorkloadSelector.Tag, - } -} diff --git a/pkg/security/resolvers/cgroup/model/types.go b/pkg/security/resolvers/cgroup/model/types.go index d07f94be04121..09a9a66473aa6 100644 --- a/pkg/security/resolvers/cgroup/model/types.go +++ b/pkg/security/resolvers/cgroup/model/types.go @@ -61,3 +61,8 @@ func (ws WorkloadSelector) ToTags() []string { "image_tag:" + ws.Tag, } } + +// Copy returns a copy of the selector +func (ws WorkloadSelector) Copy() *WorkloadSelector { + return &ws +} diff --git a/pkg/security/resolvers/cgroup/resolver.go b/pkg/security/resolvers/cgroup/resolver.go index 825d7cc92cf42..dcb1de1e6d378 100644 --- a/pkg/security/resolvers/cgroup/resolver.go +++ b/pkg/security/resolvers/cgroup/resolver.go @@ -47,8 +47,10 @@ 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 + cgroups *simplelru.LRU[model.PathKey, *model.CGroupContext] + hostWorkloads *simplelru.LRU[containerutils.CGroupID, *cgroupModel.CacheEntry] + containerWorkloads *simplelru.LRU[containerutils.ContainerID, *cgroupModel.CacheEntry] } // NewResolver returns a new cgroups monitor @@ -56,16 +58,34 @@ 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 + + cr.cgroups, err = simplelru.NewLRU(2048, func(_ model.PathKey, _ *model.CGroupContext) {}) + if err != nil { + return nil, err + } + return cr, nil } @@ -78,7 +98,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 +122,34 @@ 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.cgroups.Add(process.CGroup.CGroupFile, &process.CGroup) 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() +// GetCGroupContext returns the cgroup context with the specified path key +func (cr *Resolver) GetCGroupContext(cgroupPath model.PathKey) (*model.CGroupContext, bool) { + cr.Lock() + defer cr.Unlock() - return cr.workloads.Get(id) + return cr.cgroups.Get(cgroupPath) } // 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 +157,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 +171,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 +186,18 @@ 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.cgroups.Remove(workload.CGroupFile) + 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.cgroups.Len() } diff --git a/pkg/security/resolvers/process/resolver_ebpf.go b/pkg/security/resolvers/process/resolver_ebpf.go index c9a3fd4f8ad7e..0e80c8aa2ae93 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" @@ -290,27 +290,61 @@ func (p *EBPFResolver) UpdateArgsEnvs(event *model.ArgsEnvsEvent) { } // AddForkEntry adds an entry to the local cache and returns the newly created entry -func (p *EBPFResolver) AddForkEntry(entry *model.ProcessCacheEntry, inode uint64, newEntryCb func(*model.ProcessCacheEntry, error)) { - if entry.Pid == 0 { - return +func (p *EBPFResolver) AddForkEntry(event *model.Event, newEntryCb func(*model.ProcessCacheEntry, error)) error { + p.ApplyBootTime(event.ProcessCacheEntry) + event.ProcessCacheEntry.SetSpan(event.SpanContext.SpanID, event.SpanContext.TraceID) + + if event.ProcessCacheEntry.Pid == 0 { + return errors.New("no pid") + } + if IsKThread(event.ProcessCacheEntry.PPid, event.ProcessCacheEntry.Pid) { + return errors.New("process is kthread") } p.Lock() defer p.Unlock() - - p.insertForkEntry(entry, inode, model.ProcessCacheEntryFromEvent, newEntryCb) + p.insertForkEntry(event.ProcessCacheEntry, event.PIDContext.ExecInode, model.ProcessCacheEntryFromEvent, newEntryCb) + return nil } // AddExecEntry adds an entry to the local cache and returns the newly created entry -func (p *EBPFResolver) AddExecEntry(entry *model.ProcessCacheEntry, inode uint64) { - if entry.Pid == 0 { - return - } - +func (p *EBPFResolver) AddExecEntry(event *model.Event) error { p.Lock() defer p.Unlock() - p.insertExecEntry(entry, inode, model.ProcessCacheEntryFromEvent) + var err error + if err := p.ResolveNewProcessCacheEntry(event.ProcessCacheEntry, event.ContainerContext); err != nil { + var errResolution *spath.ErrPathResolution + if errors.As(err, &errResolution) { + event.SetPathResolutionError(&event.ProcessCacheEntry.FileEvent, err) + } + } else { + if event.ProcessCacheEntry.Pid == 0 { + return errors.New("no pid context") + } + p.insertExecEntry(event.ProcessCacheEntry, event.PIDContext.ExecInode, model.ProcessCacheEntryFromEvent) + } + + event.Exec.Process = &event.ProcessCacheEntry.Process + + return err +} + +// ApplyExitEntry delete entry from the local cache if present +func (p *EBPFResolver) ApplyExitEntry(event *model.Event, newEntryCb func(*model.ProcessCacheEntry, error)) bool { + event.ProcessCacheEntry = p.resolve(event.PIDContext.Pid, event.PIDContext.Tid, event.PIDContext.ExecInode, false, newEntryCb) + if event.ProcessCacheEntry == nil { + // no need to dispatch an exit event that don't have the corresponding cache entry + return false + } + + // Use the event timestamp as exit time + // The local process cache hasn't been updated yet with the exit time when the exit event is first seen + // The pid_cache kernel map has the exit_time but it's only accessed if there's a local miss + event.ProcessCacheEntry.ExitTime = event.FieldHandlers.ResolveEventTime(event, &event.BaseEvent) + event.Exit.Process = &event.ProcessCacheEntry.Process + return true + } // enrichEventFromProc uses /proc to enrich a ProcessCacheEntry with additional metadata @@ -334,13 +368,16 @@ func (p *EBPFResolver) enrichEventFromProc(entry *model.ProcessCacheEntry, proc // Get the file fields of the process binary info, err := p.retrieveExecFileFields(procExecPath) if err != nil { + if !os.IsNotExist(err) { + seclog.Errorf("snapshot failed for %d: couldn't retrieve inode info: %s", proc.Pid, err) + } return fmt.Errorf("snapshot failed for %d: couldn't retrieve inode info: %w", proc.Pid, err) } // Retrieve the container ID of the process from /proc containerID, cgroup, err := p.containerResolver.GetContainerContext(pid) if err != nil { - return fmt.Errorf("snapshot failed for %d: couldn't parse container ID: %w", proc.Pid, err) + return fmt.Errorf("snapshot failed for %d: couldn't parse container and cgroup context: %w", proc.Pid, err) } entry.ContainerID = containerID @@ -384,14 +421,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)) @@ -465,11 +502,11 @@ func (p *EBPFResolver) enrichEventFromProc(entry *model.ProcessCacheEntry, proc func (p *EBPFResolver) retrieveExecFileFields(procExecPath string) (*model.FileFields, error) { fi, err := os.Stat(procExecPath) if err != nil { - return nil, fmt.Errorf("snapshot failed for `%s`: couldn't stat binary: %w", procExecPath, err) + return nil, err } stat, ok := fi.Sys().(*syscall.Stat_t) if !ok { - return nil, fmt.Errorf("snapshot failed for `%s`: couldn't stat binary", procExecPath) + return nil, errors.New("wrong type") } inode := stat.Ino @@ -483,11 +520,11 @@ func (p *EBPFResolver) retrieveExecFileFields(procExecPath string) (*model.FileF var fileFields model.FileFields if _, err := fileFields.UnmarshalBinary(data); err != nil { - return nil, fmt.Errorf("unable to unmarshal entry for inode `%d`", inode) + return nil, fmt.Errorf("unable to unmarshal entry for inode `%d`: %v", inode, err) } if fileFields.Inode == 0 { - return nil, errors.New("not found") + return nil, fmt.Errorf("inode `%d` not found: %v", inode, err) } return &fileFields, nil @@ -520,6 +557,7 @@ func (p *EBPFResolver) insertEntry(entry, prev *model.ProcessCacheEntry, source } func (p *EBPFResolver) insertForkEntry(entry *model.ProcessCacheEntry, inode uint64, source uint64, newEntryCb func(*model.ProcessCacheEntry, error)) { + if entry.Pid == 0 { return } @@ -529,7 +567,6 @@ func (p *EBPFResolver) insertForkEntry(entry *model.ProcessCacheEntry, inode uin // this shouldn't happen but it is better to exit the prev and let the new one replace it prev.Exit(entry.ForkTime) } - if entry.Pid != 1 { parent := p.entryCache[entry.PPid] if entry.PPid >= 1 && inode != 0 && (parent == nil || parent.FileEvent.Inode != inode) { @@ -568,7 +605,6 @@ func (p *EBPFResolver) insertExecEntry(entry *model.ProcessCacheEntry, inode uin prev.ApplyExecTimeOf(entry) return } - prev.Exec(entry) } else { entry.IsParentMissing = true @@ -654,7 +690,6 @@ func (p *EBPFResolver) resolveFileFieldsPath(e *model.FileFields, pce *model.Pro err error maxDepthRetry = 3 ) - for maxDepthRetry > 0 { pathnameStr, mountPath, source, origin, err = p.pathResolver.ResolveFileFieldsPath(e, &pce.PIDContext, ctrCtx) if err == nil { @@ -686,7 +721,6 @@ func (p *EBPFResolver) SetProcessPath(fileEvent *model.FileEvent, pce *model.Pro if fileEvent.Inode == 0 { return onError("", &model.ErrInvalidKeyPath{Inode: fileEvent.Inode, MountID: fileEvent.MountID}) } - pathnameStr, mountPath, source, origin, err := p.resolveFileFieldsPath(&fileEvent.FileFields, pce, ctrCtx) if err != nil { return onError(pathnameStr, err) @@ -852,7 +886,7 @@ func (p *EBPFResolver) resolveFromKernelMaps(pid, tid uint32, inode uint64, newE // is no insurance that the parent of this process is still running, we can't use our user space cache to check if // the parent is in a container. In other words, we have to fall back to /proc to query the container ID of the // process. - if entry.ContainerID == "" || entry.CGroup.CGroupFile.Inode == 0 { + if entry.CGroup.CGroupFile.Inode == 0 { if containerID, cgroup, err := p.containerResolver.GetContainerContext(pid); err == nil { entry.CGroup.Merge(&cgroup) entry.ContainerID = containerID diff --git a/pkg/security/resolvers/process/resolver_test.go b/pkg/security/resolvers/process/resolver_test.go index c2febee639beb..16432e67338e1 100644 --- a/pkg/security/resolvers/process/resolver_test.go +++ b/pkg/security/resolvers/process/resolver_test.go @@ -16,10 +16,44 @@ import ( "github.com/avast/retry-go/v4" "github.com/stretchr/testify/assert" + "github.com/DataDog/datadog-agent/pkg/security/resolvers/cgroup" + "github.com/DataDog/datadog-agent/pkg/security/resolvers/path" + "github.com/DataDog/datadog-agent/pkg/security/resolvers/usergroup" "github.com/DataDog/datadog-agent/pkg/security/secl/model" + "github.com/DataDog/datadog-agent/pkg/util/ktime" "github.com/DataDog/datadog-go/v5/statsd" ) +func newFakeForkEvent(ppid, pid int, inode uint64, resolver *EBPFResolver) *model.Event { + e := model.NewFakeEvent() + e.Type = uint32(model.ForkEventType) + e.ProcessCacheEntry = resolver.NewProcessCacheEntry(model.PIDContext{Pid: uint32(pid), Tid: uint32(pid)}) + e.PIDContext = e.ProcessCacheEntry.PIDContext + e.ProcessContext = &e.ProcessCacheEntry.ProcessContext + e.ProcessCacheEntry.ForkTime = time.Now() + e.ProcessCacheEntry.PPid = uint32(ppid) + e.ProcessCacheEntry.Pid = uint32(pid) + e.ProcessCacheEntry.FileEvent.Inode = inode + return e +} + +func newFakeExecEvent(ppid, pid int, inode uint64, resolver *EBPFResolver) *model.Event { + e := model.NewFakeEvent() + e.Type = uint32(model.ExecEventType) + e.ProcessCacheEntry = resolver.NewProcessCacheEntry(model.PIDContext{Pid: uint32(pid), Tid: uint32(pid)}) + e.PIDContext = e.ProcessCacheEntry.PIDContext + e.ProcessContext = &e.ProcessCacheEntry.ProcessContext + e.ProcessCacheEntry.ExecTime = time.Now() + e.ProcessCacheEntry.PPid = uint32(ppid) + e.ProcessCacheEntry.Pid = uint32(pid) + e.ProcessCacheEntry.FileEvent.Inode = inode + return e +} + +func exit(event *model.Event) { + event.Type = uint32(model.ExitEventType) +} + func testCacheSize(t *testing.T, resolver *EBPFResolver) { err := retry.Do( func() error { @@ -33,701 +67,717 @@ func testCacheSize(t *testing.T, resolver *EBPFResolver) { assert.NoError(t, err) } -func TestFork1st(t *testing.T) { - resolver, err := NewEBPFResolver(nil, nil, &statsd.NoOpClient{}, nil, nil, nil, nil, nil, nil, nil, nil, NewResolverOpts()) +func newResolver() (*EBPFResolver, error) { + timeResolver, err := ktime.NewResolver() + if err != nil { + return nil, err + } + + cgroupsResolver, err := cgroup.NewResolver() + if err != nil { + return nil, err + } + + userGroupResolver, err := usergroup.NewResolver(cgroupsResolver) + if err != nil { + return nil, err + } + + resolver, err := NewEBPFResolver(nil, nil, &statsd.NoOpClient{}, nil, nil, nil, cgroupsResolver, userGroupResolver, timeResolver, &path.NoOpResolver{}, nil, NewResolverOpts()) if err != nil { - t.Fatal(err) + return nil, err } - parent := resolver.NewProcessCacheEntry(model.PIDContext{Pid: 1, Tid: 1}) - parent.ForkTime = time.Now() + return resolver, nil +} + +func TestFork1st(t *testing.T) { + + resolver, err := newResolver() + if err != nil { + t.Fatal() + } - child := resolver.NewProcessCacheEntry(model.PIDContext{Pid: 2, Tid: 2}) - child.PPid = parent.Pid - child.ForkTime = time.Now() + parent := newFakeForkEvent(0, 3, 123, resolver) + child := newFakeForkEvent(3, 4, 123, resolver) - // parent - resolver.AddForkEntry(parent, 0, nil) - assert.Equal(t, parent, resolver.entryCache[parent.Pid]) + // X(pid:3) + resolver.AddForkEntry(parent, nil) + assert.Equal(t, parent.ProcessCacheEntry, resolver.entryCache[parent.ProcessCacheEntry.Pid]) assert.Equal(t, 1, len(resolver.entryCache)) assert.EqualValues(t, 1, resolver.cacheSize.Load()) - // parent - // \ child - resolver.AddForkEntry(child, 0, nil) - assert.Equal(t, child, resolver.entryCache[child.Pid]) + // X(pid:3) + // | + // X(pid:4) + resolver.AddForkEntry(child, nil) + assert.Equal(t, child.ProcessCacheEntry, resolver.entryCache[child.ProcessCacheEntry.Pid]) assert.Equal(t, 2, len(resolver.entryCache)) - assert.Equal(t, parent, child.Ancestor) + assert.Equal(t, parent.ProcessCacheEntry, child.ProcessCacheEntry.Ancestor) assert.EqualValues(t, 2, resolver.cacheSize.Load()) - // parent - resolver.DeleteEntry(child.Pid, time.Now()) - assert.Nil(t, resolver.entryCache[child.Pid]) - assert.Equal(t, 1, len(resolver.entryCache)) + // X(pid:3) + exit(child) + resolver.ApplyExitEntry(child, nil) + resolver.DeleteEntry(child.ProcessCacheEntry.Pid, child.ResolveEventTime()) - // nothing - resolver.DeleteEntry(parent.Pid, time.Now()) - assert.Zero(t, len(resolver.entryCache)) + assert.Nil(t, resolver.entryCache[child.ProcessCacheEntry.Pid]) + assert.Equal(t, 1, len(resolver.entryCache)) + // nothing in the entryCache + exit(parent) + resolver.ApplyExitEntry(parent, nil) + resolver.DeleteEntry(parent.ProcessCacheEntry.Pid, parent.ResolveEventTime()) + assert.Nil(t, resolver.entryCache[parent.ProcessCacheEntry.Pid]) + assert.Equal(t, 0, len(resolver.entryCache)) testCacheSize(t, resolver) } func TestFork2nd(t *testing.T) { - resolver, err := NewEBPFResolver(nil, nil, &statsd.NoOpClient{}, nil, nil, nil, nil, nil, nil, nil, nil, NewResolverOpts()) + + resolver, err := newResolver() if err != nil { - t.Fatal(err) + t.Fatal() } - parent := resolver.NewProcessCacheEntry(model.PIDContext{Pid: 1, Tid: 1}) - parent.ForkTime = time.Now() - - child := resolver.NewProcessCacheEntry(model.PIDContext{Pid: 2, Tid: 2}) - child.PPid = parent.Pid - child.ForkTime = time.Now() + parent := newFakeForkEvent(0, 3, 123, resolver) + child := newFakeForkEvent(3, 4, 123, resolver) - // parent - resolver.AddForkEntry(parent, 0, nil) - assert.Equal(t, parent, resolver.entryCache[parent.Pid]) + // X(pid:3) + resolver.AddForkEntry(parent, nil) + assert.Equal(t, parent.ProcessCacheEntry, resolver.entryCache[parent.ProcessCacheEntry.Pid]) assert.Equal(t, 1, len(resolver.entryCache)) assert.EqualValues(t, 1, resolver.cacheSize.Load()) - // parent - // \ child - resolver.AddForkEntry(child, 0, nil) - assert.Equal(t, child, resolver.entryCache[child.Pid]) + // X(pid:3) + // | + // X(pid:4) + resolver.AddForkEntry(child, nil) + assert.Equal(t, child.ProcessCacheEntry, resolver.entryCache[child.ProcessCacheEntry.Pid]) assert.Equal(t, 2, len(resolver.entryCache)) - assert.Equal(t, parent, child.Ancestor) + assert.Equal(t, parent.ProcessCacheEntry, child.ProcessCacheEntry.Ancestor) assert.EqualValues(t, 2, resolver.cacheSize.Load()) - // [parent] - // \ child - resolver.DeleteEntry(parent.Pid, time.Now()) - assert.Nil(t, resolver.entryCache[parent.Pid]) + // [X(pid:3)] + // | + // X(pid:4) + exit(parent) + resolver.ApplyExitEntry(parent, nil) + resolver.DeleteEntry(parent.ProcessContext.Pid, parent.ResolveEventTime()) + assert.Nil(t, resolver.entryCache[parent.ProcessCacheEntry.Pid]) assert.Equal(t, 1, len(resolver.entryCache)) - assert.Equal(t, parent, child.Ancestor) + assert.Equal(t, parent.ProcessCacheEntry, child.ProcessCacheEntry.Ancestor) - // nothing - resolver.DeleteEntry(child.Pid, time.Now()) - assert.Zero(t, len(resolver.entryCache)) + // nothing in the entryCache + exit(child) + resolver.ApplyExitEntry(child, nil) + resolver.DeleteEntry(child.ProcessContext.Pid, child.ResolveEventTime()) + assert.Nil(t, resolver.entryCache[child.ProcessCacheEntry.Pid]) + assert.Equal(t, 0, len(resolver.entryCache)) testCacheSize(t, resolver) } func TestForkExec(t *testing.T) { - resolver, err := NewEBPFResolver(nil, nil, &statsd.NoOpClient{}, nil, nil, nil, nil, nil, nil, nil, nil, NewResolverOpts()) + resolver, err := newResolver() if err != nil { - t.Fatal(err) + t.Fatal() } - parent := resolver.NewProcessCacheEntry(model.PIDContext{Pid: 1, Tid: 1}) - parent.ForkTime = time.Now() - - child := resolver.NewProcessCacheEntry(model.PIDContext{Pid: 2, Tid: 2}) - child.PPid = parent.Pid - child.ForkTime = time.Now() + parent := newFakeForkEvent(0, 3, 123, resolver) + child := newFakeForkEvent(3, 4, 123, resolver) + exec := newFakeExecEvent(3, 4, 456, resolver) - exec := resolver.NewProcessCacheEntry(model.PIDContext{Pid: child.Pid, Tid: child.Pid}) - exec.PPid = child.PPid - exec.FileEvent.Inode = 123 - exec.ExecTime = time.Now() - - // parent - resolver.AddForkEntry(parent, 0, nil) - assert.Equal(t, parent, resolver.entryCache[parent.Pid]) + // X(pid:3) + resolver.AddForkEntry(parent, nil) + assert.Equal(t, parent.ProcessCacheEntry, resolver.entryCache[parent.ProcessCacheEntry.Pid]) assert.Equal(t, 1, len(resolver.entryCache)) assert.EqualValues(t, 1, resolver.cacheSize.Load()) - // parent - // \ child - resolver.AddForkEntry(child, 0, nil) - assert.Equal(t, child, resolver.entryCache[child.Pid]) + // X(pid:3) + // | + // X(pid:4) + resolver.AddForkEntry(child, nil) + assert.Equal(t, child.ProcessCacheEntry, resolver.entryCache[child.ProcessCacheEntry.Pid]) assert.Equal(t, 2, len(resolver.entryCache)) - assert.Equal(t, parent, child.Ancestor) + assert.Equal(t, parent.ProcessCacheEntry, child.ProcessCacheEntry.Ancestor) assert.EqualValues(t, 2, resolver.cacheSize.Load()) - // parent - // \ [child] -> exec - resolver.AddExecEntry(exec, 0) - assert.Equal(t, exec, resolver.entryCache[exec.Pid]) + // X(pid:3) + // | + // X(pid:4) -- Y(pid:4) + resolver.AddExecEntry(exec) + assert.Equal(t, exec.ProcessCacheEntry, resolver.entryCache[exec.ProcessCacheEntry.Pid]) assert.Equal(t, 2, len(resolver.entryCache)) - assert.Equal(t, child, exec.Ancestor) - assert.Equal(t, parent, exec.Ancestor.Ancestor) + assert.Equal(t, child.ProcessCacheEntry, exec.ProcessCacheEntry.Ancestor) + assert.Equal(t, parent.ProcessCacheEntry, exec.ProcessCacheEntry.Ancestor.Ancestor) assert.EqualValues(t, 3, resolver.cacheSize.Load()) - // [parent] - // \ [child] -> exec - resolver.DeleteEntry(parent.Pid, time.Now()) - assert.Nil(t, resolver.entryCache[parent.Pid]) + // [X(pid:3)] + // | + // X(pid:4) -- Y(pid:4) + exit(parent) + resolver.ApplyExitEntry(parent, nil) + resolver.DeleteEntry(parent.ProcessContext.Pid, parent.ResolveEventTime()) + assert.Nil(t, resolver.entryCache[parent.ProcessCacheEntry.Pid]) assert.Equal(t, 1, len(resolver.entryCache)) - assert.Equal(t, child, exec.Ancestor) - assert.Equal(t, parent, exec.Ancestor.Ancestor) + assert.Equal(t, child.ProcessCacheEntry, exec.ProcessCacheEntry.Ancestor) + assert.Equal(t, parent.ProcessCacheEntry, exec.ProcessCacheEntry.Ancestor.Ancestor) - // nothing - resolver.DeleteEntry(exec.Pid, time.Now()) + // nothing in the entryCache + exit(child) + resolver.ApplyExitEntry(child, nil) + resolver.DeleteEntry(child.ProcessContext.Pid, child.ResolveEventTime()) assert.Zero(t, len(resolver.entryCache)) - testCacheSize(t, resolver) } func TestOrphanExec(t *testing.T) { - resolver, err := NewEBPFResolver(nil, nil, &statsd.NoOpClient{}, nil, nil, nil, nil, nil, nil, nil, nil, NewResolverOpts()) + resolver, err := newResolver() if err != nil { - t.Fatal(err) + t.Fatal() } - parent := resolver.NewProcessCacheEntry(model.PIDContext{Pid: 1, Tid: 1}) - parent.ForkTime = time.Now() + parent := newFakeForkEvent(0, 3, 123, resolver) + child := newFakeForkEvent(3, 4, 123, resolver) + exec := newFakeExecEvent(3, 4, 456, resolver) - child := resolver.NewProcessCacheEntry(model.PIDContext{Pid: 2, Tid: 2}) - child.PPid = parent.Pid - child.ForkTime = time.Now() - - exec := resolver.NewProcessCacheEntry(model.PIDContext{Pid: child.Pid, Tid: child.Pid}) - exec.Pid = child.Pid - exec.PPid = child.PPid - exec.FileEvent.Inode = 123 - exec.ExecTime = time.Now() - - // parent - resolver.AddForkEntry(parent, 0, nil) - assert.Equal(t, parent, resolver.entryCache[parent.Pid]) + // X(pid:3) + resolver.AddForkEntry(parent, nil) + assert.Equal(t, parent.ProcessCacheEntry, resolver.entryCache[parent.ProcessCacheEntry.Pid]) assert.Equal(t, 1, len(resolver.entryCache)) assert.EqualValues(t, 1, resolver.cacheSize.Load()) - // parent - // \ child - resolver.AddForkEntry(child, 0, nil) - assert.Equal(t, child, resolver.entryCache[child.Pid]) + // X(pid:3) + // | + // X(pid:4) + resolver.AddForkEntry(child, nil) + assert.Equal(t, child.ProcessCacheEntry, resolver.entryCache[child.ProcessCacheEntry.Pid]) assert.Equal(t, 2, len(resolver.entryCache)) - assert.Equal(t, parent, child.Ancestor) + assert.Equal(t, parent.ProcessCacheEntry, child.ProcessCacheEntry.Ancestor) assert.EqualValues(t, 2, resolver.cacheSize.Load()) - // [parent] - // \ child - resolver.DeleteEntry(parent.Pid, time.Now()) - assert.Nil(t, resolver.entryCache[parent.Pid]) + // [X(pid:3)] + // | + // X(pid:4) + exit(parent) + resolver.ApplyExitEntry(parent, nil) + resolver.DeleteEntry(parent.ProcessContext.Pid, parent.ResolveEventTime()) + assert.Nil(t, resolver.entryCache[parent.ProcessCacheEntry.Pid]) assert.Equal(t, 1, len(resolver.entryCache)) - assert.Equal(t, parent, child.Ancestor) + assert.Equal(t, parent.ProcessCacheEntry, child.ProcessCacheEntry.Ancestor) - // [parent] - // \ [child] -> exec - resolver.AddExecEntry(exec, 0) - assert.Equal(t, exec, resolver.entryCache[exec.Pid]) + // [X(pid:3)] + // | + // X(pid:4) --> Y(pid:4) + resolver.AddExecEntry(exec) + assert.Equal(t, exec.ProcessCacheEntry, resolver.entryCache[exec.ProcessCacheEntry.Pid]) assert.Equal(t, 1, len(resolver.entryCache)) - assert.Equal(t, child, exec.Ancestor) - assert.Equal(t, parent, exec.Ancestor.Ancestor) + assert.Equal(t, child.ProcessCacheEntry, exec.ProcessCacheEntry.Ancestor) + assert.Equal(t, parent.ProcessCacheEntry, exec.ProcessCacheEntry.Ancestor.Ancestor) assert.EqualValues(t, 3, resolver.cacheSize.Load()) - // nothing - resolver.DeleteEntry(exec.Pid, time.Now()) + // nothing in the entryCache + exit(exec) + resolver.ApplyExitEntry(exec, nil) + resolver.DeleteEntry(exec.ProcessCacheEntry.Pid, time.Now()) assert.Zero(t, len(resolver.entryCache)) testCacheSize(t, resolver) } func TestForkExecExec(t *testing.T) { - resolver, err := NewEBPFResolver(nil, nil, &statsd.NoOpClient{}, nil, nil, nil, nil, nil, nil, nil, nil, NewResolverOpts()) + resolver, err := newResolver() if err != nil { - t.Fatal(err) + t.Fatal() } - parent := resolver.NewProcessCacheEntry(model.PIDContext{Pid: 1, Tid: 1}) - parent.ForkTime = time.Now() - - child := resolver.NewProcessCacheEntry(model.PIDContext{Pid: 2, Tid: 2}) - child.PPid = parent.Pid - child.ForkTime = time.Now() - - exec1 := resolver.NewProcessCacheEntry(model.PIDContext{Pid: child.Pid, Tid: child.Pid}) - exec1.PPid = child.PPid - exec1.FileEvent.Inode = 123 - exec1.ExecTime = time.Now() + parent := newFakeForkEvent(0, 3, 123, resolver) + child := newFakeForkEvent(3, 4, 123, resolver) + exec1 := newFakeExecEvent(3, 4, 456, resolver) + exec2 := newFakeExecEvent(3, 4, 789, resolver) - exec2 := resolver.NewProcessCacheEntry(model.PIDContext{Pid: child.Pid, Tid: child.Pid}) - exec2.Pid = child.Pid - exec2.PPid = child.PPid - exec2.FileEvent.Inode = 456 - exec2.ExecTime = time.Now() - - // parent - resolver.AddForkEntry(parent, 0, nil) - assert.Equal(t, parent, resolver.entryCache[parent.Pid]) + // X(pid:3) + resolver.AddForkEntry(parent, nil) + assert.Equal(t, parent.ProcessCacheEntry, resolver.entryCache[parent.ProcessCacheEntry.Pid]) assert.Equal(t, 1, len(resolver.entryCache)) assert.EqualValues(t, 1, resolver.cacheSize.Load()) - // parent - // \ child - resolver.AddForkEntry(child, 0, nil) - assert.Equal(t, child, resolver.entryCache[child.Pid]) + // X(pid:3) + // | + // X(pid:4) + resolver.AddForkEntry(child, nil) + assert.Equal(t, child.ProcessCacheEntry, resolver.entryCache[child.ProcessCacheEntry.Pid]) assert.Equal(t, 2, len(resolver.entryCache)) - assert.Equal(t, parent, child.Ancestor) + assert.Equal(t, parent.ProcessCacheEntry, child.ProcessCacheEntry.Ancestor) assert.EqualValues(t, 2, resolver.cacheSize.Load()) - // [parent] - // \ child - resolver.DeleteEntry(parent.Pid, time.Now()) - assert.Nil(t, resolver.entryCache[parent.Pid]) + // [X(pid:3)] + // | + // X(pid:4) + exit(parent) + resolver.ApplyExitEntry(parent, nil) + resolver.DeleteEntry(parent.ProcessContext.Pid, parent.ResolveEventTime()) + assert.Nil(t, resolver.entryCache[parent.ProcessCacheEntry.Pid]) assert.Equal(t, 1, len(resolver.entryCache)) - assert.Equal(t, parent, child.Ancestor) + assert.Equal(t, parent.ProcessCacheEntry, child.ProcessCacheEntry.Ancestor) - // [parent] - // \ [child] -> exec1 - resolver.AddExecEntry(exec1, 0) - assert.Equal(t, exec1, resolver.entryCache[exec1.Pid]) + // [X(pid:3)] + // | + // X(pid:4) -- Y(pid:4) + resolver.AddExecEntry(exec1) + assert.Equal(t, exec1.ProcessCacheEntry, resolver.entryCache[exec1.ProcessCacheEntry.Pid]) assert.Equal(t, 1, len(resolver.entryCache)) - assert.Equal(t, child, exec1.Ancestor) - assert.Equal(t, parent, exec1.Ancestor.Ancestor) + assert.Equal(t, child.ProcessCacheEntry, exec1.ProcessCacheEntry.Ancestor) + assert.Equal(t, parent.ProcessCacheEntry, exec1.ProcessCacheEntry.Ancestor.Ancestor) assert.EqualValues(t, 3, resolver.cacheSize.Load()) - // [parent] - // \ [child] -> [exec1] -> exec2 - resolver.AddExecEntry(exec2, 0) - assert.Equal(t, exec2, resolver.entryCache[exec2.Pid]) + // [X(pid:3)] + // | + // X(pid:4) -- Y(pid:4) -- Z(pid:4) + resolver.AddExecEntry(exec2) + assert.Equal(t, exec2.ProcessCacheEntry, resolver.entryCache[exec2.ProcessCacheEntry.Pid]) assert.Equal(t, 1, len(resolver.entryCache)) - assert.Equal(t, exec1, exec2.Ancestor) - assert.Equal(t, child, exec2.Ancestor.Ancestor) - assert.Equal(t, parent, exec2.Ancestor.Ancestor.Ancestor) + assert.Equal(t, exec1.ProcessCacheEntry, exec2.ProcessCacheEntry.Ancestor) + assert.Equal(t, child.ProcessCacheEntry, exec2.ProcessCacheEntry.Ancestor.Ancestor) + assert.Equal(t, parent.ProcessCacheEntry, exec2.ProcessCacheEntry.Ancestor.Ancestor.Ancestor) assert.EqualValues(t, 4, resolver.cacheSize.Load()) - // nothing - resolver.DeleteEntry(exec2.Pid, time.Now()) + // nothing in the entryCache in the entryCache + exit(exec2) + resolver.ApplyExitEntry(exec2, nil) + resolver.DeleteEntry(exec1.ProcessCacheEntry.Pid, time.Now()) assert.Zero(t, len(resolver.entryCache)) testCacheSize(t, resolver) } func TestForkReuse(t *testing.T) { - resolver, err := NewEBPFResolver(nil, nil, &statsd.NoOpClient{}, nil, nil, nil, nil, nil, nil, nil, nil, NewResolverOpts()) + resolver, err := newResolver() if err != nil { - t.Fatal(err) + t.Fatal() } - parent1 := resolver.NewProcessCacheEntry(model.PIDContext{Pid: 1, Tid: 1}) - parent1.ForkTime = time.Now() - - child1 := resolver.NewProcessCacheEntry(model.PIDContext{Pid: 2, Tid: 2}) - child1.PPid = parent1.Pid - child1.ForkTime = time.Now() - - exec1 := resolver.NewProcessCacheEntry(model.PIDContext{Pid: child1.Pid, Tid: child1.Pid}) - exec1.PPid = child1.PPid - exec1.FileEvent.Inode = 123 - exec1.ExecTime = time.Now() + parent1 := newFakeForkEvent(0, 3, 123, resolver) + child1 := newFakeForkEvent(3, 4, 123, resolver) + exec1 := newFakeExecEvent(3, 4, 456, resolver) + parent2 := newFakeForkEvent(0, 3, 123, resolver) + child2 := newFakeForkEvent(3, 5, 123, resolver) - parent2 := resolver.NewProcessCacheEntry(model.PIDContext{Pid: 1, Tid: 1}) - parent2.ForkTime = time.Now() - - child2 := resolver.NewProcessCacheEntry(model.PIDContext{Pid: 3, Tid: 3}) - child2.PPid = parent2.Pid - child2.ForkTime = time.Now() - - // parent1 - resolver.AddForkEntry(parent1, 0, nil) - assert.Equal(t, parent1, resolver.entryCache[parent1.Pid]) + // X(pid:3) + resolver.AddForkEntry(parent1, nil) + assert.Equal(t, parent1.ProcessCacheEntry, resolver.entryCache[parent1.ProcessCacheEntry.Pid]) assert.Equal(t, 1, len(resolver.entryCache)) assert.EqualValues(t, 1, resolver.cacheSize.Load()) - // parent1 - // \ child1 - resolver.AddForkEntry(child1, 0, nil) - assert.Equal(t, child1, resolver.entryCache[child1.Pid]) + // X(pid:3) + // | + // X(pid:4) + resolver.AddForkEntry(child1, nil) + assert.Equal(t, child1.ProcessCacheEntry, resolver.entryCache[child1.ProcessCacheEntry.Pid]) assert.Equal(t, 2, len(resolver.entryCache)) - assert.Equal(t, parent1, child1.Ancestor) + assert.Equal(t, parent1.ProcessCacheEntry, child1.ProcessCacheEntry.Ancestor) assert.EqualValues(t, 2, resolver.cacheSize.Load()) - // [parent1] - // \ child1 - resolver.DeleteEntry(parent1.Pid, time.Now()) - assert.Nil(t, resolver.entryCache[parent1.Pid]) + // [X(pid:3)] + // | + // X(pid:4) + exit(parent1) + resolver.ApplyExitEntry(parent1, nil) + resolver.DeleteEntry(parent1.ProcessContext.Pid, parent1.ResolveEventTime()) + assert.Nil(t, resolver.entryCache[parent1.ProcessCacheEntry.Pid]) assert.Equal(t, 1, len(resolver.entryCache)) - assert.Equal(t, parent1, child1.Ancestor) + assert.Equal(t, parent1.ProcessCacheEntry, child1.ProcessCacheEntry.Ancestor) - // [parent1] - // \ [child1] -> exec1 - resolver.AddExecEntry(exec1, 0) - assert.Equal(t, exec1, resolver.entryCache[exec1.Pid]) + // [X(pid:3)] + // | + // X(pid:4) -- Y(pid:4) + resolver.AddExecEntry(exec1) + assert.Equal(t, exec1.ProcessCacheEntry, resolver.entryCache[exec1.ProcessCacheEntry.Pid]) assert.Equal(t, 1, len(resolver.entryCache)) - assert.Equal(t, child1, exec1.Ancestor) - assert.Equal(t, parent1, exec1.Ancestor.Ancestor) + assert.Equal(t, child1.ProcessCacheEntry, exec1.ProcessCacheEntry.Ancestor) + assert.Equal(t, parent1.ProcessCacheEntry, exec1.ProcessCacheEntry.Ancestor.Ancestor) assert.EqualValues(t, 3, resolver.cacheSize.Load()) - // [parent1:pid1] - // \ [child1] -> exec1 + // [X(pid:3)] + // | + // X(pid:4) -- Y(pid:4) // - // parent2:pid1 - resolver.AddForkEntry(parent2, 0, nil) - assert.Equal(t, parent2, resolver.entryCache[parent2.Pid]) + // Z(pid:3) + resolver.AddForkEntry(parent2, nil) + assert.Equal(t, parent2.ProcessCacheEntry, resolver.entryCache[parent2.ProcessCacheEntry.Pid]) assert.Equal(t, 2, len(resolver.entryCache)) assert.EqualValues(t, 4, resolver.cacheSize.Load()) - // [parent1:pid1] - // \ [child1] -> exec1 + // [X(pid:3)] + // | + // X(pid:4) -- Y(pid:4) // - // parent2:pid1 - // \ child2 - resolver.AddForkEntry(child2, 0, nil) - assert.Equal(t, child2, resolver.entryCache[child2.Pid]) + // Z(pid:3) + // | + // T(pid:5) + resolver.AddForkEntry(child2, nil) + assert.Equal(t, child2.ProcessCacheEntry, resolver.entryCache[child2.ProcessCacheEntry.Pid]) assert.Equal(t, 3, len(resolver.entryCache)) - assert.Equal(t, parent2, child2.Ancestor) + assert.Equal(t, parent2.ProcessCacheEntry, child2.ProcessCacheEntry.Ancestor) assert.EqualValues(t, 5, resolver.cacheSize.Load()) - // parent2:pid1 - // \ child2 - resolver.DeleteEntry(exec1.Pid, time.Now()) - assert.Nil(t, resolver.entryCache[exec1.Pid]) + // Z(pid:3) + // | + // T(pid:5) + exit(exec1) + resolver.ApplyExitEntry(exec1, nil) + resolver.DeleteEntry(exec1.ProcessContext.Pid, exec1.ResolveEventTime()) + assert.Nil(t, resolver.entryCache[exec1.ProcessCacheEntry.Pid]) assert.Equal(t, 2, len(resolver.entryCache)) - // [parent2:pid1] - // \ child2 - resolver.DeleteEntry(parent2.Pid, time.Now()) - assert.Nil(t, resolver.entryCache[parent2.Pid]) + // [Z(pid:3)] + // | + // T(pid:5) + exit(parent2) + resolver.ApplyExitEntry(parent2, nil) + resolver.DeleteEntry(parent2.ProcessContext.Pid, parent2.ResolveEventTime()) + assert.Nil(t, resolver.entryCache[parent2.ProcessCacheEntry.Pid]) assert.Equal(t, 1, len(resolver.entryCache)) - assert.Equal(t, parent2, child2.Ancestor) + assert.Equal(t, parent2.ProcessCacheEntry, child2.ProcessCacheEntry.Ancestor) - // nothing - resolver.DeleteEntry(child2.Pid, time.Now()) + // nothing in the entryCache + exit(child2) + resolver.ApplyExitEntry(child2, nil) + resolver.DeleteEntry(child2.ProcessCacheEntry.Pid, child2.ResolveEventTime()) assert.Zero(t, len(resolver.entryCache)) testCacheSize(t, resolver) } func TestForkForkExec(t *testing.T) { - resolver, err := NewEBPFResolver(nil, nil, &statsd.NoOpClient{}, nil, nil, nil, nil, nil, nil, nil, nil, NewResolverOpts()) + resolver, err := newResolver() if err != nil { - t.Fatal(err) + t.Fatal() } - parent := resolver.NewProcessCacheEntry(model.PIDContext{Pid: 1, Tid: 1}) - parent.ForkTime = time.Now() - - child := resolver.NewProcessCacheEntry(model.PIDContext{Pid: 2, Tid: 2}) - child.PPid = parent.Pid - child.ForkTime = time.Now() + parent := newFakeForkEvent(0, 3, 123, resolver) + child := newFakeForkEvent(3, 4, 123, resolver) + grandChild := newFakeForkEvent(4, 5, 123, resolver) + childExec := newFakeExecEvent(3, 4, 456, resolver) - grandChild := resolver.NewProcessCacheEntry(model.PIDContext{Pid: 3, Tid: 3}) - grandChild.PPid = child.Pid - grandChild.ForkTime = time.Now() - - childExec := resolver.NewProcessCacheEntry(model.PIDContext{Pid: child.Pid, Tid: child.Pid}) - childExec.Pid = child.Pid - childExec.PPid = child.PPid - childExec.FileEvent.Inode = 123 - childExec.ExecTime = time.Now() - - // parent - resolver.AddForkEntry(parent, 0, nil) - assert.Equal(t, parent, resolver.entryCache[parent.Pid]) + // X(pid:3) + resolver.AddForkEntry(parent, nil) + assert.Equal(t, parent.ProcessCacheEntry, resolver.entryCache[parent.ProcessCacheEntry.Pid]) assert.Equal(t, 1, len(resolver.entryCache)) - // parent - // \ child - resolver.AddForkEntry(child, 0, nil) - assert.Equal(t, child, resolver.entryCache[child.Pid]) + // X(pid:3) + // | + // X(pid:4) + resolver.AddForkEntry(child, nil) + assert.Equal(t, child.ProcessCacheEntry, resolver.entryCache[child.ProcessCacheEntry.Pid]) assert.Equal(t, 2, len(resolver.entryCache)) - assert.Equal(t, parent, child.Ancestor) - - // parent - // \ child - // \ grandChild - resolver.AddForkEntry(grandChild, 0, nil) - assert.Equal(t, grandChild, resolver.entryCache[grandChild.Pid]) + assert.Equal(t, parent.ProcessCacheEntry, child.ProcessCacheEntry.Ancestor) + + // X(pid:3) + // | + // X(pid:4) + // | + // X(pid:5) + resolver.AddForkEntry(grandChild, nil) + assert.Equal(t, grandChild.ProcessCacheEntry, resolver.entryCache[grandChild.ProcessCacheEntry.Pid]) assert.Equal(t, 3, len(resolver.entryCache)) - assert.Equal(t, child, grandChild.Ancestor) - assert.Equal(t, parent, grandChild.Ancestor.Ancestor) - - // parent - // \ [child] -> childExec - // \ grandChild - resolver.AddExecEntry(childExec, 0) - assert.Equal(t, childExec, resolver.entryCache[childExec.Pid]) + assert.Equal(t, child.ProcessCacheEntry, grandChild.ProcessCacheEntry.Ancestor) + assert.Equal(t, parent.ProcessCacheEntry, grandChild.ProcessCacheEntry.Ancestor.Ancestor) + + // X(pid:3) + // | + // X(pid:4) -- Y(pid:4) + // | + // X(pid:5) + resolver.AddExecEntry(childExec) + assert.Equal(t, childExec.ProcessCacheEntry, resolver.entryCache[childExec.ProcessCacheEntry.Pid]) assert.Equal(t, 3, len(resolver.entryCache)) - assert.Equal(t, child, childExec.Ancestor) - assert.Equal(t, parent, childExec.Ancestor.Ancestor) - assert.Equal(t, child, grandChild.Ancestor) - assert.Equal(t, parent, grandChild.Ancestor.Ancestor) + assert.Equal(t, child.ProcessCacheEntry, childExec.ProcessCacheEntry.Ancestor) + assert.Equal(t, parent.ProcessCacheEntry, childExec.ProcessCacheEntry.Ancestor.Ancestor) + assert.Equal(t, child.ProcessCacheEntry, grandChild.ProcessCacheEntry.Ancestor) + assert.Equal(t, parent.ProcessCacheEntry, grandChild.ProcessCacheEntry.Ancestor.Ancestor) // [parent] // \ [child] -> childExec // \ grandChild - resolver.DeleteEntry(parent.Pid, time.Now()) - assert.Nil(t, resolver.entryCache[parent.Pid]) + + // [X(pid:3)] + // | + // X(pid:4) -- Y(pid:4) + // | + // X(pid:5) + exit(parent) + resolver.ApplyExitEntry(parent, nil) + resolver.DeleteEntry(parent.ProcessContext.Pid, parent.ResolveEventTime()) + assert.Nil(t, resolver.entryCache[parent.ProcessCacheEntry.Pid]) + assert.Nil(t, resolver.entryCache[parent.ProcessCacheEntry.Pid]) assert.Equal(t, 2, len(resolver.entryCache)) - // [parent] - // \ [child] - // \ grandChild - resolver.DeleteEntry(childExec.Pid, time.Now()) - assert.Nil(t, resolver.entryCache[childExec.Pid]) + // [X(pid:3)] + // | + // X(pid:4) + // | + // X(pid:5) + exit(childExec) + resolver.ApplyExitEntry(childExec, nil) + resolver.DeleteEntry(childExec.ProcessContext.Pid, childExec.ResolveEventTime()) + assert.Nil(t, resolver.entryCache[childExec.ProcessCacheEntry.Pid]) assert.Equal(t, 1, len(resolver.entryCache)) - // nothing - resolver.DeleteEntry(grandChild.Pid, time.Now()) + // nothing in the entryCache + exit(grandChild) + resolver.ApplyExitEntry(grandChild, nil) + resolver.DeleteEntry(grandChild.ProcessContext.Pid, grandChild.ResolveEventTime()) assert.Zero(t, len(resolver.entryCache)) testCacheSize(t, resolver) } func TestExecBomb(t *testing.T) { - resolver, err := NewEBPFResolver(nil, nil, &statsd.NoOpClient{}, nil, nil, nil, nil, nil, nil, nil, nil, NewResolverOpts()) + + resolver, err := newResolver() if err != nil { - t.Fatal(err) + t.Fatal() } - parent := resolver.NewProcessCacheEntry(model.PIDContext{Pid: 1, Tid: 1}) - parent.ForkTime = time.Now() - - child := resolver.NewProcessCacheEntry(model.PIDContext{Pid: 2, Tid: 2}) - child.PPid = parent.Pid - child.ForkTime = time.Now() + parent := newFakeForkEvent(0, 3, 123, resolver) + child := newFakeForkEvent(3, 4, 123, resolver) + exec1 := newFakeExecEvent(3, 4, 456, resolver) + exec2 := newFakeExecEvent(3, 4, 456, resolver) - exec1 := resolver.NewProcessCacheEntry(model.PIDContext{Pid: child.Pid, Tid: child.Pid}) - exec1.PPid = child.PPid - exec1.FileEvent.Inode = 123 - exec1.ExecTime = time.Now() - - exec2 := resolver.NewProcessCacheEntry(model.PIDContext{Pid: child.Pid, Tid: child.Pid}) - exec2.Pid = child.Pid - exec2.PPid = child.PPid - exec2.FileEvent.Inode = 123 - exec2.ExecTime = time.Now() - - // parent - resolver.AddForkEntry(parent, 0, nil) - assert.Equal(t, parent, resolver.entryCache[parent.Pid]) + // X(pid:3) + resolver.AddForkEntry(parent, nil) + assert.Equal(t, parent.ProcessCacheEntry, resolver.entryCache[parent.ProcessCacheEntry.Pid]) assert.Equal(t, 1, len(resolver.entryCache)) - assert.EqualValues(t, 1, resolver.cacheSize.Load()) - // parent - // \ child - resolver.AddForkEntry(child, 0, nil) - assert.Equal(t, child, resolver.entryCache[child.Pid]) + // X(pid:3) + // | + // X(pid:4) + resolver.AddForkEntry(child, nil) + assert.Equal(t, child.ProcessCacheEntry, resolver.entryCache[child.ProcessCacheEntry.Pid]) assert.Equal(t, 2, len(resolver.entryCache)) - assert.Equal(t, parent, child.Ancestor) + assert.Equal(t, parent.ProcessCacheEntry, child.ProcessCacheEntry.Ancestor) assert.EqualValues(t, 2, resolver.cacheSize.Load()) - // [parent] - // \ child - resolver.DeleteEntry(parent.Pid, time.Now()) - assert.Nil(t, resolver.entryCache[parent.Pid]) + // [X(pid:3)] + // | + // X(pid:4) + exit(parent) + resolver.ApplyExitEntry(parent, nil) + resolver.DeleteEntry(parent.ProcessContext.Pid, parent.ResolveEventTime()) + assert.Nil(t, resolver.entryCache[parent.ProcessCacheEntry.Pid]) assert.Equal(t, 1, len(resolver.entryCache)) - assert.Equal(t, parent, child.Ancestor) + assert.Equal(t, parent.ProcessCacheEntry, child.ProcessCacheEntry.Ancestor) - // [parent] - // \ [child] -> exec1 - resolver.AddExecEntry(exec1, 0) - assert.Equal(t, exec1, resolver.entryCache[exec1.Pid]) + // [X(pid:3)] + // | + // X(pid:4) -- Y(pid:4) + resolver.AddExecEntry(exec1) + assert.Equal(t, exec1.ProcessCacheEntry, resolver.entryCache[exec1.ProcessCacheEntry.Pid]) assert.Equal(t, 1, len(resolver.entryCache)) - assert.Equal(t, child, exec1.Ancestor) - assert.Equal(t, parent, exec1.Ancestor.Ancestor) + assert.Equal(t, child.ProcessCacheEntry, exec1.ProcessCacheEntry.Ancestor) + assert.Equal(t, parent.ProcessCacheEntry, exec1.ProcessCacheEntry.Ancestor.Ancestor) assert.EqualValues(t, 3, resolver.cacheSize.Load()) - // [parent] - // \ [child] -> [exec1] -> exec2 - resolver.AddExecEntry(exec2, 0) - assert.Equal(t, exec1, resolver.entryCache[exec2.Pid]) + // [X(pid:3)] + // | + // X(pid:4) -- Y(pid:4) -- Y(pid:4) + resolver.AddExecEntry(exec2) + assert.Equal(t, exec1.ProcessCacheEntry, resolver.entryCache[exec2.ProcessCacheEntry.Pid]) assert.Equal(t, 1, len(resolver.entryCache)) - assert.Equal(t, exec1.ExecTime, exec2.ExecTime) + assert.Equal(t, exec1.ProcessCacheEntry.ExecTime, exec2.ProcessCacheEntry.ExecTime) assert.EqualValues(t, 3, resolver.cacheSize.Load()) - // nothing - resolver.DeleteEntry(exec1.Pid, time.Now()) + // nothing in the entryCache + exit(exec1) + resolver.ApplyExitEntry(exec1, nil) + resolver.DeleteEntry(exec1.ProcessContext.Pid, exec1.ResolveEventTime()) assert.Zero(t, len(resolver.entryCache)) testCacheSize(t, resolver) } func TestExecLostFork(t *testing.T) { - resolver, err := NewEBPFResolver(nil, nil, &statsd.NoOpClient{}, nil, nil, nil, nil, nil, nil, nil, nil, NewResolverOpts()) + + resolver, err := newResolver() if err != nil { - t.Fatal(err) + t.Fatal() } - parent := resolver.NewProcessCacheEntry(model.PIDContext{Pid: 11, Tid: 11}) - parent.FileEvent.BasenameStr = "agent" - parent.ForkTime = time.Now() - parent.FileEvent.Inode = 1 - parent.ExecInode = 1 - - // parent - resolver.AddForkEntry(parent, 0, nil) - - child := resolver.NewProcessCacheEntry(model.PIDContext{Pid: 22, Tid: 22}) - child.PPid = parent.Pid - child.FileEvent.Inode = 1 - - // parent - // \ child - resolver.AddForkEntry(child, parent.ExecInode, nil) - - assert.Equal(t, "agent", child.FileEvent.BasenameStr) - assert.False(t, child.IsParentMissing) - - // exec loss with inode 2 - - child1 := resolver.NewProcessCacheEntry(model.PIDContext{Pid: 33, Tid: 33}) - child1.FileEvent.BasenameStr = "sh" - child1.PPid = child.Pid - child1.ExecInode = 2 - - // parent - // \ child - // \ child1 - resolver.AddForkEntry(child1, child1.ExecInode, nil) + parent := newFakeForkEvent(0, 3, 123, resolver) + parent.ProcessCacheEntry.FileEvent.BasenameStr = "agent" + child := newFakeForkEvent(3, 4, 123, resolver) + child.PIDContext.ExecInode = 123 // ExecInode == Inode Parent + child1 := newFakeForkEvent(4, 5, 123, resolver) + child1.ProcessCacheEntry.FileEvent.BasenameStr = "sh" + child1.PIDContext.ExecInode = 456 // ExecInode != Inode parent + + // X(pid:3) + resolver.AddForkEntry(parent, nil) + assert.Equal(t, parent.ProcessCacheEntry, resolver.entryCache[parent.ProcessCacheEntry.Pid]) + assert.Equal(t, 1, len(resolver.entryCache)) - assert.Equal(t, "agent", child1.FileEvent.BasenameStr) - assert.True(t, child1.IsParentMissing) + // X(pid:3) + // | + // X(pid:4) + resolver.AddForkEntry(child, nil) + assert.Equal(t, child.ProcessCacheEntry, resolver.entryCache[child.ProcessCacheEntry.Pid]) + assert.Equal(t, 2, len(resolver.entryCache)) + assert.Equal(t, parent.ProcessCacheEntry, child.ProcessCacheEntry.Ancestor) + assert.Equal(t, "agent", child.ProcessCacheEntry.FileEvent.BasenameStr) + assert.False(t, child.ProcessCacheEntry.IsParentMissing) + + // X(pid:3) + // | + // X(pid:4) + // {|} + // X(pid:5) + resolver.AddForkEntry(child1, nil) + assert.Equal(t, "agent", child1.ProcessCacheEntry.FileEvent.BasenameStr) + assert.True(t, child1.ProcessCacheEntry.IsParentMissing) } func TestExecLostExec(t *testing.T) { - resolver, err := NewEBPFResolver(nil, nil, &statsd.NoOpClient{}, nil, nil, nil, nil, nil, nil, nil, nil, NewResolverOpts()) + + resolver, err := newResolver() if err != nil { - t.Fatal(err) + t.Fatal() } - parent := resolver.NewProcessCacheEntry(model.PIDContext{Pid: 11, Tid: 11}) - parent.FileEvent.BasenameStr = "agent" - parent.ForkTime = time.Now() - parent.FileEvent.Inode = 1 - parent.ExecInode = 1 - - // parent - resolver.AddForkEntry(parent, 0, nil) - - child1 := resolver.NewProcessCacheEntry(model.PIDContext{Pid: 22, Tid: 22}) - child1.PPid = parent.Pid - child1.FileEvent.Inode = 1 - child1.ExecInode = 1 - - // parent - // \ child1 - resolver.AddForkEntry(child1, parent.ExecInode, nil) - - assert.Equal(t, "agent", child1.FileEvent.BasenameStr) - assert.False(t, child1.IsParentMissing) - - // exec loss with inode 2 and pid 22 - - child2 := resolver.NewProcessCacheEntry(model.PIDContext{Pid: 33, Tid: 33}) - child2.FileEvent.BasenameStr = "sh" - child2.PPid = child1.Pid - child2.ExecInode = 2 - - // parent - // \ child1 - // \ child2 - resolver.AddForkEntry(child2, child2.ExecInode, nil) + parent := newFakeForkEvent(0, 3, 123, resolver) + parent.ProcessCacheEntry.FileEvent.BasenameStr = "agent" + child1 := newFakeForkEvent(3, 4, 123, resolver) + child1.PIDContext.ExecInode = 123 // ExecInode == Inode Parent + child2 := newFakeExecEvent(3, 4, 456, resolver) + child2.ProcessCacheEntry.FileEvent.BasenameStr = "sh" + child2.PIDContext.ExecInode = 456 // ExecInode != Inode Ancestor + + // X(pid:3) + resolver.AddForkEntry(parent, nil) + assert.Equal(t, parent.ProcessCacheEntry, resolver.entryCache[parent.ProcessCacheEntry.Pid]) + assert.Equal(t, 1, len(resolver.entryCache)) - assert.Equal(t, "agent", child2.FileEvent.BasenameStr) - assert.True(t, child2.IsParentMissing) + // X(pid:3) + // | + // X(pid:4) + resolver.AddForkEntry(child1, nil) + assert.Equal(t, child1.ProcessCacheEntry, resolver.entryCache[child1.ProcessCacheEntry.Pid]) + assert.Equal(t, 2, len(resolver.entryCache)) + assert.Equal(t, parent.ProcessCacheEntry, child1.ProcessCacheEntry.Ancestor) + assert.Equal(t, "agent", child1.ProcessCacheEntry.FileEvent.BasenameStr) + assert.False(t, child1.ProcessCacheEntry.IsParentMissing) + + // X(pid:3) + // | + // X(pid:4) -**- Y(pid:4) + resolver.AddExecEntry(child2) + assert.NotEqual(t, "agent", child2.ProcessCacheEntry.FileEvent.BasenameStr) + assert.True(t, child2.ProcessCacheEntry.IsParentMissing) } func TestIsExecExecRuntime(t *testing.T) { - resolver, err := NewEBPFResolver(nil, nil, &statsd.NoOpClient{}, nil, nil, nil, nil, nil, nil, nil, nil, NewResolverOpts()) + resolver, err := newResolver() if err != nil { - t.Fatal(err) + t.Fatal() } - parent := resolver.NewProcessCacheEntry(model.PIDContext{Pid: 1, Tid: 1}) - parent.ForkTime = time.Now() - parent.FileEvent.Inode = 1 - - // parent - resolver.AddForkEntry(parent, 0, nil) + parent := newFakeForkEvent(0, 3, 123, resolver) + child := newFakeForkEvent(3, 4, 123, resolver) + child2 := newFakeExecEvent(3, 4, 456, resolver) + child3 := newFakeExecEvent(3, 4, 789, resolver) + child4 := newFakeExecEvent(3, 4, 101112, resolver) - child := resolver.NewProcessCacheEntry(model.PIDContext{Pid: 2, Tid: 2}) - child.PPid = parent.Pid - child.FileEvent.Inode = 1 - - // parent - // \ child - resolver.AddForkEntry(child, 0, nil) + // X(pid:3) + resolver.AddForkEntry(parent, nil) + assert.Equal(t, parent.ProcessCacheEntry, resolver.entryCache[parent.ProcessCacheEntry.Pid]) + assert.Equal(t, 1, len(resolver.entryCache)) - // parent - // \ child - // \ child2 + // X(pid:3) + // | + // X(pid:4) + resolver.AddForkEntry(child, nil) + assert.Equal(t, child.ProcessCacheEntry, resolver.entryCache[child.ProcessCacheEntry.Pid]) + assert.Equal(t, 2, len(resolver.entryCache)) + assert.Equal(t, parent.ProcessCacheEntry, child.ProcessCacheEntry.Ancestor) - child2 := resolver.NewProcessCacheEntry(model.PIDContext{Pid: 2, Tid: 2}) - child2.FileEvent.Inode = 2 - child2.PPid = child.Pid - resolver.AddExecEntry(child2, 0) + // X(pid:3) + // | + // X(pid:4) -- Y(pid:4) + resolver.AddExecEntry(child2) - // parent - // \ child - // \ child2 - // \ child3 + // X(pid:3) + // | + // X(pid:4) -- Y(pid:4) -- Z(pid:4) + resolver.AddExecEntry(child3) - child3 := resolver.NewProcessCacheEntry(model.PIDContext{Pid: 2, Tid: 2}) - child3.FileEvent.Inode = 3 - child3.PPid = child2.Pid - resolver.AddExecEntry(child3, 0) + // X(pid:3) + // | + // X(pid:4) -- Y(pid:4) -- Z(pid:4) -- T(pid:4) + resolver.AddExecEntry(child4) - assert.False(t, parent.IsExecExec) - assert.False(t, parent.IsExec) + assert.False(t, parent.ProcessCacheEntry.IsExecExec) + assert.False(t, parent.ProcessCacheEntry.IsExec) - assert.False(t, child.IsExecExec) - assert.False(t, child.IsExec) + assert.False(t, child.ProcessCacheEntry.IsExecExec) + assert.False(t, child.ProcessCacheEntry.IsExec) - assert.False(t, child2.IsExecExec) - assert.True(t, child2.IsExec) + assert.False(t, child2.ProcessCacheEntry.IsExecExec) + assert.True(t, child2.ProcessCacheEntry.IsExec) - assert.True(t, child3.IsExecExec) - assert.True(t, child3.IsExec) + assert.True(t, child3.ProcessCacheEntry.IsExecExec) + assert.True(t, child3.ProcessCacheEntry.IsExec) - child4 := resolver.NewProcessCacheEntry(model.PIDContext{Pid: 2, Tid: 2}) - child4.FileEvent.Inode = 3 - child4.PPid = child3.Pid - resolver.AddExecEntry(child4, 0) + assert.True(t, child4.ProcessCacheEntry.IsExecExec) + assert.True(t, child4.ProcessCacheEntry.IsExec) - assert.True(t, child3.IsExecExec) - assert.True(t, child3.IsExec) } func TestIsExecExecSnapshot(t *testing.T) { - resolver, err := NewEBPFResolver(nil, nil, &statsd.NoOpClient{}, nil, nil, nil, nil, nil, nil, nil, nil, NewResolverOpts()) + + resolver, err := newResolver() if err != nil { - t.Fatal(err) + t.Fatal() } - parent := resolver.NewProcessCacheEntry(model.PIDContext{Pid: 1, Tid: 1}) - parent.ForkTime = time.Now() - parent.FileEvent.Inode = 1 - - // parent - resolver.insertEntry(parent, nil, model.ProcessCacheEntryFromSnapshot) - - child := resolver.NewProcessCacheEntry(model.PIDContext{Pid: 2, Tid: 2}) - child.PPid = parent.Pid - child.FileEvent.Inode = 2 + parent := newFakeForkEvent(0, 3, 123, resolver) + child := newFakeForkEvent(3, 4, 123, resolver) + child2 := newFakeExecEvent(3, 4, 456, resolver) + child3 := newFakeExecEvent(3, 4, 769, resolver) - // parent - // \ child - - resolver.setAncestor(child) - resolver.insertEntry(child, nil, model.ProcessCacheEntryFromSnapshot) + // X(pid:3) + resolver.insertEntry(parent.ProcessCacheEntry, nil, model.ProcessCacheEntryFromSnapshot) + assert.Equal(t, parent.ProcessCacheEntry, resolver.entryCache[parent.ProcessCacheEntry.Pid]) + assert.Equal(t, 1, len(resolver.entryCache)) - assert.False(t, parent.IsExecExec) - assert.False(t, parent.IsExec) + // X(pid:3) + // | + // X(pid:4) + resolver.setAncestor(child.ProcessCacheEntry) + resolver.insertEntry(child.ProcessCacheEntry, nil, model.ProcessCacheEntryFromSnapshot) + assert.Equal(t, child.ProcessCacheEntry, resolver.entryCache[child.ProcessCacheEntry.Pid]) + assert.Equal(t, 2, len(resolver.entryCache)) + assert.Equal(t, parent.ProcessCacheEntry, child.ProcessCacheEntry.Ancestor) - assert.False(t, child.IsExecExec) - assert.False(t, child.IsExec) + assert.False(t, parent.ProcessCacheEntry.IsExecExec) + assert.False(t, parent.ProcessCacheEntry.IsExec) - // parent - // \ child - // \ child2 + assert.False(t, child.ProcessCacheEntry.IsExecExec) + assert.False(t, child.ProcessCacheEntry.IsExec) - child2 := resolver.NewProcessCacheEntry(model.PIDContext{Pid: 2, Tid: 2}) - child2.FileEvent.Inode = 3 - child2.PPid = child.Pid - resolver.AddExecEntry(child2, 0) + // X(pid:3) + // | + // X(pid:4) -- Y(pid:4) + resolver.AddExecEntry(child2) - assert.False(t, child2.IsExecExec) - assert.True(t, child2.IsExec) + assert.False(t, child2.ProcessCacheEntry.IsExecExec) + assert.True(t, child2.ProcessCacheEntry.IsExec) - child3 := resolver.NewProcessCacheEntry(model.PIDContext{Pid: 2, Tid: 2}) - child3.FileEvent.Inode = 4 - child3.PPid = child2.Pid - resolver.AddExecEntry(child3, 0) + // X(pid:3) + // | + // X(pid:4) -- Y(pid:4) -- Z(pid:4) + resolver.AddExecEntry(child3) - assert.True(t, child3.IsExecExec) - assert.True(t, child3.IsExec) + assert.True(t, child3.ProcessCacheEntry.IsExecExec) + assert.True(t, child3.ProcessCacheEntry.IsExec) } diff --git a/pkg/security/resolvers/resolvers_ebpf.go b/pkg/security/resolvers/resolvers_ebpf.go index 91e1392502840..c9adeb82e557b 100644 --- a/pkg/security/resolvers/resolvers_ebpf.go +++ b/pkg/security/resolvers/resolvers_ebpf.go @@ -217,35 +217,29 @@ func (r *EBPFResolvers) Start(ctx context.Context) error { return r.NamespaceResolver.Start(ctx) } -// ResolveCGroup resolves the path of cgroup for a process cache entry -func (r *EBPFResolvers) ResolveCGroup(pce *model.ProcessCacheEntry, pathKey model.PathKey, cgroupFlags containerutils.CGroupFlags) error { - path, err := r.DentryResolver.Resolve(pathKey, true) - if err == nil && path != "" { - cgroup := filepath.Dir(string(path)) - if cgroup == "/" { - cgroup = path - } +// ResolveCGroupContext resolves the cgroup context from a cgroup path key +func (r *EBPFResolvers) ResolveCGroupContext(pathKey model.PathKey, cgroupFlags containerutils.CGroupFlags) (*model.CGroupContext, error) { + if cgroupContext, found := r.CGroupResolver.GetCGroupContext(pathKey); found { + return cgroupContext, nil + } - cgroupFlags := containerutils.CGroupFlags(cgroupFlags) - cgroupContext := model.CGroupContext{ - CGroupID: containerutils.CGroupID(cgroup), - CGroupFlags: containerutils.CGroupFlags(cgroupFlags), - CGroupFile: pathKey, - } + path, err := r.DentryResolver.Resolve(pathKey, true) + if err != nil { + return nil, fmt.Errorf("failed to resolve cgroup file %v: %w", pathKey, err) + } - pce.Process.CGroup = cgroupContext - pce.CGroup = cgroupContext + cgroup := filepath.Dir(string(path)) + if cgroup == "/" { + cgroup = path + } - if cgroupFlags.IsContainer() { - containerID, _ := containerutils.FindContainerID(cgroupContext.CGroupID) - pce.ContainerID = containerID - pce.Process.ContainerID = containerID - } - } else { - return fmt.Errorf("failed to resolve cgroup file %v: %w", pathKey, err) + cgroupContext := &model.CGroupContext{ + CGroupID: containerutils.CGroupID(cgroup), + CGroupFlags: containerutils.CGroupFlags(cgroupFlags), + CGroupFile: pathKey, } - return nil + return cgroupContext, nil } // Snapshot collects data on the current state of the system to populate user space and kernel space caches. diff --git a/pkg/security/resolvers/sbom/resolver.go b/pkg/security/resolvers/sbom/resolver.go index d0a290975d6df..6fe1b6f344163 100644 --- a/pkg/security/resolvers/sbom/resolver.go +++ b/pkg/security/resolvers/sbom/resolver.go @@ -33,6 +33,7 @@ import ( "github.com/DataDog/datadog-agent/pkg/security/config" "github.com/DataDog/datadog-agent/pkg/security/metrics" cgroupModel "github.com/DataDog/datadog-agent/pkg/security/resolvers/cgroup/model" + "github.com/DataDog/datadog-agent/pkg/security/resolvers/tags" "github.com/DataDog/datadog-agent/pkg/security/secl/containerutils" "github.com/DataDog/datadog-agent/pkg/security/secl/model" "github.com/DataDog/datadog-agent/pkg/security/seclog" @@ -273,7 +274,7 @@ func (r *Resolver) generateSBOM(root string) (report *trivy.Report, err error) { seclog.Infof("Generating SBOM for %s", root) r.sbomGenerations.Inc() - scanRequest := host.NewScanRequest(root, os.DirFS("/")) + scanRequest := host.NewScanRequest(root) ch := collectors.GetHostScanner().Channel() if ch == nil { return nil, fmt.Errorf("couldn't retrieve global host scanner result channel") @@ -486,15 +487,15 @@ func (r *Resolver) triggerScan(sbom *SBOM) { } // OnWorkloadSelectorResolvedEvent is used to handle the creation of a new cgroup with its resolved tags -func (r *Resolver) OnWorkloadSelectorResolvedEvent(cgroup *cgroupModel.CacheEntry) { +func (r *Resolver) OnWorkloadSelectorResolvedEvent(workload *tags.Workload) { r.sbomsLock.Lock() defer r.sbomsLock.Unlock() - if cgroup == nil { + if workload == nil { return } - id := cgroup.ContainerID + id := workload.ContainerID // We don't scan hosts for now if len(id) == 0 { return @@ -502,8 +503,8 @@ func (r *Resolver) OnWorkloadSelectorResolvedEvent(cgroup *cgroupModel.CacheEntr _, ok := r.sboms[id] if !ok { - workloadKey := getWorkloadKey(cgroup.GetWorkloadSelectorCopy()) - sbom, err := r.newWorkloadEntry(id, cgroup, workloadKey) + workloadKey := getWorkloadKey(workload.Selector.Copy()) + sbom, err := r.newWorkloadEntry(id, workload.CacheEntry, workloadKey) if err != nil { seclog.Errorf("couldn't create new SBOM entry for sbom '%s': %v", id, err) } diff --git a/pkg/security/resolvers/sbom/resolver_unsupported.go b/pkg/security/resolvers/sbom/resolver_unsupported.go index 9e073e03e552c..614682af506fa 100644 --- a/pkg/security/resolvers/sbom/resolver_unsupported.go +++ b/pkg/security/resolvers/sbom/resolver_unsupported.go @@ -15,6 +15,7 @@ import ( "github.com/DataDog/datadog-agent/pkg/security/config" cgroupModel "github.com/DataDog/datadog-agent/pkg/security/resolvers/cgroup/model" + "github.com/DataDog/datadog-agent/pkg/security/resolvers/tags" "github.com/DataDog/datadog-agent/pkg/security/secl/containerutils" "github.com/DataDog/datadog-agent/pkg/security/secl/model" ) @@ -33,7 +34,7 @@ func (r *Resolver) OnCGroupDeletedEvent(_ *cgroupModel.CacheEntry) { } // OnWorkloadSelectorResolvedEvent is used to handle the creation of a new cgroup with its resolved tags -func (r *Resolver) OnWorkloadSelectorResolvedEvent(_ *cgroupModel.CacheEntry) { +func (r *Resolver) OnWorkloadSelectorResolvedEvent(_ *tags.Workload) { } // ResolvePackage returns the Package that owns the provided file diff --git a/pkg/security/resolvers/tags/resolver.go b/pkg/security/resolvers/tags/resolver.go index 051122e4436ec..a5f0a4b956775 100644 --- a/pkg/security/resolvers/tags/resolver.go +++ b/pkg/security/resolvers/tags/resolver.go @@ -21,6 +21,8 @@ type Event int const ( // WorkloadSelectorResolved is used to notify that a new cgroup with a resolved workload selector is ready WorkloadSelectorResolved Event = iota + // WorkloadSelectorDeleted is used to notify that a cgroup with a resolved workload selector is deleted + WorkloadSelectorDeleted ) // Tagger defines a Tagger for the Tags Resolver diff --git a/pkg/security/resolvers/tags/resolver_linux.go b/pkg/security/resolvers/tags/resolver_linux.go index e11b2001dba4a..e029f003696b6 100644 --- a/pkg/security/resolvers/tags/resolver_linux.go +++ b/pkg/security/resolvers/tags/resolver_linux.go @@ -13,21 +13,26 @@ import ( "github.com/DataDog/datadog-agent/pkg/security/resolvers/cgroup" cgroupModel "github.com/DataDog/datadog-agent/pkg/security/resolvers/cgroup/model" + "github.com/DataDog/datadog-agent/pkg/security/secl/containerutils" "github.com/DataDog/datadog-agent/pkg/security/seclog" "github.com/DataDog/datadog-agent/pkg/security/utils" ) -type pendingWorkload struct { +// Workload represents a workload along with its tags +type Workload struct { *cgroupModel.CacheEntry - retries int + Tags []string + Selector cgroupModel.WorkloadSelector + retries int } // LinuxResolver represents a default resolver based directly on the underlying tagger type LinuxResolver struct { *DefaultResolver - *utils.Notifier[Event, *cgroupModel.CacheEntry] - workloadsWithoutTags chan *pendingWorkload + *utils.Notifier[Event, *Workload] + workloadsWithoutTags chan *Workload cgroupResolver *cgroup.Resolver + workloads map[containerutils.CGroupID]*Workload } // Start the resolver @@ -37,12 +42,19 @@ func (t *LinuxResolver) Start(ctx context.Context) error { } if err := t.cgroupResolver.RegisterListener(cgroup.CGroupCreated, func(cgce *cgroupModel.CacheEntry) { - workload := &pendingWorkload{CacheEntry: cgce, retries: 3} + workload := &Workload{CacheEntry: cgce, retries: 3} + t.workloads[cgce.CGroupID] = workload t.checkTags(workload) }); err != nil { return err } + if err := t.cgroupResolver.RegisterListener(cgroup.CGroupDeleted, func(cgce *cgroupModel.CacheEntry) { + delete(t.workloads, cgce.CGroupID) + }); err != nil { + return err + } + go func() { ctx, cancel := context.WithCancel(ctx) defer cancel() @@ -73,17 +85,18 @@ func (t *LinuxResolver) Start(ctx context.Context) error { return nil } -func needsTagsResolution(cgce *cgroupModel.CacheEntry) bool { - return len(cgce.ContainerID) != 0 && !cgce.WorkloadSelector.IsReady() +func needsTagsResolution(workload *Workload) bool { + return len(workload.ContainerID) != 0 && !workload.Selector.IsReady() } // checkTags checks if the tags of a workload were properly set -func (t *LinuxResolver) checkTags(pendingWorkload *pendingWorkload) { - workload := pendingWorkload.CacheEntry +func (t *LinuxResolver) checkTags(pendingWorkload *Workload) { + workload := pendingWorkload // check if the workload tags were found or if it was deleted if !workload.Deleted.Load() && needsTagsResolution(workload) { // this is an alive cgroup, try to resolve its tags now - if err := t.fetchTags(workload); err != nil || needsTagsResolution(workload) { + err := t.fetchTags(workload) + if err != nil || needsTagsResolution(workload) { if pendingWorkload.retries--; pendingWorkload.retries >= 0 { // push to the workloadsWithoutTags chan so that its tags can be resolved later select { @@ -102,22 +115,29 @@ func (t *LinuxResolver) checkTags(pendingWorkload *pendingWorkload) { } // fetchTags fetches tags for the provided workload -func (t *LinuxResolver) fetchTags(container *cgroupModel.CacheEntry) error { - newTags, err := t.ResolveWithErr(container.ContainerID) +func (t *LinuxResolver) fetchTags(workload *Workload) error { + newTags, err := t.ResolveWithErr(workload.ContainerID) if err != nil { - return fmt.Errorf("failed to resolve %s: %w", container.ContainerID, err) + return fmt.Errorf("failed to resolve %s: %w", workload.ContainerID, err) } - container.SetTags(newTags) + + workload.Selector.Image = utils.GetTagValue("image_name", newTags) + workload.Selector.Tag = utils.GetTagValue("image_tag", newTags) + if len(workload.Selector.Image) != 0 && len(workload.Selector.Tag) == 0 { + workload.Selector.Tag = "latest" + } + return nil } // NewResolver returns a new tags resolver func NewResolver(tagger Tagger, cgroupsResolver *cgroup.Resolver) *LinuxResolver { resolver := &LinuxResolver{ - Notifier: utils.NewNotifier[Event, *cgroupModel.CacheEntry](), + Notifier: utils.NewNotifier[Event, *Workload](), DefaultResolver: NewDefaultResolver(tagger), - workloadsWithoutTags: make(chan *pendingWorkload, 100), + workloadsWithoutTags: make(chan *Workload, 100), cgroupResolver: cgroupsResolver, + workloads: make(map[containerutils.CGroupID]*Workload), } return resolver } diff --git a/pkg/security/rules/filtermodel/os_only_filter.go b/pkg/security/rules/filtermodel/os_only_filter.go new file mode 100644 index 0000000000000..515203c44b6f9 --- /dev/null +++ b/pkg/security/rules/filtermodel/os_only_filter.go @@ -0,0 +1,103 @@ +// 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 filtermodel holds rules related files +package filtermodel + +import ( + "reflect" + + "github.com/DataDog/datadog-agent/pkg/security/secl/compiler/eval" +) + +// OSOnlyFilterEvent defines an os-only rule filter event +type OSOnlyFilterEvent struct { + os string +} + +// OSOnlyFilterModel defines a filter model +type OSOnlyFilterModel struct { + os string +} + +// NewOSOnlyFilterModel returns a new rule filter model +func NewOSOnlyFilterModel(os string) *OSOnlyFilterModel { + return &OSOnlyFilterModel{ + os: os, + } +} + +// NewEvent returns a new event +func (m *OSOnlyFilterModel) NewEvent() eval.Event { + return &OSOnlyFilterEvent{ + os: m.os, + } +} + +// GetEvaluator gets the evaluator +func (m *OSOnlyFilterModel) GetEvaluator(field eval.Field, _ eval.RegisterID) (eval.Evaluator, error) { + switch field { + case "os": + return &eval.StringEvaluator{ + EvalFnc: func(_ *eval.Context) string { return m.os }, + Field: field, + }, nil + } + + return nil, &eval.ErrFieldNotFound{Field: field} +} + +// GetFieldValue gets a field value +func (e *OSOnlyFilterEvent) GetFieldValue(field eval.Field) (interface{}, error) { + switch field { + case "os": + return e.os, nil + } + + return nil, &eval.ErrFieldNotFound{Field: field} +} + +// Init inits the rule filter event +func (e *OSOnlyFilterEvent) Init() {} + +// GetFieldEventType returns the event type for the given field +func (e *OSOnlyFilterEvent) GetFieldEventType(_ eval.Field) (string, error) { + return "*", nil +} + +// SetFieldValue sets the value for the given field +func (e *OSOnlyFilterEvent) SetFieldValue(field eval.Field, _ interface{}) error { + return &eval.ErrFieldNotFound{Field: field} +} + +// GetFieldType get the type of the field +func (e *OSOnlyFilterEvent) GetFieldType(field eval.Field) (reflect.Kind, error) { + switch field { + case "os": + return reflect.String, nil + } + + return reflect.Invalid, &eval.ErrFieldNotFound{Field: field} +} + +// GetType returns the type for this event +func (e *OSOnlyFilterEvent) GetType() string { + return "*" +} + +// GetTags returns the tags for this event +func (e *OSOnlyFilterEvent) GetTags() []string { + return []string{} +} + +// ValidateField returns whether the value use against the field is valid +func (m *OSOnlyFilterModel) ValidateField(_ string, _ eval.FieldValue) error { + return nil +} + +// GetFieldRestrictions returns the field event type restrictions +func (m *OSOnlyFilterModel) GetFieldRestrictions(_ eval.Field) []eval.EventType { + return nil +} diff --git a/pkg/security/secl/compiler/eval/eval_test.go b/pkg/security/secl/compiler/eval/eval_test.go index 0674e4ef744b1..6a217e8877444 100644 --- a/pkg/security/secl/compiler/eval/eval_test.go +++ b/pkg/security/secl/compiler/eval/eval_test.go @@ -1006,8 +1006,9 @@ func TestRegisterPartial(t *testing.T) { func TestOptimizer(t *testing.T) { event := &testEvent{ process: testProcess{ - uid: 44, - gid: 44, + uid: 44, + gid: 44, + name: "aaa", }, } @@ -1018,10 +1019,11 @@ func TestOptimizer(t *testing.T) { Expr string Evaluated func() bool }{ - {Expr: `process.list[A].key == 44 && process.gid == 55`, Evaluated: func() bool { return event.listEvaluated }}, + {Expr: `process.list.key == 44 && process.gid == 55`, Evaluated: func() bool { return event.listEvaluated }}, {Expr: `process.gid == 55 && process.list[A].key == 44`, Evaluated: func() bool { return event.listEvaluated }}, {Expr: `process.uid in [66, 77, 88] && process.gid == 55`, Evaluated: func() bool { return event.uidEvaluated }}, {Expr: `process.gid == 55 && process.uid in [66, 77, 88]`, Evaluated: func() bool { return event.uidEvaluated }}, + {Expr: `process.list.value == "AA" && process.name == "zzz"`, Evaluated: func() bool { return event.listEvaluated }}, } for _, test := range tests { diff --git a/pkg/security/secl/compiler/eval/operators.go b/pkg/security/secl/compiler/eval/operators.go index 9f39ff3e3550e..9fd97b9a98177 100644 --- a/pkg/security/secl/compiler/eval/operators.go +++ b/pkg/security/secl/compiler/eval/operators.go @@ -352,7 +352,6 @@ func StringEquals(a *StringEvaluator, b *StringEvaluator, state *State) (*BoolEv return &BoolEvaluator{ Value: op(ea, eb), - Weight: a.Weight + InArrayWeight*len(eb), isDeterministic: isDc, }, nil } @@ -366,7 +365,7 @@ func StringEquals(a *StringEvaluator, b *StringEvaluator, state *State) (*BoolEv return &BoolEvaluator{ EvalFnc: evalFnc, - Weight: a.Weight + InArrayWeight*len(eb), + Weight: a.Weight, isDeterministic: isDc, }, nil } diff --git a/pkg/security/secl/containerutils/cgroup.go b/pkg/security/secl/containerutils/cgroup.go index 74e7a64540c84..9cc6cca12d884 100644 --- a/pkg/security/secl/containerutils/cgroup.go +++ b/pkg/security/secl/containerutils/cgroup.go @@ -24,6 +24,12 @@ const ( CGroupManagerSystemd // systemd ) +// CGroup flags +const ( + SystemdService CGroupFlags = (0 << 8) + SystemdScope CGroupFlags = (1 << 8) +) + const ( // ContainerRuntimeDocker is used to specify that a container is managed by Docker ContainerRuntimeDocker = "docker" diff --git a/pkg/security/secl/containerutils/helpers.go b/pkg/security/secl/containerutils/helpers.go index 0e46e87af7f2a..311322f94ffc6 100644 --- a/pkg/security/secl/containerutils/helpers.go +++ b/pkg/security/secl/containerutils/helpers.go @@ -29,39 +29,42 @@ func init() { containerIDPattern = regexp.MustCompile(ContainerIDPatternStr) } -func isSystemdCgroup(cgroup CGroupID) bool { - return strings.HasSuffix(string(cgroup), ".service") || strings.HasSuffix(string(cgroup), ".scope") +func isSystemdScope(cgroup CGroupID) bool { + return strings.HasSuffix(string(cgroup), ".scope") +} + +func isSystemdService(cgroup CGroupID) bool { + return strings.HasSuffix(string(cgroup), ".service") +} + +func getSystemdCGroupFlags(cgroup CGroupID) uint64 { + if isSystemdScope(cgroup) { + return uint64(CGroupManagerSystemd) | uint64(SystemdScope) + } else if isSystemdService(cgroup) { + return uint64(CGroupManagerSystemd) | uint64(SystemdService) + } + return 0 } // FindContainerID extracts the first sub string that matches the pattern of a container ID along with the container flags induced from the container runtime prefix func FindContainerID(s CGroupID) (ContainerID, uint64) { match := containerIDPattern.FindIndex([]byte(s)) if match == nil { - if isSystemdCgroup(s) { - return "", uint64(CGroupManagerSystemd) - } - - return "", 0 + return "", getSystemdCGroupFlags(s) } // first, check what's before if match[0] != 0 { previousChar := string(s[match[0]-1]) if strings.ContainsAny(previousChar, containerIDCoreChars) { - if isSystemdCgroup(s) { - return "", uint64(CGroupManagerSystemd) - } - return "", 0 + return "", getSystemdCGroupFlags(s) } } // then, check what's after if match[1] < len(s) { nextChar := string(s[match[1]]) if strings.ContainsAny(nextChar, containerIDCoreChars) { - if isSystemdCgroup(s) { - return "", uint64(CGroupManagerSystemd) - } - return "", 0 + return "", getSystemdCGroupFlags(s) } } diff --git a/pkg/security/secl/containerutils/helpers_test.go b/pkg/security/secl/containerutils/helpers_test.go index b5474b0df5016..5a2066e0295f2 100644 --- a/pkg/security/secl/containerutils/helpers_test.go +++ b/pkg/security/secl/containerutils/helpers_test.go @@ -63,7 +63,7 @@ func TestFindContainerID(t *testing.T) { { // Some random path which could match garden format input: "/user.slice/user-1000.slice/user@1000.service/apps.slice/apps-org.gnome.Terminal.slice/vte-spawn-f9176c6a-2a34-4ce2-86af-60d16888ed8e.scope", output: "", - flags: CGroupManagerSystemd, + flags: CGroupManagerSystemd | CGroupManager(SystemdScope), }, { // GARDEN with prefix / suffix input: "prefix01234567-0123-4567-890a-bcdesuffix", diff --git a/pkg/security/secl/go.mod b/pkg/security/secl/go.mod index e5f0a3c820483..da9770680ce9c 100644 --- a/pkg/security/secl/go.mod +++ b/pkg/security/secl/go.mod @@ -17,9 +17,9 @@ require ( github.com/spf13/cast v1.7.0 github.com/stretchr/testify v1.10.0 github.com/xeipuuv/gojsonschema v1.2.0 - golang.org/x/sys v0.27.0 - golang.org/x/text v0.20.0 - golang.org/x/tools v0.27.0 + golang.org/x/sys v0.28.0 + golang.org/x/text v0.21.0 + golang.org/x/tools v0.28.0 gopkg.in/yaml.v3 v3.0.1 modernc.org/mathutil v1.6.0 sigs.k8s.io/yaml v1.4.0 @@ -39,8 +39,9 @@ require ( github.com/shopspring/decimal v1.4.0 // indirect github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect - golang.org/x/crypto v0.29.0 // indirect + golang.org/x/crypto v0.31.0 // indirect golang.org/x/mod v0.22.0 // indirect - golang.org/x/sync v0.9.0 // indirect + golang.org/x/net v0.33.0 // indirect + golang.org/x/sync v0.10.0 // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect ) diff --git a/pkg/security/secl/go.sum b/pkg/security/secl/go.sum index 0c694b56983cf..b3daad8d9516f 100644 --- a/pkg/security/secl/go.sum +++ b/pkg/security/secl/go.sum @@ -75,29 +75,29 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.29.0 h1:L5SG1JTTXupVV3n6sUqMTeWbjAyfPwoda2DLX8J8FrQ= -golang.org/x/crypto v0.29.0/go.mod h1:+F4F4N5hv6v38hfeYwTdx20oUvLLc+QfrE9Ax9HtgRg= +golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U= +golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.22.0 h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4= golang.org/x/mod v0.22.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.31.0 h1:68CPQngjLL0r2AlUKiSxtQFKvzRVbnzLwMUn5SzcLHo= -golang.org/x/net v0.31.0/go.mod h1:P4fl1q7dY2hnZFxEk4pPSkDHF+QqjitcnDjUQyMM+pM= +golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= +golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.9.0 h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ= -golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= +golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.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/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= -golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.27.0 h1:qEKojBykQkQ4EynWy4S8Weg69NumxKdn40Fce3uc/8o= -golang.org/x/tools v0.27.0/go.mod h1:sUi0ZgbwW9ZPAq26Ekut+weQPR5eIM6GQLQ1Yjm1H0Q= +golang.org/x/tools v0.28.0 h1:WuB6qZ4RPCQo5aP3WdKZS7i595EdWqWR8vqJTlwTVK8= +golang.org/x/tools v0.28.0/go.mod h1:dcIOrVd3mfQKTgrDVQHqCPMWy6lnhfhtX3hLXYVLfRw= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= diff --git a/pkg/security/secl/model/unmarshallers_linux.go b/pkg/security/secl/model/unmarshallers_linux.go index d6bdfb32fa825..7c38d3127e1ba 100644 --- a/pkg/security/secl/model/unmarshallers_linux.go +++ b/pkg/security/secl/model/unmarshallers_linux.go @@ -972,7 +972,7 @@ func (e *CgroupTracingEvent) UnmarshalBinary(data []byte) (int, error) { } cursor := read - read, err = UnmarshalBinary(data, &e.CGroupContext) + read, err = UnmarshalBinary(data[cursor:], &e.CGroupContext) if err != nil { return 0, err } diff --git a/pkg/security/secl/schemas/agent_context.schema.json b/pkg/security/secl/schemas/agent_context.schema.json index f524a02c9986e..4ec4f846aabda 100644 --- a/pkg/security/secl/schemas/agent_context.schema.json +++ b/pkg/security/secl/schemas/agent_context.schema.json @@ -27,6 +27,12 @@ "origin": { "type": "string" }, + "kernel_version": { + "type": "string" + }, + "distribution": { + "type": "string" + }, "rule_actions": { "type": "array", "items": { @@ -50,4 +56,4 @@ "arch", "origin" ] -} \ No newline at end of file +} diff --git a/pkg/security/seclog/logger.go b/pkg/security/seclog/logger.go index 632c9efde7498..c6f2aff1a24f7 100644 --- a/pkg/security/seclog/logger.go +++ b/pkg/security/seclog/logger.go @@ -13,8 +13,6 @@ import ( "strings" "sync" - "github.com/cihub/seelog" - "github.com/DataDog/datadog-agent/pkg/util/log" ) @@ -138,7 +136,7 @@ func (l *PatternLogger) Tracef(format string, params ...interface{}) { // IsTracing is used to check if TraceF would actually log func (l *PatternLogger) IsTracing() bool { - if logLevel, err := log.GetLogLevel(); err != nil || logLevel != seelog.TraceLvl { + if logLevel, err := log.GetLogLevel(); err != nil || logLevel != log.TraceLvl { return false } return true diff --git a/pkg/security/seclwin/go.mod b/pkg/security/seclwin/go.mod index 174d361f3255d..496f580b96071 100644 --- a/pkg/security/seclwin/go.mod +++ b/pkg/security/seclwin/go.mod @@ -13,5 +13,5 @@ require ( github.com/alecthomas/participle v0.7.1 // indirect github.com/jellydator/ttlcache/v3 v3.3.0 // indirect github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect - golang.org/x/sync v0.9.0 // indirect + golang.org/x/sync v0.10.0 // indirect ) diff --git a/pkg/security/seclwin/go.sum b/pkg/security/seclwin/go.sum index 502e756cc9c46..8207782fa1c53 100644 --- a/pkg/security/seclwin/go.sum +++ b/pkg/security/seclwin/go.sum @@ -18,8 +18,8 @@ github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOf github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= -golang.org/x/sync v0.9.0 h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ= -golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= +golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/pkg/security/security_profile/activity_tree/metadata/metadata.go b/pkg/security/security_profile/activity_tree/metadata/metadata.go index 2e9ea31a3da09..882e7fb69f5c0 100644 --- a/pkg/security/security_profile/activity_tree/metadata/metadata.go +++ b/pkg/security/security_profile/activity_tree/metadata/metadata.go @@ -8,7 +8,12 @@ // Package metadata holds metadata related files package metadata -import "time" +import ( + "time" + + "github.com/DataDog/datadog-agent/pkg/security/secl/containerutils" + "github.com/DataDog/datadog-agent/pkg/security/secl/model" +) // Metadata is used to provide context about the activity dump or the profile type Metadata struct { @@ -18,13 +23,13 @@ type Metadata struct { LinuxDistribution string `json:"linux_distribution"` Arch string `json:"arch"` - Name string `json:"name"` - ProtobufVersion string `json:"protobuf_version"` - DifferentiateArgs bool `json:"differentiate_args"` - ContainerID string `json:"-"` - ContainerFlags uint64 `json:"-"` - Start time.Time `json:"start"` - End time.Time `json:"end"` - Size uint64 `json:"activity_dump_size,omitempty"` - Serialization string `json:"serialization,omitempty"` + Name string `json:"name"` + ProtobufVersion string `json:"protobuf_version"` + DifferentiateArgs bool `json:"differentiate_args"` + ContainerID containerutils.ContainerID `json:"-"` + CGroupContext model.CGroupContext `json:"-"` + Start time.Time `json:"start"` + End time.Time `json:"end"` + Size uint64 `json:"activity_dump_size,omitempty"` + Serialization string `json:"serialization,omitempty"` } diff --git a/pkg/security/security_profile/activity_tree/metadata/metadata_proto_dec_v1.go b/pkg/security/security_profile/activity_tree/metadata/metadata_proto_dec_v1.go index 6f1f8ad0588f1..e08f483efac61 100644 --- a/pkg/security/security_profile/activity_tree/metadata/metadata_proto_dec_v1.go +++ b/pkg/security/security_profile/activity_tree/metadata/metadata_proto_dec_v1.go @@ -11,6 +11,7 @@ package metadata import ( adproto "github.com/DataDog/agent-payload/v5/cws/dumpsv1" + "github.com/DataDog/datadog-agent/pkg/security/secl/containerutils" activity_tree "github.com/DataDog/datadog-agent/pkg/security/security_profile/activity_tree" ) @@ -30,7 +31,7 @@ func ProtoMetadataToMetadata(meta *adproto.Metadata) Metadata { Name: meta.Name, ProtobufVersion: meta.ProtobufVersion, DifferentiateArgs: meta.DifferentiateArgs, - ContainerID: meta.ContainerId, + ContainerID: containerutils.ContainerID(meta.ContainerId), Start: activity_tree.ProtoDecodeTimestamp(meta.Start), End: activity_tree.ProtoDecodeTimestamp(meta.End), Size: meta.Size, diff --git a/pkg/security/security_profile/activity_tree/metadata/metadata_proto_enc_v1.go b/pkg/security/security_profile/activity_tree/metadata/metadata_proto_enc_v1.go index 2b02ef4004720..e28b2ce901c63 100644 --- a/pkg/security/security_profile/activity_tree/metadata/metadata_proto_enc_v1.go +++ b/pkg/security/security_profile/activity_tree/metadata/metadata_proto_enc_v1.go @@ -29,7 +29,7 @@ func ToProto(meta *Metadata) *adproto.Metadata { Name: meta.Name, ProtobufVersion: meta.ProtobufVersion, DifferentiateArgs: meta.DifferentiateArgs, - ContainerId: meta.ContainerID, + ContainerId: string(meta.ContainerID), Start: activity_tree.TimestampToProto(&meta.Start), End: activity_tree.TimestampToProto(&meta.End), Size: meta.Size, 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/security_profile/dump/activity_dump.go b/pkg/security/security_profile/dump/activity_dump.go index 80d1bb2ebe011..4df6a218cebe3 100644 --- a/pkg/security/security_profile/dump/activity_dump.go +++ b/pkg/security/security_profile/dump/activity_dump.go @@ -222,11 +222,14 @@ func NewActivityDumpFromMessage(msg *api.ActivityDumpMessage) (*ActivityDump, er Name: metadata.GetName(), ProtobufVersion: metadata.GetProtobufVersion(), DifferentiateArgs: metadata.GetDifferentiateArgs(), - ContainerID: metadata.GetContainerID(), - Start: startTime, - End: startTime.Add(timeout), - Size: metadata.GetSize(), - Arch: metadata.GetArch(), + ContainerID: containerutils.ContainerID(metadata.GetContainerID()), + CGroupContext: model.CGroupContext{ + CGroupID: containerutils.CGroupID(metadata.GetCGroupID()), + }, + Start: startTime, + End: startTime.Add(timeout), + Size: metadata.GetSize(), + Arch: metadata.GetArch(), } ad.LoadConfig = NewActivityDumpLoadConfig( []model.EventType{}, @@ -265,14 +268,26 @@ func (ad *ActivityDump) GetWorkloadSelector() *cgroupModel.WorkloadSelector { if ad.selector != nil && ad.selector.IsReady() { return ad.selector } - imageTag := utils.GetTagValue("image_tag", ad.Tags) - selector, err := cgroupModel.NewWorkloadSelector(utils.GetTagValue("image_name", ad.Tags), imageTag) - if err != nil { - return nil + + var selector cgroupModel.WorkloadSelector + var err error + if ad.ContainerID != "" { + imageTag := utils.GetTagValue("image_tag", ad.Tags) + selector, err = cgroupModel.NewWorkloadSelector(utils.GetTagValue("image_name", ad.Tags), imageTag) + if err != nil { + return nil + } + } else if ad.CGroupContext.CGroupID != "" { + selector, err = cgroupModel.NewWorkloadSelector(utils.GetTagValue("service", ad.Tags), utils.GetTagValue("version", ad.Tags)) + if err != nil { + return nil + } + } + ad.selector = &selector - // Once per workload, when tags are resolved and the firs time we successfully get the selector, tag all the existing nodes - ad.ActivityTree.TagAllNodes(imageTag) + // Once per workload, when tags are resolved and the first time we successfully get the selector, tag all the existing nodes + ad.ActivityTree.TagAllNodes(selector.Image) return ad.selector } @@ -354,7 +369,7 @@ func (ad *ActivityDump) nameMatches(name string) bool { } // containerIDMatches returns true if the ActivityDump container ID matches the provided container ID -func (ad *ActivityDump) containerIDMatches(containerID string) bool { +func (ad *ActivityDump) containerIDMatches(containerID containerutils.ContainerID) bool { return ad.Metadata.ContainerID == containerID } @@ -365,7 +380,13 @@ func (ad *ActivityDump) MatchesSelector(entry *model.ProcessCacheEntry) bool { } if len(ad.Metadata.ContainerID) > 0 { - if !ad.containerIDMatches(string(entry.ContainerID)) { + if !ad.containerIDMatches(entry.ContainerID) { + return false + } + } + + if len(ad.Metadata.CGroupContext.CGroupID) > 0 { + if entry.CGroup.CGroupID != ad.Metadata.CGroupContext.CGroupID { return false } } @@ -395,13 +416,13 @@ func (ad *ActivityDump) enable() error { } } - if len(ad.Metadata.ContainerID) > 0 { + if !ad.Metadata.CGroupContext.CGroupFile.IsNull() { // insert container ID in traced_cgroups map (it might already exist, do not update in that case) - if err := ad.adm.tracedCgroupsMap.Update(ad.Metadata.ContainerID, ad.LoadConfigCookie, ebpf.UpdateNoExist); err != nil { + if err := ad.adm.tracedCgroupsMap.Update(ad.Metadata.CGroupContext.CGroupFile, ad.LoadConfigCookie, ebpf.UpdateNoExist); err != nil { if !errors.Is(err, ebpf.ErrKeyExist) { // delete activity dump load config _ = ad.adm.activityDumpsConfigMap.Delete(ad.LoadConfigCookie) - return fmt.Errorf("couldn't push activity dump container ID %s: %w", ad.Metadata.ContainerID, err) + return fmt.Errorf("couldn't push activity dump cgroup ID %s: %w", ad.Metadata.CGroupContext.CGroupID, err) } } } @@ -448,12 +469,10 @@ func (ad *ActivityDump) disable() error { } // remove container ID from kernel space - if len(ad.Metadata.ContainerID) > 0 { - containerIDB := make([]byte, model.ContainerIDLen) - copy(containerIDB, ad.Metadata.ContainerID) - err := ad.adm.tracedCgroupsMap.Delete(containerIDB) + if !ad.Metadata.CGroupContext.CGroupFile.IsNull() { + err := ad.adm.tracedCgroupsMap.Delete(ad.Metadata.CGroupContext.CGroupFile) if err != nil && !errors.Is(err, ebpf.ErrKeyNotExist) { - return fmt.Errorf("couldn't delete activity dump filter containerID(%s): %v", ad.Metadata.ContainerID, err) + return fmt.Errorf("couldn't delete activity dump filter cgroup %s: %v", ad.Metadata.CGroupContext.CGroupID, err) } } return nil @@ -575,6 +594,9 @@ func (ad *ActivityDump) getSelectorStr() string { if len(ad.Metadata.ContainerID) > 0 { tags = append(tags, fmt.Sprintf("container_id:%s", ad.Metadata.ContainerID)) } + if len(ad.Metadata.CGroupContext.CGroupID) > 0 { + tags = append(tags, fmt.Sprintf("cgroup_id:%s", ad.Metadata.CGroupContext.CGroupID)) + } if len(ad.Tags) > 0 { for _, tag := range ad.Tags { if !strings.HasPrefix(tag, "container_id") { @@ -614,6 +636,8 @@ func (ad *ActivityDump) ResolveTags() error { return ad.resolveTags() } +const systemdSystemDir = "/usr/lib/systemd/system" + // resolveTags thread unsafe version ot ResolveTags func (ad *ActivityDump) resolveTags() error { selector := ad.GetWorkloadSelector() @@ -621,10 +645,26 @@ func (ad *ActivityDump) resolveTags() error { return nil } - var err error - ad.Tags, err = ad.adm.resolvers.TagsResolver.ResolveWithErr(containerutils.ContainerID(ad.Metadata.ContainerID)) - if err != nil { - return fmt.Errorf("failed to resolve %s: %w", ad.Metadata.ContainerID, err) + if len(ad.Metadata.ContainerID) > 0 { + var err error + if ad.Tags, err = ad.adm.resolvers.TagsResolver.ResolveWithErr(containerutils.ContainerID(ad.Metadata.ContainerID)); err != nil { + return fmt.Errorf("failed to resolve %s: %w", ad.Metadata.ContainerID, err) + } + } else if len(ad.Metadata.CGroupContext.CGroupID) > 0 { + systemdService := filepath.Base(string(ad.Metadata.CGroupContext.CGroupID)) + serviceVersion := "" + servicePath := filepath.Join(systemdSystemDir, systemdService) + + if ad.adm.resolvers.SBOMResolver != nil { + if pkg := ad.adm.resolvers.SBOMResolver.ResolvePackage("", &model.FileEvent{PathnameStr: servicePath}); pkg != nil { + serviceVersion = pkg.Version + } + } + + ad.Tags = []string{ + "service:" + systemdService, + "version:" + serviceVersion, + } } return nil @@ -655,7 +695,8 @@ func (ad *ActivityDump) ToSecurityActivityDumpMessage() *api.ActivityDumpMessage Name: ad.Metadata.Name, ProtobufVersion: ad.Metadata.ProtobufVersion, DifferentiateArgs: ad.Metadata.DifferentiateArgs, - ContainerID: ad.Metadata.ContainerID, + ContainerID: string(ad.Metadata.ContainerID), + CGroupID: string(ad.Metadata.CGroupContext.CGroupID), Start: ad.Metadata.Start.Format(time.RFC822), Timeout: ad.LoadConfig.Timeout.String(), Size: ad.Metadata.Size, diff --git a/pkg/security/security_profile/dump/load_controller.go b/pkg/security/security_profile/dump/load_controller.go index 3d0148f168232..f9bc80cdd3b4f 100644 --- a/pkg/security/security_profile/dump/load_controller.go +++ b/pkg/security/security_profile/dump/load_controller.go @@ -16,6 +16,7 @@ import ( "github.com/DataDog/datadog-agent/pkg/security/config" "github.com/DataDog/datadog-agent/pkg/security/metrics" + "github.com/DataDog/datadog-agent/pkg/security/secl/containerutils" "github.com/DataDog/datadog-agent/pkg/security/secl/model" "github.com/DataDog/datadog-agent/pkg/security/seclog" ) @@ -34,6 +35,7 @@ type ActivityDumpLoadController struct { // eBPF maps activityDumpConfigDefaults *ebpf.Map + activityDumpLoadConfig map[containerutils.CGroupManager]*model.ActivityDumpLoadConfig } // NewActivityDumpLoadController returns a new activity dump load controller @@ -58,7 +60,11 @@ func NewActivityDumpLoadController(adm *ActivityDumpManager) (*ActivityDumpLoadC }, nil } -func (lc *ActivityDumpLoadController) getDefaultLoadConfig() *model.ActivityDumpLoadConfig { +func (lc *ActivityDumpLoadController) getDefaultLoadConfigs() (map[containerutils.CGroupManager]*model.ActivityDumpLoadConfig, error) { + if lc.activityDumpLoadConfig != nil { + return lc.activityDumpLoadConfig, nil + } + defaults := NewActivityDumpLoadConfig( lc.adm.config.RuntimeSecurity.ActivityDumpTracedEventTypes, lc.adm.config.RuntimeSecurity.ActivityDumpCgroupDumpTimeout, @@ -68,14 +74,38 @@ func (lc *ActivityDumpLoadController) getDefaultLoadConfig() *model.ActivityDump lc.adm.resolvers.TimeResolver, ) defaults.WaitListTimestampRaw = uint64(lc.adm.config.RuntimeSecurity.ActivityDumpCgroupWaitListTimeout) - return defaults + + allDefaultConfigs := map[string]containerutils.CGroupManager{ + containerutils.CGroupManagerDocker.String(): containerutils.CGroupManagerDocker, + containerutils.CGroupManagerPodman.String(): containerutils.CGroupManagerPodman, + containerutils.CGroupManagerCRI.String(): containerutils.CGroupManagerCRI, + containerutils.CGroupManagerCRIO.String(): containerutils.CGroupManagerCRIO, + containerutils.CGroupManagerSystemd.String(): containerutils.CGroupManagerSystemd, + } + defaultConfigs := make(map[containerutils.CGroupManager]*model.ActivityDumpLoadConfig) + for _, cgroupManager := range lc.adm.config.RuntimeSecurity.ActivityDumpCgroupsManagers { + cgroupManager, found := allDefaultConfigs[cgroupManager] + if !found { + return nil, fmt.Errorf("unsupported cgroup manager '%s'", cgroupManager) + } + defaultConfigs[cgroupManager] = defaults + } + lc.activityDumpLoadConfig = defaultConfigs + return defaultConfigs, nil } -// PushCurrentConfig pushes the current load controller config to kernel space -func (lc *ActivityDumpLoadController) PushCurrentConfig() error { +// PushDefaultCurrentConfigs pushes the current load controller configs to kernel space +func (lc *ActivityDumpLoadController) PushDefaultCurrentConfigs() error { + defaultConfigs, err := lc.getDefaultLoadConfigs() + if err != nil { + return err + } + // push default load config values - if err := lc.activityDumpConfigDefaults.Put(uint32(0), lc.getDefaultLoadConfig()); err != nil { - return fmt.Errorf("couldn't update default activity dump load config: %w", err) + for cgroupManager, defaultConfig := range defaultConfigs { + if err := lc.activityDumpConfigDefaults.Put(uint32(cgroupManager), defaultConfig); err != nil { + return fmt.Errorf("couldn't update default activity dump load config: %w", err) + } } return nil } @@ -85,6 +115,7 @@ func (lc *ActivityDumpLoadController) PushCurrentConfig() error { func (lc *ActivityDumpLoadController) NextPartialDump(ad *ActivityDump) *ActivityDump { newDump := NewActivityDump(ad.adm) newDump.Metadata.ContainerID = ad.Metadata.ContainerID + newDump.Metadata.CGroupContext = ad.Metadata.CGroupContext newDump.Metadata.DifferentiateArgs = ad.Metadata.DifferentiateArgs newDump.Tags = ad.Tags newDump.selector = ad.selector diff --git a/pkg/security/security_profile/dump/local_storage.go b/pkg/security/security_profile/dump/local_storage.go index a1fa0c334806d..8510ea923b57b 100644 --- a/pkg/security/security_profile/dump/local_storage.go +++ b/pkg/security/security_profile/dump/local_storage.go @@ -182,16 +182,6 @@ func (storage *ActivityDumpLocalStorage) Persist(request config.StorageRequest, // set activity dump size for current encoding ad.Metadata.Size = uint64(len(raw.Bytes())) - // add the file to the list of local dumps (thus removing one or more files if we reached the limit) - if storage.localDumps != nil { - filePaths, ok := storage.localDumps.Get(ad.Metadata.Name) - if !ok { - storage.localDumps.Add(ad.Metadata.Name, &[]string{outputPath}) - } else { - *filePaths = append(*filePaths, outputPath) - } - } - // create output file _ = os.MkdirAll(request.OutputDirectory, 0400) tmpOutputPath := outputPath + ".tmp" @@ -221,6 +211,17 @@ func (storage *ActivityDumpLocalStorage) Persist(request config.StorageRequest, } seclog.Infof("[%s] file for [%s] written at: [%s]", request.Format, ad.GetSelectorStr(), outputPath) + + // add the file to the list of local dumps (thus removing one or more files if we reached the limit) + if storage.localDumps != nil { + filePaths, ok := storage.localDumps.Get(ad.Metadata.Name) + if !ok { + storage.localDumps.Add(ad.Metadata.Name, &[]string{outputPath}) + } else { + *filePaths = append(*filePaths, outputPath) + } + } + return nil } diff --git a/pkg/security/security_profile/dump/manager.go b/pkg/security/security_profile/dump/manager.go index a0b8c490b965e..be81a28ca5c4d 100644 --- a/pkg/security/security_profile/dump/manager.go +++ b/pkg/security/security_profile/dump/manager.go @@ -34,6 +34,8 @@ import ( "github.com/DataDog/datadog-agent/pkg/security/proto/api" "github.com/DataDog/datadog-agent/pkg/security/resolvers" cgroupModel "github.com/DataDog/datadog-agent/pkg/security/resolvers/cgroup/model" + "github.com/DataDog/datadog-agent/pkg/security/resolvers/tags" + "github.com/DataDog/datadog-agent/pkg/security/secl/containerutils" "github.com/DataDog/datadog-agent/pkg/security/secl/model" "github.com/DataDog/datadog-agent/pkg/security/seclog" activity_tree "github.com/DataDog/datadog-agent/pkg/security/security_profile/activity_tree" @@ -47,7 +49,7 @@ type ActivityDumpHandler interface { // SecurityProfileManager is a generic interface used to communicate with the Security Profile manager type SecurityProfileManager interface { - FetchSilentWorkloads() map[cgroupModel.WorkloadSelector][]*cgroupModel.CacheEntry + FetchSilentWorkloads() map[cgroupModel.WorkloadSelector][]*tags.Workload OnLocalStorageCleanup(files []string) } @@ -69,7 +71,7 @@ type ActivityDumpManager struct { tracedCgroupsMap *ebpf.Map cgroupWaitList *ebpf.Map activityDumpsConfigMap *ebpf.Map - ignoreFromSnapshot map[string]bool + ignoreFromSnapshot map[model.PathKey]bool dumpLimiter *lru.Cache[cgroupModel.WorkloadSelector, *atomic.Uint64] workloadDenyList []cgroupModel.WorkloadSelector @@ -147,13 +149,13 @@ func (adm *ActivityDumpManager) cleanup() { // cleanup cgroup_wait_list map iterator := adm.cgroupWaitList.Iterate() - containerIDB := make([]byte, model.ContainerIDLen) + cgroupFile := make([]byte, model.PathKeySize) var timestamp uint64 - for iterator.Next(&containerIDB, ×tamp) { + for iterator.Next(&cgroupFile, ×tamp) { if time.Now().After(adm.resolvers.TimeResolver.ResolveMonotonicTimestamp(timestamp)) { - if err := adm.cgroupWaitList.Delete(&containerIDB); err != nil { - seclog.Errorf("couldn't delete cgroup_wait_list entry for (%s): %v", string(containerIDB), err) + if err := adm.cgroupWaitList.Delete(&cgroupFile); err != nil { + seclog.Errorf("couldn't delete cgroup_wait_list entry for (%v): %v", cgroupFile, err) } } } @@ -169,7 +171,7 @@ func (adm *ActivityDumpManager) getExpiredDumps() []*ActivityDump { for _, ad := range adm.activeDumps { if time.Now().After(ad.Metadata.End) || ad.state == Stopped { expiredDumps = append(expiredDumps, ad) - delete(adm.ignoreFromSnapshot, ad.Metadata.ContainerID) + delete(adm.ignoreFromSnapshot, ad.Metadata.CGroupContext.CGroupFile) } else { newDumps = append(newDumps, ad) } @@ -303,7 +305,7 @@ func NewActivityDumpManager(config *config.Config, statsdClient statsd.ClientInt cgroupWaitList: cgroupWaitList, activityDumpsConfigMap: activityDumpsConfigMap, snapshotQueue: make(chan *ActivityDump, 100), - ignoreFromSnapshot: make(map[string]bool), + ignoreFromSnapshot: make(map[model.PathKey]bool), dumpLimiter: limiter, workloadDenyList: denyList, workloadDenyListHits: atomic.NewUint64(0), @@ -319,7 +321,8 @@ func NewActivityDumpManager(config *config.Config, statsdClient statsd.ClientInt if err != nil { return nil, fmt.Errorf("couldn't instantiate the activity dump load controller: %w", err) } - if err = loadController.PushCurrentConfig(); err != nil { + + if err = loadController.PushDefaultCurrentConfigs(); err != nil { return nil, fmt.Errorf("failed to push load controller config settings to kernel space: %w", err) } adm.loadController = loadController @@ -359,19 +362,35 @@ func (adm *ActivityDumpManager) insertActivityDump(newDump *ActivityDump) error for _, ad := range adm.activeDumps { if ad.Metadata.ContainerID == newDump.Metadata.ContainerID { // an activity dump is already active for this container ID, ignore - return nil + return fmt.Errorf("dump for container %s already running", ad.Metadata.ContainerID) } } } - // enable the new dump to start collecting events from kernel space - if err := newDump.enable(); err != nil { - return fmt.Errorf("couldn't insert new dump: %w", err) + if len(newDump.Metadata.CGroupContext.CGroupID) > 0 { + // check if the provided container ID is new + for _, ad := range adm.activeDumps { + if ad.Metadata.CGroupContext.CGroupID == newDump.Metadata.CGroupContext.CGroupID { + // an activity dump is already active for this container ID, ignore + return fmt.Errorf("dump for cgroup %s already running", ad.Metadata.CGroupContext.CGroupID) + } + } } // loop through the process cache entry tree and push traced pids if necessary pces := adm.newProcessCacheEntrySearcher(newDump) - adm.resolvers.ProcessResolver.Walk(pces.SearchTracedProcessCacheEntry) + adm.resolvers.ProcessResolver.Walk(func(entry *model.ProcessCacheEntry) { + if !pces.ad.MatchesSelector(entry) { + return + } + pces.ad.Metadata.CGroupContext = entry.CGroup + pces.SearchTracedProcessCacheEntry(entry) + }) + + // enable the new dump to start collecting events from kernel space + if err := newDump.enable(); err != nil { + return fmt.Errorf("couldn't insert new dump: %w", err) + } // Delay the activity dump snapshot to reduce the overhead on the main goroutine select { @@ -390,10 +409,10 @@ func (adm *ActivityDumpManager) insertActivityDump(newDump *ActivityDump) error } // handleDefaultDumpRequest starts dumping a new workload with the provided load configuration and the default dump configuration -func (adm *ActivityDumpManager) startDumpWithConfig(containerID string, containerFlags, cookie uint64, loadConfig model.ActivityDumpLoadConfig) error { +func (adm *ActivityDumpManager) startDumpWithConfig(containerID containerutils.ContainerID, cgroupContext model.CGroupContext, cookie uint64, loadConfig model.ActivityDumpLoadConfig) error { newDump := NewActivityDump(adm, func(ad *ActivityDump) { ad.Metadata.ContainerID = containerID - ad.Metadata.ContainerFlags = containerFlags + ad.Metadata.CGroupContext = cgroupContext ad.SetLoadConfig(cookie, loadConfig) if adm.config.RuntimeSecurity.ActivityDumpCgroupDifferentiateArgs { @@ -431,12 +450,12 @@ func (adm *ActivityDumpManager) HandleCGroupTracingEvent(event *model.CgroupTrac adm.Lock() defer adm.Unlock() - if len(event.ContainerContext.ContainerID) == 0 { - seclog.Warnf("received a cgroup tracing event with an empty container ID") + if len(event.CGroupContext.CGroupID) == 0 { + seclog.Warnf("received a cgroup tracing event with an empty cgroup ID") return } - if err := adm.startDumpWithConfig(string(event.ContainerContext.ContainerID), uint64(event.CGroupContext.CGroupFlags), event.ConfigCookie, event.Config); err != nil { + if err := adm.startDumpWithConfig(event.ContainerContext.ContainerID, event.CGroupContext, event.ConfigCookie, event.Config); err != nil { seclog.Warnf("%v", err) } } @@ -496,7 +515,19 @@ workloadLoop: } // if we're still here, we can start tracing this workload - if err := adm.startDumpWithConfig(string(workloads[0].ContainerID), uint64(workloads[0].CGroupFlags), utils.NewCookie(), *adm.loadController.getDefaultLoadConfig()); err != nil { + defaultConfigs, err := adm.loadController.getDefaultLoadConfigs() + if err != nil { + seclog.Errorf("%v", err) + continue + } + + defaultConfig, found := defaultConfigs[containerutils.CGroupManager(workloads[0].CGroupContext.CGroupFlags)] + if !found { + seclog.Errorf("Failed to find default activity dump config for %s", containerutils.CGroupManager(workloads[0].CGroupContext.CGroupFlags).String()) + continue + } + + if err := adm.startDumpWithConfig(workloads[0].ContainerID, workloads[0].CGroupContext, utils.NewCookie(), *defaultConfig); err != nil { if !errors.Is(err, unix.E2BIG) { seclog.Debugf("%v", err) break @@ -522,12 +553,32 @@ func (adm *ActivityDumpManager) ListActivityDumps(_ *api.ActivityDumpListParams) // DumpActivity handles an activity dump request func (adm *ActivityDumpManager) DumpActivity(params *api.ActivityDumpParams) (*api.ActivityDumpMessage, error) { + if params.GetContainerID() == "" && params.GetCGroupID() == "" { + errMsg := fmt.Errorf("you must specify one selector between containerID and cgroupID") + return &api.ActivityDumpMessage{Error: errMsg.Error()}, errMsg + } + adm.Lock() defer adm.Unlock() + var dumpDuration time.Duration + var err error + if params.Timeout != "" { + if dumpDuration, err = time.ParseDuration(params.Timeout); err != nil { + return nil, err + } + } else { + dumpDuration = adm.config.RuntimeSecurity.ActivityDumpCgroupDumpTimeout + } + + if params.Storage.LocalStorageDirectory == "" { + params.Storage.LocalStorageDirectory = adm.config.RuntimeSecurity.ActivityDumpLocalStorageDirectory + } + newDump := NewActivityDump(adm, func(ad *ActivityDump) { - ad.Metadata.ContainerID = params.GetContainerID() - dumpDuration, _ := time.ParseDuration(params.Timeout) + ad.Metadata.ContainerID = containerutils.ContainerID(params.GetContainerID()) + ad.Metadata.CGroupContext.CGroupID = containerutils.CGroupID(params.GetCGroupID()) + ad.SetTimeout(dumpDuration) if params.GetDifferentiateArgs() { @@ -559,15 +610,16 @@ func (adm *ActivityDumpManager) StopActivityDump(params *api.ActivityDumpStopPar adm.Lock() defer adm.Unlock() - if params.GetName() == "" && params.GetContainerID() == "" { - errMsg := fmt.Errorf("you must specify one selector between name and containerID") + if params.GetName() == "" && params.GetContainerID() == "" && params.GetCGroupID() == "" { + errMsg := fmt.Errorf("you must specify one selector between name, containerID and cgroupID") return &api.ActivityDumpStopMessage{Error: errMsg.Error()}, errMsg } toDelete := -1 for i, d := range adm.activeDumps { if (params.GetName() != "" && d.nameMatches(params.GetName())) || - (params.GetContainerID() != "" && d.containerIDMatches(params.GetContainerID())) { + (params.GetContainerID() != "" && d.containerIDMatches(containerutils.ContainerID(params.GetContainerID())) || + (params.GetCGroupID() != "" && string(d.Metadata.CGroupContext.CGroupID) == params.GetCGroupID())) { d.Finalize(true) seclog.Infof("tracing stopped for [%s]", d.GetSelectorStr()) toDelete = i @@ -592,8 +644,10 @@ func (adm *ActivityDumpManager) StopActivityDump(params *api.ActivityDumpStopPar var errMsg error if params.GetName() != "" { errMsg = fmt.Errorf("the activity dump manager does not contain any ActivityDump with the following name: %s", params.GetName()) - } else /* if params.GetContainerID() != "" */ { + } else if params.GetContainerID() != "" { errMsg = fmt.Errorf("the activity dump manager does not contain any ActivityDump with the following containerID: %s", params.GetContainerID()) + } else /* if params.GetCGroupID() != "" */ { + errMsg = fmt.Errorf("the activity dump manager does not contain any ActivityDump with the following cgroup ID: %s", params.GetCGroupID()) } return &api.ActivityDumpStopMessage{Error: errMsg.Error()}, errMsg } @@ -785,13 +839,14 @@ func (adm *ActivityDumpManager) SendStats() error { func (adm *ActivityDumpManager) SnapshotTracedCgroups() { var err error var event model.CgroupTracingEvent - containerIDB := make([]byte, model.ContainerIDLen) + var cgroupFile model.PathKey + iterator := adm.tracedCgroupsMap.Iterate() seclog.Infof("snapshotting traced_cgroups map") - for iterator.Next(&containerIDB, &event.ConfigCookie) { + for iterator.Next(&cgroupFile, &event.ConfigCookie) { adm.Lock() - if adm.ignoreFromSnapshot[string(containerIDB)] { + if adm.ignoreFromSnapshot[cgroupFile] { adm.Unlock() continue } @@ -799,15 +854,8 @@ func (adm *ActivityDumpManager) SnapshotTracedCgroups() { if err = adm.activityDumpsConfigMap.Lookup(&event.ConfigCookie, &event.Config); err != nil { // this config doesn't exist anymore, remove expired entries - seclog.Errorf("config not found for (%s): %v", string(containerIDB), err) - _ = adm.tracedCgroupsMap.Delete(containerIDB) - continue - } - - if _, err = event.ContainerContext.UnmarshalBinary(containerIDB[:]); err != nil { - seclog.Errorf("couldn't unmarshal container ID from traced_cgroups key: %v", err) - // remove invalid entry - _ = adm.tracedCgroupsMap.Delete(containerIDB) + seclog.Errorf("config not found for (%v): %v", cgroupFile, err) + _ = adm.tracedCgroupsMap.Delete(cgroupFile) continue } @@ -878,7 +926,7 @@ func (adm *ActivityDumpManager) triggerLoadController() { } // remove container ID from the map of ignored container IDs for the snapshot - delete(adm.ignoreFromSnapshot, ad.Metadata.ContainerID) + delete(adm.ignoreFromSnapshot, ad.Metadata.CGroupContext.CGroupFile) adm.Unlock() } } @@ -901,7 +949,7 @@ func (adm *ActivityDumpManager) getOverweightDumps() []*ActivityDump { if dumpSize >= int64(adm.config.RuntimeSecurity.ActivityDumpMaxDumpSize()) { toDelete = append([]int{i}, toDelete...) dumps = append(dumps, ad) - adm.ignoreFromSnapshot[ad.Metadata.ContainerID] = true + adm.ignoreFromSnapshot[ad.Metadata.CGroupContext.CGroupFile] = true } } for _, i := range toDelete { diff --git a/pkg/security/security_profile/dump/manager_test.go b/pkg/security/security_profile/dump/manager_test.go index f16d599230fd6..d7075b4d62f42 100644 --- a/pkg/security/security_profile/dump/manager_test.go +++ b/pkg/security/security_profile/dump/manager_test.go @@ -17,6 +17,7 @@ import ( "github.com/DataDog/datadog-go/v5/statsd" "github.com/DataDog/datadog-agent/pkg/security/config" + "github.com/DataDog/datadog-agent/pkg/security/secl/model" activity_tree "github.com/DataDog/datadog-agent/pkg/security/security_profile/activity_tree" mtdt "github.com/DataDog/datadog-agent/pkg/security/security_profile/activity_tree/metadata" ) @@ -197,7 +198,7 @@ func TestActivityDumpManager_getExpiredDumps(t *testing.T) { adm := &ActivityDumpManager{ activeDumps: tt.fields.activeDumps, - ignoreFromSnapshot: make(map[string]bool), + ignoreFromSnapshot: make(map[model.PathKey]bool), } expiredDumps := adm.getExpiredDumps() @@ -474,7 +475,7 @@ func TestActivityDumpManager_getOverweightDumps(t *testing.T) { }, }, statsdClient: &statsd.NoOpClient{}, - ignoreFromSnapshot: make(map[string]bool), + ignoreFromSnapshot: make(map[model.PathKey]bool), } compareListOfDumps(t, adm.getOverweightDumps(), tt.overweightDumps) diff --git a/pkg/security/security_profile/dump/storage_manager.go b/pkg/security/security_profile/dump/storage_manager.go index 454309068fad4..ab0382257b6de 100644 --- a/pkg/security/security_profile/dump/storage_manager.go +++ b/pkg/security/security_profile/dump/storage_manager.go @@ -33,12 +33,15 @@ type ActivityDumpStorage interface { type ActivityDumpStorageManager struct { statsdClient statsd.ClientInterface storages map[config.StorageType]ActivityDumpStorage + isFowarder bool } // NewAgentStorageManager returns a new instance of ActivityDumpStorageManager -func NewAgentStorageManager() (*ActivityDumpStorageManager, error) { +func NewAgentStorageManager(statsdClient statsd.ClientInterface) (*ActivityDumpStorageManager, error) { manager := &ActivityDumpStorageManager{ - storages: make(map[config.StorageType]ActivityDumpStorage), + statsdClient: statsdClient, + storages: make(map[config.StorageType]ActivityDumpStorage), + isFowarder: false, } // create remote storage @@ -54,7 +57,8 @@ func NewAgentStorageManager() (*ActivityDumpStorageManager, error) { // NewAgentCommandStorageManager returns a new instance of ActivityDumpStorageManager func NewAgentCommandStorageManager(cfg *config.Config) (*ActivityDumpStorageManager, error) { manager := &ActivityDumpStorageManager{ - storages: make(map[config.StorageType]ActivityDumpStorage), + storages: make(map[config.StorageType]ActivityDumpStorage), + isFowarder: false, } storage, err := NewActivityDumpLocalStorage(cfg, nil) @@ -78,6 +82,7 @@ func NewActivityDumpStorageManager(cfg *config.Config, statsdClient statsd.Clien manager := &ActivityDumpStorageManager{ storages: make(map[config.StorageType]ActivityDumpStorage), statsdClient: statsdClient, + isFowarder: true, } storage, err := NewActivityDumpLocalStorage(cfg, m) @@ -133,7 +138,7 @@ func (manager *ActivityDumpStorageManager) PersistRaw(requests []config.StorageR } // send dump metric - if manager.statsdClient != nil { + if manager.statsdClient != nil && manager.isFowarder { if size := len(raw.Bytes()); size > 0 { tags := []string{"format:" + request.Format.String(), "storage_type:" + request.Type.String(), fmt.Sprintf("compression:%v", request.Compression)} if err := manager.statsdClient.Count(metrics.MetricActivityDumpSizeInBytes, int64(size), tags, 1.0); err != nil { diff --git a/pkg/security/security_profile/dump/storage_manager_unsupported.go b/pkg/security/security_profile/dump/storage_manager_unsupported.go index 885c1f2030808..3fee25e03615c 100644 --- a/pkg/security/security_profile/dump/storage_manager_unsupported.go +++ b/pkg/security/security_profile/dump/storage_manager_unsupported.go @@ -12,6 +12,8 @@ import ( "bytes" "fmt" + "github.com/DataDog/datadog-go/v5/statsd" + "github.com/DataDog/datadog-agent/pkg/security/config" "github.com/DataDog/datadog-agent/pkg/security/proto/api" ) @@ -28,7 +30,7 @@ func (manager *ActivityDumpStorageManager) PersistRaw(_ []config.StorageRequest, func (manager *ActivityDumpStorageManager) SendTelemetry() {} // NewAgentStorageManager returns a new instance of ActivityDumpStorageManager -func NewAgentStorageManager() (*ActivityDumpStorageManager, error) { +func NewAgentStorageManager(_ statsd.ClientInterface) (*ActivityDumpStorageManager, error) { return nil, fmt.Errorf("the activity dump manager is unsupported on this platform") } diff --git a/pkg/security/security_profile/profile/manager.go b/pkg/security/security_profile/profile/manager.go index aadd9b94cd88b..38fd111fbfe5a 100644 --- a/pkg/security/security_profile/profile/manager.go +++ b/pkg/security/security_profile/profile/manager.go @@ -29,7 +29,6 @@ import ( "github.com/DataDog/datadog-agent/pkg/security/metrics" "github.com/DataDog/datadog-agent/pkg/security/proto/api" "github.com/DataDog/datadog-agent/pkg/security/resolvers" - "github.com/DataDog/datadog-agent/pkg/security/resolvers/cgroup" cgroupModel "github.com/DataDog/datadog-agent/pkg/security/resolvers/cgroup/model" "github.com/DataDog/datadog-agent/pkg/security/resolvers/tags" "github.com/DataDog/datadog-agent/pkg/security/secl/containerutils" @@ -228,7 +227,7 @@ func (m *SecurityProfileManager) Start(ctx context.Context) { // register the manager to the CGroup resolver _ = m.resolvers.TagsResolver.RegisterListener(tags.WorkloadSelectorResolved, m.OnWorkloadSelectorResolvedEvent) - _ = m.resolvers.CGroupResolver.RegisterListener(cgroup.CGroupDeleted, m.OnCGroupDeletedEvent) + _ = m.resolvers.TagsResolver.RegisterListener(tags.WorkloadSelectorDeleted, m.OnWorkloadDeletedEvent) seclog.Infof("security profile manager started") @@ -250,7 +249,7 @@ func (m *SecurityProfileManager) propagateWorkloadSelectorsToProviders() { } // OnWorkloadSelectorResolvedEvent is used to handle the creation of a new cgroup with its resolved tags -func (m *SecurityProfileManager) OnWorkloadSelectorResolvedEvent(workload *cgroupModel.CacheEntry) { +func (m *SecurityProfileManager) OnWorkloadSelectorResolvedEvent(workload *tags.Workload) { m.profilesLock.Lock() defer m.profilesLock.Unlock() workload.Lock() @@ -261,7 +260,7 @@ func (m *SecurityProfileManager) OnWorkloadSelectorResolvedEvent(workload *cgrou return } - selector := workload.WorkloadSelector + selector := workload.Selector selector.Tag = "*" // check if the workload of this selector already exists @@ -307,7 +306,7 @@ func (m *SecurityProfileManager) OnWorkloadSelectorResolvedEvent(workload *cgrou } // LinkProfile applies a profile to the provided workload -func (m *SecurityProfileManager) LinkProfile(profile *SecurityProfile, workload *cgroupModel.CacheEntry) { +func (m *SecurityProfileManager) LinkProfile(profile *SecurityProfile, workload *tags.Workload) { profile.Lock() defer profile.Unlock() @@ -329,7 +328,7 @@ func (m *SecurityProfileManager) LinkProfile(profile *SecurityProfile, workload } // UnlinkProfile removes the link between a workload and a profile -func (m *SecurityProfileManager) UnlinkProfile(profile *SecurityProfile, workload *cgroupModel.CacheEntry) { +func (m *SecurityProfileManager) UnlinkProfile(profile *SecurityProfile, workload *tags.Workload) { profile.Lock() defer profile.Unlock() @@ -394,11 +393,11 @@ func FillProfileContextFromProfile(ctx *model.SecurityProfileContext, profile *S } } -// OnCGroupDeletedEvent is used to handle a CGroupDeleted event -func (m *SecurityProfileManager) OnCGroupDeletedEvent(workload *cgroupModel.CacheEntry) { +// OnWorkloadDeletedEvent is used to handle a WorkloadDeleted event +func (m *SecurityProfileManager) OnWorkloadDeletedEvent(workload *tags.Workload) { // lookup the profile selector := cgroupModel.WorkloadSelector{ - Image: workload.WorkloadSelector.Image, + Image: workload.Selector.Image, Tag: "*", } profile := m.GetProfile(selector) @@ -640,24 +639,24 @@ func (m *SecurityProfileManager) unloadProfile(profile *SecurityProfile) { } // linkProfile (thread unsafe) updates the kernel space mapping between a workload and its profile -func (m *SecurityProfileManager) linkProfile(profile *SecurityProfile, workload *cgroupModel.CacheEntry) { +func (m *SecurityProfileManager) linkProfile(profile *SecurityProfile, workload *tags.Workload) { if err := m.securityProfileMap.Put([]byte(workload.ContainerID), profile.profileCookie); err != nil { - seclog.Errorf("couldn't link workload %s (selector: %s) with profile %s (check map size limit ?): %v", workload.ContainerID, workload.WorkloadSelector.String(), profile.Metadata.Name, err) + seclog.Errorf("couldn't link workload %s (selector: %s) with profile %s (check map size limit ?): %v", workload.ContainerID, workload.Selector.String(), profile.Metadata.Name, err) return } - seclog.Infof("workload %s (selector: %s) successfully linked to profile %s", workload.ContainerID, workload.WorkloadSelector.String(), profile.Metadata.Name) + seclog.Infof("workload %s (selector: %s) successfully linked to profile %s", workload.ContainerID, workload.Selector.String(), profile.Metadata.Name) } // unlinkProfile (thread unsafe) updates the kernel space mapping between a workload and its profile -func (m *SecurityProfileManager) unlinkProfile(profile *SecurityProfile, workload *cgroupModel.CacheEntry) { +func (m *SecurityProfileManager) unlinkProfile(profile *SecurityProfile, workload *tags.Workload) { if !profile.loadedInKernel { return } if err := m.securityProfileMap.Delete([]byte(workload.ContainerID)); err != nil { - seclog.Errorf("couldn't unlink workload %s (selector: %s) with profile %s: %v", workload.ContainerID, workload.WorkloadSelector.String(), profile.Metadata.Name, err) + seclog.Errorf("couldn't unlink workload %s (selector: %s) with profile %s: %v", workload.ContainerID, workload.Selector.String(), profile.Metadata.Name, err) } - seclog.Infof("workload %s (selector: %s) successfully unlinked from profile %s", workload.ContainerID, workload.WorkloadSelector.String(), profile.Metadata.Name) + seclog.Infof("workload %s (selector: %s) successfully unlinked from profile %s", workload.ContainerID, workload.Selector.String(), profile.Metadata.Name) } func (m *SecurityProfileManager) canGenerateAnomaliesFor(e *model.Event) bool { @@ -960,11 +959,11 @@ func (m *SecurityProfileManager) SaveSecurityProfile(params *api.SecurityProfile } // FetchSilentWorkloads returns the list of workloads for which we haven't received any profile -func (m *SecurityProfileManager) FetchSilentWorkloads() map[cgroupModel.WorkloadSelector][]*cgroupModel.CacheEntry { +func (m *SecurityProfileManager) FetchSilentWorkloads() map[cgroupModel.WorkloadSelector][]*tags.Workload { m.profilesLock.Lock() defer m.profilesLock.Unlock() - out := make(map[cgroupModel.WorkloadSelector][]*cgroupModel.CacheEntry) + out := make(map[cgroupModel.WorkloadSelector][]*tags.Workload) for selector, profile := range m.profiles { profile.Lock() diff --git a/pkg/security/security_profile/profile/manager_test.go b/pkg/security/security_profile/profile/manager_test.go index dc41ce396c286..b25390fbad9d0 100644 --- a/pkg/security/security_profile/profile/manager_test.go +++ b/pkg/security/security_profile/profile/manager_test.go @@ -21,6 +21,7 @@ import ( "github.com/DataDog/datadog-agent/pkg/security/config" cgroupModel "github.com/DataDog/datadog-agent/pkg/security/resolvers/cgroup/model" + "github.com/DataDog/datadog-agent/pkg/security/resolvers/tags" "github.com/DataDog/datadog-agent/pkg/security/secl/containerutils" "github.com/DataDog/datadog-agent/pkg/security/secl/model" activity_tree "github.com/DataDog/datadog-agent/pkg/security/security_profile/activity_tree" @@ -841,14 +842,15 @@ func TestSecurityProfileManager_tryAutolearn(t *testing.T) { if ti.newProfile || profile == nil { profile = NewSecurityProfile(cgroupModel.WorkloadSelector{Image: "image", Tag: "tag"}, []model.EventType{model.ExecEventType, model.DNSEventType}, nil) profile.ActivityTree = activity_tree.NewActivityTree(profile, nil, "security_profile") - profile.Instances = append(profile.Instances, &cgroupModel.CacheEntry{ - ContainerContext: model.ContainerContext{ + profile.Instances = append(profile.Instances, &tags.Workload{ + CacheEntry: &cgroupModel.CacheEntry{ContainerContext: model.ContainerContext{ ContainerID: containerutils.ContainerID(defaultContainerID), }, - CGroupContext: model.CGroupContext{ - CGroupID: containerutils.CGroupID(defaultContainerID), + CGroupContext: model.CGroupContext{ + CGroupID: containerutils.CGroupID(defaultContainerID), + }, }, - WorkloadSelector: cgroupModel.WorkloadSelector{Image: "image", Tag: "tag"}, + Selector: cgroupModel.WorkloadSelector{Image: "image", Tag: "tag"}, }) profile.loadedNano = uint64(t0.UnixNano()) } diff --git a/pkg/security/security_profile/profile/profile.go b/pkg/security/security_profile/profile/profile.go index c70c28f9712b2..b7118732d1a9d 100644 --- a/pkg/security/security_profile/profile/profile.go +++ b/pkg/security/security_profile/profile/profile.go @@ -22,6 +22,7 @@ import ( "github.com/DataDog/datadog-agent/pkg/security/proto/api" cgroupModel "github.com/DataDog/datadog-agent/pkg/security/resolvers/cgroup/model" + "github.com/DataDog/datadog-agent/pkg/security/resolvers/tags" "github.com/DataDog/datadog-agent/pkg/security/secl/model" activity_tree "github.com/DataDog/datadog-agent/pkg/security/security_profile/activity_tree" mtdt "github.com/DataDog/datadog-agent/pkg/security/security_profile/activity_tree/metadata" @@ -69,7 +70,7 @@ type SecurityProfile struct { pathsReducer *activity_tree.PathsReducer // Instances is the list of workload instances to witch the profile should apply - Instances []*cgroupModel.CacheEntry + Instances []*tags.Workload // Metadata contains metadata for the current profile Metadata mtdt.Metadata diff --git a/pkg/security/security_profile/tests/activity_tree_test.go b/pkg/security/security_profile/tests/activity_tree_test.go index 5f9afbb1c9e9a..7f100d75c18d1 100644 --- a/pkg/security/security_profile/tests/activity_tree_test.go +++ b/pkg/security/security_profile/tests/activity_tree_test.go @@ -20,6 +20,7 @@ import ( "github.com/stretchr/testify/assert" cgroupModel "github.com/DataDog/datadog-agent/pkg/security/resolvers/cgroup/model" + "github.com/DataDog/datadog-agent/pkg/security/resolvers/tags" "github.com/DataDog/datadog-agent/pkg/security/secl/containerutils" "github.com/DataDog/datadog-agent/pkg/security/secl/model" activity_tree "github.com/DataDog/datadog-agent/pkg/security/security_profile/activity_tree" @@ -686,18 +687,20 @@ func TestActivityTree_CreateProcessNode(t *testing.T) { if tt == dumpTree { dump := dump.NewEmptyActivityDump(nil) - dump.Metadata.ContainerID = contID + dump.Metadata.ContainerID = containerutils.ContainerID(contID) at = dump.ActivityTree } else /* profileTree */ { profile := profile.NewSecurityProfile(cgroupModel.WorkloadSelector{Image: "image", Tag: "tag"}, []model.EventType{model.ExecEventType, model.DNSEventType}, nil) at = activity_tree.NewActivityTree(profile, nil, "profile") profile.ActivityTree = at - profile.Instances = append(profile.Instances, &cgroupModel.CacheEntry{ - ContainerContext: model.ContainerContext{ - ContainerID: containerutils.ContainerID(contID), + profile.Instances = append(profile.Instances, &tags.Workload{ + CacheEntry: &cgroupModel.CacheEntry{ + ContainerContext: model.ContainerContext{ + ContainerID: containerutils.ContainerID(contID), + }, + CGroupContext: model.CGroupContext{CGroupID: containerutils.CGroupID(contID)}, }, - CGroupContext: model.CGroupContext{CGroupID: containerutils.CGroupID(contID)}, - WorkloadSelector: cgroupModel.WorkloadSelector{Image: "image", Tag: "tag"}, + Selector: cgroupModel.WorkloadSelector{Image: "image", Tag: "tag"}, }) } } else { // retrieve last saved tree state diff --git a/pkg/security/serializers/serializers_base.go b/pkg/security/serializers/serializers_base.go index 32f84ace271f8..805e52f8c67cc 100644 --- a/pkg/security/serializers/serializers_base.go +++ b/pkg/security/serializers/serializers_base.go @@ -18,15 +18,6 @@ import ( "github.com/DataDog/datadog-agent/pkg/util/scrubber" ) -// CGroupContextSerializer serializes a cgroup context to JSON -// easyjson:json -type CGroupContextSerializer struct { - // CGroup ID - ID string `json:"id,omitempty"` - // CGroup manager - Manager string `json:"manager,omitempty"` -} - // ContainerContextSerializer serializes a container context to JSON // easyjson:json type ContainerContextSerializer struct { @@ -213,7 +204,6 @@ type BaseEventSerializer struct { *ExitEventSerializer `json:"exit,omitempty"` *ProcessContextSerializer `json:"process,omitempty"` *ContainerContextSerializer `json:"container,omitempty"` - *CGroupContextSerializer `json:"cgroup,omitempty"` } // TLSContextSerializer defines a tls context serializer diff --git a/pkg/security/serializers/serializers_base_linux_easyjson.go b/pkg/security/serializers/serializers_base_linux_easyjson.go index 743795c140527..8502c05b45842 100644 --- a/pkg/security/serializers/serializers_base_linux_easyjson.go +++ b/pkg/security/serializers/serializers_base_linux_easyjson.go @@ -1777,72 +1777,7 @@ func (v ContainerContextSerializer) MarshalEasyJSON(w *jwriter.Writer) { func (v *ContainerContextSerializer) UnmarshalEasyJSON(l *jlexer.Lexer) { easyjsonA1e47abeDecodeGithubComDataDogDatadogAgentPkgSecuritySerializers14(l, v) } -func easyjsonA1e47abeDecodeGithubComDataDogDatadogAgentPkgSecuritySerializers15(in *jlexer.Lexer, out *CGroupContextSerializer) { - isTopLevel := in.IsStart() - if in.IsNull() { - if isTopLevel { - in.Consumed() - } - in.Skip() - return - } - in.Delim('{') - for !in.IsDelim('}') { - key := in.UnsafeFieldName(false) - in.WantColon() - if in.IsNull() { - in.Skip() - in.WantComma() - continue - } - switch key { - case "id": - out.ID = string(in.String()) - case "manager": - out.Manager = string(in.String()) - default: - in.SkipRecursive() - } - in.WantComma() - } - in.Delim('}') - if isTopLevel { - in.Consumed() - } -} -func easyjsonA1e47abeEncodeGithubComDataDogDatadogAgentPkgSecuritySerializers15(out *jwriter.Writer, in CGroupContextSerializer) { - out.RawByte('{') - first := true - _ = first - if in.ID != "" { - const prefix string = ",\"id\":" - first = false - out.RawString(prefix[1:]) - out.String(string(in.ID)) - } - if in.Manager != "" { - const prefix string = ",\"manager\":" - if first { - first = false - out.RawString(prefix[1:]) - } else { - out.RawString(prefix) - } - out.String(string(in.Manager)) - } - out.RawByte('}') -} - -// MarshalEasyJSON supports easyjson.Marshaler interface -func (v CGroupContextSerializer) MarshalEasyJSON(w *jwriter.Writer) { - easyjsonA1e47abeEncodeGithubComDataDogDatadogAgentPkgSecuritySerializers15(w, v) -} - -// UnmarshalEasyJSON supports easyjson.Unmarshaler interface -func (v *CGroupContextSerializer) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjsonA1e47abeDecodeGithubComDataDogDatadogAgentPkgSecuritySerializers15(l, v) -} -func easyjsonA1e47abeDecodeGithubComDataDogDatadogAgentPkgSecuritySerializers16(in *jlexer.Lexer, out *BaseEventSerializer) { +func easyjsonA1e47abeDecodeGithubComDataDogDatadogAgentPkgSecuritySerializers15(in *jlexer.Lexer, out *BaseEventSerializer) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -1855,7 +1790,6 @@ func easyjsonA1e47abeDecodeGithubComDataDogDatadogAgentPkgSecuritySerializers16( out.ExitEventSerializer = new(ExitEventSerializer) out.ProcessContextSerializer = new(ProcessContextSerializer) out.ContainerContextSerializer = new(ContainerContextSerializer) - out.CGroupContextSerializer = new(CGroupContextSerializer) in.Delim('{') for !in.IsDelim('}') { key := in.UnsafeFieldName(false) @@ -1912,16 +1846,6 @@ func easyjsonA1e47abeDecodeGithubComDataDogDatadogAgentPkgSecuritySerializers16( } (*out.ContainerContextSerializer).UnmarshalEasyJSON(in) } - case "cgroup": - if in.IsNull() { - in.Skip() - out.CGroupContextSerializer = nil - } else { - if out.CGroupContextSerializer == nil { - out.CGroupContextSerializer = new(CGroupContextSerializer) - } - (*out.CGroupContextSerializer).UnmarshalEasyJSON(in) - } default: in.SkipRecursive() } @@ -1932,7 +1856,7 @@ func easyjsonA1e47abeDecodeGithubComDataDogDatadogAgentPkgSecuritySerializers16( in.Consumed() } } -func easyjsonA1e47abeEncodeGithubComDataDogDatadogAgentPkgSecuritySerializers16(out *jwriter.Writer, in BaseEventSerializer) { +func easyjsonA1e47abeEncodeGithubComDataDogDatadogAgentPkgSecuritySerializers15(out *jwriter.Writer, in BaseEventSerializer) { out.RawByte('{') first := true _ = first @@ -1992,29 +1916,19 @@ func easyjsonA1e47abeEncodeGithubComDataDogDatadogAgentPkgSecuritySerializers16( } (*in.ContainerContextSerializer).MarshalEasyJSON(out) } - if in.CGroupContextSerializer != nil { - const prefix string = ",\"cgroup\":" - if first { - first = false - out.RawString(prefix[1:]) - } else { - out.RawString(prefix) - } - (*in.CGroupContextSerializer).MarshalEasyJSON(out) - } out.RawByte('}') } // MarshalEasyJSON supports easyjson.Marshaler interface func (v BaseEventSerializer) MarshalEasyJSON(w *jwriter.Writer) { - easyjsonA1e47abeEncodeGithubComDataDogDatadogAgentPkgSecuritySerializers16(w, v) + easyjsonA1e47abeEncodeGithubComDataDogDatadogAgentPkgSecuritySerializers15(w, v) } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *BaseEventSerializer) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjsonA1e47abeDecodeGithubComDataDogDatadogAgentPkgSecuritySerializers16(l, v) + easyjsonA1e47abeDecodeGithubComDataDogDatadogAgentPkgSecuritySerializers15(l, v) } -func easyjsonA1e47abeDecodeGithubComDataDogDatadogAgentPkgSecuritySerializers17(in *jlexer.Lexer, out *AWSSecurityCredentialsSerializer) { +func easyjsonA1e47abeDecodeGithubComDataDogDatadogAgentPkgSecuritySerializers16(in *jlexer.Lexer, out *AWSSecurityCredentialsSerializer) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -2053,7 +1967,7 @@ func easyjsonA1e47abeDecodeGithubComDataDogDatadogAgentPkgSecuritySerializers17( in.Consumed() } } -func easyjsonA1e47abeEncodeGithubComDataDogDatadogAgentPkgSecuritySerializers17(out *jwriter.Writer, in AWSSecurityCredentialsSerializer) { +func easyjsonA1e47abeEncodeGithubComDataDogDatadogAgentPkgSecuritySerializers16(out *jwriter.Writer, in AWSSecurityCredentialsSerializer) { out.RawByte('{') first := true _ = first @@ -2087,14 +2001,14 @@ func easyjsonA1e47abeEncodeGithubComDataDogDatadogAgentPkgSecuritySerializers17( // MarshalEasyJSON supports easyjson.Marshaler interface func (v AWSSecurityCredentialsSerializer) MarshalEasyJSON(w *jwriter.Writer) { - easyjsonA1e47abeEncodeGithubComDataDogDatadogAgentPkgSecuritySerializers17(w, v) + easyjsonA1e47abeEncodeGithubComDataDogDatadogAgentPkgSecuritySerializers16(w, v) } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *AWSSecurityCredentialsSerializer) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjsonA1e47abeDecodeGithubComDataDogDatadogAgentPkgSecuritySerializers17(l, v) + easyjsonA1e47abeDecodeGithubComDataDogDatadogAgentPkgSecuritySerializers16(l, v) } -func easyjsonA1e47abeDecodeGithubComDataDogDatadogAgentPkgSecuritySerializers18(in *jlexer.Lexer, out *AWSIMDSEventSerializer) { +func easyjsonA1e47abeDecodeGithubComDataDogDatadogAgentPkgSecuritySerializers17(in *jlexer.Lexer, out *AWSIMDSEventSerializer) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -2135,7 +2049,7 @@ func easyjsonA1e47abeDecodeGithubComDataDogDatadogAgentPkgSecuritySerializers18( in.Consumed() } } -func easyjsonA1e47abeEncodeGithubComDataDogDatadogAgentPkgSecuritySerializers18(out *jwriter.Writer, in AWSIMDSEventSerializer) { +func easyjsonA1e47abeEncodeGithubComDataDogDatadogAgentPkgSecuritySerializers17(out *jwriter.Writer, in AWSIMDSEventSerializer) { out.RawByte('{') first := true _ = first @@ -2154,10 +2068,10 @@ func easyjsonA1e47abeEncodeGithubComDataDogDatadogAgentPkgSecuritySerializers18( // MarshalEasyJSON supports easyjson.Marshaler interface func (v AWSIMDSEventSerializer) MarshalEasyJSON(w *jwriter.Writer) { - easyjsonA1e47abeEncodeGithubComDataDogDatadogAgentPkgSecuritySerializers18(w, v) + easyjsonA1e47abeEncodeGithubComDataDogDatadogAgentPkgSecuritySerializers17(w, v) } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *AWSIMDSEventSerializer) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjsonA1e47abeDecodeGithubComDataDogDatadogAgentPkgSecuritySerializers18(l, v) + easyjsonA1e47abeDecodeGithubComDataDogDatadogAgentPkgSecuritySerializers17(l, v) } diff --git a/pkg/security/serializers/serializers_linux.go b/pkg/security/serializers/serializers_linux.go index 69b1cf0bd225a..4f38767025b47 100644 --- a/pkg/security/serializers/serializers_linux.go +++ b/pkg/security/serializers/serializers_linux.go @@ -81,6 +81,15 @@ type FileSerializer struct { MountOrigin string `json:"mount_origin,omitempty"` } +// CGroupContextSerializer serializes a cgroup context to JSON +// easyjson:json +type CGroupContextSerializer struct { + // CGroup ID + ID string `json:"id,omitempty"` + // CGroup manager + Manager string `json:"manager,omitempty"` +} + // UserContextSerializer serializes a user context to JSON // easyjson:json type UserContextSerializer struct { @@ -622,6 +631,7 @@ type EventSerializer struct { *NetworkContextSerializer `json:"network,omitempty"` *DDContextSerializer `json:"dd,omitempty"` *SecurityProfileContextSerializer `json:"security_profile,omitempty"` + *CGroupContextSerializer `json:"cgroup,omitempty"` *SELinuxEventSerializer `json:"selinux,omitempty"` *BPFEventSerializer `json:"bpf,omitempty"` diff --git a/pkg/security/serializers/serializers_linux_easyjson.go b/pkg/security/serializers/serializers_linux_easyjson.go index ec264f2cb6de4..e61dfb697a062 100644 --- a/pkg/security/serializers/serializers_linux_easyjson.go +++ b/pkg/security/serializers/serializers_linux_easyjson.go @@ -3595,6 +3595,7 @@ func easyjsonDdc0fdbeDecodeGithubComDataDogDatadogAgentPkgSecuritySerializers24( out.NetworkContextSerializer = new(NetworkContextSerializer) out.DDContextSerializer = new(DDContextSerializer) out.SecurityProfileContextSerializer = new(SecurityProfileContextSerializer) + out.CGroupContextSerializer = new(CGroupContextSerializer) out.SELinuxEventSerializer = new(SELinuxEventSerializer) out.BPFEventSerializer = new(BPFEventSerializer) out.MMapEventSerializer = new(MMapEventSerializer) @@ -3652,6 +3653,16 @@ func easyjsonDdc0fdbeDecodeGithubComDataDogDatadogAgentPkgSecuritySerializers24( } (*out.SecurityProfileContextSerializer).UnmarshalEasyJSON(in) } + case "cgroup": + if in.IsNull() { + in.Skip() + out.CGroupContextSerializer = nil + } else { + if out.CGroupContextSerializer == nil { + out.CGroupContextSerializer = new(CGroupContextSerializer) + } + (*out.CGroupContextSerializer).UnmarshalEasyJSON(in) + } case "selinux": if in.IsNull() { in.Skip() @@ -3889,16 +3900,6 @@ func easyjsonDdc0fdbeDecodeGithubComDataDogDatadogAgentPkgSecuritySerializers24( } (*out.ContainerContextSerializer).UnmarshalEasyJSON(in) } - case "cgroup": - if in.IsNull() { - in.Skip() - out.CGroupContextSerializer = nil - } else { - if out.CGroupContextSerializer == nil { - out.CGroupContextSerializer = new(CGroupContextSerializer) - } - (*out.CGroupContextSerializer).UnmarshalEasyJSON(in) - } default: in.SkipRecursive() } @@ -3939,6 +3940,16 @@ func easyjsonDdc0fdbeEncodeGithubComDataDogDatadogAgentPkgSecuritySerializers24( } (*in.SecurityProfileContextSerializer).MarshalEasyJSON(out) } + if in.CGroupContextSerializer != nil { + const prefix string = ",\"cgroup\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + (*in.CGroupContextSerializer).MarshalEasyJSON(out) + } if in.SELinuxEventSerializer != nil { const prefix string = ",\"selinux\":" if first { @@ -4180,16 +4191,6 @@ func easyjsonDdc0fdbeEncodeGithubComDataDogDatadogAgentPkgSecuritySerializers24( } (*in.ContainerContextSerializer).MarshalEasyJSON(out) } - if in.CGroupContextSerializer != nil { - const prefix string = ",\"cgroup\":" - if first { - first = false - out.RawString(prefix[1:]) - } else { - out.RawString(prefix) - } - (*in.CGroupContextSerializer).MarshalEasyJSON(out) - } out.RawByte('}') } @@ -4663,7 +4664,72 @@ func (v CapsetSerializer) MarshalEasyJSON(w *jwriter.Writer) { func (v *CapsetSerializer) UnmarshalEasyJSON(l *jlexer.Lexer) { easyjsonDdc0fdbeDecodeGithubComDataDogDatadogAgentPkgSecuritySerializers28(l, v) } -func easyjsonDdc0fdbeDecodeGithubComDataDogDatadogAgentPkgSecuritySerializers29(in *jlexer.Lexer, out *BindEventSerializer) { +func easyjsonDdc0fdbeDecodeGithubComDataDogDatadogAgentPkgSecuritySerializers29(in *jlexer.Lexer, out *CGroupContextSerializer) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeFieldName(false) + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + case "id": + out.ID = string(in.String()) + case "manager": + out.Manager = string(in.String()) + default: + in.SkipRecursive() + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} +func easyjsonDdc0fdbeEncodeGithubComDataDogDatadogAgentPkgSecuritySerializers29(out *jwriter.Writer, in CGroupContextSerializer) { + out.RawByte('{') + first := true + _ = first + if in.ID != "" { + const prefix string = ",\"id\":" + first = false + out.RawString(prefix[1:]) + out.String(string(in.ID)) + } + if in.Manager != "" { + const prefix string = ",\"manager\":" + if first { + first = false + out.RawString(prefix[1:]) + } else { + out.RawString(prefix) + } + out.String(string(in.Manager)) + } + out.RawByte('}') +} + +// MarshalEasyJSON supports easyjson.Marshaler interface +func (v CGroupContextSerializer) MarshalEasyJSON(w *jwriter.Writer) { + easyjsonDdc0fdbeEncodeGithubComDataDogDatadogAgentPkgSecuritySerializers29(w, v) +} + +// UnmarshalEasyJSON supports easyjson.Unmarshaler interface +func (v *CGroupContextSerializer) UnmarshalEasyJSON(l *jlexer.Lexer) { + easyjsonDdc0fdbeDecodeGithubComDataDogDatadogAgentPkgSecuritySerializers29(l, v) +} +func easyjsonDdc0fdbeDecodeGithubComDataDogDatadogAgentPkgSecuritySerializers30(in *jlexer.Lexer, out *BindEventSerializer) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -4696,7 +4762,7 @@ func easyjsonDdc0fdbeDecodeGithubComDataDogDatadogAgentPkgSecuritySerializers29( in.Consumed() } } -func easyjsonDdc0fdbeEncodeGithubComDataDogDatadogAgentPkgSecuritySerializers29(out *jwriter.Writer, in BindEventSerializer) { +func easyjsonDdc0fdbeEncodeGithubComDataDogDatadogAgentPkgSecuritySerializers30(out *jwriter.Writer, in BindEventSerializer) { out.RawByte('{') first := true _ = first @@ -4715,14 +4781,14 @@ func easyjsonDdc0fdbeEncodeGithubComDataDogDatadogAgentPkgSecuritySerializers29( // MarshalEasyJSON supports easyjson.Marshaler interface func (v BindEventSerializer) MarshalEasyJSON(w *jwriter.Writer) { - easyjsonDdc0fdbeEncodeGithubComDataDogDatadogAgentPkgSecuritySerializers29(w, v) + easyjsonDdc0fdbeEncodeGithubComDataDogDatadogAgentPkgSecuritySerializers30(w, v) } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *BindEventSerializer) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjsonDdc0fdbeDecodeGithubComDataDogDatadogAgentPkgSecuritySerializers29(l, v) + easyjsonDdc0fdbeDecodeGithubComDataDogDatadogAgentPkgSecuritySerializers30(l, v) } -func easyjsonDdc0fdbeDecodeGithubComDataDogDatadogAgentPkgSecuritySerializers30(in *jlexer.Lexer, out *BPFProgramSerializer) { +func easyjsonDdc0fdbeDecodeGithubComDataDogDatadogAgentPkgSecuritySerializers31(in *jlexer.Lexer, out *BPFProgramSerializer) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -4782,7 +4848,7 @@ func easyjsonDdc0fdbeDecodeGithubComDataDogDatadogAgentPkgSecuritySerializers30( in.Consumed() } } -func easyjsonDdc0fdbeEncodeGithubComDataDogDatadogAgentPkgSecuritySerializers30(out *jwriter.Writer, in BPFProgramSerializer) { +func easyjsonDdc0fdbeEncodeGithubComDataDogDatadogAgentPkgSecuritySerializers31(out *jwriter.Writer, in BPFProgramSerializer) { out.RawByte('{') first := true _ = first @@ -4846,14 +4912,14 @@ func easyjsonDdc0fdbeEncodeGithubComDataDogDatadogAgentPkgSecuritySerializers30( // MarshalEasyJSON supports easyjson.Marshaler interface func (v BPFProgramSerializer) MarshalEasyJSON(w *jwriter.Writer) { - easyjsonDdc0fdbeEncodeGithubComDataDogDatadogAgentPkgSecuritySerializers30(w, v) + easyjsonDdc0fdbeEncodeGithubComDataDogDatadogAgentPkgSecuritySerializers31(w, v) } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *BPFProgramSerializer) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjsonDdc0fdbeDecodeGithubComDataDogDatadogAgentPkgSecuritySerializers30(l, v) + easyjsonDdc0fdbeDecodeGithubComDataDogDatadogAgentPkgSecuritySerializers31(l, v) } -func easyjsonDdc0fdbeDecodeGithubComDataDogDatadogAgentPkgSecuritySerializers31(in *jlexer.Lexer, out *BPFMapSerializer) { +func easyjsonDdc0fdbeDecodeGithubComDataDogDatadogAgentPkgSecuritySerializers32(in *jlexer.Lexer, out *BPFMapSerializer) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -4886,7 +4952,7 @@ func easyjsonDdc0fdbeDecodeGithubComDataDogDatadogAgentPkgSecuritySerializers31( in.Consumed() } } -func easyjsonDdc0fdbeEncodeGithubComDataDogDatadogAgentPkgSecuritySerializers31(out *jwriter.Writer, in BPFMapSerializer) { +func easyjsonDdc0fdbeEncodeGithubComDataDogDatadogAgentPkgSecuritySerializers32(out *jwriter.Writer, in BPFMapSerializer) { out.RawByte('{') first := true _ = first @@ -4911,14 +4977,14 @@ func easyjsonDdc0fdbeEncodeGithubComDataDogDatadogAgentPkgSecuritySerializers31( // MarshalEasyJSON supports easyjson.Marshaler interface func (v BPFMapSerializer) MarshalEasyJSON(w *jwriter.Writer) { - easyjsonDdc0fdbeEncodeGithubComDataDogDatadogAgentPkgSecuritySerializers31(w, v) + easyjsonDdc0fdbeEncodeGithubComDataDogDatadogAgentPkgSecuritySerializers32(w, v) } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *BPFMapSerializer) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjsonDdc0fdbeDecodeGithubComDataDogDatadogAgentPkgSecuritySerializers31(l, v) + easyjsonDdc0fdbeDecodeGithubComDataDogDatadogAgentPkgSecuritySerializers32(l, v) } -func easyjsonDdc0fdbeDecodeGithubComDataDogDatadogAgentPkgSecuritySerializers32(in *jlexer.Lexer, out *BPFEventSerializer) { +func easyjsonDdc0fdbeDecodeGithubComDataDogDatadogAgentPkgSecuritySerializers33(in *jlexer.Lexer, out *BPFEventSerializer) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -4969,7 +5035,7 @@ func easyjsonDdc0fdbeDecodeGithubComDataDogDatadogAgentPkgSecuritySerializers32( in.Consumed() } } -func easyjsonDdc0fdbeEncodeGithubComDataDogDatadogAgentPkgSecuritySerializers32(out *jwriter.Writer, in BPFEventSerializer) { +func easyjsonDdc0fdbeEncodeGithubComDataDogDatadogAgentPkgSecuritySerializers33(out *jwriter.Writer, in BPFEventSerializer) { out.RawByte('{') first := true _ = first @@ -4993,14 +5059,14 @@ func easyjsonDdc0fdbeEncodeGithubComDataDogDatadogAgentPkgSecuritySerializers32( // MarshalEasyJSON supports easyjson.Marshaler interface func (v BPFEventSerializer) MarshalEasyJSON(w *jwriter.Writer) { - easyjsonDdc0fdbeEncodeGithubComDataDogDatadogAgentPkgSecuritySerializers32(w, v) + easyjsonDdc0fdbeEncodeGithubComDataDogDatadogAgentPkgSecuritySerializers33(w, v) } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *BPFEventSerializer) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjsonDdc0fdbeDecodeGithubComDataDogDatadogAgentPkgSecuritySerializers32(l, v) + easyjsonDdc0fdbeDecodeGithubComDataDogDatadogAgentPkgSecuritySerializers33(l, v) } -func easyjsonDdc0fdbeDecodeGithubComDataDogDatadogAgentPkgSecuritySerializers33(in *jlexer.Lexer, out *AnomalyDetectionSyscallEventSerializer) { +func easyjsonDdc0fdbeDecodeGithubComDataDogDatadogAgentPkgSecuritySerializers34(in *jlexer.Lexer, out *AnomalyDetectionSyscallEventSerializer) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -5031,7 +5097,7 @@ func easyjsonDdc0fdbeDecodeGithubComDataDogDatadogAgentPkgSecuritySerializers33( in.Consumed() } } -func easyjsonDdc0fdbeEncodeGithubComDataDogDatadogAgentPkgSecuritySerializers33(out *jwriter.Writer, in AnomalyDetectionSyscallEventSerializer) { +func easyjsonDdc0fdbeEncodeGithubComDataDogDatadogAgentPkgSecuritySerializers34(out *jwriter.Writer, in AnomalyDetectionSyscallEventSerializer) { out.RawByte('{') first := true _ = first @@ -5045,10 +5111,10 @@ func easyjsonDdc0fdbeEncodeGithubComDataDogDatadogAgentPkgSecuritySerializers33( // MarshalEasyJSON supports easyjson.Marshaler interface func (v AnomalyDetectionSyscallEventSerializer) MarshalEasyJSON(w *jwriter.Writer) { - easyjsonDdc0fdbeEncodeGithubComDataDogDatadogAgentPkgSecuritySerializers33(w, v) + easyjsonDdc0fdbeEncodeGithubComDataDogDatadogAgentPkgSecuritySerializers34(w, v) } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *AnomalyDetectionSyscallEventSerializer) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjsonDdc0fdbeDecodeGithubComDataDogDatadogAgentPkgSecuritySerializers33(l, v) + easyjsonDdc0fdbeDecodeGithubComDataDogDatadogAgentPkgSecuritySerializers34(l, v) } diff --git a/pkg/security/tests/activity_dumps_test.go b/pkg/security/tests/activity_dumps_test.go index 0046251a969bd..07189c9a8d2ba 100644 --- a/pkg/security/tests/activity_dumps_test.go +++ b/pkg/security/tests/activity_dumps_test.go @@ -93,7 +93,7 @@ func TestActivityDumps(t *testing.T) { } time.Sleep(1 * time.Second) // a quick sleep to let events to be added to the dump - err = test.StopActivityDump(dump.Name, "") + err = test.StopActivityDump(dump.Name) if err != nil { t.Fatal(err) } @@ -134,7 +134,7 @@ func TestActivityDumps(t *testing.T) { } time.Sleep(1 * time.Second) // a quick sleep to let events to be added to the dump - err = test.StopActivityDump(dump.Name, "") + err = test.StopActivityDump(dump.Name) if err != nil { t.Fatal(err) } @@ -211,7 +211,7 @@ func TestActivityDumps(t *testing.T) { } time.Sleep(1 * time.Second) // a quick sleep to let events to be added to the dump - err = test.StopActivityDump(dump.Name, "") + err = test.StopActivityDump(dump.Name) if err != nil { t.Fatal(err) } @@ -256,7 +256,7 @@ func TestActivityDumps(t *testing.T) { } time.Sleep(1 * time.Second) // a quick sleep to let events to be added to the dump - err = test.StopActivityDump(dump.Name, "") + err = test.StopActivityDump(dump.Name) if err != nil { t.Fatal(err) } @@ -295,7 +295,7 @@ func TestActivityDumps(t *testing.T) { } time.Sleep(1 * time.Second) // a quick sleep to let events to be added to the dump - err = test.StopActivityDump(dump.Name, "") + err = test.StopActivityDump(dump.Name) if err != nil { t.Fatal(err) } @@ -338,7 +338,7 @@ func TestActivityDumps(t *testing.T) { } time.Sleep(1 * time.Second) // a quick sleep to let events to be added to the dump - err = test.StopActivityDump(dump.Name, "") + err = test.StopActivityDump(dump.Name) if err != nil { t.Fatal(err) } @@ -394,7 +394,7 @@ func TestActivityDumps(t *testing.T) { } time.Sleep(1 * time.Second) // a quick sleep to let events to be added to the dump - err = test.StopActivityDump(dump.Name, "") + err = test.StopActivityDump(dump.Name) if err != nil { t.Fatal(err) } diff --git a/pkg/security/tests/cmdwrapper.go b/pkg/security/tests/cmdwrapper.go index 1d25a6b4a7664..ca91fb42dd9ec 100644 --- a/pkg/security/tests/cmdwrapper.go +++ b/pkg/security/tests/cmdwrapper.go @@ -11,6 +11,7 @@ package tests import ( "fmt" "os/exec" + "strconv" "strings" "testing" @@ -78,8 +79,10 @@ type dockerCmdWrapper struct { executable string mountSrc string mountDest string + pid int64 containerName string containerID string + cgroupID string image string } @@ -101,9 +104,24 @@ func (d *dockerCmdWrapper) start() ([]byte, error) { d.containerName = fmt.Sprintf("docker-wrapper-%s", utils.RandString(6)) cmd := exec.Command(d.executable, "run", "--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined", "--rm", "--cap-add", "NET_ADMIN", "-d", "--name", d.containerName, "-v", d.mountSrc+":"+d.mountDest, d.image, "sleep", "1200") out, err := cmd.CombinedOutput() - if err == nil { - d.containerID = strings.TrimSpace(string(out)) + if err != nil { + return nil, err + } + + d.containerID = strings.TrimSpace(string(out)) + + cmd = exec.Command(d.executable, "inspect", "--format", "{{ .State.Pid }}", d.containerID) + out, err = cmd.CombinedOutput() + if err != nil { + return nil, err + } + + d.pid, _ = strconv.ParseInt(strings.TrimSpace(string(out)), 10, 64) + + if d.cgroupID, err = getPIDCGroup(uint32(d.pid)); err != nil { + return nil, err } + return out, err } diff --git a/pkg/security/tests/connect_test.go b/pkg/security/tests/connect_test.go index 1e64fe57e1989..7f56dcfb8956c 100644 --- a/pkg/security/tests/connect_test.go +++ b/pkg/security/tests/connect_test.go @@ -12,7 +12,6 @@ import ( "context" "fmt" "net" - "sync" "testing" "golang.org/x/net/nettest" @@ -50,22 +49,20 @@ func TestConnectEvent(t *testing.T) { } t.Run("connect-af-inet-any-tcp-success", func(t *testing.T) { - var wg sync.WaitGroup - wg.Add(1) - defer wg.Wait() - - done := make(chan struct{}) - defer close(done) - go func() { - defer wg.Done() - err := bindAndAcceptConnection("tcp", ":4242", done) - if err != nil { - t.Error(err) - } - }() + done := make(chan error) + started := make(chan struct{}) + go bindAndAcceptConnection("tcp", ":4242", done, started) + + // Wait until the server is listening before attempting to connect + <-started test.WaitSignal(t, func() error { - return runSyscallTesterFunc(context.Background(), t, syscallTester, "connect", "AF_INET", "any", "tcp") + if err := runSyscallTesterFunc(context.Background(), t, syscallTester, "connect", "AF_INET", "any", "tcp"); err != nil { + return err + } + err := <-done + close(done) + return err }, func(event *model.Event, _ *rules.Rule) { assert.Equal(t, "connect", event.GetType(), "wrong event type") assert.Equal(t, uint16(unix.AF_INET), event.Connect.AddrFamily, "wrong address family") @@ -78,22 +75,19 @@ func TestConnectEvent(t *testing.T) { }) t.Run("connect-af-inet-any-udp-success", func(t *testing.T) { - var wg sync.WaitGroup - wg.Add(1) - defer wg.Wait() - - done := make(chan struct{}) - defer close(done) - go func() { - defer wg.Done() - err := bindAndAcceptConnection("udp", ":4242", done) - if err != nil { - t.Error(err) - } - }() + done := make(chan error) + started := make(chan struct{}) + go bindAndAcceptConnection("udp", ":4242", done, started) + + <-started test.WaitSignal(t, func() error { - return runSyscallTesterFunc(context.Background(), t, syscallTester, "connect", "AF_INET", "any", "udp") + if err := runSyscallTesterFunc(context.Background(), t, syscallTester, "connect", "AF_INET", "any", "udp"); err != nil { + return err + } + err := <-done + close(done) + return err }, func(event *model.Event, _ *rules.Rule) { assert.Equal(t, "connect", event.GetType(), "wrong event type") assert.Equal(t, uint16(unix.AF_INET), event.Connect.AddrFamily, "wrong address family") @@ -110,22 +104,19 @@ func TestConnectEvent(t *testing.T) { t.Skip("IPv6 is not supported") } - var wg sync.WaitGroup - wg.Add(1) - defer wg.Wait() - - done := make(chan struct{}) - defer close(done) - go func() { - defer wg.Done() - err := bindAndAcceptConnection("tcp", ":4242", done) - if err != nil { - t.Error(err) - } - }() + done := make(chan error) + started := make(chan struct{}) + go bindAndAcceptConnection("tcp", ":4242", done, started) + + <-started test.WaitSignal(t, func() error { - return runSyscallTesterFunc(context.Background(), t, syscallTester, "connect", "AF_INET6", "any", "tcp") + if err := runSyscallTesterFunc(context.Background(), t, syscallTester, "connect", "AF_INET6", "any", "tcp"); err != nil { + return err + } + err := <-done + close(done) + return err }, func(event *model.Event, _ *rules.Rule) { assert.Equal(t, "connect", event.GetType(), "wrong event type") assert.Equal(t, uint16(unix.AF_INET6), event.Connect.AddrFamily, "wrong address family") @@ -142,22 +133,19 @@ func TestConnectEvent(t *testing.T) { t.Skip("IPv6 is not supported") } - var wg sync.WaitGroup - wg.Add(1) - defer wg.Wait() - - done := make(chan struct{}) - defer close(done) - go func() { - defer wg.Done() - err := bindAndAcceptConnection("udp", ":4242", done) - if err != nil { - t.Error(err) - } - }() + done := make(chan error) + started := make(chan struct{}) + go bindAndAcceptConnection("udp", ":4242", done, started) + + <-started test.WaitSignal(t, func() error { - return runSyscallTesterFunc(context.Background(), t, syscallTester, "connect", "AF_INET6", "any", "udp") + if err := runSyscallTesterFunc(context.Background(), t, syscallTester, "connect", "AF_INET6", "any", "udp"); err != nil { + return err + } + err := <-done + close(done) + return err }, func(event *model.Event, _ *rules.Rule) { assert.Equal(t, "connect", event.GetType(), "wrong event type") assert.Equal(t, uint16(unix.AF_INET6), event.Connect.AddrFamily, "wrong address family") @@ -168,43 +156,47 @@ func TestConnectEvent(t *testing.T) { test.validateConnectSchema(t, event) }) }) - } -func bindAndAcceptConnection(proto, address string, done chan struct{}) error { +func bindAndAcceptConnection(proto, address string, done chan error, started chan struct{}) { switch proto { case "tcp": listener, err := net.Listen(proto, address) if err != nil { - return fmt.Errorf("failed to bind to %s:%s: %w", proto, address, err) + done <- fmt.Errorf("failed to bind to %s:%s: %w", proto, address, err) + return } defer listener.Close() - // Start a goroutine to accept connections continuously - go func() { - for { - c, err := listener.Accept() - if err != nil { - fmt.Printf("accept error: %v\n", err) - return - } - fmt.Println("Connection accepted") - defer c.Close() - } - }() + // Signal that the server is ready to accept connections + close(started) + + c, err := listener.Accept() + if err != nil { + fmt.Printf("accept error: %v\n", err) + done <- err + return + } + defer c.Close() + + fmt.Println("Connection accepted") case "udp", "unixgram": conn, err := net.ListenPacket(proto, address) if err != nil { - return fmt.Errorf("failed to bind to %s:%s: %w", proto, address, err) + done <- err + return } defer conn.Close() + // For packet-based connections, we can signal readiness immediately + close(started) + default: - return fmt.Errorf("unsupported protocol: %s", proto) + done <- fmt.Errorf("unsupported protocol: %s", proto) + return } // Wait for the test to complete before returning - <-done - return nil + done <- nil } diff --git a/pkg/security/tests/constants_test.go b/pkg/security/tests/constants_test.go index f7a156aac2954..8982f6a1ff686 100644 --- a/pkg/security/tests/constants_test.go +++ b/pkg/security/tests/constants_test.go @@ -19,20 +19,6 @@ import ( "github.com/DataDog/datadog-agent/pkg/security/probe/constantfetch" ) -var BTFHubVsRcPossiblyMissingConstants = []string{ - constantfetch.OffsetNameNFConnStructCTNet, - constantfetch.OffsetNameIoKiocbStructCtx, - constantfetch.OffsetNameMountMntID, -} - -var RCVsFallbackPossiblyMissingConstants = []string{ - constantfetch.OffsetNameIoKiocbStructCtx, - constantfetch.OffsetNameTaskStructPID, - constantfetch.OffsetNameTaskStructPIDLink, - constantfetch.OffsetNameDeviceStructNdNet, - constantfetch.OffsetNameMountMntID, -} - var BTFHubVsFallbackPossiblyMissingConstants = []string{ constantfetch.OffsetNameNFConnStructCTNet, constantfetch.OffsetNameTaskStructPID, @@ -69,40 +55,6 @@ func TestOctogonConstants(t *testing.T) { t.Fatal(err) } - _, secconfig, err := genTestConfigs(dir, testOpts{}) - if err != nil { - t.Fatal(err) - } - - t.Run("rc-vs-fallback", func(t *testing.T) { - checkKernelCompatibility(t, "SLES kernels", func(kv *kernel.Version) bool { - return kv.IsSLESKernel() || (kv.IsAmazonLinux2023Kernel() && (testEnvironment == DockerEnvironment)) - }) - - fallbackFetcher := constantfetch.NewFallbackConstantFetcher(kv) - rcFetcher := constantfetch.NewRuntimeCompilationConstantFetcher(&secconfig.Probe.Config, nil) - - assertConstantsEqual(t, rcFetcher, fallbackFetcher, kv, RCVsFallbackPossiblyMissingConstants) - }) - - t.Run("btfhub-vs-rc", func(t *testing.T) { - checkKernelCompatibility(t, "SLES kernels", func(kv *kernel.Version) bool { - return kv.IsSLESKernel() || (kv.IsAmazonLinux2023Kernel() && (testEnvironment == DockerEnvironment)) - }) - - btfhubFetcher, err := constantfetch.NewBTFHubConstantFetcher(kv) - if err != nil { - t.Skipf("btfhub constant fetcher is not available: %v", err) - } - if !btfhubFetcher.HasConstantsInStore() { - t.Skip("btfhub has no constant for this OS") - } - - rcFetcher := constantfetch.NewRuntimeCompilationConstantFetcher(&secconfig.Probe.Config, nil) - - assertConstantsEqual(t, rcFetcher, btfhubFetcher, kv, BTFHubVsRcPossiblyMissingConstants) - }) - t.Run("btfhub-vs-fallback", func(t *testing.T) { btfhubFetcher, err := constantfetch.NewBTFHubConstantFetcher(kv) if err != nil { @@ -116,17 +68,6 @@ func TestOctogonConstants(t *testing.T) { assertConstantsEqual(t, btfhubFetcher, fallbackFetcher, kv, BTFHubVsFallbackPossiblyMissingConstants) }) - - t.Run("guesser-vs-rc", func(t *testing.T) { - checkKernelCompatibility(t, "SLES kernels", func(kv *kernel.Version) bool { - return kv.IsSLESKernel() || (kv.IsAmazonLinux2023Kernel() && (testEnvironment == DockerEnvironment)) - }) - - rcFetcher := constantfetch.NewRuntimeCompilationConstantFetcher(&secconfig.Probe.Config, nil) - ogFetcher := constantfetch.NewOffsetGuesserFetcher(secconfig.Probe, kv) - - assertConstantContains(t, rcFetcher, ogFetcher, kv, nil) - }) } func getFighterConstants(champion, challenger constantfetch.ConstantFetcher, kv *kernel.Version) (map[string]uint64, map[string]uint64, error) { @@ -177,42 +118,6 @@ func assertConstantsEqual(t *testing.T, champion, challenger constantfetch.Const } } -func assertConstantContains(t *testing.T, champion, challenger constantfetch.ConstantFetcher, kv *kernel.Version, ignoreMissing []string) { - t.Helper() - championConstants, challengerConstants, err := getFighterConstants(champion, challenger, kv) - if err != nil { - t.Error(err) - } - - if len(challengerConstants) == 0 { - t.Errorf("challenger %s has no constant\n", challenger) - } - - // In the case where challenger is missing a constant, we set it to the error sentinel - for _, k := range ignoreMissing { - if _, championPresent := championConstants[k]; !championPresent { - championConstants[k] = constantfetch.ErrorSentinel - } - } - - for k, v := range challengerConstants { - if v == constantfetch.ErrorSentinel { - continue - } - - expected, ok := championConstants[k] - if !ok { - t.Errorf("champion (`%s`) does not contain the expected constant `%s`", champion.String(), k) - } else if v != expected && expected != constantfetch.ErrorSentinel { - t.Errorf("difference between fighters for `%s`: `%s`:%d and `%s`:%d", k, champion.String(), expected, challenger.String(), v) - } - } - - if t.Failed() { - t.Logf("kernel version: %v", kv) - } -} - func getOffsetConstantsFromFetcher(cf constantfetch.ConstantFetcher, kv *kernel.Version) (map[string]uint64, error) { probe.AppendProbeRequestsToFetcher(cf, kv) return cf.FinishAndGetResults() diff --git a/pkg/security/tests/container_test.go b/pkg/security/tests/container_test.go index 7a659481da74b..15d896f1718ef 100644 --- a/pkg/security/tests/container_test.go +++ b/pkg/security/tests/container_test.go @@ -182,3 +182,73 @@ func TestContainerFlagsPodman(t *testing.T) { }) }) } + +func TestContainerVariables(t *testing.T) { + SkipIfNotAvailable(t) + + ruleDefs := []*rules.RuleDefinition{ + { + ID: "test_container_set_variable", + Expression: `container.id != "" && open.file.path == "{{.Root}}/test-open"`, + Actions: []*rules.ActionDefinition{ + { + Set: &rules.SetDefinition{ + Scope: "container", + Value: 1, + Name: "foo", + }, + }, + }, + }, + { + ID: "test_container_check_variable", + Expression: `container.id != "" && open.file.path == "{{.Root}}/test-open2" && ${container.foo} == 1`, + }, + } + test, err := newTestModule(t, nil, ruleDefs) + if err != nil { + t.Fatal(err) + } + defer test.Close() + + testFile, _, err := test.Path("test-open") + if err != nil { + t.Fatal(err) + } + + testFile2, _, err := test.Path("test-open2") + if err != nil { + t.Fatal(err) + } + + dockerWrapper, err := newDockerCmdWrapper(test.Root(), test.Root(), "ubuntu", "") + if err != nil { + t.Skip("Skipping created time in containers tests: Docker not available") + return + } + defer dockerWrapper.stop() + + dockerWrapper.Run(t, "container-variables", func(t *testing.T, _ wrapperType, cmdFunc func(cmd string, args []string, envs []string) *exec.Cmd) { + test.WaitSignal(t, func() error { + cmd := cmdFunc("touch", []string{testFile}, nil) + return cmd.Run() + }, func(event *model.Event, rule *rules.Rule) { + assertTriggeredRule(t, rule, "test_container_set_variable") + assertFieldEqual(t, event, "open.file.path", testFile) + assertFieldNotEmpty(t, event, "container.id", "container id shouldn't be empty") + + test.validateOpenSchema(t, event) + }) + + test.WaitSignal(t, func() error { + cmd := cmdFunc("touch", []string{testFile2}, nil) + return cmd.Run() + }, func(event *model.Event, rule *rules.Rule) { + assertTriggeredRule(t, rule, "test_container_check_variable") + assertFieldEqual(t, event, "open.file.path", testFile2) + assertFieldNotEmpty(t, event, "container.id", "container id shouldn't be empty") + + test.validateOpenSchema(t, event) + }) + }) +} diff --git a/pkg/security/tests/main_linux.go b/pkg/security/tests/main_linux.go index c64b83fbc917d..bea7537bf4f91 100644 --- a/pkg/security/tests/main_linux.go +++ b/pkg/security/tests/main_linux.go @@ -129,6 +129,20 @@ func SkipIfNotAvailable(t *testing.T) { } } +// getPIDCGroup returns the path of the first cgroup found for a PID +func getPIDCGroup(pid uint32) (string, error) { + cgroups, err := utils.GetProcControlGroups(pid, pid) + if err != nil { + return "", err + } + + if len(cgroups) == 0 { + return "", fmt.Errorf("failed to find cgroup for pid %d", pid) + } + + return cgroups[0].Path, nil +} + func preTestsHook() { if trace { args := slices.DeleteFunc(os.Args, func(arg string) bool { diff --git a/pkg/security/tests/main_test.go b/pkg/security/tests/main_test.go index 6ef5e6cdb8a80..36b434722dc9d 100644 --- a/pkg/security/tests/main_test.go +++ b/pkg/security/tests/main_test.go @@ -15,7 +15,7 @@ import ( "testing" "time" - "github.com/cihub/seelog" + "github.com/DataDog/datadog-agent/pkg/util/log" ) // TestMain is the entry points for functional tests @@ -43,7 +43,7 @@ var ( ) func init() { - flag.StringVar(&logLevelStr, "loglevel", seelog.WarnStr, "log level") + flag.StringVar(&logLevelStr, "loglevel", log.WarnStr, "log level") flag.Var(&logPatterns, "logpattern", "List of log pattern") flag.Var(&logTags, "logtag", "List of log tag") diff --git a/pkg/security/tests/main_windows.go b/pkg/security/tests/main_windows.go index 945126ae6c59c..4cc1f88754218 100644 --- a/pkg/security/tests/main_windows.go +++ b/pkg/security/tests/main_windows.go @@ -8,6 +8,13 @@ // Package tests holds tests related files package tests +import "errors" + +// getPIDCGroup returns the path of the first cgroup found for a PID +func getPIDCGroup(pid uint32) (string, error) { + return "", errors.New("cgroups are not supported on Windows") +} + func preTestsHook() {} func postTestsHook() {} diff --git a/pkg/security/tests/module_tester_linux.go b/pkg/security/tests/module_tester_linux.go index 268fc839f625e..37a54cf6fee5b 100644 --- a/pkg/security/tests/module_tester_linux.go +++ b/pkg/security/tests/module_tester_linux.go @@ -27,7 +27,6 @@ import ( "time" "github.com/avast/retry-go/v4" - "github.com/cihub/seelog" "github.com/davecgh/go-spew/spew" "github.com/hashicorp/go-multierror" "github.com/oliveagle/jsonpath" @@ -44,6 +43,7 @@ import ( cgroupModel "github.com/DataDog/datadog-agent/pkg/security/resolvers/cgroup/model" rulesmodule "github.com/DataDog/datadog-agent/pkg/security/rules" "github.com/DataDog/datadog-agent/pkg/security/rules/bundled" + "github.com/DataDog/datadog-agent/pkg/security/secl/containerutils" "github.com/DataDog/datadog-agent/pkg/security/secl/model" "github.com/DataDog/datadog-agent/pkg/security/secl/rules" activity_tree "github.com/DataDog/datadog-agent/pkg/security/security_profile/activity_tree" @@ -57,7 +57,7 @@ import ( ) var ( - logger seelog.LoggerInterface + logger log.LoggerInterface ) const ( @@ -999,7 +999,7 @@ func (tm *testModule) Close() { var logInitilialized bool func initLogger() error { - logLevel, found := seelog.LogLevelFromString(logLevelStr) + logLevel, found := log.LogLevelFromString(logLevelStr) if !found { return fmt.Errorf("invalid log level '%s'", logLevel) } @@ -1014,20 +1014,20 @@ func initLogger() error { return nil } -func swapLogLevel(logLevel seelog.LogLevel) (seelog.LogLevel, error) { +func swapLogLevel(logLevel log.LogLevel) (log.LogLevel, error) { if logger == nil { logFormat := "[%Date(2006-01-02 15:04:05.000)] [%LEVEL] %Func:%Line %Msg\n" var err error - logger, err = seelog.LoggerFromWriterWithMinLevelAndFormat(os.Stdout, logLevel, logFormat) + logger, err = log.LoggerFromWriterWithMinLevelAndFormat(os.Stdout, logLevel, logFormat) if err != nil { return 0, err } } log.SetupLogger(logger, logLevel.String()) - prevLevel, _ := seelog.LogLevelFromString(logLevelStr) + prevLevel, _ := log.LogLevelFromString(logLevelStr) logLevelStr = logLevel.String() return prevLevel, nil } @@ -1125,7 +1125,7 @@ func checkNetworkCompatibility(tb testing.TB) { }) } -func (tm *testModule) StopActivityDump(name, containerID string) error { +func (tm *testModule) StopActivityDump(name string) error { p, ok := tm.probe.PlatformProbe.(*sprobe.EBPFProbe) if !ok { return errors.New("not supported") @@ -1136,8 +1136,7 @@ func (tm *testModule) StopActivityDump(name, containerID string) error { return errors.New("no manager") } params := &api.ActivityDumpStopParams{ - Name: name, - ContainerID: containerID, + Name: name, } _, err := managers.StopActivityDump(params) if err != nil { @@ -1148,7 +1147,8 @@ func (tm *testModule) StopActivityDump(name, containerID string) error { type activityDumpIdentifier struct { Name string - ContainerID string + ContainerID containerutils.ContainerID + CGroupID containerutils.CGroupID Timeout string OutputFiles []string } @@ -1183,7 +1183,8 @@ func (tm *testModule) ListActivityDumps() ([]*activityDumpIdentifier, error) { dumps = append(dumps, &activityDumpIdentifier{ Name: dump.Metadata.Name, - ContainerID: dump.Metadata.ContainerID, + ContainerID: containerutils.ContainerID(dump.Metadata.ContainerID), + CGroupID: containerutils.CGroupID(dump.Metadata.CGroupID), Timeout: dump.Metadata.Timeout, OutputFiles: files, }) @@ -1253,6 +1254,7 @@ func (tm *testModule) StartADocker() (*dockerCmdWrapper, error) { } time.Sleep(1 * time.Second) // a quick sleep to ensure the dump has started + return docker, nil } @@ -1261,7 +1263,7 @@ func (tm *testModule) GetDumpFromDocker(dockerInstance *dockerCmdWrapper) (*acti if err != nil { return nil, err } - dump := findLearningContainerID(dumps, dockerInstance.containerID) + dump := findLearningContainerID(dumps, containerutils.ContainerID(dockerInstance.containerID)) if dump == nil { return nil, errors.New("ContainerID not found on activity dump list") } @@ -1282,7 +1284,7 @@ func (tm *testModule) StartADockerGetDump() (*dockerCmdWrapper, *activityDumpIde } //nolint:deadcode,unused -func findLearningContainerID(dumps []*activityDumpIdentifier, containerID string) *activityDumpIdentifier { +func findLearningContainerID(dumps []*activityDumpIdentifier, containerID containerutils.ContainerID) *activityDumpIdentifier { for _, dump := range dumps { if dump.ContainerID == containerID { return dump @@ -1539,7 +1541,7 @@ func (tm *testModule) StopAllActivityDumps() error { return nil } for _, dump := range dumps { - _ = tm.StopActivityDump(dump.Name, "") + _ = tm.StopActivityDump(dump.Name) } dumps, err = tm.ListActivityDumps() if err != nil { diff --git a/pkg/security/tests/sbom_test.go b/pkg/security/tests/sbom_test.go index 3a0588aba3861..c4309b029ba5c 100644 --- a/pkg/security/tests/sbom_test.go +++ b/pkg/security/tests/sbom_test.go @@ -10,7 +10,6 @@ package tests import ( "fmt" - "os" "os/exec" "testing" @@ -18,7 +17,6 @@ import ( "github.com/DataDog/datadog-agent/pkg/security/secl/containerutils" "github.com/DataDog/datadog-agent/pkg/security/secl/model" "github.com/DataDog/datadog-agent/pkg/security/secl/rules" - "github.com/DataDog/datadog-agent/pkg/util/flavor" "github.com/avast/retry-go/v4" ) @@ -30,13 +28,6 @@ func TestSBOM(t *testing.T) { t.Skip("Skip test spawning docker containers on docker") } - originalFlavor := flavor.GetFlavor() - flavor.SetFlavor(flavor.SecurityAgent) - defer func() { - flavor.SetFlavor(originalFlavor) - }() - os.Chdir("/") - ruleDefs := []*rules.RuleDefinition{ { ID: "test_file_package", diff --git a/pkg/security/tests/security_profile_test.go b/pkg/security/tests/security_profile_test.go index 1c814ea196f5c..01faf63d61ed5 100644 --- a/pkg/security/tests/security_profile_test.go +++ b/pkg/security/tests/security_profile_test.go @@ -87,7 +87,7 @@ func TestSecurityProfile(t *testing.T) { } time.Sleep(1 * time.Second) // a quick sleep to let events to be added to the dump - err = test.StopActivityDump(dump.Name, "") + err = test.StopActivityDump(dump.Name) if err != nil { t.Fatal(err) } @@ -97,7 +97,8 @@ func TestSecurityProfile(t *testing.T) { if sp.Metadata.Name != dump.Name { t.Errorf("Profile name %s != %s\n", sp.Metadata.Name, dump.Name) } - if sp.Metadata.ContainerID != dump.ContainerID { + if (sp.Metadata.ContainerID != dump.ContainerID) && + (sp.Metadata.CGroupContext.CGroupID != dump.CGroupID) { t.Errorf("Profile containerID %s != %s\n", sp.Metadata.ContainerID, dump.ContainerID) } @@ -105,7 +106,7 @@ func TestSecurityProfile(t *testing.T) { if ctx == nil { t.Errorf("No profile context found!") } else { - if !slices.Contains(ctx.Tags, "container_id:"+dump.ContainerID) { + if !slices.Contains(ctx.Tags, "container_id:"+string(dump.ContainerID)) { t.Errorf("Profile did not contains container_id tag: %v\n", ctx.Tags) } if !slices.Contains(ctx.Tags, "image_tag:latest") { @@ -140,7 +141,7 @@ func TestSecurityProfile(t *testing.T) { } time.Sleep(1 * time.Second) // a quick sleep to let events to be added to the dump - err = test.StopActivityDump(dump.Name, "") + err = test.StopActivityDump(dump.Name) if err != nil { t.Fatal(err) } @@ -179,7 +180,7 @@ func TestSecurityProfile(t *testing.T) { } time.Sleep(1 * time.Second) // a quick sleep to let events to be added to the dump - err = test.StopActivityDump(dump.Name, "") + err = test.StopActivityDump(dump.Name) if err != nil { t.Fatal(err) } @@ -267,7 +268,7 @@ func TestAnomalyDetection(t *testing.T) { } time.Sleep(1 * time.Second) // a quick sleep to let events to be added to the dump - err = test.StopActivityDump(dump.Name, "") + err = test.StopActivityDump(dump.Name) if err != nil { t.Fatal(err) } @@ -299,7 +300,7 @@ func TestAnomalyDetection(t *testing.T) { } time.Sleep(1 * time.Second) // a quick sleep to let events to be added to the dump - err = test.StopActivityDump(dump.Name, "") + err = test.StopActivityDump(dump.Name) if err != nil { t.Fatal(err) } @@ -332,7 +333,7 @@ func TestAnomalyDetection(t *testing.T) { } time.Sleep(1 * time.Second) // a quick sleep to let events to be added to the dump - err = test.StopActivityDump(dump.Name, "") + err = test.StopActivityDump(dump.Name) if err != nil { t.Fatal(err) } @@ -368,7 +369,7 @@ func TestAnomalyDetection(t *testing.T) { } time.Sleep(1 * time.Second) // a quick sleep to let events to be added to the dump - err = test.StopActivityDump(dump.Name, "") + err = test.StopActivityDump(dump.Name) if err != nil { t.Fatal(err) } @@ -443,7 +444,7 @@ func TestAnomalyDetectionWarmup(t *testing.T) { cmd.CombinedOutput() time.Sleep(1 * time.Second) // a quick sleep to let events to be added to the dump - err = test.StopActivityDump(dump.Name, "") + err = test.StopActivityDump(dump.Name) if err != nil { t.Fatal(err) } @@ -605,7 +606,7 @@ func TestSecurityProfileReinsertionPeriod(t *testing.T) { } time.Sleep(1 * time.Second) // a quick sleep to let events to be added to the dump - err = test.StopActivityDump(dump.Name, "") + err = test.StopActivityDump(dump.Name) if err != nil { t.Fatal(err) } @@ -639,7 +640,7 @@ func TestSecurityProfileReinsertionPeriod(t *testing.T) { } time.Sleep(1 * time.Second) // a quick sleep to let events to be added to the dump - err = test.StopActivityDump(dump.Name, "") + err = test.StopActivityDump(dump.Name) if err != nil { t.Fatal(err) } @@ -669,7 +670,7 @@ func TestSecurityProfileReinsertionPeriod(t *testing.T) { } time.Sleep(1 * time.Second) // a quick sleep to let events to be added to the dump - err = test.StopActivityDump(dump.Name, "") + err = test.StopActivityDump(dump.Name) if err != nil { t.Fatal(err) } @@ -706,7 +707,7 @@ func TestSecurityProfileReinsertionPeriod(t *testing.T) { } time.Sleep(1 * time.Second) // a quick sleep to let events to be added to the dump - err = test.StopActivityDump(dump.Name, "") + err = test.StopActivityDump(dump.Name) if err != nil { t.Fatal(err) } @@ -840,7 +841,7 @@ func TestSecurityProfileAutoSuppression(t *testing.T) { } }) - err = test.StopActivityDump(dump.Name, "") + err = test.StopActivityDump(dump.Name) if err != nil { t.Fatal(err) } @@ -981,7 +982,7 @@ func TestSecurityProfileDifferentiateArgs(t *testing.T) { } time.Sleep(1 * time.Second) // a quick sleep to let events to be added to the dump - err = test.StopActivityDump(dump.Name, "") + err = test.StopActivityDump(dump.Name) if err != nil { t.Fatal(err) } @@ -1078,7 +1079,7 @@ func TestSecurityProfileLifeCycleExecs(t *testing.T) { t.Fatal(err) } - dockerInstanceV1, err := test.StartADocker() + dockerInstanceV1, dump, err := test.StartADockerGetDump() if err != nil { t.Fatal(err) } @@ -1091,7 +1092,7 @@ func TestSecurityProfileLifeCycleExecs(t *testing.T) { } time.Sleep(1 * time.Second) // a quick sleep to let events to be added to the dump - err = test.StopActivityDump("", dockerInstanceV1.containerID) + err = test.StopActivityDump(dump.Name) if err != nil { t.Fatal(err) } @@ -1252,7 +1253,7 @@ func TestSecurityProfileLifeCycleDNS(t *testing.T) { t.Fatal(err) } - dockerInstanceV1, err := test.StartADocker() + dockerInstanceV1, dump, err := test.StartADockerGetDump() if err != nil { t.Fatal(err) } @@ -1265,7 +1266,7 @@ func TestSecurityProfileLifeCycleDNS(t *testing.T) { } time.Sleep(1 * time.Second) // a quick sleep to let events to be added to the dump - err = test.StopActivityDump("", dockerInstanceV1.containerID) + err = test.StopActivityDump(dump.Name) if err != nil { t.Fatal(err) } @@ -1425,7 +1426,7 @@ func TestSecurityProfileLifeCycleSyscall(t *testing.T) { t.Fatal(err) } - dockerInstanceV1, err := test.StartADocker() + dockerInstanceV1, dump, err := test.StartADockerGetDump() if err != nil { t.Fatal(err) } @@ -1438,7 +1439,7 @@ func TestSecurityProfileLifeCycleSyscall(t *testing.T) { } time.Sleep(1 * time.Second) // a quick sleep to let events be added to the dump - err = test.StopActivityDump("", dockerInstanceV1.containerID) + err = test.StopActivityDump(dump.Name) if err != nil { t.Fatal(err) } @@ -1614,7 +1615,7 @@ func TestSecurityProfileLifeCycleEvictionProcess(t *testing.T) { t.Fatal(err) } - dockerInstanceV1, err := test.StartADocker() + dockerInstanceV1, dump, err := test.StartADockerGetDump() if err != nil { t.Fatal(err) } @@ -1627,7 +1628,7 @@ func TestSecurityProfileLifeCycleEvictionProcess(t *testing.T) { } time.Sleep(1 * time.Second) // a quick sleep to let events to be added to the dump - err = test.StopActivityDump("", dockerInstanceV1.containerID) + err = test.StopActivityDump(dump.Name) if err != nil { t.Fatal(err) } @@ -1792,7 +1793,7 @@ func TestSecurityProfileLifeCycleEvictionDNS(t *testing.T) { t.Fatal(err) } - dockerInstanceV1, err := test.StartADocker() + dockerInstanceV1, dump, err := test.StartADockerGetDump() if err != nil { t.Fatal(err) } @@ -1805,7 +1806,7 @@ func TestSecurityProfileLifeCycleEvictionDNS(t *testing.T) { } time.Sleep(1 * time.Second) // a quick sleep to let events to be added to the dump - err = test.StopActivityDump("", dockerInstanceV1.containerID) + err = test.StopActivityDump(dump.Name) if err != nil { t.Fatal(err) } @@ -1970,7 +1971,7 @@ func TestSecurityProfileLifeCycleEvictionProcessUnstable(t *testing.T) { t.Fatal(err) } - dockerInstanceV1, err := test.StartADocker() + dockerInstanceV1, dump, err := test.StartADockerGetDump() if err != nil { t.Fatal(err) } @@ -1983,7 +1984,7 @@ func TestSecurityProfileLifeCycleEvictionProcessUnstable(t *testing.T) { } time.Sleep(1 * time.Second) // a quick sleep to let events to be added to the dump - err = test.StopActivityDump("", dockerInstanceV1.containerID) + err = test.StopActivityDump(dump.Name) if err != nil { t.Fatal(err) } @@ -2148,13 +2149,13 @@ func TestSecurityProfilePersistence(t *testing.T) { } defer test.Close() - dockerInstance1, err := test.StartADocker() + dockerInstance1, dump, err := test.StartADockerGetDump() if err != nil { t.Fatal(err) } defer dockerInstance1.stop() - err = test.StopActivityDump("", dockerInstance1.containerID) + err = test.StopActivityDump(dump.Name) if err != nil { t.Fatal(err) } diff --git a/pkg/security/tests/threat_score_test.go b/pkg/security/tests/threat_score_test.go index 2256847bc5f86..13d11ddc52451 100644 --- a/pkg/security/tests/threat_score_test.go +++ b/pkg/security/tests/threat_score_test.go @@ -100,7 +100,7 @@ func TestActivityDumpsThreatScore(t *testing.T) { } time.Sleep(1 * time.Second) // a quick sleep to let events to be added to the dump - err = test.StopActivityDump(dump.Name, "") + err = test.StopActivityDump(dump.Name) if err != nil { t.Fatal(err) } @@ -150,7 +150,7 @@ func TestActivityDumpsThreatScore(t *testing.T) { } time.Sleep(1 * time.Second) // a quick sleep to let events to be added to the dump - err = test.StopActivityDump(dump.Name, "") + err = test.StopActivityDump(dump.Name) if err != nil { t.Fatal(err) } @@ -191,7 +191,7 @@ func TestActivityDumpsThreatScore(t *testing.T) { } time.Sleep(1 * time.Second) // a quick sleep to let events to be added to the dump - err = test.StopActivityDump(dump.Name, "") + err = test.StopActivityDump(dump.Name) if err != nil { t.Fatal(err) } @@ -236,7 +236,7 @@ func TestActivityDumpsThreatScore(t *testing.T) { } time.Sleep(1 * time.Second) // a quick sleep to let events to be added to the dump - err = test.StopActivityDump(dump.Name, "") + err = test.StopActivityDump(dump.Name) if err != nil { t.Fatal(err) } diff --git a/pkg/security/utils/cgroup.go b/pkg/security/utils/cgroup.go index b4a3de192d7de..7b4be338429a6 100644 --- a/pkg/security/utils/cgroup.go +++ b/pkg/security/utils/cgroup.go @@ -12,6 +12,7 @@ import ( "bufio" "bytes" "crypto/sha256" + "fmt" "os" "strconv" "strings" @@ -49,6 +50,67 @@ func (cg ControlGroup) GetContainerID() containerutils.ContainerID { return containerutils.ContainerID(id) } +func parseCgroupLine(line string, expectedID int) (ControlGroup, error) { + idstr, rest, ok := strings.Cut(line, ":") + if !ok { + return ControlGroup{}, fmt.Errorf("invalid cgroup line: %s", line) + } + + id, err := strconv.Atoi(idstr) + if err != nil { + return ControlGroup{}, err + } + + if expectedID >= 0 && expectedID != id { + return ControlGroup{}, fmt.Errorf("found cgroup, but with wrong ID (%d, but expected %d): %s", id, expectedID, line) + } + + controllers, path, ok := strings.Cut(rest, ":") + if !ok { + return ControlGroup{}, fmt.Errorf("invalid cgroup line: %s", line) + } + + return ControlGroup{ + ID: id, + Controllers: strings.Split(controllers, ","), + Path: path, + }, nil +} + +// GetProcControlGroup0 returns the cgroup membership with index 0 of the specified task. +func GetProcControlGroup0(tgid, pid uint32) (ControlGroup, error) { + data, err := os.ReadFile(CgroupTaskPath(tgid, pid)) + if err != nil { + return ControlGroup{}, err + } + data = bytes.TrimSpace(data) + + var lastLine []byte + + for len(data) != 0 { + eol := bytes.IndexByte(data, '\n') + if eol < 0 { + eol = len(data) + } + line := data[:eol] + if bytes.HasPrefix(line, []byte("0:")) { + return parseCgroupLine(string(line), 0) + } + + if bytes.ContainsRune(line, ':') { + lastLine = line + } + + nextStart := eol + 1 + if nextStart >= len(data) { + break + } + data = data[nextStart:] + } + + return parseCgroupLine(string(lastLine), -1) +} + // GetProcControlGroups returns the cgroup membership of the specified task. func GetProcControlGroups(tgid, pid uint32) ([]ControlGroup, error) { data, err := os.ReadFile(CgroupTaskPath(tgid, pid)) @@ -59,16 +121,9 @@ func GetProcControlGroups(tgid, pid uint32) ([]ControlGroup, error) { scanner := bufio.NewScanner(bytes.NewReader(data)) for scanner.Scan() { t := scanner.Text() - parts := strings.Split(t, ":") - var ID int - ID, err = strconv.Atoi(parts[0]) + c, err := parseCgroupLine(t, -1) if err != nil { - continue - } - c := ControlGroup{ - ID: ID, - Controllers: strings.Split(parts[1], ","), - Path: parts[2], + return nil, err } cgroups = append(cgroups, c) } @@ -85,14 +140,14 @@ func GetProcContainerID(tgid, pid uint32) (containerutils.ContainerID, error) { // GetProcContainerContext returns the container ID which the process belongs to along with its manager. Returns "" if the process does not belong // to a container. func GetProcContainerContext(tgid, pid uint32) (containerutils.ContainerID, model.CGroupContext, error) { - cgroups, err := GetProcControlGroups(tgid, pid) - if err != nil || len(cgroups) == 0 { + cgroup, err := GetProcControlGroup0(tgid, pid) + if err != nil { return "", model.CGroupContext{}, err } - containerID, runtime := cgroups[0].GetContainerContext() + containerID, runtime := cgroup.GetContainerContext() cgroupContext := model.CGroupContext{ - CGroupID: containerutils.CGroupID(cgroups[0].Path), + CGroupID: containerutils.CGroupID(cgroup.Path), CGroupFlags: runtime, } 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..229a4b16350ed 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 @@ -110,6 +110,11 @@ func StatusPath(pid uint32) string { return procPidPath(pid, "status") } +// TaskStatusPath returns the path to the status file of a task pid in /proc +func TaskStatusPath(pid uint32, task string) string { + return procPidPath3(pid, "task", task, "status") +} + // LoginUIDPath returns the path to the loginuid file of a pid in /proc func LoginUIDPath(pid uint32) string { return procPidPath(pid, "loginuid") @@ -144,6 +149,10 @@ func procPidPath2(pid uint32, path1 string, path2 string) string { return filepath.Join(kernel.ProcFSRoot(), strconv.FormatUint(uint64(pid), 10), path1, path2) } +func procPidPath3(pid uint32, path1, path2, path3 string) string { + return filepath.Join(kernel.ProcFSRoot(), strconv.FormatUint(uint64(pid), 10), path1, path2, path3) +} + // ModulesPath returns the path to the modules file in /proc func ModulesPath() string { return filepath.Join(kernel.ProcFSRoot(), "modules") @@ -410,8 +419,8 @@ func GetProcessPidNamespace(pid uint32) (uint64, error) { } // GetNsPids returns the namespaced pids of the the givent root pid -func GetNsPids(pid uint32) ([]uint32, error) { - statusFile := StatusPath(pid) +func GetNsPids(pid uint32, task string) ([]uint32, error) { + statusFile := TaskStatusPath(pid, task) content, err := os.ReadFile(statusFile) if err != nil { return nil, fmt.Errorf("failed to read status file: %w", err) @@ -442,6 +451,26 @@ func GetNsPids(pid uint32) ([]uint32, error) { return nil, fmt.Errorf("NSpid field not found") } +// GetPidTasks returns the task IDs of a process +func GetPidTasks(pid uint32) ([]string, error) { + taskPath := procPidPath(pid, "task") + + // Read the contents of the task directory + tasks, err := os.ReadDir(taskPath) + if err != nil { + return nil, fmt.Errorf("failed to read task directory: %v", err) + } + + // Collect all task IDs + var taskIDs []string + for _, task := range tasks { + if task.IsDir() { + taskIDs = append(taskIDs, task.Name()) + } + } + return taskIDs, nil +} + // FindPidNamespace search and return the host PID for the given namespaced PID + its namespace func FindPidNamespace(nspid uint32, ns uint64) (uint32, error) { procPids, err := process.Pids() @@ -455,8 +484,17 @@ func FindPidNamespace(nspid uint32, ns uint64) (uint32, error) { continue } - if procNs == ns { - nspids, err := GetNsPids(uint32(procPid)) + if procNs != ns { + continue + } + + tasks, err := GetPidTasks(uint32(procPid)) + if err != nil { + continue + } + + for _, task := range tasks { + nspids, err := GetNsPids(uint32(procPid), task) if err != nil { return 0, err } @@ -529,22 +567,14 @@ var isNsPidAvailable = sync.OnceValue(func() bool { }) // TryToResolveTraceePid tries to resolve and returnt the HOST tracee PID, given the HOST tracer PID and the namespaced tracee PID. -func TryToResolveTraceePid(hostTracerPID, NsTraceePid uint32) (uint32, error) { +func TryToResolveTraceePid(hostTracerPID uint32, tracerNSID uint64, NsTraceePid uint32) (uint32, error) { // Look if the NSpid status field is available or not (it should be, except for Centos7). if isNsPidAvailable() { /* If it's available, we will search for an host pid having the same PID namespace as the tracer, and having the corresponding NS PID in its status field */ - - // 1. get the pid namespace of the tracer - ns, err := GetProcessPidNamespace(hostTracerPID) - if err != nil { - return 0, fmt.Errorf("Failed to resolve PID namespace: %v", err) - } - - // 2. find the host pid matching the arg pid with he tracer namespace - pid, err := FindPidNamespace(NsTraceePid, ns) + pid, err := FindPidNamespace(NsTraceePid, tracerNSID) if err != nil { return 0, fmt.Errorf("Failed to resolve tracee PID namespace: %v", err) } diff --git a/pkg/serializer/go.mod b/pkg/serializer/go.mod index 5e0bd3938c766..b4e6926e84ff3 100644 --- a/pkg/serializer/go.mod +++ b/pkg/serializer/go.mod @@ -63,7 +63,7 @@ replace ( ) require ( - github.com/DataDog/agent-payload/v5 v5.0.137 + github.com/DataDog/agent-payload/v5 v5.0.138 github.com/DataDog/datadog-agent/comp/core/config v0.57.1 github.com/DataDog/datadog-agent/comp/forwarder/defaultforwarder v0.56.0-rc.3 github.com/DataDog/datadog-agent/comp/forwarder/orchestrator/orchestratorinterface v0.56.0-rc.3 @@ -77,9 +77,9 @@ require ( github.com/DataDog/datadog-agent/pkg/tagset v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/telemetry v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/util/json v0.56.0-rc.3 - github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 - github.com/DataDog/datadog-agent/pkg/version v0.57.1 - github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.21.0 + github.com/DataDog/datadog-agent/pkg/util/log v0.59.1 + github.com/DataDog/datadog-agent/pkg/version v0.59.1 + github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.22.0 github.com/gogo/protobuf v1.3.2 github.com/json-iterator/go v1.1.12 github.com/protocolbuffers/protoscope v0.0.0-20221109213918-8e7a6aafa2c9 @@ -116,14 +116,14 @@ require ( github.com/DataDog/datadog-agent/pkg/util/http v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/pkg/util/optional v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/pointer v0.59.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.1 // indirect github.com/DataDog/datadog-agent/pkg/util/sort v0.56.0-rc.3 // indirect 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.0 // indirect + 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 @@ -139,11 +140,11 @@ require ( github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hashicorp/hcl v1.0.1-vault-5 // indirect - github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 // indirect + github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 // indirect github.com/klauspost/compress v1.17.11 // indirect - github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c // indirect + github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect @@ -155,13 +156,12 @@ require ( github.com/patrickmn/go-cache v2.1.0+incompatible // indirect 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/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect github.com/prometheus/client_golang v1.20.5 // indirect 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 @@ -177,10 +177,10 @@ require ( go.uber.org/fx v1.23.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect - golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f // indirect - golang.org/x/net v0.31.0 // indirect - golang.org/x/sys v0.27.0 // indirect - golang.org/x/text v0.20.0 // indirect + golang.org/x/exp v0.0.0-20241210194714-1829a127f884 // indirect + golang.org/x/net v0.33.0 // indirect + golang.org/x/sys v0.28.0 // indirect + golang.org/x/text v0.21.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/pkg/serializer/go.sum b/pkg/serializer/go.sum index fc5136030cbaa..83ba9e3da98d3 100644 --- a/pkg/serializer/go.sum +++ b/pkg/serializer/go.sum @@ -1,17 +1,17 @@ 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/agent-payload/v5 v5.0.137 h1:nV02RrYj6AwlQBGIEv6yG23CuxGtG0YWoFZAVE6vwxY= -github.com/DataDog/agent-payload/v5 v5.0.137/go.mod h1:lxh9lb5xYrBXjblpIWYUi4deJqVbkIfkjwesi5nskDc= +github.com/DataDog/agent-payload/v5 v5.0.138 h1:Wg7hmWuoLC/o0X3zZ+uGcfRHPyaytljudgSY9O59zjc= +github.com/DataDog/agent-payload/v5 v5.0.138/go.mod h1:lxh9lb5xYrBXjblpIWYUi4deJqVbkIfkjwesi5nskDc= 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/opentelemetry-mapping-go/pkg/internal/sketchtest v0.21.0 h1:VS4NTqwczwezMVvI6A7xYR3ugPmMUJ4FcdFrsdnZI2I= -github.com/DataDog/opentelemetry-mapping-go/pkg/internal/sketchtest v0.21.0/go.mod h1:66XlN7QpQKqIvw8e2UbCXV5X8wGnEw851nT9BjJ75dY= -github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.21.0 h1:/Dp1WBvekdusS9Tw9pLE7RG04eluNktQ29arLS4SpGM= -github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.21.0/go.mod h1:asNuwNy1O2HbadkcZVuqmFGonfEzXS/SBvOo8V1MJvQ= +github.com/DataDog/opentelemetry-mapping-go/pkg/internal/sketchtest v0.22.0 h1:cXcKVEU1D0HlguR7GunnvuI70TghkarCa9DApqzMY94= +github.com/DataDog/opentelemetry-mapping-go/pkg/internal/sketchtest v0.22.0/go.mod h1:ES00EXfyEKgUkjd93tAXCxJA6i0seeOhZoS5Cj2qzzg= +github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.22.0 h1:63SzQz9Ab8XJj8fQKQz6UZNBhOm8rucwzbDfwTVF6dQ= +github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.22.0/go.mod h1:E/PY/aQ6S/N5hBPHXZRGmovs5b1BSi4RHGNcB4yP/Z0= 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= @@ -93,7 +95,6 @@ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5a github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/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= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -116,8 +117,8 @@ github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9 github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/hcl v1.0.1-vault-5 h1:kI3hhbbyzr4dldA8UdTb7ZlVVlI2DACdCfz31RPDgJM= github.com/hashicorp/hcl v1.0.1-vault-5/go.mod h1:XYhtn6ijBSAj6n4YqAaf7RBPS4I06AItNorpy+MoQNM= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 h1:S4qyfL2sEm5Budr4KVMyEniCy+PbS55651I/a+Kn/NQ= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb h1:PGufWXXDq9yaev6xX1YQauaO1MV90e6Mpoq1I7Lz/VM= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= @@ -146,8 +147,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -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/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a h1:3Bm7EwfUQUvhNeKIkUct/gl9eod1TcXuj8stxvi/GoI= +github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a/go.mod h1:ilwx/Dta8jXAgpFYFvSWEMwxmbWXyiUHkd5FwyKhb5k= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= @@ -185,8 +186,8 @@ 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-20220216144756-c35f1ee13d7c h1:NRoLoZvkBTKvR5gQLgA3e0hqjkY9u1wm+iOL45VN/qI= -github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 h1:o4JXh1EVt9k/+g42oCprj/FisM4qX9L3sZB3upGN2ZU= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= @@ -222,12 +223,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= @@ -303,8 +300,8 @@ golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f h1:XdNn9LlyWAhLVp6P/i8QYBW+hlyhrhei9uErw2B5GJo= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f/go.mod h1:D5SMRVC3C2/4+F/DB1wZsLRnSNimn2Sp/NPsCrsv8ak= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884 h1:Y/Mj/94zIQQGHVSv1tTtQBDaQaJe62U9bkDZKKyhPCU= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -325,8 +322,8 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20191002035440-2ec189313ef0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.31.0 h1:68CPQngjLL0r2AlUKiSxtQFKvzRVbnzLwMUn5SzcLHo= -golang.org/x/net v0.31.0/go.mod h1:P4fl1q7dY2hnZFxEk4pPSkDHF+QqjitcnDjUQyMM+pM= +golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= +golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -350,12 +347,12 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220829200755-d48e67d00261/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.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/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= -golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= diff --git a/pkg/serializer/internal/metrics/origin_mapping.go b/pkg/serializer/internal/metrics/origin_mapping.go index 95fd26b258e8c..02c54e1913363 100644 --- a/pkg/serializer/internal/metrics/origin_mapping.go +++ b/pkg/serializer/internal/metrics/origin_mapping.go @@ -40,7 +40,7 @@ func metricSourceToOriginCategory(ms metrics.MetricSource) int32 { metrics.MetricSourceContainerd, metrics.MetricSourceCri, metrics.MetricSourceDocker, - metrics.MetricSourceNtp, + metrics.MetricSourceNTP, metrics.MetricSourceSystemd, metrics.MetricSourceHelm, metrics.MetricSourceKubeflow, @@ -64,6 +64,9 @@ func metricSourceToOriginCategory(ms metrics.MetricSource) int32 { metrics.MetricSourceDisk, metrics.MetricSourceNetwork, metrics.MetricSourceSnmp, + // Plugins and non-checks + metrics.MetricSourceCloudFoundry, + metrics.MetricSourceJenkins, // Python Checks metrics.MetricSourceZenohRouter, metrics.MetricSourceZabbix, @@ -148,6 +151,9 @@ func metricSourceToOriginCategory(ms metrics.MetricSource) int32 { metrics.MetricSourceRay, metrics.MetricSourceNvidiaTriton, metrics.MetricSourceKarpenter, + metrics.MetricSourceKubeVirtAPI, + metrics.MetricSourceKubeVirtController, + metrics.MetricSourceKubeVirtHandler, metrics.MetricSourceFluxcd, metrics.MetricSourceEsxi, metrics.MetricSourceDcgm, @@ -301,6 +307,8 @@ func metricSourceToOriginCategory(ms metrics.MetricSource) int32 { metrics.MetricSourceYarn, metrics.MetricSourceZk, metrics.MetricSourceAwsNeuron, + metrics.MetricSourceNvidiaNim, + metrics.MetricSourceQuarkus, metrics.MetricSourceMilvus: return 11 // integrationMetrics default: @@ -365,6 +373,8 @@ func metricSourceToOriginService(ms metrics.MetricSource) int32 { return 36 case metrics.MetricSourceClickhouse: return 37 + case metrics.MetricSourceCloudFoundry: + return 440 case metrics.MetricSourceCloudFoundryAPI: return 38 case metrics.MetricSourceCockroachdb: @@ -463,6 +473,8 @@ func metricSourceToOriginService(ms metrics.MetricSource) int32 { return 86 case metrics.MetricSourceJbossWildfly: return 87 + case metrics.MetricSourceJenkins: + return 436 case metrics.MetricSourceKafkaConsumer: return 89 case metrics.MetricSourceKafka: @@ -487,6 +499,12 @@ func metricSourceToOriginService(ms metrics.MetricSource) int32 { return 98 case metrics.MetricSourceKubernetesState: return 99 + case metrics.MetricSourceKubeVirtAPI: + return 437 + case metrics.MetricSourceKubeVirtController: + return 438 + case metrics.MetricSourceKubeVirtHandler: + return 439 case metrics.MetricSourceKyototycoon: return 100 case metrics.MetricSourceLighttpd: @@ -651,7 +669,7 @@ func metricSourceToOriginService(ms metrics.MetricSource) int32 { return 182 case metrics.MetricSourceDocker: return 183 - case metrics.MetricSourceNtp: + case metrics.MetricSourceNTP: return 184 case metrics.MetricSourceSystemd: return 185 @@ -883,6 +901,10 @@ func metricSourceToOriginService(ms metrics.MetricSource) int32 { return 419 case metrics.MetricSourceMilvus: return 425 + case metrics.MetricSourceNvidiaNim: + return 426 + case metrics.MetricSourceQuarkus: + return 427 default: return 0 } diff --git a/pkg/serializer/internal/metrics/service_checks_test.go b/pkg/serializer/internal/metrics/service_checks_test.go index 2a96f3d10072a..2559d7c9ed2cc 100644 --- a/pkg/serializer/internal/metrics/service_checks_test.go +++ b/pkg/serializer/internal/metrics/service_checks_test.go @@ -126,7 +126,7 @@ func TestPayloadsEmptyServiceCheck(t *testing.T) { func TestPayloadsServiceChecks(t *testing.T) { config := mock.New(t) - config.Set("serializer_max_payload_size", 200, pkgconfigmodel.SourceAgentRuntime) + config.Set("serializer_max_payload_size", 250, pkgconfigmodel.SourceAgentRuntime) serviceCheckCollection := []ServiceChecks{ {createServiceCheck("1"), createServiceCheck("2"), createServiceCheck("3")}, diff --git a/pkg/serverless/daemon/routes.go b/pkg/serverless/daemon/routes.go index 733b4a49b050c..fe78651ac4d2f 100644 --- a/pkg/serverless/daemon/routes.go +++ b/pkg/serverless/daemon/routes.go @@ -104,7 +104,17 @@ func (e *EndInvocation) ServeHTTP(w http.ResponseWriter, r *http.Request) { } errorMsg := r.Header.Get(invocationlifecycle.InvocationErrorMsgHeader) + if decodedMsg, err := base64.StdEncoding.DecodeString(errorMsg); err != nil { + log.Debug("Error message header may not be encoded, setting as is") + } else { + errorMsg = string(decodedMsg) + } errorType := r.Header.Get(invocationlifecycle.InvocationErrorTypeHeader) + if decodedType, err := base64.StdEncoding.DecodeString(errorType); err != nil { + log.Debug("Error type header may not be encoded, setting as is") + } else { + errorType = string(decodedType) + } errorStack := r.Header.Get(invocationlifecycle.InvocationErrorStackHeader) if decodedStack, err := base64.StdEncoding.DecodeString(errorStack); err != nil { log.Debug("Could not decode error stack header") diff --git a/pkg/serverless/daemon/routes_test.go b/pkg/serverless/daemon/routes_test.go index e0f2fea43a637..e630d2829bd61 100644 --- a/pkg/serverless/daemon/routes_test.go +++ b/pkg/serverless/daemon/routes_test.go @@ -7,6 +7,7 @@ package daemon import ( "bytes" + "encoding/base64" "fmt" "io" "net/http" @@ -17,7 +18,6 @@ import ( "testing" "time" - "github.com/cihub/seelog" "github.com/stretchr/testify/assert" nooptagger "github.com/DataDog/datadog-agent/comp/core/tagger/impl-noop" @@ -105,7 +105,7 @@ func TestEndInvocation(t *testing.T) { assert.Equal(m.lastEndDetails.Runtime, d.ExecutionContext.GetCurrentState().Runtime) } -func TestEndInvocationWithError(t *testing.T) { +func TestEndInvocationWithErrorEncodedHeaders(t *testing.T) { assert := assert.New(t) port := testutil.FreeTCPPort(t) d := StartDaemon(fmt.Sprintf("127.0.0.1:%d", port)) @@ -115,10 +115,52 @@ func TestEndInvocationWithError(t *testing.T) { m := &mockLifecycleProcessor{} d.InvocationProcessor = m + errorMessage := "Error message" + errorType := "System.Exception" + errorStack := "System.Exception: Error message \n at TestFunction.Handle(ILambdaContext context)" + + client := &http.Client{} + body := bytes.NewBuffer([]byte(`{}`)) + request, err := http.NewRequest(http.MethodPost, fmt.Sprintf("http://127.0.0.1:%d/lambda/end-invocation", port), body) + request.Header.Set("x-datadog-invocation-error", "true") + request.Header.Set(invocationlifecycle.InvocationErrorMsgHeader, base64.StdEncoding.EncodeToString([]byte(errorMessage))) + request.Header.Set(invocationlifecycle.InvocationErrorTypeHeader, base64.StdEncoding.EncodeToString([]byte(errorType))) + request.Header.Set(invocationlifecycle.InvocationErrorStackHeader, base64.StdEncoding.EncodeToString([]byte(errorStack))) + assert.Nil(err) + res, err := client.Do(request) + assert.Nil(err) + if res != nil { + res.Body.Close() + assert.Equal(res.StatusCode, 200) + } + assert.True(m.OnInvokeEndCalled) + assert.True(m.isError) + assert.Equal(m.lastEndDetails.ErrorMsg, errorMessage) + assert.Equal(m.lastEndDetails.ErrorType, errorType) + assert.Equal(m.lastEndDetails.ErrorStack, errorStack) +} + +func TestEndInvocationWithErrorNonEncodedHeaders(t *testing.T) { + assert := assert.New(t) + port := testutil.FreeTCPPort(t) + d := StartDaemon(fmt.Sprintf("127.0.0.1:%d", port)) + time.Sleep(100 * time.Millisecond) + defer d.Stop() + + m := &mockLifecycleProcessor{} + d.InvocationProcessor = m + + errorMessage := "Error message" + errorType := "System.Exception" + errorStack := "System.Exception: Error message at TestFunction.Handle(ILambdaContext context)" + client := &http.Client{} body := bytes.NewBuffer([]byte(`{}`)) request, err := http.NewRequest(http.MethodPost, fmt.Sprintf("http://127.0.0.1:%d/lambda/end-invocation", port), body) request.Header.Set("x-datadog-invocation-error", "true") + request.Header.Set(invocationlifecycle.InvocationErrorMsgHeader, errorMessage) + request.Header.Set(invocationlifecycle.InvocationErrorTypeHeader, errorType) + request.Header.Set(invocationlifecycle.InvocationErrorStackHeader, errorStack) assert.Nil(err) res, err := client.Do(request) assert.Nil(err) @@ -128,6 +170,9 @@ func TestEndInvocationWithError(t *testing.T) { } assert.True(m.OnInvokeEndCalled) assert.True(m.isError) + assert.Equal(m.lastEndDetails.ErrorMsg, errorMessage) + assert.Equal(m.lastEndDetails.ErrorType, errorType) + assert.Equal(m.lastEndDetails.ErrorStack, errorStack) } func TestTraceContext(t *testing.T) { @@ -399,7 +444,7 @@ func getEventFromFile(filename string) string { func BenchmarkStartEndInvocation(b *testing.B) { // Set the logger up, so that it does not buffer all entries forever (some of these are BIG as they include the // JSON payload). We're not interested in any output here, so we send it all to `io.Discard`. - l, err := seelog.LoggerFromWriterWithMinLevel(io.Discard, seelog.ErrorLvl) + l, err := log.LoggerFromWriterWithMinLevel(io.Discard, log.ErrorLvl) assert.Nil(b, err) log.SetupLogger(l, "error") diff --git a/pkg/serverless/logs/logs_test.go b/pkg/serverless/logs/logs_test.go index 6a8f0d30d3cb0..132efb75bbcaa 100644 --- a/pkg/serverless/logs/logs_test.go +++ b/pkg/serverless/logs/logs_test.go @@ -224,7 +224,7 @@ func TestProcessMessageValid(t *testing.T) { lc.processMessage(&message) - received, timed := demux.WaitForNumberOfSamples(7, 0, 100*time.Millisecond) + received, timed := demux.WaitForNumberOfSamples(7, 0, 125*time.Millisecond) assert.Len(t, received, 7) assert.Len(t, timed, 0) demux.Reset() @@ -232,7 +232,7 @@ func TestProcessMessageValid(t *testing.T) { lc.enhancedMetricsEnabled = false lc.processMessage(&message) - received, timed = demux.WaitForSamples(100 * time.Millisecond) + received, timed = demux.WaitForSamples(125 * time.Millisecond) assert.Len(t, received, 0, "we should NOT have received metrics") assert.Len(t, timed, 0) } @@ -366,7 +366,7 @@ func TestProcessMessageShouldNotProcessArnNotSet(t *testing.T) { go lc.processMessage(message) - received, timed := demux.WaitForSamples(100 * time.Millisecond) + received, timed := demux.WaitForSamples(125 * time.Millisecond) assert.Len(t, received, 0, "We should NOT have received metrics") assert.Len(t, timed, 0) } @@ -394,7 +394,7 @@ func TestProcessMessageShouldNotProcessLogsDropped(t *testing.T) { go lc.processMessage(message) - received, timed := demux.WaitForSamples(100 * time.Millisecond) + received, timed := demux.WaitForSamples(125 * time.Millisecond) assert.Len(t, received, 0, "We should NOT have received metrics") assert.Len(t, timed, 0) } @@ -424,11 +424,13 @@ func TestProcessMessageShouldProcessLogTypeFunctionOutOfMemory(t *testing.T) { go lc.processMessage(message) - received, timed := demux.WaitForNumberOfSamples(2, 0, 100*time.Millisecond) + received, timed := demux.WaitForNumberOfSamples(2, 0, 125*time.Millisecond) assert.Len(t, received, 2) assert.Len(t, timed, 0) - assert.Equal(t, serverlessMetrics.OutOfMemoryMetric, received[0].Name) - assert.Equal(t, serverlessMetrics.ErrorsMetric, received[1].Name) + if len(received) == 2 { + assert.Equal(t, serverlessMetrics.OutOfMemoryMetric, received[0].Name) + assert.Equal(t, serverlessMetrics.ErrorsMetric, received[1].Name) + } } func TestProcessMessageShouldProcessLogTypePlatformReportOutOfMemory(t *testing.T) { @@ -465,7 +467,7 @@ func TestProcessMessageShouldProcessLogTypePlatformReportOutOfMemory(t *testing. go lc.processMessage(message) - received, timed := demux.WaitForNumberOfSamples(2, 0, 100*time.Millisecond) + received, timed := demux.WaitForNumberOfSamples(2, 0, 125*time.Millisecond) assert.Len(t, received, 8) assert.Len(t, timed, 0) assert.Equal(t, serverlessMetrics.OutOfMemoryMetric, received[6].Name) @@ -497,7 +499,7 @@ func TestProcessMessageShouldSendFailoverMetric(t *testing.T) { lc.processMessage(&message) - received, timed := demux.WaitForNumberOfSamples(1, 0, 100*time.Millisecond) + received, timed := demux.WaitForNumberOfSamples(1, 0, 125*time.Millisecond) assert.Len(t, received, 1) assert.Len(t, timed, 0) demux.Reset() @@ -507,7 +509,7 @@ func TestProcessMessageShouldSendFailoverMetric(t *testing.T) { message.stringRecord = "{\"DD_EXTENSION_FALLBACK_REASON\":\"test-reason\"}" // add again bc processing empties it lc.processMessage(&message) - received, timed = demux.WaitForNumberOfSamples(1, 0, 100*time.Millisecond) + received, timed = demux.WaitForNumberOfSamples(1, 0, 125*time.Millisecond) assert.Len(t, received, 1) assert.Len(t, timed, 0) } @@ -549,7 +551,7 @@ func TestProcessLogMessageLogsEnabled(t *testing.T) { assert.NotNil(t, received) assert.Equal(t, "my-arn", received.Lambda.ARN) assert.Equal(t, "myRequestID", received.Lambda.RequestID) - case <-time.After(100 * time.Millisecond): + case <-time.After(125 * time.Millisecond): assert.Fail(t, "We should have received logs") } } @@ -597,7 +599,7 @@ func TestProcessLogMessageLogsEnabledForMixedUnorderedMessages(t *testing.T) { assert.NotNil(t, received) assert.Equal(t, "my-arn", received.Lambda.ARN) assert.Equal(t, expectedRequestIDs[i], received.Lambda.RequestID) - case <-time.After(100 * time.Millisecond): + case <-time.After(125 * time.Millisecond): assert.Fail(t, "We should have received logs") } } @@ -628,7 +630,7 @@ func TestProcessLogMessageNoStringRecordPlatformLog(t *testing.T) { select { case <-logChannel: assert.Fail(t, "We should not have received logs") - case <-time.After(100 * time.Millisecond): + case <-time.After(125 * time.Millisecond): // nothing to do here } } @@ -663,7 +665,7 @@ func TestProcessLogMessageNoStringRecordFunctionLog(t *testing.T) { assert.NotNil(t, received) assert.Equal(t, "my-arn", received.Lambda.ARN) assert.Equal(t, "myRequestID", received.Lambda.RequestID) - case <-time.After(100 * time.Millisecond): + case <-time.After(125 * time.Millisecond): assert.Fail(t, "We should have received logs") } } @@ -700,7 +702,7 @@ func TestProcessLogMessageLogsNotEnabled(t *testing.T) { select { case <-logChannel: assert.Fail(t, "We should not have received logs") - case <-time.After(100 * time.Millisecond): + case <-time.After(125 * time.Millisecond): // nothing to do here } } @@ -763,7 +765,7 @@ func TestProcessLogMessagesTimeoutLogFromReportLog(t *testing.T) { assert.Equal(t, "myRequestID", received.Lambda.RequestID) assert.Equal(t, expectedStringRecord[i], string(received.Content)) assert.Equal(t, expectedErrors[i], received.IsError) - case <-time.After(100 * time.Millisecond): + case <-time.After(125 * time.Millisecond): assert.Fail(t, "We should have received logs") } } @@ -858,7 +860,7 @@ func TestProcessMultipleLogMessagesTimeoutLogFromReportLog(t *testing.T) { } else { assert.False(t, received.IsError) } - case <-time.After(100 * time.Millisecond): + case <-time.After(125 * time.Millisecond): assert.Fail(t, "We should have received logs") } } @@ -904,7 +906,7 @@ func TestProcessLogMessagesOutOfMemoryError(t *testing.T) { assert.Equal(t, "my-arn", received.Lambda.ARN) assert.Equal(t, "myRequestID", received.Lambda.RequestID) assert.Equal(t, true, received.IsError) - case <-time.After(100 * time.Millisecond): + case <-time.After(125 * time.Millisecond): assert.Fail(t, "We should have received logs") } } @@ -943,7 +945,7 @@ func TestProcessLogMessageLogsNoRequestID(t *testing.T) { select { case <-logChannel: assert.Fail(t, "We should not have received logs") - case <-time.After(100 * time.Millisecond): + case <-time.After(125 * time.Millisecond): // nothing to do here } @@ -952,7 +954,7 @@ func TestProcessLogMessageLogsNoRequestID(t *testing.T) { for _, msg := range received { assert.Equal(t, "", msg.objectRecord.requestID) } - case <-time.After(100 * time.Millisecond): + case <-time.After(125 * time.Millisecond): assert.Fail(t, "We should have received logs") } } @@ -1228,7 +1230,7 @@ func TestRuntimeMetricsMatchLogs(t *testing.T) { lc.processMessage(doneMessage) lc.processMessage(reportMessage) - generatedMetrics, timedMetrics := demux.WaitForNumberOfSamples(10, 0, 100*time.Millisecond) + generatedMetrics, timedMetrics := demux.WaitForNumberOfSamples(10, 0, 125*time.Millisecond) postRuntimeMetricTimestamp := float64(reportLogTime.UnixNano()) / float64(time.Second) runtimeMetricTimestamp := float64(endTime.UnixNano()) / float64(time.Second) assert.Equal(t, generatedMetrics[0], metrics.MetricSample{ @@ -1314,7 +1316,7 @@ func TestRuntimeMetricsMatchLogsProactiveInit(t *testing.T) { lc.processMessage(doneMessage) lc.processMessage(reportMessage) - generatedMetrics, timedMetrics := demux.WaitForNumberOfSamples(10, 0, 100*time.Millisecond) + generatedMetrics, timedMetrics := demux.WaitForNumberOfSamples(10, 0, 125*time.Millisecond) postRuntimeMetricTimestamp := float64(reportLogTime.UnixNano()) / float64(time.Second) runtimeMetricTimestamp := float64(endTime.UnixNano()) / float64(time.Second) assert.Equal(t, generatedMetrics[0], metrics.MetricSample{ @@ -1416,7 +1418,7 @@ func TestRuntimeMetricsOnTimeout(t *testing.T) { assert.Nil(t, restoreErr) lc.processMessage(reportMessage) - generatedMetrics, timedMetrics := demux.WaitForNumberOfSamples(10, 0, 100*time.Millisecond) + generatedMetrics, timedMetrics := demux.WaitForNumberOfSamples(10, 0, 125*time.Millisecond) postRuntimeMetricTimestamp := float64(reportLogTime.UnixNano()) / float64(time.Second) runtimeMetricTimestamp := float64(endTime.UnixNano()) / float64(time.Second) assert.Equal(t, generatedMetrics[0], metrics.MetricSample{ diff --git a/pkg/serverless/metrics/enhanced_metrics_test.go b/pkg/serverless/metrics/enhanced_metrics_test.go index ea6619861f726..9c6f9472ee756 100644 --- a/pkg/serverless/metrics/enhanced_metrics_test.go +++ b/pkg/serverless/metrics/enhanced_metrics_test.go @@ -34,7 +34,7 @@ func TestGenerateEnhancedMetricsFromFunctionLogOutOfMemory(t *testing.T) { GenerateOutOfMemoryEnhancedMetrics(reportLogTime, tags, demux) } - generatedMetrics, timedMetrics := demux.WaitForNumberOfSamples(2, 0, 100*time.Millisecond) + generatedMetrics, timedMetrics := demux.WaitForNumberOfSamples(2, 0, 125*time.Millisecond) assert.True(t, isOOM) assert.Len(t, generatedMetrics, 2, "two enhanced metrics should have been generated") assert.Len(t, timedMetrics, 0) @@ -63,7 +63,7 @@ func TestGenerateEnhancedMetricsFromFunctionLogNoMetric(t *testing.T) { GenerateOutOfMemoryEnhancedMetrics(time.Now(), tags, demux) } - generatedMetrics, timedMetrics := demux.WaitForSamples(100 * time.Millisecond) + generatedMetrics, timedMetrics := demux.WaitForSamples(125 * time.Millisecond) assert.False(t, isOOM) assert.Len(t, generatedMetrics, 0, "no metrics should have been generated") assert.Len(t, timedMetrics, 0) @@ -89,7 +89,7 @@ func TestGenerateEnhancedMetricsFromReportLogColdStart(t *testing.T) { } go GenerateEnhancedMetricsFromReportLog(args) - generatedMetrics, timedMetrics := demux.WaitForNumberOfSamples(7, 0, 100*time.Millisecond) + generatedMetrics, timedMetrics := demux.WaitForNumberOfSamples(7, 0, 125*time.Millisecond) assert.Equal(t, generatedMetrics[:7], []metrics.MetricSample{{ Name: maxMemoryUsedMetric, @@ -164,7 +164,7 @@ func TestGenerateEnhancedMetricsFromReportLogNoColdStart(t *testing.T) { } go GenerateEnhancedMetricsFromReportLog(args) - generatedMetrics, timedMetrics := demux.WaitForNumberOfSamples(6, 0, 0100*time.Millisecond) + generatedMetrics, timedMetrics := demux.WaitForNumberOfSamples(6, 0, 125*time.Millisecond) assert.Equal(t, generatedMetrics[:6], []metrics.MetricSample{{ Name: maxMemoryUsedMetric, @@ -218,7 +218,7 @@ func TestSendTimeoutEnhancedMetric(t *testing.T) { go SendTimeoutEnhancedMetric(tags, demux) - generatedMetrics, timedMetrics := demux.WaitForNumberOfSamples(1, 0, 100*time.Millisecond) + generatedMetrics, timedMetrics := demux.WaitForNumberOfSamples(1, 0, 125*time.Millisecond) assert.Equal(t, generatedMetrics[:1], []metrics.MetricSample{{ Name: timeoutsMetric, @@ -238,7 +238,7 @@ func TestSendInvocationEnhancedMetric(t *testing.T) { go SendInvocationEnhancedMetric(tags, demux) - generatedMetrics, timedMetrics := demux.WaitForNumberOfSamples(1, 0, 100*time.Millisecond) + generatedMetrics, timedMetrics := demux.WaitForNumberOfSamples(1, 0, 125*time.Millisecond) assert.Equal(t, generatedMetrics[:1], []metrics.MetricSample{{ Name: invocationsMetric, @@ -264,7 +264,7 @@ func TestDisableEnhancedMetrics(t *testing.T) { SendInvocationEnhancedMetric(tags, demux) }() - generatedMetrics, timedMetrics := demux.WaitForNumberOfSamples(1, 0, 100*time.Millisecond) + generatedMetrics, timedMetrics := demux.WaitForNumberOfSamples(1, 0, 125*time.Millisecond) assert.Len(t, generatedMetrics, 0) assert.Len(t, timedMetrics, 0) @@ -279,7 +279,7 @@ func TestSendOutOfMemoryEnhancedMetric(t *testing.T) { mockTime := time.Now() go SendOutOfMemoryEnhancedMetric(tags, mockTime, demux) - generatedMetrics, timedMetrics := demux.WaitForNumberOfSamples(1, 0, 100*time.Millisecond) + generatedMetrics, timedMetrics := demux.WaitForNumberOfSamples(1, 0, 125*time.Millisecond) assert.Equal(t, generatedMetrics[:1], []metrics.MetricSample{{ Name: OutOfMemoryMetric, @@ -298,7 +298,7 @@ func TestSendErrorsEnhancedMetric(t *testing.T) { mockTime := time.Now() go SendErrorsEnhancedMetric(tags, mockTime, demux) - generatedMetrics, timedMetrics := demux.WaitForNumberOfSamples(1, 0, 100*time.Millisecond) + generatedMetrics, timedMetrics := demux.WaitForNumberOfSamples(1, 0, 125*time.Millisecond) assert.Equal(t, generatedMetrics[:1], []metrics.MetricSample{{ Name: ErrorsMetric, @@ -366,7 +366,7 @@ func TestGenerateEnhancedMetricsFromRuntimeDoneLogNoStartDate(t *testing.T) { Demux: demux, } go GenerateEnhancedMetricsFromRuntimeDoneLog(args) - generatedMetrics, timedMetrics := demux.WaitForNumberOfSamples(3, 0, 100*time.Millisecond) + generatedMetrics, timedMetrics := demux.WaitForNumberOfSamples(3, 0, 125*time.Millisecond) assert.Equal(t, generatedMetrics, []metrics.MetricSample{{ Name: responseLatencyMetric, Value: 19, @@ -407,7 +407,7 @@ func TestGenerateEnhancedMetricsFromRuntimeDoneLogNoEndDate(t *testing.T) { Demux: demux, } go GenerateEnhancedMetricsFromRuntimeDoneLog(args) - generatedMetrics, timedMetrics := demux.WaitForNumberOfSamples(3, 0, 100*time.Millisecond) + generatedMetrics, timedMetrics := demux.WaitForNumberOfSamples(3, 0, 125*time.Millisecond) assert.Equal(t, generatedMetrics, []metrics.MetricSample{{ Name: responseLatencyMetric, Value: 19, @@ -448,7 +448,7 @@ func TestGenerateEnhancedMetricsFromRuntimeDoneLogOK(t *testing.T) { Demux: demux, } go GenerateEnhancedMetricsFromRuntimeDoneLog(args) - generatedMetrics, timedMetrics := demux.WaitForNumberOfSamples(4, 0, 100*time.Millisecond) + generatedMetrics, timedMetrics := demux.WaitForNumberOfSamples(4, 0, 125*time.Millisecond) assert.Equal(t, generatedMetrics, []metrics.MetricSample{{ Name: runtimeDurationMetric, Value: 153, @@ -487,7 +487,7 @@ func TestGenerateCPUEnhancedMetrics(t *testing.T) { now := float64(time.Now().UnixNano()) / float64(time.Second) args := generateCPUEnhancedMetricsArgs{100, 53, 200, tags, demux, now} go generateCPUEnhancedMetrics(args) - generatedMetrics, timedMetrics := demux.WaitForNumberOfSamples(4, 0, 100*time.Millisecond) + generatedMetrics, timedMetrics := demux.WaitForNumberOfSamples(4, 0, 125*time.Millisecond) assert.Equal(t, []metrics.MetricSample{ { Name: cpuSystemTimeMetric, @@ -530,7 +530,7 @@ func TestDisableCPUEnhancedMetrics(t *testing.T) { SendCPUEnhancedMetrics(&proc.CPUData{}, 0, tags, demux) }() - generatedMetrics, timedMetrics := demux.WaitForNumberOfSamples(1, 0, 100*time.Millisecond) + generatedMetrics, timedMetrics := demux.WaitForNumberOfSamples(1, 0, 125*time.Millisecond) assert.Len(t, generatedMetrics, 0) assert.Len(t, timedMetrics, 0) @@ -560,7 +560,7 @@ func TestGenerateCPUUtilizationEnhancedMetrics(t *testing.T) { Time: now, } go GenerateCPUUtilizationEnhancedMetrics(args) - generatedMetrics, timedMetrics := demux.WaitForNumberOfSamples(5, 0, 100*time.Millisecond) + generatedMetrics, timedMetrics := demux.WaitForNumberOfSamples(5, 0, 125*time.Millisecond) assert.Equal(t, []metrics.MetricSample{ { Name: cpuTotalUtilizationPctMetric, @@ -621,7 +621,7 @@ func TestGenerateNetworkEnhancedMetrics(t *testing.T) { Time: now, } go generateNetworkEnhancedMetrics(args) - generatedMetrics, timedMetrics := demux.WaitForNumberOfSamples(3, 0, 100*time.Millisecond) + generatedMetrics, timedMetrics := demux.WaitForNumberOfSamples(3, 0, 125*time.Millisecond) assert.Equal(t, []metrics.MetricSample{ { Name: rxBytesMetric, @@ -664,7 +664,7 @@ func TestNetworkEnhancedMetricsDisabled(t *testing.T) { SendNetworkEnhancedMetrics(&proc.NetworkData{}, tags, demux) }() - generatedMetrics, timedMetrics := demux.WaitForNumberOfSamples(1, 0, 100*time.Millisecond) + generatedMetrics, timedMetrics := demux.WaitForNumberOfSamples(1, 0, 125*time.Millisecond) assert.Len(t, generatedMetrics, 0) assert.Len(t, timedMetrics, 0) @@ -685,7 +685,7 @@ func TestSendTmpEnhancedMetrics(t *testing.T) { Time: now, } go generateTmpEnhancedMetrics(args) - generatedMetrics, timedMetrics := demux.WaitForNumberOfSamples(3, 0, 100*time.Millisecond) + generatedMetrics, timedMetrics := demux.WaitForNumberOfSamples(3, 0, 125*time.Millisecond) assert.Equal(t, []metrics.MetricSample{ { Name: tmpUsedMetric, @@ -722,7 +722,7 @@ func TestSendTmpEnhancedMetricsDisabled(t *testing.T) { SendTmpEnhancedMetrics(make(chan bool), tags, &metricAgent) }() - generatedMetrics, timedMetrics := demux.WaitForNumberOfSamples(1, 0, 100*time.Millisecond) + generatedMetrics, timedMetrics := demux.WaitForNumberOfSamples(1, 0, 125*time.Millisecond) assert.Len(t, generatedMetrics, 0) assert.Len(t, timedMetrics, 0) @@ -743,7 +743,7 @@ func TestSendFdEnhancedMetrics(t *testing.T) { Time: now, } go generateFdEnhancedMetrics(args) - generatedMetrics, timedMetrics := demux.WaitForNumberOfSamples(3, 0, 100*time.Millisecond) + generatedMetrics, timedMetrics := demux.WaitForNumberOfSamples(3, 0, 125*time.Millisecond) assert.Equal(t, []metrics.MetricSample{ { Name: fdMaxMetric, @@ -779,7 +779,7 @@ func TestSendThreadEnhancedMetrics(t *testing.T) { Time: now, } go generateThreadEnhancedMetrics(args) - generatedMetrics, timedMetrics := demux.WaitForNumberOfSamples(3, 0, 100*time.Millisecond) + generatedMetrics, timedMetrics := demux.WaitForNumberOfSamples(3, 0, 125*time.Millisecond) assert.Equal(t, []metrics.MetricSample{ { Name: threadsMaxMetric, @@ -816,7 +816,7 @@ func TestSendProcessEnhancedMetricsDisabled(t *testing.T) { SendProcessEnhancedMetrics(make(chan bool), tags, &metricAgent) }() - generatedMetrics, timedMetrics := demux.WaitForNumberOfSamples(1, 0, 100*time.Millisecond) + generatedMetrics, timedMetrics := demux.WaitForNumberOfSamples(1, 0, 125*time.Millisecond) assert.Len(t, generatedMetrics, 0) assert.Len(t, timedMetrics, 0) @@ -829,7 +829,7 @@ func TestSendFailoverReasonMetric(t *testing.T) { demux := createDemultiplexer(t) tags := []string{"reason:test-reason"} go SendFailoverReasonMetric(tags, demux) - generatedMetrics, _ := demux.WaitForNumberOfSamples(1, 0, 100*time.Millisecond) + generatedMetrics, _ := demux.WaitForNumberOfSamples(1, 0, 125*time.Millisecond) assert.Len(t, generatedMetrics, 1) } diff --git a/pkg/serverless/otlp/otlp.go b/pkg/serverless/otlp/otlp.go index 0efb26bb4f23c..19f7c7847111e 100644 --- a/pkg/serverless/otlp/otlp.go +++ b/pkg/serverless/otlp/otlp.go @@ -15,6 +15,7 @@ import ( "go.opentelemetry.io/collector/otelcol" + tagger "github.com/DataDog/datadog-agent/comp/core/tagger/def" coreOtlp "github.com/DataDog/datadog-agent/comp/otelcol/otlp" "github.com/DataDog/datadog-agent/comp/otelcol/otlp/configcheck" pkgconfigsetup "github.com/DataDog/datadog-agent/pkg/config/setup" @@ -29,8 +30,8 @@ type ServerlessOTLPAgent struct { // NewServerlessOTLPAgent creates a new ServerlessOTLPAgent with the correct // otel pipeline. -func NewServerlessOTLPAgent(serializer serializer.MetricSerializer) *ServerlessOTLPAgent { - pipeline, err := coreOtlp.NewPipelineFromAgentConfig(pkgconfigsetup.Datadog(), serializer, nil, nil) +func NewServerlessOTLPAgent(serializer serializer.MetricSerializer, tagger tagger.Component) *ServerlessOTLPAgent { + pipeline, err := coreOtlp.NewPipelineFromAgentConfig(pkgconfigsetup.Datadog(), serializer, nil, tagger) if err != nil { log.Error("Error creating new otlp pipeline:", err) return nil diff --git a/pkg/serverless/otlp/otlp_no_otlp.go b/pkg/serverless/otlp/otlp_no_otlp.go index 761639bed48b0..fe953d1a75543 100644 --- a/pkg/serverless/otlp/otlp_no_otlp.go +++ b/pkg/serverless/otlp/otlp_no_otlp.go @@ -8,13 +8,16 @@ //nolint:revive // TODO(SERV) Fix revive linter package otlp -import "github.com/DataDog/datadog-agent/pkg/serializer" +import ( + tagger "github.com/DataDog/datadog-agent/comp/core/tagger/def" + "github.com/DataDog/datadog-agent/pkg/serializer" +) //nolint:revive // TODO(SERV) Fix revive linter type ServerlessOTLPAgent struct{} //nolint:revive // TODO(SERV) Fix revive linter -func NewServerlessOTLPAgent(serializer.MetricSerializer) *ServerlessOTLPAgent { +func NewServerlessOTLPAgent(serializer.MetricSerializer, tagger.Component) *ServerlessOTLPAgent { return nil } diff --git a/pkg/serverless/otlp/otlp_test.go b/pkg/serverless/otlp/otlp_test.go index b7851f4488e14..e7481a198b433 100644 --- a/pkg/serverless/otlp/otlp_test.go +++ b/pkg/serverless/otlp/otlp_test.go @@ -21,11 +21,13 @@ import ( "go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp" sdktrace "go.opentelemetry.io/otel/sdk/trace" + "github.com/stretchr/testify/assert" + + taggernoop "github.com/DataDog/datadog-agent/comp/core/tagger/impl-noop" pb "github.com/DataDog/datadog-agent/pkg/proto/pbgo/trace" "github.com/DataDog/datadog-agent/pkg/serverless/metrics" "github.com/DataDog/datadog-agent/pkg/serverless/trace" "github.com/DataDog/datadog-agent/pkg/trace/testutil" - "github.com/stretchr/testify/assert" ) func TestMain(m *testing.M) { @@ -84,7 +86,7 @@ func TestServerlessOTLPAgentReceivesTraces(t *testing.T) { assert.True(metricAgent.IsReady()) // setup otlp agent - otlpAgent := NewServerlessOTLPAgent(metricAgent.Demux.Serializer()) + otlpAgent := NewServerlessOTLPAgent(metricAgent.Demux.Serializer(), taggernoop.NewComponent()) otlpAgent.Start() defer otlpAgent.Stop() assert.NotNil(otlpAgent.pipeline) diff --git a/pkg/serverless/proxy/proxy.go b/pkg/serverless/proxy/proxy.go index 7d43dd36db257..1f8a2e3087658 100644 --- a/pkg/serverless/proxy/proxy.go +++ b/pkg/serverless/proxy/proxy.go @@ -8,6 +8,7 @@ package proxy import ( "context" + "errors" "net/http" "net/http/httputil" "net/url" @@ -68,9 +69,44 @@ func newProxy(target string, processor invocationlifecycle.InvocationProcessor) Scheme: "http", Host: target, } + proxy := httputil.NewSingleHostReverseProxy(url) + + // The default error handler logs "http: proxy error: %v" then returns an HTTP 502 (bad gateway) + // response. This is unfortunate because it lacks much any context on the original request that + // failed, and the commonly observed error today is "context deadline exceeded", which is not + // actionnable if you don't know what request it was for. It also logs to STDERR and does not + // honor the agent's log level. + proxy.ErrorHandler = func(w http.ResponseWriter, r *http.Request, err error) { + log.Debugf( + "[serverless/proxy][%T] %s %s -- proxy error: %v", + // The dynamic type of processor informs about what kind of proxy this was (main/appsec) + processor, + // The request method and URL are useful to understand what exactly failed. We won't log + // the body (too large) or headers (risks containing sensitive data, such as API keys) + r.Method, r.URL, + // What happened that caused us to be called? + err, + ) + + // If the error is a [context.DeadlineExceeded], we return an HTTP 504 (gateway timeout) + // instead of the generic HTTP 502 (bad gateway) to give the client a better idea of what is + // going on (this may influence retry behavior, for example). + if errors.Is(err, context.DeadlineExceeded) { + w.WriteHeader(http.StatusGatewayTimeout) + } else { + // Return an HTTP 502 (bad gateway) error response; defer the retrying to the client. + w.WriteHeader(http.StatusBadGateway) + } + + // Writing the error message as best-effort, we simply debug-log any error that occur here. + if _, err := w.Write([]byte(err.Error())); err != nil { + log.Debugf("[serverless/proxy][%T] failed to write error message to response body: %v", processor, err) + } + } + return &runtimeProxy{ target: url, - proxy: httputil.NewSingleHostReverseProxy(url), + proxy: proxy, processor: processor, } } diff --git a/pkg/snmp/gosnmplib/gosnmp_log_test.go b/pkg/snmp/gosnmplib/gosnmp_log_test.go index 264c81142d427..30394a680cc13 100644 --- a/pkg/snmp/gosnmplib/gosnmp_log_test.go +++ b/pkg/snmp/gosnmplib/gosnmp_log_test.go @@ -10,7 +10,6 @@ import ( "bytes" "testing" - "github.com/cihub/seelog" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -92,7 +91,7 @@ func TestTraceLevelLogWriter_Write(t *testing.T) { t.Run(tt.name, func(t *testing.T) { var b bytes.Buffer w := bufio.NewWriter(&b) - l, err := seelog.LoggerFromWriterWithMinLevelAndFormat(w, seelog.TraceLvl, "[%LEVEL] %FuncShort: %Msg") + l, err := log.LoggerFromWriterWithMinLevelAndFormat(w, log.TraceLvl, "[%LEVEL] %FuncShort: %Msg") require.NoError(t, err) log.SetupLogger(l, "trace") diff --git a/pkg/snmp/snmp.go b/pkg/snmp/snmp.go index 8e63ad76a6d3e..db35905dbabf5 100644 --- a/pkg/snmp/snmp.go +++ b/pkg/snmp/snmp.go @@ -95,6 +95,9 @@ type intOrBoolPtr interface { *int | *bool } +// ErrNoConfigGiven is returned when the SNMP listener config was not found +var ErrNoConfigGiven = errors.New("no config given for snmp_listener") + // NewListenerConfig parses configuration and returns a built ListenerConfig func NewListenerConfig() (ListenerConfig, error) { var snmpConfig ListenerConfig @@ -114,7 +117,7 @@ func NewListenerConfig() (ListenerConfig, error) { return snmpConfig, err } } else { - return snmpConfig, errors.New("no config given for snmp_listener") + return snmpConfig, ErrNoConfigGiven } if snmpConfig.AllowedFailures == 0 && snmpConfig.AllowedFailuresLegacy != 0 { diff --git a/pkg/status/systemprobe/status.go b/pkg/status/systemprobe/status.go index 533b94e1f3981..c6cb485094974 100644 --- a/pkg/status/systemprobe/status.go +++ b/pkg/status/systemprobe/status.go @@ -3,8 +3,6 @@ // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2016-present Datadog, Inc. -//go:build process - // Package systemprobe fetch information about the system probe package systemprobe diff --git a/pkg/status/systemprobe/status_unsupported.go b/pkg/status/systemprobe/status_unsupported.go deleted file mode 100644 index 31c2523258659..0000000000000 --- a/pkg/status/systemprobe/status_unsupported.go +++ /dev/null @@ -1,26 +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 !process - -// Package systemprobe fetch information about the system probe -package systemprobe - -import ( - "github.com/DataDog/datadog-agent/comp/core/status" - "github.com/DataDog/datadog-agent/comp/core/sysprobeconfig" -) - -// GetStatus returns a notice that it is not supported on systems that do not at least build the process agent -func GetStatus(stats map[string]interface{}, _ string) { - stats["systemProbeStats"] = map[string]interface{}{ - "Errors": "System Probe is not supported on this system", - } -} - -// GetProvider returns nil -func GetProvider(_ sysprobeconfig.Component) status.Provider { - return nil -} diff --git a/pkg/telemetry/go.mod b/pkg/telemetry/go.mod index d50e41412bcc8..6b727ea0cfd97 100644 --- a/pkg/telemetry/go.mod +++ b/pkg/telemetry/go.mod @@ -36,7 +36,7 @@ require ( go.uber.org/fx v1.23.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect - golang.org/x/sys v0.27.0 // indirect + golang.org/x/sys v0.28.0 // indirect google.golang.org/protobuf v1.35.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/pkg/telemetry/go.sum b/pkg/telemetry/go.sum index a634eb0726e6e..6ba871b73d5aa 100644 --- a/pkg/telemetry/go.sum +++ b/pkg/telemetry/go.sum @@ -50,8 +50,8 @@ go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.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= google.golang.org/protobuf v1.35.2 h1:8Ar7bF+apOIoThw1EdZl0p1oWvMqTHmpA2fRTyZO8io= google.golang.org/protobuf v1.35.2/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/pkg/trace/api/api.go b/pkg/trace/api/api.go index c74ecbb137fb9..5cb57d2478a27 100644 --- a/pkg/trace/api/api.go +++ b/pkg/trace/api/api.go @@ -141,7 +141,7 @@ func NewHTTPReceiver( } } log.Infof("Receiver configured with %d decoders and a timeout of %dms", semcount, conf.DecoderTimeout) - containerIDProvider := NewIDProvider(conf.ContainerProcRoot) + containerIDProvider := NewIDProvider(conf.ContainerProcRoot, conf.ContainerIDFromOriginInfo) telemetryForwarder := NewTelemetryForwarder(conf, containerIDProvider, statsd) return &HTTPReceiver{ Stats: info.NewReceiverStats(), diff --git a/pkg/trace/api/api_test.go b/pkg/trace/api/api_test.go index 9a468dc164487..3d43d0dbe3c6e 100644 --- a/pkg/trace/api/api_test.go +++ b/pkg/trace/api/api_test.go @@ -19,6 +19,7 @@ import ( "testing" "time" + "github.com/DataDog/datadog-agent/comp/core/tagger/origindetection" pb "github.com/DataDog/datadog-agent/pkg/proto/pbgo/trace" "github.com/DataDog/datadog-agent/pkg/trace/api/internal/header" "github.com/DataDog/datadog-agent/pkg/trace/config" @@ -576,7 +577,9 @@ func TestDecodeV05(t *testing.T) { req, err := http.NewRequest("POST", "/v0.5/traces", bytes.NewReader(b)) assert.NoError(err) req.Header.Set(header.ContainerID, "abcdef123789456") - tp, err := decodeTracerPayload(v05, req, NewIDProvider(""), "python", "3.8.1", "1.2.3") + tp, err := decodeTracerPayload(v05, req, NewIDProvider("", func(_ origindetection.OriginInfo) (string, error) { + return "abcdef123789456", nil + }), "python", "3.8.1", "1.2.3") assert.NoError(err) assert.EqualValues(tp, &pb.TracerPayload{ ContainerID: "abcdef123789456", @@ -1039,14 +1042,26 @@ func TestExpvar(t *testing.T) { } c := newTestReceiverConfig() - c.DebugServerPort = 5012 + c.DebugServerPort = 6789 info.InitInfo(c) + + // Starting a TLS httptest server to retrieve tlsCert + ts := httptest.NewTLSServer(http.HandlerFunc(func(_ http.ResponseWriter, _ *http.Request) {})) + tlsConfig := ts.TLS.Clone() + // Setting a client with the proper TLS configuration + client := ts.Client() + ts.Close() + + // Starting Debug Server s := NewDebugServer(c) + s.SetTLSConfig(tlsConfig) + + // Starting the Debug server s.Start() defer s.Stop() - resp, err := http.Get("http://127.0.0.1:5012/debug/vars") - assert.NoError(t, err) + resp, err := client.Get(fmt.Sprintf("https://127.0.0.1:%d/debug/vars", c.DebugServerPort)) + require.NoError(t, err) defer resp.Body.Close() t.Run("read-expvars", func(t *testing.T) { diff --git a/pkg/trace/api/container.go b/pkg/trace/api/container.go index 508277c5abaf9..0c789f9d06ca7 100644 --- a/pkg/trace/api/container.go +++ b/pkg/trace/api/container.go @@ -12,6 +12,7 @@ import ( "net" "net/http" + "github.com/DataDog/datadog-agent/comp/core/tagger/origindetection" "github.com/DataDog/datadog-agent/pkg/trace/api/internal/header" ) @@ -28,7 +29,7 @@ type IDProvider interface { type idProvider struct{} // NewIDProvider initializes an IDProvider instance, in non-linux environments the procRoot arg is unused. -func NewIDProvider(_ string) IDProvider { +func NewIDProvider(_ string, _ func(originInfo origindetection.OriginInfo) (string, error)) IDProvider { return &idProvider{} } diff --git a/pkg/trace/api/container_linux.go b/pkg/trace/api/container_linux.go index 2129a6377c97f..6dd12d227894d 100644 --- a/pkg/trace/api/container_linux.go +++ b/pkg/trace/api/container_linux.go @@ -18,6 +18,7 @@ import ( "syscall" "time" + "github.com/DataDog/datadog-agent/comp/core/tagger/origindetection" "github.com/DataDog/datadog-agent/pkg/trace/api/internal/header" "github.com/DataDog/datadog-agent/pkg/util/cgroups" "github.com/DataDog/datadog-agent/pkg/util/log" @@ -96,7 +97,7 @@ func (i *noCgroupsProvider) GetContainerID(_ context.Context, h http.Header) str } // NewIDProvider initializes an IDProvider instance using the provided procRoot to perform cgroups lookups in linux environments. -func NewIDProvider(procRoot string) IDProvider { +func NewIDProvider(procRoot string, containerIDFromOriginInfo func(originInfo origindetection.OriginInfo) (string, error)) IDProvider { // taken from pkg/util/containers/metrics/system.collector_linux.go var hostPrefix string if strings.HasPrefix(procRoot, "/host") { @@ -120,10 +121,11 @@ func NewIDProvider(procRoot string) IDProvider { } c := NewCache(1 * time.Minute) return &cgroupIDProvider{ - procRoot: procRoot, - controller: cgroupController, - cache: c, - reader: reader, + procRoot: procRoot, + controller: cgroupController, + cache: c, + reader: reader, + containerIDFromOriginInfo: containerIDFromOriginInfo, } } @@ -131,8 +133,9 @@ type cgroupIDProvider struct { procRoot string controller string // reader is used to retrieve the container ID from its cgroup v2 inode. - reader *cgroups.Reader - cache *Cache + reader *cgroups.Reader + cache *Cache + containerIDFromOriginInfo func(originInfo origindetection.OriginInfo) (string, error) } // GetContainerID returns the container ID. @@ -157,6 +160,11 @@ func (c *cgroupIDProvider) GetContainerID(ctx context.Context, h http.Header) st return containerID } + // Retrieve container ID from External Data header + if externalData := h.Get(header.ExternalData); externalData != "" { + return c.resolveContainerIDFromExternalData(externalData) + } + return "" } @@ -296,6 +304,27 @@ func (c *cgroupIDProvider) getCachedContainerID(key string, retrievalFunc func() return val, nil } +// resolveContainerIDFromExternalData returns the container ID for the given External Data. +func (c *cgroupIDProvider) resolveContainerIDFromExternalData(rawExternalData string) string { + var generatedContainerID string + + externalData, err := origindetection.ParseExternalData(rawExternalData) + if err != nil { + log.Errorf("Could not parse external data (%s): %v", rawExternalData, err) + return "" + } + generatedContainerID, err = c.containerIDFromOriginInfo(origindetection.OriginInfo{ + ExternalData: externalData, + ProductOrigin: origindetection.ProductOriginAPM, + }) + if err != nil { + log.Errorf("Could not generate container ID from external data (%s): %v", rawExternalData, err) + return "" + } + + return generatedContainerID +} + // The below cache is copied from /pkg/util/containers/v2/metrics/provider/cache.go. It is not // imported to avoid making the datadog-agent module a dependency of the pkg/trace module. The // datadog-agent module contains replace directives which are not inherited by packages that diff --git a/pkg/trace/api/debug_server.go b/pkg/trace/api/debug_server.go index 828d5357330eb..6fd2f39cc011a 100644 --- a/pkg/trace/api/debug_server.go +++ b/pkg/trace/api/debug_server.go @@ -9,6 +9,7 @@ package api import ( "context" + "crypto/tls" "expvar" "fmt" "net" @@ -29,9 +30,10 @@ const ( // DebugServer serves /debug/* endpoints type DebugServer struct { - conf *config.AgentConfig - server *http.Server - mux *http.ServeMux + conf *config.AgentConfig + server *http.Server + mux *http.ServeMux + tlsConfig *tls.Config } // NewDebugServer returns a debug server @@ -53,13 +55,14 @@ func (ds *DebugServer) Start() { WriteTimeout: defaultTimeout, Handler: ds.setupMux(), } - listener, err := net.Listen("tcp", fmt.Sprintf("127.0.0.1:%d", ds.conf.DebugServerPort)) + listener, err := net.Listen("tcp", net.JoinHostPort("127.0.0.1", strconv.Itoa(ds.conf.DebugServerPort))) if err != nil { log.Errorf("Error creating debug server listener: %s", err) return } + tlsListener := tls.NewListener(listener, ds.tlsConfig) go func() { - if err := ds.server.Serve(listener); err != nil && err != http.ErrServerClosed { + if err := ds.server.Serve(tlsListener); err != nil && err != http.ErrServerClosed { log.Errorf("Could not start debug server: %s. Debug server disabled.", err) } }() @@ -82,6 +85,11 @@ func (ds *DebugServer) AddRoute(route string, handler http.Handler) { ds.mux.Handle(route, handler) } +// SetTLSConfig adds the provided tls.Config to the internal http.Server +func (ds *DebugServer) SetTLSConfig(config *tls.Config) { + ds.tlsConfig = config +} + func (ds *DebugServer) setupMux() *http.ServeMux { ds.mux.HandleFunc("/debug/pprof/", pprof.Index) ds.mux.HandleFunc("/debug/pprof/cmdline", pprof.Cmdline) diff --git a/pkg/trace/api/debugger.go b/pkg/trace/api/debugger.go index 61164f1d3ed02..51816276a3f3b 100644 --- a/pkg/trace/api/debugger.go +++ b/pkg/trace/api/debugger.go @@ -81,7 +81,7 @@ func debuggerErrorHandler(err error) http.Handler { // newDebuggerProxy returns a new httputil.ReverseProxy proxying and augmenting requests with headers containing the tags. func newDebuggerProxy(conf *config.AgentConfig, transport http.RoundTripper, hostTags string) *httputil.ReverseProxy { - cidProvider := NewIDProvider(conf.ContainerProcRoot) + cidProvider := NewIDProvider(conf.ContainerProcRoot, conf.ContainerIDFromOriginInfo) logger := log.NewThrottled(5, 10*time.Second) // limit to 5 messages every 10 seconds return &httputil.ReverseProxy{ Director: getDirector(hostTags, cidProvider, conf.ContainerTags), diff --git a/pkg/trace/api/evp_proxy.go b/pkg/trace/api/evp_proxy.go index 452d73017aa8d..2795e6304b605 100644 --- a/pkg/trace/api/evp_proxy.go +++ b/pkg/trace/api/evp_proxy.go @@ -86,7 +86,7 @@ func evpProxyForwarder(conf *config.AgentConfig, statsd statsd.ClientInterface) req.Header["X-Forwarded-For"] = nil }, ErrorLog: logger, - Transport: &evpProxyTransport{conf.NewHTTPTransport(), endpoints, conf, NewIDProvider(conf.ContainerProcRoot), statsd}, + Transport: &evpProxyTransport{conf.NewHTTPTransport(), endpoints, conf, NewIDProvider(conf.ContainerProcRoot, conf.ContainerIDFromOriginInfo), statsd}, } } diff --git a/pkg/trace/api/internal/header/headers.go b/pkg/trace/api/internal/header/headers.go index 8ae458be834f5..88cb3549b2836 100644 --- a/pkg/trace/api/internal/header/headers.go +++ b/pkg/trace/api/internal/header/headers.go @@ -25,6 +25,16 @@ const ( // * "ci-,in-" LocalData = "Datadog-Entity-ID" + // ExternalData is a list that contain prefixed-items, split by a ','. Current items are: + // * "it-" if the container is an init container. + // * "cn-" for the container name. + // * "pu-" for the pod UID. + // Order does not matter. + // Possible values: + // * "it-false,cn-nginx,pu-3413883c-ac60-44ab-96e0-9e52e4e173e2" + // * "cn-init,pu-cb4aba1d-0129-44f1-9f1b-b4dc5d29a3b3,it-true" + ExternalData = "Datadog-External-Env" + // Lang specifies the name of the header which contains the language from // which the traces originate. Lang = "Datadog-Meta-Lang" diff --git a/pkg/trace/api/otlp.go b/pkg/trace/api/otlp.go index de53f14d369ec..eb136d267e090 100644 --- a/pkg/trace/api/otlp.go +++ b/pkg/trace/api/otlp.go @@ -9,7 +9,6 @@ import ( "context" "encoding/hex" "fmt" - "github.com/DataDog/datadog-agent/pkg/trace/transform" "math" "net" "net/http" @@ -26,6 +25,7 @@ import ( "github.com/DataDog/datadog-agent/pkg/trace/sampler" "github.com/DataDog/datadog-agent/pkg/trace/timing" "github.com/DataDog/datadog-agent/pkg/trace/traceutil" + "github.com/DataDog/datadog-agent/pkg/trace/transform" "github.com/DataDog/datadog-go/v5/statsd" "github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes" @@ -102,7 +102,7 @@ func NewOTLPReceiver(out chan<- *Payload, cfg *config.AgentConfig, statsd statsd enableReceiveResourceSpansV2Val = 1.0 } _ = statsd.Gauge("datadog.trace_agent.otlp.enable_receive_resource_spans_v2", enableReceiveResourceSpansV2Val, nil, 1) - return &OTLPReceiver{out: out, conf: cfg, cidProvider: NewIDProvider(cfg.ContainerProcRoot), statsd: statsd, timing: timing, ignoreResNames: ignoreResNames} + return &OTLPReceiver{out: out, conf: cfg, cidProvider: NewIDProvider(cfg.ContainerProcRoot, cfg.ContainerIDFromOriginInfo), statsd: statsd, timing: timing, ignoreResNames: ignoreResNames} } // Start starts the OTLPReceiver, if any of the servers were configured as active. @@ -684,6 +684,13 @@ func resourceFromTags(meta map[string]string) string { return m + " " + svc } return m + } else if typ := meta[semconv117.AttributeGraphqlOperationType]; typ != "" { + // Enrich GraphQL query resource names. + // See https://github.com/open-telemetry/semantic-conventions/blob/v1.29.0/docs/graphql/graphql-spans.md + if name := meta[semconv117.AttributeGraphqlOperationName]; name != "" { + return typ + " " + name + } + return typ } return "" } diff --git a/pkg/trace/api/otlp_test.go b/pkg/trace/api/otlp_test.go index bd6377ff4612d..0966ee75ff1e9 100644 --- a/pkg/trace/api/otlp_test.go +++ b/pkg/trace/api/otlp_test.go @@ -1573,6 +1573,18 @@ func TestOTLPHelpers(t *testing.T) { meta: map[string]string{semconv.AttributeRPCMethod: "M"}, out: "M", }, + { + meta: map[string]string{"graphql.operation.name": "myQuery"}, + out: "", + }, + { + meta: map[string]string{"graphql.operation.type": "query"}, + out: "query", + }, + { + meta: map[string]string{"graphql.operation.type": "query", "graphql.operation.name": "myQuery"}, + out: "query myQuery", + }, } { assert.Equal(t, tt.out, resourceFromTags(tt.meta)) } diff --git a/pkg/trace/api/pipeline_stats.go b/pkg/trace/api/pipeline_stats.go index b6fe3f2cd161c..b8daf12590bf7 100644 --- a/pkg/trace/api/pipeline_stats.go +++ b/pkg/trace/api/pipeline_stats.go @@ -71,7 +71,7 @@ func pipelineStatsErrorHandler(err error) http.Handler { // The tags will be added as a header to all proxied requests. func newPipelineStatsProxy(conf *config.AgentConfig, urls []*url.URL, apiKeys []string, tags string, statsd statsd.ClientInterface) *httputil.ReverseProxy { log.Debug("[pipeline_stats] Creating reverse proxy") - cidProvider := NewIDProvider(conf.ContainerProcRoot) + cidProvider := NewIDProvider(conf.ContainerProcRoot, conf.ContainerIDFromOriginInfo) director := func(req *http.Request) { req.Header.Set("Via", fmt.Sprintf("trace-agent %s", conf.AgentVersion)) if _, ok := req.Header["User-Agent"]; !ok { diff --git a/pkg/trace/api/profiles.go b/pkg/trace/api/profiles.go index 9b43efc94de74..19add3e307daa 100644 --- a/pkg/trace/api/profiles.go +++ b/pkg/trace/api/profiles.go @@ -109,7 +109,7 @@ func errorHandler(err error) http.Handler { // The tags will be added as a header to all proxied requests. // For more details please see multiTransport. func newProfileProxy(conf *config.AgentConfig, targets []*url.URL, keys []string, tags string, statsd statsd.ClientInterface) *httputil.ReverseProxy { - cidProvider := NewIDProvider(conf.ContainerProcRoot) + cidProvider := NewIDProvider(conf.ContainerProcRoot, conf.ContainerIDFromOriginInfo) director := func(req *http.Request) { req.Header.Set("Via", fmt.Sprintf("trace-agent %s", conf.AgentVersion)) if _, ok := req.Header["User-Agent"]; !ok { diff --git a/pkg/trace/api/symdb.go b/pkg/trace/api/symdb.go index 31b96c494ce5f..b238b478eb65c 100644 --- a/pkg/trace/api/symdb.go +++ b/pkg/trace/api/symdb.go @@ -62,7 +62,7 @@ func symDBErrorHandler(err error) http.Handler { // newSymDBProxy returns a new httputil.ReverseProxy proxying and augmenting requests with headers containing the tags. func newSymDBProxy(conf *config.AgentConfig, transport http.RoundTripper, hostTags string) *httputil.ReverseProxy { - cidProvider := NewIDProvider(conf.ContainerProcRoot) + cidProvider := NewIDProvider(conf.ContainerProcRoot, conf.ContainerIDFromOriginInfo) logger := log.NewThrottled(5, 10*time.Second) // limit to 5 messages every 10 seconds return &httputil.ReverseProxy{ Director: getSymDBDirector(hostTags, cidProvider, conf.ContainerTags), diff --git a/pkg/trace/config/config.go b/pkg/trace/config/config.go index 5d0e59f059e39..cbf0b0ea5c3a3 100644 --- a/pkg/trace/config/config.go +++ b/pkg/trace/config/config.go @@ -17,6 +17,7 @@ import ( "github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes" + "github.com/DataDog/datadog-agent/comp/core/tagger/origindetection" "github.com/DataDog/datadog-agent/pkg/obfuscate" "github.com/DataDog/datadog-agent/pkg/remoteconfig/state" "github.com/DataDog/datadog-agent/pkg/trace/log" @@ -445,6 +446,9 @@ type AgentConfig struct { // ContainerTags ... ContainerTags func(cid string) ([]string, error) `json:"-"` + // ContainerIDFromOriginInfo ... + ContainerIDFromOriginInfo func(originInfo origindetection.OriginInfo) (string, error) `json:"-"` + // ContainerProcRoot is the root dir for `proc` info ContainerProcRoot string diff --git a/pkg/trace/go.mod b/pkg/trace/go.mod index bd0db6ed04e59..e0e3ee4906d99 100644 --- a/pkg/trace/go.mod +++ b/pkg/trace/go.mod @@ -20,31 +20,30 @@ require ( github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 github.com/DataDog/datadog-agent/pkg/util/pointer v0.59.0 github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.0 - github.com/DataDog/datadog-go/v5 v5.5.0 - github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.21.0 + github.com/DataDog/datadog-go/v5 v5.6.0 + github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.22.0 github.com/DataDog/sketches-go v1.4.6 github.com/Microsoft/go-winio v0.6.2 - github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 + github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc github.com/golang/mock v1.6.0 github.com/golang/protobuf v1.5.4 github.com/google/go-cmp v0.6.0 github.com/google/gofuzz v1.2.0 github.com/google/uuid v1.6.0 - github.com/open-telemetry/opentelemetry-collector-contrib/processor/probabilisticsamplerprocessor v0.114.0 - github.com/shirou/gopsutil/v3 v3.24.4 + github.com/open-telemetry/opentelemetry-collector-contrib/processor/probabilisticsamplerprocessor v0.115.0 github.com/stretchr/testify v1.10.0 github.com/tinylib/msgp v1.2.4 github.com/vmihailenco/msgpack/v4 v4.3.13 - go.opentelemetry.io/collector/component v0.114.0 // indirect - go.opentelemetry.io/collector/consumer v0.114.0 - go.opentelemetry.io/collector/pdata v1.20.0 - go.opentelemetry.io/collector/processor/processortest v0.114.0 - go.opentelemetry.io/collector/semconv v0.114.0 + go.opentelemetry.io/collector/component v0.115.0 // indirect + go.opentelemetry.io/collector/consumer v1.21.0 + go.opentelemetry.io/collector/pdata v1.21.0 + go.opentelemetry.io/collector/processor/processortest v0.115.0 + go.opentelemetry.io/collector/semconv v0.115.0 go.opentelemetry.io/otel v1.32.0 go.opentelemetry.io/otel/metric v1.32.0 go.uber.org/atomic v1.11.0 - golang.org/x/sys v0.27.0 + golang.org/x/sys v0.28.0 golang.org/x/time v0.8.0 google.golang.org/grpc v1.67.1 google.golang.org/protobuf v1.35.2 @@ -52,11 +51,16 @@ require ( k8s.io/apimachinery v0.31.2 ) -require go.opentelemetry.io/collector/component/componenttest v0.114.0 +require ( + github.com/DataDog/datadog-agent/comp/core/tagger/origindetection v0.0.0-20241217122454-175edb6c74f2 + github.com/shirou/gopsutil/v4 v4.24.11 + go.opentelemetry.io/collector/component/componenttest v0.115.0 +) -require go.opentelemetry.io/collector/processor v0.114.0 // indirect +require go.opentelemetry.io/collector/processor v0.115.0 // indirect require ( + github.com/DataDog/datadog-agent/pkg/version v0.59.1 // indirect github.com/DataDog/go-sqllexer v0.0.17 // indirect github.com/DataDog/go-tuf v1.1.0-0.5.2 // indirect github.com/DataDog/zstd v1.5.6 // indirect @@ -65,6 +69,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 @@ -76,43 +81,42 @@ require ( github.com/moby/sys/userns v0.1.0 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/sampling v0.114.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/sampling v0.115.0 // indirect github.com/opencontainers/runtime-spec v1.2.0 // indirect github.com/outcaste-io/ristretto v0.2.3 // indirect github.com/philhofer/fwd v1.1.3-0.20240916144458-20a13a1f6b7c // indirect github.com/pkg/errors v0.9.1 // indirect + github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // 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/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 github.com/yusufpapurcu/wmi v1.2.4 // indirect - go.opentelemetry.io/collector/component/componentstatus v0.114.0 // indirect - go.opentelemetry.io/collector/config/configtelemetry v0.114.0 // indirect - go.opentelemetry.io/collector/consumer/consumerprofiles v0.114.0 // indirect - go.opentelemetry.io/collector/consumer/consumertest v0.114.0 // indirect - go.opentelemetry.io/collector/pdata/pprofile v0.114.0 // indirect - go.opentelemetry.io/collector/pdata/testdata v0.114.0 // indirect - go.opentelemetry.io/collector/pipeline v0.114.0 // indirect - go.opentelemetry.io/collector/processor/processorprofiles v0.114.0 // indirect + go.opentelemetry.io/collector/component/componentstatus v0.115.0 // indirect + go.opentelemetry.io/collector/config/configtelemetry v0.115.0 // indirect + go.opentelemetry.io/collector/consumer/consumerprofiles v0.115.0 // indirect + go.opentelemetry.io/collector/consumer/consumertest v0.115.0 // indirect + go.opentelemetry.io/collector/pdata/pprofile v0.115.0 // indirect + go.opentelemetry.io/collector/pdata/testdata v0.115.0 // indirect + go.opentelemetry.io/collector/pipeline v0.115.0 // indirect + go.opentelemetry.io/collector/processor/processorprofiles v0.115.0 // indirect go.opentelemetry.io/otel/sdk v1.32.0 // indirect go.opentelemetry.io/otel/sdk/metric v1.32.0 // indirect go.opentelemetry.io/otel/trace v1.32.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect - golang.org/x/net v0.31.0 // indirect - golang.org/x/text v0.20.0 // indirect + golang.org/x/net v0.33.0 // indirect + golang.org/x/text v0.21.0 // indirect google.golang.org/appengine v1.6.8 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) replace ( github.com/DataDog/datadog-agent => ../../ + github.com/DataDog/datadog-agent/comp/core/tagger/origindetection => ../../comp/core/tagger/origindetection github.com/DataDog/datadog-agent/comp/trace/compression/def => ../../comp/trace/compression/def github.com/DataDog/datadog-agent/comp/trace/compression/impl-gzip => ../../comp/trace/compression/impl-gzip github.com/DataDog/datadog-agent/comp/trace/compression/impl-zstd => ../../comp/trace/compression/impl-zstd @@ -124,3 +128,5 @@ replace ( github.com/DataDog/datadog-agent/pkg/util/pointer => ../util/pointer github.com/DataDog/datadog-agent/pkg/util/scrubber => ../util/scrubber ) + +replace github.com/DataDog/datadog-agent/pkg/version => ../version diff --git a/pkg/trace/go.sum b/pkg/trace/go.sum index 57f7c4a1dd4a4..44ab376fcf70f 100644 --- a/pkg/trace/go.sum +++ b/pkg/trace/go.sum @@ -1,11 +1,11 @@ -github.com/DataDog/datadog-go/v5 v5.5.0 h1:G5KHeB8pWBNXT4Jtw0zAkhdxEAWSpWH00geHI6LDrKU= -github.com/DataDog/datadog-go/v5 v5.5.0/go.mod h1:K9kcYBlxkcPP8tvvjZZKs/m1edNAUFzBbdpTUKfCsuw= +github.com/DataDog/datadog-go/v5 v5.6.0 h1:2oCLxjF/4htd55piM75baflj/KoE6VYS7alEUqFvRDw= +github.com/DataDog/datadog-go/v5 v5.6.0/go.mod h1:K9kcYBlxkcPP8tvvjZZKs/m1edNAUFzBbdpTUKfCsuw= github.com/DataDog/go-sqllexer v0.0.17 h1:u47fJAVg/+5DA74ZW3w0Qu+3qXHd3GtnA8ZBYixdPrM= github.com/DataDog/go-sqllexer v0.0.17/go.mod h1:KwkYhpFEVIq+BfobkTC1vfqm4gTi65skV/DpDBXtexc= github.com/DataDog/go-tuf v1.1.0-0.5.2 h1:4CagiIekonLSfL8GMHRHcHudo1fQnxELS9g4tiAupQ4= github.com/DataDog/go-tuf v1.1.0-0.5.2/go.mod h1:zBcq6f654iVqmkk8n2Cx81E1JnNTMOAx1UEO/wZR+P0= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.21.0 h1:hgbTFS6SkqbzOiWSfP58dZ/Jpjlmv6dpD4+V4LDHm2Q= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.21.0/go.mod h1:dvIWN9pA2zWNTw5rhDWZgzZnhcfpH++d+8d1SWW6xkY= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.22.0 h1:yfk2cF8Bx98fSFpGrehEHh1FRqewfxcCTAbUDt5r3F8= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.22.0/go.mod h1:9qzpnBSxSOnKzbF/uHket3SSlQihQHix/ZRC2nZUUYQ= 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/zstd v1.5.6 h1:LbEglqepa/ipmmQJUDnSsfvA8e8IStVcGaFWDuxvGOY= @@ -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= @@ -117,12 +115,12 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.114.0 h1:d2wCLlENxH4I2axQWaogivx/5ZIjDYgn9MIf6sFxlJ4= -github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.114.0/go.mod h1:Psyligv8GKL9WI3TraW3BLwkOX4TRxaaa1BBQQyICzA= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/sampling v0.114.0 h1:mtSN/07RGQPi1/zHVSZg4G0qRtOoJpPew5jsQWv9uS0= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/sampling v0.114.0/go.mod h1:C9Zgh/N3j4NR2D+1FGAA1YizhFW9OS51DwLUFJTdXN4= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/probabilisticsamplerprocessor v0.114.0 h1:I4ZYVRYW3Cjb65sPENZ9kHam/JUMXNEp2n/knJ0C0Vc= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/probabilisticsamplerprocessor v0.114.0/go.mod h1:4BhyIaOn2LS48WS+ZNix4TpP0+goq9gDEtGzth5Cr3M= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.115.0 h1:a36EJz/mb83f6ieX0v4fNDJ1jXqpeaM6DVQXeFDvdhw= +github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.115.0/go.mod h1:r5/40YO1eSP5ZreOmRzVOUtDr7YG39ZIUcVjHd+9Izc= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/sampling v0.115.0 h1:R9MRrO+dSkAHBQLZjuwjv2RHXHQqF2Wtm1Ki0VKD5cs= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/sampling v0.115.0/go.mod h1:rKXLXmwdUVcUHwTilroKSejbg3KSwLeYzNPSpkIEnv4= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/probabilisticsamplerprocessor v0.115.0 h1:vwZQ7k8oqlK0bdZYTsjP/59zjQQfjSD4fNsWIWsTu2w= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/probabilisticsamplerprocessor v0.115.0/go.mod h1:5ObSa9amrbzbYTdAK1Qhv3D/YqCxxnQhP0sk2eWB7Oo= github.com/opencontainers/runtime-spec v1.2.0 h1:z97+pHb3uELt/yiAWD691HNHQIF07bE7dzrbT927iTk= github.com/opencontainers/runtime-spec v1.2.0/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/outcaste-io/ristretto v0.2.3 h1:AK4zt/fJ76kjlYObOeNwh4T3asEuaCmp26pOvUOL9w0= @@ -131,10 +129,11 @@ github.com/philhofer/fwd v1.1.3-0.20240916144458-20a13a1f6b7c h1:dAMKvw0MlJT1Gsh github.com/philhofer/fwd v1.1.3-0.20240916144458-20a13a1f6b7c/go.mod h1:RqIHx9QI14HlwKwm98g9Re5prTQ6LdeRQn+gXJFxsJM= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 h1:GFCKgmp0tecUJ0sJuv4pzYCqS9+RGSn52M3FUwPs+uo= +github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10/go.mod h1:t/avpk3KcrXxUnYOhZhMXJlSEyie6gQbtLq5NM3loB8= 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 +148,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.10 h1:7VOzPtfw/5YDU+jLEoBwXwxJbQetULywoSV4RYY7HkM= -github.com/shirou/gopsutil/v4 v4.24.10/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/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/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 +166,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= @@ -197,84 +185,84 @@ github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1 github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0= github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= -go.opentelemetry.io/collector/component v0.114.0 h1:SVGbm5LvHGSTEDv7p92oPuBgK5tuiWR82I9+LL4TtBE= -go.opentelemetry.io/collector/component v0.114.0/go.mod h1:MLxtjZ6UVHjDxSdhGLuJfHBHvfl1iT/Y7IaQPD24Eww= -go.opentelemetry.io/collector/component/componentstatus v0.114.0 h1:y9my/xink8KB5lK8zFAjgB2+pEh0QYy5TM972fxZY9w= -go.opentelemetry.io/collector/component/componentstatus v0.114.0/go.mod h1:RIoeCYZpPaae7QLE/1RacqzhHuXBmzRAk9H/EwYtIIs= -go.opentelemetry.io/collector/component/componenttest v0.114.0 h1:GM4FTTlfeXoVm6sZYBHImwlRN8ayh2oAfUhvaFj7Zo8= -go.opentelemetry.io/collector/component/componenttest v0.114.0/go.mod h1:ZZEJMtbJtoVC/3/9R1HzERq+cYQRxuMFQrPCpfZ4Xos= -go.opentelemetry.io/collector/config/configtelemetry v0.114.0 h1:kjLeyrumge6wsX6ZIkicdNOlBXaEyW2PI2ZdVXz/rzY= -go.opentelemetry.io/collector/config/configtelemetry v0.114.0/go.mod h1:R0MBUxjSMVMIhljuDHWIygzzJWQyZHXXWIgQNxcFwhc= -go.opentelemetry.io/collector/confmap v1.20.0 h1:ARfOwmkKxFOud1njl03yAHQ30+uenlzqCO6LBYamDTE= -go.opentelemetry.io/collector/confmap v1.20.0/go.mod h1:DMpd9Ay/ffls3JoQBQ73vWeRsz1rNuLbwjo6WtjSQus= -go.opentelemetry.io/collector/confmap/provider/envprovider v1.20.0 h1:I3xDecFXJVZBo5zJS7Y5SWBjF22XDWGZJgwotiwA5QM= -go.opentelemetry.io/collector/confmap/provider/envprovider v1.20.0/go.mod h1:CF0l8V8MNv+Wag8UkqObotFnlhMzdTFuk4/6kylKwYU= -go.opentelemetry.io/collector/confmap/provider/fileprovider v1.20.0 h1:wWxvQ7wj+1O9yDGM5m1HPEz8FJewAHAUWadAAi0KVbM= -go.opentelemetry.io/collector/confmap/provider/fileprovider v1.20.0/go.mod h1:/5HWIPjGYk8IUurs1CZUSjGaSsaQyJsfR8+Zs5rGJ6Y= -go.opentelemetry.io/collector/confmap/provider/httpprovider v1.20.0 h1:YS1nB8vDoCS8IlfX5OP3QGS90y/hfflwZ7CoPQcAOlU= -go.opentelemetry.io/collector/confmap/provider/httpprovider v1.20.0/go.mod h1:aV4UfkgcJ3eyXvfd3m694omN++1c96Joitab+YL6Xks= -go.opentelemetry.io/collector/confmap/provider/yamlprovider v1.20.0 h1:jSXTojCPI6Xr98m99nF7qbQFnw3INLEOHRcqcHS+lak= -go.opentelemetry.io/collector/confmap/provider/yamlprovider v1.20.0/go.mod h1:Pu95O2JE3R+0BBTbe4gpAC8ms3w6FbICHJw3WvGWrjs= -go.opentelemetry.io/collector/connector v0.114.0 h1:efGAeTCtg8zp5Hyd7Am8kBUgsSxWEFlFtAu4OX4mcEA= -go.opentelemetry.io/collector/connector v0.114.0/go.mod h1:8DhGgD8RhkF0ooELl4NOPPD/wgHuXHmY7g90RwJ2eNo= -go.opentelemetry.io/collector/connector/connectorprofiles v0.114.0 h1:uVs9gy3UfQBmH0636ouIbGIoWis7zmKN+ny4XOGm36U= -go.opentelemetry.io/collector/connector/connectorprofiles v0.114.0/go.mod h1:X681qFEAsEPMDQ0pMsD/3DqePw58sfLew1QbBKvGnmw= -go.opentelemetry.io/collector/connector/connectortest v0.114.0 h1:Fpy1JHyNOLdVzNcmxUY6Jwxdz6JDcTXL1NCfw8k1AOc= -go.opentelemetry.io/collector/connector/connectortest v0.114.0/go.mod h1:1zaAlODuL9iNyfyjHQeGCpbcaUjf5b68t8LqlwHKBNA= -go.opentelemetry.io/collector/consumer v0.114.0 h1:1zVaHvfIZowGwZRitRBRo3i+RP2StlU+GClYiofSw0Q= -go.opentelemetry.io/collector/consumer v0.114.0/go.mod h1:d+Mrzt9hsH1ub3zmwSlnQVPLeTYir4Mgo7CrWfnncN4= -go.opentelemetry.io/collector/consumer/consumererror v0.114.0 h1:r2YiELfWerb40FHD23V04gNjIkLUcjEKGxI4Vtm2iO4= -go.opentelemetry.io/collector/consumer/consumererror v0.114.0/go.mod h1:MzIrLQ5jptO2egypolhlAbZsWZr29WC4FhSxQjnxcvg= -go.opentelemetry.io/collector/consumer/consumerprofiles v0.114.0 h1:5pXYy3E6UK5Huu3aQbsYL8B6E6MyWx4fvXXDn+oXZaA= -go.opentelemetry.io/collector/consumer/consumerprofiles v0.114.0/go.mod h1:PMq3f54KcJQO4v1tue0QxQScu7REFVADlXxXSAYMiN0= -go.opentelemetry.io/collector/consumer/consumertest v0.114.0 h1:isaTwJK5DOy8Bs7GuLq23ejfgj8gLIo5dOUvkRnLF4g= -go.opentelemetry.io/collector/consumer/consumertest v0.114.0/go.mod h1:GNeLPkfRPdh06n/Rv1UKa/cAtCKjN0a7ADyHjIj4HFE= -go.opentelemetry.io/collector/exporter v0.114.0 h1:5/0BBpXuCJQSQ5SQf31g7j6T4XEKkyx9mZMcA2rS5e8= -go.opentelemetry.io/collector/exporter v0.114.0/go.mod h1:atpd0wWXgh5LAZ0REU/d/Ti/q50HDfnlBIjMjJQlKFg= -go.opentelemetry.io/collector/exporter/exporterprofiles v0.114.0 h1:/wmWOSBHcvtz3Pbv7+rWCqPPQuNvYaoidKKaOqZsLKs= -go.opentelemetry.io/collector/exporter/exporterprofiles v0.114.0/go.mod h1:epRYTkyJZTSQZBJflMGHUyUo2EdLPhsaZEyo5Qm848A= -go.opentelemetry.io/collector/exporter/exportertest v0.114.0 h1:vo0idBJT+QACSM1KpjVLm9VeiXVwO7y4UnMpGxN6EyM= -go.opentelemetry.io/collector/exporter/exportertest v0.114.0/go.mod h1:420ssFrhaphneybstbMeSIiqSRoaBARPgO71O17foaM= -go.opentelemetry.io/collector/extension v0.114.0 h1:9Qb92y8hD2WDC5aMDoj4JNQN+/5BQYJWPUPzLXX+iGw= -go.opentelemetry.io/collector/extension v0.114.0/go.mod h1:Yk2/1ptVgfTr12t+22v93nYJpioP14pURv2YercSzU0= -go.opentelemetry.io/collector/extension/extensioncapabilities v0.114.0 h1:3OHll7gp5XIu7FVgon+koShPy797nze6EjCDokFUG7w= -go.opentelemetry.io/collector/extension/extensioncapabilities v0.114.0/go.mod h1:f0KdeLmE2jWVBmJ1U4WmfAtz1/tQUErGPfhPLKCQ49U= -go.opentelemetry.io/collector/extension/extensiontest v0.114.0 h1:ibXDms1qrswlvlR6b3d2BeyI8sXUXoFV11yOi9Sop8o= -go.opentelemetry.io/collector/extension/extensiontest v0.114.0/go.mod h1:/bOYmqu5yTDfI1bJZUxFqm8ZtmcodpquebiSxiQxtDY= -go.opentelemetry.io/collector/featuregate v1.20.0 h1:Mi7nMy/q52eruI+6jWnMKUOeM55XvwoPnGcdB1++O8c= -go.opentelemetry.io/collector/featuregate v1.20.0/go.mod h1:47xrISO71vJ83LSMm8+yIDsUbKktUp48Ovt7RR6VbRs= -go.opentelemetry.io/collector/internal/fanoutconsumer v0.114.0 h1:JM9huYqy5LTzmuxQmbPST3l5Ez5kJNit28c6WFWls34= -go.opentelemetry.io/collector/internal/fanoutconsumer v0.114.0/go.mod h1:V28tDU4Wvf1PfW1Ty/SBL9tpKul2iYGno/HkCWGDrj0= -go.opentelemetry.io/collector/otelcol v0.114.0 h1:d/nmYc+adzZ70g4zBMtgujGHVNulF59ExCpuM/3ZKV4= -go.opentelemetry.io/collector/otelcol v0.114.0/go.mod h1:DGmFFao5jHSwD6G1HjUjs0CYcyrTau+u7GjTRUGKN+4= -go.opentelemetry.io/collector/otelcol/otelcoltest v0.114.0 h1:Em5e1EgrPrS90EWDWLJHCvyFIDl5PIq1DuW9zd8F3pY= -go.opentelemetry.io/collector/otelcol/otelcoltest v0.114.0/go.mod h1:YAs78SaOJsf1HNWrNH+GFTdkS58dpQI98cok6gZP4Lg= -go.opentelemetry.io/collector/pdata v1.20.0 h1:ePcwt4bdtISP0loHaE+C9xYoU2ZkIvWv89Fob16o9SM= -go.opentelemetry.io/collector/pdata v1.20.0/go.mod h1:Ox1YVLe87cZDB/TL30i4SUz1cA5s6AM6SpFMfY61ICs= -go.opentelemetry.io/collector/pdata/pprofile v0.114.0 h1:pUNfTzsI/JUTiE+DScDM4lsrPoxnVNLI2fbTxR/oapo= -go.opentelemetry.io/collector/pdata/pprofile v0.114.0/go.mod h1:4aNcj6WM1n1uXyFSXlhVs4ibrERgNYsTbzcYI2zGhxA= -go.opentelemetry.io/collector/pdata/testdata v0.114.0 h1:+AzszWSL1i4K6meQ8rU0JDDW55SYCXa6FVqfDixhhTo= -go.opentelemetry.io/collector/pdata/testdata v0.114.0/go.mod h1:bv8XFdCTZxG2MQB5l9dKxSxf5zBrcodwO6JOy1+AxXM= -go.opentelemetry.io/collector/pipeline v0.114.0 h1:v3YOhc5z0tD6QbO5n/pnftpIeroihM2ks9Z2yKPCcwY= -go.opentelemetry.io/collector/pipeline v0.114.0/go.mod h1:4vOvjVsoYTHVGTbfFwqfnQOSV2K3RKUHofh3jNRc2Mg= -go.opentelemetry.io/collector/pipeline/pipelineprofiles v0.114.0 h1:LZgxMQ2zXcz8ILBefhxpZBpn/Rx+TJTncIIQy0LgtgY= -go.opentelemetry.io/collector/pipeline/pipelineprofiles v0.114.0/go.mod h1:bmyqQCJWcA53/GtqZJ2ahwmLdFl6UelFH2nR6OJFqpw= -go.opentelemetry.io/collector/processor v0.114.0 h1:6bqQgLL7BtKrNv4YkEOGjZfkcfZv/ciJSQx1epGG9Zk= -go.opentelemetry.io/collector/processor v0.114.0/go.mod h1:DV/wa+nAmSHIDeD9NblPwkY9PbgtDQAZJ+PE5biZwPc= -go.opentelemetry.io/collector/processor/processorprofiles v0.114.0 h1:+P/1nLouEXTnN8DVQl+qWwO4BTkQyNPG9t/FrpUqrSI= -go.opentelemetry.io/collector/processor/processorprofiles v0.114.0/go.mod h1:3fuHeNIpINwx3bqFMprmDJyr6y5tWoWbJH599kltO5Y= -go.opentelemetry.io/collector/processor/processortest v0.114.0 h1:3FTaVXAp0LoVmUJn1ewBFckAby7AHa6/Kcdj0xuW14c= -go.opentelemetry.io/collector/processor/processortest v0.114.0/go.mod h1:OgsdOs1Fv5ZGTTJPF5nNIUJh2YkuV1acWd73yWgnti4= -go.opentelemetry.io/collector/receiver v0.114.0 h1:90SAnXAjNq7/k52/pFmmb06Cf1YauoPYtbio4aOXafY= -go.opentelemetry.io/collector/receiver v0.114.0/go.mod h1:KUGT0/D953LXbGH/D3lLPU8yrU3HfWnUqpt4W4hSOnE= -go.opentelemetry.io/collector/receiver/receiverprofiles v0.114.0 h1:ibhEfGpvNB3yrtpl2jYFabrunMk1hurxvMYpM0b1Ck4= -go.opentelemetry.io/collector/receiver/receiverprofiles v0.114.0/go.mod h1:UZyRfaasw+NLvN10AN8IQnmj5tQ3BOUH1uP2ctpO9f0= -go.opentelemetry.io/collector/receiver/receivertest v0.114.0 h1:D+Kh9t2n4asTnM+TiSxbrKlUemLZandWntj17BJWWb0= -go.opentelemetry.io/collector/receiver/receivertest v0.114.0/go.mod h1:mNSHQ13vFmqD+VAcRzLjStFBejbcWUn2Mp0pAd7Op+U= -go.opentelemetry.io/collector/semconv v0.114.0 h1:/eKcCJwZepQUtEuFuxa0thx2XIOvhFpaf214ZG1a11k= -go.opentelemetry.io/collector/semconv v0.114.0/go.mod h1:zCJ5njhWpejR+A40kiEoeFm1xq1uzyZwMnRNX6/D82A= -go.opentelemetry.io/collector/service v0.114.0 h1:MYF/4nH1CgtiLx09503xPAAUZefCzG1kaO+oanwX590= -go.opentelemetry.io/collector/service v0.114.0/go.mod h1:xH5/RapJdf5Ohh8iU8J0ZstfFYciP1oJPesiByteZxo= +go.opentelemetry.io/collector/component v0.115.0 h1:iLte1oCiXzjiCnaOBKdsXacfFiECecpWxW3/LeriMoo= +go.opentelemetry.io/collector/component v0.115.0/go.mod h1:oIUFiH7w1eOimdeYhFI+gAIxYSiLDocKVJ0PTvX7d6s= +go.opentelemetry.io/collector/component/componentstatus v0.115.0 h1:pbpUIL+uKDfEiSgKK+S5nuSL6MDIIQYsp4b65ZGVb9M= +go.opentelemetry.io/collector/component/componentstatus v0.115.0/go.mod h1:36A+9XSiOz0Cdhq+UwwPRlEr5CYuSkEnVO9om4BH7d0= +go.opentelemetry.io/collector/component/componenttest v0.115.0 h1:9URDJ9VyP6tuij+YHjp/kSSMecnZOd7oGvzu+rw9SJY= +go.opentelemetry.io/collector/component/componenttest v0.115.0/go.mod h1:PzXvNqKLCiSADZGZFKH+IOHMkaQ0GTHuzysfVbTPKYY= +go.opentelemetry.io/collector/config/configtelemetry v0.115.0 h1:U07FinCDop+r2RjWQ3aP9ZWONC7r7kQIp1GkXQi6nsI= +go.opentelemetry.io/collector/config/configtelemetry v0.115.0/go.mod h1:SlBEwQg0qly75rXZ6W1Ig8jN25KBVBkFIIAUI1GiAAE= +go.opentelemetry.io/collector/confmap v1.21.0 h1:1tIcx2/Suwg8VhuPmQw87ba0ludPmumpFCFRZZa6RXA= +go.opentelemetry.io/collector/confmap v1.21.0/go.mod h1:Rrhs+MWoaP6AswZp+ReQ2VO9dfOfcUjdjiSHBsG+nec= +go.opentelemetry.io/collector/confmap/provider/envprovider v1.21.0 h1:YLf++Z8CMp86AanfOCWUiE7vKbb1kSjgC3a9VJoxbD4= +go.opentelemetry.io/collector/confmap/provider/envprovider v1.21.0/go.mod h1:aSWLYcmgZZJDNtWN1M8JKQuehoGgOxibl1KuvKTar4M= +go.opentelemetry.io/collector/confmap/provider/fileprovider v1.21.0 h1:+zukkM+3l426iGoJkXTpLB2Z8QnZFu26TkGPjh5Rn/4= +go.opentelemetry.io/collector/confmap/provider/fileprovider v1.21.0/go.mod h1:BXBpQhF3n4CNLYO2n/mWZPd2U9ekpbLXLRGZrun1VfI= +go.opentelemetry.io/collector/confmap/provider/httpprovider v1.21.0 h1:NYYGM+SgIlTuNGjd8eGzDr8DkvOe4q7cXon8djF9yyI= +go.opentelemetry.io/collector/confmap/provider/httpprovider v1.21.0/go.mod h1:XRYbuwqq1awFuNhLDUv4aSvn6MzqX+abcevx1O+APJI= +go.opentelemetry.io/collector/confmap/provider/yamlprovider v1.21.0 h1:P3Q9RytCMY76ORPCnkkjOa4fkuFqmZiQRor+F/nPlYE= +go.opentelemetry.io/collector/confmap/provider/yamlprovider v1.21.0/go.mod h1:xhYhHK3yLQ78tsoaKPIGUfFulgy961ImOe2gATH3RQc= +go.opentelemetry.io/collector/connector v0.115.0 h1:4Kkm3HQFzNT1eliMOB8FbIn+PLMRJ2qQku5Vmy3V8Ko= +go.opentelemetry.io/collector/connector v0.115.0/go.mod h1:+ByuAmYLrYHoKh9B+LGqUc0N2kXcN2l8Dea8Mp6brZ8= +go.opentelemetry.io/collector/connector/connectorprofiles v0.115.0 h1:aW1f4Az0I+QJyImFccNWAXqik80bnNu27aQqi2hFfD8= +go.opentelemetry.io/collector/connector/connectorprofiles v0.115.0/go.mod h1:lmynB1CucydOsHa8RSSBh5roUZPfuiv65imXhtNzClM= +go.opentelemetry.io/collector/connector/connectortest v0.115.0 h1:GjtourFr0MJmlbtEPAZ/1BZCxkNAeJ0aMTlrxwftJ0k= +go.opentelemetry.io/collector/connector/connectortest v0.115.0/go.mod h1:f3KQXXNlh/XuV8elmnuVVyfY92dJCAovz10gD72OH0k= +go.opentelemetry.io/collector/consumer v1.21.0 h1:THKZ2Vbi6GkamjTBI2hFq5Dc4kINZTWGwQNa8d/Ty9g= +go.opentelemetry.io/collector/consumer v1.21.0/go.mod h1:FQcC4ThMtRYY41dv+IPNK8POLLhAFY3r1YR5fuP7iiY= +go.opentelemetry.io/collector/consumer/consumererror v0.115.0 h1:yli//xBCQMPZKXNgNlXemo4dvqhnFrAmCZ11DvQgmcY= +go.opentelemetry.io/collector/consumer/consumererror v0.115.0/go.mod h1:LwVzAvQ6ZVNG7mbOvurbAo+W/rKws0IcjOwriuZXqPE= +go.opentelemetry.io/collector/consumer/consumerprofiles v0.115.0 h1:H3fDuyQW1t2HWHkz96WMBQJKUevypOCjBqnqtaAWyoA= +go.opentelemetry.io/collector/consumer/consumerprofiles v0.115.0/go.mod h1:IzEmZ91Tp7TBxVDq8Cc9xvLsmO7H08njr6Pu9P5d9ns= +go.opentelemetry.io/collector/consumer/consumertest v0.115.0 h1:hru0I2447y0TluCdwlKYFFtgcpyCnlM+LiOK1JZyA70= +go.opentelemetry.io/collector/consumer/consumertest v0.115.0/go.mod h1:ybjALRJWR6aKNOzEMy1T1ruCULVDEjj4omtOJMrH/kU= +go.opentelemetry.io/collector/exporter v0.115.0 h1:JnxfpOnsuqhTPKJXVKJLS1Cv3BiVrVLzpHOjJEQw+xw= +go.opentelemetry.io/collector/exporter v0.115.0/go.mod h1:xof3fHQK8wADhaKLIJcQ7ChZaFLNC+haRdPN0wgl6kY= +go.opentelemetry.io/collector/exporter/exporterprofiles v0.115.0 h1:lSQEleCn/q9eFufcuK61NdFKU70ZlgI9dBjPCO/4CrE= +go.opentelemetry.io/collector/exporter/exporterprofiles v0.115.0/go.mod h1:7l5K2AecimX2kx+nZC1gKG3QkP247CO1+SodmJ4fFkQ= +go.opentelemetry.io/collector/exporter/exportertest v0.115.0 h1:P9SMTUXQOtcaq40bGtnnAe14zRmR4/yUgj/Tb2BEf/k= +go.opentelemetry.io/collector/exporter/exportertest v0.115.0/go.mod h1:1jMZ9gFGXglb8wfNrBZIgd+RvpZhSyFwdfE+Jtf9w4U= +go.opentelemetry.io/collector/extension v0.115.0 h1:/cBb8AUdD0KMWC6V3lvCC16eP9Fg0wd1Upcp5rgvuGI= +go.opentelemetry.io/collector/extension v0.115.0/go.mod h1:HI7Ak6loyi6ZrZPsQJW1OO1wbaAW8OqXLFNQlTZnreQ= +go.opentelemetry.io/collector/extension/extensioncapabilities v0.115.0 h1:/g25Hp5aoCNKdDjIb3Fc7XRglO8yaBRFLO/IUNPnqNI= +go.opentelemetry.io/collector/extension/extensioncapabilities v0.115.0/go.mod h1:EQx7ETiy330O6q05S2KRZsRNDg0aQEeJmVl7Ipx+Fcw= +go.opentelemetry.io/collector/extension/extensiontest v0.115.0 h1:GBVFxFEskR8jSdu9uaQh2qpXnN5VNXhXjpJ2UjxtE8I= +go.opentelemetry.io/collector/extension/extensiontest v0.115.0/go.mod h1:eu1ecbz5mT+cHoH2H3GmD/rOO0WsicSJD2RLrYuOmRA= +go.opentelemetry.io/collector/featuregate v1.21.0 h1:+EULHPJDLMipcwAGZVp9Nm8NriRvoBBMxp7MSiIZVMI= +go.opentelemetry.io/collector/featuregate v1.21.0/go.mod h1:3GaXqflNDVwWndNGBJ1+XJFy3Fv/XrFgjMN60N3z7yg= +go.opentelemetry.io/collector/internal/fanoutconsumer v0.115.0 h1:6DRiSECeApFq6Jj5ug77rG53R6FzJEZBfygkyMEXdpg= +go.opentelemetry.io/collector/internal/fanoutconsumer v0.115.0/go.mod h1:vgQf5HQdmLQqpDHpDq2S3nTRoUuKtRcZpRTsy+UiwYw= +go.opentelemetry.io/collector/otelcol v0.115.0 h1:wZhFGrSCZcTQ4qw4ePjI2PaSrOCejoQKAjprKD/xavs= +go.opentelemetry.io/collector/otelcol v0.115.0/go.mod h1:iK8DPvaizirIYKDl1zZG7DDYUj6GkkH4KHifVVM88vk= +go.opentelemetry.io/collector/otelcol/otelcoltest v0.115.0 h1:HNlFpQujlnvawBk8nvMGxzjDHWDCfSprxem/EpQn4u8= +go.opentelemetry.io/collector/otelcol/otelcoltest v0.115.0/go.mod h1:WsMbqYl2rm3nPFbdxQqyLXf4iu97nYLeuQ1seZIpV3Y= +go.opentelemetry.io/collector/pdata v1.21.0 h1:PG+UbiFMJ35X/WcAR7Rf/PWmWtRdW0aHlOidsR6c5MA= +go.opentelemetry.io/collector/pdata v1.21.0/go.mod h1:GKb1/zocKJMvxKbS+sl0W85lxhYBTFJ6h6I1tphVyDU= +go.opentelemetry.io/collector/pdata/pprofile v0.115.0 h1:NI89hy13vNDw7EOnQf7Jtitks4HJFO0SUWznTssmP94= +go.opentelemetry.io/collector/pdata/pprofile v0.115.0/go.mod h1:jGzdNfO0XTtfLjXCL/uCC1livg1LlfR+ix2WE/z3RpQ= +go.opentelemetry.io/collector/pdata/testdata v0.115.0 h1:Rblz+AKXdo3fG626jS+KSd0OSA4uMXcTQfpwed6P8LI= +go.opentelemetry.io/collector/pdata/testdata v0.115.0/go.mod h1:inNnRt6S2Nn260EfCBEcjesjlKOSsr0jPwkPqpBkt4s= +go.opentelemetry.io/collector/pipeline v0.115.0 h1:bmACBqb0e8U9ag+vGGHUP7kCfAO7HHROdtzIEg8ulus= +go.opentelemetry.io/collector/pipeline v0.115.0/go.mod h1:qE3DmoB05AW0C3lmPvdxZqd/H4po84NPzd5MrqgtL74= +go.opentelemetry.io/collector/pipeline/pipelineprofiles v0.115.0 h1:3l9ruCAOrssTUDnyChKNzHWOdTtfThnYaoPZ1/+5sD0= +go.opentelemetry.io/collector/pipeline/pipelineprofiles v0.115.0/go.mod h1:2Myg+law/5lcezo9PhhZ0wjCaLYdGK24s1jDWbSW9VY= +go.opentelemetry.io/collector/processor v0.115.0 h1:+fveHGRe24PZPv/F5taahGuZ9HdNW44hgNWEJhIUdyc= +go.opentelemetry.io/collector/processor v0.115.0/go.mod h1:/oLHBlLsm7tFb7zOIrA5C0j14yBtjXKAgxJJ2Bktyk4= +go.opentelemetry.io/collector/processor/processorprofiles v0.115.0 h1:cCZAs+FXaebZPppqAN3m+X3etoSBL6NvyQo8l0hOZoo= +go.opentelemetry.io/collector/processor/processorprofiles v0.115.0/go.mod h1:kMxF0gknlWX4duuAJFi2/HuIRi6C3w95tOenRa0GKOY= +go.opentelemetry.io/collector/processor/processortest v0.115.0 h1:j9HEaYFOeOB6VYl9zGhBnhQbTkqGBa2udUvu5NTh6hc= +go.opentelemetry.io/collector/processor/processortest v0.115.0/go.mod h1:Gws+VEnp/eW3qAqPpqbKsrbnnxxNfyDjqrfUXbZfZic= +go.opentelemetry.io/collector/receiver v0.115.0 h1:55Q3Jvj6zHCIA1psKqi/3kEMJO4OqUF5tNAEYNdB1U8= +go.opentelemetry.io/collector/receiver v0.115.0/go.mod h1:nBSCh2O/WUcfgpJ+Jpz+B0z0Hn5jHeRvF2WmLij5EIY= +go.opentelemetry.io/collector/receiver/receiverprofiles v0.115.0 h1:R9JLaj2Al93smIPUkbJshAkb/cY0H5JBOxIx+Zu0NG4= +go.opentelemetry.io/collector/receiver/receiverprofiles v0.115.0/go.mod h1:05E5hGujWeeXJmzKZwTdHyZ/+rRyrQlQB5p5Q2XY39M= +go.opentelemetry.io/collector/receiver/receivertest v0.115.0 h1:OiB684SbHQi6/Pd3ZH0cXjYvCpBS9ilQBfTQx0wVXHg= +go.opentelemetry.io/collector/receiver/receivertest v0.115.0/go.mod h1:Y8Z9U/bz9Xpyt8GI8DxZZgryw3mnnIw+AeKVLTD2cP8= +go.opentelemetry.io/collector/semconv v0.115.0 h1:SoqMvg4ZEB3mz2EdAb6XYa+TuMo5Mir5FRBr3nVFUDY= +go.opentelemetry.io/collector/semconv v0.115.0/go.mod h1:N6XE8Q0JKgBN2fAhkUQtqK9LT7rEGR6+Wu/Rtbal1iI= +go.opentelemetry.io/collector/service v0.115.0 h1:k4GAOiI5tZgB2QKgwA6c3TeAVr7QL/ft5cOQbzUr8Iw= +go.opentelemetry.io/collector/service v0.115.0/go.mod h1:DKde9LMhNebdREecDSsqiTFLI2wRc+IoV4/wGxU6goY= go.opentelemetry.io/contrib/bridges/otelzap v0.6.0 h1:j8icMXyyqNf6HGuwlYhniPnVsbJIq7n+WirDu3VAJdQ= go.opentelemetry.io/contrib/bridges/otelzap v0.6.0/go.mod h1:evIOZpl+kAlU5IsaYX2Siw+IbpacAZvXemVsgt70uvw= go.opentelemetry.io/contrib/config v0.10.0 h1:2JknAzMaYjxrHkTnZh3eOme/Y2P5eHE2SWfhfV6Xd6c= @@ -330,8 +318,8 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.29.0 h1:L5SG1JTTXupVV3n6sUqMTeWbjAyfPwoda2DLX8J8FrQ= -golang.org/x/crypto v0.29.0/go.mod h1:+F4F4N5hv6v38hfeYwTdx20oUvLLc+QfrE9Ax9HtgRg= +golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U= +golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f h1:XdNn9LlyWAhLVp6P/i8QYBW+hlyhrhei9uErw2B5GJo= golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f/go.mod h1:D5SMRVC3C2/4+F/DB1wZsLRnSNimn2Sp/NPsCrsv8ak= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= @@ -347,8 +335,8 @@ golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.31.0 h1:68CPQngjLL0r2AlUKiSxtQFKvzRVbnzLwMUn5SzcLHo= -golang.org/x/net v0.31.0/go.mod h1:P4fl1q7dY2hnZFxEk4pPSkDHF+QqjitcnDjUQyMM+pM= +golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= +golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -369,11 +357,8 @@ 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.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.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= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -381,8 +366,8 @@ golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= -golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= -golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.8.0 h1:9i3RxcPv3PZnitoVGMPDKZSq1xW1gK1Xy3ArNOGZfEg= golang.org/x/time v0.8.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -417,8 +402,6 @@ gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntN gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/pkg/trace/info/info.go b/pkg/trace/info/info.go index df86c40587fdc..4198100ee6a5b 100644 --- a/pkg/trace/info/info.go +++ b/pkg/trace/info/info.go @@ -8,6 +8,7 @@ package info import ( "bytes" + "crypto/tls" "encoding/json" "expvar" // automatically publish `/debug/vars` on HTTP port "fmt" @@ -236,8 +237,9 @@ func getProgramBanner(version string) (string, string) { // If error is nil, means the program is running. // If not, it displays a pretty-printed message anyway (for support) func Info(w io.Writer, conf *config.AgentConfig) error { - url := fmt.Sprintf("http://127.0.0.1:%d/debug/vars", conf.DebugServerPort) - client := http.Client{Timeout: 3 * time.Second} + url := fmt.Sprintf("https://127.0.0.1:%d/debug/vars", conf.DebugServerPort) + tr := &http.Transport{TLSClientConfig: &tls.Config{InsecureSkipVerify: true}} + client := http.Client{Timeout: 3 * time.Second, Transport: tr} resp, err := client.Get(url) if err != nil { // OK, here, we can't even make an http call on the agent port, diff --git a/pkg/trace/info/info_test.go b/pkg/trace/info/info_test.go index 01c369cac403e..25b7cb42b13ff 100644 --- a/pkg/trace/info/info_test.go +++ b/pkg/trace/info/info_test.go @@ -63,7 +63,7 @@ func (h *testServerHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { func testServer(t *testing.T, testFile string) *httptest.Server { t.Helper() - server := httptest.NewServer(&testServerHandler{t: t, testFile: testFile}) + server := httptest.NewTLSServer(&testServerHandler{t: t, testFile: testFile}) t.Logf("test server (serving fake yet valid data) listening on %s", server.URL) return server } @@ -94,7 +94,7 @@ func (h *testServerWarningHandler) ServeHTTP(w http.ResponseWriter, r *http.Requ } func testServerWarning(t *testing.T) *httptest.Server { - server := httptest.NewServer(&testServerWarningHandler{t: t}) + server := httptest.NewTLSServer(&testServerWarningHandler{t: t}) t.Logf("test server (serving data containing worrying values) listening on %s", server.URL) return server } @@ -119,7 +119,7 @@ func (h *testServerErrorHandler) ServeHTTP(w http.ResponseWriter, r *http.Reques } func testServerError(t *testing.T) *httptest.Server { - server := httptest.NewServer(&testServerErrorHandler{t: t}) + server := httptest.NewTLSServer(&testServerErrorHandler{t: t}) t.Logf("test server (serving bad data to trigger errors) listening on %s", server.URL) return server } @@ -331,7 +331,7 @@ func TestError(t *testing.T) { assert.Equal(len(lines[1]), len(lines[2])) assert.Equal("", lines[3]) assert.Regexp(regexp.MustCompile(`^ Error: .*$`), lines[4]) - assert.Equal(fmt.Sprintf(" URL: http://127.0.0.1:%d/debug/vars", port), lines[5]) + assert.Equal(fmt.Sprintf(" URL: https://127.0.0.1:%d/debug/vars", port), lines[5]) assert.Equal("", lines[6]) assert.Equal("", lines[7]) } diff --git a/pkg/trace/remoteconfighandler/remote_config_handler.go b/pkg/trace/remoteconfighandler/remote_config_handler.go index a1d24e7b8e744..0aff0f665099e 100644 --- a/pkg/trace/remoteconfighandler/remote_config_handler.go +++ b/pkg/trace/remoteconfighandler/remote_config_handler.go @@ -19,7 +19,6 @@ import ( "github.com/DataDog/datadog-agent/pkg/trace/log" pkglog "github.com/DataDog/datadog-agent/pkg/util/log" - "github.com/cihub/seelog" "github.com/davecgh/go-spew/spew" ) @@ -95,7 +94,7 @@ func (h *RemoteConfigHandler) onAgentConfigUpdate(updates map[string]state.RawCo if len(mergedConfig.LogLevel) > 0 { // Get the current log level - var newFallback seelog.LogLevel + var newFallback pkglog.LogLevel newFallback, err = pkglog.GetLogLevel() if err == nil { h.configState.FallbackLogLevel = newFallback.String() @@ -113,7 +112,7 @@ func (h *RemoteConfigHandler) onAgentConfigUpdate(updates map[string]state.RawCo } } } else { - var currentLogLevel seelog.LogLevel + var currentLogLevel pkglog.LogLevel currentLogLevel, err = pkglog.GetLogLevel() if err == nil && currentLogLevel.String() == h.configState.LatestLogLevel { pkglog.Infof("Removing remote-config log level override of the trace-agent, falling back to %s", h.configState.FallbackLogLevel) diff --git a/pkg/trace/remoteconfighandler/remote_config_handler_test.go b/pkg/trace/remoteconfighandler/remote_config_handler_test.go index 6d3cde4a49711..d53ea39325c79 100644 --- a/pkg/trace/remoteconfighandler/remote_config_handler_test.go +++ b/pkg/trace/remoteconfighandler/remote_config_handler_test.go @@ -13,7 +13,6 @@ import ( "strings" "testing" - "github.com/cihub/seelog" "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" @@ -34,7 +33,7 @@ func TestStart(t *testing.T) { prioritySampler := NewMockprioritySampler(ctrl) errorsSampler := NewMockerrorsSampler(ctrl) rareSampler := NewMockrareSampler(ctrl) - pkglog.SetupLogger(seelog.Default, "debug") + pkglog.SetupLogger(pkglog.Default(), "debug") h := New(&agentConfig, prioritySampler, rareSampler, errorsSampler) @@ -58,7 +57,7 @@ func TestPrioritySampler(t *testing.T) { prioritySampler := NewMockprioritySampler(ctrl) errorsSampler := NewMockerrorsSampler(ctrl) rareSampler := NewMockrareSampler(ctrl) - pkglog.SetupLogger(seelog.Default, "debug") + pkglog.SetupLogger(pkglog.Default(), "debug") agentConfig := config.AgentConfig{RemoteConfigClient: remoteClient, TargetTPS: 41, ErrorTPS: 41, RareSamplerEnabled: true} h := New(&agentConfig, prioritySampler, rareSampler, errorsSampler) @@ -89,7 +88,7 @@ func TestErrorsSampler(t *testing.T) { prioritySampler := NewMockprioritySampler(ctrl) errorsSampler := NewMockerrorsSampler(ctrl) rareSampler := NewMockrareSampler(ctrl) - pkglog.SetupLogger(seelog.Default, "debug") + pkglog.SetupLogger(pkglog.Default(), "debug") agentConfig := config.AgentConfig{RemoteConfigClient: remoteClient, TargetTPS: 41, ErrorTPS: 41, RareSamplerEnabled: true} h := New(&agentConfig, prioritySampler, rareSampler, errorsSampler) @@ -120,7 +119,7 @@ func TestRareSampler(t *testing.T) { prioritySampler := NewMockprioritySampler(ctrl) errorsSampler := NewMockerrorsSampler(ctrl) rareSampler := NewMockrareSampler(ctrl) - pkglog.SetupLogger(seelog.Default, "debug") + pkglog.SetupLogger(pkglog.Default(), "debug") agentConfig := config.AgentConfig{RemoteConfigClient: remoteClient, TargetTPS: 41, ErrorTPS: 41, RareSamplerEnabled: true} h := New(&agentConfig, prioritySampler, rareSampler, errorsSampler) @@ -151,7 +150,7 @@ func TestEnvPrecedence(t *testing.T) { prioritySampler := NewMockprioritySampler(ctrl) errorsSampler := NewMockerrorsSampler(ctrl) rareSampler := NewMockrareSampler(ctrl) - pkglog.SetupLogger(seelog.Default, "debug") + pkglog.SetupLogger(pkglog.Default(), "debug") agentConfig := config.AgentConfig{RemoteConfigClient: remoteClient, TargetTPS: 41, ErrorTPS: 41, RareSamplerEnabled: true, DefaultEnv: "agent-env"} h := New(&agentConfig, prioritySampler, rareSampler, errorsSampler) @@ -193,7 +192,7 @@ func TestLogLevel(t *testing.T) { errorsSampler := NewMockerrorsSampler(ctrl) rareSampler := NewMockrareSampler(ctrl) - pkglog.SetupLogger(seelog.Default, "debug") + pkglog.SetupLogger(pkglog.Default(), "debug") srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { assert.Equal(t, "Bearer fakeToken", r.Header.Get("Authorization")) w.WriteHeader(200) diff --git a/pkg/trace/stats/oteltest/go.mod b/pkg/trace/stats/oteltest/go.mod index aabc79c264479..3f97dcf41808c 100644 --- a/pkg/trace/stats/oteltest/go.mod +++ b/pkg/trace/stats/oteltest/go.mod @@ -6,20 +6,21 @@ require ( github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/statsprocessor v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/proto v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/trace v0.56.0-rc.3 - github.com/DataDog/datadog-go/v5 v5.5.0 - github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.21.0 + github.com/DataDog/datadog-go/v5 v5.6.0 + github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.22.0 github.com/google/go-cmp v0.6.0 github.com/stretchr/testify v1.10.0 - go.opentelemetry.io/collector/component/componenttest v0.114.0 - go.opentelemetry.io/collector/pdata v1.20.0 - go.opentelemetry.io/collector/semconv v0.114.0 + go.opentelemetry.io/collector/component/componenttest v0.115.0 + go.opentelemetry.io/collector/pdata v1.21.0 + go.opentelemetry.io/collector/semconv v0.115.0 go.opentelemetry.io/otel/metric v1.32.0 google.golang.org/protobuf v1.35.2 ) -require go.opentelemetry.io/collector/component v0.114.0 // indirect +require go.opentelemetry.io/collector/component v0.115.0 // indirect require ( + github.com/DataDog/datadog-agent/comp/core/tagger/origindetection v0.0.0-20241217122454-175edb6c74f2 // indirect github.com/DataDog/datadog-agent/comp/trace/compression/def v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/comp/trace/compression/impl-gzip v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/pkg/obfuscate v0.56.0-rc.3 // indirect @@ -28,6 +29,7 @@ require ( github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/pointer v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/version v0.59.1 // indirect github.com/DataDog/go-sqllexer v0.0.17 // indirect github.com/DataDog/go-tuf v1.1.0-0.5.2 // indirect github.com/DataDog/sketches-go v1.4.6 // indirect @@ -39,6 +41,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 @@ -57,16 +60,16 @@ require ( github.com/outcaste-io/ristretto v0.2.3 // indirect github.com/philhofer/fwd v1.1.3-0.20240916144458-20a13a1f6b7c // indirect github.com/pkg/errors v0.9.1 // indirect + github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // 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/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 github.com/yusufpapurcu/wmi v1.2.4 // indirect - go.opentelemetry.io/collector/config/configtelemetry v0.114.0 // indirect + go.opentelemetry.io/collector/config/configtelemetry v0.115.0 // indirect go.opentelemetry.io/otel v1.32.0 // indirect go.opentelemetry.io/otel/sdk v1.32.0 // indirect go.opentelemetry.io/otel/sdk/metric v1.32.0 // indirect @@ -74,18 +77,18 @@ require ( go.uber.org/atomic v1.11.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect - golang.org/x/net v0.31.0 // indirect - golang.org/x/sys v0.27.0 // indirect - golang.org/x/text v0.20.0 // indirect + golang.org/x/net v0.33.0 // indirect + golang.org/x/sys v0.28.0 // indirect + golang.org/x/text v0.21.0 // indirect golang.org/x/time v0.8.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect google.golang.org/grpc v1.67.1 // indirect gopkg.in/ini.v1 v1.67.0 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) replace ( + github.com/DataDog/datadog-agent/comp/core/tagger/origindetection => ../../../../comp/core/tagger/origindetection github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/metricsclient => ../../../../comp/otelcol/otlp/components/metricsclient github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/statsprocessor => ../../../../comp/otelcol/otlp/components/statsprocessor github.com/DataDog/datadog-agent/comp/trace/compression/def => ../../../../comp/trace/compression/def @@ -107,3 +110,5 @@ replace ( github.com/DataDog/datadog-agent/pkg/util/pointer => ../../../util/pointer github.com/DataDog/datadog-agent/pkg/util/scrubber => ../../../util/scrubber ) + +replace github.com/DataDog/datadog-agent/pkg/version => ../../../version diff --git a/pkg/trace/stats/oteltest/go.sum b/pkg/trace/stats/oteltest/go.sum index 3c983553c9350..abd898f9bed2a 100644 --- a/pkg/trace/stats/oteltest/go.sum +++ b/pkg/trace/stats/oteltest/go.sum @@ -1,11 +1,11 @@ -github.com/DataDog/datadog-go/v5 v5.5.0 h1:G5KHeB8pWBNXT4Jtw0zAkhdxEAWSpWH00geHI6LDrKU= -github.com/DataDog/datadog-go/v5 v5.5.0/go.mod h1:K9kcYBlxkcPP8tvvjZZKs/m1edNAUFzBbdpTUKfCsuw= +github.com/DataDog/datadog-go/v5 v5.6.0 h1:2oCLxjF/4htd55piM75baflj/KoE6VYS7alEUqFvRDw= +github.com/DataDog/datadog-go/v5 v5.6.0/go.mod h1:K9kcYBlxkcPP8tvvjZZKs/m1edNAUFzBbdpTUKfCsuw= github.com/DataDog/go-sqllexer v0.0.17 h1:u47fJAVg/+5DA74ZW3w0Qu+3qXHd3GtnA8ZBYixdPrM= github.com/DataDog/go-sqllexer v0.0.17/go.mod h1:KwkYhpFEVIq+BfobkTC1vfqm4gTi65skV/DpDBXtexc= github.com/DataDog/go-tuf v1.1.0-0.5.2 h1:4CagiIekonLSfL8GMHRHcHudo1fQnxELS9g4tiAupQ4= github.com/DataDog/go-tuf v1.1.0-0.5.2/go.mod h1:zBcq6f654iVqmkk8n2Cx81E1JnNTMOAx1UEO/wZR+P0= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.21.0 h1:hgbTFS6SkqbzOiWSfP58dZ/Jpjlmv6dpD4+V4LDHm2Q= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.21.0/go.mod h1:dvIWN9pA2zWNTw5rhDWZgzZnhcfpH++d+8d1SWW6xkY= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.22.0 h1:yfk2cF8Bx98fSFpGrehEHh1FRqewfxcCTAbUDt5r3F8= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.22.0/go.mod h1:9qzpnBSxSOnKzbF/uHket3SSlQihQHix/ZRC2nZUUYQ= 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/zstd v1.5.6 h1:LbEglqepa/ipmmQJUDnSsfvA8e8IStVcGaFWDuxvGOY= @@ -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= @@ -78,10 +80,10 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/sampling v0.114.0 h1:mtSN/07RGQPi1/zHVSZg4G0qRtOoJpPew5jsQWv9uS0= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/sampling v0.114.0/go.mod h1:C9Zgh/N3j4NR2D+1FGAA1YizhFW9OS51DwLUFJTdXN4= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/probabilisticsamplerprocessor v0.114.0 h1:I4ZYVRYW3Cjb65sPENZ9kHam/JUMXNEp2n/knJ0C0Vc= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/probabilisticsamplerprocessor v0.114.0/go.mod h1:4BhyIaOn2LS48WS+ZNix4TpP0+goq9gDEtGzth5Cr3M= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/sampling v0.115.0 h1:R9MRrO+dSkAHBQLZjuwjv2RHXHQqF2Wtm1Ki0VKD5cs= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/sampling v0.115.0/go.mod h1:rKXLXmwdUVcUHwTilroKSejbg3KSwLeYzNPSpkIEnv4= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/probabilisticsamplerprocessor v0.115.0 h1:vwZQ7k8oqlK0bdZYTsjP/59zjQQfjSD4fNsWIWsTu2w= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/probabilisticsamplerprocessor v0.115.0/go.mod h1:5ObSa9amrbzbYTdAK1Qhv3D/YqCxxnQhP0sk2eWB7Oo= github.com/opencontainers/runtime-spec v1.2.0 h1:z97+pHb3uELt/yiAWD691HNHQIF07bE7dzrbT927iTk= github.com/opencontainers/runtime-spec v1.2.0/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/outcaste-io/ristretto v0.2.3 h1:AK4zt/fJ76kjlYObOeNwh4T3asEuaCmp26pOvUOL9w0= @@ -90,6 +92,8 @@ github.com/philhofer/fwd v1.1.3-0.20240916144458-20a13a1f6b7c h1:dAMKvw0MlJT1Gsh github.com/philhofer/fwd v1.1.3-0.20240916144458-20a13a1f6b7c/go.mod h1:RqIHx9QI14HlwKwm98g9Re5prTQ6LdeRQn+gXJFxsJM= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 h1:GFCKgmp0tecUJ0sJuv4pzYCqS9+RGSn52M3FUwPs+uo= +github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10/go.mod h1:t/avpk3KcrXxUnYOhZhMXJlSEyie6gQbtLq5NM3loB8= 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= @@ -99,12 +103,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= @@ -134,36 +134,36 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0= github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= -go.opentelemetry.io/collector/component v0.114.0 h1:SVGbm5LvHGSTEDv7p92oPuBgK5tuiWR82I9+LL4TtBE= -go.opentelemetry.io/collector/component v0.114.0/go.mod h1:MLxtjZ6UVHjDxSdhGLuJfHBHvfl1iT/Y7IaQPD24Eww= -go.opentelemetry.io/collector/component/componentstatus v0.114.0 h1:y9my/xink8KB5lK8zFAjgB2+pEh0QYy5TM972fxZY9w= -go.opentelemetry.io/collector/component/componentstatus v0.114.0/go.mod h1:RIoeCYZpPaae7QLE/1RacqzhHuXBmzRAk9H/EwYtIIs= -go.opentelemetry.io/collector/component/componenttest v0.114.0 h1:GM4FTTlfeXoVm6sZYBHImwlRN8ayh2oAfUhvaFj7Zo8= -go.opentelemetry.io/collector/component/componenttest v0.114.0/go.mod h1:ZZEJMtbJtoVC/3/9R1HzERq+cYQRxuMFQrPCpfZ4Xos= -go.opentelemetry.io/collector/config/configtelemetry v0.114.0 h1:kjLeyrumge6wsX6ZIkicdNOlBXaEyW2PI2ZdVXz/rzY= -go.opentelemetry.io/collector/config/configtelemetry v0.114.0/go.mod h1:R0MBUxjSMVMIhljuDHWIygzzJWQyZHXXWIgQNxcFwhc= -go.opentelemetry.io/collector/consumer v0.114.0 h1:1zVaHvfIZowGwZRitRBRo3i+RP2StlU+GClYiofSw0Q= -go.opentelemetry.io/collector/consumer v0.114.0/go.mod h1:d+Mrzt9hsH1ub3zmwSlnQVPLeTYir4Mgo7CrWfnncN4= -go.opentelemetry.io/collector/consumer/consumerprofiles v0.114.0 h1:5pXYy3E6UK5Huu3aQbsYL8B6E6MyWx4fvXXDn+oXZaA= -go.opentelemetry.io/collector/consumer/consumerprofiles v0.114.0/go.mod h1:PMq3f54KcJQO4v1tue0QxQScu7REFVADlXxXSAYMiN0= -go.opentelemetry.io/collector/consumer/consumertest v0.114.0 h1:isaTwJK5DOy8Bs7GuLq23ejfgj8gLIo5dOUvkRnLF4g= -go.opentelemetry.io/collector/consumer/consumertest v0.114.0/go.mod h1:GNeLPkfRPdh06n/Rv1UKa/cAtCKjN0a7ADyHjIj4HFE= -go.opentelemetry.io/collector/pdata v1.20.0 h1:ePcwt4bdtISP0loHaE+C9xYoU2ZkIvWv89Fob16o9SM= -go.opentelemetry.io/collector/pdata v1.20.0/go.mod h1:Ox1YVLe87cZDB/TL30i4SUz1cA5s6AM6SpFMfY61ICs= -go.opentelemetry.io/collector/pdata/pprofile v0.114.0 h1:pUNfTzsI/JUTiE+DScDM4lsrPoxnVNLI2fbTxR/oapo= -go.opentelemetry.io/collector/pdata/pprofile v0.114.0/go.mod h1:4aNcj6WM1n1uXyFSXlhVs4ibrERgNYsTbzcYI2zGhxA= -go.opentelemetry.io/collector/pdata/testdata v0.114.0 h1:+AzszWSL1i4K6meQ8rU0JDDW55SYCXa6FVqfDixhhTo= -go.opentelemetry.io/collector/pdata/testdata v0.114.0/go.mod h1:bv8XFdCTZxG2MQB5l9dKxSxf5zBrcodwO6JOy1+AxXM= -go.opentelemetry.io/collector/pipeline v0.114.0 h1:v3YOhc5z0tD6QbO5n/pnftpIeroihM2ks9Z2yKPCcwY= -go.opentelemetry.io/collector/pipeline v0.114.0/go.mod h1:4vOvjVsoYTHVGTbfFwqfnQOSV2K3RKUHofh3jNRc2Mg= -go.opentelemetry.io/collector/processor v0.114.0 h1:6bqQgLL7BtKrNv4YkEOGjZfkcfZv/ciJSQx1epGG9Zk= -go.opentelemetry.io/collector/processor v0.114.0/go.mod h1:DV/wa+nAmSHIDeD9NblPwkY9PbgtDQAZJ+PE5biZwPc= -go.opentelemetry.io/collector/processor/processorprofiles v0.114.0 h1:+P/1nLouEXTnN8DVQl+qWwO4BTkQyNPG9t/FrpUqrSI= -go.opentelemetry.io/collector/processor/processorprofiles v0.114.0/go.mod h1:3fuHeNIpINwx3bqFMprmDJyr6y5tWoWbJH599kltO5Y= -go.opentelemetry.io/collector/processor/processortest v0.114.0 h1:3FTaVXAp0LoVmUJn1ewBFckAby7AHa6/Kcdj0xuW14c= -go.opentelemetry.io/collector/processor/processortest v0.114.0/go.mod h1:OgsdOs1Fv5ZGTTJPF5nNIUJh2YkuV1acWd73yWgnti4= -go.opentelemetry.io/collector/semconv v0.114.0 h1:/eKcCJwZepQUtEuFuxa0thx2XIOvhFpaf214ZG1a11k= -go.opentelemetry.io/collector/semconv v0.114.0/go.mod h1:zCJ5njhWpejR+A40kiEoeFm1xq1uzyZwMnRNX6/D82A= +go.opentelemetry.io/collector/component v0.115.0 h1:iLte1oCiXzjiCnaOBKdsXacfFiECecpWxW3/LeriMoo= +go.opentelemetry.io/collector/component v0.115.0/go.mod h1:oIUFiH7w1eOimdeYhFI+gAIxYSiLDocKVJ0PTvX7d6s= +go.opentelemetry.io/collector/component/componentstatus v0.115.0 h1:pbpUIL+uKDfEiSgKK+S5nuSL6MDIIQYsp4b65ZGVb9M= +go.opentelemetry.io/collector/component/componentstatus v0.115.0/go.mod h1:36A+9XSiOz0Cdhq+UwwPRlEr5CYuSkEnVO9om4BH7d0= +go.opentelemetry.io/collector/component/componenttest v0.115.0 h1:9URDJ9VyP6tuij+YHjp/kSSMecnZOd7oGvzu+rw9SJY= +go.opentelemetry.io/collector/component/componenttest v0.115.0/go.mod h1:PzXvNqKLCiSADZGZFKH+IOHMkaQ0GTHuzysfVbTPKYY= +go.opentelemetry.io/collector/config/configtelemetry v0.115.0 h1:U07FinCDop+r2RjWQ3aP9ZWONC7r7kQIp1GkXQi6nsI= +go.opentelemetry.io/collector/config/configtelemetry v0.115.0/go.mod h1:SlBEwQg0qly75rXZ6W1Ig8jN25KBVBkFIIAUI1GiAAE= +go.opentelemetry.io/collector/consumer v1.21.0 h1:THKZ2Vbi6GkamjTBI2hFq5Dc4kINZTWGwQNa8d/Ty9g= +go.opentelemetry.io/collector/consumer v1.21.0/go.mod h1:FQcC4ThMtRYY41dv+IPNK8POLLhAFY3r1YR5fuP7iiY= +go.opentelemetry.io/collector/consumer/consumerprofiles v0.115.0 h1:H3fDuyQW1t2HWHkz96WMBQJKUevypOCjBqnqtaAWyoA= +go.opentelemetry.io/collector/consumer/consumerprofiles v0.115.0/go.mod h1:IzEmZ91Tp7TBxVDq8Cc9xvLsmO7H08njr6Pu9P5d9ns= +go.opentelemetry.io/collector/consumer/consumertest v0.115.0 h1:hru0I2447y0TluCdwlKYFFtgcpyCnlM+LiOK1JZyA70= +go.opentelemetry.io/collector/consumer/consumertest v0.115.0/go.mod h1:ybjALRJWR6aKNOzEMy1T1ruCULVDEjj4omtOJMrH/kU= +go.opentelemetry.io/collector/pdata v1.21.0 h1:PG+UbiFMJ35X/WcAR7Rf/PWmWtRdW0aHlOidsR6c5MA= +go.opentelemetry.io/collector/pdata v1.21.0/go.mod h1:GKb1/zocKJMvxKbS+sl0W85lxhYBTFJ6h6I1tphVyDU= +go.opentelemetry.io/collector/pdata/pprofile v0.115.0 h1:NI89hy13vNDw7EOnQf7Jtitks4HJFO0SUWznTssmP94= +go.opentelemetry.io/collector/pdata/pprofile v0.115.0/go.mod h1:jGzdNfO0XTtfLjXCL/uCC1livg1LlfR+ix2WE/z3RpQ= +go.opentelemetry.io/collector/pdata/testdata v0.115.0 h1:Rblz+AKXdo3fG626jS+KSd0OSA4uMXcTQfpwed6P8LI= +go.opentelemetry.io/collector/pdata/testdata v0.115.0/go.mod h1:inNnRt6S2Nn260EfCBEcjesjlKOSsr0jPwkPqpBkt4s= +go.opentelemetry.io/collector/pipeline v0.115.0 h1:bmACBqb0e8U9ag+vGGHUP7kCfAO7HHROdtzIEg8ulus= +go.opentelemetry.io/collector/pipeline v0.115.0/go.mod h1:qE3DmoB05AW0C3lmPvdxZqd/H4po84NPzd5MrqgtL74= +go.opentelemetry.io/collector/processor v0.115.0 h1:+fveHGRe24PZPv/F5taahGuZ9HdNW44hgNWEJhIUdyc= +go.opentelemetry.io/collector/processor v0.115.0/go.mod h1:/oLHBlLsm7tFb7zOIrA5C0j14yBtjXKAgxJJ2Bktyk4= +go.opentelemetry.io/collector/processor/processorprofiles v0.115.0 h1:cCZAs+FXaebZPppqAN3m+X3etoSBL6NvyQo8l0hOZoo= +go.opentelemetry.io/collector/processor/processorprofiles v0.115.0/go.mod h1:kMxF0gknlWX4duuAJFi2/HuIRi6C3w95tOenRa0GKOY= +go.opentelemetry.io/collector/processor/processortest v0.115.0 h1:j9HEaYFOeOB6VYl9zGhBnhQbTkqGBa2udUvu5NTh6hc= +go.opentelemetry.io/collector/processor/processortest v0.115.0/go.mod h1:Gws+VEnp/eW3qAqPpqbKsrbnnxxNfyDjqrfUXbZfZic= +go.opentelemetry.io/collector/semconv v0.115.0 h1:SoqMvg4ZEB3mz2EdAb6XYa+TuMo5Mir5FRBr3nVFUDY= +go.opentelemetry.io/collector/semconv v0.115.0/go.mod h1:N6XE8Q0JKgBN2fAhkUQtqK9LT7rEGR6+Wu/Rtbal1iI= go.opentelemetry.io/otel v1.32.0 h1:WnBN+Xjcteh0zdk01SVqV55d/m62NJLJdIyb4y/WO5U= go.opentelemetry.io/otel v1.32.0/go.mod h1:00DCVSB0RQcnzlwyTfqtxSm+DRr9hpYrHjNGiBHVQIg= go.opentelemetry.io/otel/metric v1.32.0 h1:xV2umtmNcThh2/a/aCP+h64Xx5wsj8qqnkYZktzNa0M= @@ -186,8 +186,8 @@ go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.29.0 h1:L5SG1JTTXupVV3n6sUqMTeWbjAyfPwoda2DLX8J8FrQ= -golang.org/x/crypto v0.29.0/go.mod h1:+F4F4N5hv6v38hfeYwTdx20oUvLLc+QfrE9Ax9HtgRg= +golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U= +golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= @@ -196,8 +196,8 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.31.0 h1:68CPQngjLL0r2AlUKiSxtQFKvzRVbnzLwMUn5SzcLHo= -golang.org/x/net v0.31.0/go.mod h1:P4fl1q7dY2hnZFxEk4pPSkDHF+QqjitcnDjUQyMM+pM= +golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= +golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -214,13 +214,13 @@ golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220627191245-f75cf1eec38b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.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= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= -golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.8.0 h1:9i3RxcPv3PZnitoVGMPDKZSq1xW1gK1Xy3ArNOGZfEg= golang.org/x/time v0.8.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -245,8 +245,6 @@ gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntN gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/pkg/trace/traceutil/otel_util.go b/pkg/trace/traceutil/otel_util.go index bb3e03783c4dc..5e645f7b6673b 100644 --- a/pkg/trace/traceutil/otel_util.go +++ b/pkg/trace/traceutil/otel_util.go @@ -195,6 +195,13 @@ func GetOTelResourceV1(span ptrace.Span, res pcommon.Resource) (resName string) // ...and service if available resName = resName + " " + svc } + } else if m := GetOTelAttrValInResAndSpanAttrs(span, res, false, semconv117.AttributeGraphqlOperationType); m != "" { + // Enrich GraphQL query resource names. + // See https://github.com/open-telemetry/semantic-conventions/blob/v1.29.0/docs/graphql/graphql-spans.md + resName = m + if name := GetOTelAttrValInResAndSpanAttrs(span, res, false, semconv117.AttributeGraphqlOperationName); name != "" { + resName = resName + " " + name + } } else { resName = span.Name() } @@ -249,6 +256,16 @@ func GetOTelResourceV2(span ptrace.Span, res pcommon.Resource) (resName string) } return } + + if m := GetOTelAttrValInResAndSpanAttrs(span, res, false, semconv117.AttributeGraphqlOperationType); m != "" { + // Enrich GraphQL query resource names. + // See https://github.com/open-telemetry/semantic-conventions/blob/v1.29.0/docs/graphql/graphql-spans.md + resName = m + if name := GetOTelAttrValInResAndSpanAttrs(span, res, false, semconv117.AttributeGraphqlOperationName); name != "" { + resName = resName + " " + name + } + return + } resName = span.Name() return diff --git a/pkg/trace/traceutil/otel_util_test.go b/pkg/trace/traceutil/otel_util_test.go index 9b6934caf3a7a..201c64a0745b8 100644 --- a/pkg/trace/traceutil/otel_util_test.go +++ b/pkg/trace/traceutil/otel_util_test.go @@ -293,6 +293,27 @@ func TestGetOTelResource(t *testing.T) { expectedV1: strings.Repeat("a", MaxResourceLen), expectedV2: strings.Repeat("a", MaxResourceLen), }, + { + name: "GraphQL with no type", + sattrs: map[string]string{"graphql.operation.name": "myQuery"}, + normalize: false, + expectedV1: "span_name", + expectedV2: "span_name", + }, + { + name: "GraphQL with only type", + sattrs: map[string]string{"graphql.operation.type": "query"}, + normalize: false, + expectedV1: "query", + expectedV2: "query", + }, + { + name: "GraphQL with only type", + sattrs: map[string]string{"graphql.operation.type": "query", "graphql.operation.name": "myQuery"}, + normalize: false, + expectedV1: "query myQuery", + expectedV2: "query myQuery", + }, } { t.Run(tt.name, func(t *testing.T) { span := ptrace.NewSpan() 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/cgroups/go.mod b/pkg/util/cgroups/go.mod index 582db53aa5134..0be6406d65503 100644 --- a/pkg/util/cgroups/go.mod +++ b/pkg/util/cgroups/go.mod @@ -19,18 +19,19 @@ require ( 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/coreos/go-systemd/v22 v22.5.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/docker/go-units v0.5.0 // indirect github.com/godbus/dbus/v5 v5.1.0 // indirect - github.com/kr/text v0.2.0 // indirect github.com/moby/sys/userns v0.1.0 // indirect github.com/opencontainers/runtime-spec v1.2.0 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect go.uber.org/atomic v1.11.0 // indirect - golang.org/x/sys v0.27.0 // indirect + golang.org/x/sys v0.28.0 // indirect google.golang.org/protobuf v1.35.2 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) + +replace github.com/DataDog/datadog-agent/pkg/version => ../../version diff --git a/pkg/util/cgroups/go.sum b/pkg/util/cgroups/go.sum index 3b65e4fa070a9..d2a0373b5e095 100644 --- a/pkg/util/cgroups/go.sum +++ b/pkg/util/cgroups/go.sum @@ -4,7 +4,6 @@ github.com/containerd/cgroups/v3 v3.0.4 h1:2fs7l3P0Qxb1nKWuJNFiwhp2CqiKzho71DQkD github.com/containerd/cgroups/v3 v3.0.4/go.mod h1:SA5DLYnXO8pTGYiAHXz94qvLQTKfVM5GEVisn4jpins= github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs= github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= 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/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= @@ -32,14 +31,12 @@ github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOf github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.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= google.golang.org/protobuf v1.35.2 h1:8Ar7bF+apOIoThw1EdZl0p1oWvMqTHmpA2fRTyZO8io= google.golang.org/protobuf v1.35.2/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/pkg/util/cloudproviders/gce/gce_tags.go b/pkg/util/cloudproviders/gce/gce_tags.go index 31c986277bc97..9440ba6ccc21b 100644 --- a/pkg/util/cloudproviders/gce/gce_tags.go +++ b/pkg/util/cloudproviders/gce/gce_tags.go @@ -3,8 +3,6 @@ // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2016-present Datadog, Inc. -//go:build gce - package gce import ( diff --git a/pkg/util/cloudproviders/gce/gce_tags_test.go b/pkg/util/cloudproviders/gce/gce_tags_test.go index 06f15ed938f21..80a803e3cc687 100644 --- a/pkg/util/cloudproviders/gce/gce_tags_test.go +++ b/pkg/util/cloudproviders/gce/gce_tags_test.go @@ -3,8 +3,6 @@ // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2016-present Datadog, Inc. -//go:build gce - package gce import ( diff --git a/pkg/util/containers/filter.go b/pkg/util/containers/filter.go index 1e2ab52934e77..63676bc59533d 100644 --- a/pkg/util/containers/filter.go +++ b/pkg/util/containers/filter.go @@ -112,6 +112,7 @@ func parseFilters(filters []string) (imageFilters, nameFilters, namespaceFilters for _, filter := range filters { switch { case strings.HasPrefix(filter, imageFilterPrefix): + filter = preprocessImageFilter(filter) r, err := filterToRegex(filter, imageFilterPrefix) if err != nil { filterErrs = append(filterErrs, err.Error()) @@ -145,6 +146,19 @@ func parseFilters(filters []string) (imageFilters, nameFilters, namespaceFilters return imageFilters, nameFilters, namespaceFilters, filterWarnings, nil } +// preprocessImageFilter modifies image filters having the format `name$`, where {name} doesn't include a colon (e.g. nginx$, ^nginx$), to +// `name:.*`. +// This is done so that image filters can still match even if the matched image contains the tag or digest. +func preprocessImageFilter(imageFilter string) string { + regexVal := strings.TrimPrefix(imageFilter, imageFilterPrefix) + if strings.HasSuffix(regexVal, "$") && !strings.Contains(regexVal, ":") { + mutatedRegexVal := regexVal[:len(regexVal)-1] + "(@sha256)?:.*" + return imageFilterPrefix + mutatedRegexVal + } + + return imageFilter +} + // filterToRegex checks a filter's regex func filterToRegex(filter string, filterPrefix string) (*regexp.Regexp, error) { pat := strings.TrimPrefix(filter, filterPrefix) @@ -327,7 +341,16 @@ func NewAutodiscoveryFilter(ft FilterType) (*Filter, error) { // based on the filters in the containerFilter instance. Consider also using // Note: exclude filters are not applied to empty container names, empty // images and empty namespaces. +// +// containerImage may or may not contain the image tag or image digest. (e.g. nginx:latest and nginx are both valid) func (cf Filter) IsExcluded(annotations map[string]string, containerName, containerImage, podNamespace string) bool { + + // If containerImage doesn't include the tag or digest, add a colon so that it + // can match image filters + if len(containerImage) > 0 && !strings.Contains(containerImage, ":") { + containerImage += ":" + } + if cf.isExcludedByAnnotation(annotations, containerName) { return true } diff --git a/pkg/util/containers/filter_test.go b/pkg/util/containers/filter_test.go index 1c1d768a4dfc0..ea33a72134f46 100644 --- a/pkg/util/containers/filter_test.go +++ b/pkg/util/containers/filter_test.go @@ -28,6 +28,14 @@ func TestFilter(t *testing.T) { c ctnDef ns string }{ + { + c: ctnDef{ + ID: "0", + Name: "container-with-sha", + Image: "docker-dd-agent@sha256:1892862abcdef61516516", + }, + ns: "default", + }, { c: ctnDef{ ID: "1", @@ -268,25 +276,33 @@ func TestFilter(t *testing.T) { expectedIDs []string }{ { - expectedIDs: []string{"1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "23", "24", "25", "26", "27", "28", "29", "30", "31"}, + expectedIDs: []string{"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "23", "24", "25", "26", "27", "28", "29", "30", "31"}, }, { - excludeList: []string{"name:secret"}, + excludeList: []string{"image:^docker-dd-agent$"}, expectedIDs: []string{"2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "23", "24", "25", "26", "27", "28", "29", "30", "31"}, }, + { + excludeList: []string{"image:^apache$"}, + expectedIDs: []string{"0", "1", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "23", "24", "25", "26", "27", "28", "29", "30", "31"}, + }, + { + excludeList: []string{"name:secret"}, + expectedIDs: []string{"0", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "23", "24", "25", "26", "27", "28", "29", "30", "31"}, + }, { excludeList: []string{"image:secret"}, - expectedIDs: []string{"1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "23", "24", "25", "26", "27", "28", "29", "30", "31"}, + expectedIDs: []string{"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "23", "24", "25", "26", "27", "28", "29", "30", "31"}, }, { includeList: []string{}, excludeList: []string{"image:apache", "image:alpine"}, - expectedIDs: []string{"1", "3", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "23", "24", "25", "26", "27", "28", "29", "30", "31"}, + expectedIDs: []string{"0", "1", "3", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "23", "24", "25", "26", "27", "28", "29", "30", "31"}, }, { includeList: []string{"name:mysql"}, excludeList: []string{"name:dd"}, - expectedIDs: []string{"3", "5", "6", "7", "8", "9", "10", "11", "12", "13", "16", "17", "18", "19", "20", "23", "24", "25", "26", "27", "28", "29", "30", "31"}, + expectedIDs: []string{"0", "3", "5", "6", "7", "8", "9", "10", "11", "12", "13", "16", "17", "18", "19", "20", "23", "24", "25", "26", "27", "28", "29", "30", "31"}, }, { excludeList: []string{"kube_namespace:.*"}, @@ -295,7 +311,7 @@ func TestFilter(t *testing.T) { }, { excludeList: []string{"kube_namespace:bar"}, - expectedIDs: []string{"1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "19", "20", "23", "24", "25", "26", "27", "28", "29", "30", "31"}, + expectedIDs: []string{"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "19", "20", "23", "24", "25", "26", "27", "28", "29", "30", "31"}, }, { excludeList: []string{"name:.*"}, @@ -305,7 +321,17 @@ func TestFilter(t *testing.T) { { excludeList: []string{"image:.*"}, includeList: []string{"image:docker-dd-agent"}, - expectedIDs: []string{"1", "30"}, + expectedIDs: []string{"0", "1", "30"}, + }, + { + excludeList: []string{"image:.*"}, + includeList: []string{"image:^docker-dd-agent$"}, + expectedIDs: []string{"0", "1", "30"}, + }, + { + excludeList: []string{"image:.*"}, + includeList: []string{"image:^docker-dd-agent$"}, + expectedIDs: []string{"0", "1", "30"}, }, // Test kubernetes defaults { @@ -326,7 +352,7 @@ func TestFilter(t *testing.T) { pauseContainerUpstream, pauseContainerCDK, }, - expectedIDs: []string{"1", "2", "3", "4", "5", "14", "15", "29", "30", "31"}, + expectedIDs: []string{"0", "1", "2", "3", "4", "5", "14", "15", "29", "30", "31"}, }, } { t.Run("", func(t *testing.T) { @@ -624,6 +650,15 @@ func TestParseFilters(t *testing.T) { expectedErrMsg: nil, filterErrors: nil, }, + { + desc: "valid filters, image filter strict match without tag or digest", + filters: []string{"image:^nginx$", "name:xyz-.*", "kube_namespace:sandbox.*", "name:abc"}, + imageFilters: []*regexp.Regexp{regexp.MustCompile("^nginx(@sha256)?:.*")}, + nameFilters: []*regexp.Regexp{regexp.MustCompile("xyz-.*"), regexp.MustCompile("abc")}, + namespaceFilters: []*regexp.Regexp{regexp.MustCompile("sandbox.*")}, + expectedErrMsg: nil, + filterErrors: nil, + }, { desc: "invalid regex", filters: []string{"image:apache.*", "name:a(?=b)", "kube_namespace:sandbox.*", "name:abc"}, diff --git a/pkg/util/core.go b/pkg/util/coredump/core.go similarity index 81% rename from pkg/util/core.go rename to pkg/util/coredump/core.go index 77649ea1d53f3..64b4f35c3a12a 100644 --- a/pkg/util/core.go +++ b/pkg/util/coredump/core.go @@ -5,7 +5,7 @@ //go:build !windows -package util +package coredump import ( "fmt" @@ -16,8 +16,8 @@ import ( "github.com/DataDog/datadog-agent/pkg/config/model" ) -// SetupCoreDump enables core dumps and sets the core dump size limit based on configuration -func SetupCoreDump(cfg model.Reader) error { +// Setup enables core dumps and sets the core dump size limit based on configuration +func Setup(cfg model.Reader) error { if cfg.GetBool("go_core_dump") { debug.SetTraceback("crash") diff --git a/pkg/util/core_windows.go b/pkg/util/coredump/core_windows.go similarity index 73% rename from pkg/util/core_windows.go rename to pkg/util/coredump/core_windows.go index c11422c8aff2b..3e7d3915f7636 100644 --- a/pkg/util/core_windows.go +++ b/pkg/util/coredump/core_windows.go @@ -3,7 +3,7 @@ // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2016-2020 Datadog, Inc. -package util +package coredump import ( "fmt" @@ -11,8 +11,8 @@ import ( "github.com/DataDog/datadog-agent/pkg/config/model" ) -// SetupCoreDump enables core dumps and sets the core dump size limit based on configuration -func SetupCoreDump(cfg model.Reader) error { +// Setup enables core dumps and sets the core dump size limit based on configuration +func Setup(cfg model.Reader) error { if cfg.GetBool("go_core_dump") { return fmt.Errorf("Not supported on Windows") } diff --git a/pkg/util/coredump/docs.go b/pkg/util/coredump/docs.go new file mode 100644 index 0000000000000..43371b50e7dac --- /dev/null +++ b/pkg/util/coredump/docs.go @@ -0,0 +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-2020 Datadog, Inc. + +// Package coredump provides utils to enable core dumps and set core dump size limit +package coredump diff --git a/pkg/util/defaultpaths/go.mod b/pkg/util/defaultpaths/go.mod index ea2d774c6fd68..0f0c498c8154e 100644 --- a/pkg/util/defaultpaths/go.mod +++ b/pkg/util/defaultpaths/go.mod @@ -13,13 +13,16 @@ require ( github.com/DataDog/datadog-agent/pkg/util/executable v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/util/log v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/util/winutil v0.56.0-rc.3 - golang.org/x/sys v0.27.0 + golang.org/x/sys v0.28.0 ) 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/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 // indirect go.uber.org/atomic v1.11.0 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect ) + +replace github.com/DataDog/datadog-agent/pkg/version => ../../version diff --git a/pkg/util/defaultpaths/go.sum b/pkg/util/defaultpaths/go.sum index c3b0b0188c902..82beecfd023fb 100644 --- a/pkg/util/defaultpaths/go.sum +++ b/pkg/util/defaultpaths/go.sum @@ -16,12 +16,10 @@ github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOf github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.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= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 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 1753d7310cddd..278ca25596558 100644 --- a/pkg/util/filesystem/go.mod +++ b/pkg/util/filesystem/go.mod @@ -5,27 +5,31 @@ go 1.22.0 replace ( github.com/DataDog/datadog-agent/pkg/util/log => ../log/ github.com/DataDog/datadog-agent/pkg/util/scrubber => ../scrubber/ + github.com/DataDog/datadog-agent/pkg/util/winutil => ../winutil/ ) require ( - github.com/DataDog/datadog-agent/pkg/util/log v0.56.0-rc.3 - github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 - github.com/shirou/gopsutil/v3 v3.24.5 + 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-20230122075934-ca0b05cb1adb + github.com/shirou/gopsutil/v4 v4.24.11 github.com/stretchr/testify v1.10.0 - golang.org/x/sys v0.27.0 + golang.org/x/sys v0.28.0 ) require ( - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.56.0-rc.3 // 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/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/kr/text v0.2.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 + github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect go.uber.org/atomic v1.11.0 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) + +replace github.com/DataDog/datadog-agent/pkg/version => ../../version diff --git a/pkg/util/filesystem/go.sum b/pkg/util/filesystem/go.sum index e3cc0b7e589e0..7c87d03c25604 100644 --- a/pkg/util/filesystem/go.sum +++ b/pkg/util/filesystem/go.sum @@ -1,25 +1,26 @@ github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 h1:kHaBemcxl8o/pQ5VM1c8PVE1PubbNx3mjUr09OqWGCs= github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575/go.mod h1:9d6lWj8KzO/fd/NrVaLscBKmPigpZpn5YawRPw+e3Yo= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= 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= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 h1:S4qyfL2sEm5Budr4KVMyEniCy+PbS55651I/a+Kn/NQ= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb h1:PGufWXXDq9yaev6xX1YQauaO1MV90e6Mpoq1I7Lz/VM= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= 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-20220216144756-c35f1ee13d7c h1:NRoLoZvkBTKvR5gQLgA3e0hqjkY9u1wm+iOL45VN/qI= -github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 h1:o4JXh1EVt9k/+g42oCprj/FisM4qX9L3sZB3upGN2ZU= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55/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= @@ -30,12 +31,10 @@ golang.org/x/sys v0.0.0-20190529164535-6a60838ec259/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.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= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/pkg/util/filesystem/permission_windows.go b/pkg/util/filesystem/permission_windows.go index 2ae2929ce1809..43819ee0be97c 100644 --- a/pkg/util/filesystem/permission_windows.go +++ b/pkg/util/filesystem/permission_windows.go @@ -8,15 +8,16 @@ package filesystem import ( "fmt" - "syscall" "github.com/hectane/go-acl" "golang.org/x/sys/windows" + + "github.com/DataDog/datadog-agent/pkg/util/winutil" ) // Permission handles permissions for Unix and Windows type Permission struct { - currentUserSid *windows.SID + ddUserSid *windows.SID administratorSid *windows.SID systemSid *windows.SID } @@ -32,32 +33,24 @@ func NewPermission() (*Permission, error) { return nil, err } - currentUserSid, err := getCurrentUserSid() + ddUserSid, err := getDatadogUserSid() if err != nil { - return nil, fmt.Errorf("Unable to get current user sid %v", err) + return nil, fmt.Errorf("unable to get datadog user sid %v", err) } return &Permission{ - currentUserSid: currentUserSid, + ddUserSid: ddUserSid, administratorSid: administratorSid, systemSid: systemSid, }, nil } -func getCurrentUserSid() (*windows.SID, error) { - token, err := syscall.OpenCurrentProcessToken() - if err != nil { - return nil, fmt.Errorf("Couldn't get process token %v", err) - } - defer token.Close() - user, err := token.GetTokenUser() - if err != nil { - return nil, fmt.Errorf("Couldn't get token user %v", err) - } - sidString, err := user.User.Sid.String() +func getDatadogUserSid() (*windows.SID, error) { + ddUserSid, err := winutil.GetDDAgentUserSID() if err != nil { - return nil, fmt.Errorf("Couldn't get user sid string %v", err) + // falls back to current user on failure + return winutil.GetSidFromUser() } - return windows.StringToSid(sidString) + return ddUserSid, nil } // RestrictAccessToUser update the ACL of a file so only the current user and ADMIN/SYSTEM can access it @@ -68,7 +61,7 @@ func (p *Permission) RestrictAccessToUser(path string) error { false, // don't inherit acl.GrantSid(windows.GENERIC_ALL, p.administratorSid), acl.GrantSid(windows.GENERIC_ALL, p.systemSid), - acl.GrantSid(windows.GENERIC_ALL, p.currentUserSid)) + acl.GrantSid(windows.GENERIC_ALL, p.ddUserSid)) } // RemoveAccessToOtherUsers on Windows this function calls RestrictAccessToUser diff --git a/pkg/util/filesystem/permission_windows_test.go b/pkg/util/filesystem/permission_windows_test.go new file mode 100644 index 0000000000000..61921718cd37f --- /dev/null +++ b/pkg/util/filesystem/permission_windows_test.go @@ -0,0 +1,73 @@ +// 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 filesystem + +import ( + "os" + "path/filepath" + "testing" + "unsafe" + + "github.com/stretchr/testify/require" + "golang.org/x/sys/windows" +) + +func TestRemoveAccessToOtherUsers(t *testing.T) { + + p, err := NewPermission() + require.NoError(t, err) + + root := t.TempDir() + + t.Log(root) + + testFile := filepath.Join(root, "file") + testDir := filepath.Join(root, "dir") + + err = os.WriteFile(testFile, []byte("test"), 0777) + require.NoError(t, err) + err = os.Mkdir(testDir, 0777) + require.NoError(t, err) + + err = p.RemoveAccessToOtherUsers(testFile) + require.NoError(t, err) + + // Assert the permissions for the file + assertPermissions(t, testFile, p) + + err = p.RemoveAccessToOtherUsers(testDir) + require.NoError(t, err) + + // Assert the permissions for the directory + assertPermissions(t, testDir, p) +} + +func assertPermissions(t *testing.T, path string, p *Permission) { + sd, err := windows.GetNamedSecurityInfo( + path, + windows.SE_FILE_OBJECT, + windows.DACL_SECURITY_INFORMATION, + ) + require.NoError(t, err) + + dacl, _, err := sd.DACL() + require.NoError(t, err) + + aceCount := int(dacl.AceCount) + for i := 0; i < aceCount; i++ { + var ace *windows.ACCESS_ALLOWED_ACE + err := windows.GetAce(dacl, uint32(i), &ace) + require.NoError(t, err) + + var sid *windows.SID = (*windows.SID)(unsafe.Pointer(&ace.SidStart)) + + if !sid.Equals(p.ddUserSid) && !sid.Equals(p.administratorSid) && !sid.Equals(p.systemSid) { + t.Errorf("Unexpected SID with access: %v", sid) + } + } +} diff --git a/pkg/util/flavor/go.mod b/pkg/util/flavor/go.mod index bb7190a4d241c..9a50d863cc8d3 100644 --- a/pkg/util/flavor/go.mod +++ b/pkg/util/flavor/go.mod @@ -46,31 +46,32 @@ require ( github.com/DataDog/datadog-agent/pkg/util/executable v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/filesystem v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.59.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/log v0.59.1 // indirect github.com/DataDog/datadog-agent/pkg/util/optional v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/pointer v0.59.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.1 // indirect 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.0 // indirect - github.com/DataDog/viper v1.13.5 // 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.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 - github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 // indirect + github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb // indirect github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 // indirect - github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c // indirect + github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c // indirect github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect 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/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // 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 @@ -79,9 +80,9 @@ require ( github.com/tklauser/numcpus v0.8.0 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect go.uber.org/atomic v1.11.0 // indirect - golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f // indirect - golang.org/x/sys v0.27.0 // indirect - golang.org/x/text v0.20.0 // indirect + golang.org/x/exp v0.0.0-20241210194714-1829a127f884 // indirect + golang.org/x/sys v0.28.0 // indirect + golang.org/x/text v0.21.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) @@ -89,3 +90,5 @@ require ( replace github.com/DataDog/datadog-agent/pkg/config/mock => ../../config/mock replace github.com/DataDog/datadog-agent/pkg/config/structure => ../../config/structure + +replace github.com/DataDog/datadog-agent/pkg/version => ../../version diff --git a/pkg/util/flavor/go.sum b/pkg/util/flavor/go.sum index b70b04e70aa56..e78672416b092 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= @@ -69,7 +71,6 @@ github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/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= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -84,8 +85,8 @@ github.com/grpc-ecosystem/grpc-gateway v1.13.0/go.mod h1:8XEsbTttt/W+VvjtQhLACqC github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/hcl v1.0.1-vault-5 h1:kI3hhbbyzr4dldA8UdTb7ZlVVlI2DACdCfz31RPDgJM= github.com/hashicorp/hcl v1.0.1-vault-5/go.mod h1:XYhtn6ijBSAj6n4YqAaf7RBPS4I06AItNorpy+MoQNM= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 h1:S4qyfL2sEm5Budr4KVMyEniCy+PbS55651I/a+Kn/NQ= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb h1:PGufWXXDq9yaev6xX1YQauaO1MV90e6Mpoq1I7Lz/VM= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= @@ -107,8 +108,8 @@ 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-20220913051719-115f729f3c8c h1:VtwQ41oftZwlMnOEbMWQtSEUgU64U4s+GHk7hZK+jtY= -github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c/go.mod h1:JKx41uQRwqlTZabZc+kILPrO/3jlKnQ2Z8b7YiVw5cE= +github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a h1:3Bm7EwfUQUvhNeKIkUct/gl9eod1TcXuj8stxvi/GoI= +github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a/go.mod h1:ilwx/Dta8jXAgpFYFvSWEMwxmbWXyiUHkd5FwyKhb5k= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= @@ -135,8 +136,8 @@ github.com/pkg/errors v0.8.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-20220216144756-c35f1ee13d7c h1:NRoLoZvkBTKvR5gQLgA3e0hqjkY9u1wm+iOL45VN/qI= -github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 h1:o4JXh1EVt9k/+g42oCprj/FisM4qX9L3sZB3upGN2ZU= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= @@ -167,12 +168,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= @@ -237,8 +234,8 @@ golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnf golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f h1:XdNn9LlyWAhLVp6P/i8QYBW+hlyhrhei9uErw2B5GJo= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f/go.mod h1:D5SMRVC3C2/4+F/DB1wZsLRnSNimn2Sp/NPsCrsv8ak= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884 h1:Y/Mj/94zIQQGHVSv1tTtQBDaQaJe62U9bkDZKKyhPCU= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -275,11 +272,11 @@ golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20220829200755-d48e67d00261/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.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/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= -golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= diff --git a/pkg/util/fxutil/go.mod b/pkg/util/fxutil/go.mod index 249b7b5223891..48681aa9b89a5 100644 --- a/pkg/util/fxutil/go.mod +++ b/pkg/util/fxutil/go.mod @@ -24,6 +24,6 @@ require ( go.uber.org/dig v1.18.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect - golang.org/x/sys v0.27.0 // indirect + golang.org/x/sys v0.28.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/pkg/util/fxutil/go.sum b/pkg/util/fxutil/go.sum index b6080ae54f78c..3dcc180d9ba1c 100644 --- a/pkg/util/fxutil/go.sum +++ b/pkg/util/fxutil/go.sum @@ -28,8 +28,8 @@ go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.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= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= diff --git a/pkg/util/grpc/agent_client_test.go b/pkg/util/grpc/agent_client_test.go index 0bc586fae3fdb..8fcc62aeb51a3 100644 --- a/pkg/util/grpc/agent_client_test.go +++ b/pkg/util/grpc/agent_client_test.go @@ -11,14 +11,13 @@ import ( "testing" "time" - "github.com/cihub/seelog" "github.com/stretchr/testify/assert" "github.com/DataDog/datadog-agent/pkg/util/log" ) func TestMain(m *testing.M) { - log.SetupLogger(seelog.Default, "trace") + log.SetupLogger(log.Default(), "trace") os.Exit(m.Run()) } diff --git a/pkg/util/grpc/auth.go b/pkg/util/grpc/auth.go index 382c4838919a6..fae83d5c22e8d 100644 --- a/pkg/util/grpc/auth.go +++ b/pkg/util/grpc/auth.go @@ -7,6 +7,7 @@ package grpc import ( "context" + "crypto/subtle" "errors" "fmt" @@ -45,7 +46,7 @@ func AuthInterceptor(verifier verifierFunc) grpc_auth.AuthFunc { // using the given token. func StaticAuthInterceptor(token string) grpc_auth.AuthFunc { return AuthInterceptor(func(reqToken string) (interface{}, error) { - if reqToken != token { + if subtle.ConstantTimeCompare([]byte(reqToken), []byte(token)) == 0 { return struct{}{}, errors.New("invalid session token") } diff --git a/pkg/util/grpc/go.mod b/pkg/util/grpc/go.mod index b058dd317dd34..0be10f8fb6b09 100644 --- a/pkg/util/grpc/go.mod +++ b/pkg/util/grpc/go.mod @@ -37,11 +37,10 @@ replace ( require ( github.com/DataDog/datadog-agent/pkg/api v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/proto v0.56.0-rc.3 - github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 - github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 + github.com/DataDog/datadog-agent/pkg/util/log v0.59.1 github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 github.com/stretchr/testify v1.10.0 - golang.org/x/net v0.31.0 + golang.org/x/net v0.33.0 google.golang.org/grpc v1.67.1 ) @@ -61,31 +60,32 @@ require ( github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/optional v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/pointer v0.59.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.1 // indirect 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.0 // indirect - github.com/DataDog/datadog-agent/pkg/version v0.56.0-rc.3 // indirect - github.com/DataDog/viper v1.13.5 // 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.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 github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect github.com/hashicorp/hcl v1.0.1-vault-5 // indirect - github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 // indirect + github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb // indirect github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 // indirect - github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c // indirect + github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c // indirect github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect github.com/pelletier/go-toml v1.9.5 // indirect 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/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // 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 @@ -95,10 +95,10 @@ require ( github.com/tklauser/numcpus v0.8.0 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect go.uber.org/atomic v1.11.0 // indirect - golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f // indirect + golang.org/x/exp v0.0.0-20241210194714-1829a127f884 // indirect golang.org/x/oauth2 v0.23.0 // indirect - golang.org/x/sys v0.27.0 // indirect - golang.org/x/text v0.20.0 // indirect + golang.org/x/sys v0.28.0 // indirect + golang.org/x/text v0.21.0 // indirect google.golang.org/genproto v0.0.0-20240903143218-8af14fe29dc1 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20241104194629-dd2ea8efbc28 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect diff --git a/pkg/util/grpc/go.sum b/pkg/util/grpc/go.sum index 2670baa59f394..82c303e1a95bf 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= @@ -83,7 +85,6 @@ github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/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= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -103,8 +104,8 @@ github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFb github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/hcl v1.0.1-vault-5 h1:kI3hhbbyzr4dldA8UdTb7ZlVVlI2DACdCfz31RPDgJM= github.com/hashicorp/hcl v1.0.1-vault-5/go.mod h1:XYhtn6ijBSAj6n4YqAaf7RBPS4I06AItNorpy+MoQNM= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 h1:S4qyfL2sEm5Budr4KVMyEniCy+PbS55651I/a+Kn/NQ= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb h1:PGufWXXDq9yaev6xX1YQauaO1MV90e6Mpoq1I7Lz/VM= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= @@ -127,8 +128,8 @@ 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-20220913051719-115f729f3c8c h1:VtwQ41oftZwlMnOEbMWQtSEUgU64U4s+GHk7hZK+jtY= -github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c/go.mod h1:JKx41uQRwqlTZabZc+kILPrO/3jlKnQ2Z8b7YiVw5cE= +github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a h1:3Bm7EwfUQUvhNeKIkUct/gl9eod1TcXuj8stxvi/GoI= +github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a/go.mod h1:ilwx/Dta8jXAgpFYFvSWEMwxmbWXyiUHkd5FwyKhb5k= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= @@ -157,8 +158,8 @@ github.com/pkg/errors v0.8.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-20220216144756-c35f1ee13d7c h1:NRoLoZvkBTKvR5gQLgA3e0hqjkY9u1wm+iOL45VN/qI= -github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 h1:o4JXh1EVt9k/+g42oCprj/FisM4qX9L3sZB3upGN2ZU= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= @@ -189,12 +190,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= @@ -270,8 +267,8 @@ golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f h1:XdNn9LlyWAhLVp6P/i8QYBW+hlyhrhei9uErw2B5GJo= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f/go.mod h1:D5SMRVC3C2/4+F/DB1wZsLRnSNimn2Sp/NPsCrsv8ak= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884 h1:Y/Mj/94zIQQGHVSv1tTtQBDaQaJe62U9bkDZKKyhPCU= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -294,8 +291,8 @@ golang.org/x/net v0.0.0-20191002035440-2ec189313ef0/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.31.0 h1:68CPQngjLL0r2AlUKiSxtQFKvzRVbnzLwMUn5SzcLHo= -golang.org/x/net v0.31.0/go.mod h1:P4fl1q7dY2hnZFxEk4pPSkDHF+QqjitcnDjUQyMM+pM= +golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= +golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.23.0 h1:PbgcYx2W7i4LvjJWEbf0ngHV6qJYr86PkAV3bXdLEbs= @@ -322,12 +319,12 @@ golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220829200755-d48e67d00261/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.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/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= -golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= diff --git a/pkg/util/hostname/validate/go.mod b/pkg/util/hostname/validate/go.mod index ca6d2889b8178..9c1a227476e2c 100644 --- a/pkg/util/hostname/validate/go.mod +++ b/pkg/util/hostname/validate/go.mod @@ -14,11 +14,12 @@ require ( 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/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/kr/text v0.2.0 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect go.uber.org/atomic v1.11.0 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) + +replace github.com/DataDog/datadog-agent/pkg/version => ../../../version diff --git a/pkg/util/hostname/validate/go.sum b/pkg/util/hostname/validate/go.sum index 8c774897583cd..d45d69118e85e 100644 --- a/pkg/util/hostname/validate/go.sum +++ b/pkg/util/hostname/validate/go.sum @@ -1,6 +1,5 @@ github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 h1:kHaBemcxl8o/pQ5VM1c8PVE1PubbNx3mjUr09OqWGCs= github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575/go.mod h1:9d6lWj8KzO/fd/NrVaLscBKmPigpZpn5YawRPw+e3Yo= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= 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/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= @@ -18,7 +17,5 @@ go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0 gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/pkg/util/http/go.mod b/pkg/util/http/go.mod index 0d248d6101c9f..bd1e65ac069bb 100644 --- a/pkg/util/http/go.mod +++ b/pkg/util/http/go.mod @@ -33,9 +33,9 @@ replace ( require ( github.com/DataDog/datadog-agent/pkg/config/mock v0.59.0 github.com/DataDog/datadog-agent/pkg/config/model v0.59.0 - github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 + github.com/DataDog/datadog-agent/pkg/util/log v0.59.1 github.com/stretchr/testify v1.10.0 - golang.org/x/net v0.31.0 + golang.org/x/net v0.33.0 ) require ( @@ -51,28 +51,29 @@ require ( github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/optional v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/pointer v0.59.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.1 // indirect 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.0 // indirect - github.com/DataDog/viper v1.13.5 // 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.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 - github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 // indirect + github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb // indirect github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 // indirect - github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c // indirect + github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c // indirect github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect 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/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // 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 @@ -81,11 +82,13 @@ require ( github.com/tklauser/numcpus v0.8.0 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect go.uber.org/atomic v1.11.0 // indirect - golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f // indirect - golang.org/x/sys v0.27.0 // indirect - golang.org/x/text v0.20.0 // indirect + golang.org/x/exp v0.0.0-20241210194714-1829a127f884 // indirect + golang.org/x/sys v0.28.0 // indirect + golang.org/x/text v0.21.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) replace github.com/DataDog/datadog-agent/pkg/config/structure => ../../config/structure + +replace github.com/DataDog/datadog-agent/pkg/version => ../../version diff --git a/pkg/util/http/go.sum b/pkg/util/http/go.sum index d2da3c8b27c74..5629e2aaf45a4 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= @@ -69,7 +71,6 @@ github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/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= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -84,8 +85,8 @@ github.com/grpc-ecosystem/grpc-gateway v1.13.0/go.mod h1:8XEsbTttt/W+VvjtQhLACqC github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/hcl v1.0.1-vault-5 h1:kI3hhbbyzr4dldA8UdTb7ZlVVlI2DACdCfz31RPDgJM= github.com/hashicorp/hcl v1.0.1-vault-5/go.mod h1:XYhtn6ijBSAj6n4YqAaf7RBPS4I06AItNorpy+MoQNM= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 h1:S4qyfL2sEm5Budr4KVMyEniCy+PbS55651I/a+Kn/NQ= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb h1:PGufWXXDq9yaev6xX1YQauaO1MV90e6Mpoq1I7Lz/VM= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= @@ -107,8 +108,8 @@ 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-20220913051719-115f729f3c8c h1:VtwQ41oftZwlMnOEbMWQtSEUgU64U4s+GHk7hZK+jtY= -github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c/go.mod h1:JKx41uQRwqlTZabZc+kILPrO/3jlKnQ2Z8b7YiVw5cE= +github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a h1:3Bm7EwfUQUvhNeKIkUct/gl9eod1TcXuj8stxvi/GoI= +github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a/go.mod h1:ilwx/Dta8jXAgpFYFvSWEMwxmbWXyiUHkd5FwyKhb5k= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= @@ -135,8 +136,8 @@ github.com/pkg/errors v0.8.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-20220216144756-c35f1ee13d7c h1:NRoLoZvkBTKvR5gQLgA3e0hqjkY9u1wm+iOL45VN/qI= -github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 h1:o4JXh1EVt9k/+g42oCprj/FisM4qX9L3sZB3upGN2ZU= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= @@ -167,12 +168,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= @@ -237,8 +234,8 @@ golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnf golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f h1:XdNn9LlyWAhLVp6P/i8QYBW+hlyhrhei9uErw2B5GJo= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f/go.mod h1:D5SMRVC3C2/4+F/DB1wZsLRnSNimn2Sp/NPsCrsv8ak= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884 h1:Y/Mj/94zIQQGHVSv1tTtQBDaQaJe62U9bkDZKKyhPCU= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -256,8 +253,8 @@ golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191002035440-2ec189313ef0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.31.0 h1:68CPQngjLL0r2AlUKiSxtQFKvzRVbnzLwMUn5SzcLHo= -golang.org/x/net v0.31.0/go.mod h1:P4fl1q7dY2hnZFxEk4pPSkDHF+QqjitcnDjUQyMM+pM= +golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= +golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -277,11 +274,11 @@ golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20220829200755-d48e67d00261/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.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/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= -golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 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/kubernetes/apiserver/controllers/controllers.go b/pkg/util/kubernetes/apiserver/controllers/controllers.go index 174e793165540..bb3c3dda78e42 100644 --- a/pkg/util/kubernetes/apiserver/controllers/controllers.go +++ b/pkg/util/kubernetes/apiserver/controllers/controllers.go @@ -129,9 +129,11 @@ func StartControllers(ctx *ControllerContext) k8serrors.Aggregate { // startMetadataController starts the informers needed for metadata collection. // The synchronization of the informers is handled by the controller. func startMetadataController(ctx *ControllerContext, _ chan error) { + useEndpointSlices := pkgconfigsetup.Datadog().GetBool("kubernetes_use_endpoint_slices") metaController := newMetadataController( - ctx.InformerFactory.Core().V1().Endpoints(), + ctx.InformerFactory, ctx.WorkloadMeta, + useEndpointSlices, ) go metaController.run(ctx.StopCh) } diff --git a/pkg/util/kubernetes/apiserver/controllers/metadata_controller.go b/pkg/util/kubernetes/apiserver/controllers/metadata_controller.go index 6956c131f83e2..eb808df547a86 100644 --- a/pkg/util/kubernetes/apiserver/controllers/metadata_controller.go +++ b/pkg/util/kubernetes/apiserver/controllers/metadata_controller.go @@ -9,14 +9,18 @@ package controllers import ( "fmt" + "sync" "time" corev1 "k8s.io/api/core/v1" + discv1 "k8s.io/api/discovery/v1" "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/util/sets" "k8s.io/apimachinery/pkg/util/wait" - coreinformers "k8s.io/client-go/informers/core/v1" + "k8s.io/client-go/informers" corelisters "k8s.io/client-go/listers/core/v1" + disclisters "k8s.io/client-go/listers/discovery/v1" "k8s.io/client-go/tools/cache" "k8s.io/client-go/util/workqueue" @@ -33,11 +37,29 @@ import ( // so that the cache does not contain data for deleted pods/services. // // This controller is used by the Datadog Cluster Agent and supports Kubernetes 1.4+. + +const kubernetesServiceNameLabel = "kubernetes.io/service-name" + type metadataController struct { wmeta workloadmeta.Component - endpointsLister corelisters.EndpointsLister - endpointsListerSynced cache.InformerSynced + endpointsLister corelisters.EndpointsLister + endpointSliceLister disclisters.EndpointSliceLister + listerSynced cache.InformerSynced + useEndpointSlices bool + + // Cache to map endpointSlices to their corresponding services. + // - Allows cleanup of metadata when an endpointSlice is deleted since endpointSlices + // do not directly map to services. + // - Prevents redundant processing by tracking the resource version of endpointSlices. + sliceServiceCache map[string]map[string]sliceCacheEntry + sliceCacheLock sync.RWMutex + + // Stores the mapping of services to nodes. + // - Tracks nodes associated with services to detect when all pods on a node + // are removed from a service. + serviceToNodes map[string]sets.Set[string] + serviceToNodesLock sync.RWMutex store *metaBundleStore @@ -45,26 +67,52 @@ type metadataController struct { queue workqueue.TypedRateLimitingInterface[string] } +// sliceCacheEntry represents the service and resource version of an endpointSlice, +// enabling metadata cleanup and change detection. +type sliceCacheEntry struct { + serviceName string + resourceVersion string +} + // newMetadataController returns a new metadata controller -func newMetadataController(endpointsInformer coreinformers.EndpointsInformer, wmeta workloadmeta.Component) *metadataController { +func newMetadataController(informerFactory informers.SharedInformerFactory, wmeta workloadmeta.Component, useEndpointSlices bool) *metadataController { m := &metadataController{ wmeta: wmeta, queue: workqueue.NewTypedRateLimitingQueueWithConfig( workqueue.DefaultTypedControllerRateLimiter[string](), workqueue.TypedRateLimitingQueueConfig[string]{Name: "endpoints"}, ), + useEndpointSlices: useEndpointSlices, } - if _, err := endpointsInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{ - AddFunc: m.addEndpoints, - UpdateFunc: m.updateEndpoints, - DeleteFunc: m.deleteEndpoints, - }); err != nil { - log.Errorf("error adding event handler to node informer: %f", err) + if useEndpointSlices { + log.Info("Initializing metadata controller with endpointSlices") + endpointSliceInformer := informerFactory.Discovery().V1().EndpointSlices() + if _, err := endpointSliceInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{ + AddFunc: m.addEndpointSlice, + UpdateFunc: m.updateEndpointSlice, + DeleteFunc: m.deleteEndpointSlice, + }); err != nil { + log.Errorf("error adding event handler to endpointSlice informer: %v", err) + } + m.sliceServiceCache = make(map[string]map[string]sliceCacheEntry) + m.endpointSliceLister = endpointSliceInformer.Lister() + m.listerSynced = endpointSliceInformer.Informer().HasSynced + } else { + log.Info("Initializing metadata controller with endpoints") + endpointInformer := informerFactory.Core().V1().Endpoints() + if _, err := endpointInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{ + AddFunc: m.addEndpoints, + UpdateFunc: m.updateEndpoints, + DeleteFunc: m.deleteEndpoints, + }); err != nil { + log.Errorf("error adding event handler to node informer: %f", err) + } + m.endpointsLister = endpointInformer.Lister() + m.listerSynced = endpointInformer.Informer().HasSynced } - m.endpointsLister = endpointsInformer.Lister() - m.endpointsListerSynced = endpointsInformer.Informer().HasSynced + m.serviceToNodes = make(map[string]sets.Set[string]) m.store = globalMetaBundleStore // default to global store return m @@ -77,7 +125,7 @@ func (m *metadataController) run(stopCh <-chan struct{}) { log.Infof("Starting metadata controller") defer log.Infof("Stopping metadata controller") - if !cache.WaitForCacheSync(stopCh, m.endpointsListerSynced) { + if !cache.WaitForCacheSync(stopCh, m.listerSynced) { return } @@ -101,6 +149,7 @@ func (m *metadataController) run(stopCh <-chan struct{}) { <-stopCh } +// worker processes items in the work queue. func (m *metadataController) worker() { for m.processNextWorkItem() { } @@ -113,7 +162,7 @@ func (m *metadataController) processNextWorkItem() bool { } defer m.queue.Done(key) - err := m.syncEndpoints(key) + err := m.sync(key) if err != nil { log.Debugf("Error syncing endpoints %v: %v", key, err) } @@ -187,6 +236,42 @@ func (m *metadataController) deleteEndpoints(obj interface{}) { m.enqueue(obj) } +func (m *metadataController) addEndpointSlice(obj interface{}) { + endpointSlice, ok := obj.(*discv1.EndpointSlice) + if !ok { + return + } + log.Debugf("Adding endpointSlice %s/%s", endpointSlice.Namespace, endpointSlice.Name) + m.enqueue(obj) +} + +func (m *metadataController) updateEndpointSlice(_, cur interface{}) { + newEndpointSlice, ok := cur.(*discv1.EndpointSlice) + if !ok { + return + } + log.Tracef("Updating endpointSlice %s/%s", newEndpointSlice.Namespace, newEndpointSlice.Name) + m.enqueue(cur) +} + +func (m *metadataController) deleteEndpointSlice(obj interface{}) { + endpointSlice, ok := obj.(*discv1.EndpointSlice) + if !ok { + tombstone, ok := obj.(cache.DeletedFinalStateUnknown) + if !ok { + log.Debugf("Couldn't get object from tombstone %#v", obj) + return + } + endpointSlice, ok = tombstone.Obj.(*discv1.EndpointSlice) + if !ok { + log.Debugf("Tombstone contained object that is not an endpointSlice %#v", obj) + return + } + } + log.Debugf("Deleting endpointSlice %s/%s", endpointSlice.Namespace, endpointSlice.Name) + m.enqueue(obj) +} + func (m *metadataController) enqueue(obj interface{}) { key, err := cache.MetaNamespaceKeyFunc(obj) if err != nil { @@ -196,6 +281,13 @@ func (m *metadataController) enqueue(obj interface{}) { m.queue.Add(key) } +func (m *metadataController) sync(key string) error { + if m.useEndpointSlices { + return m.syncEndpointSlices(key) + } + return m.syncEndpoints(key) +} + func (m *metadataController) syncEndpoints(key string) error { namespace, name, err := cache.SplitMetaNamespaceKey(key) if err != nil { @@ -207,7 +299,10 @@ func (m *metadataController) syncEndpoints(key string) error { case errors.IsNotFound(err): // Endpoints absence in store means watcher caught the deletion, ensure metadata map is cleaned. log.Tracef("Endpoints has been deleted %v. Attempting to cleanup metadata map", key) - err = m.deleteMappedEndpoints(namespace, name) + m.serviceToNodesLock.Lock() + delete(m.serviceToNodes, name) + m.serviceToNodesLock.Unlock() + err = m.deleteService(namespace, name) case err != nil: log.Debugf("Unable to retrieve endpoints %v from store: %v", key, err) default: @@ -216,9 +311,30 @@ func (m *metadataController) syncEndpoints(key string) error { return err } +func (m *metadataController) syncEndpointSlices(key string) error { + namespace, sliceName, err := cache.SplitMetaNamespaceKey(key) + if err != nil { + return err + } + + endpointSlice, err := m.endpointSliceLister.EndpointSlices(namespace).Get(sliceName) + switch { + case errors.IsNotFound(err): + // Endpoints absence in store means watcher caught the deletion, ensure metadata map is cleaned. + log.Tracef("EndpointSlice has been deleted %v. Attempting to cleanup metadata map", key) + err = m.cleanupEndpointSlice(namespace, sliceName) + case err != nil: + log.Debugf("Unable to retrieve endpointSlice %v from store: %v", key, err) + default: + err = m.mapEndpointSlice(endpointSlice) + } + return err +} + // mapEndpoints matches pods to services via endpoint TargetRef objects. It supports Kubernetes 1.4+. func (m *metadataController) mapEndpoints(endpoints *corev1.Endpoints) error { nodeToPods := make(map[string]map[string]sets.Set[string]) + affectedNodes := sets.New[string]() // Loop over the subsets to create a mapping of nodes to pods running on the node. for _, subset := range endpoints.Subsets { @@ -247,6 +363,8 @@ func (m *metadataController) mapEndpoints(endpoints *corev1.Endpoints) error { nodeName := *address.NodeName + affectedNodes.Insert(nodeName) + if _, ok := nodeToPods[nodeName]; !ok { nodeToPods[nodeName] = make(map[string]sets.Set[string]) } @@ -257,24 +375,175 @@ func (m *metadataController) mapEndpoints(endpoints *corev1.Endpoints) error { } } - svc := endpoints.Name - namespace := endpoints.Namespace - for nodeName, ns := range nodeToPods { + m.cleanupStaleNodes(endpoints.Namespace, endpoints.Name, affectedNodes) + m.updateNodeMetadata(endpoints.Namespace, endpoints.Name, nodeToPods) + + return nil +} + +// mapEndpointSlice matches pods to services via endpoint TargetRef objects. It supports Kubernetes 1.19+. +func (m *metadataController) mapEndpointSlice(endpointSlice *discv1.EndpointSlice) error { + svc, svcExists := endpointSlice.Labels[kubernetesServiceNameLabel] + if !svcExists || svc == "" { + log.Tracef("EndpointSlice %s/%s missing %s label; skipping", endpointSlice.Namespace, endpointSlice.Name, kubernetesServiceNameLabel) + return nil + } + + m.sliceCacheLock.RLock() + cachedEntry, exists := m.sliceServiceCache[endpointSlice.Namespace][endpointSlice.Name] + m.sliceCacheLock.RUnlock() + + // Skip processing if the resource version hasn't changed + if exists && cachedEntry.resourceVersion == endpointSlice.ResourceVersion { + log.Tracef("No change detected for EndpointSlice %s/%s; skipping", endpointSlice.Namespace, endpointSlice.Name) + return nil + } + + m.sliceCacheLock.Lock() + if _, ok := m.sliceServiceCache[endpointSlice.Namespace]; !ok { + m.sliceServiceCache[endpointSlice.Namespace] = make(map[string]sliceCacheEntry) + } + m.sliceServiceCache[endpointSlice.Namespace][endpointSlice.Name] = sliceCacheEntry{ + serviceName: svc, + resourceVersion: endpointSlice.ResourceVersion, + } + m.sliceCacheLock.Unlock() + + allSlices, err := m.endpointSliceLister.EndpointSlices(endpointSlice.Namespace).List(labels.Set{kubernetesServiceNameLabel: svc}.AsSelector()) + if err != nil { + return fmt.Errorf("failed to fetch EndpointSlices for Service %s/%s: %w", endpointSlice.Namespace, svc, err) + } + + nodeToPods, affectedNodes := m.buildNodeToPodsMapping(allSlices) + m.cleanupStaleNodes(endpointSlice.Namespace, svc, affectedNodes) + m.updateNodeMetadata(endpointSlice.Namespace, svc, nodeToPods) + + return nil +} + +// cleanupEndpointSlice removes metadata associated with a deleted EndpointSlice. +func (m *metadataController) cleanupEndpointSlice(namespace, sliceName string) error { + serviceName := m.getCachedServiceName(namespace, sliceName) + if serviceName == "" { + return fmt.Errorf("no service found for EndpointSlice %s/%s in cache", namespace, sliceName) + } + + m.sliceCacheLock.Lock() + defer m.sliceCacheLock.Unlock() + + slices, ok := m.sliceServiceCache[namespace] + if ok { + delete(slices, sliceName) + if len(slices) == 0 { + delete(m.sliceServiceCache, namespace) + } + } + + remainingSlices, err := m.endpointSliceLister.EndpointSlices(namespace).List(labels.Set{kubernetesServiceNameLabel: serviceName}.AsSelector()) + if err != nil { + return fmt.Errorf("failed to fetch remaining EndpointSlices for Service %s/%s: %w", namespace, serviceName, err) + } + + nodeToPods, affectedNodes := m.buildNodeToPodsMapping(remainingSlices) + m.cleanupStaleNodes(namespace, serviceName, affectedNodes) + m.updateNodeMetadata(namespace, serviceName, nodeToPods) + + if len(remainingSlices) == 0 { + m.serviceToNodesLock.Lock() + delete(m.serviceToNodes, serviceName) + m.serviceToNodesLock.Unlock() + + err := m.deleteService(namespace, serviceName) + if err != nil { + return fmt.Errorf("failed to delete service metadata for Service %s/%s: %w", namespace, serviceName, err) + } + } + + return nil +} + +// buildNodeToPodsMapping builds the node-to-pods mapping from a list of EndpointSlices. +func (m *metadataController) buildNodeToPodsMapping(slices []*discv1.EndpointSlice) (map[string]map[string]sets.Set[string], sets.Set[string]) { + nodeToPods := make(map[string]map[string]sets.Set[string]) + affectedNodes := sets.New[string]() + + for _, slice := range slices { + for _, endpoint := range slice.Endpoints { + if endpoint.TargetRef == nil || endpoint.TargetRef.Kind != "Pod" { + continue + } + + podNamespace := endpoint.TargetRef.Namespace + podName := endpoint.TargetRef.Name + if podNamespace == "" || podName == "" { + continue + } + + nodeName := "" + if endpoint.NodeName != nil { + nodeName = *endpoint.NodeName + } + + affectedNodes.Insert(nodeName) + + if _, ok := nodeToPods[nodeName]; !ok { + nodeToPods[nodeName] = make(map[string]sets.Set[string]) + } + if _, ok := nodeToPods[nodeName][podNamespace]; !ok { + nodeToPods[nodeName][podNamespace] = sets.New[string]() + } + nodeToPods[nodeName][podNamespace].Insert(podName) + } + } + + return nodeToPods, affectedNodes +} + +// cleanupStaleNodes removes stale nodes for a given service. +func (m *metadataController) cleanupStaleNodes(namespace, serviceName string, affectedNodes sets.Set[string]) { + m.serviceToNodesLock.Lock() + defer m.serviceToNodesLock.Unlock() + + staleNodes := m.serviceToNodes[serviceName].Difference(affectedNodes) + for nodeName := range staleNodes { + log.Tracef("Cleaning up stale service metadata for Node %s and Service %s/%s", nodeName, namespace, serviceName) + metaBundle := m.store.getCopyOrNew(nodeName) + metaBundle.Services.Delete(namespace, serviceName) + m.store.set(nodeName, metaBundle) + } + + m.serviceToNodes[serviceName] = affectedNodes +} + +// updateNodeMetadata updates metadata for nodes based on node-to-pods mapping. +func (m *metadataController) updateNodeMetadata(namespace, serviceName string, nodeToPods map[string]map[string]sets.Set[string]) { + for nodeName, podsByNamespace := range nodeToPods { metaBundle := m.store.getCopyOrNew(nodeName) - metaBundle.Services.Delete(namespace, svc) // cleanup pods deleted from the service - for _, pods := range ns { + metaBundle.Services.Delete(namespace, serviceName) // Cleanup old metadata + for podNamespace, pods := range podsByNamespace { for podName := range pods { - metaBundle.Services.Set(namespace, podName, svc) + metaBundle.Services.Set(podNamespace, podName, serviceName) } } - m.store.set(nodeName, metaBundle) } +} - return nil +// getCachedServiceName retrieves the cached service name for a given EndpointSlice. +func (m *metadataController) getCachedServiceName(namespace, sliceName string) string { + m.sliceCacheLock.RLock() + defer m.sliceCacheLock.RUnlock() + + if slices, ok := m.sliceServiceCache[namespace]; ok { + if cachedEntry, ok := slices[sliceName]; ok { + return cachedEntry.serviceName + } + } + return "" } -func (m *metadataController) deleteMappedEndpoints(namespace, svc string) error { +// deleteService removes a service's metadata from all nodes. +func (m *metadataController) deleteService(namespace, svc string) error { nodes := m.wmeta.ListKubernetesMetadata(workloadmeta.IsNodeMetadata) // Delete the service from the metadata bundle for each node. diff --git a/pkg/util/kubernetes/apiserver/controllers/metadata_controller_test.go b/pkg/util/kubernetes/apiserver/controllers/metadata_controller_test.go index e01683d992bf1..9e2b14c295af2 100644 --- a/pkg/util/kubernetes/apiserver/controllers/metadata_controller_test.go +++ b/pkg/util/kubernetes/apiserver/controllers/metadata_controller_test.go @@ -9,6 +9,7 @@ package controllers import ( "context" + "strings" "testing" "time" @@ -16,7 +17,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.uber.org/fx" - v1 "k8s.io/api/core/v1" + corev1 "k8s.io/api/core/v1" + discv1 "k8s.io/api/discovery/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/types" @@ -41,9 +43,9 @@ import ( func TestMetadataControllerSyncEndpoints(t *testing.T) { client := fake.NewSimpleClientset() - metaController, informerFactory := newFakeMetadataController(client, newMockWorkloadMeta(t)) + metaController, informerFactory := newFakeMetadataController(client, newMockWorkloadMeta(t), false) - // don't use the global store so we can can inspect the store without + // don't use the global store so we can inspect the store without // it being modified by other tests. metaController.store = &metaBundleStore{ cache: gocache.New(gocache.NoExpiration, 5*time.Second), @@ -102,17 +104,17 @@ func TestMetadataControllerSyncEndpoints(t *testing.T) { tests := []struct { desc string delete bool // whether to add or delete endpoints - endpoints *v1.Endpoints + endpoints *corev1.Endpoints expectedBundles map[string]apiv1.NamespacesPodsStringsSet }{ { "one service on multiple nodes", false, - &v1.Endpoints{ + &corev1.Endpoints{ ObjectMeta: metav1.ObjectMeta{Namespace: "default", Name: "svc1"}, - Subsets: []v1.EndpointSubset{ + Subsets: []corev1.EndpointSubset{ { - Addresses: []v1.EndpointAddress{ + Addresses: []corev1.EndpointAddress{ newFakeEndpointAddress("node1", pod1), newFakeEndpointAddress("node2", pod2), }, @@ -135,11 +137,11 @@ func TestMetadataControllerSyncEndpoints(t *testing.T) { { "pod added to service", false, - &v1.Endpoints{ + &corev1.Endpoints{ ObjectMeta: metav1.ObjectMeta{Namespace: "default", Name: "svc1"}, - Subsets: []v1.EndpointSubset{ + Subsets: []corev1.EndpointSubset{ { - Addresses: []v1.EndpointAddress{ + Addresses: []corev1.EndpointAddress{ newFakeEndpointAddress("node1", pod1), newFakeEndpointAddress("node2", pod2), newFakeEndpointAddress("node1", pod3), @@ -164,11 +166,59 @@ func TestMetadataControllerSyncEndpoints(t *testing.T) { { "pod deleted from service", false, - &v1.Endpoints{ + &corev1.Endpoints{ ObjectMeta: metav1.ObjectMeta{Namespace: "default", Name: "svc1"}, - Subsets: []v1.EndpointSubset{ + Subsets: []corev1.EndpointSubset{ { - Addresses: []v1.EndpointAddress{ + Addresses: []corev1.EndpointAddress{ + newFakeEndpointAddress("node1", pod1), + newFakeEndpointAddress("node2", pod2), + }, + }, + }, + }, + map[string]apiv1.NamespacesPodsStringsSet{ + "node1": { + "default": { + "pod1_name": sets.New("svc1"), + }, + }, + "node2": { + "default": { + "pod2_name": sets.New("svc1"), + }, + }, + }, + }, + { + "pod deleted from service and node clears", + false, + &corev1.Endpoints{ + ObjectMeta: metav1.ObjectMeta{Namespace: "default", Name: "svc1"}, + Subsets: []corev1.EndpointSubset{ + { + Addresses: []corev1.EndpointAddress{ + newFakeEndpointAddress("node1", pod1), + }, + }, + }, + }, + map[string]apiv1.NamespacesPodsStringsSet{ + "node1": { + "default": { + "pod1_name": sets.New("svc1"), + }, + }, + }, + }, + { + "pod added back to service", + false, + &corev1.Endpoints{ + ObjectMeta: metav1.ObjectMeta{Namespace: "default", Name: "svc1"}, + Subsets: []corev1.EndpointSubset{ + { + Addresses: []corev1.EndpointAddress{ newFakeEndpointAddress("node1", pod1), newFakeEndpointAddress("node2", pod2), }, @@ -191,11 +241,11 @@ func TestMetadataControllerSyncEndpoints(t *testing.T) { { "add service for existing pod", false, - &v1.Endpoints{ + &corev1.Endpoints{ ObjectMeta: metav1.ObjectMeta{Namespace: "default", Name: "svc2"}, - Subsets: []v1.EndpointSubset{ + Subsets: []corev1.EndpointSubset{ { - Addresses: []v1.EndpointAddress{ + Addresses: []corev1.EndpointAddress{ newFakeEndpointAddress("node1", pod1), }, }, @@ -217,7 +267,7 @@ func TestMetadataControllerSyncEndpoints(t *testing.T) { { "delete service with pods on multiple nodes", true, - &v1.Endpoints{ + &corev1.Endpoints{ ObjectMeta: metav1.ObjectMeta{Namespace: "default", Name: "svc1"}, }, map[string]apiv1.NamespacesPodsStringsSet{ @@ -231,7 +281,7 @@ func TestMetadataControllerSyncEndpoints(t *testing.T) { { "add endpoints for leader election", false, - &v1.Endpoints{ + &corev1.Endpoints{ ObjectMeta: metav1.ObjectMeta{ Namespace: "default", Name: "leader-election", @@ -251,7 +301,7 @@ func TestMetadataControllerSyncEndpoints(t *testing.T) { { "update endpoints for leader election", false, - &v1.Endpoints{ + &corev1.Endpoints{ ObjectMeta: metav1.ObjectMeta{ Namespace: "default", Name: "leader-election", @@ -271,42 +321,341 @@ func TestMetadataControllerSyncEndpoints(t *testing.T) { { "delete every service", true, - &v1.Endpoints{ + &corev1.Endpoints{ ObjectMeta: metav1.ObjectMeta{Namespace: "default", Name: "svc2"}, }, map[string]apiv1.NamespacesPodsStringsSet{}, }, } - for i, tt := range tests { - t.Logf("Running step %d %s", i, tt.desc) - - store := informerFactory. - Core(). - V1(). - Endpoints(). - Informer(). - GetStore() - - var err error - if tt.delete { - err = store.Delete(tt.endpoints) - } else { - err = store.Add(tt.endpoints) - } - require.NoError(t, err) + for _, tt := range tests { + t.Run(tt.desc, func(t *testing.T) { + store := informerFactory. + Core(). + V1(). + Endpoints(). + Informer(). + GetStore() + + var err error + if tt.delete { + err = store.Delete(tt.endpoints) + } else { + err = store.Add(tt.endpoints) + } + require.NoError(t, err) + + key, err := cache.MetaNamespaceKeyFunc(tt.endpoints) + require.NoError(t, err) + + err = metaController.syncEndpoints(key) + require.NoError(t, err) + + nonNilKeys := metaController.countNonNilKeys() + assert.Equal(t, len(tt.expectedBundles), nonNilKeys, "Unexpected metaBundles found") + + for nodeName, expectedMapper := range tt.expectedBundles { + metaBundle, ok := metaController.store.get(nodeName) + require.True(t, ok, "No meta bundle for %s", nodeName) + assert.Equal(t, expectedMapper, metaBundle.Services, nodeName) + } + }) + } +} - key, err := cache.MetaNamespaceKeyFunc(tt.endpoints) - require.NoError(t, err) +func TestMetadataControllerSyncEndpointSlices(t *testing.T) { + client := fake.NewSimpleClientset() + + metaController, informerFactory := newFakeMetadataController(client, newMockWorkloadMeta(t), true) + + metaController.store = &metaBundleStore{ + cache: gocache.New(gocache.NoExpiration, 5*time.Second), + } + + pod1 := newFakePod( + "default", + "pod1_name", + "1111", + "1.1.1.1", + ) - err = metaController.syncEndpoints(key) + pod2 := newFakePod( + "default", + "pod2_name", + "2222", + "2.2.2.2", + ) + + pod3 := newFakePod( + "default", + "pod3_name", + "3333", + "3.3.3.3", + ) + + // Create nodes in workloadmeta + for _, nodeName := range []string{"node1", "node2", "node3"} { + err := metaController.wmeta.Push( + "metadata-controller", + workloadmeta.Event{ + Type: workloadmeta.EventTypeSet, + Entity: &workloadmeta.KubernetesMetadata{ + EntityID: workloadmeta.EntityID{ + Kind: workloadmeta.KindKubernetesMetadata, + ID: nodeName, + }, + EntityMeta: workloadmeta.EntityMeta{ + Name: nodeName, + }, + GVR: &schema.GroupVersionResource{ + Version: "v1", + Resource: "nodes", + }, + }, + }, + ) require.NoError(t, err) + } - for nodeName, expectedMapper := range tt.expectedBundles { - metaBundle, ok := metaController.store.get(nodeName) - require.True(t, ok, "No meta bundle for %s", nodeName) - assert.Equal(t, expectedMapper, metaBundle.Services, nodeName) - } + require.Eventually(t, func() bool { + return len(metaController.wmeta.ListKubernetesMetadata(workloadmeta.IsNodeMetadata)) == 3 + }, 5*time.Second, 100*time.Millisecond) + + tests := []struct { + desc string + delete bool + endpointSlices []*discv1.EndpointSlice + expectedBundles map[string]apiv1.NamespacesPodsStringsSet + expectedCacheLen int + }{ + { + "add service with multiple slices", + false, + []*discv1.EndpointSlice{ + { + ObjectMeta: metav1.ObjectMeta{ + Namespace: "default", + Name: "svc1-slice1", + Labels: map[string]string{"kubernetes.io/service-name": "svc1"}, + ResourceVersion: "v1", + }, + Endpoints: []discv1.Endpoint{ + newFakeEndpoint("node1", pod1), + newFakeEndpoint("node2", pod2), + }, + }, + { + ObjectMeta: metav1.ObjectMeta{ + Namespace: "default", + Name: "svc1-slice2", + Labels: map[string]string{"kubernetes.io/service-name": "svc1"}, + ResourceVersion: "v1", + }, + Endpoints: []discv1.Endpoint{ + newFakeEndpoint("node3", pod3), + }, + }, + }, + map[string]apiv1.NamespacesPodsStringsSet{ + "node1": { + "default": { + "pod1_name": sets.New("svc1"), + }, + }, + "node2": { + "default": { + "pod2_name": sets.New("svc1"), + }, + }, + "node3": { + "default": { + "pod3_name": sets.New("svc1"), + }, + }, + }, + 2, + }, + { + "add new service tied to an existing pod", + false, + []*discv1.EndpointSlice{ + { + ObjectMeta: metav1.ObjectMeta{ + Namespace: "default", + Name: "svc2-slice1", + Labels: map[string]string{"kubernetes.io/service-name": "svc2"}, + ResourceVersion: "v1", + }, + Endpoints: []discv1.Endpoint{ + newFakeEndpoint("node1", pod1), + }, + }, + }, + map[string]apiv1.NamespacesPodsStringsSet{ + "node1": { + "default": { + "pod1_name": sets.New("svc1", "svc2"), + }, + }, + "node2": { + "default": { + "pod2_name": sets.New("svc1"), + }, + }, + "node3": { + "default": { + "pod3_name": sets.New("svc1"), + }, + }, + }, + 3, // Cache length increases by 1 for svc2-slice1 + }, + { + "update slice to add pod", + false, + []*discv1.EndpointSlice{ + { + ObjectMeta: metav1.ObjectMeta{ + Namespace: "default", + Name: "svc2-slice1", + Labels: map[string]string{"kubernetes.io/service-name": "svc2"}, + ResourceVersion: "v2", + }, + Endpoints: []discv1.Endpoint{ + newFakeEndpoint("node1", pod1), + newFakeEndpoint("node2", pod2), + }, + }, + }, + map[string]apiv1.NamespacesPodsStringsSet{ + "node1": { + "default": { + "pod1_name": sets.New("svc1", "svc2"), + }, + }, + "node2": { + "default": { + "pod2_name": sets.New("svc1", "svc2"), + }, + }, + "node3": { + "default": { + "pod3_name": sets.New("svc1"), + }, + }, + }, + 3, + }, + { + "update slice to delete pod", + false, + []*discv1.EndpointSlice{ + { + ObjectMeta: metav1.ObjectMeta{ + Namespace: "default", + Name: "svc2-slice1", + Labels: map[string]string{"kubernetes.io/service-name": "svc2"}, + ResourceVersion: "v3", + }, + Endpoints: []discv1.Endpoint{ + newFakeEndpoint("node2", pod2), + }, + }, + }, + map[string]apiv1.NamespacesPodsStringsSet{ + "node1": { + "default": { + "pod1_name": sets.New("svc1"), + }, + }, + "node2": { + "default": { + "pod2_name": sets.New("svc1", "svc2"), + }, + }, + "node3": { + "default": { + "pod3_name": sets.New("svc1"), + }, + }, + }, + 3, + }, + { + "delete service with multiple slices", + true, + []*discv1.EndpointSlice{ + { + ObjectMeta: metav1.ObjectMeta{ + Namespace: "default", + Name: "svc1-slice1", + Labels: map[string]string{"kubernetes.io/service-name": "svc1"}, + ResourceVersion: "v2", + }, + }, + { + ObjectMeta: metav1.ObjectMeta{ + Namespace: "default", + Name: "svc1-slice2", + Labels: map[string]string{"kubernetes.io/service-name": "svc1"}, + ResourceVersion: "v2", + }, + }, + }, + map[string]apiv1.NamespacesPodsStringsSet{ + "node2": { + "default": { + "pod2_name": sets.New("svc2"), + }, + }, + }, + 1, + }, + } + + for _, tt := range tests { + t.Run(tt.desc, func(t *testing.T) { + store := informerFactory. + Discovery(). + V1(). + EndpointSlices(). + Informer(). + GetStore() + + var err error + if tt.delete { + for _, slice := range tt.endpointSlices { + err = store.Delete(slice) + require.NoError(t, err) + } + } else { + for _, slice := range tt.endpointSlices { + err = store.Add(slice) + require.NoError(t, err) + } + } + + for _, slice := range tt.endpointSlices { + key, err := cache.MetaNamespaceKeyFunc(slice) + require.NoError(t, err) + + err = metaController.syncEndpointSlices(key) + require.NoError(t, err) + } + + nonNilKeys := metaController.countNonNilKeys() + assert.Equal(t, len(tt.expectedBundles), nonNilKeys, "Unexpected metaBundles found") + + for nodeName, expectedMapper := range tt.expectedBundles { + metaBundle, ok := metaController.store.get(nodeName) + require.True(t, ok, "No meta bundle for %s", nodeName) + assert.Equal(t, expectedMapper, metaBundle.Services, nodeName) + } + + cacheLen := len(metaController.sliceServiceCache["default"]) + + assert.Equal(t, tt.expectedCacheLen, cacheLen, "Cache length mismatch") + }) } } @@ -320,13 +669,13 @@ func TestMetadataController(t *testing.T) { // Create a Ready Schedulable node // As we don't have a controller they don't need to have some heartbeat mechanism - node := &v1.Node{ - Spec: v1.NodeSpec{ + node := &corev1.Node{ + Spec: corev1.NodeSpec{ PodCIDR: "192.168.1.0/24", Unschedulable: false, }, - Status: v1.NodeStatus{ - Addresses: []v1.NodeAddress{ + Status: corev1.NodeStatus{ + Addresses: []corev1.NodeAddress{ { Address: "172.31.119.125", Type: "InternalIP", @@ -340,7 +689,7 @@ func TestMetadataController(t *testing.T) { Type: "Hostname", }, }, - Conditions: []v1.NodeCondition{ + Conditions: []corev1.NodeCondition{ { Type: "Ready", Status: "True", @@ -354,13 +703,13 @@ func TestMetadataController(t *testing.T) { _, err := c.Nodes().Create(context.TODO(), node, metav1.CreateOptions{}) require.NoError(t, err) - pod := &v1.Pod{ + pod := &corev1.Pod{ ObjectMeta: metav1.ObjectMeta{ Namespace: metav1.NamespaceDefault, }, - Spec: v1.PodSpec{ + Spec: corev1.PodSpec{ NodeName: node.Name, - Containers: []v1.Container{ + Containers: []corev1.Container{ { Name: "nginx", Image: "nginx:latest", @@ -373,49 +722,49 @@ func TestMetadataController(t *testing.T) { pendingPod, err := c.Pods("default").Create(context.TODO(), pod, metav1.CreateOptions{}) require.NoError(t, err) - pendingPod.Status = v1.PodStatus{ + pendingPod.Status = corev1.PodStatus{ Phase: "Running", PodIP: "172.17.0.1", HostIP: "172.31.119.125", - Conditions: []v1.PodCondition{ + Conditions: []corev1.PodCondition{ { Type: "Ready", Status: "True", }, }, // mark it ready - ContainerStatuses: []v1.ContainerStatus{ + ContainerStatuses: []corev1.ContainerStatus{ { Name: "nginx", Ready: true, Image: "nginx:latest", - State: v1.ContainerState{Running: &v1.ContainerStateRunning{StartedAt: metav1.Now()}}, + State: corev1.ContainerState{Running: &corev1.ContainerStateRunning{StartedAt: metav1.Now()}}, }, }, } _, err = c.Pods("default").UpdateStatus(context.TODO(), pendingPod, metav1.UpdateOptions{}) require.NoError(t, err) - svc := &v1.Service{ - Spec: v1.ServiceSpec{ + svc := &corev1.Service{ + Spec: corev1.ServiceSpec{ Selector: map[string]string{ "app": "nginx", }, - Ports: []v1.ServicePort{{Port: 443}}, + Ports: []corev1.ServicePort{{Port: 443}}, }, } svc.Name = "nginx-1" _, err = c.Services("default").Create(context.TODO(), svc, metav1.CreateOptions{}) require.NoError(t, err) - ep := &v1.Endpoints{ - Subsets: []v1.EndpointSubset{ + ep := &corev1.Endpoints{ + Subsets: []corev1.EndpointSubset{ { - Addresses: []v1.EndpointAddress{ + Addresses: []corev1.EndpointAddress{ { IP: pendingPod.Status.PodIP, NodeName: &node.Name, - TargetRef: &v1.ObjectReference{ + TargetRef: &corev1.ObjectReference{ Kind: "Pod", Namespace: pendingPod.Namespace, Name: pendingPod.Name, @@ -423,7 +772,7 @@ func TestMetadataController(t *testing.T) { }, }, }, - Ports: []v1.EndpointPort{ + Ports: []corev1.EndpointPort{ { Name: "https", Port: 443, @@ -446,7 +795,7 @@ func TestMetadataController(t *testing.T) { _, err = c.Endpoints("default").Create(context.TODO(), ep, metav1.CreateOptions{}) require.NoError(t, err) - metaController, informerFactory := newFakeMetadataController(client, newMockWorkloadMeta(t)) + metaController, informerFactory := newFakeMetadataController(client, newMockWorkloadMeta(t), false) stop := make(chan struct{}) defer close(stop) @@ -454,7 +803,7 @@ func TestMetadataController(t *testing.T) { go metaController.run(stop) testutil.AssertTrueBeforeTimeout(t, 100*time.Millisecond, 2*time.Second, func() bool { - return metaController.endpointsListerSynced() + return metaController.listerSynced() }) testutil.AssertTrueBeforeTimeout(t, 100*time.Millisecond, 2*time.Second, func() bool { @@ -498,34 +847,35 @@ func newMockWorkloadMeta(t *testing.T) workloadmeta.Component { ) } -func newFakeMetadataController(client kubernetes.Interface, wmeta workloadmeta.Component) (*metadataController, informers.SharedInformerFactory) { +func newFakeMetadataController(client kubernetes.Interface, wmeta workloadmeta.Component, useEndpointSlices bool) (*metadataController, informers.SharedInformerFactory) { informerFactory := informers.NewSharedInformerFactory(client, 1*time.Second) metaController := newMetadataController( - informerFactory.Core().V1().Endpoints(), + informerFactory, wmeta, + useEndpointSlices, ) return metaController, informerFactory } -func newFakePod(namespace, name, uid, ip string) v1.Pod { - return v1.Pod{ +func newFakePod(namespace, name, uid, ip string) corev1.Pod { + return corev1.Pod{ TypeMeta: metav1.TypeMeta{Kind: "Pod"}, ObjectMeta: metav1.ObjectMeta{ Name: name, Namespace: namespace, UID: types.UID(uid), }, - Status: v1.PodStatus{PodIP: ip}, + Status: corev1.PodStatus{PodIP: ip}, } } -func newFakeEndpointAddress(nodeName string, pod v1.Pod) v1.EndpointAddress { - return v1.EndpointAddress{ +func newFakeEndpointAddress(nodeName string, pod corev1.Pod) corev1.EndpointAddress { + return corev1.EndpointAddress{ IP: pod.Status.PodIP, NodeName: &nodeName, - TargetRef: &v1.ObjectReference{ + TargetRef: &corev1.ObjectReference{ Kind: pod.Kind, Namespace: pod.Namespace, Name: pod.Name, @@ -533,3 +883,36 @@ func newFakeEndpointAddress(nodeName string, pod v1.Pod) v1.EndpointAddress { }, } } + +func newFakeEndpoint(nodeName string, pod corev1.Pod) discv1.Endpoint { + return discv1.Endpoint{ + Addresses: []string{pod.Status.PodIP}, + NodeName: &nodeName, + TargetRef: &corev1.ObjectReference{ + Kind: pod.Kind, + Namespace: pod.Namespace, + Name: pod.Name, + UID: pod.UID, + }, + } +} + +func (m *metadataController) countNonNilKeys() int { + nonNilKeys := 0 + for _, key := range m.store.listKeys() { + value, _ := m.store.get(key) + if value != nil && len(value.Services) > 0 { + nonNilKeys++ + } + } + return nonNilKeys +} + +func (m *metaBundleStore) listKeys() []string { + keys := []string{} + for k := range m.cache.Items() { + k = strings.TrimPrefix(k, "agent/KubernetesMetadataMapping/") + keys = append(keys, k) + } + return keys +} diff --git a/pkg/util/kubernetes/apiserver/controllers/wpa_controller_test.go b/pkg/util/kubernetes/apiserver/controllers/wpa_controller_test.go index 89374ba3ea185..ffc573d99d355 100644 --- a/pkg/util/kubernetes/apiserver/controllers/wpa_controller_test.go +++ b/pkg/util/kubernetes/apiserver/controllers/wpa_controller_test.go @@ -18,7 +18,6 @@ import ( "github.com/DataDog/watermarkpodautoscaler/apis/datadoghq/v1alpha1" "github.com/cenkalti/backoff" - "github.com/cihub/seelog" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "gopkg.in/zorkian/go-datadog-api.v2" @@ -654,11 +653,10 @@ func TestWPACRDCheck(t *testing.T) { } func configureLoggerForTest(t *testing.T) func() { - logger, err := seelog.LoggerFromWriterWithMinLevel(testWriter{t}, seelog.TraceLvl) + logger, err := log.LoggerFromWriterWithMinLevel(testWriter{t}, log.TraceLvl) if err != nil { t.Fatalf("unable to configure logger, err: %v", err) } - seelog.ReplaceLogger(logger) //nolint:errcheck log.SetupLogger(logger, "trace") return log.Flush } diff --git a/pkg/util/kubernetes/apiserver/leaderelection/leaderelection.go b/pkg/util/kubernetes/apiserver/leaderelection/leaderelection.go index 45ea62c6e2d26..2c55b5042b8ce 100644 --- a/pkg/util/kubernetes/apiserver/leaderelection/leaderelection.go +++ b/pkg/util/kubernetes/apiserver/leaderelection/leaderelection.go @@ -228,9 +228,15 @@ func (le *LeaderEngine) EnsureLeaderElectionRuns() error { func (le *LeaderEngine) runLeaderElection() { for { - log.Infof("Starting leader election process for %q...", le.HolderIdentity) - le.leaderElector.Run(le.ctx) - log.Info("Leader election lost") + select { + case <-le.ctx.Done(): + log.Infof("Quitting leader election process: context was cancelled") + return + default: + log.Infof("Starting leader election process for %q...", le.HolderIdentity) + le.leaderElector.Run(le.ctx) + log.Info("Leader election lost") + } } } @@ -275,17 +281,23 @@ func (le *LeaderEngine) IsLeader() bool { return le.GetLeader() == le.HolderIdentity } -// Subscribe allows any component to receive a notification -// when the current process becomes leader. +// Subscribe allows any component to receive a notification when leadership state of the current +// process changes. +// +// The subscriber will not be notified about the leadership state change if the previous notification +// hasn't yet been consumed from the notification channel. +// // Calling Subscribe is optional, use IsLeader if the client doesn't need an event-based approach. -func (le *LeaderEngine) Subscribe() <-chan struct{} { - c := make(chan struct{}, 5) // buffered channel to avoid blocking in case of stuck subscriber +func (le *LeaderEngine) Subscribe() (leadershipChangeNotif <-chan struct{}, isLeader func() bool) { + c := make(chan struct{}, 1) le.m.Lock() le.subscribers = append(le.subscribers, c) le.m.Unlock() - return c + leadershipChangeNotif = c + isLeader = le.IsLeader + return } func detectLeases(client discovery.DiscoveryInterface) (bool, error) { diff --git a/pkg/util/kubernetes/apiserver/leaderelection/leaderelection_engine.go b/pkg/util/kubernetes/apiserver/leaderelection/leaderelection_engine.go index d134c95f17eb2..4a765a46307a3 100644 --- a/pkg/util/kubernetes/apiserver/leaderelection/leaderelection_engine.go +++ b/pkg/util/kubernetes/apiserver/leaderelection/leaderelection_engine.go @@ -154,7 +154,7 @@ func (le *LeaderEngine) newElection() (*ld.LeaderElector, error) { OnStartedLeading: func(context.Context) { le.updateLeaderIdentity(le.HolderIdentity) le.reportLeaderMetric(true) - le.notify() + le.notify() // current process gained leadership log.Infof("Started leading as %q...", le.HolderIdentity) }, // OnStoppedLeading shouldn't be called unless the election is lost. This could happen if @@ -162,6 +162,7 @@ func (le *LeaderEngine) newElection() (*ld.LeaderElector, error) { OnStoppedLeading: func() { le.updateLeaderIdentity("") le.reportLeaderMetric(false) + le.notify() // current process lost leadership log.Infof("Stopped leading %q", le.HolderIdentity) }, } @@ -219,14 +220,18 @@ func (le *LeaderEngine) reportLeaderMetric(isLeader bool) { le.leaderMetric.Set(1.0, metrics.JoinLeaderValue, strconv.FormatBool(isLeader)) } -// notify sends a notification to subscribers when the current process becomes leader. -// notify is a simplistic notifier but can be extended to send different notification -// kinds (leadership acquisition / loss) in the future if needed. +// notify sends a notification to subscribers when the leadership state of the current +// process changes func (le *LeaderEngine) notify() { le.m.Lock() defer le.m.Unlock() for _, s := range le.subscribers { + if len(s) > 0 { + // subscriber already notified about the change in leadership state + continue + } + s <- struct{}{} } } diff --git a/pkg/util/kubernetes/apiserver/leaderelection/leaderelection_test.go b/pkg/util/kubernetes/apiserver/leaderelection/leaderelection_test.go index af604ec84e37c..f07e2b9d2e7c5 100644 --- a/pkg/util/kubernetes/apiserver/leaderelection/leaderelection_test.go +++ b/pkg/util/kubernetes/apiserver/leaderelection/leaderelection_test.go @@ -202,8 +202,9 @@ func TestSubscribe(t *testing.T) { } { t.Run(fmt.Sprintf("case %d: %s", nb, tc.name), func(t *testing.T) { client := fake.NewSimpleClientset() + ctx, cancel := context.WithCancel(context.Background()) le := &LeaderEngine{ - ctx: context.Background(), + ctx: ctx, HolderIdentity: "foo", LeaseName: leaseName, LeaderNamespace: "default", @@ -211,11 +212,11 @@ func TestSubscribe(t *testing.T) { coreClient: client.CoreV1(), coordClient: client.CoordinationV1(), leaderMetric: &dummyGauge{}, - lockType: cmLock.ConfigMapsResourceLock, + lockType: tc.lockType, } - notif1 := le.Subscribe() - notif2 := le.Subscribe() + notif1, _ := le.Subscribe() + notif2, _ := le.Subscribe() require.Len(t, le.subscribers, 2) err := tc.getTokenFunc(client) @@ -227,10 +228,46 @@ func TestSubscribe(t *testing.T) { le.EnsureLeaderElectionRuns() require.True(t, le.IsLeader()) + err = tc.getTokenFunc(client) + require.NoError(t, err) + counter1, counter2 := 0, 0 for { select { case <-notif1: + counter1++ + require.Truef(t, le.IsLeader(), "Expected to be leader") + if counter1 > 1 { + require.Fail(t, "Received too many notifications") + break + } + + case <-notif2: + counter2++ + require.Truef(t, le.IsLeader(), "Expected to be leader") + if counter2 > 1 { + require.Fail(t, "Received too many notifications") + break + } + + case <-time.After(5 * time.Second): + require.Fail(t, "Waiting on leader notification timed out") + break + } + + if counter1 == 1 && counter2 == 1 { + break + } + } + + // simulate leadership lease loss by cancelling leader election context + cancel() + + counter1, counter2 = 0, 0 + for { + select { + case <-notif1: + require.Falsef(t, le.IsLeader(), "Expected to be a follower") counter1++ if counter1 > 1 { require.Fail(t, "Received too many notifications") @@ -238,6 +275,7 @@ func TestSubscribe(t *testing.T) { } case <-notif2: + require.Falsef(t, le.IsLeader(), "Expected to be a follower") counter2++ if counter2 > 1 { require.Fail(t, "Received too many notifications") @@ -253,6 +291,7 @@ func TestSubscribe(t *testing.T) { break } } + }) } diff --git a/pkg/util/log/go.mod b/pkg/util/log/go.mod index 3f4354d5c8445..a439a62283f76 100644 --- a/pkg/util/log/go.mod +++ b/pkg/util/log/go.mod @@ -13,9 +13,11 @@ require ( ) require ( + github.com/DataDog/datadog-agent/pkg/version v0.59.1 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect go.uber.org/multierr v1.11.0 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) + +replace github.com/DataDog/datadog-agent/pkg/version => ../../version diff --git a/pkg/util/log/go.sum b/pkg/util/log/go.sum index f46b720dc7374..ffca41d546584 100644 --- a/pkg/util/log/go.sum +++ b/pkg/util/log/go.sum @@ -23,7 +23,5 @@ go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/pkg/util/log/levels.go b/pkg/util/log/levels.go new file mode 100644 index 0000000000000..52e8dd99c49e0 --- /dev/null +++ b/pkg/util/log/levels.go @@ -0,0 +1,47 @@ +// 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 log + +import "github.com/cihub/seelog" + +// LogLevel is the type of log levels +// +//nolint:revive // keeping the original type name from seelog +type LogLevel seelog.LogLevel + +// Log levels +const ( + TraceLvl LogLevel = seelog.TraceLvl + DebugLvl LogLevel = seelog.DebugLvl + InfoLvl LogLevel = seelog.InfoLvl + WarnLvl LogLevel = seelog.WarnLvl + ErrorLvl LogLevel = seelog.ErrorLvl + CriticalLvl LogLevel = seelog.CriticalLvl + Off LogLevel = seelog.Off +) + +// Log level string representations +const ( + TraceStr = seelog.TraceStr + DebugStr = seelog.DebugStr + InfoStr = seelog.InfoStr + WarnStr = seelog.WarnStr + ErrorStr = seelog.ErrorStr + CriticalStr = seelog.CriticalStr + OffStr = seelog.OffStr +) + +func (level LogLevel) String() string { + return seelog.LogLevel(level).String() +} + +// LogLevelFromString returns a LogLevel from a string +// +//nolint:revive // keeping the original function name from seelog +func LogLevelFromString(levelStr string) (LogLevel, bool) { + level, ok := seelog.LogLevelFromString(levelStr) + return LogLevel(level), ok +} diff --git a/pkg/util/log/log.go b/pkg/util/log/log.go index 0e1ecaa23e3e5..3eb9ef9fb2679 100644 --- a/pkg/util/log/log.go +++ b/pkg/util/log/log.go @@ -22,7 +22,6 @@ import ( "strings" "sync" - "github.com/cihub/seelog" "go.uber.org/atomic" "github.com/DataDog/datadog-agent/pkg/util/scrubber" @@ -53,9 +52,9 @@ var ( // DatadogLogger wrapper structure for seelog type DatadogLogger struct { - inner seelog.LoggerInterface - level seelog.LogLevel - extra map[string]seelog.LoggerInterface + inner LoggerInterface + level LogLevel + extra map[string]LoggerInterface l sync.RWMutex } @@ -64,7 +63,7 @@ type DatadogLogger struct { */ // SetupLogger setup agent wide logger -func SetupLogger(i seelog.LoggerInterface, level string) { +func SetupLogger(i LoggerInterface, level string) { logger.Store(setupCommonLogger(i, level)) // Flush the log entries logged before initialization now that the logger is initialized @@ -76,17 +75,17 @@ func SetupLogger(i seelog.LoggerInterface, level string) { logsBuffer = []func(){} } -func setupCommonLogger(i seelog.LoggerInterface, level string) *DatadogLogger { +func setupCommonLogger(i LoggerInterface, level string) *DatadogLogger { l := &DatadogLogger{ inner: i, - extra: make(map[string]seelog.LoggerInterface), + extra: make(map[string]LoggerInterface), } - lvl, ok := seelog.LogLevelFromString(level) + lvl, ok := LogLevelFromString(level) if !ok { - lvl = seelog.InfoLvl + lvl = InfoLvl } - l.level = lvl + l.level = LogLevel(lvl) // We're not going to call DatadogLogger directly, but using the // exported functions, that will give us two frames in the stack @@ -121,7 +120,7 @@ func (sw *DatadogLogger) scrub(s string) string { // ChangeLogLevel changes the current log level, valid levels are trace, debug, // info, warn, error, critical and off, it requires a new seelog logger because // an existing one cannot be updated -func ChangeLogLevel(li seelog.LoggerInterface, level string) error { +func ChangeLogLevel(li LoggerInterface, level string) error { if err := logger.changeLogLevel(level); err != nil { return err } @@ -149,36 +148,36 @@ func (sw *loggerPointer) changeLogLevel(level string) error { return errors.New("cannot change loglevel: logger is initialized however logger.inner is nil") } - lvl, ok := seelog.LogLevelFromString(strings.ToLower(level)) + lvl, ok := LogLevelFromString(strings.ToLower(level)) if !ok { return errors.New("bad log level") } - l.level = lvl + l.level = LogLevel(lvl) return nil } // GetLogLevel returns a seelog native representation of the current log level -func GetLogLevel() (seelog.LogLevel, error) { +func GetLogLevel() (LogLevel, error) { return logger.getLogLevel() } -func (sw *loggerPointer) getLogLevel() (seelog.LogLevel, error) { +func (sw *loggerPointer) getLogLevel() (LogLevel, error) { l := sw.Load() if l == nil { - return seelog.InfoLvl, errors.New("cannot get loglevel: logger not initialized") + return InfoLvl, errors.New("cannot get loglevel: logger not initialized") } l.l.RLock() defer l.l.RUnlock() if l.inner == nil { - return seelog.InfoLvl, errors.New("cannot get loglevel: logger not initialized") + return InfoLvl, errors.New("cannot get loglevel: logger not initialized") } return l.level, nil } // ShouldLog returns whether a given log level should be logged by the default logger -func ShouldLog(lvl seelog.LogLevel) bool { +func ShouldLog(lvl LogLevel) bool { // The lock stay in the exported function due to the use of `shouldLog` in function that already hold the lock l := logger.Load() if l != nil { @@ -190,7 +189,7 @@ func ShouldLog(lvl seelog.LogLevel) bool { } // This function should be called with `sw.l` held -func (sw *DatadogLogger) shouldLog(level seelog.LogLevel) bool { +func (sw *DatadogLogger) shouldLog(level LogLevel) bool { return level >= sw.level } @@ -203,7 +202,7 @@ func ValidateLogLevel(logLevel string) (string, error) { seelogLogLevel = "warn" } - if _, found := seelog.LogLevelFromString(seelogLogLevel); !found { + if _, found := LogLevelFromString(seelogLogLevel); !found { return "", fmt.Errorf("unknown log level: %s", seelogLogLevel) } return seelogLogLevel, nil @@ -214,10 +213,10 @@ func ValidateLogLevel(logLevel string) (string, error) { */ // RegisterAdditionalLogger registers an additional logger for logging -func RegisterAdditionalLogger(n string, li seelog.LoggerInterface) error { +func RegisterAdditionalLogger(n string, li LoggerInterface) error { return logger.registerAdditionalLogger(n, li) } -func (sw *loggerPointer) registerAdditionalLogger(n string, li seelog.LoggerInterface) error { +func (sw *loggerPointer) registerAdditionalLogger(n string, li LoggerInterface) error { l := sw.Load() if l == nil { return errors.New("cannot register: logger not initialized") @@ -244,10 +243,10 @@ func (sw *loggerPointer) registerAdditionalLogger(n string, li seelog.LoggerInte } // ReplaceLogger allows replacing the internal logger, returns old logger -func ReplaceLogger(li seelog.LoggerInterface) seelog.LoggerInterface { +func ReplaceLogger(li LoggerInterface) LoggerInterface { return logger.replaceInnerLogger(li) } -func (sw *loggerPointer) replaceInnerLogger(li seelog.LoggerInterface) seelog.LoggerInterface { +func (sw *loggerPointer) replaceInnerLogger(li LoggerInterface) LoggerInterface { l := sw.Load() if l == nil { return nil // Return nil if logger is not initialized @@ -291,7 +290,7 @@ func (sw *loggerPointer) flush() { // log logs a message at the given level, using either bufferFunc (if logging is not yet set up) or // scrubAndLogFunc, and treating the variadic args as the message. -func log(logLevel seelog.LogLevel, bufferFunc func(), scrubAndLogFunc func(string), v ...interface{}) { +func log(logLevel LogLevel, bufferFunc func(), scrubAndLogFunc func(string), v ...interface{}) { l := logger.Load() if l == nil { @@ -310,7 +309,7 @@ func log(logLevel seelog.LogLevel, bufferFunc func(), scrubAndLogFunc func(strin } } -func logWithError(logLevel seelog.LogLevel, bufferFunc func(), scrubAndLogFunc func(string) error, fallbackStderr bool, v ...interface{}) error { +func logWithError(logLevel LogLevel, bufferFunc func(), scrubAndLogFunc func(string) error, fallbackStderr bool, v ...interface{}) error { l := logger.Load() if l == nil { @@ -353,7 +352,7 @@ func logWithError(logLevel seelog.LogLevel, bufferFunc func(), scrubAndLogFunc f * logFormat functions */ -func logFormat(logLevel seelog.LogLevel, bufferFunc func(), scrubAndLogFunc func(string, ...interface{}), format string, params ...interface{}) { +func logFormat(logLevel LogLevel, bufferFunc func(), scrubAndLogFunc func(string, ...interface{}), format string, params ...interface{}) { l := logger.Load() if l == nil { @@ -370,7 +369,7 @@ func logFormat(logLevel seelog.LogLevel, bufferFunc func(), scrubAndLogFunc func scrubAndLogFunc(format, params...) } } -func logFormatWithError(logLevel seelog.LogLevel, bufferFunc func(), scrubAndLogFunc func(string, ...interface{}) error, format string, fallbackStderr bool, params ...interface{}) error { +func logFormatWithError(logLevel LogLevel, bufferFunc func(), scrubAndLogFunc func(string, ...interface{}) error, format string, fallbackStderr bool, params ...interface{}) error { l := logger.Load() if l == nil { @@ -412,7 +411,7 @@ func logFormatWithError(logLevel seelog.LogLevel, bufferFunc func(), scrubAndLog * logContext functions */ -func logContext(logLevel seelog.LogLevel, bufferFunc func(), scrubAndLogFunc func(string), message string, depth int, context ...interface{}) { +func logContext(logLevel LogLevel, bufferFunc func(), scrubAndLogFunc func(string), message string, depth int, context ...interface{}) { l := logger.Load() if l == nil { @@ -433,7 +432,7 @@ func logContext(logLevel seelog.LogLevel, bufferFunc func(), scrubAndLogFunc fun l.inner.SetAdditionalStackDepth(defaultStackDepth) //nolint:errcheck } } -func logContextWithError(logLevel seelog.LogLevel, bufferFunc func(), scrubAndLogFunc func(string) error, message string, fallbackStderr bool, depth int, context ...interface{}) error { +func logContextWithError(logLevel LogLevel, bufferFunc func(), scrubAndLogFunc func(string) error, message string, fallbackStderr bool, depth int, context ...interface{}) error { l := logger.Load() if l == nil { @@ -758,29 +757,29 @@ func formatErrorc(message string, context ...interface{}) error { // Trace logs at the trace level func Trace(v ...interface{}) { - log(seelog.TraceLvl, func() { Trace(v...) }, logger.trace, v...) + log(TraceLvl, func() { Trace(v...) }, logger.trace, v...) } // Tracef logs with format at the trace level func Tracef(format string, params ...interface{}) { - logFormat(seelog.TraceLvl, func() { Tracef(format, params...) }, logger.tracef, format, params...) + logFormat(TraceLvl, func() { Tracef(format, params...) }, logger.tracef, format, params...) } // TracefStackDepth logs with format at the trace level and the current stack depth plus the given depth func TracefStackDepth(depth int, format string, params ...interface{}) { currentLevel, _ := GetLogLevel() - if currentLevel > seelog.TraceLvl { + if currentLevel > TraceLvl { return } msg := fmt.Sprintf(format, params...) - log(seelog.TraceLvl, func() { TraceStackDepth(depth, msg) }, func(s string) { + log(TraceLvl, func() { TraceStackDepth(depth, msg) }, func(s string) { logger.traceStackDepth(s, depth) }, msg) } // TracecStackDepth logs at the trace level with context and the current stack depth plus the additional given one func TracecStackDepth(message string, depth int, context ...interface{}) { - logContext(seelog.TraceLvl, func() { Tracec(message, context...) }, logger.trace, message, depth, context...) + logContext(TraceLvl, func() { Tracec(message, context...) }, logger.trace, message, depth, context...) } // Tracec logs at the trace level with context @@ -791,36 +790,36 @@ func Tracec(message string, context ...interface{}) { // TraceFunc calls and logs the result of 'logFunc' if and only if Trace (or more verbose) logs are enabled func TraceFunc(logFunc func() string) { currentLevel, _ := GetLogLevel() - if currentLevel <= seelog.TraceLvl { + if currentLevel <= TraceLvl { TraceStackDepth(2, logFunc()) } } // Debug logs at the debug level func Debug(v ...interface{}) { - log(seelog.DebugLvl, func() { Debug(v...) }, logger.debug, v...) + log(DebugLvl, func() { Debug(v...) }, logger.debug, v...) } // Debugf logs with format at the debug level func Debugf(format string, params ...interface{}) { - logFormat(seelog.DebugLvl, func() { Debugf(format, params...) }, logger.debugf, format, params...) + logFormat(DebugLvl, func() { Debugf(format, params...) }, logger.debugf, format, params...) } // DebugfStackDepth logs with format at the debug level and the current stack depth plus the given depth func DebugfStackDepth(depth int, format string, params ...interface{}) { currentLevel, _ := GetLogLevel() - if currentLevel > seelog.DebugLvl { + if currentLevel > DebugLvl { return } msg := fmt.Sprintf(format, params...) - log(seelog.DebugLvl, func() { DebugStackDepth(depth, msg) }, func(s string) { + log(DebugLvl, func() { DebugStackDepth(depth, msg) }, func(s string) { logger.debugStackDepth(s, depth) }, msg) } // DebugcStackDepth logs at the debug level with context and the current stack depth plus the additional given one func DebugcStackDepth(message string, depth int, context ...interface{}) { - logContext(seelog.DebugLvl, func() { Debugc(message, context...) }, logger.debug, message, depth, context...) + logContext(DebugLvl, func() { Debugc(message, context...) }, logger.debug, message, depth, context...) } // Debugc logs at the debug level with context @@ -831,36 +830,36 @@ func Debugc(message string, context ...interface{}) { // DebugFunc calls and logs the result of 'logFunc' if and only if Debug (or more verbose) logs are enabled func DebugFunc(logFunc func() string) { currentLevel, _ := GetLogLevel() - if currentLevel <= seelog.DebugLvl { + if currentLevel <= DebugLvl { DebugStackDepth(2, logFunc()) } } // Info logs at the info level func Info(v ...interface{}) { - log(seelog.InfoLvl, func() { Info(v...) }, logger.info, v...) + log(InfoLvl, func() { Info(v...) }, logger.info, v...) } // Infof logs with format at the info level func Infof(format string, params ...interface{}) { - logFormat(seelog.InfoLvl, func() { Infof(format, params...) }, logger.infof, format, params...) + logFormat(InfoLvl, func() { Infof(format, params...) }, logger.infof, format, params...) } // InfofStackDepth logs with format at the info level and the current stack depth plus the given depth func InfofStackDepth(depth int, format string, params ...interface{}) { currentLevel, _ := GetLogLevel() - if currentLevel > seelog.InfoLvl { + if currentLevel > InfoLvl { return } msg := fmt.Sprintf(format, params...) - log(seelog.InfoLvl, func() { InfoStackDepth(depth, msg) }, func(s string) { + log(InfoLvl, func() { InfoStackDepth(depth, msg) }, func(s string) { logger.infoStackDepth(s, depth) }, msg) } // InfocStackDepth logs at the info level with context and the current stack depth plus the additional given one func InfocStackDepth(message string, depth int, context ...interface{}) { - logContext(seelog.InfoLvl, func() { Infoc(message, context...) }, logger.info, message, depth, context...) + logContext(InfoLvl, func() { Infoc(message, context...) }, logger.info, message, depth, context...) } // Infoc logs at the info level with context @@ -871,32 +870,32 @@ func Infoc(message string, context ...interface{}) { // InfoFunc calls and logs the result of 'logFunc' if and only if Info (or more verbose) logs are enabled func InfoFunc(logFunc func() string) { currentLevel, _ := GetLogLevel() - if currentLevel <= seelog.InfoLvl { + if currentLevel <= InfoLvl { InfoStackDepth(2, logFunc()) } } // Warn logs at the warn level and returns an error containing the formated log message func Warn(v ...interface{}) error { - return logWithError(seelog.WarnLvl, func() { _ = Warn(v...) }, logger.warn, false, v...) + return logWithError(WarnLvl, func() { _ = Warn(v...) }, logger.warn, false, v...) } // Warnf logs with format at the warn level and returns an error containing the formated log message func Warnf(format string, params ...interface{}) error { - return logFormatWithError(seelog.WarnLvl, func() { _ = Warnf(format, params...) }, logger.warnf, format, false, params...) + return logFormatWithError(WarnLvl, func() { _ = Warnf(format, params...) }, logger.warnf, format, false, params...) } // WarnfStackDepth logs with format at the warn level and the current stack depth plus the given depth func WarnfStackDepth(depth int, format string, params ...interface{}) error { msg := fmt.Sprintf(format, params...) - return logWithError(seelog.WarnLvl, func() { _ = WarnStackDepth(depth, msg) }, func(s string) error { + return logWithError(WarnLvl, func() { _ = WarnStackDepth(depth, msg) }, func(s string) error { return logger.warnStackDepth(s, depth) }, false, msg) } // WarncStackDepth logs at the warn level with context and the current stack depth plus the additional given one and returns an error containing the formated log message func WarncStackDepth(message string, depth int, context ...interface{}) error { - return logContextWithError(seelog.WarnLvl, func() { _ = Warnc(message, context...) }, logger.warn, message, false, depth, context...) + return logContextWithError(WarnLvl, func() { _ = Warnc(message, context...) }, logger.warn, message, false, depth, context...) } // Warnc logs at the warn level with context and returns an error containing the formated log message @@ -907,32 +906,32 @@ func Warnc(message string, context ...interface{}) error { // WarnFunc calls and logs the result of 'logFunc' if and only if Warn (or more verbose) logs are enabled func WarnFunc(logFunc func() string) { currentLevel, _ := GetLogLevel() - if currentLevel <= seelog.WarnLvl { + if currentLevel <= WarnLvl { _ = WarnStackDepth(2, logFunc()) } } // Error logs at the error level and returns an error containing the formated log message func Error(v ...interface{}) error { - return logWithError(seelog.ErrorLvl, func() { _ = Error(v...) }, logger.error, true, v...) + return logWithError(ErrorLvl, func() { _ = Error(v...) }, logger.error, true, v...) } // Errorf logs with format at the error level and returns an error containing the formated log message func Errorf(format string, params ...interface{}) error { - return logFormatWithError(seelog.ErrorLvl, func() { _ = Errorf(format, params...) }, logger.errorf, format, true, params...) + return logFormatWithError(ErrorLvl, func() { _ = Errorf(format, params...) }, logger.errorf, format, true, params...) } // ErrorfStackDepth logs with format at the error level and the current stack depth plus the given depth func ErrorfStackDepth(depth int, format string, params ...interface{}) error { msg := fmt.Sprintf(format, params...) - return logWithError(seelog.ErrorLvl, func() { _ = ErrorStackDepth(depth, msg) }, func(s string) error { + return logWithError(ErrorLvl, func() { _ = ErrorStackDepth(depth, msg) }, func(s string) error { return logger.errorStackDepth(s, depth) }, true, msg) } // ErrorcStackDepth logs at the error level with context and the current stack depth plus the additional given one and returns an error containing the formated log message func ErrorcStackDepth(message string, depth int, context ...interface{}) error { - return logContextWithError(seelog.ErrorLvl, func() { _ = Errorc(message, context...) }, logger.error, message, true, depth, context...) + return logContextWithError(ErrorLvl, func() { _ = Errorc(message, context...) }, logger.error, message, true, depth, context...) } // Errorc logs at the error level with context and returns an error containing the formated log message @@ -943,32 +942,32 @@ func Errorc(message string, context ...interface{}) error { // ErrorFunc calls and logs the result of 'logFunc' if and only if Error (or more verbose) logs are enabled func ErrorFunc(logFunc func() string) { currentLevel, _ := GetLogLevel() - if currentLevel <= seelog.ErrorLvl { + if currentLevel <= ErrorLvl { _ = ErrorStackDepth(2, logFunc()) } } // Critical logs at the critical level and returns an error containing the formated log message func Critical(v ...interface{}) error { - return logWithError(seelog.CriticalLvl, func() { _ = Critical(v...) }, logger.critical, true, v...) + return logWithError(CriticalLvl, func() { _ = Critical(v...) }, logger.critical, true, v...) } // Criticalf logs with format at the critical level and returns an error containing the formated log message func Criticalf(format string, params ...interface{}) error { - return logFormatWithError(seelog.CriticalLvl, func() { _ = Criticalf(format, params...) }, logger.criticalf, format, true, params...) + return logFormatWithError(CriticalLvl, func() { _ = Criticalf(format, params...) }, logger.criticalf, format, true, params...) } // CriticalfStackDepth logs with format at the critical level and the current stack depth plus the given depth func CriticalfStackDepth(depth int, format string, params ...interface{}) error { msg := fmt.Sprintf(format, params...) - return logWithError(seelog.CriticalLvl, func() { _ = CriticalStackDepth(depth, msg) }, func(s string) error { + return logWithError(CriticalLvl, func() { _ = CriticalStackDepth(depth, msg) }, func(s string) error { return logger.criticalStackDepth(s, depth) }, false, msg) } // CriticalcStackDepth logs at the critical level with context and the current stack depth plus the additional given one and returns an error containing the formated log message func CriticalcStackDepth(message string, depth int, context ...interface{}) error { - return logContextWithError(seelog.CriticalLvl, func() { _ = Criticalc(message, context...) }, logger.critical, message, true, depth, context...) + return logContextWithError(CriticalLvl, func() { _ = Criticalc(message, context...) }, logger.critical, message, true, depth, context...) } // Criticalc logs at the critical level with context and returns an error containing the formated log message @@ -979,49 +978,49 @@ func Criticalc(message string, context ...interface{}) error { // CriticalFunc calls and logs the result of 'logFunc' if and only if Critical (or more verbose) logs are enabled func CriticalFunc(logFunc func() string) { currentLevel, _ := GetLogLevel() - if currentLevel <= seelog.CriticalLvl { + if currentLevel <= CriticalLvl { _ = CriticalStackDepth(2, logFunc()) } } // InfoStackDepth logs at the info level and the current stack depth plus the additional given one func InfoStackDepth(depth int, v ...interface{}) { - log(seelog.InfoLvl, func() { InfoStackDepth(depth, v...) }, func(s string) { + log(InfoLvl, func() { InfoStackDepth(depth, v...) }, func(s string) { logger.infoStackDepth(s, depth) }, v...) } // WarnStackDepth logs at the warn level and the current stack depth plus the additional given one and returns an error containing the formated log message func WarnStackDepth(depth int, v ...interface{}) error { - return logWithError(seelog.WarnLvl, func() { _ = WarnStackDepth(depth, v...) }, func(s string) error { + return logWithError(WarnLvl, func() { _ = WarnStackDepth(depth, v...) }, func(s string) error { return logger.warnStackDepth(s, depth) }, false, v...) } // DebugStackDepth logs at the debug level and the current stack depth plus the additional given one and returns an error containing the formated log message func DebugStackDepth(depth int, v ...interface{}) { - log(seelog.DebugLvl, func() { DebugStackDepth(depth, v...) }, func(s string) { + log(DebugLvl, func() { DebugStackDepth(depth, v...) }, func(s string) { logger.debugStackDepth(s, depth) }, v...) } // TraceStackDepth logs at the trace level and the current stack depth plus the additional given one and returns an error containing the formated log message func TraceStackDepth(depth int, v ...interface{}) { - log(seelog.TraceLvl, func() { TraceStackDepth(depth, v...) }, func(s string) { + log(TraceLvl, func() { TraceStackDepth(depth, v...) }, func(s string) { logger.traceStackDepth(s, depth) }, v...) } // ErrorStackDepth logs at the error level and the current stack depth plus the additional given one and returns an error containing the formated log message func ErrorStackDepth(depth int, v ...interface{}) error { - return logWithError(seelog.ErrorLvl, func() { _ = ErrorStackDepth(depth, v...) }, func(s string) error { + return logWithError(ErrorLvl, func() { _ = ErrorStackDepth(depth, v...) }, func(s string) error { return logger.errorStackDepth(s, depth) }, true, v...) } // CriticalStackDepth logs at the critical level and the current stack depth plus the additional given one and returns an error containing the formated log message func CriticalStackDepth(depth int, v ...interface{}) error { - return logWithError(seelog.CriticalLvl, func() { _ = CriticalStackDepth(depth, v...) }, func(s string) error { + return logWithError(CriticalLvl, func() { _ = CriticalStackDepth(depth, v...) }, func(s string) error { return logger.criticalStackDepth(s, depth) }, true, v...) } @@ -1032,15 +1031,15 @@ func CriticalStackDepth(depth int, v ...interface{}) error { // JMXError Logs for JMX check func JMXError(v ...interface{}) error { - return logWithError(seelog.ErrorLvl, func() { _ = JMXError(v...) }, jmxLogger.error, true, v...) + return logWithError(ErrorLvl, func() { _ = JMXError(v...) }, jmxLogger.error, true, v...) } // JMXInfo Logs func JMXInfo(v ...interface{}) { - log(seelog.InfoLvl, func() { JMXInfo(v...) }, jmxLogger.info, v...) + log(InfoLvl, func() { JMXInfo(v...) }, jmxLogger.info, v...) } // SetupJMXLogger setup JMXfetch specific logger -func SetupJMXLogger(i seelog.LoggerInterface, level string) { +func SetupJMXLogger(i LoggerInterface, level string) { jmxLogger.Store(setupCommonLogger(i, level)) } diff --git a/pkg/util/log/log_bench_test.go b/pkg/util/log/log_bench_test.go index 61ab1ec8ccbc3..bf700aae85e75 100644 --- a/pkg/util/log/log_bench_test.go +++ b/pkg/util/log/log_bench_test.go @@ -9,15 +9,13 @@ import ( "bufio" "bytes" "testing" - - "github.com/cihub/seelog" ) func BenchmarkLogVanilla(b *testing.B) { var buff bytes.Buffer w := bufio.NewWriter(&buff) - l, _ := seelog.LoggerFromWriterWithMinLevelAndFormat(w, seelog.DebugLvl, "[%LEVEL] %FuncShort: %Msg") + l, _ := LoggerFromWriterWithMinLevelAndFormat(w, DebugLvl, "[%LEVEL] %FuncShort: %Msg") for n := 0; n < b.N; n++ { l.Infof("this is a credential encoding uri: %s", "http://user:password@host:port") @@ -28,7 +26,7 @@ func BenchmarkLogVanillaLevels(b *testing.B) { var buff bytes.Buffer w := bufio.NewWriter(&buff) - l, _ := seelog.LoggerFromWriterWithMinLevelAndFormat(w, seelog.InfoLvl, "[%LEVEL] %FuncShort: %Msg") + l, _ := LoggerFromWriterWithMinLevelAndFormat(w, InfoLvl, "[%LEVEL] %FuncShort: %Msg") for n := 0; n < b.N; n++ { l.Debugf("this is a credential encoding uri: %s", "http://user:password@host:port") @@ -39,7 +37,7 @@ func BenchmarkLogScrubbing(b *testing.B) { var buff bytes.Buffer w := bufio.NewWriter(&buff) - l, _ := seelog.LoggerFromWriterWithMinLevelAndFormat(w, seelog.DebugLvl, "[%LEVEL] %FuncShort: %Msg") + l, _ := LoggerFromWriterWithMinLevelAndFormat(w, DebugLvl, "[%LEVEL] %FuncShort: %Msg") SetupLogger(l, "info") for n := 0; n < b.N; n++ { @@ -51,7 +49,7 @@ func BenchmarkLogScrubbingLevels(b *testing.B) { var buff bytes.Buffer w := bufio.NewWriter(&buff) - l, _ := seelog.LoggerFromWriterWithMinLevelAndFormat(w, seelog.DebugLvl, "[%LEVEL] %FuncShort: %Msg") + l, _ := LoggerFromWriterWithMinLevelAndFormat(w, DebugLvl, "[%LEVEL] %FuncShort: %Msg") SetupLogger(l, "info") for n := 0; n < b.N; n++ { @@ -64,8 +62,8 @@ func BenchmarkLogScrubbingMulti(b *testing.B) { wA := bufio.NewWriter(&buffA) wB := bufio.NewWriter(&buffB) - lA, _ := seelog.LoggerFromWriterWithMinLevelAndFormat(wA, seelog.DebugLvl, "[%LEVEL] %FuncShort: %Msg") - lB, _ := seelog.LoggerFromWriterWithMinLevelAndFormat(wB, seelog.DebugLvl, "[%LEVEL] %FuncShort: %Msg") + lA, _ := LoggerFromWriterWithMinLevelAndFormat(wA, DebugLvl, "[%LEVEL] %FuncShort: %Msg") + lB, _ := LoggerFromWriterWithMinLevelAndFormat(wB, DebugLvl, "[%LEVEL] %FuncShort: %Msg") SetupLogger(lA, "info") _ = RegisterAdditionalLogger("extra", lB) @@ -82,7 +80,7 @@ func BenchmarkLogWithContext(b *testing.B) { var buff bytes.Buffer w := bufio.NewWriter(&buff) - l, _ := seelog.LoggerFromWriterWithMinLevelAndFormat(w, seelog.DebugLvl, "[%LEVEL] %FuncShort: %Msg") + l, _ := LoggerFromWriterWithMinLevelAndFormat(w, DebugLvl, "[%LEVEL] %FuncShort: %Msg") SetupLogger(l, "info") for n := 0; n < b.N; n++ { diff --git a/pkg/util/log/log_not_serverless_test.go b/pkg/util/log/log_not_serverless_test.go index 5bc245912cc49..c684977738602 100644 --- a/pkg/util/log/log_not_serverless_test.go +++ b/pkg/util/log/log_not_serverless_test.go @@ -12,7 +12,6 @@ import ( "bytes" "testing" - "github.com/cihub/seelog" "github.com/stretchr/testify/assert" ) @@ -20,7 +19,7 @@ func TestServerlessLoggingNotInServerlessContext(t *testing.T) { var b bytes.Buffer w := bufio.NewWriter(&b) - l, err := seelog.LoggerFromWriterWithMinLevel(w, seelog.DebugLvl) + l, err := LoggerFromWriterWithMinLevel(w, DebugLvl) assert.NoError(t, err) SetupLogger(l, "debug") diff --git a/pkg/util/log/log_serverless_test.go b/pkg/util/log/log_serverless_test.go index cb9c2ed83b9a3..a6520631ce741 100644 --- a/pkg/util/log/log_serverless_test.go +++ b/pkg/util/log/log_serverless_test.go @@ -12,7 +12,6 @@ import ( "bytes" "testing" - "github.com/cihub/seelog" "github.com/stretchr/testify/assert" ) @@ -20,7 +19,7 @@ func TestServerlessLoggingInServerlessContext(t *testing.T) { var b bytes.Buffer w := bufio.NewWriter(&b) - l, err := seelog.LoggerFromWriterWithMinLevel(w, seelog.DebugLvl) + l, err := LoggerFromWriterWithMinLevel(w, DebugLvl) assert.NoError(t, err) SetupLogger(l, "debug") diff --git a/pkg/util/log/log_test.go b/pkg/util/log/log_test.go index b6af55dd37c7c..ca1bbf45d737a 100644 --- a/pkg/util/log/log_test.go +++ b/pkg/util/log/log_test.go @@ -49,7 +49,7 @@ func TestBasicLogging(t *testing.T) { w := bufio.NewWriter(&b) seelog.RegisterCustomFormatter("ExtraTextContext", createExtraTextContext) - l, err := seelog.LoggerFromWriterWithMinLevelAndFormat(w, seelog.DebugLvl, "[%LEVEL] %FuncShort: %ExtraTextContext%Msg\n") + l, err := LoggerFromWriterWithMinLevelAndFormat(w, DebugLvl, "[%LEVEL] %FuncShort: %ExtraTextContext%Msg\n") assert.NoError(t, err) SetupLogger(l, "debug") @@ -108,7 +108,7 @@ func TestLogBuffer(t *testing.T) { var b bytes.Buffer w := bufio.NewWriter(&b) - l, err := seelog.LoggerFromWriterWithMinLevelAndFormat(w, seelog.DebugLvl, "[%LEVEL] %FuncShort: %Msg") + l, err := LoggerFromWriterWithMinLevelAndFormat(w, DebugLvl, "[%LEVEL] %FuncShort: %Msg") assert.NoError(t, err) Tracef("%s", "foo") @@ -134,7 +134,7 @@ func TestLogBufferWithContext(t *testing.T) { var b bytes.Buffer w := bufio.NewWriter(&b) - l, err := seelog.LoggerFromWriterWithMinLevelAndFormat(w, seelog.DebugLvl, "[%LEVEL] %FuncShort: %Msg") + l, err := LoggerFromWriterWithMinLevelAndFormat(w, DebugLvl, "[%LEVEL] %FuncShort: %Msg") assert.NoError(t, err) Tracec("baz", "number", 1, "str", "hello") @@ -170,7 +170,7 @@ func TestCredentialScrubbingLogging(t *testing.T) { var b bytes.Buffer w := bufio.NewWriter(&b) - l, err := seelog.LoggerFromWriterWithMinLevelAndFormat(w, seelog.DebugLvl, "[%LEVEL] %FuncShort: %Msg") + l, err := LoggerFromWriterWithMinLevelAndFormat(w, DebugLvl, "[%LEVEL] %FuncShort: %Msg") assert.NoError(t, err) SetupLogger(l, "info") @@ -192,9 +192,9 @@ func TestExtraLogging(t *testing.T) { w := bufio.NewWriter(&a) wA := bufio.NewWriter(&b) - l, err := seelog.LoggerFromWriterWithMinLevelAndFormat(w, seelog.DebugLvl, "[%LEVEL] %Msg") + l, err := LoggerFromWriterWithMinLevelAndFormat(w, DebugLvl, "[%LEVEL] %Msg") assert.NoError(t, err) - lA, err := seelog.LoggerFromWriterWithMinLevelAndFormat(wA, seelog.DebugLvl, "[%LEVEL] %Msg") + lA, err := LoggerFromWriterWithMinLevelAndFormat(wA, DebugLvl, "[%LEVEL] %Msg") assert.NoError(t, err) SetupLogger(l, "info") @@ -244,7 +244,7 @@ func TestWarnNotNil(t *testing.T) { assert.NotNil(t, Warn("test")) - l, _ := seelog.LoggerFromWriterWithMinLevelAndFormat(w, seelog.CriticalLvl, "[%LEVEL] %FuncShort: %Msg") + l, _ := LoggerFromWriterWithMinLevelAndFormat(w, CriticalLvl, "[%LEVEL] %FuncShort: %Msg") SetupLogger(l, "critical") assert.NotNil(t, Warn("test")) @@ -260,7 +260,7 @@ func TestWarnfNotNil(t *testing.T) { assert.NotNil(t, Warn("test")) - l, _ := seelog.LoggerFromWriterWithMinLevelAndFormat(w, seelog.CriticalLvl, "[%LEVEL] %FuncShort: %Msg") + l, _ := LoggerFromWriterWithMinLevelAndFormat(w, CriticalLvl, "[%LEVEL] %FuncShort: %Msg") SetupLogger(l, "critical") assert.NotNil(t, Warn("test")) @@ -277,7 +277,7 @@ func TestWarncNotNil(t *testing.T) { assert.NotNil(t, Warnc("test", "key", "val")) seelog.RegisterCustomFormatter("ExtraTextContext", createExtraTextContext) - l, _ := seelog.LoggerFromWriterWithMinLevelAndFormat(w, seelog.CriticalLvl, "[%LEVEL] %FuncShort: %ExtraTextContext%Msg") + l, _ := LoggerFromWriterWithMinLevelAndFormat(w, CriticalLvl, "[%LEVEL] %FuncShort: %ExtraTextContext%Msg") SetupLogger(l, "critical") assert.NotNil(t, Warnc("test", "key", "val")) @@ -293,7 +293,7 @@ func TestErrorNotNil(t *testing.T) { assert.NotNil(t, Error("test")) - l, _ := seelog.LoggerFromWriterWithMinLevelAndFormat(w, seelog.CriticalLvl, "[%LEVEL] %FuncShort: %Msg") + l, _ := LoggerFromWriterWithMinLevelAndFormat(w, CriticalLvl, "[%LEVEL] %FuncShort: %Msg") SetupLogger(l, "critical") assert.NotNil(t, Error("test")) @@ -309,7 +309,7 @@ func TestErrorfNotNil(t *testing.T) { assert.NotNil(t, Errorf("test")) - l, _ := seelog.LoggerFromWriterWithMinLevelAndFormat(w, seelog.CriticalLvl, "[%LEVEL] %FuncShort: %Msg") + l, _ := LoggerFromWriterWithMinLevelAndFormat(w, CriticalLvl, "[%LEVEL] %FuncShort: %Msg") SetupLogger(l, "critical") assert.NotNil(t, Errorf("test")) @@ -326,7 +326,7 @@ func TestErrorcNotNil(t *testing.T) { assert.NotNil(t, Errorc("test", "key", "val")) seelog.RegisterCustomFormatter("ExtraTextContext", createExtraTextContext) - l, _ := seelog.LoggerFromWriterWithMinLevelAndFormat(w, seelog.CriticalLvl, "[%LEVEL] %FuncShort: %ExtraTextContext%Msg") + l, _ := LoggerFromWriterWithMinLevelAndFormat(w, CriticalLvl, "[%LEVEL] %FuncShort: %ExtraTextContext%Msg") SetupLogger(l, "critical") assert.NotNil(t, Errorc("test", "key", "val")) @@ -342,7 +342,7 @@ func TestCriticalNotNil(t *testing.T) { assert.NotNil(t, Critical("test")) - l, _ := seelog.LoggerFromWriterWithMinLevelAndFormat(w, seelog.InfoLvl, "[%LEVEL] %FuncShort: %Msg") + l, _ := LoggerFromWriterWithMinLevelAndFormat(w, InfoLvl, "[%LEVEL] %FuncShort: %Msg") SetupLogger(l, "info") assert.NotNil(t, Critical("test")) @@ -354,7 +354,7 @@ func TestCriticalfNotNil(t *testing.T) { assert.NotNil(t, Criticalf("test")) - l, _ := seelog.LoggerFromWriterWithMinLevelAndFormat(w, seelog.InfoLvl, "[%LEVEL] %FuncShort: %Msg") + l, _ := LoggerFromWriterWithMinLevelAndFormat(w, InfoLvl, "[%LEVEL] %FuncShort: %Msg") SetupLogger(l, "info") assert.NotNil(t, Criticalf("test")) @@ -367,7 +367,7 @@ func TestCriticalcNotNil(t *testing.T) { assert.NotNil(t, Criticalc("test", "key", "val")) seelog.RegisterCustomFormatter("ExtraTextContext", createExtraTextContext) - l, _ := seelog.LoggerFromWriterWithMinLevelAndFormat(w, seelog.InfoLvl, "[%LEVEL] %FuncShort: %ExtraTextContext%Msg") + l, _ := LoggerFromWriterWithMinLevelAndFormat(w, InfoLvl, "[%LEVEL] %FuncShort: %ExtraTextContext%Msg") SetupLogger(l, "info") assert.NotNil(t, Criticalc("test", "key", "val")) @@ -377,7 +377,7 @@ func TestDebugFuncNoExecute(t *testing.T) { var b bytes.Buffer w := bufio.NewWriter(&b) - l, _ := seelog.LoggerFromWriterWithMinLevelAndFormat(w, seelog.InfoLvl, "[%LEVEL] %FuncShort: %Msg") + l, _ := LoggerFromWriterWithMinLevelAndFormat(w, InfoLvl, "[%LEVEL] %FuncShort: %Msg") SetupLogger(l, "info") i := 0 @@ -393,7 +393,7 @@ func TestDebugFuncExecute(t *testing.T) { var b bytes.Buffer w := bufio.NewWriter(&b) - l, _ := seelog.LoggerFromWriterWithMinLevelAndFormat(w, seelog.DebugLvl, "[%LEVEL] %FuncShort: %Msg") + l, _ := LoggerFromWriterWithMinLevelAndFormat(w, DebugLvl, "[%LEVEL] %FuncShort: %Msg") SetupLogger(l, "debug") i := 0 @@ -410,37 +410,37 @@ func TestDebugFuncExecute(t *testing.T) { func TestFuncVersions(t *testing.T) { cases := []struct { - seelogLevel seelog.LogLevel + seelogLevel LogLevel strLogLevel string logFunc func(func() string) expectedToBeCalled bool }{ - {seelog.ErrorLvl, "error", DebugFunc, false}, - {seelog.WarnLvl, "warn", DebugFunc, false}, - {seelog.InfoLvl, "info", DebugFunc, false}, - {seelog.DebugLvl, "debug", DebugFunc, true}, - {seelog.TraceLvl, "trace", DebugFunc, true}, + {ErrorLvl, "error", DebugFunc, false}, + {WarnLvl, "warn", DebugFunc, false}, + {InfoLvl, "info", DebugFunc, false}, + {DebugLvl, "debug", DebugFunc, true}, + {TraceLvl, "trace", DebugFunc, true}, - {seelog.TraceLvl, "trace", TraceFunc, true}, - {seelog.InfoLvl, "info", TraceFunc, false}, + {TraceLvl, "trace", TraceFunc, true}, + {InfoLvl, "info", TraceFunc, false}, - {seelog.InfoLvl, "info", InfoFunc, true}, - {seelog.WarnLvl, "warn", InfoFunc, false}, + {InfoLvl, "info", InfoFunc, true}, + {WarnLvl, "warn", InfoFunc, false}, - {seelog.WarnLvl, "warn", WarnFunc, true}, - {seelog.ErrorLvl, "error", WarnFunc, false}, + {WarnLvl, "warn", WarnFunc, true}, + {ErrorLvl, "error", WarnFunc, false}, - {seelog.ErrorLvl, "error", ErrorFunc, true}, - {seelog.CriticalLvl, "critical", ErrorFunc, false}, + {ErrorLvl, "error", ErrorFunc, true}, + {CriticalLvl, "critical", ErrorFunc, false}, - {seelog.CriticalLvl, "critical", CriticalFunc, true}, + {CriticalLvl, "critical", CriticalFunc, true}, } for _, tc := range cases { var b bytes.Buffer w := bufio.NewWriter(&b) - l, _ := seelog.LoggerFromWriterWithMinLevelAndFormat(w, tc.seelogLevel, "[%LEVEL] %FuncShort: %Msg") + l, _ := LoggerFromWriterWithMinLevelAndFormat(w, tc.seelogLevel, "[%LEVEL] %FuncShort: %Msg") SetupLogger(l, tc.strLogLevel) i := 0 @@ -463,16 +463,16 @@ func TestStackDepthfLogging(t *testing.T) { const stackDepth = 1 cases := []struct { - seelogLevel seelog.LogLevel + seelogLevel LogLevel strLogLevel string expectedToBeCalled int }{ - {seelog.CriticalLvl, "critical", 1}, - {seelog.ErrorLvl, "error", 2}, - {seelog.WarnLvl, "warn", 3}, - {seelog.InfoLvl, "info", 4}, - {seelog.DebugLvl, "debug", 5}, - {seelog.TraceLvl, "trace", 6}, + {CriticalLvl, "critical", 1}, + {ErrorLvl, "error", 2}, + {WarnLvl, "warn", 3}, + {InfoLvl, "info", 4}, + {DebugLvl, "debug", 5}, + {TraceLvl, "trace", 6}, } for _, tc := range cases { @@ -480,7 +480,7 @@ func TestStackDepthfLogging(t *testing.T) { var b bytes.Buffer w := bufio.NewWriter(&b) - l, err := seelog.LoggerFromWriterWithMinLevelAndFormat(w, tc.seelogLevel, "[%LEVEL] %Func: %Msg\n") + l, err := LoggerFromWriterWithMinLevelAndFormat(w, tc.seelogLevel, "[%LEVEL] %Func: %Msg\n") assert.NoError(t, err) SetupLogger(l, tc.strLogLevel) @@ -529,7 +529,7 @@ func getFuncName(val reflect.Value) (string, error) { func TestLoggerScrubbingCount(t *testing.T) { var b bytes.Buffer w := bufio.NewWriter(&b) - l, err := seelog.LoggerFromWriterWithMinLevelAndFormat(w, seelog.TraceLvl, "[%LEVEL] %FuncShort: %Msg") + l, err := LoggerFromWriterWithMinLevelAndFormat(w, TraceLvl, "[%LEVEL] %FuncShort: %Msg") require.NoError(t, err) SetupLogger(l, "trace") diff --git a/pkg/util/log/log_test_init.go b/pkg/util/log/log_test_init.go index 7dd6bcd7e3c7c..b1b5e3bbedba2 100644 --- a/pkg/util/log/log_test_init.go +++ b/pkg/util/log/log_test_init.go @@ -9,8 +9,6 @@ package log import ( "os" - - "github.com/cihub/seelog" ) func init() { @@ -18,5 +16,5 @@ func init() { if level == "" { level = "debug" } - SetupLogger(seelog.Default, level) + SetupLogger(Default(), level) } diff --git a/pkg/util/log/logger.go b/pkg/util/log/logger.go new file mode 100644 index 0000000000000..5de956c854f07 --- /dev/null +++ b/pkg/util/log/logger.go @@ -0,0 +1,35 @@ +// 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 log + +import ( + "io" + + "github.com/cihub/seelog" +) + +// LoggerInterface provides basic logging methods. +type LoggerInterface seelog.LoggerInterface + +// Default returns a default logger +func Default() LoggerInterface { + return seelog.Default +} + +// Disabled returns a disabled logger +func Disabled() LoggerInterface { + return seelog.Disabled +} + +// LoggerFromWriterWithMinLevelAndFormat creates a new logger from a writer, a minimum log level and a format. +func LoggerFromWriterWithMinLevelAndFormat(output io.Writer, minLevel LogLevel, format string) (LoggerInterface, error) { + return seelog.LoggerFromWriterWithMinLevelAndFormat(output, seelog.LogLevel(minLevel), format) +} + +// LoggerFromWriterWithMinLevel creates a new logger from a writer and a minimum log level. +func LoggerFromWriterWithMinLevel(output io.Writer, minLevel LogLevel) (LoggerInterface, error) { + return seelog.LoggerFromWriterWithMinLevel(output, seelog.LogLevel(minLevel)) +} diff --git a/pkg/util/log/setup/go.mod b/pkg/util/log/setup/go.mod index 8eb352e5a4570..31ca3e7584b67 100644 --- a/pkg/util/log/setup/go.mod +++ b/pkg/util/log/setup/go.mod @@ -33,7 +33,7 @@ replace ( require ( github.com/DataDog/datadog-agent/pkg/config/mock v0.59.0 github.com/DataDog/datadog-agent/pkg/config/model v0.59.0 - github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 + github.com/DataDog/datadog-agent/pkg/util/log v0.59.1 github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 github.com/stretchr/testify v1.10.0 ) @@ -51,27 +51,28 @@ require ( github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/optional v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/pointer v0.59.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.1 // indirect 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.0 // indirect - github.com/DataDog/viper v1.13.5 // 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.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 - github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 // indirect + github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb // indirect github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 // indirect - github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c // indirect + github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c // indirect github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect 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/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // 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 @@ -80,11 +81,13 @@ require ( github.com/tklauser/numcpus v0.8.0 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect go.uber.org/atomic v1.11.0 // indirect - golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f // indirect - golang.org/x/sys v0.27.0 // indirect - golang.org/x/text v0.20.0 // indirect + golang.org/x/exp v0.0.0-20241210194714-1829a127f884 // indirect + golang.org/x/sys v0.28.0 // indirect + golang.org/x/text v0.21.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) replace github.com/DataDog/datadog-agent/pkg/config/structure => ../../../config/structure + +replace github.com/DataDog/datadog-agent/pkg/version => ../../../version diff --git a/pkg/util/log/setup/go.sum b/pkg/util/log/setup/go.sum index b70b04e70aa56..e78672416b092 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= @@ -69,7 +71,6 @@ github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/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= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -84,8 +85,8 @@ github.com/grpc-ecosystem/grpc-gateway v1.13.0/go.mod h1:8XEsbTttt/W+VvjtQhLACqC github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/hcl v1.0.1-vault-5 h1:kI3hhbbyzr4dldA8UdTb7ZlVVlI2DACdCfz31RPDgJM= github.com/hashicorp/hcl v1.0.1-vault-5/go.mod h1:XYhtn6ijBSAj6n4YqAaf7RBPS4I06AItNorpy+MoQNM= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 h1:S4qyfL2sEm5Budr4KVMyEniCy+PbS55651I/a+Kn/NQ= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb h1:PGufWXXDq9yaev6xX1YQauaO1MV90e6Mpoq1I7Lz/VM= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= @@ -107,8 +108,8 @@ 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-20220913051719-115f729f3c8c h1:VtwQ41oftZwlMnOEbMWQtSEUgU64U4s+GHk7hZK+jtY= -github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c/go.mod h1:JKx41uQRwqlTZabZc+kILPrO/3jlKnQ2Z8b7YiVw5cE= +github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a h1:3Bm7EwfUQUvhNeKIkUct/gl9eod1TcXuj8stxvi/GoI= +github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a/go.mod h1:ilwx/Dta8jXAgpFYFvSWEMwxmbWXyiUHkd5FwyKhb5k= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= @@ -135,8 +136,8 @@ github.com/pkg/errors v0.8.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-20220216144756-c35f1ee13d7c h1:NRoLoZvkBTKvR5gQLgA3e0hqjkY9u1wm+iOL45VN/qI= -github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 h1:o4JXh1EVt9k/+g42oCprj/FisM4qX9L3sZB3upGN2ZU= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= @@ -167,12 +168,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= @@ -237,8 +234,8 @@ golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnf golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f h1:XdNn9LlyWAhLVp6P/i8QYBW+hlyhrhei9uErw2B5GJo= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f/go.mod h1:D5SMRVC3C2/4+F/DB1wZsLRnSNimn2Sp/NPsCrsv8ak= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884 h1:Y/Mj/94zIQQGHVSv1tTtQBDaQaJe62U9bkDZKKyhPCU= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -275,11 +272,11 @@ golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20220829200755-d48e67d00261/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.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/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= -golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= diff --git a/pkg/util/log/setup/log.go b/pkg/util/log/setup/log.go index 959918853ba55..87b8a27da455a 100644 --- a/pkg/util/log/setup/log.go +++ b/pkg/util/log/setup/log.go @@ -246,29 +246,29 @@ type logWriter struct { } // NewLogWriter returns a logWriter set with given logLevel. Returns an error if logLevel is unknown/not set. -func NewLogWriter(additionalDepth int, logLevel seelog.LogLevel) (io.Writer, error) { +func NewLogWriter(additionalDepth int, logLevel log.LogLevel) (io.Writer, error) { writer := &logWriter{ additionalDepth: additionalDepth, } switch logLevel { - case seelog.TraceLvl: + case log.TraceLvl: writer.logFunc = log.TraceStackDepth - case seelog.DebugLvl: + case log.DebugLvl: writer.logFunc = log.DebugStackDepth - case seelog.InfoLvl: + case log.InfoLvl: writer.logFunc = log.InfoStackDepth - case seelog.WarnLvl: + case log.WarnLvl: writer.logFunc = func(dept int, v ...interface{}) { _ = log.WarnStackDepth(dept, v...) } writer.additionalDepth++ - case seelog.ErrorLvl: + case log.ErrorLvl: writer.logFunc = func(dept int, v ...interface{}) { _ = log.ErrorStackDepth(dept, v...) } writer.additionalDepth++ - case seelog.CriticalLvl: + case log.CriticalLvl: writer.logFunc = func(dept int, v ...interface{}) { _ = log.CriticalStackDepth(dept, v...) } @@ -294,7 +294,7 @@ type tlsHandshakeErrorWriter struct { } // NewTLSHandshakeErrorWriter is a wrapper function which creates a new logWriter. -func NewTLSHandshakeErrorWriter(additionalDepth int, logLevel seelog.LogLevel) (io.Writer, error) { +func NewTLSHandshakeErrorWriter(additionalDepth int, logLevel log.LogLevel) (io.Writer, error) { logWriter, err := NewLogWriter(additionalDepth, logLevel) if err != nil { return nil, err diff --git a/pkg/util/log/zap/zapcore.go b/pkg/util/log/zap/zapcore.go index 576e443557f21..4d77c3e1c8612 100644 --- a/pkg/util/log/zap/zapcore.go +++ b/pkg/util/log/zap/zapcore.go @@ -7,7 +7,6 @@ package log import ( - "github.com/cihub/seelog" "go.uber.org/zap/zapcore" "github.com/DataDog/datadog-agent/pkg/util/log" @@ -20,18 +19,18 @@ type core struct { } func (c *core) Enabled(level zapcore.Level) bool { - var seelogLevel seelog.LogLevel + var seelogLevel log.LogLevel switch level { case zapcore.DebugLevel: - seelogLevel = seelog.DebugLvl + seelogLevel = log.DebugLvl case zapcore.InfoLevel: - seelogLevel = seelog.InfoLvl + seelogLevel = log.InfoLvl case zapcore.WarnLevel: - seelogLevel = seelog.WarnLvl + seelogLevel = log.WarnLvl case zapcore.ErrorLevel: - seelogLevel = seelog.ErrorLvl + seelogLevel = log.ErrorLvl case zapcore.DPanicLevel, zapcore.PanicLevel, zapcore.FatalLevel: - seelogLevel = seelog.CriticalLvl + seelogLevel = log.CriticalLvl } return log.ShouldLog(seelogLevel) } 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/scrubber/default.go b/pkg/util/scrubber/default.go index 290592ddf2eb2..d2f5060e0a041 100644 --- a/pkg/util/scrubber/default.go +++ b/pkg/util/scrubber/default.go @@ -31,6 +31,10 @@ var ( // secrets package for example. dynamicReplacers = []Replacer{} dynamicReplacersMutex = sync.Mutex{} + + // defaultVersion is the first version of the agent scrubber. + // https://github.com/DataDog/datadog-agent/pull/9618 + defaultVersion = parseVersion("7.33.0") ) func init() { @@ -46,12 +50,16 @@ func AddDefaultReplacers(scrubber *Scrubber) { Regex: regexp.MustCompile(`(api_?key=)\b[a-zA-Z0-9]+([a-zA-Z0-9]{5})\b`), Hints: []string{"api_key", "apikey"}, Repl: []byte(`$1***************************$2`), + + LastUpdated: defaultVersion, } hintedAPPKeyReplacer := Replacer{ // If hinted, mask the value regardless if it doesn't match 40-char hexadecimal string Regex: regexp.MustCompile(`(ap(?:p|plication)_?key=)\b[a-zA-Z0-9]+([a-zA-Z0-9]{5})\b`), Hints: []string{"app_key", "appkey", "application_key"}, Repl: []byte(`$1***********************************$2`), + + LastUpdated: defaultVersion, } // replacers are check one by one in order. We first try to scrub 64 bytes token, keeping the last 5 digit. If @@ -60,45 +68,70 @@ func AddDefaultReplacers(scrubber *Scrubber) { Regex: regexp.MustCompile(`\bBearer [a-fA-F0-9]{59}([a-fA-F0-9]{5})\b`), Hints: []string{"Bearer"}, Repl: []byte(`Bearer ***********************************************************$1`), + + // https://github.com/DataDog/datadog-agent/pull/12338 + LastUpdated: parseVersion("7.38.0"), } // For this one we match any characters hintedBearerInvalidReplacer := Replacer{ Regex: regexp.MustCompile(`\bBearer\s+[^*]+\b`), Hints: []string{"Bearer"}, Repl: []byte("Bearer " + defaultReplacement), + + // https://github.com/DataDog/datadog-agent/pull/23448 + LastUpdated: parseVersion("7.53.0"), } apiKeyReplacerYAML := Replacer{ Regex: regexp.MustCompile(`(\-|\:|,|\[|\{)(\s+)?\b[a-fA-F0-9]{27}([a-fA-F0-9]{5})\b`), Repl: []byte(`$1$2"***************************$3"`), + + // https://github.com/DataDog/datadog-agent/pull/12605 + LastUpdated: parseVersion("7.39.0"), } apiKeyReplacer := Replacer{ Regex: regexp.MustCompile(`\b[a-fA-F0-9]{27}([a-fA-F0-9]{5})\b`), Repl: []byte(`***************************$1`), + + LastUpdated: defaultVersion, } appKeyReplacerYAML := Replacer{ Regex: regexp.MustCompile(`(\-|\:|,|\[|\{)(\s+)?\b[a-fA-F0-9]{35}([a-fA-F0-9]{5})\b`), Repl: []byte(`$1$2"***********************************$3"`), + + // https://github.com/DataDog/datadog-agent/pull/12605 + LastUpdated: parseVersion("7.39.0"), } appKeyReplacer := Replacer{ Regex: regexp.MustCompile(`\b[a-fA-F0-9]{35}([a-fA-F0-9]{5})\b`), Repl: []byte(`***********************************$1`), + + LastUpdated: defaultVersion, } rcAppKeyReplacer := Replacer{ Regex: regexp.MustCompile(`\bDDRCM_[A-Z0-9]+([A-Z0-9]{5})\b`), Repl: []byte(`***********************************$1`), + + // https://github.com/DataDog/datadog-agent/pull/14681 + LastUpdated: parseVersion("7.42.0"), } + // URI Generic Syntax // https://tools.ietf.org/html/rfc3986 uriPasswordReplacer := Replacer{ - Regex: regexp.MustCompile(`(?i)([a-z][a-z0-9+-.]+://|\b)([^:]+):([^\s|"]+)@`), + Regex: regexp.MustCompile(`(?i)([a-z][a-z0-9+-.]+://|\b)([^:\s]+):([^\s|"]+)@`), Repl: []byte(`$1$2:********@`), + + // https://github.com/DataDog/datadog-agent/pull/32503 + LastUpdated: parseVersion("7.62.0"), } + yamlPasswordReplacer := matchYAMLKeyPart( `(pass(word)?|pwd)`, []string{"pass", "pwd"}, []byte(`$1 "********"`), ) + yamlPasswordReplacer.LastUpdated = defaultVersion passwordReplacer := Replacer{ // this regex has three parts: // * key: case-insensitive, optionally quoted (pass | password | pswd | pwd), not anchored to match on args like --mysql_password= etc. @@ -107,22 +140,28 @@ func AddDefaultReplacers(scrubber *Scrubber) { Regex: regexp.MustCompile(`(?i)(\"?(?:pass(?:word)?|pswd|pwd)\"?)((?:=| = |: )\"?)([0-9A-Za-z#!$%&()*+,\-./:<=>?@[\\\]^_{|}~]+)`), // replace the 3rd capture group (password string) with ******** Repl: []byte(`$1$2********`), + + // https://github.com/DataDog/datadog-agent/pull/28144 + LastUpdated: parseVersion("7.57.0"), } tokenReplacer := matchYAMLKeyEnding( `token`, []string{"token"}, []byte(`$1 "********"`), ) + tokenReplacer.LastUpdated = defaultVersion snmpReplacer := matchYAMLKey( `(community_string|authKey|privKey|community|authentication_key|privacy_key|Authorization|authorization)`, []string{"community_string", "authKey", "privKey", "community", "authentication_key", "privacy_key", "Authorization", "authorization"}, []byte(`$1 "********"`), ) + snmpReplacer.LastUpdated = parseVersion("7.53.0") // https://github.com/DataDog/datadog-agent/pull/23515 snmpMultilineReplacer := matchYAMLKeyWithListValue( "(community_strings)", "community_strings", []byte(`$1 "********"`), ) + snmpMultilineReplacer.LastUpdated = parseVersion("7.34.0") // https://github.com/DataDog/datadog-agent/pull/10305 certReplacer := Replacer{ /* Try to match as accurately as possible. RFC 7468's ABNF @@ -132,6 +171,8 @@ func AddDefaultReplacers(scrubber *Scrubber) { Regex: regexp.MustCompile(`-----BEGIN (?:.*)-----[A-Za-z0-9=\+\/\s]*-----END (?:.*)-----`), Hints: []string{"BEGIN"}, Repl: []byte(`********`), + + LastUpdated: defaultVersion, } // The following replacers works on YAML object only @@ -151,6 +192,7 @@ func AddDefaultReplacers(scrubber *Scrubber) { return defaultReplacement }, ) + apiKeyYaml.LastUpdated = parseVersion("7.44.0") // https://github.com/DataDog/datadog-agent/pull/15707 appKeyYaml := matchYAMLOnly( `ap(?:p|plication)_?key`, @@ -167,6 +209,7 @@ func AddDefaultReplacers(scrubber *Scrubber) { return defaultReplacement }, ) + appKeyYaml.LastUpdated = parseVersion("7.44.0") // https://github.com/DataDog/datadog-agent/pull/15707 scrubber.AddReplacer(SingleLine, hintedAPIKeyReplacer) scrubber.AddReplacer(SingleLine, hintedAPPKeyReplacer) diff --git a/pkg/util/scrubber/default_test.go b/pkg/util/scrubber/default_test.go index 86134fbc90328..637ed9a464c17 100644 --- a/pkg/util/scrubber/default_test.go +++ b/pkg/util/scrubber/default_test.go @@ -6,16 +6,13 @@ package scrubber import ( - "encoding/json" "os" "path/filepath" - "reflect" "strings" "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "gopkg.in/yaml.v2" ) func assertClean(t *testing.T, contents, cleanContents string) { @@ -26,96 +23,6 @@ func assertClean(t *testing.T, contents, cleanContents string) { assert.Equal(t, strings.TrimSpace(cleanContents), strings.TrimSpace(cleanedString)) } -func TestConfigScrubbedValidYaml(t *testing.T) { - wd, _ := os.Getwd() - - inputConf := filepath.Join(wd, "test", "conf.yaml") - inputConfData, err := os.ReadFile(inputConf) - require.NoError(t, err) - - outputConf := filepath.Join(wd, "test", "conf_scrubbed.yaml") - outputConfData, err := os.ReadFile(outputConf) - require.NoError(t, err) - - cleaned, err := ScrubBytes([]byte(inputConfData)) - require.NoError(t, err) - - // First test that the a scrubbed yaml is still a valid yaml - var out interface{} - err = yaml.Unmarshal(cleaned, &out) - assert.NoError(t, err, "Could not load YAML configuration after being scrubbed") - - // We replace windows line break by linux so the tests pass on every OS - trimmedOutput := strings.TrimSpace(strings.Replace(string(outputConfData), "\r\n", "\n", -1)) - trimmedCleaned := strings.TrimSpace(strings.Replace(string(cleaned), "\r\n", "\n", -1)) - - assert.Equal(t, trimmedOutput, trimmedCleaned) -} - -func TestConfigScrubbedYaml(t *testing.T) { - wd, _ := os.Getwd() - - inputConf := filepath.Join(wd, "test", "conf_multiline.yaml") - inputConfData, err := os.ReadFile(inputConf) - require.NoError(t, err) - - outputConf := filepath.Join(wd, "test", "conf_multiline_scrubbed.yaml") - outputConfData, err := os.ReadFile(outputConf) - require.NoError(t, err) - - cleaned, err := ScrubYaml([]byte(inputConfData)) - require.NoError(t, err) - - // First test that the a scrubbed yaml is still a valid yaml - var out interface{} - err = yaml.Unmarshal(cleaned, &out) - assert.NoError(t, err, "Could not load YAML configuration after being scrubbed") - - // We replace windows line break by linux so the tests pass on every OS - trimmedOutput := strings.TrimSpace(strings.Replace(string(outputConfData), "\r\n", "\n", -1)) - trimmedCleaned := strings.TrimSpace(strings.Replace(string(cleaned), "\r\n", "\n", -1)) - - assert.Equal(t, trimmedOutput, trimmedCleaned) -} - -func TestConfigScrubbedJson(t *testing.T) { - wd, _ := os.Getwd() - - inputConf := filepath.Join(wd, "test", "config.json") - inputConfData, err := os.ReadFile(inputConf) - require.NoError(t, err) - cleaned, err := ScrubJSON([]byte(inputConfData)) - require.NoError(t, err) - // First test that the a scrubbed json is still valid - var actualOutJSON map[string]interface{} - err = json.Unmarshal(cleaned, &actualOutJSON) - assert.NoError(t, err, "Could not load JSON configuration after being scrubbed") - - outputConf := filepath.Join(wd, "test", "config_scrubbed.json") - outputConfData, err := os.ReadFile(outputConf) - require.NoError(t, err) - var expectedOutJSON map[string]interface{} - err = json.Unmarshal(outputConfData, &expectedOutJSON) - require.NoError(t, err) - assert.Equal(t, reflect.DeepEqual(expectedOutJSON, actualOutJSON), true) -} - -func TestEmptyYaml(t *testing.T) { - cleaned, err := ScrubYaml(nil) - require.NoError(t, err) - assert.Equal(t, "", string(cleaned)) - - cleaned, err = ScrubYaml([]byte("")) - require.NoError(t, err) - assert.Equal(t, "", string(cleaned)) -} - -func TestEmptyYamlString(t *testing.T) { - cleaned, err := ScrubYamlString("") - require.NoError(t, err) - assert.Equal(t, "", string(cleaned)) -} - func TestConfigStripApiKey(t *testing.T) { assertClean(t, `api_key: aaaaaaaaaaaaaaaaaaaaaaaaaaaabbbb`, @@ -200,6 +107,12 @@ func TestConfigRCAppKey(t *testing.T) { } func TestConfigStripURLPassword(t *testing.T) { + assertClean(t, + `proxy: random_url_key: http://user:password@host:port`, + `proxy: random_url_key: http://user:********@host:port`) + assertClean(t, + `random_url_key http://user:password@host:port`, + `random_url_key http://user:********@host:port`) assertClean(t, `random_url_key: http://user:password@host:port`, `random_url_key: http://user:********@host:port`) @@ -567,39 +480,8 @@ func TestAddStrippedKeys(t *testing.T) { AddStrippedKeys([]string{"foobar"}) assertClean(t, contents, `foobar: "********"`) -} -func TestAddStrippedKeysExceptions(t *testing.T) { - t.Run("single key", func(t *testing.T) { - contents := `api_key: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'` - - AddStrippedKeys([]string{"api_key"}) - - scrubbed, err := ScrubYamlString(contents) - require.Nil(t, err) - require.YAMLEq(t, `api_key: '***************************aaaaa'`, scrubbed) - }) - - t.Run("multiple keys", func(t *testing.T) { - contents := `api_key: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' -some_other_key: 'bbbb' -app_key: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaacccc' -yet_another_key: 'dddd'` - - keys := []string{"api_key", "some_other_key", "app_key"} - AddStrippedKeys(keys) - - // check that AddStrippedKeys didn't modify the parameter slice - assert.Equal(t, []string{"api_key", "some_other_key", "app_key"}, keys) - - scrubbed, err := ScrubYamlString(contents) - require.Nil(t, err) - expected := `api_key: '***************************aaaaa' -some_other_key: '********' -app_key: '***********************************acccc' -yet_another_key: 'dddd'` - require.YAMLEq(t, expected, scrubbed) - }) + dynamicReplacers = []Replacer{} } func TestAddStrippedKeysNewReplacer(t *testing.T) { @@ -612,6 +494,8 @@ func TestAddStrippedKeysNewReplacer(t *testing.T) { cleaned, err := newScrubber.ScrubBytes([]byte(contents)) require.NoError(t, err) assert.Equal(t, strings.TrimSpace(`foobar: "********"`), strings.TrimSpace(string(cleaned))) + + dynamicReplacers = []Replacer{} } func TestCertConfig(t *testing.T) { @@ -686,33 +570,6 @@ network_devices: log_level: info`) } -func TestConfigFile(t *testing.T) { - cleanedConfigFile := `dd_url: https://app.datadoghq.com - -api_key: "***************************aaaaa" - -proxy: http://user:********@host:port - - - - - - -dogstatsd_port : 8125 - - -log_level: info -` - - wd, _ := os.Getwd() - filePath := filepath.Join(wd, "test", "datadog.yaml") - cleaned, err := ScrubFile(filePath) - assert.NoError(t, err) - cleanedString := string(cleaned) - - assert.Equal(t, cleanedConfigFile, cleanedString) -} - func TestBearerToken(t *testing.T) { assertClean(t, `Bearer 2fe663014abcd1850076f6d68c0355666db98758262870811cace007cd4a62ba`, @@ -785,3 +642,30 @@ func TestScrubCommandsEnv(t *testing.T) { }) } } + +func TestConfigFile(t *testing.T) { + cleanedConfigFile := `dd_url: https://app.datadoghq.com + +api_key: "***************************aaaaa" + +proxy: http://user:********@host:port + + + + + + +dogstatsd_port : 8125 + + +log_level: info +` + + wd, _ := os.Getwd() + filePath := filepath.Join(wd, "test", "datadog.yaml") + cleaned, err := ScrubFile(filePath) + assert.NoError(t, err) + cleanedString := string(cleaned) + + assert.Equal(t, cleanedConfigFile, cleanedString) +} diff --git a/pkg/util/scrubber/go.mod b/pkg/util/scrubber/go.mod index ccabdeab1cacc..ff0eb09afc0ef 100644 --- a/pkg/util/scrubber/go.mod +++ b/pkg/util/scrubber/go.mod @@ -3,15 +3,15 @@ module github.com/DataDog/datadog-agent/pkg/util/scrubber go 1.22.0 require ( + github.com/DataDog/datadog-agent/pkg/version v0.59.1 github.com/stretchr/testify v1.10.0 - gopkg.in/yaml.v2 v2.4.0 + gopkg.in/yaml.v3 v3.0.1 ) require ( github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/kr/pretty v0.3.1 // indirect + github.com/kr/text v0.2.0 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect - github.com/rogpeppe/go-internal v1.13.1 // indirect - gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect - gopkg.in/yaml.v3 v3.0.1 // indirect ) + +replace github.com/DataDog/datadog-agent/pkg/version => ../../version diff --git a/pkg/util/scrubber/go.sum b/pkg/util/scrubber/go.sum index 08716d442d1db..878d5c29e2e5d 100644 --- a/pkg/util/scrubber/go.sum +++ b/pkg/util/scrubber/go.sum @@ -1,17 +1,12 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= 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/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= -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/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= 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/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= 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/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= @@ -19,7 +14,5 @@ github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/pkg/util/scrubber/json_scrubber.go b/pkg/util/scrubber/json_scrubber.go index 34c65dd357cfa..dbf624b119533 100644 --- a/pkg/util/scrubber/json_scrubber.go +++ b/pkg/util/scrubber/json_scrubber.go @@ -22,7 +22,7 @@ func (c *Scrubber) ScrubJSON(input []byte) ([]byte, error) { if len(input) != 0 && err == nil { c.ScrubDataObj(data) - newInput, err := json.Marshal(data) + newInput, err := json.MarshalIndent(data, "", " ") if err == nil { return newInput, nil } diff --git a/pkg/util/scrubber/json_scrubber_test.go b/pkg/util/scrubber/json_scrubber_test.go index 007da8d3f34cb..b45d0a8d08f78 100644 --- a/pkg/util/scrubber/json_scrubber_test.go +++ b/pkg/util/scrubber/json_scrubber_test.go @@ -6,9 +6,14 @@ package scrubber import ( + "encoding/json" + "os" + "path/filepath" + "reflect" "regexp" "testing" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) @@ -68,3 +73,25 @@ func TestScrubJSON(t *testing.T) { require.Equal(t, expected, string(actual)) }) } + +func TestConfigScrubbedJson(t *testing.T) { + wd, _ := os.Getwd() + + inputConf := filepath.Join(wd, "test", "config.json") + inputConfData, err := os.ReadFile(inputConf) + require.NoError(t, err) + cleaned, err := ScrubJSON([]byte(inputConfData)) + require.NoError(t, err) + // First test that the a scrubbed json is still valid + var actualOutJSON map[string]interface{} + err = json.Unmarshal(cleaned, &actualOutJSON) + assert.NoError(t, err, "Could not load JSON configuration after being scrubbed") + + outputConf := filepath.Join(wd, "test", "config_scrubbed.json") + outputConfData, err := os.ReadFile(outputConf) + require.NoError(t, err) + var expectedOutJSON map[string]interface{} + err = json.Unmarshal(outputConfData, &expectedOutJSON) + require.NoError(t, err) + assert.Equal(t, reflect.DeepEqual(expectedOutJSON, actualOutJSON), true) +} diff --git a/pkg/util/scrubber/scrubber.go b/pkg/util/scrubber/scrubber.go index 1aaad14c2a6d9..c37ede0303017 100644 --- a/pkg/util/scrubber/scrubber.go +++ b/pkg/util/scrubber/scrubber.go @@ -17,6 +17,8 @@ import ( "io" "os" "regexp" + + "github.com/DataDog/datadog-agent/pkg/version" ) // Replacer represents a replacement of sensitive information with a "clean" version. @@ -40,6 +42,18 @@ type Replacer struct { // ReplFunc, if set, is called with the matched bytes (see regexp#Regexp.ReplaceAllFunc). Only // one of Repl and ReplFunc should be set. ReplFunc func(b []byte) []byte + + // LastUpdated is the last version when the replacer was updated. + // This is used to track when a replacer was last updated to compare with the flare version on the rapid side to decide to apply the replacer or not. + LastUpdated *version.Version +} + +func parseVersion(versionString string) *version.Version { + v, err := version.New(versionString, "") + if err != nil { + panic(err) + } + return &v } // ReplacerKind modifies how a Replacer is applied @@ -71,6 +85,10 @@ var blankRegex = regexp.MustCompile(`^\s*$`) type Scrubber struct { singleLineReplacers []Replacer multiLineReplacers []Replacer + + // shouldApply is a function that can be used to conditionally apply a replacer. + // If the function returns false, the replacer will not be applied. + shouldApply func(repl Replacer) bool } // New creates a new scrubber with no replacers installed. @@ -98,6 +116,11 @@ func (c *Scrubber) AddReplacer(kind ReplacerKind, replacer Replacer) { } } +// SetShouldApply sets a condition function to the scrubber. If the function returns false, the replacer will not be applied. +func (c *Scrubber) SetShouldApply(shouldApply func(repl Replacer) bool) { + c.shouldApply = shouldApply +} + // ScrubFile scrubs credentials from file given by pathname func (c *Scrubber) ScrubFile(filePath string) ([]byte, error) { file, err := os.Open(filePath) @@ -177,6 +200,10 @@ func (c *Scrubber) scrub(data []byte, replacers []Replacer) []byte { continue } + if c.shouldApply != nil && !c.shouldApply(repl) { + continue + } + containsHint := false for _, hint := range repl.Hints { if bytes.Contains(data, []byte(hint)) { diff --git a/pkg/util/scrubber/scrubber_test.go b/pkg/util/scrubber/scrubber_test.go index dc23ec52d1971..5a6245d81cddd 100644 --- a/pkg/util/scrubber/scrubber_test.go +++ b/pkg/util/scrubber/scrubber_test.go @@ -28,6 +28,16 @@ func TestNewWithDefaults(t *testing.T) { assert.Equal(t, len(scrubberEmpty.multiLineReplacers), len(scrubber.multiLineReplacers)) } +func TestLastUpdated(t *testing.T) { + scrubber := NewWithDefaults() + for _, replacer := range scrubber.singleLineReplacers { + assert.NotNil(t, replacer.LastUpdated, "single line replacer has no LastUpdated: %v", replacer) + } + for _, replacer := range scrubber.multiLineReplacers { + assert.NotNil(t, replacer.LastUpdated, "multi line replacer has no LastUpdated: %v", replacer) + } +} + func TestRepl(t *testing.T) { scrubber := New() scrubber.AddReplacer(SingleLine, Replacer{ diff --git a/pkg/util/scrubber/test/conf.yaml b/pkg/util/scrubber/test/conf.yaml index cf7fc3d34d3f5..d2bb11a2a9fe3 100644 --- a/pkg/util/scrubber/test/conf.yaml +++ b/pkg/util/scrubber/test/conf.yaml @@ -14,7 +14,7 @@ list_api_key: [aaaaaaaaaaaaaaaaaaaaaaaaaaaabbbb, aaaaaaaaaaaaaaaaaaaaaaaaaaaabbb list_app_key: [aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbb, aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbb] dict_api_key: {one: aaaaaaaaaaaaaaaaaaaaaaaaaaaabbbb, two: aaaaaaaaaaaaaaaaaaaaaaaaaaaabbbb} -dict_app_key: {two: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbb, two: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbb} +dict_app_key: {one: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbb, two: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbb} additional_endpoints: "https://app.datadoghq.com": @@ -29,15 +29,15 @@ random_url_key1: http://user:p@ssw0r)@host:port random_url_key2: protocol://user:p@ssw0r)@host:port random_url_key3: "http://user:password@host:port" random_domain_key: 'user:password@host:port' -random_url_key1: | +random_url_key4: | http://user:password@host:port -random_url_key2: > +random_url_key5: > http://user:password@host:port -random_url_key3: 'http://user:password@host:port' -random_url_key4: 'mongodb+s.r-v://user:password@host:port' -random_url_key5: 'mongodb+srv://user:pass-with-hyphen@abc.example.com/database' -random_url_key6: 'http://user-with-hyphen:pass-with-hyphen@abc.example.com/database' -random_url_key7: 'http://user-with-hyphen:pass@abc.example.com/database' +random_url_key6: 'http://user:password@host:port' +random_url_key7: 'mongodb+s.r-v://user:password@host:port' +random_url_key8: 'mongodb+srv://user:pass-with-hyphen@abc.example.com/database' +random_url_key9: 'http://user-with-hyphen:pass-with-hyphen@abc.example.com/database' +random_url_key10: 'http://user-with-hyphen:pass@abc.example.com/database' mysql_password1: password mysql_password3: "password" diff --git a/pkg/util/scrubber/test/conf_scrubbed.yaml b/pkg/util/scrubber/test/conf_scrubbed.yaml index c4c987bba5df4..5bb34c750ac3c 100644 --- a/pkg/util/scrubber/test/conf_scrubbed.yaml +++ b/pkg/util/scrubber/test/conf_scrubbed.yaml @@ -14,7 +14,7 @@ list_api_key: ["***************************abbbb", "***************************a list_app_key: ["***********************************abbbb", "***********************************abbbb"] dict_api_key: {one: "***************************abbbb", two: "***************************abbbb"} -dict_app_key: {two: "***********************************abbbb", two: "***********************************abbbb"} +dict_app_key: {one: "***********************************abbbb", two: "***********************************abbbb"} additional_endpoints: "https://app.datadoghq.com": @@ -29,15 +29,15 @@ random_url_key1: http://user:********@host:port random_url_key2: protocol://user:********@host:port random_url_key3: "http://user:********@host:port" random_domain_key: 'user:********@host:port' -random_url_key1: | +random_url_key4: | http://user:********@host:port -random_url_key2: > +random_url_key5: > http://user:********@host:port -random_url_key3: 'http://user:********@host:port' -random_url_key4: 'mongodb+s.r-v://user:********@host:port' -random_url_key5: 'mongodb+srv://user:********@abc.example.com/database' -random_url_key6: 'http://user-with-hyphen:********@abc.example.com/database' -random_url_key7: 'http://user-with-hyphen:********@abc.example.com/database' +random_url_key6: 'http://user:********@host:port' +random_url_key7: 'mongodb+s.r-v://user:********@host:port' +random_url_key8: 'mongodb+srv://user:********@abc.example.com/database' +random_url_key9: 'http://user-with-hyphen:********@abc.example.com/database' +random_url_key10: 'http://user-with-hyphen:********@abc.example.com/database' mysql_password1: "********" mysql_password3: "********" diff --git a/pkg/util/scrubber/yaml_scrubber.go b/pkg/util/scrubber/yaml_scrubber.go index 74016778573ba..90f144c6617eb 100644 --- a/pkg/util/scrubber/yaml_scrubber.go +++ b/pkg/util/scrubber/yaml_scrubber.go @@ -6,10 +6,11 @@ package scrubber import ( + "bytes" "fmt" "os" - "gopkg.in/yaml.v2" + "gopkg.in/yaml.v3" ) type scrubCallback = func(string, interface{}) (bool, interface{}) @@ -85,6 +86,11 @@ func (c *Scrubber) ScrubDataObj(data *interface{}) { if replacer.YAMLKeyRegex == nil { continue } + + if c.shouldApply != nil && !c.shouldApply(replacer) { + continue + } + if replacer.YAMLKeyRegex.Match([]byte(key)) { if replacer.ProcessValue != nil { return true, replacer.ProcessValue(value) @@ -105,13 +111,16 @@ func (c *Scrubber) ScrubYaml(input []byte) ([]byte, error) { // if we can't load the yaml run the default scrubber on the input if len(input) != 0 && err == nil { c.ScrubDataObj(data) - newInput, err := yaml.Marshal(data) - if err == nil { - input = newInput - } else { - // Since the scrubber is a dependency of the logger we can use it here. + + var buffer bytes.Buffer + encoder := yaml.NewEncoder(&buffer) + encoder.SetIndent(2) + if err := encoder.Encode(&data); err != nil { fmt.Fprintf(os.Stderr, "error scrubbing YAML, falling back on text scrubber: %s\n", err) + } else { + input = buffer.Bytes() } + encoder.Close() } return c.ScrubBytes(input) } diff --git a/pkg/util/scrubber/yaml_scrubber_test.go b/pkg/util/scrubber/yaml_scrubber_test.go index 68f45dbcb9aaa..d576472186bd2 100644 --- a/pkg/util/scrubber/yaml_scrubber_test.go +++ b/pkg/util/scrubber/yaml_scrubber_test.go @@ -6,9 +6,15 @@ package scrubber import ( + "os" + "path/filepath" + "strings" "testing" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "gopkg.in/yaml.v3" ) func TestScrubDataObj(t *testing.T) { @@ -62,3 +68,104 @@ func TestScrubDataObj(t *testing.T) { }) } } + +func TestConfigScrubbedValidYaml(t *testing.T) { + wd, _ := os.Getwd() + + inputConf := filepath.Join(wd, "test", "conf.yaml") + inputConfData, err := os.ReadFile(inputConf) + require.NoError(t, err) + + outputConf := filepath.Join(wd, "test", "conf_scrubbed.yaml") + outputConfData, err := os.ReadFile(outputConf) + require.NoError(t, err) + + cleaned, err := ScrubBytes([]byte(inputConfData)) + require.NoError(t, err) + + // First test that the a scrubbed yaml is still a valid yaml + var out interface{} + err = yaml.Unmarshal(cleaned, &out) + assert.NoError(t, err, "Could not load YAML configuration after being scrubbed") + + // We replace windows line break by linux so the tests pass on every OS + trimmedOutput := strings.TrimSpace(strings.Replace(string(outputConfData), "\r\n", "\n", -1)) + trimmedCleaned := strings.TrimSpace(strings.Replace(string(cleaned), "\r\n", "\n", -1)) + + assert.Equal(t, trimmedOutput, trimmedCleaned) +} + +func TestConfigScrubbedYaml(t *testing.T) { + wd, _ := os.Getwd() + + inputConf := filepath.Join(wd, "test", "conf_multiline.yaml") + inputConfData, err := os.ReadFile(inputConf) + require.NoError(t, err) + + outputConf := filepath.Join(wd, "test", "conf_multiline_scrubbed.yaml") + outputConfData, err := os.ReadFile(outputConf) + require.NoError(t, err) + + cleaned, err := ScrubYaml([]byte(inputConfData)) + require.NoError(t, err) + + // First test that the a scrubbed yaml is still a valid yaml + var out interface{} + err = yaml.Unmarshal(cleaned, &out) + assert.NoError(t, err, "Could not load YAML configuration after being scrubbed") + + // We replace windows line break by linux so the tests pass on every OS + trimmedOutput := strings.TrimSpace(strings.Replace(string(outputConfData), "\r\n", "\n", -1)) + trimmedCleaned := strings.TrimSpace(strings.Replace(string(cleaned), "\r\n", "\n", -1)) + + assert.Equal(t, trimmedOutput, trimmedCleaned) +} + +func TestEmptyYaml(t *testing.T) { + cleaned, err := ScrubYaml(nil) + require.NoError(t, err) + assert.Equal(t, "", string(cleaned)) + + cleaned, err = ScrubYaml([]byte("")) + require.NoError(t, err) + assert.Equal(t, "", string(cleaned)) +} + +func TestEmptyYamlString(t *testing.T) { + cleaned, err := ScrubYamlString("") + require.NoError(t, err) + assert.Equal(t, "", string(cleaned)) +} + +func TestAddStrippedKeysExceptions(t *testing.T) { + t.Run("single key", func(t *testing.T) { + contents := `api_key: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'` + + AddStrippedKeys([]string{"api_key"}) + + scrubbed, err := ScrubYamlString(contents) + require.Nil(t, err) + require.YAMLEq(t, `api_key: '***************************aaaaa'`, scrubbed) + }) + + t.Run("multiple keys", func(t *testing.T) { + contents := `api_key: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' +some_other_key: 'bbbb' +app_key: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaacccc' +yet_another_key: 'dddd'` + + keys := []string{"api_key", "some_other_key", "app_key"} + AddStrippedKeys(keys) + + // check that AddStrippedKeys didn't modify the parameter slice + assert.Equal(t, []string{"api_key", "some_other_key", "app_key"}, keys) + + scrubbed, err := ScrubYamlString(contents) + require.Nil(t, err) + expected := `api_key: '***************************aaaaa' +some_other_key: '********' +app_key: '***********************************acccc' +yet_another_key: 'dddd'` + require.YAMLEq(t, expected, scrubbed) + }) +} diff --git a/pkg/util/static_tags.go b/pkg/util/static_tags.go index f6173daa9e450..84589ed7e747c 100644 --- a/pkg/util/static_tags.go +++ b/pkg/util/static_tags.go @@ -9,9 +9,8 @@ import ( "context" "strings" + "github.com/DataDog/datadog-agent/comp/core/config" "github.com/DataDog/datadog-agent/pkg/config/env" - "github.com/DataDog/datadog-agent/pkg/config/model" - pkgconfigsetup "github.com/DataDog/datadog-agent/pkg/config/setup" configUtils "github.com/DataDog/datadog-agent/pkg/config/utils" "github.com/DataDog/datadog-agent/pkg/util/fargate" "github.com/DataDog/datadog-agent/pkg/util/flavor" @@ -24,7 +23,7 @@ import ( // included in host tags. In environments with no host metadata (such as where // the hostname is empty), tags that would otherwise be included in host // metadata are generated by this function. -func GetStaticTagsSlice(ctx context.Context) []string { +func GetStaticTagsSlice(ctx context.Context, datadogConfig config.Reader) []string { // fargate (ECS or EKS) does not have host tags, so we need to // add static tags to each container manually @@ -35,7 +34,7 @@ func GetStaticTagsSlice(ctx context.Context) []string { tags := []string{} // DD_TAGS / DD_EXTRA_TAGS - tags = append(tags, configUtils.GetConfiguredTags(pkgconfigsetup.Datadog(), false)...) + tags = append(tags, configUtils.GetConfiguredTags(datadogConfig, false)...) // EKS Fargate specific tags if env.IsFeaturePresent(env.EKSFargate) { @@ -74,8 +73,8 @@ func GetStaticTagsSlice(ctx context.Context) []string { // GetStaticTags is similar to GetStaticTagsSlice, but returning a map[string][]string containing // : pairs for tags. Tags not matching this pattern are omitted. -func GetStaticTags(ctx context.Context) map[string][]string { - tags := GetStaticTagsSlice(ctx) +func GetStaticTags(ctx context.Context, datadogConfig config.Component) map[string][]string { + tags := GetStaticTagsSlice(ctx, datadogConfig) if tags == nil { return nil } @@ -85,7 +84,7 @@ func GetStaticTags(ctx context.Context) map[string][]string { // GetGlobalEnvTags is similar to GetStaticTags, but returning a map[string][]string containing // : pairs for all global environment tags on the cluster agent. This includes: // DD_TAGS, DD_EXTRA_TAGS, DD_CLUSTER_CHECKS_EXTRA_TAGS, and DD_ORCHESTRATOR_EXPLORER_EXTRA_TAGS -func GetGlobalEnvTags(config model.Reader) map[string][]string { +func GetGlobalEnvTags(config config.Reader) map[string][]string { if flavor.GetFlavor() != flavor.ClusterAgent { return nil } diff --git a/pkg/util/static_tags_test.go b/pkg/util/static_tags_test.go index 013e79689fe94..e8fa2b33b004e 100644 --- a/pkg/util/static_tags_test.go +++ b/pkg/util/static_tags_test.go @@ -26,7 +26,7 @@ func TestStaticTags(t *testing.T) { t.Run("just tags", func(t *testing.T) { mockConfig.SetWithoutSource("tags", []string{"some:tag", "another:tag", "nocolon"}) defer mockConfig.SetWithoutSource("tags", []string{}) - staticTags := GetStaticTags(context.Background()) + staticTags := GetStaticTags(context.Background(), mockConfig) assert.Equal(t, map[string][]string{ "some": {"tag"}, "another": {"tag"}, @@ -39,7 +39,7 @@ func TestStaticTags(t *testing.T) { mockConfig.SetWithoutSource("extra_tags", []string{"extra:tag", "missingcolon"}) defer mockConfig.SetWithoutSource("tags", []string{}) defer mockConfig.SetWithoutSource("extra_tags", []string{}) - staticTags := GetStaticTags(context.Background()) + staticTags := GetStaticTags(context.Background(), mockConfig) assert.Equal(t, map[string][]string{ "some": {"tag"}, "extra": {"tag"}, @@ -50,7 +50,7 @@ func TestStaticTags(t *testing.T) { t.Run("cluster name already set", func(t *testing.T) { mockConfig.SetWithoutSource("tags", []string{"kube_cluster_name:foo"}) defer mockConfig.SetWithoutSource("tags", []string{}) - staticTags := GetStaticTags(context.Background()) + staticTags := GetStaticTags(context.Background(), mockConfig) assert.Equal(t, map[string][]string{ "eks_fargate_node": {"eksnode"}, "kube_cluster_name": {"foo"}, @@ -68,7 +68,7 @@ func TestStaticTagsSlice(t *testing.T) { t.Run("just tags", func(t *testing.T) { mockConfig.SetWithoutSource("tags", []string{"some:tag", "another:tag", "nocolon"}) defer mockConfig.SetWithoutSource("tags", []string{}) - staticTags := GetStaticTagsSlice(context.Background()) + staticTags := GetStaticTagsSlice(context.Background(), mockConfig) assert.ElementsMatch(t, []string{ "nocolon", "some:tag", @@ -82,7 +82,7 @@ func TestStaticTagsSlice(t *testing.T) { mockConfig.SetWithoutSource("extra_tags", []string{"extra:tag", "missingcolon"}) defer mockConfig.SetWithoutSource("tags", []string{}) defer mockConfig.SetWithoutSource("extra_tags", []string{}) - staticTags := GetStaticTagsSlice(context.Background()) + staticTags := GetStaticTagsSlice(context.Background(), mockConfig) assert.ElementsMatch(t, []string{ "nocolon", "missingcolon", diff --git a/pkg/util/statstracker/stats_tracker.go b/pkg/util/statstracker/stats_tracker.go index e25543ea5e647..0b917b97381be 100644 --- a/pkg/util/statstracker/stats_tracker.go +++ b/pkg/util/statstracker/stats_tracker.go @@ -171,15 +171,10 @@ func (s *Tracker) InfoKey() string { // Info returns the Tracker as a formatted string slice. func (s *Tracker) Info() []string { - AllTimeAvgLatency := s.AllTimeAvg() / int64(time.Millisecond) - AllTimePeakLatency := s.AllTimePeak() / int64(time.Millisecond) - RecentAvgLatency := s.MovingAvg() / int64(time.Millisecond) - RecentPeakLatency := s.MovingPeak() / int64(time.Millisecond) - return []string{ - fmt.Sprintf("Average Latency (ms): %d", AllTimeAvgLatency), - fmt.Sprintf("24h Average Latency (ms): %d", RecentAvgLatency), - fmt.Sprintf("Peak Latency (ms): %d", AllTimePeakLatency), - fmt.Sprintf("24h Peak Latency (ms): %d", RecentPeakLatency), + fmt.Sprintf("Average Latency: %s", time.Duration(s.AllTimeAvg())), + fmt.Sprintf("24h Average Latency: %s", time.Duration(s.MovingAvg())), + fmt.Sprintf("Peak Latency: %s", time.Duration(s.AllTimePeak())), + fmt.Sprintf("24h Peak Latency: %s", time.Duration(s.MovingPeak())), } } 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 db28f3923c003..e6ad2fcd805ba 100644 --- a/pkg/util/system/go.mod +++ b/pkg/util/system/go.mod @@ -13,30 +13,31 @@ replace ( require ( github.com/DataDog/datadog-agent/pkg/util/filesystem v0.56.0-rc.3 - github.com/DataDog/datadog-agent/pkg/util/log 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.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.56.0-rc.3 - github.com/shirou/gopsutil/v3 v3.24.5 + github.com/DataDog/datadog-agent/pkg/util/winutil v0.59.1 + 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.27.0 + golang.org/x/sys v0.28.0 ) require ( - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.56.0-rc.3 // 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/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/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb // indirect + github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a // 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/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // 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 - gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) + +replace github.com/DataDog/datadog-agent/pkg/version => ../../version diff --git a/pkg/util/system/go.sum b/pkg/util/system/go.sum index 0789cc0a43849..30c4f119b4bf3 100644 --- a/pkg/util/system/go.sum +++ b/pkg/util/system/go.sum @@ -2,32 +2,29 @@ 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= -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= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 h1:S4qyfL2sEm5Budr4KVMyEniCy+PbS55651I/a+Kn/NQ= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb h1:PGufWXXDq9yaev6xX1YQauaO1MV90e6Mpoq1I7Lz/VM= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= 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-20220913051719-115f729f3c8c h1:VtwQ41oftZwlMnOEbMWQtSEUgU64U4s+GHk7hZK+jtY= -github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c/go.mod h1:JKx41uQRwqlTZabZc+kILPrO/3jlKnQ2Z8b7YiVw5cE= +github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a h1:3Bm7EwfUQUvhNeKIkUct/gl9eod1TcXuj8stxvi/GoI= +github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a/go.mod h1:ilwx/Dta8jXAgpFYFvSWEMwxmbWXyiUHkd5FwyKhb5k= 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-20220216144756-c35f1ee13d7c h1:NRoLoZvkBTKvR5gQLgA3e0hqjkY9u1wm+iOL45VN/qI= -github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 h1:o4JXh1EVt9k/+g42oCprj/FisM4qX9L3sZB3upGN2ZU= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55/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= @@ -42,12 +39,10 @@ golang.org/x/sys v0.0.0-20190529164535-6a60838ec259/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.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= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/pkg/util/system/socket/go.mod b/pkg/util/system/socket/go.mod index d3b2514425928..adca0da3a1292 100644 --- a/pkg/util/system/socket/go.mod +++ b/pkg/util/system/socket/go.mod @@ -4,4 +4,4 @@ go 1.22.0 require github.com/Microsoft/go-winio v0.6.2 -require golang.org/x/sys v0.27.0 // indirect +require golang.org/x/sys v0.28.0 // indirect diff --git a/pkg/util/system/socket/go.sum b/pkg/util/system/socket/go.sum index 58b1be1082c18..d723dbfa45f9e 100644 --- a/pkg/util/system/socket/go.sum +++ b/pkg/util/system/socket/go.sum @@ -1,4 +1,4 @@ github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.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= diff --git a/pkg/util/trivy/cache.go b/pkg/util/trivy/cache.go index b1c9da8c53659..06d20166a99f4 100644 --- a/pkg/util/trivy/cache.go +++ b/pkg/util/trivy/cache.go @@ -22,7 +22,7 @@ import ( "github.com/DataDog/datadog-agent/pkg/util/log" "github.com/DataDog/datadog-agent/pkg/util/optional" - "github.com/aquasecurity/trivy/pkg/fanal/cache" + "github.com/aquasecurity/trivy/pkg/cache" "github.com/aquasecurity/trivy/pkg/fanal/types" "github.com/hashicorp/golang-lru/v2/simplelru" ) diff --git a/pkg/util/trivy/containerd.go b/pkg/util/trivy/containerd.go index 94b8b7dab0f8b..47d504b897048 100644 --- a/pkg/util/trivy/containerd.go +++ b/pkg/util/trivy/containerd.go @@ -3,7 +3,7 @@ // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2016-present Datadog, Inc. -//go:build trivy +//go:build trivy && containerd package trivy @@ -17,10 +17,14 @@ import ( "strings" "time" + ftypes "github.com/aquasecurity/trivy/pkg/fanal/types" "github.com/containerd/containerd" "github.com/containerd/containerd/content" "github.com/containerd/containerd/images/archive" + "github.com/containerd/containerd/leases" + "github.com/containerd/containerd/mount" "github.com/containerd/containerd/namespaces" + "github.com/containerd/errdefs" refdocker "github.com/distribution/reference" api "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/container" @@ -31,6 +35,9 @@ import ( "github.com/samber/lo" workloadmeta "github.com/DataDog/datadog-agent/comp/core/workloadmeta/def" + "github.com/DataDog/datadog-agent/pkg/sbom" + cutil "github.com/DataDog/datadog-agent/pkg/util/containerd" + "github.com/DataDog/datadog-agent/pkg/util/log" ) // ContainerdCollector defines the conttainerd collector name @@ -181,3 +188,144 @@ func inspect(ctx context.Context, imgMeta *workloadmeta.ContainerImageMetadata, }, }, history, ref, nil } + +const ( + cleanupTimeout = 30 * time.Second +) + +type fakeContainerdContainer struct { + *fakeContainer + *image +} + +func (c *fakeContainerdContainer) LayerByDiffID(hash string) (ftypes.LayerPath, error) { + return c.fakeContainer.LayerByDiffID(hash) +} + +func (c *fakeContainerdContainer) LayerByDigest(hash string) (ftypes.LayerPath, error) { + return c.fakeContainer.LayerByDigest(hash) +} + +func (c *fakeContainerdContainer) Layers() (layers []ftypes.LayerPath) { + return c.fakeContainer.Layers() +} + +// ContainerdAccessor is a function that should return a containerd client +type ContainerdAccessor func() (cutil.ContainerdItf, error) + +// ScanContainerdImageFromSnapshotter scans containerd image directly from the snapshotter +func (c *Collector) ScanContainerdImageFromSnapshotter(ctx context.Context, imgMeta *workloadmeta.ContainerImageMetadata, img containerd.Image, client cutil.ContainerdItf, scanOptions sbom.ScanOptions) (sbom.Report, error) { + fanalImage, cleanup, err := convertContainerdImage(ctx, client.RawClient(), imgMeta, img) + if cleanup != nil { + defer cleanup() + } + if err != nil { + return nil, err + } + + // Computing duration of containerd lease + deadline, _ := ctx.Deadline() + expiration := deadline.Sub(time.Now().Add(cleanupTimeout)) + clClient := client.RawClient() + imageID := imgMeta.ID + + mounts, err := client.Mounts(ctx, expiration, imgMeta.Namespace, img) + if err != nil { + return nil, fmt.Errorf("unable to get mounts for image %s, err: %w", imgMeta.ID, err) + } + + layers := extractLayersFromOverlayFSMounts(mounts) + if len(layers) == 0 { + return nil, fmt.Errorf("unable to extract layers from overlayfs mounts %+v for image %s", mounts, imgMeta.ID) + } + + ctx = namespaces.WithNamespace(ctx, imgMeta.Namespace) + // Adding a lease to cleanup dandling snaphots at expiration + ctx, done, err := clClient.WithLease(ctx, + leases.WithID(imageID), + leases.WithExpiration(expiration), + leases.WithLabels(map[string]string{ + "containerd.io/gc.ref.snapshot." + containerd.DefaultSnapshotter: imageID, + }), + ) + if err != nil && !errdefs.IsAlreadyExists(err) { + return nil, fmt.Errorf("unable to get a lease, err: %w", err) + } + + report, err := c.scanOverlayFS(ctx, layers, &fakeContainerdContainer{ + image: fanalImage, + fakeContainer: &fakeContainer{ + layerPaths: layers, + imgMeta: imgMeta, + layerIDs: fanalImage.inspect.RootFS.Layers, + }, + }, imgMeta, scanOptions) + + if err := done(ctx); err != nil { + log.Warnf("Unable to cancel containerd lease with id: %s, err: %v", imageID, err) + } + + return report, err +} + +// ScanContainerdImage scans containerd image by exporting it and scanning the tarball +func (c *Collector) ScanContainerdImage(ctx context.Context, imgMeta *workloadmeta.ContainerImageMetadata, img containerd.Image, client cutil.ContainerdItf, scanOptions sbom.ScanOptions) (sbom.Report, error) { + fanalImage, cleanup, err := convertContainerdImage(ctx, client.RawClient(), imgMeta, img) + if cleanup != nil { + defer cleanup() + } + if err != nil { + return nil, fmt.Errorf("unable to convert containerd image, err: %w", err) + } + + return c.scanImage(ctx, fanalImage, imgMeta, scanOptions) +} + +// ScanContainerdImageFromFilesystem scans containerd image from file-system +func (c *Collector) ScanContainerdImageFromFilesystem(ctx context.Context, imgMeta *workloadmeta.ContainerImageMetadata, img containerd.Image, client cutil.ContainerdItf, scanOptions sbom.ScanOptions) (sbom.Report, error) { + imagePath, err := os.MkdirTemp("", "containerd-image-*") + if err != nil { + return nil, fmt.Errorf("unable to create temp dir, err: %w", err) + } + defer func() { + err := os.RemoveAll(imagePath) + if err != nil { + log.Errorf("Unable to remove temp dir: %s, err: %v", imagePath, err) + } + }() + + // Computing duration of containerd lease + deadline, _ := ctx.Deadline() + expiration := deadline.Sub(time.Now().Add(cleanupTimeout)) + + cleanUp, err := client.MountImage(ctx, expiration, imgMeta.Namespace, img, imagePath) + if err != nil { + return nil, fmt.Errorf("unable to mount containerd image, err: %w", err) + } + + defer func() { + cleanUpContext, cleanUpContextCancel := context.WithTimeout(context.Background(), cleanupTimeout) + err := cleanUp(cleanUpContext) + cleanUpContextCancel() + if err != nil { + log.Errorf("Unable to clean up mounted image, err: %v", err) + } + }() + + return c.scanFilesystem(ctx, imagePath, imgMeta, scanOptions) +} + +func extractLayersFromOverlayFSMounts(mounts []mount.Mount) []string { + var layers []string + for _, mount := range mounts { + for _, opt := range mount.Options { + for _, prefix := range []string{"upperdir=", "lowerdir="} { + trimmedOpt := strings.TrimPrefix(opt, prefix) + if trimmedOpt != opt { + layers = append(layers, strings.Split(trimmedOpt, ":")...) + } + } + } + } + return layers +} diff --git a/pkg/util/trivy/crio.go b/pkg/util/trivy/crio.go new file mode 100644 index 0000000000000..610e1739a435a --- /dev/null +++ b/pkg/util/trivy/crio.go @@ -0,0 +1,102 @@ +// 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 trivy && crio + +// Package trivy holds the scan components +package trivy + +import ( + "context" + "fmt" + "path/filepath" + + workloadmeta "github.com/DataDog/datadog-agent/comp/core/workloadmeta/def" + "github.com/DataDog/datadog-agent/pkg/sbom" + "github.com/DataDog/datadog-agent/pkg/util/crio" + ftypes "github.com/aquasecurity/trivy/pkg/fanal/types" + v1 "github.com/google/go-containerregistry/pkg/v1" +) + +type fakeCRIOContainer struct { + *fakeContainer +} + +func (c *fakeCRIOContainer) ID() (string, error) { + return c.imgMeta.ID, nil +} + +func (c *fakeCRIOContainer) ConfigFile() (*v1.ConfigFile, error) { + configFile := &v1.ConfigFile{ + Architecture: c.imgMeta.Architecture, + OS: c.imgMeta.OS, + } + configFile.RootFS.DiffIDs = make([]v1.Hash, len(c.layerIDs)) + for i, diffID := range c.layerIDs { + configFile.RootFS.DiffIDs[i], _ = v1.NewHash(diffID) + } + + for _, layer := range c.imgMeta.Layers { + configFile.History = append(configFile.History, v1.History{ + Author: layer.History.Author, + Created: v1.Time{Time: *layer.History.Created}, + CreatedBy: layer.History.CreatedBy, + Comment: layer.History.Comment, + EmptyLayer: layer.History.EmptyLayer, + }) + + } + return configFile, nil +} + +func (c *fakeCRIOContainer) LayerByDiffID(hash string) (ftypes.LayerPath, error) { + return c.fakeContainer.LayerByDiffID(hash) +} + +func (c *fakeCRIOContainer) LayerByDigest(hash string) (ftypes.LayerPath, error) { + return c.fakeContainer.LayerByDigest(hash) +} + +func (c *fakeCRIOContainer) Layers() (layers []ftypes.LayerPath) { + return c.fakeContainer.Layers() +} + +func (c *fakeCRIOContainer) Name() string { + return c.imgMeta.Name +} + +func (c *fakeCRIOContainer) RepoTags() []string { + return c.imgMeta.RepoTags +} + +func (c *fakeCRIOContainer) RepoDigests() []string { + return c.imgMeta.RepoDigests +} + +// ScanCRIOImageFromOverlayFS scans the CRI-O image layers using OverlayFS. +func (c *Collector) ScanCRIOImageFromOverlayFS(ctx context.Context, imgMeta *workloadmeta.ContainerImageMetadata, client crio.Client, scanOptions sbom.ScanOptions) (sbom.Report, error) { + lowerDirs, err := client.GetCRIOImageLayers(imgMeta) + if err != nil { + return nil, fmt.Errorf("failed to retrieve layer directories: %w", err) + } + + diffIDs := make([]string, 0, len(lowerDirs)) + for _, dir := range lowerDirs { + diffIDs = append(diffIDs, "sha256:"+filepath.Base(filepath.Dir(dir))) + } + + report, err := c.scanOverlayFS(ctx, lowerDirs, &fakeCRIOContainer{ + fakeContainer: &fakeContainer{ + imgMeta: imgMeta, + layerPaths: lowerDirs, + layerIDs: diffIDs, + }, + }, imgMeta, scanOptions) + if err != nil { + return nil, err + } + + return report, nil +} diff --git a/pkg/util/trivy/docker.go b/pkg/util/trivy/docker.go index f4a255c24e00e..bbd22bd8a1e1c 100644 --- a/pkg/util/trivy/docker.go +++ b/pkg/util/trivy/docker.go @@ -11,8 +11,13 @@ import ( "context" "fmt" "os" + "strings" workloadmeta "github.com/DataDog/datadog-agent/comp/core/workloadmeta/def" + "github.com/DataDog/datadog-agent/pkg/config/env" + "github.com/DataDog/datadog-agent/pkg/sbom" + containersimage "github.com/DataDog/datadog-agent/pkg/util/containers/image" + ftypes "github.com/aquasecurity/trivy/pkg/fanal/types" "github.com/docker/docker/client" ) @@ -52,9 +57,84 @@ func convertDockerImage(ctx context.Context, client client.ImageAPIClient, imgMe _ = os.Remove(f.Name()) } - return &image{ + img := &image{ opener: imageOpener(ctx, DockerCollector, imageID, f, client.ImageSave), inspect: inspect, history: configHistory(history), - }, cleanup, nil + } + + return img, cleanup, nil +} + +type fakeDockerContainer struct { + *image + *fakeContainer +} + +func (c *fakeDockerContainer) LayerByDiffID(hash string) (ftypes.LayerPath, error) { + return c.fakeContainer.LayerByDiffID(hash) +} + +func (c *fakeDockerContainer) LayerByDigest(hash string) (ftypes.LayerPath, error) { + return c.fakeContainer.LayerByDigest(hash) +} + +func (c *fakeDockerContainer) Layers() (layers []ftypes.LayerPath) { + return c.fakeContainer.Layers() +} + +// ScanDockerImageFromGraphDriver scans a docker image directly from the graph driver +func (c *Collector) ScanDockerImageFromGraphDriver(ctx context.Context, imgMeta *workloadmeta.ContainerImageMetadata, client client.ImageAPIClient, scanOptions sbom.ScanOptions) (sbom.Report, error) { + fanalImage, cleanup, err := convertDockerImage(ctx, client, imgMeta) + if cleanup != nil { + defer cleanup() + } + + if err != nil { + return nil, fmt.Errorf("unable to convert docker image, err: %w", err) + } + + if fanalImage.inspect.GraphDriver.Name == "overlay2" { + var layers []string + if layerDirs, ok := fanalImage.inspect.GraphDriver.Data["LowerDir"]; ok { + layers = append(layers, strings.Split(layerDirs, ":")...) + } + + if layerDirs, ok := fanalImage.inspect.GraphDriver.Data["UpperDir"]; ok { + layers = append(layers, strings.Split(layerDirs, ":")...) + } + + if env.IsContainerized() { + for i, layer := range layers { + layers[i] = containersimage.SanitizeHostPath(layer) + } + } + + fakeContainer := &fakeDockerContainer{ + image: fanalImage, + fakeContainer: &fakeContainer{ + layerIDs: fanalImage.inspect.RootFS.Layers, + layerPaths: layers, + imgMeta: imgMeta, + }, + } + + return c.scanOverlayFS(ctx, layers, fakeContainer, imgMeta, scanOptions) + } + + return nil, fmt.Errorf("unsupported graph driver: %s", fanalImage.inspect.GraphDriver.Name) +} + +// ScanDockerImage scans a docker image by exporting it and scanning the tarball +func (c *Collector) ScanDockerImage(ctx context.Context, imgMeta *workloadmeta.ContainerImageMetadata, client client.ImageAPIClient, scanOptions sbom.ScanOptions) (sbom.Report, error) { + fanalImage, cleanup, err := convertDockerImage(ctx, client, imgMeta) + if cleanup != nil { + defer cleanup() + } + + if err != nil { + return nil, fmt.Errorf("unable to convert docker image, err: %w", err) + } + + return c.scanImage(ctx, fanalImage, imgMeta, scanOptions) } diff --git a/pkg/util/trivy/image.go b/pkg/util/trivy/image.go index 93fa12e3bd5ab..adf2e650004b6 100644 --- a/pkg/util/trivy/image.go +++ b/pkg/util/trivy/image.go @@ -299,3 +299,7 @@ func (img *image) Name() string { func (img *image) ID() (string, error) { return fimage.ID(img) } + +func (img *image) Layers() ([]v1.Layer, error) { + return nil, nil +} diff --git a/pkg/util/trivy/overlayfs.go b/pkg/util/trivy/overlayfs.go index 8c5a73cf8e3ea..34c08105884bb 100644 --- a/pkg/util/trivy/overlayfs.go +++ b/pkg/util/trivy/overlayfs.go @@ -3,240 +3,109 @@ // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2016-present Datadog, Inc. -//go:build linux +//go:build trivy // Package trivy implement a simple overlayfs like filesystem to be able to // scan through layered filesystems. package trivy import ( + "context" "errors" "fmt" - "io/fs" - "os" - "path" - "sort" - "syscall" - "golang.org/x/sys/unix" -) - -// whiteoutCharDev is defined as zero and is not const only for testing as it -// is not allowed to mknod a 0/0 char dev in userns. -var whiteoutCharDev uint64 = 0 //nolint:revive - -var whiteout *fs.DirEntry - -type filesystem struct { - layers []string -} - -type file struct { - *os.File - ofs filesystem - fi fs.FileInfo - name string -} + workloadmeta "github.com/DataDog/datadog-agent/comp/core/workloadmeta/def" + "github.com/DataDog/datadog-agent/pkg/sbom" + "github.com/DataDog/datadog-agent/pkg/util/log" -// NewFS returns a fs.ReadDirFS consisting of merging the given layer paths. -func NewFS(layers []string) interface { - fs.FS - fs.ReadDirFS - fs.StatFS -} { - return &filesystem{layers[:]} -} - -// Open implements fs.StatFS. -func (ofs filesystem) Stat(name string) (fs.FileInfo, error) { - name = path.Join("/", name)[1:] - if name == "" { - name = "." - } - _, fi, err := ofs.stat(name) - return fi, err -} + "github.com/aquasecurity/trivy/pkg/fanal/applier" + local "github.com/aquasecurity/trivy/pkg/fanal/artifact/container" + ftypes "github.com/aquasecurity/trivy/pkg/fanal/types" + v1 "github.com/google/go-containerregistry/pkg/v1" +) -// Open implements fs.FS. -func (ofs filesystem) Open(name string) (fs.File, error) { - name = path.Join("/", name)[1:] - layerIndex, fi, err := ofs.stat(name) - if err != nil { - err.(*os.PathError).Op = "open" - return nil, err - } - f, err := os.Open(ofs.path(layerIndex, name)) - if err != nil { - return nil, &os.PathError{Op: "open", Path: name, Err: err} +type fakeContainer struct { + layerIDs []string + imgMeta *workloadmeta.ContainerImageMetadata + layerPaths []string +} + +func (c *fakeContainer) LayerByDiffID(hash string) (ftypes.LayerPath, error) { + for i, layer := range c.layerIDs { + diffID, _ := v1.NewHash(layer) + if diffID.String() == hash { + return ftypes.LayerPath{ + DiffID: diffID.String(), + Path: c.layerPaths[i], + Digest: c.imgMeta.Layers[i].Digest, + }, nil + } } - return &file{File: f, ofs: ofs, fi: fi, name: name}, nil + return ftypes.LayerPath{}, errors.New("not found") } -func (ofs filesystem) path(layerIndex int, name string) string { - if !fs.ValidPath(name) { - panic(fmt.Errorf("unexpected invalid path name %q", name)) +func (c *fakeContainer) LayerByDigest(hash string) (ftypes.LayerPath, error) { + for i, layer := range c.layerIDs { + diffID, _ := v1.NewHash(layer) + if hash == c.imgMeta.Layers[i].Digest { + return ftypes.LayerPath{ + DiffID: diffID.String(), + Path: c.layerPaths[i], + Digest: c.imgMeta.Layers[i].Digest, + }, nil + } } - return path.Join(ofs.layers[layerIndex], name) + return ftypes.LayerPath{}, errors.New("not found") } -func (ofs filesystem) stat(name string) (int, fs.FileInfo, error) { - var errf error - for layerIndex := range ofs.layers { - fi, err := os.Stat(ofs.path(layerIndex, name)) - if errors.Is(err, syscall.ENOENT) || errors.Is(err, syscall.ENOTDIR) { - // When path does not exist, overlayfs does not verify that a - // whiteout file has been created as one of the parent dir in the - // current layer. Meaning you can open file from lower dirs even - // if a whiteout or opaque directory has been created on an upper - // layer. - continue - } - if err != nil { - errf = err - break - } - if isWhiteout(fi) { - break - } - return layerIndex, fi, nil +func (c *fakeContainer) Layers() (layers []ftypes.LayerPath) { + for i, layer := range c.layerIDs { + diffID, _ := v1.NewHash(layer) + layers = append(layers, ftypes.LayerPath{ + DiffID: diffID.String(), + Path: c.layerPaths[i], + Digest: c.imgMeta.Layers[i].Digest, + }) } - if errf == nil { - errf = syscall.ENOENT - } - return 0, nil, &os.PathError{Op: "stat", Path: name, Err: errf} -} -// ReadDir implements fs.ReadDirFS. -func (ofs filesystem) ReadDir(name string) ([]fs.DirEntry, error) { - return ofs.readDirN(name, -1) + return layers } -func (ofs filesystem) readDirN(name string, n int) ([]fs.DirEntry, error) { - name = path.Join("/", name)[1:] - if name == "" { - name = "." - } - - var entriesMap map[string]*fs.DirEntry - var err error - var ok bool - for layerIndex := range ofs.layers { - if ok, err = ofs.readDirLayer(layerIndex, name, n, &entriesMap); ok { - break - } - } - if err == nil && entriesMap == nil { - err = syscall.ENOENT - } +func (c *Collector) scanOverlayFS(ctx context.Context, layers []string, ctr ftypes.Container, imgMeta *workloadmeta.ContainerImageMetadata, scanOptions sbom.ScanOptions) (sbom.Report, error) { + cache, err := c.getCache() if err != nil { - return []fs.DirEntry{}, &os.PathError{Op: "readdirent", Path: name, Err: err} + return nil, err } - entries := make([]fs.DirEntry, 0, len(entriesMap)) - for _, entry := range entriesMap { - if entry != whiteout { - entries = append(entries, *entry) - } + if cache == nil { + return nil, errors.New("failed to get cache for scan") } - sort.Slice(entries, func(i, j int) bool { - return entries[i].Name() < entries[j].Name() - }) - if n > 0 && len(entries) > n { - entries = entries[:n] - } - return entries, nil -} -func (ofs filesystem) readDirLayer(layerIndex int, name string, n int, entriesMap *map[string]*fs.DirEntry) (bool, error) { - fullname := ofs.path(layerIndex, name) - - di, err := os.Stat(fullname) - if errors.Is(err, syscall.ENOENT) || errors.Is(err, syscall.ENOTDIR) { - return false, nil - } + containerArtifact, err := local.NewArtifact(ctr, cache, NewFSWalker(), getDefaultArtifactOption(scanOptions)) if err != nil { - return true, err - } - if isWhiteout(di) { - return true, syscall.ENOENT - } - if !di.IsDir() { - return true, syscall.ENOTDIR + return nil, err } - d, err := os.Open(fullname) - if err != nil { - return true, err - } + log.Debugf("Generating SBOM for image %s using overlayfs %+v", imgMeta.ID, layers) - entries, err := d.ReadDir(n) + trivyReport, err := c.scan(ctx, containerArtifact, applier.NewApplier(cache), imgMeta, cache, false) if err != nil { - return true, err - } - if *entriesMap == nil { - *entriesMap = make(map[string]*fs.DirEntry) - } - for entryIndex, entry := range entries { - entryName := entry.Name() - if _, exists := (*entriesMap)[entryName]; !exists { - entryPtr := &entries[entryIndex] - if entry.Type().IsRegular() { - (*entriesMap)[entryName] = entryPtr - } else { - ei, err := entry.Info() - if err != nil { - return true, err - } - if isWhiteout(ei) { - (*entriesMap)[entryName] = whiteout - } else { - (*entriesMap)[entryName] = entryPtr - } - } + if imgMeta != nil { + return nil, fmt.Errorf("unable to marshal report to sbom format for image %s, err: %w", imgMeta.ID, err) } + return nil, fmt.Errorf("unable to marshal report to sbom format, err: %w", err) } - return isOpaqueDir(d), nil -} - -// ReadDir implements fs.ReadDirFile. -func (f *file) ReadDir(n int) ([]fs.DirEntry, error) { - if !f.fi.IsDir() { - return nil, &os.PathError{Op: "readdirent", Path: f.name, Err: syscall.ENOTDIR} + log.Debugf("Found OS: %+v", trivyReport.Metadata.OS) + pkgCount := 0 + for _, results := range trivyReport.Results { + pkgCount += len(results.Packages) } - return f.ofs.readDirN(f.name, n) -} - -// Read implements fs.File. -func (f *file) Read(b []byte) (int, error) { - return f.File.Read(b) -} + log.Debugf("Found %d packages", pkgCount) -// Stat implements fs.File. -func (f *file) Stat() (fs.FileInfo, error) { - return f.fi, nil -} - -// Close implements fs.File. -func (f *file) Close() error { - return f.File.Close() -} - -var _ fs.ReadDirFile = &file{} - -func isWhiteout(fm fs.FileInfo) bool { - return fm.Mode()&fs.ModeCharDevice != 0 && uint64(fm.Sys().(*syscall.Stat_t).Rdev) == whiteoutCharDev -} - -func isOpaqueDir(d *os.File) bool { - var data [1]byte - var sz int - var err error - for { - sz, err = unix.Fgetxattr(int(d.Fd()), "trusted.overlay.opaque", data[:]) - if err != unix.EINTR { - break - } - } - return sz == 1 && data[0] == 'y' + return &Report{ + Report: trivyReport, + id: imgMeta.ID, + marshaler: c.marshaler, + }, nil } diff --git a/pkg/util/trivy/trivy.go b/pkg/util/trivy/trivy.go index 07a15d58d93ac..1f2765cb5e5fa 100644 --- a/pkg/util/trivy/trivy.go +++ b/pkg/util/trivy/trivy.go @@ -12,25 +12,15 @@ import ( "context" "errors" "fmt" - "io/fs" - "os" - "path/filepath" "runtime" "sort" - "strings" "sync" - "time" - "github.com/containerd/containerd/mount" - "github.com/containerd/containerd/namespaces" + "golang.org/x/xerrors" "github.com/DataDog/datadog-agent/comp/core/config" workloadmeta "github.com/DataDog/datadog-agent/comp/core/workloadmeta/def" - "github.com/DataDog/datadog-agent/pkg/config/env" "github.com/DataDog/datadog-agent/pkg/sbom" - cutil "github.com/DataDog/datadog-agent/pkg/util/containerd" - containersimage "github.com/DataDog/datadog-agent/pkg/util/containers/image" - "github.com/DataDog/datadog-agent/pkg/util/crio" "github.com/DataDog/datadog-agent/pkg/util/log" "github.com/DataDog/datadog-agent/pkg/util/optional" @@ -41,38 +31,28 @@ import ( image2 "github.com/aquasecurity/trivy/pkg/fanal/artifact/image" local2 "github.com/aquasecurity/trivy/pkg/fanal/artifact/local" ftypes "github.com/aquasecurity/trivy/pkg/fanal/types" + "github.com/aquasecurity/trivy/pkg/fanal/walker" "github.com/aquasecurity/trivy/pkg/sbom/cyclonedx" "github.com/aquasecurity/trivy/pkg/scanner" "github.com/aquasecurity/trivy/pkg/scanner/langpkg" - "github.com/aquasecurity/trivy/pkg/scanner/local" "github.com/aquasecurity/trivy/pkg/scanner/ospkg" "github.com/aquasecurity/trivy/pkg/types" "github.com/aquasecurity/trivy/pkg/vulnerability" - "github.com/containerd/containerd" - "github.com/containerd/containerd/leases" - "github.com/containerd/errdefs" - "github.com/docker/docker/client" // This is required to load sqlite based RPM databases _ "modernc.org/sqlite" ) const ( - cleanupTimeout = 30 * time.Second - OSAnalyzers = "os" // OSAnalyzers defines an OS analyzer LanguagesAnalyzers = "languages" // LanguagesAnalyzers defines a language analyzer SecretAnalyzers = "secret" // SecretAnalyzers defines a secret analyzer ConfigFileAnalyzers = "config" // ConfigFileAnalyzers defines a configuration file analyzer - LicenseAnalyzers = "license" // LicenseAnalyzers defines a license analyzer TypeApkCommand = "apk-command" // TypeApkCommand defines a apk-command analyzer HistoryDockerfile = "history-dockerfile" // HistoryDockerfile defines a history-dockerfile analyzer TypeImageConfigSecret = "image-config-secret" // TypeImageConfigSecret defines a history-dockerfile analyzer ) -// ContainerdAccessor is a function that should return a containerd client -type ContainerdAccessor func() (cutil.ContainerdItf, error) - // collectorConfig allows to pass configuration type collectorConfig struct { clearCacheOnClose bool @@ -94,7 +74,7 @@ type Collector struct { var globalCollector *Collector -func getDefaultArtifactOption(root string, opts sbom.ScanOptions) artifact.Option { +func getDefaultArtifactOption(opts sbom.ScanOptions) artifact.Option { parallel := 1 if opts.Fast { parallel = runtime.NumCPU() @@ -107,18 +87,11 @@ func getDefaultArtifactOption(root string, opts sbom.ScanOptions) artifact.Optio Parallel: parallel, SBOMSources: []string{}, DisabledHandlers: DefaultDisabledHandlers(), - WalkOption: artifact.WalkOption{ - ErrorCallback: func(_ string, err error) error { - if errors.Is(err, fs.ErrPermission) || errors.Is(err, os.ErrNotExist) { - return nil - } - return err - }, - }, + WalkerOption: walker.Option{}, } if len(opts.Analyzers) == 1 && opts.Analyzers[0] == OSAnalyzers { - option.OnlyDirs = []string{ + option.WalkerOption.OnlyDirs = []string{ "/etc/*", "/lib/apk/db/*", "/usr/lib/*", @@ -126,14 +99,6 @@ func getDefaultArtifactOption(root string, opts sbom.ScanOptions) artifact.Optio "/var/lib/dpkg/**", "/var/lib/rpm/*", } - if root != "" { - // OnlyDirs is handled differently for image than for filesystem. - // This needs to be fixed properly but in the meantime, use absolute - // paths for fs and relative paths for images. - for i := range option.OnlyDirs { - option.OnlyDirs[i] = filepath.Join(root, option.OnlyDirs[i]) - } - } } return option @@ -160,9 +125,6 @@ func DefaultDisabledCollectors(enabledAnalyzers []string) []analyzer.Type { if analyzersDisabled(ConfigFileAnalyzers) { disabledAnalyzers = append(disabledAnalyzers, analyzer.TypeConfigFiles...) } - if analyzersDisabled(LicenseAnalyzers) { - disabledAnalyzers = append(disabledAnalyzers, analyzer.TypeLicenseFile) - } if analyzersDisabled(TypeApkCommand) { disabledAnalyzers = append(disabledAnalyzers, analyzer.TypeApkCommand) } @@ -177,7 +139,9 @@ func DefaultDisabledCollectors(enabledAnalyzers []string) []analyzer.Type { analyzer.TypeRedHatContentManifestType, analyzer.TypeRedHatDockerfileType, analyzer.TypeSBOM, - analyzer.TypeUbuntuESM) + analyzer.TypeUbuntuESM, + analyzer.TypeLicenseFile, + ) return disabledAnalyzers } @@ -259,174 +223,13 @@ func (c *Collector) getCache() (CacheWithCleaner, error) { return c.persistentCache, nil } -// ScanDockerImageFromGraphDriver scans a docker image directly from the graph driver -func (c *Collector) ScanDockerImageFromGraphDriver(ctx context.Context, imgMeta *workloadmeta.ContainerImageMetadata, client client.ImageAPIClient, scanOptions sbom.ScanOptions) (sbom.Report, error) { - fanalImage, cleanup, err := convertDockerImage(ctx, client, imgMeta) - if cleanup != nil { - defer cleanup() - } - - if err != nil { - return nil, fmt.Errorf("unable to convert docker image, err: %w", err) - } - - if fanalImage.inspect.GraphDriver.Name == "overlay2" { - var layers []string - if layerDirs, ok := fanalImage.inspect.GraphDriver.Data["LowerDir"]; ok { - layers = append(layers, strings.Split(layerDirs, ":")...) - } - - if layerDirs, ok := fanalImage.inspect.GraphDriver.Data["UpperDir"]; ok { - layers = append(layers, strings.Split(layerDirs, ":")...) - } - - if env.IsContainerized() { - for i, layer := range layers { - layers[i] = containersimage.SanitizeHostPath(layer) - } - } - - return c.scanOverlayFS(ctx, layers, imgMeta, scanOptions) - } - - return nil, fmt.Errorf("unsupported graph driver: %s", fanalImage.inspect.GraphDriver.Name) -} - -// ScanDockerImage scans a docker image by exporting it and scanning the tarball -func (c *Collector) ScanDockerImage(ctx context.Context, imgMeta *workloadmeta.ContainerImageMetadata, client client.ImageAPIClient, scanOptions sbom.ScanOptions) (sbom.Report, error) { - fanalImage, cleanup, err := convertDockerImage(ctx, client, imgMeta) - if cleanup != nil { - defer cleanup() - } - - if err != nil { - return nil, fmt.Errorf("unable to convert docker image, err: %w", err) - } - - return c.scanImage(ctx, fanalImage, imgMeta, scanOptions) -} - -func (c *Collector) scanOverlayFS(ctx context.Context, layers []string, imgMeta *workloadmeta.ContainerImageMetadata, scanOptions sbom.ScanOptions) (sbom.Report, error) { - log.Debugf("Generating SBOM for image %s using overlayfs %+v", imgMeta.ID, layers) - overlayFsReader := NewFS(layers) - report, err := c.scanFilesystem(ctx, overlayFsReader, "/", imgMeta, scanOptions) - if err != nil { - return nil, err - } - - return report, nil -} - -// ScanContainerdImageFromSnapshotter scans containerd image directly from the snapshotter -func (c *Collector) ScanContainerdImageFromSnapshotter(ctx context.Context, imgMeta *workloadmeta.ContainerImageMetadata, img containerd.Image, client cutil.ContainerdItf, scanOptions sbom.ScanOptions) (sbom.Report, error) { - // Computing duration of containerd lease - deadline, _ := ctx.Deadline() - expiration := deadline.Sub(time.Now().Add(cleanupTimeout)) - clClient := client.RawClient() - imageID := imgMeta.ID - - mounts, err := client.Mounts(ctx, expiration, imgMeta.Namespace, img) - if err != nil { - return nil, fmt.Errorf("unable to get mounts for image %s, err: %w", imgMeta.ID, err) - } - - layers := extractLayersFromOverlayFSMounts(mounts) - if len(layers) == 0 { - return nil, fmt.Errorf("unable to extract layers from overlayfs mounts %+v for image %s", mounts, imgMeta.ID) - } - - ctx = namespaces.WithNamespace(ctx, imgMeta.Namespace) - // Adding a lease to cleanup dandling snaphots at expiration - ctx, done, err := clClient.WithLease(ctx, - leases.WithID(imageID), - leases.WithExpiration(expiration), - leases.WithLabels(map[string]string{ - "containerd.io/gc.ref.snapshot." + containerd.DefaultSnapshotter: imageID, - }), - ) - if err != nil && !errdefs.IsAlreadyExists(err) { - return nil, fmt.Errorf("unable to get a lease, err: %w", err) - } - - report, err := c.scanOverlayFS(ctx, layers, imgMeta, scanOptions) - - if err := done(ctx); err != nil { - log.Warnf("Unable to cancel containerd lease with id: %s, err: %v", imageID, err) - } - - return report, err -} - -// ScanContainerdImage scans containerd image by exporting it and scanning the tarball -func (c *Collector) ScanContainerdImage(ctx context.Context, imgMeta *workloadmeta.ContainerImageMetadata, img containerd.Image, client cutil.ContainerdItf, scanOptions sbom.ScanOptions) (sbom.Report, error) { - fanalImage, cleanup, err := convertContainerdImage(ctx, client.RawClient(), imgMeta, img) - if cleanup != nil { - defer cleanup() - } - if err != nil { - return nil, fmt.Errorf("unable to convert containerd image, err: %w", err) - } - - return c.scanImage(ctx, fanalImage, imgMeta, scanOptions) -} - -// ScanContainerdImageFromFilesystem scans containerd image from file-system -func (c *Collector) ScanContainerdImageFromFilesystem(ctx context.Context, imgMeta *workloadmeta.ContainerImageMetadata, img containerd.Image, client cutil.ContainerdItf, scanOptions sbom.ScanOptions) (sbom.Report, error) { - //nolint:gosimple // TODO(CINT) Fix go simple linte - imagePath, err := os.MkdirTemp(os.TempDir(), fmt.Sprintf("containerd-image-*")) - if err != nil { - return nil, fmt.Errorf("unable to create temp dir, err: %w", err) - } - defer func() { - err := os.RemoveAll(imagePath) - if err != nil { - log.Errorf("Unable to remove temp dir: %s, err: %v", imagePath, err) - } - }() - - // Computing duration of containerd lease - deadline, _ := ctx.Deadline() - expiration := deadline.Sub(time.Now().Add(cleanupTimeout)) - - cleanUp, err := client.MountImage(ctx, expiration, imgMeta.Namespace, img, imagePath) - if err != nil { - return nil, fmt.Errorf("unable to mount containerd image, err: %w", err) - } - - defer func() { - cleanUpContext, cleanUpContextCancel := context.WithTimeout(context.Background(), cleanupTimeout) - err := cleanUp(cleanUpContext) - cleanUpContextCancel() - if err != nil { - log.Errorf("Unable to clean up mounted image, err: %v", err) - } - }() - - return c.scanFilesystem(ctx, os.DirFS("/"), imagePath, imgMeta, scanOptions) -} - -// ScanCRIOImageFromOverlayFS scans the CRI-O image layers using OverlayFS. -func (c *Collector) ScanCRIOImageFromOverlayFS(ctx context.Context, imgMeta *workloadmeta.ContainerImageMetadata, client crio.Client, scanOptions sbom.ScanOptions) (sbom.Report, error) { - lowerDirs, err := client.GetCRIOImageLayers(imgMeta) - if err != nil { - return nil, fmt.Errorf("failed to retrieve layer directories: %w", err) - } - - report, err := c.scanOverlayFS(ctx, lowerDirs, imgMeta, scanOptions) - if err != nil { - return nil, err - } - - return report, nil -} - // scanFilesystem scans the specified directory and logs detailed scan steps. -func (c *Collector) scanFilesystem(ctx context.Context, fsys fs.FS, path string, imgMeta *workloadmeta.ContainerImageMetadata, scanOptions sbom.ScanOptions) (sbom.Report, error) { +func (c *Collector) scanFilesystem(ctx context.Context, path string, imgMeta *workloadmeta.ContainerImageMetadata, scanOptions sbom.ScanOptions) (sbom.Report, error) { // For filesystem scans, it is required to walk the filesystem to get the persistentCache key so caching does not add any value. // TODO: Cache directly the trivy report for container images cache := newMemoryCache() - fsArtifact, err := local2.NewArtifact(fsys, path, cache, getDefaultArtifactOption(".", scanOptions)) + fsArtifact, err := local2.NewArtifact(path, cache, NewFSWalker(), getDefaultArtifactOption(scanOptions)) if err != nil { return nil, fmt.Errorf("unable to create artifact from fs, err: %w", err) } @@ -454,8 +257,60 @@ func (c *Collector) scanFilesystem(ctx context.Context, fsys fs.FS, path string, } // ScanFilesystem scans file-system -func (c *Collector) ScanFilesystem(ctx context.Context, fsys fs.FS, path string, scanOptions sbom.ScanOptions) (sbom.Report, error) { - return c.scanFilesystem(ctx, fsys, path, nil, scanOptions) +func (c *Collector) ScanFilesystem(ctx context.Context, path string, scanOptions sbom.ScanOptions) (sbom.Report, error) { + return c.scanFilesystem(ctx, path, nil, scanOptions) +} + +type driver struct { + applier applier.Applier +} + +func (d *driver) Scan(_ context.Context, target, artifactKey string, blobKeys []string, _ types.ScanOptions) ( + results types.Results, osFound ftypes.OS, err error) { + + detail, err := d.applier.ApplyLayers(artifactKey, blobKeys) + switch { + case errors.Is(err, analyzer.ErrUnknownOS): + log.Debug("OS is not detected.") + + // Packages may contain OS-independent binary information even though OS is not detected. + if len(detail.Packages) != 0 { + detail.OS = ftypes.OS{Family: "none"} + } + + // If OS is not detected and repositories are detected, we'll try to use repositories as OS. + if detail.Repository != nil { + log.Debug("Package repository %s, version %s", string(detail.Repository.Family), detail.Repository.Release) + log.Debug("Assuming OS family %s, version %s", string(detail.Repository.Family), detail.Repository.Release) + detail.OS = ftypes.OS{ + Family: detail.Repository.Family, + Name: detail.Repository.Release, + } + } + case errors.Is(err, analyzer.ErrNoPkgsDetected): + log.Warn("No OS package is detected. Make sure you haven't deleted any files that contain information about the installed packages.") + log.Warn(`e.g. files under "/lib/apk/db/", "/var/lib/dpkg/" and "/var/lib/rpm"`) + case err != nil: + return nil, ftypes.OS{}, xerrors.Errorf("failed to apply layers: %w", err) + } + + scanTarget := types.ScanTarget{ + Name: target, + OS: detail.OS, + Repository: detail.Repository, + Packages: detail.Packages, + } + + result := types.Result{ + Target: fmt.Sprintf("%s (%s %s)", target, detail.OS.Family, detail.OS.Name), + Class: types.ClassOSPkg, + Type: scanTarget.OS.Family, + } + + sort.Sort(scanTarget.Packages) + result.Packages = scanTarget.Packages + + return []types.Result{result}, detail.OS, nil } func (c *Collector) scan(ctx context.Context, artifact artifact.Artifact, applier applier.Applier, imgMeta *workloadmeta.ContainerImageMetadata, cache CacheWithCleaner, useCache bool) (*types.Report, error) { @@ -469,11 +324,15 @@ func (c *Collector) scan(ctx context.Context, artifact artifact.Artifact, applie cache.setKeysForEntity(imgMeta.EntityID.ID, append(artifactReference.BlobIDs, artifactReference.ID)) } - s := scanner.NewScanner(local.NewScanner(applier, c.osScanner, c.langScanner, c.vulnClient), artifact) + s := scanner.NewScanner(&driver{applier: applier}, artifact) + trivyReport, err := s.ScanArtifact(ctx, types.ScanOptions{ - VulnType: []string{}, ScanRemovedPackages: false, - ListAllPackages: true, + PkgTypes: []types.PkgType{types.PkgTypeOS}, + PkgRelationships: []ftypes.Relationship{ + ftypes.RelationshipUnknown, + }, + Scanners: types.Scanners{types.VulnerabilityScanner}, }) if err != nil { return nil, err @@ -488,7 +347,7 @@ func (c *Collector) scanImage(ctx context.Context, fanalImage ftypes.Image, imgM return nil, err } - imageArtifact, err := image2.NewArtifact(fanalImage, cache, getDefaultArtifactOption("", scanOptions)) + imageArtifact, err := image2.NewArtifact(fanalImage, cache, getDefaultArtifactOption(scanOptions)) if err != nil { return nil, fmt.Errorf("unable to create artifact from image, err: %w", err) } @@ -504,18 +363,3 @@ func (c *Collector) scanImage(ctx context.Context, fanalImage ftypes.Image, imgM marshaler: c.marshaler, }, nil } - -func extractLayersFromOverlayFSMounts(mounts []mount.Mount) []string { - var layers []string - for _, mount := range mounts { - for _, opt := range mount.Options { - for _, prefix := range []string{"upperdir=", "lowerdir="} { - trimmedOpt := strings.TrimPrefix(opt, prefix) - if trimmedOpt != opt { - layers = append(layers, strings.Split(trimmedOpt, ":")...) - } - } - } - } - return layers -} diff --git a/pkg/util/trivy/trivy_test.go b/pkg/util/trivy/trivy_test.go index 20bd729cde6c5..c27dc1e1553fe 100644 --- a/pkg/util/trivy/trivy_test.go +++ b/pkg/util/trivy/trivy_test.go @@ -3,7 +3,7 @@ // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2016-present Datadog, Inc. -//go:build trivy +//go:build trivy && containerd // Package trivy holds the scan components package trivy diff --git a/pkg/util/trivy/walker.go b/pkg/util/trivy/walker.go new file mode 100644 index 0000000000000..e71a24c86c1b9 --- /dev/null +++ b/pkg/util/trivy/walker.go @@ -0,0 +1,149 @@ +// 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 trivy + +// Package trivy holds the scan components +package trivy + +import ( + "errors" + "io/fs" + "os" + "path/filepath" + "strings" + + "golang.org/x/xerrors" + + "github.com/aquasecurity/trivy/pkg/fanal/utils" + "github.com/aquasecurity/trivy/pkg/fanal/walker" + xio "github.com/aquasecurity/trivy/pkg/x/io" +) + +var defaultSkipDirs = []string{ + "**/.git", + "proc", + "sys", + "dev", +} + +// FSWalker is the filesystem walker used for SBOM generation +type FSWalker struct { + walker *walker.FS +} + +// NewFSWalker returns a new filesystem walker +func NewFSWalker() *FSWalker { + return &FSWalker{ + walker: walker.NewFS(), + } +} + +// Walk walks the filesystem rooted at root, calling fn for each unfiltered file. +func (w *FSWalker) Walk(root string, opt walker.Option, fn walker.WalkFunc) error { + buildPaths := func(paths []string) []string { + buildPaths := make([]string, len(paths)) + for i, path := range paths { + buildPaths[i] = root + path + } + return buildPaths + } + opt.SkipFiles = w.walker.BuildSkipPaths(root, buildPaths(opt.SkipFiles)) + opt.SkipDirs = w.walker.BuildSkipPaths(root, buildPaths(opt.SkipDirs)) + opt.SkipDirs = append(opt.SkipDirs, defaultSkipDirs...) + opt.OnlyDirs = w.walker.BuildSkipPaths(root, buildPaths(opt.OnlyDirs)) + + walkDirFunc := w.WalkDirFunc(root, fn, opt) + walkDirFunc = w.onError(walkDirFunc) + + // Walk the filesystem + if err := fs.WalkDir(os.DirFS(root), ".", walkDirFunc); err != nil { + return xerrors.Errorf("walk dir error: %w", err) + } + + return nil +} + +// WalkDirFunc is the type of the function called by [WalkDir] to visit +// each file or directory. +func (w *FSWalker) WalkDirFunc(root string, fn walker.WalkFunc, opt walker.Option) fs.WalkDirFunc { + return func(filePath string, d fs.DirEntry, err error) error { + if err != nil { + if errors.Is(err, fs.ErrPermission) || errors.Is(err, os.ErrNotExist) { + return nil + } + return err + } + + if !strings.HasPrefix(filePath, "/") { + filePath = root + "/" + filePath + } + + relPath, err := filepath.Rel(root, filePath) + if err != nil { + return xerrors.Errorf("filepath rel (%s): %w", relPath, err) + } + relPath = filepath.ToSlash(relPath) + + // Skip unnecessary files + switch { + case d.IsDir(): + if utils.SkipPath(relPath, opt.SkipDirs) { + return filepath.SkipDir + } + if utils.OnlyPath(relPath, opt.OnlyDirs) { + return filepath.SkipDir + } + return nil + case !opt.AllFiles && !d.Type().IsRegular(): + return nil + case utils.SkipPath(relPath, opt.SkipFiles): + return nil + case utils.OnlyPath(relPath, opt.OnlyDirs): + return nil + } + + info, err := d.Info() + if err != nil { + return xerrors.Errorf("file info error: %w", err) + } + + if err = fn(relPath, info, fileOpener(filePath)); err != nil { + return xerrors.Errorf("failed to analyze file: %w", err) + } + + return nil + } +} + +func (w *FSWalker) onError(wrapped fs.WalkDirFunc) fs.WalkDirFunc { + return func(filePath string, d fs.DirEntry, err error) error { + err = wrapped(filePath, d, err) + switch { + // Unwrap fs.SkipDir error + case errors.Is(err, fs.SkipDir): + return fs.SkipDir + // Ignore permission errors + case os.IsPermission(err): + return nil + case err != nil: + // halt traversal on any other error + return xerrors.Errorf("unknown error with %s: %w", filePath, err) + } + return nil + } +} + +// fileOpener returns a function opening a file. +func fileOpener(filePath string) func() (xio.ReadSeekCloserAt, error) { + return func() (xio.ReadSeekCloserAt, error) { + f, err := os.Open(filePath) + if err != nil { + return nil, err + } + + return f, nil + } +} diff --git a/pkg/util/uuid/go.mod b/pkg/util/uuid/go.mod index de6cfd5cbb275..abfac7302bf9c 100644 --- a/pkg/util/uuid/go.mod +++ b/pkg/util/uuid/go.mod @@ -11,23 +11,24 @@ 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 - golang.org/x/sys v0.27.0 + github.com/shirou/gopsutil/v4 v4.24.11 + golang.org/x/sys v0.28.0 ) 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/kr/text v0.2.0 // indirect - github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c // indirect + github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a // 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/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // 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 go.uber.org/atomic v1.11.0 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect ) + +replace github.com/DataDog/datadog-agent/pkg/version => ../../version diff --git a/pkg/util/uuid/go.sum b/pkg/util/uuid/go.sum index c3eee394bf35e..f3c3cbafaf95a 100644 --- a/pkg/util/uuid/go.sum +++ b/pkg/util/uuid/go.sum @@ -1,34 +1,30 @@ github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 h1:kHaBemcxl8o/pQ5VM1c8PVE1PubbNx3mjUr09OqWGCs= github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575/go.mod h1:9d6lWj8KzO/fd/NrVaLscBKmPigpZpn5YawRPw+e3Yo= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= 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= -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= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= 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-20220913051719-115f729f3c8c h1:VtwQ41oftZwlMnOEbMWQtSEUgU64U4s+GHk7hZK+jtY= -github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c/go.mod h1:JKx41uQRwqlTZabZc+kILPrO/3jlKnQ2Z8b7YiVw5cE= +github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a h1:3Bm7EwfUQUvhNeKIkUct/gl9eod1TcXuj8stxvi/GoI= +github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a/go.mod h1:ilwx/Dta8jXAgpFYFvSWEMwxmbWXyiUHkd5FwyKhb5k= github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc= github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ= 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-20220216144756-c35f1ee13d7c h1:NRoLoZvkBTKvR5gQLgA3e0hqjkY9u1wm+iOL45VN/qI= -github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 h1:o4JXh1EVt9k/+g42oCprj/FisM4qX9L3sZB3upGN2ZU= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55/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= @@ -42,12 +38,10 @@ go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0 golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.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= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 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/pkg/util/winutil/eventlog/subscription/subscription_test.go b/pkg/util/winutil/eventlog/subscription/subscription_test.go index bc59447aec2b7..f9ba0b1cca496 100644 --- a/pkg/util/winutil/eventlog/subscription/subscription_test.go +++ b/pkg/util/winutil/eventlog/subscription/subscription_test.go @@ -13,11 +13,10 @@ import ( "testing" pkglog "github.com/DataDog/datadog-agent/pkg/util/log" - "github.com/cihub/seelog" - "github.com/DataDog/datadog-agent/pkg/util/winutil/eventlog/api" - "github.com/DataDog/datadog-agent/pkg/util/winutil/eventlog/bookmark" - "github.com/DataDog/datadog-agent/pkg/util/winutil/eventlog/test" + evtapi "github.com/DataDog/datadog-agent/pkg/util/winutil/eventlog/api" + evtbookmark "github.com/DataDog/datadog-agent/pkg/util/winutil/eventlog/bookmark" + eventlog_test "github.com/DataDog/datadog-agent/pkg/util/winutil/eventlog/test" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -31,7 +30,7 @@ var debuglogFlag = flag.Bool("debuglog", false, "Enable seelog debug logging") func optEnableDebugLogging() { // Enable logger if *debuglogFlag { - pkglog.SetupLogger(seelog.Default, "debug") + pkglog.SetupLogger(pkglog.Default(), "debug") } } diff --git a/pkg/util/winutil/go.mod b/pkg/util/winutil/go.mod index f23d0e841a613..172db988efae7 100644 --- a/pkg/util/winutil/go.mod +++ b/pkg/util/winutil/go.mod @@ -9,18 +9,19 @@ replace ( require ( github.com/DataDog/datadog-agent/pkg/util/log v0.56.0-rc.3 - github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 github.com/fsnotify/fsnotify v1.8.0 github.com/stretchr/testify v1.10.0 go.uber.org/atomic v1.11.0 - golang.org/x/sys v0.27.0 + golang.org/x/sys v0.28.0 ) 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/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/kr/text v0.2.0 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) + +replace github.com/DataDog/datadog-agent/pkg/version => ../../version diff --git a/pkg/util/winutil/go.sum b/pkg/util/winutil/go.sum index f752a0e34e2b9..788135f619bbb 100644 --- a/pkg/util/winutil/go.sum +++ b/pkg/util/winutil/go.sum @@ -1,6 +1,5 @@ github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 h1:kHaBemcxl8o/pQ5VM1c8PVE1PubbNx3mjUr09OqWGCs= github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575/go.mod h1:9d6lWj8KzO/fd/NrVaLscBKmPigpZpn5YawRPw+e3Yo= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= 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/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= @@ -17,12 +16,10 @@ github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOf github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.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= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/pkg/util/winutil/service.go b/pkg/util/winutil/service.go index 11bc407bb0f43..22387fd89ea28 100644 --- a/pkg/util/winutil/service.go +++ b/pkg/util/winutil/service.go @@ -419,3 +419,20 @@ func IsServiceRunning(serviceName string) (running bool, err error) { } return (status.State == windows.SERVICE_RUNNING), nil } + +// GetServiceUser returns the service user for the given service +func GetServiceUser(serviceName string) (string, error) { + manager, service, err := openManagerService(serviceName, windows.SERVICE_QUERY_CONFIG) + if err != nil { + return "", err + } + defer closeManagerService(manager, service) + + serviceConfig, err := service.Config() + if err != nil { + return "", fmt.Errorf("could not retrieve config for %s: %w", serviceName, err) + } + + return serviceConfig.ServiceStartName, nil + +} diff --git a/pkg/util/winutil/users.go b/pkg/util/winutil/users.go index 7026b76507ebb..be17fe6a7cdb2 100644 --- a/pkg/util/winutil/users.go +++ b/pkg/util/winutil/users.go @@ -8,6 +8,7 @@ package winutil import ( "fmt" + "strings" "syscall" "golang.org/x/sys/windows" @@ -75,3 +76,53 @@ func GetLocalSystemSID() (*windows.SID, error) { return localSystem, err } + +// GetServiceUserSID returns the SID of the specified service account +func GetServiceUserSID(service string) (*windows.SID, error) { + // get config for datadogagent service + user, err := GetServiceUser(service) + if err != nil { + return nil, fmt.Errorf("could not get datadogagent service user: %s", err) + } + + username, err := getUserFromServiceUser(user) + if err != nil { + return nil, err + } + + // Manually map some aliases that SCM uses and are not recognized by the + // security subsystem (`LookupAccountName()` will fail) + // https://learn.microsoft.com/en-us/windows/win32/services/service-user-accounts + if username == "LocalSystem" { + return windows.StringToSid("S-1-5-18") + } + + // get the SID for the user account + sid, _, _, err := windows.LookupSID("", username) + return sid, err +} + +func getUserFromServiceUser(user string) (string, error) { + var domain, username string + parts := strings.SplitN(user, "\\", 2) + if len(parts) == 1 { + username = user + } else if len(parts) == 2 { + domain = parts[0] + if domain == "." { + username = parts[1] + } else { + username = user + } + } else { + return "", fmt.Errorf("could not parse user: %s", user) + } + + return username, nil + +} + +// GetDDAgentUserSID returns the SID of the DataDog Agent account +func GetDDAgentUserSID() (*windows.SID, error) { + return GetServiceUserSID("datadogagent") +} diff --git a/pkg/util/winutil/users_test.go b/pkg/util/winutil/users_test.go index d541eeb4e1ff8..d1941003bfda4 100644 --- a/pkg/util/winutil/users_test.go +++ b/pkg/util/winutil/users_test.go @@ -11,6 +11,8 @@ import ( "testing" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "golang.org/x/sys/windows" ) func TestGetSidFromUser(t *testing.T) { @@ -19,3 +21,27 @@ func TestGetSidFromUser(t *testing.T) { assert.Nil(t, err) assert.NotNil(t, sid) } + +func TestGetServiceUserSID(t *testing.T) { + // create LocalService SID + serviceSid, err := windows.StringToSid("S-1-5-19") + require.NoError(t, err) + + // get the SID for the EventLog service (has LocalService as its user) + sid, err := GetServiceUserSID("EventLog") + require.NoError(t, err) + assert.NotNil(t, sid) + assert.True(t, windows.EqualSid(sid, serviceSid)) + t.Logf("The SID found was: %v", sid) + + // create LocalSystem SID + systemSid, err := windows.StringToSid("S-1-5-18") + require.NoError(t, err) + + // get the SID for the BITS service (has LocalSystem as its user) + sid, err = GetServiceUserSID("BITS") + require.NoError(t, err) + assert.NotNil(t, sid) + assert.True(t, windows.EqualSid(sid, systemSid)) + t.Logf("The SID found was: %v", sid) +} diff --git a/pkg/util/winutil/winctrlhandler.go b/pkg/util/winutil/winctrlhandler.go new file mode 100644 index 0000000000000..024982a86495f --- /dev/null +++ b/pkg/util/winutil/winctrlhandler.go @@ -0,0 +1,45 @@ +// 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 winutil contains Windows OS utilities +package winutil + +import "golang.org/x/sys/windows" + +var ( + setConsoleCtrlHandler = k32.NewProc("SetConsoleCtrlHandler") +) + +// Console control signal constants +// +// https://learn.microsoft.com/en-us/windows/console/handlerroutine +const ( + CtrlCEvent = 0 + CtrlBreakEvent = 1 +) + +func boolToInt(b bool) int { + if b { + return 1 + } + return 0 +} + +// SetConsoleCtrlHandler sets the handler function for console control events. +// +// https://learn.microsoft.com/en-us/windows/console/setconsolectrlhandler +func SetConsoleCtrlHandler(handler func(uint32) bool, add bool) error { + ret, _, err := setConsoleCtrlHandler.Call( + uintptr(windows.NewCallback(func(sig uint32) uintptr { + return uintptr(boolToInt(handler(sig))) + })), + uintptr(boolToInt(add))) + if ret == 0 { + return err + } + return nil +} diff --git a/release.json b/release.json index 6c42ba0c2fe30..79d045f9a0942 100644 --- a/release.json +++ b/release.json @@ -1,14 +1,14 @@ { "base_branch": "main", - "current_milestone": "7.62.0", + "current_milestone": "7.63.0", "last_stable": { "6": "6.53.0", - "7": "7.59.0" + "7": "7.60.0" }, "nightly": { "INTEGRATIONS_CORE_VERSION": "master", "OMNIBUS_SOFTWARE_VERSION": "0059a287d5543305c01a098740ba328aef7fa8ff", - "OMNIBUS_RUBY_VERSION": "d365e483ee05a13e55eeb5208d11452c5b65afbb", + "OMNIBUS_RUBY_VERSION": "650e39bb0b7c8d57ddabe21eb0588b368986aede", "JMXFETCH_VERSION": "0.49.6", "JMXFETCH_HASH": "f06bdac1f8ec41daf9b9839ac883f1865a068b04810ea82197b8a6afb9369cb9", "MACOS_BUILD_VERSION": "master", @@ -27,7 +27,7 @@ "nightly-a7": { "INTEGRATIONS_CORE_VERSION": "master", "OMNIBUS_SOFTWARE_VERSION": "0059a287d5543305c01a098740ba328aef7fa8ff", - "OMNIBUS_RUBY_VERSION": "d365e483ee05a13e55eeb5208d11452c5b65afbb", + "OMNIBUS_RUBY_VERSION": "650e39bb0b7c8d57ddabe21eb0588b368986aede", "JMXFETCH_VERSION": "0.49.6", "JMXFETCH_HASH": "f06bdac1f8ec41daf9b9839ac883f1865a068b04810ea82197b8a6afb9369cb9", "MACOS_BUILD_VERSION": "master", @@ -49,7 +49,7 @@ "OMNIBUS_RUBY_VERSION": "7.56.0-rc.1", "JMXFETCH_VERSION": "0.49.6", "JMXFETCH_HASH": "f06bdac1f8ec41daf9b9839ac883f1865a068b04810ea82197b8a6afb9369cb9", - "SECURITY_AGENT_POLICIES_VERSION": "v0.61.0", + "SECURITY_AGENT_POLICIES_VERSION": "v0.62.0", "MACOS_BUILD_VERSION": "6.56.0-rc.3", "WINDOWS_DDNPM_DRIVER": "release-signed", "WINDOWS_DDNPM_VERSION": "2.7.1", @@ -64,7 +64,7 @@ "OMNIBUS_RUBY_VERSION": "7.56.0-rc.1", "JMXFETCH_VERSION": "0.49.6", "JMXFETCH_HASH": "f06bdac1f8ec41daf9b9839ac883f1865a068b04810ea82197b8a6afb9369cb9", - "SECURITY_AGENT_POLICIES_VERSION": "v0.61.0", + "SECURITY_AGENT_POLICIES_VERSION": "v0.62.0", "MACOS_BUILD_VERSION": "7.56.0-rc.3", "WINDOWS_DDNPM_DRIVER": "release-signed", "WINDOWS_DDNPM_VERSION": "2.7.1", diff --git a/releasenotes-dca/notes/add-endpoint-slice-support-079a4ce598c8db95.yaml b/releasenotes-dca/notes/add-endpoint-slice-support-079a4ce598c8db95.yaml new file mode 100644 index 0000000000000..cb4f0df807648 --- /dev/null +++ b/releasenotes-dca/notes/add-endpoint-slice-support-079a4ce598c8db95.yaml @@ -0,0 +1,19 @@ +# Each section from every release note are combined when the +# CHANGELOG-DCA.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. +--- +enhancements: + - | + Added support for EndpointSlices in the metadata controller. This feature, + enabled by setting `kubernetesUseEndpointSlices` to `true`, resolves limitations + of Endpoints resources, particularly for services with more than 1000 addresses. + Must add `endpointslices` to DCA cluster role. +fixes: + - | + Resolved a bug where `kube_service` tags were not properly deleted when a + service's ties to pods on a specific node were removed but the service itself + was not deleted. diff --git a/releasenotes-dca/notes/delete_admission_webhooks-5c89ccd6c0d6ff8b.yaml b/releasenotes-dca/notes/delete_admission_webhooks-5c89ccd6c0d6ff8b.yaml new file mode 100644 index 0000000000000..61dc3b2cad986 --- /dev/null +++ b/releasenotes-dca/notes/delete_admission_webhooks-5c89ccd6c0d6ff8b.yaml @@ -0,0 +1,14 @@ +# Each section from every release note are combined when the +# CHANGELOG-DCA.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. +--- +enhancements: + - | + The Cluster Agent is now able to delete `ValidatingAdmissionWebhook` and `MutatingAdmissionWebhook` + depending on the `admission_controller.validation.enabled` and `admission_controller.mutation.enabled` settings. + Note that `admission_controller.enabled` must be set to `true` to allow the Cluster Agent to + interact with the Kubernetes Admission Controller. diff --git a/releasenotes-dca/notes/optimize-ksm-configmap-collection-dcd3bfaa71fb2865.yaml b/releasenotes-dca/notes/optimize-ksm-configmap-collection-dcd3bfaa71fb2865.yaml new file mode 100644 index 0000000000000..0e5a6cd7f5c92 --- /dev/null +++ b/releasenotes-dca/notes/optimize-ksm-configmap-collection-dcd3bfaa71fb2865.yaml @@ -0,0 +1,13 @@ +# Each section from every release note are combined when the +# CHANGELOG-DCA.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. +--- +enhancements: + - | + The `kubernetes_state_core` check now collects only metadata for configmaps, + reducing memory, CPU, and network usage in the Cluster Agent while preserving + full metric functionality. 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/releasenotes/notes/Add-metrics-origins-for-Quarkus-integration.-e2ff9ac00b7ea6df.yaml b/releasenotes/notes/Add-metrics-origins-for-Quarkus-integration.-e2ff9ac00b7ea6df.yaml new file mode 100644 index 0000000000000..6a23ab8155f8c --- /dev/null +++ b/releasenotes/notes/Add-metrics-origins-for-Quarkus-integration.-e2ff9ac00b7ea6df.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. +--- +other: + - | + Add metrics origins for Quarkus integration. diff --git a/releasenotes/notes/Update-gstatus-binary-bbd8cd907bd974c3.yaml b/releasenotes/notes/Update-gstatus-binary-bbd8cd907bd974c3.yaml new file mode 100644 index 0000000000000..8c62e4b4b2c87 --- /dev/null +++ b/releasenotes/notes/Update-gstatus-binary-bbd8cd907bd974c3.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. +--- +fixes: + - | + Upgrade `gstatus` binary to version 1.0.9 to work with newer version of GlusterFS. diff --git a/releasenotes/notes/add-events-to-flare-b10cb7bf1aaf4d50.yaml b/releasenotes/notes/add-events-to-flare-b10cb7bf1aaf4d50.yaml new file mode 100644 index 0000000000000..9bff569f5f774 --- /dev/null +++ b/releasenotes/notes/add-events-to-flare-b10cb7bf1aaf4d50.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. +--- +enhancements: + - | + On Windows, Agent flares now include event logs for .NET applications. diff --git a/releasenotes/notes/add-integration-field-to-topology-link-metadata-8a35c0a70ac80b1e.yaml b/releasenotes/notes/add-integration-field-to-topology-link-metadata-8a35c0a70ac80b1e.yaml new file mode 100644 index 0000000000000..003ca577e3799 --- /dev/null +++ b/releasenotes/notes/add-integration-field-to-topology-link-metadata-8a35c0a70ac80b1e.yaml @@ -0,0 +1,12 @@ +# 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. +--- +enhancements: + - | + Emit new field: integration for TopologyLinkMetadata for better metrics collection. + diff --git a/releasenotes/notes/add-platform-integrations-metrics-origins-q4-3278d0ead5015daf.yaml b/releasenotes/notes/add-platform-integrations-metrics-origins-q4-3278d0ead5015daf.yaml new file mode 100644 index 0000000000000..5ea9260a42a85 --- /dev/null +++ b/releasenotes/notes/add-platform-integrations-metrics-origins-q4-3278d0ead5015daf.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. +--- +other: + - | + Add metric origins for Platform Integrations: Cloud Foundry, Jenkins, KubeVirt API, KubeVirt Controller, and KubeVirt Handler. \ No newline at end of file diff --git a/releasenotes/notes/add-tagger-tags-to-pod-manifests-617c152d112e21e3.yaml b/releasenotes/notes/add-tagger-tags-to-pod-manifests-617c152d112e21e3.yaml new file mode 100644 index 0000000000000..19f359d4d1ea4 --- /dev/null +++ b/releasenotes/notes/add-tagger-tags-to-pod-manifests-617c152d112e21e3.yaml @@ -0,0 +1,3 @@ +enhancements: + - | + Adds tagger tags to pod manifests. diff --git a/releasenotes/notes/add-tls-enhanced-tags-6ff09ae7fc0ff7a1.yaml b/releasenotes/notes/add-tls-enhanced-tags-6ff09ae7fc0ff7a1.yaml new file mode 100644 index 0000000000000..14ed9c4ee8c35 --- /dev/null +++ b/releasenotes/notes/add-tls-enhanced-tags-6ff09ae7fc0ff7a1.yaml @@ -0,0 +1,13 @@ +# 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: + - | + The Agent will now tag TLS enhanced metrics like `tls_version` and `tls_cipher`. + This will allow you to filter and aggregate metrics based on the TLS version and cipher used in the connection. + The tags will be added in CNM and USM. diff --git a/releasenotes/notes/add_system_cpu_total_metrics-769eed5d476ba712.yaml b/releasenotes/notes/add_system_cpu_total_metrics-769eed5d476ba712.yaml new file mode 100644 index 0000000000000..9d2899b7bfcc1 --- /dev/null +++ b/releasenotes/notes/add_system_cpu_total_metrics-769eed5d476ba712.yaml @@ -0,0 +1,15 @@ +# 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 new system.cpu.user.total, system.cpu.nice.total, + system.cpu.system.total, system.cpu.idle.total, system.cpu.iowait.total, + system.cpu.irq.total, system.cpu.softirq.total, system.cpu.steal.total, + system.cpu.guest.total, system.cpu.guestnice.total metrics + with core tag for each one of them. diff --git a/releasenotes/notes/agent-flare-sestatus-5820cfc79ec91d1f.yaml b/releasenotes/notes/agent-flare-sestatus-5820cfc79ec91d1f.yaml new file mode 100644 index 0000000000000..e7bac3330c728 --- /dev/null +++ b/releasenotes/notes/agent-flare-sestatus-5820cfc79ec91d1f.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. +--- +enhancements: + - | + Added the output of ``sestatus`` into the Agent flare. This information will appear in ``system-probe/selinux_sestatus.log``. diff --git a/releasenotes/notes/agent-sidecar-security-cbfd5ea9f72124d0.yaml b/releasenotes/notes/agent-sidecar-security-cbfd5ea9f72124d0.yaml new file mode 100644 index 0000000000000..a1f2095a0d121 --- /dev/null +++ b/releasenotes/notes/agent-sidecar-security-cbfd5ea9f72124d0.yaml @@ -0,0 +1,14 @@ +# 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. +--- +upgrade: +enhancements: + - | + The Datadog Cluster Agent admission controller agent sidecar injection now sets up + Agent sidecars to run with securityContext of `readOnlyRootFilesystem:false` by default. + Advanced users can customize the securityContext via clusterAgent.admissionController.agentSidecarInjection.profiles. diff --git a/releasenotes/notes/agent-tel-extend-histogr-6e2da94e63edcaf8.yaml b/releasenotes/notes/agent-tel-extend-histogr-6e2da94e63edcaf8.yaml new file mode 100644 index 0000000000000..7b6280295dbba --- /dev/null +++ b/releasenotes/notes/agent-tel-extend-histogr-6e2da94e63edcaf8.yaml @@ -0,0 +1,14 @@ +# 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. +--- +enhancements: + - | + Extended Agent telemetry histogram details, specifically: + - Added previously omitted and implicit `+Inf` bucket value to histogram payload. + - Added p75, p95, and p99 histogram values (expressed as the upper-bound for the + matching bucket). diff --git a/releasenotes/notes/agent-tel-gzip-bba8a51c1aa3ba2f.yaml b/releasenotes/notes/agent-tel-gzip-bba8a51c1aa3ba2f.yaml new file mode 100644 index 0000000000000..ca28c715ecaa1 --- /dev/null +++ b/releasenotes/notes/agent-tel-gzip-bba8a51c1aa3ba2f.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. +--- +enhancements: + - | + Use HTTP zstd compression for the Agent telemetry payloads. diff --git a/releasenotes/notes/external_data_apm-6538531e3f34f305.yaml b/releasenotes/notes/external_data_apm-6538531e3f34f305.yaml new file mode 100644 index 0000000000000..4aa3e9ef23e70 --- /dev/null +++ b/releasenotes/notes/external_data_apm-6538531e3f34f305.yaml @@ -0,0 +1,13 @@ +# 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: + - | + Implement External Data resolution for APM. This is needed to support the + latest Origin Detection spec and resolution with nested virtualization. + diff --git a/releasenotes/notes/file-permissions-to-dduser-windows-6e9940175f9130ff.yaml b/releasenotes/notes/file-permissions-to-dduser-windows-6e9940175f9130ff.yaml new file mode 100644 index 0000000000000..45e2515092583 --- /dev/null +++ b/releasenotes/notes/file-permissions-to-dduser-windows-6e9940175f9130ff.yaml @@ -0,0 +1,12 @@ +# 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. +--- +fixes: + - | + Fix Windows file permissions on authToken to give access to the Datadog user even when privilege processes create it. + diff --git a/releasenotes/notes/fix-agent-ctrlc-520d29d346ee6939.yaml b/releasenotes/notes/fix-agent-ctrlc-520d29d346ee6939.yaml new file mode 100644 index 0000000000000..3654fbdf6a957 --- /dev/null +++ b/releasenotes/notes/fix-agent-ctrlc-520d29d346ee6939.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. +--- +fixes: + - | + Fixes Windows CTRL-C handler on the agent run command. diff --git a/releasenotes/notes/fix-oracle-can_connect-host-tag-c7b00cb45e17735c.yaml b/releasenotes/notes/fix-oracle-can_connect-host-tag-c7b00cb45e17735c.yaml new file mode 100644 index 0000000000000..df805c338b08c --- /dev/null +++ b/releasenotes/notes/fix-oracle-can_connect-host-tag-c7b00cb45e17735c.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. +--- +fixes: + - | + Corrects host tagging for the oracle.can_connect service check diff --git a/releasenotes/notes/flare-semodule-list-883aecc886cd62ac.yaml b/releasenotes/notes/flare-semodule-list-883aecc886cd62ac.yaml new file mode 100644 index 0000000000000..2baa2dea73281 --- /dev/null +++ b/releasenotes/notes/flare-semodule-list-883aecc886cd62ac.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. +--- +enhancements: + - | + Added the output of ``semodule -l`` to the Agent flare; this information appears in ``system-probe/selinux_semodule_list.log``. diff --git a/releasenotes/notes/force-http1-for-log-agent-2cbfba763697ab42.yaml b/releasenotes/notes/force-http1-for-log-agent-2cbfba763697ab42.yaml index 53476dcfa0bb9..e9c1031ef5d3b 100644 --- a/releasenotes/notes/force-http1-for-log-agent-2cbfba763697ab42.yaml +++ b/releasenotes/notes/force-http1-for-log-agent-2cbfba763697ab42.yaml @@ -9,7 +9,7 @@ features: - | Introduced a new configuration variable `logs_config.http_protocol`, allowing users to enforce HTTP/1.1 for outgoing HTTP connections in the Datadog Agent. This provides better control over transport protocols and improves compatibility with systems that do not support HTTP/2. - By default, the log agent will now attempt to use HTTP/2 and fall back to the best available protocol if HTTP/2 is not supported. + By default, the log agent will now attempt to use HTTP/2 (unless a proxy is configured) and fall back to the best available protocol if HTTP/2 is not supported. enhancements: - | - Improved logging to add visiblity for latency and transport protocol \ No newline at end of file + Improved logging to add visibility for latency and transport protocol \ No newline at end of file diff --git a/releasenotes/notes/kube-cache-sync-timeout-seconds-default-0bb13defed7ae192.yaml b/releasenotes/notes/kube-cache-sync-timeout-seconds-default-0bb13defed7ae192.yaml new file mode 100644 index 0000000000000..d79275c25c19b --- /dev/null +++ b/releasenotes/notes/kube-cache-sync-timeout-seconds-default-0bb13defed7ae192.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. +--- +other: + - | + Bumps the default value for `kube_cache_sync_timeout_seconds` from 5 to 10 seconds. diff --git a/releasenotes/notes/logs-check-feature-13a93c589fe0613d.yaml b/releasenotes/notes/logs-check-feature-13a93c589fe0613d.yaml new file mode 100644 index 0000000000000..b842e4e8f8a53 --- /dev/null +++ b/releasenotes/notes/logs-check-feature-13a93c589fe0613d.yaml @@ -0,0 +1,15 @@ +# 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: + - | + The Logs Agent Analyze feature introduces a new subcommand, `agent analyze-logs`, within the Datadog Agent. + This tool helps users test log configurations, regular expressions, and processing rules in isolation. + It offers a streamlined, cost-effective way to validate log configurations without + running the entire Datadog Agent or sending data to Datadog. This allows users to quickly identify configuration issues. + diff --git a/releasenotes/notes/make-missing-tags-errors-c4cd44a12d22e7bc.yaml b/releasenotes/notes/make-missing-tags-errors-c4cd44a12d22e7bc.yaml new file mode 100644 index 0000000000000..ddbfef1c88172 --- /dev/null +++ b/releasenotes/notes/make-missing-tags-errors-c4cd44a12d22e7bc.yaml @@ -0,0 +1,12 @@ +# 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. +--- +deprecations: + - | + SNMP profiles containing metric_tags without a specified `tag` field + will now show an error and be ignored, similar to other profile syntax errors. diff --git a/releasenotes/notes/make_image_filters_consistent-14fd44a352723e50.yaml b/releasenotes/notes/make_image_filters_consistent-14fd44a352723e50.yaml new file mode 100644 index 0000000000000..d0b292f5f2267 --- /dev/null +++ b/releasenotes/notes/make_image_filters_consistent-14fd44a352723e50.yaml @@ -0,0 +1,16 @@ +# 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. +--- +fixes: + - | + Fixes consistency issue with container image filters. + Depending on the Agent configuration, filters were sometimes behaving differently + for metrics and logs. For example, an image filter that worked for excluding logs + didn't work when used to exclude metrics, and vice versa. + The exclusion logic is now consistent between metrics and logs. + diff --git a/releasenotes/notes/metrics-compression-default-zstd-c786c2d28eb51b1f.yaml b/releasenotes/notes/metrics-compression-default-zstd-c786c2d28eb51b1f.yaml new file mode 100644 index 0000000000000..7d9a8653d8f0d --- /dev/null +++ b/releasenotes/notes/metrics-compression-default-zstd-c786c2d28eb51b1f.yaml @@ -0,0 +1,13 @@ +# 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. +--- +enhancements: + - | + Metric payloads are compressed using `zstd` compression by default. + This can be reverted to the previous compression kind by adding + ``serializer_compressor_kind: zlib`` to the configuration. diff --git a/releasenotes/notes/none-cardinality-tag-f2ceec7ec571387e.yaml b/releasenotes/notes/none-cardinality-tag-f2ceec7ec571387e.yaml new file mode 100644 index 0000000000000..2957ae7f9441d --- /dev/null +++ b/releasenotes/notes/none-cardinality-tag-f2ceec7ec571387e.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. +--- +enhancements: + - | + Adds support for the `none` cardinality type in the tagger. diff --git a/releasenotes/notes/otel-graphql-resource-e31ae2262b52a873.yaml b/releasenotes/notes/otel-graphql-resource-e31ae2262b52a873.yaml new file mode 100644 index 0000000000000..8962c355b585a --- /dev/null +++ b/releasenotes/notes/otel-graphql-resource-e31ae2262b52a873.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. +--- +enhancements: + - | + For OpenTelemetry GraphQL request spans, the span resource name is now the GraphQL operation type and name. diff --git a/releasenotes/notes/process-agent-config-auth-09a3123ac6496052.yaml b/releasenotes/notes/process-agent-config-auth-09a3123ac6496052.yaml new file mode 100644 index 0000000000000..f95ff5b472dac --- /dev/null +++ b/releasenotes/notes/process-agent-config-auth-09a3123ac6496052.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. +--- +enhancements: + - | + All process agent endpoints now require authentication. diff --git a/releasenotes/notes/support-database-name-in-aurora-discovery-ec366b44f47c046a.yaml b/releasenotes/notes/support-database-name-in-aurora-discovery-ec366b44f47c046a.yaml new file mode 100644 index 0000000000000..c475c22785ca9 --- /dev/null +++ b/releasenotes/notes/support-database-name-in-aurora-discovery-ec366b44f47c046a.yaml @@ -0,0 +1,13 @@ +# 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. +--- +enhancements: + - | + Extends extra configuration available for templating from Aurora Database Discovery + to include %%extra_dbname%% allowing instances which are configured with non-standard + DBName field to be discovered successfully diff --git a/releasenotes/notes/update-embedded-permissions-a8e169f1c079cd41.yaml b/releasenotes/notes/update-embedded-permissions-a8e169f1c079cd41.yaml new file mode 100644 index 0000000000000..8b9cafd486a16 --- /dev/null +++ b/releasenotes/notes/update-embedded-permissions-a8e169f1c079cd41.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. +--- +security: + - | + Move the embedded Python cache out of the installation directory on Windows. diff --git a/rtloader/three/three.cpp b/rtloader/three/three.cpp index 1df4c7bca26b8..425f8e93a24b3 100644 --- a/rtloader/three/three.cpp +++ b/rtloader/three/three.cpp @@ -110,7 +110,10 @@ bool Three::init() PyImport_AppendInittab(KUBEUTIL_MODULE_NAME, PyInit_kubeutil); PyImport_AppendInittab(CONTAINERS_MODULE_NAME, PyInit_containers); - Py_Initialize(); + // force initialize siginterrupt with signal in python so it can be overwritten by the agent + // This only effects the windows builds as linux already has the sigint handler initialized + // and thus python will ignore it + Py_InitializeEx(1); if (!Py_IsInitialized()) { setError("Python not initialized"); diff --git a/tasks/__init__.py b/tasks/__init__.py index d59a06de7463b..0dffed23dacaf 100644 --- a/tasks/__init__.py +++ b/tasks/__init__.py @@ -87,13 +87,13 @@ tidy, tidy_all, ) +from tasks.gointegrationtest import integration_tests from tasks.gotest import ( check_otel_build, check_otel_module_versions, e2e_tests, get_impacted_packages, get_modified_packages, - integration_tests, lint_go, send_unit_tests_stats, test, diff --git a/tasks/agent.py b/tasks/agent.py index 276c0c372e1e6..84d1134310965 100644 --- a/tasks/agent.py +++ b/tasks/agent.py @@ -17,10 +17,17 @@ from tasks.build_tags import add_fips_tags, filter_incompatible_tags, get_build_tags, get_default_build_tags from tasks.devcontainer import run_on_devcontainer from tasks.flavor import AgentFlavor +from tasks.gointegrationtest import ( + CORE_AGENT_LINUX_IT_CONF, + CORE_AGENT_WINDOWS_IT_CONF, + containerized_integration_tests, +) from tasks.libs.common.utils import ( REPO_PATH, bin_name, get_build_flags, + get_embedded_path, + get_goenv, get_version, gitlab_section, ) @@ -113,7 +120,7 @@ LAST_DIRECTORY_COMMIT_PATTERN = "git -C {integrations_dir} rev-list -1 HEAD {integration}" -@task +@task(iterable=['bundle']) @run_on_devcontainer def build( ctx, @@ -134,6 +141,8 @@ def build( go_mod="readonly", windows_sysprobe=False, cmake_options='', + bundle=None, + bundle_ebpf=False, agent_bin=None, run_on=None, # noqa: U100, F841. Used by the run_on_devcontainer decorator ): @@ -167,12 +176,12 @@ def build( major_version=major_version, ) + bundled_agents = ["agent"] if sys.platform == 'win32' or os.getenv("GOOS") == "windows": # Important for x-compiling env["CGO_ENABLED"] = "1" build_messagetable(ctx) - # Do not call build_rc when cross-compiling on Linux as the intend is more # to streamline the development process that producing a working executable / installer if sys.platform == 'win32': @@ -183,20 +192,31 @@ def build( vars=vars, out="cmd/agent/rsrc.syso", ) + else: + bundled_agents += bundle or [] if flavor.is_iot(): # Iot mode overrides whatever passed through `--build-exclude` and `--build-include` build_tags = get_default_build_tags(build="agent", flavor=flavor) else: - include_tags = ( - get_default_build_tags(build="agent", flavor=flavor) - if build_include is None - else filter_incompatible_tags(build_include.split(",")) - ) + all_tags = set() + if bundle_ebpf and "system-probe" in bundled_agents: + all_tags.add("ebpf_bindata") + + for build in bundled_agents: + all_tags.add("bundle_" + build.replace("-", "_")) + include_tags = ( + get_default_build_tags(build=build, flavor=flavor) + if build_include is None + else filter_incompatible_tags(build_include.split(",")) + ) + + exclude_tags = [] if build_exclude is None else build_exclude.split(",") + build_tags = get_build_tags(include_tags, exclude_tags) + build_tags = add_fips_tags(build_tags, fips_mode) - exclude_tags = [] if build_exclude is None else build_exclude.split(",") - build_tags = get_build_tags(include_tags, exclude_tags) - build_tags = add_fips_tags(build_tags, fips_mode) + all_tags |= set(build_tags) + build_tags = list(all_tags) cmd = "go build -mod={go_mod} {race_opt} {build_type} -tags \"{go_build_tags}\" " @@ -221,6 +241,23 @@ def build( with gitlab_section("Build agent", collapsed=True): ctx.run(cmd.format(**args), env=env) + if embedded_path is None: + embedded_path = get_embedded_path(ctx) + assert embedded_path, "Failed to find embedded path" + + for build in bundled_agents: + if build == "agent": + continue + + bundled_agent_dir = os.path.join(BIN_DIR, build) + bundled_agent_bin = os.path.join(bundled_agent_dir, bin_name(build)) + agent_fullpath = os.path.normpath(os.path.join(embedded_path, "..", "bin", "agent", bin_name("agent"))) + + if not os.path.exists(os.path.dirname(bundled_agent_bin)): + os.mkdir(os.path.dirname(bundled_agent_bin)) + + create_launcher(ctx, build, agent_fullpath, bundled_agent_bin) + with gitlab_section("Generate configuration files", collapsed=True): render_config( ctx, @@ -233,6 +270,22 @@ def build( ) +def create_launcher(ctx, agent, src, dst): + cc = get_goenv(ctx, "CC") + if not cc: + print("Failed to find C compiler") + raise Exit(code=1) + + cmd = "{cc} -DDD_AGENT_PATH='\"{agent_bin}\"' -DDD_AGENT='\"{agent}\"' -o {launcher_bin} ./cmd/agent/launcher/launcher.c" + args = { + "cc": cc, + "agent": agent, + "agent_bin": src, + "launcher_bin": dst, + } + ctx.run(cmd.format(**args)) + + def render_config(ctx, env, flavor, skip_assets, build_tags, development, windows_sysprobe): # Remove cross-compiling bits to render config env.update({"GOOS": "", "GOARCH": ""}) @@ -299,9 +352,8 @@ def refresh_assets(_, build_tags, development=True, flavor=AgentFlavor.base.name check_dir = os.path.join(dist_folder, f"conf.d/{check}.d/") shutil.copytree(f"./cmd/agent/dist/conf.d/{check}.d/", check_dir, dirs_exist_ok=True) - if "apm" in build_tags: + if sys.platform == 'darwin': shutil.copy("./cmd/agent/dist/conf.d/apm.yaml.default", os.path.join(dist_folder, "conf.d/apm.yaml.default")) - if "process" in build_tags: shutil.copy( "./cmd/agent/dist/conf.d/process_agent.yaml.default", os.path.join(dist_folder, "conf.d/process_agent.yaml.default"), @@ -530,79 +582,18 @@ def integration_tests(ctx, race=False, remote_docker=False, go_mod="readonly", t """ Run integration tests for the Agent """ - if sys.platform == 'win32': - return _windows_integration_tests(ctx, race=race, go_mod=go_mod, timeout=timeout) - else: - # TODO: See if these will function on Windows - return _linux_integration_tests(ctx, race=race, remote_docker=remote_docker, go_mod=go_mod, timeout=timeout) - - -def _windows_integration_tests(ctx, race=False, go_mod="readonly", timeout=""): - test_args = { - "go_mod": go_mod, - "go_build_tags": " ".join(get_default_build_tags(build="test")), - "race_opt": "-race" if race else "", - "exec_opts": "", - "timeout_opt": f"-timeout {timeout}" if timeout else "", - } - - go_cmd = 'go test {timeout_opt} -mod={go_mod} {race_opt} -tags "{go_build_tags}" {exec_opts}'.format(**test_args) # noqa: FS002 - - tests = [ - { - # Run eventlog tests with the Windows API, which depend on the EventLog service - "dir": "./pkg/util/winutil/", - 'prefix': './eventlog/...', - 'extra_args': '-evtapi Windows', - }, - { - # Run eventlog tailer tests with the Windows API, which depend on the EventLog service - "dir": ".", - 'prefix': './pkg/logs/tailers/windowsevent/...', - 'extra_args': '-evtapi Windows', - }, - { - # Run eventlog check tests with the Windows API, which depend on the EventLog service - "dir": ".", - # Don't include submodules, since the `-evtapi` flag is not defined in them - 'prefix': './comp/checks/windowseventlog/windowseventlogimpl/check', - 'extra_args': '-evtapi Windows', - }, - ] - - for test in tests: - with ctx.cd(f"{test['dir']}"): - ctx.run(f"{go_cmd} {test['prefix']} {test['extra_args']}") - - -def _linux_integration_tests(ctx, race=False, remote_docker=False, go_mod="readonly", timeout=""): - test_args = { - "go_mod": go_mod, - "go_build_tags": " ".join(get_default_build_tags(build="test")), - "race_opt": "-race" if race else "", - "exec_opts": "", - "timeout_opt": f"-timeout {timeout}" if timeout else "", - } - - # since Go 1.13, the -exec flag of go test could add some parameters such as -test.timeout - # to the call, we don't want them because while calling invoke below, invoke - # thinks that the parameters are for it to interpret. - # we're calling an intermediate script which only pass the binary name to the invoke task. - if remote_docker: - test_args["exec_opts"] = f"-exec \"{os.getcwd()}/test/integration/dockerize_tests.sh\"" - - go_cmd = 'go test {timeout_opt} -mod={go_mod} {race_opt} -tags "{go_build_tags}" {exec_opts}'.format(**test_args) # noqa: FS002 - - prefixes = [ - "./test/integration/config_providers/...", - "./test/integration/corechecks/...", - "./test/integration/listeners/...", - "./test/integration/util/kubelet/...", - ] - - for prefix in prefixes: - ctx.run(f"{go_cmd} {prefix}") + return containerized_integration_tests( + ctx, CORE_AGENT_WINDOWS_IT_CONF, race=race, go_mod=go_mod, timeout=timeout + ) + return containerized_integration_tests( + ctx, + CORE_AGENT_LINUX_IT_CONF, + race=race, + remote_docker=remote_docker, + go_mod=go_mod, + timeout=timeout, + ) def check_supports_python_version(check_dir, python): diff --git a/tasks/build_tags.py b/tasks/build_tags.py index c2cabdbb6d45e..9f58d3e45c60a 100644 --- a/tasks/build_tags.py +++ b/tasks/build_tags.py @@ -17,7 +17,6 @@ # ALL_TAGS lists all available build tags. # Used to remove unknown tags from provided tag lists. ALL_TAGS = { - "apm", "clusterchecks", "consul", "containerd", @@ -28,7 +27,6 @@ "ec2", "etcd", "fargateprocess", - "gce", "jmx", "jetson", "kubeapiserver", @@ -41,9 +39,7 @@ "otlp", "pcap", # used by system-probe to compile packet filters using google/gopacket/pcap, which requires cgo to link libpcap "podman", - "process", "python", - "remotewmonly", # used when you want to use only the remote workloadmeta store without importing all dependencies of local collectors "sds", "serverless", "systemd", @@ -60,7 +56,6 @@ # AGENT_TAGS lists the tags needed when building the agent. AGENT_TAGS = { - "apm", "consul", "containerd", "cri", @@ -69,7 +64,6 @@ "docker", "ec2", "etcd", - "gce", "jetson", "jmx", "kubeapiserver", @@ -79,7 +73,6 @@ "orchestrator", "otlp", "podman", - "process", "python", "systemd", "trivy", @@ -110,7 +103,7 @@ FIPS_AGENT_TAGS = AGENT_TAGS.union({"goexperiment.systemcrypto"}) # CLUSTER_AGENT_TAGS lists the tags needed when building the cluster-agent -CLUSTER_AGENT_TAGS = {"clusterchecks", "datadog.no_waf", "kubeapiserver", "orchestrator", "zlib", "zstd", "ec2", "gce"} +CLUSTER_AGENT_TAGS = {"clusterchecks", "datadog.no_waf", "kubeapiserver", "orchestrator", "zlib", "zstd", "ec2"} # CLUSTER_AGENT_CLOUDFOUNDRY_TAGS lists the tags needed when building the cloudfoundry cluster-agent CLUSTER_AGENT_CLOUDFOUNDRY_TAGS = {"clusterchecks"} @@ -122,7 +115,7 @@ IOT_AGENT_TAGS = {"jetson", "otlp", "systemd", "zlib", "zstd"} # INSTALLER_TAGS lists the tags needed when building the installer -INSTALLER_TAGS = {"docker", "ec2", "gce", "kubelet"} +INSTALLER_TAGS = {"docker", "ec2", "kubelet"} # PROCESS_AGENT_TAGS lists the tags necessary to build the process-agent PROCESS_AGENT_TAGS = AGENT_TAGS.union({"fargateprocess"}).difference({"otlp", "python", "trivy"}) @@ -162,7 +155,17 @@ SERVERLESS_TAGS = {"serverless", "otlp"} # SYSTEM_PROBE_TAGS lists the tags necessary to build system-probe -SYSTEM_PROBE_TAGS = AGENT_TAGS.union({"linux_bpf", "npm", "pcap", "remotewmonly"}).difference({"python", "systemd"}) +SYSTEM_PROBE_TAGS = { + "datadog.no_waf", + "ec2", + "linux_bpf", + "netcgo", + "npm", + "pcap", + "trivy", + "zlib", + "zstd", +} # TRACE_AGENT_TAGS lists the tags that have to be added when the trace-agent TRACE_AGENT_TAGS = {"docker", "containerd", "datadog.no_waf", "kubeapiserver", "kubelet", "otlp", "netcgo", "podman"} diff --git a/tasks/buildimages.py b/tasks/buildimages.py index 2f7d228d4d070..06ea84211ac1a 100644 --- a/tasks/buildimages.py +++ b/tasks/buildimages.py @@ -1,7 +1,5 @@ from __future__ import annotations -import os - import yaml from invoke import Context, Exit, task @@ -37,17 +35,33 @@ def update(_: Context, tag: str = "", images: str = "", test: bool = True, list_ print(f" {', '.join(modified)}") -@task(help={"commit_sha": "commit sha from the test-infra-definitions repository"}) -def update_test_infra_definitions(ctx: Context, commit_sha: str, go_mod_only: bool = False): +@task( + help={ + "commit_sha": "commit sha from the test-infra-definitions repository", + "go_mod_only": "Update only the go.mod file", + "is_dev_image": "Is the image bumped to a dev version, used to test changes in test-infra-definitions", + } +) +def update_test_infra_definitions(ctx: Context, commit_sha: str, go_mod_only: bool = False, is_dev_image: bool = False): """ Update the test-infra-definition image version in the Gitlab CI as well as in the e2e go.mod """ - if not go_mod_only: - update_test_infra_def(".gitlab/common/test_infra_version.yml", commit_sha[:12]) + print(f"Updating test-infra-definitions to {commit_sha}") + with ctx.cd("test/new-e2e"): + ctx.run(f"go get github.com/DataDog/test-infra-definitions@{commit_sha}") + ctx.run("go mod tidy") - os.chdir("test/new-e2e") - ctx.run(f"go get github.com/DataDog/test-infra-definitions@{commit_sha}") - ctx.run("go mod tidy") + if not go_mod_only: + prefix_comment = """# File generated by inv buildimages.update-test-infra-definitions +# Please do not edit this file manually +# To update the test-infra-definitions version, run `inv buildimages.update-test-infra-definitions --commit-sha ` [--is-dev-image] +""" + update_test_infra_def( + file_path=".gitlab/common/test_infra_version.yml", + image_tag=commit_sha[:12], + is_dev_image=is_dev_image, + prefix_comment=prefix_comment, + ) @task( diff --git a/tasks/cluster_agent.py b/tasks/cluster_agent.py index 8bbde5be51ece..b929270831a58 100644 --- a/tasks/cluster_agent.py +++ b/tasks/cluster_agent.py @@ -12,10 +12,10 @@ from invoke import task from invoke.exceptions import Exit -from tasks.build_tags import get_build_tags, get_default_build_tags +from tasks.build_tags import get_default_build_tags from tasks.cluster_agent_helpers import build_common, clean_common, refresh_assets_common, version_common from tasks.cws_instrumentation import BIN_PATH as CWS_INSTRUMENTATION_BIN_PATH -from tasks.libs.common.utils import TestsNotSupportedError +from tasks.gointegrationtest import CLUSTER_AGENT_IT_CONF, containerized_integration_tests from tasks.libs.releasing.version import load_release_versions # constants @@ -92,33 +92,14 @@ def integration_tests(ctx, race=False, remote_docker=False, go_mod="readonly", t """ Run integration tests for cluster-agent """ - if sys.platform == 'win32': - raise TestsNotSupportedError('Cluster Agent integration tests are not supported on Windows') - - # We need docker for the kubeapiserver integration tests - tags = get_default_build_tags(build="cluster-agent") + ["docker", "test"] - - go_build_tags = " ".join(get_build_tags(tags, [])) - race_opt = "-race" if race else "" - exec_opts = "" - timeout_opt = f"-timeout {timeout}" if timeout else "" - - # since Go 1.13, the -exec flag of go test could add some parameters such as -test.timeout - # to the call, we don't want them because while calling invoke below, invoke - # thinks that the parameters are for it to interpret. - # we're calling an intermediate script which only pass the binary name to the invoke task. - if remote_docker: - exec_opts = f"-exec \"{os.getcwd()}/test/integration/dockerize_tests.sh\"" - - go_cmd = f'go test {timeout_opt} -mod={go_mod} {race_opt} -tags "{go_build_tags}" {exec_opts}' - - prefixes = [ - "./test/integration/util/kube_apiserver", - "./test/integration/util/leaderelection", - ] - - for prefix in prefixes: - ctx.run(f"{go_cmd} {prefix}") + containerized_integration_tests( + ctx, + CLUSTER_AGENT_IT_CONF, + race=race, + remote_docker=remote_docker, + go_mod=go_mod, + timeout=timeout, + ) @task diff --git a/tasks/collector.py b/tasks/collector.py index 93ff65b73edbd..74f3a439bd9fd 100644 --- a/tasks/collector.py +++ b/tasks/collector.py @@ -14,13 +14,14 @@ from tasks.go import tidy from tasks.libs.ciproviders.github_api import GithubAPI from tasks.libs.common.color import Color, color_message +from tasks.libs.common.git import check_uncommitted_changes, get_git_config, revert_git_config, set_git_config LICENSE_HEADER = """// 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. """ -OCB_VERSION = "0.114.0" +OCB_VERSION = "0.115.0" MANDATORY_COMPONENTS = { "extensions": [ @@ -257,7 +258,7 @@ def generate(ctx): with open(file_path, "w") as f: f.write(content) - + ctx.run(f"gofmt -l -s -w {file_path}") print(f"Updated package name and ensured license header in: {file_path}") @@ -478,9 +479,10 @@ def update_files(self): "./comp/otelcol/collector/impl/collector.go", "./tasks/collector.py", "./.gitlab/integration_test/otel.yml", + "./test/otel/testdata/ocb_build_script.sh", ] - for root, _, files in os.walk("./tasks/unit_tests/testdata/collector"): - for file in files: + for root, _, testfiles in os.walk("./tasks/unit_tests/testdata/collector"): + for file in testfiles: files.append(os.path.join(root, file)) collector_version = self.core_collector.get_version()[1:] for file in files: @@ -498,3 +500,37 @@ def update(ctx): updater = CollectorVersionUpdater() updater.update() print("Update complete.") + + +@task() +def pull_request(ctx): + # Save current Git configuration + original_config = {'user.name': get_git_config('user.name'), 'user.email': get_git_config('user.email')} + + try: + # Set new Git configuration + set_git_config('user.name', 'github-actions[bot]') + set_git_config('user.email', 'github-actions[bot]@users.noreply.github.com') + + # Perform Git operations + ctx.run('git add .') + if check_uncommitted_changes(ctx): + branch_name = f"update-otel-collector-dependencies-{OCB_VERSION}" + ctx.run(f'git switch -c {branch_name}') + ctx.run( + f'git commit -m "Update OTel Collector dependencies to {OCB_VERSION} and generate OTel Agent" --no-verify' + ) + ctx.run(f'git push -u origin {branch_name} --no-verify') # skip pre-commit hook if installed locally + gh = GithubAPI() + gh.create_pr( + pr_title=f"Update OTel Collector dependencies to v{OCB_VERSION}", + pr_body=f"This PR updates the dependencies of the OTel Collector to v{OCB_VERSION} and generates the OTel Agent code.", + target_branch=branch_name, + base_branch="main", + draft=True, + ) + else: + print("No changes detected, skipping PR creation.") + finally: + # Revert to original Git configuration + revert_git_config(original_config) diff --git a/tasks/components.py b/tasks/components.py index c534d63c56b83..fc5b04806ce04 100644 --- a/tasks/components.py +++ b/tasks/components.py @@ -96,8 +96,6 @@ def has_type_component(content) -> bool: 'comp/core/configsync/configsyncimpl', 'comp/core/gui/guiimpl', 'comp/core/hostname/hostnameimpl', - 'comp/core/log/logimpl', - 'comp/core/log/tracelogimpl', 'comp/core/pid/pidimpl', 'comp/core/secrets/secretsimpl', 'comp/core/settings/settingsimpl', @@ -165,7 +163,6 @@ def has_type_component(content) -> bool: # Please do not add a new component to this list. components_missing_implementation_folder = [ "comp/dogstatsd/statsd", - "comp/core/tagger", "comp/forwarder/orchestrator/orchestratorinterface", "comp/core/hostname/hostnameinterface", ] @@ -233,6 +230,12 @@ def check_component_contents_and_file_hiearchy(comp): for src_file in locate_nontest_source_files(impl_folders): pkgname = parse_package_name(src_file) expectname = comp.name + 'impl' + + for part in src_file.parts: + if "impl-" in part: + parts = part.split("-") + expectname = parts[1] + 'impl' + if pkgname != expectname: return f"** {src_file} has wrong package name '{pkgname}', must be '{expectname}'" if comp.path in ignore_fx_import: diff --git a/tasks/dogstatsd.py b/tasks/dogstatsd.py index 08dbe80a85993..311560a3d118e 100644 --- a/tasks/dogstatsd.py +++ b/tasks/dogstatsd.py @@ -11,7 +11,8 @@ from tasks.build_tags import filter_incompatible_tags, get_build_tags, get_default_build_tags from tasks.flavor import AgentFlavor -from tasks.libs.common.utils import REPO_PATH, TestsNotSupportedError, bin_name, get_build_flags, get_root +from tasks.gointegrationtest import DOGSTATSD_IT_CONF, containerized_integration_tests +from tasks.libs.common.utils import REPO_PATH, bin_name, get_build_flags, get_root from tasks.windows_resources import build_messagetable, build_rc, versioninfo_vars # constants @@ -174,29 +175,14 @@ def integration_tests(ctx, race=False, remote_docker=False, go_mod="readonly", t """ Run integration tests for dogstatsd """ - if sys.platform == 'win32': - raise TestsNotSupportedError('DogStatsD integration tests are not supported on Windows') - - go_build_tags = " ".join(get_default_build_tags(build="test")) - race_opt = "-race" if race else "" - exec_opts = "" - timeout_opt = f"-timeout {timeout}" if timeout else "" - - # since Go 1.13, the -exec flag of go test could add some parameters such as -test.timeout - # to the call, we don't want them because while calling invoke below, invoke - # thinks that the parameters are for it to interpret. - # we're calling an intermediate script which only pass the binary name to the invoke task. - if remote_docker: - exec_opts = f"-exec \"{os.getcwd()}/test/integration/dockerize_tests.sh\"" - - go_cmd = f'go test {timeout_opt} -mod={go_mod} {race_opt} -tags "{go_build_tags}" {exec_opts}' - - prefixes = [ - "./test/integration/dogstatsd/...", - ] - - for prefix in prefixes: - ctx.run(f"{go_cmd} {prefix}") + containerized_integration_tests( + ctx, + DOGSTATSD_IT_CONF, + race=race, + remote_docker=remote_docker, + go_mod=go_mod, + timeout=timeout, + ) @task diff --git a/tasks/ebpf.py b/tasks/ebpf.py index dc84b410e43d0..711639cebd073 100644 --- a/tasks/ebpf.py +++ b/tasks/ebpf.py @@ -804,6 +804,7 @@ def _try_delete_github_comment(msg: str): max_complexity_abs_change = -9e9 threshold_for_max_limit = 0.85 programs_now_below_limit, programs_now_above_limit = 0, 0 + has_programs_with_changes = False for program, entries in sorted(program_complexity.items(), key=lambda x: max(e[2] for e in x[1])): avg_new_complexity, avg_old_complexity = 0, 0 highest_new_complexity, highest_old_complexity = 0, 0 @@ -833,8 +834,11 @@ def _try_delete_github_comment(msg: str): programs_now_above_limit += 1 abs_change = new_complexity - old_complexity - max_complexity_rel_change = max(max_complexity_rel_change, abs_change / old_complexity) - max_complexity_abs_change = max(max_complexity_abs_change, abs_change) + + if abs_change != 0: + max_complexity_rel_change = max(max_complexity_rel_change, abs_change / old_complexity) + max_complexity_abs_change = max(max_complexity_abs_change, abs_change) + has_programs_with_changes = True avg_new_complexity /= len(entries) avg_old_complexity /= len(entries) @@ -854,6 +858,12 @@ def _try_delete_github_comment(msg: str): ] summarized_complexity_changes.append(row) + # Reset the max values if we have no programs with changes, as we don't want the -9e9 values + # which are used as the initial values + if not has_programs_with_changes: + max_complexity_abs_change = 0 + max_complexity_rel_change = 0 + headers = ["Program", "Avg. complexity", "Distro with highest complexity", "Distro with lowest complexity"] summarized_complexity_changes = sorted(summarized_complexity_changes, key=lambda x: x[0]) diff --git a/tasks/github_tasks.py b/tasks/github_tasks.py index 7cc67757a61c3..a71e00b834997 100644 --- a/tasks/github_tasks.py +++ b/tasks/github_tasks.py @@ -16,17 +16,19 @@ follow_workflow_run, print_failed_jobs_logs, print_workflow_conclusion, + trigger_buildenv_workflow, trigger_macos_workflow, ) from tasks.libs.common.color import Color, color_message from tasks.libs.common.constants import DEFAULT_INTEGRATIONS_CORE_BRANCH from tasks.libs.common.datadog_api import create_gauge, send_event, send_metrics from tasks.libs.common.git import get_default_branch -from tasks.libs.common.junit_upload_core import repack_macos_junit_tar from tasks.libs.common.utils import get_git_pretty_ref +from tasks.libs.notify.pipeline_status import send_slack_message from tasks.libs.owners.linter import codeowner_has_orphans, directory_has_packages_without_owner from tasks.libs.owners.parsing import read_owners from tasks.libs.pipeline.notifications import GITHUB_SLACK_MAP +from tasks.libs.releasing.version import current_version from tasks.release import _get_release_json_value ALL_TEAMS = '@datadog/agent-all' @@ -76,8 +78,6 @@ def trigger_macos( version_cache=None, retry_download=3, retry_interval=10, - fast_tests=None, - test_washer=False, integrations_core_ref=DEFAULT_INTEGRATIONS_CORE_BRANCH, ): """ @@ -107,30 +107,62 @@ def trigger_macos( version_cache_file_content=version_cache, integrations_core_ref=integrations_core_ref, ) - elif workflow_type == "test": - conclusion = _trigger_macos_workflow( - release_version, - destination, - retry_download, - retry_interval, - workflow_name="test.yaml", - datadog_agent_ref=datadog_agent_ref, - version_cache_file_content=version_cache, - fast_tests=fast_tests, - test_washer=test_washer, - ) - repack_macos_junit_tar(conclusion, "junit-tests_macos.tgz", "junit-tests_macos-repacked.tgz") - elif workflow_type == "lint": - conclusion = _trigger_macos_workflow( - release_version, - workflow_name="lint.yaml", - datadog_agent_ref=datadog_agent_ref, - version_cache_file_content=version_cache, - ) + else: + raise Exit(f"Unsupported workflow type: {workflow_type}", code=1) if conclusion != "success": raise Exit(message=f"Macos {workflow_type} workflow {conclusion}", code=1) +def _update_windows_runner_version(new_version=None, buildenv_ref="master"): + if new_version is None: + raise Exit(message="Buildenv workflow need the 'new_version' field value to be not None") + + run = trigger_buildenv_workflow( + workflow_name="runner-bump.yml", + github_action_ref=buildenv_ref, + new_version=new_version, + ) + # We are only waiting 0.5min between each status check because buildenv is much faster than macOS builds + workflow_conclusion, workflow_url = follow_workflow_run(run, "DataDog/buildenv", 0.5) + + if workflow_conclusion != "success": + if workflow_conclusion == "failure": + print_failed_jobs_logs(run) + return workflow_conclusion + + print_workflow_conclusion(workflow_conclusion, workflow_url) + + download_with_retry(download_artifacts, run, ".", 3, 5, "DataDog/buildenv") + + with open("PR_URL_ARTIFACT") as f: + PR_URL = f.read().strip() + + if not PR_URL: + raise Exit(message="Failed to fetch artifact from the workflow. (Empty artifact)") + + message = f":robobits: A new windows-runner bump PR to {new_version} has been generated. Please take a look :frog-review:\n:pr: {PR_URL} :ty:" + + send_slack_message("ci-infra-support", message) + return workflow_conclusion + + +@task +def update_windows_runner_version( + ctx, + new_version=None, + buildenv_ref="master", +): + """ + Trigger a workflow on the buildenv repository to bump windows gitlab runner + """ + if new_version is None: + new_version = str(current_version(ctx, "7")) + + conclusion = _update_windows_runner_version(new_version, buildenv_ref) + if conclusion != "success": + raise Exit(message=f"Buildenv workflow {conclusion}", code=1) + + @task def lint_codeowner(_, owners_file=".github/CODEOWNERS"): """ diff --git a/tasks/go.py b/tasks/go.py index fafcaa008af35..5bb3fcad7d656 100644 --- a/tasks/go.py +++ b/tasks/go.py @@ -78,11 +78,16 @@ def lint_module(target): concurrency_arg = "" if concurrency is None else f"--concurrency {concurrency}" tags_arg = " ".join(sorted(set(tags))) timeout_arg_value = "25m0s" if not timeout else f"{timeout}m0s" - return ctx.run( + res = ctx.run( f'golangci-lint run {verbosity} --timeout {timeout_arg_value} {concurrency_arg} --build-tags "{tags_arg}" --path-prefix "{module_path}" {golangci_lint_kwargs} {target}/...', env=env, warn=True, ) + # early stop on SIGINT: exit code is 128 + signal number, SIGINT is 2, so 130 + # for some reason this becomes -2 here + if res is not None and (res.exited == -2 or res.exited == 130): + raise KeyboardInterrupt() + return res target_path = Path(module_path) / target result, time_result = TimedOperationResult.run( @@ -217,6 +222,7 @@ def generate_protobuf(ctx): 'workloadmeta': (False, False), 'languagedetection': (False, False), 'remoteagent': (False, False), + 'autodiscovery': (False, False), } # maybe put this in a separate function diff --git a/tasks/go_deps.py b/tasks/go_deps.py index 5310ede1384d8..b08560eaa8056 100644 --- a/tasks/go_deps.py +++ b/tasks/go_deps.py @@ -1,5 +1,7 @@ import datetime import os +import shutil +import tempfile from collections.abc import Iterable from invoke.context import Context @@ -185,3 +187,108 @@ def show(ctx: Context, build: str, flavor: str = AgentFlavor.base.name, os: str for dep in deps: print(dep) + + +@task( + help={ + 'build': f'The agent build to use, one of {", ".join(BINARIES.keys())}', + 'flavor': f'The agent flavor to use, one of {", ".join(AgentFlavor.__members__.keys())}. Defaults to base', + 'os': f'The OS to use, one of {", ".join(GOOS_MAPPING.keys())}. Defaults to host platform', + 'arch': f'The architecture to use, one of {", ".join(GOARCH_MAPPING.keys())}. Defaults to host architecture', + 'entrypoint': 'A Go package path, defaults to the entrypoint of the build.', + 'target': 'A Go package path. If specified, generate a graph from the entrypoint to the target.', + 'std': 'Whether to include the standard library in the graph', + 'cluster': 'Whether to group packages by cluster.', + 'fmt': 'The format of the generated image. Must be accepted by "dot -T". Defaults to "svg".', + 'auto_open': 'Whether to open the generated graph automatically.', + } +) +def graph( + ctx: Context, + build: str, + flavor: str = AgentFlavor.base.name, + os: str | None = None, + arch: str | None = None, + entrypoint: str | None = None, + target: str | None = None, + std: bool = False, + cluster: bool = False, + fmt: str = "svg", + auto_open: bool = True, +): + """ + Generate a dependency graph of the given build. + Requires https://github.com/loov/goda and Graphviz's `dot` tools to be in the PATH. + + Usage: + Dependency graph of the trace-agent on Linux + inv -e go-deps.graph --build trace-agent --os linux + Reachability graph of the process-agent on Linux to k8s.io/... dependencies + inv -e go-deps.graph --build process-agent --os linux --target k8s.io/... + Dependency graph of workloadmeta on Linux when using the same build tags as the core-agent + inv -e go-deps.graph --build agent --os linux --entrypoint github.com/DataDog/datadog-agent/comp/core/workloadmeta/...:all + """ + if shutil.which("goda") is None: + raise Exit( + code=1, + message=color_message( + "'goda' not found in PATH. Please install it with `go install github.com/loov/goda@latest`", "red" + ), + ) + + if os is None: + goos = ctx.run("go env GOOS", hide=True) + assert goos is not None + os = goos.stdout.strip() + assert os in GOOS_MAPPING.values() + + if arch is None: + goarch = ctx.run("go env GOARCH", hide=True) + assert goarch is not None + arch = goarch.stdout.strip() + assert arch in GOARCH_MAPPING.values() + + stdarg = "-std" if std else "" + clusterarg = "-cluster" if cluster else "" + + if entrypoint is None: + entrypoint = BINARIES[build]["entrypoint"] + entrypoint = f"github.com/DataDog/datadog-agent/{entrypoint}:all" + + build_tags = get_default_build_tags( + build=build, flavor=AgentFlavor[flavor], platform=key_for_value(GOOS_MAPPING, os) + ) + for tag in build_tags: + entrypoint = f"{tag}=1({entrypoint})" + + expr = entrypoint if target is None else f"reach({entrypoint}, {target})" + + cmd = f"goda graph {stdarg} {clusterarg} \"{expr}\"" + + env = {"GOOS": os, "GOARCH": arch} + res = ctx.run(cmd, env=env, hide='out') + assert res + + tmpfile = tempfile.mktemp(prefix="graph-") + + dotfile = tmpfile + ".dot" + print("Saving dot file in " + dotfile) + with open(dotfile, "w") as f: + f.write(res.stdout) + + if shutil.which("dot") is None: + raise Exit( + code=1, + message=color_message( + "'dot' not found in PATH. Please follow instructions on https://graphviz.org/download/ to install it.", + "red", + ), + ) + + fmtfile = tmpfile + "." + fmt + print(f"Rendering {fmt} in {fmtfile}") + ctx.run(f"dot -T{fmt} -o {fmtfile} {dotfile}") + + if auto_open: + print(f"Opening {fmt} file") + ctx.run(f"open {fmtfile}") diff --git a/tasks/gointegrationtest.py b/tasks/gointegrationtest.py new file mode 100644 index 0000000000000..1d5cc56c8b9cf --- /dev/null +++ b/tasks/gointegrationtest.py @@ -0,0 +1,161 @@ +import os +import sys +import traceback +from dataclasses import dataclass + +from invoke import Context, task +from invoke.exceptions import Exit + +from tasks.build_tags import get_default_build_tags +from tasks.libs.common.utils import TestsNotSupportedError, gitlab_section + + +@dataclass +class IntegrationTest: + """ + Integration tests + """ + + prefix: str + dir: str = None + extra_args: str = None + + +@dataclass +class IntegrationTestsConfig: + """ + Integration tests configuration + """ + + name: str + go_build_tags: list[str] + tests: list[IntegrationTest] + env: dict[str, str] = None + is_windows_supported: bool = True + + +CORE_AGENT_LINUX_IT_CONF = IntegrationTestsConfig( + name="Core Agent Linux", + go_build_tags=get_default_build_tags(build="test"), + tests=[ + IntegrationTest(prefix="./test/integration/config_providers/..."), + IntegrationTest(prefix="./test/integration/corechecks/..."), + IntegrationTest(prefix="./test/integration/listeners/..."), + IntegrationTest(prefix="./test/integration/util/kubelet/..."), + ], + is_windows_supported=False, +) + +CORE_AGENT_WINDOWS_IT_CONF = IntegrationTestsConfig( + name="Core Agent Windows", + go_build_tags=get_default_build_tags(build="test"), + tests=[ + # Run eventlog tests with the Windows API, which depend on the EventLog service + IntegrationTest(dir="./pkg/util/winutil/", prefix="./eventlog/...", extra_args="-evtapi Windows"), + # Run eventlog tailer tests with the Windows API, which depend on the EventLog service + IntegrationTest(dir=".", prefix="./pkg/logs/tailers/windowsevent/...", extra_args="-evtapi Windows"), + # Run eventlog check tests with the Windows API, which depend on the EventLog service + # Don't include submodules, since the `-evtapi` flag is not defined in them + IntegrationTest( + dir=".", prefix="./comp/checks/windowseventlog/windowseventlogimpl/check", extra_args="-evtapi Windows" + ), + ], +) + +DOGSTATSD_IT_CONF = IntegrationTestsConfig( + name="DogStatsD", + go_build_tags=get_default_build_tags(build="test"), + tests=[IntegrationTest(prefix="./test/integration/dogstatsd/...")], + is_windows_supported=False, +) + +CLUSTER_AGENT_IT_CONF = IntegrationTestsConfig( + name="Cluster Agent", + go_build_tags=get_default_build_tags(build="cluster-agent") + ["docker", "test"], + tests=[ + IntegrationTest(prefix="./test/integration/util/kube_apiserver"), + IntegrationTest(prefix="./test/integration/util/leaderelection"), + ], + is_windows_supported=False, +) + +TRACE_AGENT_IT_CONF = IntegrationTestsConfig( + name="Trace Agent", + go_build_tags=get_default_build_tags(build="test"), + tests=[IntegrationTest(prefix="./cmd/trace-agent/test/testsuite/...")], + env={"INTEGRATION": "yes"}, + is_windows_supported=False, +) + + +def containerized_integration_tests( + ctx: Context, + integration_tests_config: IntegrationTestsConfig, + race=False, + remote_docker=False, + go_mod="readonly", + timeout="", +): + if sys.platform == 'win32' and not integration_tests_config.is_windows_supported: + raise TestsNotSupportedError(f'{integration_tests_config.name} integration tests are not supported on Windows') + test_args = { + "go_mod": go_mod, + "go_build_tags": " ".join(integration_tests_config.go_build_tags), + "race_opt": "-race" if race else "", + "exec_opts": "", + "timeout_opt": f"-timeout {timeout}" if timeout else "", + } + + # since Go 1.13, the -exec flag of go test could add some parameters such as -test.timeout + # to the call, we don't want them because while calling invoke below, invoke + # thinks that the parameters are for it to interpret. + # we're calling an intermediate script which only pass the binary name to the invoke task. + if remote_docker: + test_args["exec_opts"] = f"-exec \"{os.getcwd()}/test/integration/dockerize_tests.sh\"" + + go_cmd = 'go test {timeout_opt} -mod={go_mod} {race_opt} -tags "{go_build_tags}" {exec_opts}'.format(**test_args) # noqa: FS002 + + for it in integration_tests_config.tests: + if it.dir: + with ctx.cd(f"{it.dir}"): + ctx.run(f"{go_cmd} {it.prefix}", env=integration_tests_config.env) + else: + ctx.run(f"{go_cmd} {it.prefix}", env=integration_tests_config.env) + + +@task +def integration_tests(ctx, race=False, remote_docker=False, timeout=""): + """ + Run all the available integration tests + """ + core_agent_conf = CORE_AGENT_WINDOWS_IT_CONF if sys.platform == 'win32' else CORE_AGENT_LINUX_IT_CONF + tests = { + "Agent Core": lambda: containerized_integration_tests( + ctx, core_agent_conf, race=race, remote_docker=remote_docker, timeout=timeout + ), + "DogStatsD": lambda: containerized_integration_tests( + ctx, DOGSTATSD_IT_CONF, race=race, remote_docker=remote_docker, timeout=timeout + ), + "Cluster Agent": lambda: containerized_integration_tests( + ctx, CLUSTER_AGENT_IT_CONF, race=race, remote_docker=remote_docker, timeout=timeout + ), + "Trace Agent": lambda: containerized_integration_tests(ctx, TRACE_AGENT_IT_CONF, race=race, timeout=timeout), + } + tests_failures = {} + for t_name, t in tests.items(): + with gitlab_section(f"Running the {t_name} integration tests", collapsed=True, echo=True): + try: + t() + except TestsNotSupportedError as e: + print(f"Skipping {t_name}: {e}") + except Exception: + # Keep printing the traceback not to have to wait until all tests are done to see what failed + traceback.print_exc() + # Storing the traceback to print it at the end without directly raising the exception + tests_failures[t_name] = traceback.format_exc() + if tests_failures: + print("The following integration tests failed:") + for t_name in tests_failures: + print(f"- {t_name}") + print("See the above logs to get the full traceback.") + raise Exit(code=1) diff --git a/tasks/gotest.py b/tasks/gotest.py index 7ca411e7521ea..af889e8b6dcae 100644 --- a/tasks/gotest.py +++ b/tasks/gotest.py @@ -11,7 +11,6 @@ import os import re import sys -import traceback from collections import defaultdict from collections.abc import Iterable from datetime import datetime @@ -22,13 +21,10 @@ from invoke.context import Context from invoke.exceptions import Exit -from tasks.agent import integration_tests as agent_integration_tests from tasks.build_tags import compute_build_tags_for_flavor -from tasks.cluster_agent import integration_tests as dca_integration_tests from tasks.collector import OCB_VERSION from tasks.coverage import PROFILE_COV, CodecovWorkaround from tasks.devcontainer import run_on_devcontainer -from tasks.dogstatsd import integration_tests as dsd_integration_tests from tasks.flavor import AgentFlavor from tasks.libs.common.color import color_message from tasks.libs.common.datadog_api import create_count, send_metrics @@ -36,7 +32,6 @@ from tasks.libs.common.gomodules import get_default_modules from tasks.libs.common.junit_upload_core import enrich_junitxml, produce_junit_tar from tasks.libs.common.utils import ( - TestsNotSupportedError, clean_nested_paths, get_build_flags, gitlab_section, @@ -46,7 +41,6 @@ from tasks.modules import GoModule, get_module_by_path from tasks.test_core import ModuleTestResult, process_input_args, process_module_results, test_core from tasks.testwasher import TestWasher -from tasks.trace_agent import integration_tests as trace_integration_tests from tasks.update_go import PATTERN_MAJOR_MINOR_BUGFIX GO_TEST_RESULT_TMP_JSON = 'module_test_output.json' @@ -151,6 +145,9 @@ def command(test_results, module, module_result): out_stream=test_profiler, warn=True, ) + # early stop on SIGINT: exit code is 128 + signal number, SIGINT is 2, so 130 + if res is not None and res.exited == 130: + raise KeyboardInterrupt() module_result.result_json_path = os.path.join(module_path, GO_TEST_RESULT_TMP_JSON) @@ -405,36 +402,6 @@ def test( print(f"Tests final status (including re-runs): {color_message('ALL TESTS PASSED', 'green')}") -@task -def integration_tests(ctx, race=False, remote_docker=False, timeout=""): - """ - Run all the available integration tests - """ - tests = { - "Agent": lambda: agent_integration_tests(ctx, race=race, remote_docker=remote_docker, timeout=timeout), - "DogStatsD": lambda: dsd_integration_tests(ctx, race=race, remote_docker=remote_docker, timeout=timeout), - "Cluster Agent": lambda: dca_integration_tests(ctx, race=race, remote_docker=remote_docker, timeout=timeout), - "Trace Agent": lambda: trace_integration_tests(ctx, race=race, timeout=timeout), - } - tests_failures = {} - for t_name, t in tests.items(): - with gitlab_section(f"Running the {t_name} integration tests", collapsed=True, echo=True): - try: - t() - except TestsNotSupportedError as e: - print(f"Skipping {t_name}: {e}") - except Exception: - # Keep printing the traceback not to have to wait until all tests are done to see what failed - traceback.print_exc() - # Storing the traceback to print it at the end without directly raising the exception - tests_failures[t_name] = traceback.format_exc() - if tests_failures: - print("Integration tests failed:") - for t_name, t_failure in tests_failures.items(): - print(f"{t_name}:\n{t_failure}") - raise Exit(code=1) - - @task def e2e_tests(ctx, target="gitlab", agent_image="", dca_image="", argo_workflow="default"): """ diff --git a/tasks/installer.py b/tasks/installer.py index 7429a1eaf3148..381c2dc104db8 100644 --- a/tasks/installer.py +++ b/tasks/installer.py @@ -10,6 +10,7 @@ from invoke.exceptions import Exit from tasks.build_tags import filter_incompatible_tags, get_build_tags, get_default_build_tags +from tasks.libs.common.git import get_commit_sha from tasks.libs.common.utils import REPO_PATH, bin_name, get_build_flags from tasks.libs.releasing.version import get_version @@ -106,12 +107,16 @@ def build_linux_script( with open(INSTALL_SCRIPT_TEMPLATE) as f: install_script = f.read() + # default version on pipelines, using the commit sha instead + if version == "nightly-a7": + version = get_commit_sha(ctx) + archs = ['amd64', 'arm64'] for arch in archs: build_downloader(ctx, flavor=flavor, version=version, os='linux', arch=arch) with open(DOWNLOADER_BIN, 'rb') as f: encoded_bin = base64.encodebytes(f.read()).decode('utf-8') - install_script = install_script.replace(f'DOWNLOADER_BIN_{arch.upper()}', encoded_bin) + install_script = install_script.replace(f'DOWNLOADER_BIN_LINUX_{arch.upper()}', encoded_bin) commit_sha = ctx.run('git rev-parse HEAD', hide=True).stdout.strip() install_script = install_script.replace('INSTALLER_COMMIT', commit_sha) diff --git a/tasks/issue.py b/tasks/issue.py index 3d3f80161fdd4..92e4d1ee1cb98 100644 --- a/tasks/issue.py +++ b/tasks/issue.py @@ -1,11 +1,12 @@ import os +import random from invoke import task from tasks.libs.ciproviders.github_api import GithubAPI from tasks.libs.issue.assign import assign_with_model, assign_with_rules from tasks.libs.issue.model.actions import fetch_data_and_train_model -from tasks.libs.pipeline.notifications import GITHUB_SLACK_MAP +from tasks.libs.pipeline.notifications import GITHUB_SLACK_MAP, GITHUB_SLACK_REVIEW_MAP @task @@ -25,9 +26,14 @@ def assign_owner(_, issue_id, dry_run=False): from slack_sdk import WebClient client = WebClient(os.environ['SLACK_API_TOKEN']) - channel = GITHUB_SLACK_MAP.get(owner.lower(), '#agent-ask-anything') - message = f':githubstatus_partial_outage: *New Community Issue*\n{issue.title} <{issue.html_url}|{gh.repo.name}#{issue_id}>' - message += "\nThe assignation to your team was done automatically, using issue content and title. Please redirect if needed." + channel = next((chan for team, chan in GITHUB_SLACK_MAP.items() if owner.lower() in team), '#agent-devx-help') + message = f':githubstatus_partial_outage: *New Community Issue*\n{issue.title} <{issue.html_url}|{gh.repo.name}#{issue_id}>\n' + if channel == '#agent-ask-anything': + message += "The CI bot failed to assign this issue to a team.\nPlease assign it manually." + else: + message += ( + "Your team was assigned automatically, using the issue content and title.\nPlease redirect if needed." + ) client.chat_postMessage(channel=channel, text=message) return owner @@ -35,3 +41,62 @@ def assign_owner(_, issue_id, dry_run=False): @task def generate_model(_): fetch_data_and_train_model() + + +WAVES = [ + "wave", + "waveboi", + "wastelands-wave", + "wave_hello", + "wave-hokusai", + "wave_moomin", + "wave2", + "wave3", + "wallee-wave", + "vaporeon_wave", + "turtle-wave", + "softwave", + "shiba-wave", + "minion-wave", + "meow_wave_comfy", + "mario-wave", + "link-wave", + "kirby_wave", + "frog-wave", + "fox_wave", + "duckwave", + "cyr-wave", + "cozy-wave", + "cat-wave", + "capy-wave", + "bufo-wave", + "bongo-wave", + "blobwave", + "birb-wave", + "arnaud-wave", +] + + +@task +def ask_reviews(_, pr_id): + gh = GithubAPI() + pr = gh.repo.get_pull(int(pr_id)) + if any(label.name == 'ask-review' for label in pr.get_labels()): + reviewers = [f"@datadog/{team.slug}" for team in pr.requested_teams] + + from slack_sdk import WebClient + + client = WebClient(os.environ['SLACK_API_TOKEN']) + for reviewer in reviewers: + channel = next( + (chan for team, chan in GITHUB_SLACK_REVIEW_MAP.items() if team.casefold() == reviewer.casefold()), + '#agent-devx-help', + ) + message = f'Hello :{random.choice(WAVES)}:! Can you please review <{pr.html_url}/s|{pr.title}>?\n Thanks in advance!' + if channel == '#agent-devx-help': + message = f'Hello :{random.choice(WAVES)}:!\nA review channel is missing for {reviewer}, can you please ask them to update `github_slack_review_map.yaml` and transfer them this review <{pr.html_url}/s|{pr.title}>?\n Thanks in advance!' + try: + client.chat_postMessage(channel=channel, text=message) + except Exception as e: + message = f"An error occurred while sending a review message for PR <{pr.html_url}/s|{pr.title}> to channel {channel}. Error: {e}" + client.chat_postMessage(channel='#agent-devx-ops', text=message) diff --git a/tasks/kmt.py b/tasks/kmt.py index 18f5f9370893b..b284e6d56c91b 100644 --- a/tasks/kmt.py +++ b/tasks/kmt.py @@ -738,17 +738,18 @@ def prepare( ) if ci: - domains = None stack = "ci" return _prepare(ctx, stack, component, arch_obj, packages, verbose, ci, compile_only) - if alien_vms is not None: - err_msg = f"no alient VMs discovered from provided profile {alien_vms}." - else: - err_msg = f"no vms found from list {vms}. Run `inv -e kmt.status` to see all VMs in current stack" - stack = get_kmt_or_alien_stack(ctx, stack, vms, alien_vms) - domains = get_target_domains(ctx, stack, ssh_key, arch_obj, vms, alien_vms) - assert len(domains) > 0, err_msg + domains = None + if not compile_only: + if alien_vms is not None: + err_msg = f"no alient VMs discovered from provided profile {alien_vms}." + else: + err_msg = f"no vms found from list {vms}. Run `inv -e kmt.status` to see all VMs in current stack" + stack = get_kmt_or_alien_stack(ctx, stack, vms, alien_vms) + domains = get_target_domains(ctx, stack, ssh_key, arch_obj, vms, alien_vms) + assert len(domains) > 0, err_msg _prepare(ctx, stack, component, arch_obj, packages, verbose, ci, compile_only, domains=domains) diff --git a/tasks/libs/ciproviders/github_actions_tools.py b/tasks/libs/ciproviders/github_actions_tools.py index 9399302271b5d..591c999a4066d 100644 --- a/tasks/libs/ciproviders/github_actions_tools.py +++ b/tasks/libs/ciproviders/github_actions_tools.py @@ -14,6 +14,45 @@ from tasks.libs.common.git import get_default_branch +def trigger_buildenv_workflow(workflow_name="runner-bump.yml", github_action_ref="master", new_version=None): + """ + Trigger a workflow to bump windows gitlab runner + """ + inputs = {} + if new_version is not None: + inputs["new-version"] = new_version + + print( + "Creating workflow on buildenv on commit {} with args:\n{}".format( # noqa: FS002 + github_action_ref, "\n".join([f" - {k}: {inputs[k]}" for k in inputs]) + ) + ) + + # Hack: get current time to only fetch workflows that started after now + now = datetime.utcnow() + + gh = GithubAPI('DataDog/buildenv') + result = gh.trigger_workflow(workflow_name, github_action_ref, inputs) + + if not result: + print(f"Couldn't trigger workflow run. result={result}") + raise Exit(code=1) + + # Since we can't get the worflow run id from a `create_dispatch` api call we are fetching the first running workflow after `now`. + recent_runs = gh.workflow_run_for_ref_after_date(workflow_name, github_action_ref, now) + MAX_RETRY = 10 + while not recent_runs and MAX_RETRY > 0: + MAX_RETRY -= 1 + sleep(3) + recent_runs = gh.workflow_run_for_ref_after_date(workflow_name, github_action_ref, now) + + if not recent_runs: + print("Couldn't get the run workflow") + raise Exit(code=1) + + return recent_runs[0] + + def trigger_macos_workflow( workflow_name="macos.yaml", github_action_ref="master", @@ -130,7 +169,7 @@ def trigger_macos_workflow( raise Exit(code=1) -def follow_workflow_run(run): +def follow_workflow_run(run, repository="DataDog/datadog-agent-macos-build", interval=5): """ Follow the workflow run until completion and return its conclusion. """ @@ -141,13 +180,11 @@ def follow_workflow_run(run): minutes = 0 failures = 0 - # Wait time (in minutes) between two queries of the workflow status - interval = 5 MAX_FAILURES = 5 while True: # Do not fail outright for temporary failures try: - github = GithubAPI('DataDog/datadog-agent-macos-build') + github = GithubAPI(repository) run = github.workflow_run(run.id) except GithubException as e: failures += 1 @@ -241,7 +278,7 @@ def parse_log_file(log_file): return lines[line_number:] -def download_artifacts(run, destination="."): +def download_artifacts(run, destination=".", repository="DataDog/datadog-agent-macos-build"): """ Download all artifacts for a given job in the specified location. """ @@ -255,7 +292,7 @@ def download_artifacts(run, destination="."): # Create temp directory to store the artifact zips with tempfile.TemporaryDirectory() as tmpdir: - workflow = GithubAPI('DataDog/datadog-agent-macos-build') + workflow = GithubAPI(repository) for artifact in run_artifacts: # Download artifact print("Downloading artifact: ", artifact) @@ -281,14 +318,21 @@ def download_logs(run, destination="."): zip_ref.extractall(destination) -def download_with_retry(download_function, run, destination=".", retry_count=3, retry_interval=10): +def download_with_retry( + download_function, + run, + destination=".", + retry_count=3, + retry_interval=10, + repository="DataDog/datadog-agent-macos-build", +): import requests retry = retry_count while retry > 0: try: - download_function(run, destination) + download_function(run, destination, repository) print(color_message(f"Download successful for run {run.id} to {destination}", "blue")) return except (requests.exceptions.RequestException, ConnectionError): diff --git a/tasks/libs/ciproviders/github_api.py b/tasks/libs/ciproviders/github_api.py index 4021b5d7937e5..54a3ba49a43f1 100644 --- a/tasks/libs/ciproviders/github_api.py +++ b/tasks/libs/ciproviders/github_api.py @@ -64,11 +64,13 @@ def get_branch(self, branch_name): return None raise e - def create_pr(self, pr_title, pr_body, base_branch, target_branch): + def create_pr(self, pr_title, pr_body, base_branch, target_branch, draft=False): """ Creates a PR in the given Github repository. """ - return self._repository.create_pull(title=pr_title, body=pr_body, base=base_branch, head=target_branch) + return self._repository.create_pull( + title=pr_title, body=pr_body, base=base_branch, head=target_branch, draft=draft + ) def update_pr(self, pull_number, milestone_number, labels): """ @@ -330,7 +332,9 @@ def workflow_run_for_ref_after_date(self, workflow_name, ref, oldest_date): return sorted(recent_runs, key=lambda run: run.created_at, reverse=True) - def latest_release(self) -> str: + def latest_release(self, major_version=7) -> str: + if major_version == 6: + return max((r for r in self.get_releases() if r.title.startswith('6.53')), key=lambda r: r.created_at).title release = self._repository.get_latest_release() return release.title @@ -521,6 +525,9 @@ def create_label(self, name, color, description=""): """ return self._repository.create_label(name, color, description) + def create_milestone(self, title): + self._repository.create_milestone(title) + def create_release(self, tag, message, draft=True): return self._repository.create_git_release( tag=tag, diff --git a/tasks/libs/ciproviders/gitlab_api.py b/tasks/libs/ciproviders/gitlab_api.py index cb4e42644e7c6..f1c0b4784d2f6 100644 --- a/tasks/libs/ciproviders/gitlab_api.py +++ b/tasks/libs/ciproviders/gitlab_api.py @@ -1258,19 +1258,26 @@ def full_config_get_all_stages(full_config: dict) -> set[str]: return all_stages -def update_test_infra_def(file_path, image_tag): +def update_test_infra_def(file_path, image_tag, is_dev_image=False, prefix_comment=""): """ - Override TEST_INFRA_DEFINITIONS_BUILDIMAGES in `.gitlab/common/test_infra_version.yml` file + Updates TEST_INFRA_DEFINITIONS_BUILDIMAGES in `.gitlab/common/test_infra_version.yml` file """ - with open(file_path) as gl: - file_content = gl.readlines() - with open(file_path, "w") as gl: - for line in file_content: - test_infra_def = re.search(r"TEST_INFRA_DEFINITIONS_BUILDIMAGES:\s*(\w+)", line) - if test_infra_def: - gl.write(line.replace(test_infra_def.group(1), image_tag)) + test_infra_def = {} + with open(file_path) as test_infra_version_file: + try: + test_infra_def = yaml.safe_load(test_infra_version_file) + test_infra_def["variables"]["TEST_INFRA_DEFINITIONS_BUILDIMAGES"] = image_tag + if is_dev_image: + test_infra_def["variables"]["TEST_INFRA_DEFINITIONS_BUILDIMAGES_SUFFIX"] = "-dev" else: - gl.write(line) + test_infra_def["variables"]["TEST_INFRA_DEFINITIONS_BUILDIMAGES_SUFFIX"] = "" + except yaml.YAMLError as e: + raise Exit(f"Error while loading {file_path}: {e}") from e + with open(file_path, "w") as test_infra_version_file: + test_infra_version_file.write(prefix_comment + ('\n\n' if prefix_comment else '')) + # Add explicit_start=True to keep the document start marker --- + # See "Document Start" in https://www.yaml.info/learn/document.html for more details + yaml.dump(test_infra_def, test_infra_version_file, explicit_start=True) def update_gitlab_config(file_path, tag, images="", test=True, update=True): diff --git a/tasks/libs/common/datadog_api.py b/tasks/libs/common/datadog_api.py index 55b888678b768..7b8b9df7f6a8a 100644 --- a/tasks/libs/common/datadog_api.py +++ b/tasks/libs/common/datadog_api.py @@ -16,8 +16,12 @@ def create_metric(metric_type, metric_name, timestamp, value, tags, unit=None, m unit = unit or unset metadata = unset - if metric_origin: - metadata = MetricMetadata(origin=MetricOrigin(**metric_origin)) + origin_metadata = metric_origin or { + "origin_product": 10, # Agent + "origin_sub_product": 54, # Agent CI + "origin_product_detail": 64, # Gitlab + } + metadata = MetricMetadata(origin=MetricOrigin(**origin_metadata)) return MetricSeries( metric=metric_name, diff --git a/tasks/libs/common/git.py b/tasks/libs/common/git.py index dfff77eda03f7..b1dc1b1cd7683 100644 --- a/tasks/libs/common/git.py +++ b/tasks/libs/common/git.py @@ -1,8 +1,11 @@ from __future__ import annotations import os +import subprocess +import sys import tempfile from contextlib import contextmanager +from time import sleep from typing import TYPE_CHECKING from invoke import Context @@ -161,25 +164,45 @@ def check_base_branch(branch, release_version): return branch == get_default_branch() or branch == release_version.branch() -def try_git_command(ctx, git_command): - """ - Try a git command that should be retried (after user confirmation) if it fails. +def try_git_command(ctx, git_command, non_interactive_retries=2, non_interactive_delay=5): + """Try a git command that should be retried (after user confirmation) if it fails. Primarily useful for commands which can fail if commit signing fails: we don't want the whole workflow to fail if that happens, we want to retry. + + Args: + ctx: The invoke context. + git_command: The git command to run. + non_interactive_retries: The number of times to retry the command if it fails when running non-interactively. + non_interactive_delay: The delay in seconds to retry the command if it fails when running non-interactively. """ do_retry = True + n_retries = 0 + interactive = sys.stdin.isatty() while do_retry: res = ctx.run(git_command, warn=True) if res.exited is None or res.exited > 0: - print( - color_message( - f"Failed to run \"{git_command}\" (did the commit/tag signing operation fail?)", - "orange", + if interactive: + print( + color_message( + f"Failed to run \"{git_command}\" (did the commit/tag signing operation fail?)", + "orange", + ) ) - ) - do_retry = yes_no_question("Do you want to retry this operation?", color="orange", default=True) + do_retry = yes_no_question("Do you want to retry this operation?", color="orange", default=True) + else: + # Non interactive, retry in `non_interactive_delay` seconds if we haven't reached the limit + n_retries += 1 + if n_retries > non_interactive_retries: + print(f'{color_message("Error", Color.RED)}: Failed to run git command', file=sys.stderr) + return False + + print( + f'{color_message("Warning", Color.ORANGE)}: Retrying git command in {non_interactive_delay}s', + file=sys.stderr, + ) + sleep(non_interactive_delay) continue return True @@ -270,3 +293,20 @@ def get_last_release_tag(ctx, repo, pattern): last_tag_name = last_tag_name_with_suffix.removesuffix("^{}") last_tag_name = last_tag_name.removeprefix("refs/tags/") return last_tag_commit, last_tag_name + + +def get_git_config(key): + result = subprocess.run(['git', 'config', '--get', key], capture_output=True, text=True) + return result.stdout.strip() if result.returncode == 0 else None + + +def set_git_config(key, value): + subprocess.run(['git', 'config', key, value]) + + +def revert_git_config(original_config): + for key, value in original_config.items(): + if value is None: + subprocess.run(['git', 'config', '--unset', key]) + else: + subprocess.run(['git', 'config', key, value]) diff --git a/tasks/libs/common/gomodules.py b/tasks/libs/common/gomodules.py index 8f33fa55ebb52..e4805588f73f5 100644 --- a/tasks/libs/common/gomodules.py +++ b/tasks/libs/common/gomodules.py @@ -101,7 +101,6 @@ class GoModule: test_targets: Directories to unit test. should_test_condition: When to execute tests, must be a enumerated field of `GoModule.CONDITIONS`. should_tag: Whether this module should be tagged or not. - importable: HACK: Workaround for modules that can be tested, but not imported (eg. gohai), because they define a main package A better solution would be to automatically detect if a module contains a main package, at the cost of spending some time parsing the module. independent: Specifies whether this modules is supposed to exist independently of the datadog-agent module. If True, a check will run to ensure this is true. lint_targets: Directories to lint. used_by_otel: Whether the module is an otel dependency or not. @@ -109,7 +108,6 @@ class GoModule: Usage: A module is defined within the modules.yml file containing the following fields by default (these can be omitted if the default value is used): > should_test_condition: always - > importable: true > independent: true > lint_targets: > - . @@ -140,11 +138,6 @@ class GoModule: should_test_condition: str = 'always' # Whether this module should be tagged or not should_tag: bool = True - # HACK: Workaround for modules that can be tested, but not imported (eg. gohai), because - # they define a main package - # A better solution would be to automatically detect if a module contains a main package, - # at the cost of spending some time parsing the module. - importable: bool = True # Whether this modules is supposed to exist independently of the datadog-agent module. If True, a check will run to ensure this is true. independent: bool = True # Directories to lint @@ -164,7 +157,6 @@ def from_dict(path: str, data: dict[str, object]) -> GoModule: lint_targets=data.get("lint_targets", default["lint_targets"]), should_test_condition=data.get("should_test_condition", default["should_test_condition"]), should_tag=data.get("should_tag", default["should_tag"]), - importable=data.get("importable", default["importable"]), independent=data.get("independent", default["independent"]), used_by_otel=data.get("used_by_otel", default["used_by_otel"]), legacy_go_mod_version=data.get("legacy_go_mod_version", default["legacy_go_mod_version"]), @@ -197,7 +189,6 @@ def to_dict(self, remove_defaults=True, remove_path=False) -> dict[str, object]: "lint_targets": self.lint_targets, "should_test_condition": self.should_test_condition, "should_tag": self.should_tag, - "importable": self.importable, "independent": self.independent, "used_by_otel": self.used_by_otel, "legacy_go_mod_version": self.legacy_go_mod_version, @@ -261,8 +252,13 @@ def tag(self, agent_version): >>> [mod.tag("7.27.0") for mod in mods] [["7.27.0"], ["pkg/util/log/v0.27.0"]] """ + from invoke import Context + + from tasks.libs.common.git import is_agent6 + + major = "6" if is_agent6(Context()) else "7" if self.path == ".": - return ["7" + agent_version[1:]] + return [major + agent_version[1:]] return [f"{self.path}/{self.__version(agent_version)}"] diff --git a/tasks/libs/common/junit_upload_core.py b/tasks/libs/common/junit_upload_core.py index b7282d9bf4ebc..cebbe0a1c2b75 100644 --- a/tasks/libs/common/junit_upload_core.py +++ b/tasks/libs/common/junit_upload_core.py @@ -377,25 +377,3 @@ def produce_junit_tar(files, result_path): job_env_info.size = job_env_file.getbuffer().nbytes job_env_file.seek(0) tgz.addfile(job_env_info, job_env_file) - - -def repack_macos_junit_tar(workflow_conclusion, infile, outfile): - """ - Repacks JUnit tgz file from macOS Github Action run, so it would - contain correct job name and job URL. - """ - if workflow_conclusion == "cancelled" and not os.path.exists(infile): - print(f"Skipping repacking of JUnit tarball due to {workflow_conclusion} workflow") - return - - with tarfile.open(infile) as infp, tarfile.open(outfile, "w:gz") as outfp, tempfile.TemporaryDirectory() as tempd: - infp.extractall(tempd) - - # write the proper job url and job name - with open(os.path.join(tempd, JOB_ENV_FILE_NAME), "w") as fp: - fp.write(f'CI_JOB_URL={os.environ.get("CI_JOB_URL", "")}\n') - fp.write(f'CI_JOB_NAME={os.environ.get("CI_JOB_NAME", "")}') - - # pack all files to a new tarball - for f in os.listdir(tempd): - outfp.add(os.path.join(tempd, f), arcname=f) diff --git a/tasks/libs/common/omnibus.py b/tasks/libs/common/omnibus.py index 803400026082b..1887cffb97133 100644 --- a/tasks/libs/common/omnibus.py +++ b/tasks/libs/common/omnibus.py @@ -11,13 +11,6 @@ from tasks.release import _get_release_json_value -def _get_build_images(ctx): - # We intentionally include both build images & their test suffixes in the pattern - # as a test image and the merged version shouldn't share their cache - tags = ctx.run("grep -E 'DATADOG_AGENT_.*BUILDIMAGES' .gitlab-ci.yml | cut -d ':' -f 2", hide='stdout').stdout - return (t.strip() for t in tags.splitlines()) - - def _get_omnibus_commits(field): if 'RELEASE_VERSION' in os.environ: release_version = os.environ['RELEASE_VERSION'] @@ -38,6 +31,7 @@ def env_filter(item): 'AGENT_', 'API_KEY_', 'APP_KEY_', + 'ATLASSIAN_', 'AWS_', 'BAZEL_', 'BETA_', @@ -53,13 +47,14 @@ def env_filter(item): 'DESTINATION_', 'DOCKER_', 'DYNAMIC_', - 'E2E_TESTS_', + 'E2E_', 'EMISSARY_', 'EXECUTOR_', 'FF_', 'GITHUB_', 'GITLAB_', 'GIT_', + 'INSTALLER_', 'JIRA_', 'K8S_', 'KITCHEN_', @@ -102,7 +97,9 @@ def env_filter(item): "CHANNEL", "CHART", "CI", - "CLUSTER", + "CLUSTERS", + "CODECOV", + "CODECOV_TOKEN", "COMPUTERNAME", "CONDA_PROMPT_MODIFIER", "CONSUL_HTTP_ADDR", @@ -118,12 +115,16 @@ def env_filter(item): "GENERAL_ARTIFACTS_CACHE_BUCKET_URL", "GET_SOURCES_ATTEMPTS", "GO_TEST_SKIP_FLAKE", + "GONOSUMDB", + "GOPROXY", "HELM_HOOKS_CI_IMAGE", + "HELM_HOOKS_PERIODICAL_REBUILD_CONDUCTOR_ENV", "HOME", "HOSTNAME", "HOST_IP", "INFOPATH", "INSTALL_SCRIPT_API_KEY_ORG2", + "INSTANCE_TYPE", "INTEGRATION_WHEELS_CACHE_BUCKET", "IRBRC", "KITCHEN_INFRASTRUCTURE_FLAKES_RETRY", @@ -136,9 +137,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", @@ -148,6 +151,7 @@ def env_filter(item): "SIGN", "SHELL", "SHLVL", + "SLACK_AGENT", "STATIC_BINARIES_DIR", "STATSD_URL", "SYSTEM_PROBE_BINARIES_DIR", @@ -205,9 +209,7 @@ def omnibus_compute_cache_key(ctx): h = hashlib.sha1() omnibus_last_changes = _last_omnibus_changes(ctx) h.update(str.encode(omnibus_last_changes)) - buildimages_hash = _get_build_images(ctx) - for img_hash in buildimages_hash: - h.update(str.encode(img_hash)) + h.update(str.encode(os.getenv('CI_JOB_IMAGE', 'local_build'))) omnibus_ruby_commit = _get_omnibus_commits('OMNIBUS_RUBY_VERSION') omnibus_software_commit = _get_omnibus_commits('OMNIBUS_SOFTWARE_VERSION') print(f'Omnibus ruby commit: {omnibus_ruby_commit}') diff --git a/tasks/libs/common/utils.py b/tasks/libs/common/utils.py index 175b6d848d4d7..56e96ba23403f 100644 --- a/tasks/libs/common/utils.py +++ b/tasks/libs/common/utils.py @@ -661,3 +661,15 @@ def agent_working_directory(): from tasks.libs.common.worktree import LOCAL_DIRECTORY, WORKTREE_DIRECTORY, is_worktree return WORKTREE_DIRECTORY if is_worktree() else LOCAL_DIRECTORY + + +def is_macos(): + return sys.platform == 'darwin' + + +def is_linux(): + return sys.platform.startswith('linux') + + +def is_windows(): + return sys.platform == 'win32' diff --git a/tasks/libs/common/worktree.py b/tasks/libs/common/worktree.py index 74dd5e04e4877..17e5db4abfc97 100644 --- a/tasks/libs/common/worktree.py +++ b/tasks/libs/common/worktree.py @@ -5,10 +5,11 @@ """ import os +import sys from contextlib import contextmanager from pathlib import Path -from invoke.exceptions import Exit +from invoke.exceptions import Exit, UnexpectedExit from tasks.libs.common.color import Color, color_message from tasks.libs.common.git import get_current_branch @@ -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( @@ -48,7 +49,18 @@ def init_env(ctx, branch: str | None = None): f"git -C '{WORKTREE_DIRECTORY}' rev-parse --abbrev-ref HEAD", hide=True ).stdout.strip() if worktree_branch != branch: - ctx.run(f"git -C '{WORKTREE_DIRECTORY}' checkout '{branch}'", hide=True) + for retry in range(2): + try: + ctx.run(f"git -C '{WORKTREE_DIRECTORY}' checkout '{branch}'", hide=True) + except UnexpectedExit as e: + if retry == 1: + raise e + else: + print( + f'{color_message("Warning", Color.ORANGE)}: Git branch not found in the local worktree folder, fetching repository', + file=sys.stderr, + ) + ctx.run(f"git -C '{WORKTREE_DIRECTORY}' fetch", hide=True) if not os.environ.get("AGENT_WORKTREE_NO_PULL"): ctx.run(f"git -C '{WORKTREE_DIRECTORY}' pull", hide=True) diff --git a/tasks/libs/package/size.py b/tasks/libs/package/size.py index dad67823d3223..2323d40fdb56b 100644 --- a/tasks/libs/package/size.py +++ b/tasks/libs/package/size.py @@ -7,7 +7,7 @@ from tasks.libs.common.constants import ORIGIN_CATEGORY, ORIGIN_PRODUCT, ORIGIN_SERVICE from tasks.libs.common.git import get_default_branch from tasks.libs.common.utils import get_metric_origin -from tasks.libs.package.utils import get_package_path +from tasks.libs.package.utils import find_package DEBIAN_OS = "debian" CENTOS_OS = "centos" @@ -37,22 +37,22 @@ # The below template contains the relative increase threshold for each package type PACKAGE_SIZE_TEMPLATE = { 'amd64': { - 'datadog-agent': {'deb': 140 * pow(10, 6)}, - 'datadog-iot-agent': {'deb': 10 * pow(10, 6)}, - 'datadog-dogstatsd': {'deb': 10 * pow(10, 6)}, - 'datadog-heroku-agent': {'deb': 70 * pow(10, 6)}, + 'datadog-agent': {'deb': int(140e6)}, + 'datadog-iot-agent': {'deb': int(10e6)}, + 'datadog-dogstatsd': {'deb': int(10e6)}, + 'datadog-heroku-agent': {'deb': int(70e6)}, }, 'x86_64': { - 'datadog-agent': {'rpm': 140 * pow(10, 6), 'suse': 140 * pow(10, 6)}, - 'datadog-iot-agent': {'rpm': 10 * pow(10, 6), 'suse': 10 * pow(10, 6)}, - 'datadog-dogstatsd': {'rpm': 10 * pow(10, 6), 'suse': 10 * pow(10, 6)}, + 'datadog-agent': {'rpm': int(140e6), 'suse': int(140e6)}, + 'datadog-iot-agent': {'rpm': int(10e6), 'suse': int(10e6)}, + 'datadog-dogstatsd': {'rpm': int(10e6), 'suse': int(10e6)}, }, 'arm64': { - 'datadog-agent': {'deb': 140 * pow(10, 6)}, - 'datadog-iot-agent': {'deb': 10 * pow(10, 6)}, - 'datadog-dogstatsd': {'deb': 10 * pow(10, 6)}, + 'datadog-agent': {'deb': int(140e6)}, + 'datadog-iot-agent': {'deb': int(10e6)}, + 'datadog-dogstatsd': {'deb': int(10e6)}, }, - 'aarch64': {'datadog-agent': {'rpm': 140 * pow(10, 6)}, 'datadog-iot-agent': {'rpm': 10 * pow(10, 6)}}, + 'aarch64': {'datadog-agent': {'rpm': int(140e6)}, 'datadog-iot-agent': {'rpm': int(10e6)}}, } @@ -158,54 +158,30 @@ def compute_package_size_metrics( return series -def compare(ctx, package_sizes, ancestor, arch, flavor, os_name, threshold): +def compare(ctx, package_sizes, ancestor, pkg_size): """ - Compare (or update) a package size with the ancestor package size. + Compare (or update, when on main branch) a package size with the ancestor package size. """ - if os_name == 'suse': - dir = os.environ['OMNIBUS_PACKAGE_DIR_SUSE'] - path = f'{dir}/{flavor}-7*{arch}.rpm' - else: - dir = os.environ['OMNIBUS_PACKAGE_DIR'] - separator = '_' if os_name == 'deb' else '-' - path = f'{dir}/{flavor}{separator}7*{arch}.{os_name}' - package_size = _get_uncompressed_size(ctx, get_package_path(path), os_name) + current_size = _get_uncompressed_size(ctx, find_package(pkg_size.path()), pkg_size.os) if os.environ['CI_COMMIT_REF_NAME'] == get_default_branch(): - package_sizes[ancestor][arch][flavor][os_name] = package_size + # On main, ancestor is the current commit, so we set the current value + package_sizes[ancestor][pkg_size.arch][pkg_size.flavor][pkg_size.os] = current_size return - previous_size = package_sizes[ancestor][arch][flavor][os_name] - diff = package_size - previous_size - - message = f"{flavor}-{arch}-{os_name} size {mb(package_size)} is OK: {mb(diff)} diff with previous {mb(previous_size)} (max: {mb(threshold)})" + previous_size = package_sizes[ancestor][pkg_size.arch][pkg_size.flavor][pkg_size.os] + pkg_size.compare(current_size, previous_size) - if diff > threshold: - emoji = "❌" - print(color_message(message.replace('OK', 'too large'), Color.RED), file=sys.stderr) + if pkg_size.ko(): + print(color_message(pkg_size.log(), Color.RED), file=sys.stderr) else: - emoji = "✅" if diff <= 0 else "⚠️" - print(message) - return f"|{flavor}-{arch}-{os_name}|{mb(diff)}|{emoji}|{mb(package_size)}|{mb(previous_size)}|{mb(threshold)}|" - - -def mb(value): - return f"{value / 1000000:.2f}MB" + print(pkg_size.log()) + return pkg_size def _get_uncompressed_size(ctx, package, os_name): if os_name == 'deb': - return _get_deb_uncompressed_size(ctx, package) + return ( + int(ctx.run(f'dpkg-deb --info {package} | grep Installed-Size | cut -d : -f 2 | xargs', hide=True).stdout) + * 1024 + ) else: - return _get_rpm_uncompressed_size(ctx, package) - - -def _get_deb_uncompressed_size(ctx, package): - # the size returned by dpkg is a number of bytes divided by 1024 - # so we multiply it back to get the same unit as RPM or stat - return ( - int(ctx.run(f'dpkg-deb --info {package} | grep Installed-Size | cut -d : -f 2 | xargs', hide=True).stdout) - * 1024 - ) - - -def _get_rpm_uncompressed_size(ctx, package): - return int(ctx.run(f'rpm -qip {package} | grep Size | cut -d : -f 2 | xargs', hide=True).stdout) + return int(ctx.run(f'rpm -qip {package} | grep Size | cut -d : -f 2 | xargs', hide=True).stdout) diff --git a/tasks/libs/package/utils.py b/tasks/libs/package/utils.py index 298901732c33e..8f43eaa9b4e33 100644 --- a/tasks/libs/package/utils.py +++ b/tasks/libs/package/utils.py @@ -1,5 +1,6 @@ import glob import json +import os from invoke import Exit, UnexpectedExit @@ -11,7 +12,69 @@ PACKAGE_SIZE_S3_CI_BUCKET_URL = "s3://dd-ci-artefacts-build-stable/datadog-agent/package_size" -def get_package_path(glob_pattern): +class PackageSize: + def __init__(self, arch, flavor, os_name, threshold): + self.arch = arch + self.flavor = flavor + self.os = os_name + self.size = 0 + self.ancestor_size = 0 + self.diff = 0 + self.mb_diff = 0 + self.threshold = threshold + self.emoji = "✅" + + @property + def name(self): + return f"{self.flavor}-{self.arch}-{self.os}" + + def arch_name(self): + if self.arch in ["x86_64", "amd64"]: + return "amd" + return "arm" + + def ko(self): + return self.diff > self.threshold + + def path(self): + if self.os == 'suse': + dir = os.environ['OMNIBUS_PACKAGE_DIR_SUSE'] + return f'{dir}/{self.flavor}-7*{self.arch}.rpm' + else: + dir = os.environ['OMNIBUS_PACKAGE_DIR'] + separator = '_' if self.os == 'deb' else '-' + return f'{dir}/{self.flavor}{separator}7*{self.arch}.{self.os}' + + def compare(self, size, ancestor_size): + self.size = size + self.ancestor_size = ancestor_size + self.diff = self.size - self.ancestor_size + self.mb_diff = float(f"{self.diff / pow(10, 6):.2f}") + if self.ko(): + self.emoji = "❌" + elif self.mb_diff > 0: + self.emoji = "⚠️" + + @staticmethod + def mb(value): + return f"{value / 1e6:.2f}MB" + + def log(self): + return f"{self.emoji} - {self.name} size {self.mb(self.size)}: {self.mb(self.diff)} diff[{self.diff}] with previous {self.mb(self.ancestor_size)} (max: {self.mb(self.threshold)})" + + def markdown(self): + elements = ( + self.name, + self.mb(self.diff), + self.emoji, + self.mb(self.size), + self.mb(self.ancestor_size), + self.mb(self.threshold), + ) + return f'|{"|".join(map(str, elements))}|' + + +def find_package(glob_pattern): package_paths = glob.glob(glob_pattern) if len(package_paths) > 1: raise Exit(code=1, message=color_message(f"Too many files matching {glob_pattern}: {package_paths}", "red")) @@ -103,4 +166,4 @@ def display_message(ctx, ancestor, rows, decision): ## Decision {decision} """ - pr_commenter(ctx, title="Package size comparison", body=message) + pr_commenter(ctx, title="Uncompressed package size comparison", body=message) diff --git a/tasks/libs/pipeline/github_jira_map.yaml b/tasks/libs/pipeline/github_jira_map.yaml index d3262de27a247..d4bf1aefe502e 100644 --- a/tasks/libs/pipeline/github_jira_map.yaml +++ b/tasks/libs/pipeline/github_jira_map.yaml @@ -12,7 +12,7 @@ '@datadog/network-device-monitoring': NDMII '@datadog/ndm-core': NDMII '@datadog/ndm-integrations': NDINT -'@datadog/processes': PROCS +'@datadog/container-intake': CTK '@datadog/agent-metrics-logs': AMLII '@datadog/agent-shared-components': ASCII '@datadog/container-app': CAP diff --git a/tasks/libs/pipeline/github_slack_map.yaml b/tasks/libs/pipeline/github_slack_map.yaml index fd021cf169528..0d673eddd714e 100644 --- a/tasks/libs/pipeline/github_slack_map.yaml +++ b/tasks/libs/pipeline/github_slack_map.yaml @@ -14,7 +14,7 @@ '@datadog/network-device-monitoring': '#network-device-monitoring' '@datadog/ndm-core': '#ndm-core' '@datadog/ndm-integrations': '#ndm-integrations' -'@datadog/processes': '#process-agent-ops' +'@datadog/container-intake': '#process-agent-ops' '@datadog/agent-metrics-logs': '#agent-metrics-logs' '@datadog/agent-processing-and-routing': '#agent-processing-and-routing' '@datadog/agent-shared-components': '#agent-shared-components-ops' @@ -44,5 +44,5 @@ '@datadog/agent-devx-infra': '#agent-devx-ops' '@datadog/agent-devx-loops': '#agent-devx-ops' '@datadog/apm-onboarding': '#apm-onboarding' -'@datadog/apm-reliability-and-performance': '#apm-ecosystems-reliability' +'@datadog/apm-ecosystems-performance': '#apm-benchmarking-platform' '@DataDog/container-ecosystems': '#container-ecosystems-ops' diff --git a/tasks/libs/pipeline/github_slack_review_map.yaml b/tasks/libs/pipeline/github_slack_review_map.yaml new file mode 100644 index 0000000000000..9ae0b6931a898 --- /dev/null +++ b/tasks/libs/pipeline/github_slack_review_map.yaml @@ -0,0 +1,48 @@ +# This file contains a mapping of DataDog Github teams to slack channels for reviews. +# It was created until we find a good solution to get information directly from https://github.com/DataDog/web-ui/blob/preprod/packages/lib/teams/teams-config.ts +# The DEFAULT_SLACK_CHANNEL value is interpreted as '#agent-devx-ops'. +# Note that the values must be quoted if they contain a '#' symbol, because +# YAML interprets that as the beginning of a comment. Keys must also be quoted +# because the '@' symbol is reserved in YAML. +'@datadog/agent-platform': DEFAULT_SLACK_CHANNEL +'@datadog/documentation': '#documentation' +'@datadog/container-integrations': '#container-integrations' +'@datadog/container-platform': '#container-platform' +'@datadog/container-ecosystems': '#container-ecosystems' +'@datadog/platform-integrations': '#platform-integrations' +'@datadog/agent-security': '#security-and-compliance-agent' +'@datadog/agent-apm': '#apm-agent' +'@datadog/network-device-monitoring': '#network-device-monitoring' +'@datadog/ndm-core': '#ndm-core' +'@datadog/ndm-integrations': '#ndm-integrations' +'@datadog/container-intake': '#process-agent-ops' +'@datadog/agent-metrics-logs': '#agent-metrics-logs' +'@datadog/agent-processing-and-routing': '#agent-processing-and-routing' +'@datadog/agent-shared-components': '#agent-shared-components' +'@datadog/container-app': '#container-app' +'@datadog/metrics-aggregation': '#metrics-aggregation' +'@datadog/serverless': '#serverless-agent' +'@datadog/remote-config': '#remote-config-monitoring' +'@datadog/fleet': '#fleet-automation-monitoring' +'@datadog/agent-all': '#datadog-agent-pipelines' +'@datadog/ebpf-platform': '#ebpf-platform' +'@datadog/networks': '#network-performance-monitoring' +'@datadog/universal-service-monitoring': '#universal-service-monitoring' +'@datadog/windows-agent': '#windows-agent-reviews' +'@datadog/windows-kernel-integrations': '#windows-kernel-integrations-reviews' +'@datadog/opentelemetry': '#opentelemetry' +'@datadog/agent-e2e-testing': '#agent-e2e-framework-devs' +'@datadog/software-integrity-and-trust': '#sit' +'@datadog/single-machine-performance': '#single-machine-performance' +'@datadog/agent-integrations': '#agent-integrations' +'@datadog/debugger': '#debugger' +'@datadog/database-monitoring': '#database-monitoring' +'@datadog/agent-cspm': '#k9-cspm' +'@datadog/telemetry-and-analytics': '#instrumentation-telemetry' +'@datadog/apm-trace-storage': '#apm-trace-storage' +'@datadog/asm-go': '#k9-library-go' +'@datadog/agent-delivery': '#agent-delivery-reviews' +'@datadog/agent-devx-infra': '#agent-devx-infra-reviews' +'@datadog/agent-devx-loops': '#agent-devx-loops-reviews' +'@datadog/apm-onboarding': '#apm-onboarding' +'@datadog/apm-ecosystems-performance': '#apm-benchmarking-platform' diff --git a/tasks/libs/pipeline/notifications.py b/tasks/libs/pipeline/notifications.py index b121dc1b6b2ef..92e6af39bdc70 100644 --- a/tasks/libs/pipeline/notifications.py +++ b/tasks/libs/pipeline/notifications.py @@ -42,6 +42,9 @@ def load_and_validate( # Map keys in lowercase GITHUB_SLACK_MAP = load_and_validate("github_slack_map.yaml", "DEFAULT_SLACK_CHANNEL", DEFAULT_SLACK_CHANNEL) GITHUB_JIRA_MAP = load_and_validate("github_jira_map.yaml", "DEFAULT_JIRA_PROJECT", DEFAULT_JIRA_PROJECT) +GITHUB_SLACK_REVIEW_MAP = load_and_validate( + "github_slack_review_map.yaml", "DEFAULT_SLACK_CHANNEL", DEFAULT_SLACK_CHANNEL +) def check_for_missing_owners_slack_and_jira(print_missing_teams=True, owners_file=".github/CODEOWNERS"): diff --git a/tasks/libs/releasing/documentation.py b/tasks/libs/releasing/documentation.py index 13c7f0d148252..9834983792cbd 100644 --- a/tasks/libs/releasing/documentation.py +++ b/tasks/libs/releasing/documentation.py @@ -31,7 +31,7 @@ def release_entry_for(agent_major_version): return f"release-a{agent_major_version}" -def create_release_page(version, freeze_date): +def create_release_page(version, cutoff_date): username = os.environ['ATLASSIAN_USERNAME'] password = os.environ['ATLASSIAN_PASSWORD'] parent_page_id = "2244936127" @@ -44,7 +44,7 @@ def create_release_page(version, freeze_date): page = confluence.create_page( space=SPACE_KEY, title=page_title, - body=create_release_table(version, freeze_date, teams), + body=create_release_table(version, cutoff_date, teams), parent_id=parent_page_id, editor="v2", ) @@ -52,7 +52,7 @@ def create_release_page(version, freeze_date): confluence.create_page( space=SPACE_KEY, title=f"{page_title} Notes", - body=create_release_notes(freeze_date, teams), + body=create_release_notes(cutoff_date, teams), parent_id=release_page["id"], ) return release_page @@ -118,12 +118,13 @@ def get_releasing_teams(): 'agent-platform', 'agent-release-management', 'container-ecosystems', + 'apm-trace-storage', } owners = set(list_owners()) return sorted(owners - non_releasing_teams) -def create_release_table(version, freeze_date, teams): +def create_release_table(version, cutoff_date, teams): from yattag import Doc doc, tag, text, line = Doc().ttl() @@ -153,7 +154,7 @@ def create_release_table(version, freeze_date, teams): with ( tag('td', colspan="2"), tag('p', style="text-align: center;"), - tag('time', datetime=f"{freeze_date + timedelta(days=26)}"), + tag('time', datetime=f"{cutoff_date + timedelta(days=26)}"), ): pass with tag('tr'): @@ -164,11 +165,11 @@ def create_release_table(version, freeze_date, teams): text(f'https://github.com/DataDog/datadog-agent/releases/tag/{version}') with tag('tr'): with tag('td'), tag('p'): - text('Code freeze date') + text('Cut-off date') with ( tag('td', colspan="2"), tag('p', style="text-align: center;"), - tag('time', datetime=f"{freeze_date}"), + tag('time', datetime=f"{cutoff_date}"), ): pass with tag('tr'): @@ -201,17 +202,17 @@ def create_release_table(version, freeze_date, teams): return doc.getvalue() -def create_release_notes(freeze_date, teams): +def create_release_notes(cutoff_date, teams): from yattag import Doc doc, tag, text, line = Doc().ttl() milestones = { - '"Code freeze"': freeze_date, - '"RC.1 built"': freeze_date + timedelta(days=1), - '"Staging deployment"': freeze_date + timedelta(days=3), - '"Prod deployment start"': freeze_date + timedelta(days=11), - '"Full prod deployment"': freeze_date + timedelta(days=20), - '"Release"': freeze_date + timedelta(days=26), + '"Cut-off"': cutoff_date, + '"RC.1 built"': cutoff_date + timedelta(days=1), + '"Staging deployment"': cutoff_date + timedelta(days=3), + '"Prod deployment start"': cutoff_date + timedelta(days=11), + '"Full prod deployment"': cutoff_date + timedelta(days=20), + '"Release"': cutoff_date + timedelta(days=26), } line('h2', 'Schedule') diff --git a/tasks/libs/releasing/version.py b/tasks/libs/releasing/version.py index 23472d57c0cca..85e66ea283080 100644 --- a/tasks/libs/releasing/version.py +++ b/tasks/libs/releasing/version.py @@ -6,6 +6,7 @@ from invoke import Exit from tasks.libs.ciproviders.github_api import GithubAPI +from tasks.libs.common.color import Color, color_message from tasks.libs.common.constants import ( AGENT_VERSION_CACHE_NAME, ALLOWED_REPO_NIGHTLY_BRANCHES, @@ -441,3 +442,80 @@ def get_matching_pattern(ctx, major_version, release=False): ) pattern = max(tags, key=cmp_to_key(semver.compare)) return pattern + + +def deduce_version(ctx, branch, as_str: bool = True, trust: bool = False, next_version: bool = True) -> str | Version: + """Deduces the version from the release branch name. + + Args: + next_version: If True, will return the next tag version, otherwise will return the current tag version. Example: If there are 7.60.0 and 7.60.1 tags, it will return 7.60.2 if next_tag is True, 7.60.1 otherwise. + """ + release_version = get_next_version_from_branch(ctx, branch, as_str=as_str, next_version=next_version) + + print( + f'{color_message("Info", Color.BLUE)}: Version {release_version} deduced from branch {branch}', file=sys.stderr + ) + + if ( + trust + or not os.isatty(sys.stdin.fileno()) + or yes_no_question( + 'Is this the version you want to use?', + color="orange", + default=False, + ) + ): + return release_version + + raise Exit(color_message("Aborting.", "red"), code=1) + + +def get_version_major(branch: str) -> int: + """Get the major version from a branch name.""" + + return 7 if branch == 'main' else int(branch.split('.')[0]) + + +def get_all_version_tags(ctx) -> list[str]: + """Returns the tags for all the versions of the Agent in git.""" + + cmd = "bash -c 'git tag | grep -E \"^[0-9]\\.[0-9]+\\.[0-9]+$\"'" + + return ctx.run(cmd, hide=True).stdout.strip().split('\n') + + +def get_next_version_from_branch(ctx, branch: str, as_str: bool = True, next_version: bool = True) -> str | Version: + """Returns the latest version + 1 belonging to a branch. + + Args: + next_version: If True, will return the next tag version, otherwise will return the current tag version. Example: If there are 7.60.0 and 7.60.1 tags, it will return 7.60.2 if next_tag is True, 7.60.1 otherwise. + + Example: + get_latest_version_from_branch("7.55.x") -> Version(7, 55, 4) if there are 7.55.0, 7.55.1, 7.55.2, 7.55.3 tags. + get_latest_version_from_branch("6.99.x") -> Version(6, 99, 0) if there are no 6.99.* tags. + """ + + re_branch = re.compile(r"^([0-9]\.[0-9]+\.)x$") + + try: + matched = re_branch.match(branch).group(1) + except Exception as e: + raise Exit( + f'{color_message("Error:", "red")}: Branch {branch} is not a release branch (should be X.Y.x)', code=1 + ) from e + + tags = [tuple(map(int, tag.split('.'))) for tag in get_all_version_tags(ctx) if tag.startswith(matched)] + versions = sorted(Version(*tag) for tag in tags) + + minor, major = tuple(map(int, branch.split('.')[:2])) + + if next_version: + # Get version after the latest one + version = versions[-1].next_version(bump_patch=True) if versions else Version(minor, major, 0) + else: + # Get current latest version + assert versions, f"No tags found for branch {branch} (expected at least one tag)" + + version = versions[-1] + + return str(version) if as_str else version diff --git a/tasks/licenses.py b/tasks/licenses.py index 79add346ac03b..29bc9accc6efe 100644 --- a/tasks/licenses.py +++ b/tasks/licenses.py @@ -108,7 +108,7 @@ def _verify_unknown_licenses(licenses, licenses_filename): def is_valid_quote(copyright): stack = [] - quotes_to_check = ["'", '"'] + quotes_to_check = ['"'] for c in copyright: if c in quotes_to_check: if stack and stack[-1] == c: diff --git a/tasks/modules.py b/tasks/modules.py index 9d92b5324cd2a..252b40426f037 100644 --- a/tasks/modules.py +++ b/tasks/modules.py @@ -45,7 +45,7 @@ def generate_dummy_package(ctx, folder): try: import_paths = [] for mod in get_default_modules().values(): - if mod.path != "." and mod.should_test() and mod.importable: + if mod.path != "." and mod.should_test(): import_paths.append(mod.import_path) os.mkdir(folder) diff --git a/tasks/new_e2e_tests.py b/tasks/new_e2e_tests.py index 4b0aef5a214a4..74f027afd1582 100644 --- a/tasks/new_e2e_tests.py +++ b/tasks/new_e2e_tests.py @@ -23,7 +23,7 @@ from tasks.libs.common.git import get_commit_sha from tasks.libs.common.go import download_go_dependencies from tasks.libs.common.gomodules import get_default_modules -from tasks.libs.common.utils import REPO_PATH, color_message, running_in_ci +from tasks.libs.common.utils import REPO_PATH, color_message, gitlab_section, running_in_ci from tasks.tools.e2e_stacks import destroy_remote_stack @@ -66,6 +66,9 @@ def run( test_washer=False, agent_image="", cluster_agent_image="", + logs_post_processing=False, + logs_post_processing_test_depth=1, + logs_folder="e2e_logs", ): """ Run E2E Tests based on test-infra-definitions infrastructure provisioning. @@ -108,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", @@ -164,6 +174,27 @@ def run( 'You can also add `E2E_DEV_MODE="true"` to run in dev mode which will leave the environment up after the tests.' ) + if logs_post_processing: + if len(test_res) == 1: + post_processed_output = post_process_output( + test_res[0].result_json_path, test_depth=logs_post_processing_test_depth + ) + + os.makedirs(logs_folder, exist_ok=True) + write_result_to_log_files(post_processed_output, logs_folder) + try: + pretty_print_logs(post_processed_output) + except TooManyLogsError: + print( + color_message("WARNING", "yellow") + + f": Too many logs to print, skipping logs printing to avoid Gitlab collapse. You can find your logs properly organized in the job artifacts: https://gitlab.ddbuild.io/DataDog/datadog-agent/-/jobs/{os.getenv('CI_JOB_ID')}/artifacts/browse/e2e-output/logs/" + ) + else: + print( + color_message("WARNING", "yellow") + + f": Logs post processing expect only test result for test/new-e2e module. Skipping because result contains test for {len(test_res)} modules." + ) + if not success: raise Exit(code=1) @@ -253,6 +284,94 @@ def cleanup_remote_stacks(ctx, stack_regex, pulumi_backend): print(f"Failed to destroy stack {stack}") +def post_process_output(path: str, test_depth: int = 1): + """ + Post process the test results to add the test run name + path: path to the test result json file + test_depth: depth of the test name to consider + + By default the test_depth is set to 1, which means that the logs will be splitted depending on the test suite name. + If we use a single test suite to run multiple tests we can increase the test_depth to split the logs per test. + For example with: + TestPackages/run_ubuntu + TestPackages/run_centos + TestPackages/run_debian + We should set test_depth to 2 to avoid mixing all the logs of the different tested platform + """ + + def is_parent(parent: list[str], child: list[str]) -> bool: + for i in range(len(parent)): + if parent[i] != child[i]: + return False + return True + + logs_per_test = {} + with open(path) as f: + all_lines = f.readlines() + + # Initalize logs_per_test with all test names + for line in all_lines: + json_line = json.loads(line) + if "Package" not in json_line or "Test" not in json_line or "Output" not in json_line: + continue + splitted_test = json_line["Test"].split("/") + if len(splitted_test) < test_depth: + continue + if json_line["Package"] not in logs_per_test: + logs_per_test[json_line["Package"]] = {} + + test_name = splitted_test[: min(test_depth, len(splitted_test))] + logs_per_test[json_line["Package"]]["/".join(test_name)] = [] + + for line in all_lines: + json_line = json.loads(line) + if "Package" not in json_line or "Test" not in json_line or "Output" not in json_line: + continue + + if "===" in json_line["Output"]: # Ignore these lines that are produced when running test concurrently + continue + + splitted_test = json_line["Test"].split("/") + + if len(splitted_test) < test_depth: # Append logs to all children tests + for test_name in logs_per_test[json_line["Package"]]: + if is_parent(splitted_test, test_name.split("/")): + logs_per_test[json_line["Package"]][test_name].append(json_line["Output"]) + continue + + logs_per_test[json_line["Package"]]["/".join(splitted_test[:test_depth])].append(json_line["Output"]) + return logs_per_test + + +def write_result_to_log_files(logs_per_test, log_folder): + for package, tests in logs_per_test.items(): + for test, logs in tests.items(): + sanitized_package_name = re.sub(r"[^\w_. -]", "_", package) + sanitized_test_name = re.sub(r"[^\w_. -]", "_", test) + with open(f"{log_folder}/{sanitized_package_name}.{sanitized_test_name}.log", "w") as f: + f.write("".join(logs)) + + +class TooManyLogsError(Exception): + pass + + +def pretty_print_logs(logs_per_test, max_size=250000): + # Compute size in bytes of what we are about to print. If it exceeds max_size, we skip printing because it will make the Gitlab logs almost completely collapsed. + # By default Gitlab has a limit of 500KB per job log, so we want to avoid printing too much. + size = 0 + for _, tests in logs_per_test.items(): + for _, logs in tests.items(): + size += len("".join(logs).encode()) + if size > max_size and running_in_ci(): + raise TooManyLogsError + for package, tests in logs_per_test.items(): + for test, logs in tests.items(): + with gitlab_section("Complete logs for " + package + "." + test, collapsed=True): + print("Complete logs for " + package + "." + test) + print("".join(logs)) + + @task def deps(ctx, verbose=False): """ diff --git a/tasks/omnibus.py b/tasks/omnibus.py index b93fea751c17d..aa467171f9e18 100644 --- a/tasks/omnibus.py +++ b/tasks/omnibus.py @@ -285,7 +285,7 @@ def build( if use_remote_cache: cache_state = None cache_key = omnibus_compute_cache_key(ctx) - git_cache_url = f"s3://{os.environ['S3_OMNIBUS_CACHE_BUCKET']}/builds/{cache_key}/{remote_cache_name}" + git_cache_url = f"s3://{os.environ['S3_OMNIBUS_GIT_CACHE_BUCKET']}/{cache_key}/{remote_cache_name}" bundle_dir = tempfile.TemporaryDirectory() bundle_path = os.path.join(bundle_dir.name, 'omnibus-git-cache-bundle') with timed(quiet=True) as durations['Restoring omnibus cache']: diff --git a/tasks/package.py b/tasks/package.py index 307624be2f2f2..3a831a24225fc 100644 --- a/tasks/package.py +++ b/tasks/package.py @@ -8,15 +8,13 @@ from tasks.libs.common.git import get_default_branch from tasks.libs.package.size import ( PACKAGE_SIZE_TEMPLATE, - _get_deb_uncompressed_size, - _get_rpm_uncompressed_size, compare, compute_package_size_metrics, ) from tasks.libs.package.utils import ( + PackageSize, display_message, get_ancestor, - get_package_path, list_packages, retrieve_package_sizes, upload_package_sizes, @@ -33,71 +31,33 @@ def check_size(ctx, filename: str = 'package_sizes.json', dry_run: bool = False) if ancestor in package_sizes: # The test already ran on this commit return - package_sizes[ancestor] = PACKAGE_SIZE_TEMPLATE + package_sizes[ancestor] = PACKAGE_SIZE_TEMPLATE.copy() package_sizes[ancestor]['timestamp'] = int(datetime.now().timestamp()) # Check size of packages print( color_message(f"Checking package sizes from {os.environ['CI_COMMIT_REF_NAME']} against {ancestor}", Color.BLUE) ) - size_table = "" + size_table = [] for package_info in list_packages(PACKAGE_SIZE_TEMPLATE): - size_table += f"{compare(ctx, package_sizes, ancestor, *package_info)}\n" + pkg_size = PackageSize(*package_info) + size_table.append(compare(ctx, package_sizes, ancestor, pkg_size)) if on_main: upload_package_sizes(ctx, package_sizes, filename, distant=not dry_run) else: - if "❌" in size_table: + size_table.sort(key=lambda x: (-x.diff, x.flavor, x.arch_name())) + size_message = "".join(f"{pkg_size.markdown()}\n" for pkg_size in size_table) + if "❌" in size_message: decision = "❌ Failed" - elif "⚠️" in size_table: + elif "⚠️" in size_message: decision = "⚠️ Warning" else: decision = "✅ Passed" - display_message(ctx, ancestor, size_table, decision) + display_message(ctx, ancestor, size_message, decision) if "Failed" in decision: raise Exit(code=1) -@task -def compare_size(ctx, new_package, stable_package, package_type, last_stable, threshold): - mb = 1000000 - - if package_type.endswith('deb'): - new_package_size = _get_deb_uncompressed_size(ctx, get_package_path(new_package)) - stable_package_size = _get_deb_uncompressed_size(ctx, get_package_path(stable_package)) - else: - new_package_size = _get_rpm_uncompressed_size(ctx, get_package_path(new_package)) - stable_package_size = _get_rpm_uncompressed_size(ctx, get_package_path(stable_package)) - - threshold = int(threshold) - - diff = new_package_size - stable_package_size - - # For printing purposes - new_package_size_mb = new_package_size / mb - stable_package_size_mb = stable_package_size / mb - threshold_mb = threshold / mb - diff_mb = diff / mb - - if diff > threshold: - print( - color_message( - f"""{package_type} size increase is too large: - New package size is {new_package_size_mb:.2f}MB - Stable package ({last_stable}) size is {stable_package_size_mb:.2f}MB - Diff is {diff_mb:.2f}MB > {threshold_mb:.2f}MB (max allowed diff)""", - "red", - ) - ) - raise Exit(code=1) - - print( - f"""{package_type} size increase is OK: - New package size is {new_package_size_mb:.2f}MB - Stable package ({last_stable}) size is {stable_package_size_mb:.2f}MB - Diff is {diff_mb:.2f}MB (max allowed diff: {threshold_mb:.2f}MB)""" - ) - - @task def send_size( ctx, diff --git a/tasks/pipeline.py b/tasks/pipeline.py index bff7b05b8b1ab..ad825bee1540d 100644 --- a/tasks/pipeline.py +++ b/tasks/pipeline.py @@ -43,11 +43,9 @@ # Tasks to trigger pipelines -def check_deploy_pipeline(repo: Project, git_ref: str, release_version_6, release_version_7, repo_branch): +def check_deploy_pipeline(repo_branch): """ - Run checks to verify a deploy pipeline is valid: - - it targets a valid repo branch - - it has matching Agent 6 and Agent 7 tags (depending on release_version_* values) + Run checks to verify a deploy pipeline is valid (it targets a valid repo branch) """ # Check that the target repo branch is valid @@ -57,41 +55,6 @@ def check_deploy_pipeline(repo: Project, git_ref: str, release_version_6, releas ) raise Exit(code=1) - # - # If git_ref matches v7 pattern and release_version_6 is not empty, make sure Gitlab has v6 tag. - # If git_ref matches v6 pattern and release_version_7 is not empty, make sure Gitlab has v7 tag. - # v7 version pattern should be able to match 7.12.24-rc2 and 7.12.34 - # - v7_pattern = r'^7\.(\d+\.\d+)(-.+|)$' - v6_pattern = r'^6\.(\d+\.\d+)(-.+|)$' - - match = re.match(v7_pattern, git_ref) - - # TODO(@spencergilbert): remove cross reference check when all references to a6 are removed - if release_version_6 and match: - # release_version_6 is not empty and git_ref matches v7 pattern, construct v6 tag and check. - tag_name = "6." + "".join(match.groups()) - try: - repo.tags.get(tag_name) - except GitlabError: - print(f"Cannot find GitLab v6 tag {tag_name} while trying to build git ref {git_ref}") - print("v6 tags are no longer created, this check will be removed in a later commit") - - print(f"Successfully cross checked v6 tag {tag_name} and git ref {git_ref}") - else: - match = re.match(v6_pattern, git_ref) - - if release_version_7 and match: - # release_version_7 is not empty and git_ref matches v6 pattern, construct v7 tag and check. - tag_name = "7." + "".join(match.groups()) - try: - repo.tags.get(tag_name) - except GitlabError as e: - print(f"Cannot find GitLab v7 tag {tag_name} while trying to build git ref {git_ref}") - raise Exit(code=1) from e - - print(f"Successfully cross checked v7 tag {tag_name} and git ref {git_ref}") - @task def clean_running_pipelines(ctx, git_ref=None, here=False, use_latest_sha=False, sha=None): @@ -168,6 +131,9 @@ def auto_cancel_previous_pipelines(ctx): raise Exit("GITLAB_TOKEN variable needed to cancel pipelines on the same ref.", 1) git_ref = os.environ["CI_COMMIT_REF_NAME"] + if git_ref == "": + raise Exit("CI_COMMIT_REF_NAME is empty, skipping pipeline cancellation", 0) + git_sha = os.getenv("CI_COMMIT_SHA") repo = get_gitlab_repo() @@ -292,7 +258,7 @@ def run( if deploy or deploy_installer: # Check the validity of the deploy pipeline - check_deploy_pipeline(repo, git_ref, release_version_6, release_version_7, repo_branch) + check_deploy_pipeline(repo_branch) # Force all builds and e2e tests to be run if not all_builds: print( diff --git a/tasks/release.py b/tasks/release.py index 999230044ea44..c692d5c5a4ffe 100644 --- a/tasks/release.py +++ b/tasks/release.py @@ -34,6 +34,7 @@ get_last_commit, get_last_release_tag, is_agent6, + set_git_config, try_git_command, ) from tasks.libs.common.gomodules import get_default_modules @@ -69,10 +70,11 @@ VERSION_RE, _create_version_from_match, current_version, + deduce_version, + get_version_major, next_final_version, next_rc_version, ) -from tasks.libs.types.version import Version from tasks.pipeline import edit_schedule, run from tasks.release_metrics.metrics import get_prs_metrics, get_release_lead_time @@ -84,63 +86,6 @@ BACKPORT_LABEL_COLOR = "5319e7" -def deduce_and_ask_version(ctx, branch, as_str=True, trust=False) -> str | Version: - release_version = get_next_version_from_branch(ctx, branch, as_str=as_str) - - if trust: - return release_version - - if yes_no_question( - f'Version {release_version} deduced from branch {branch}. Is this the version you want to use?', - color="orange", - default=False, - ): - return release_version - - raise Exit(color_message("Aborting.", "red"), code=1) - - -def get_version_major(branch: str) -> int: - """Get the major version from a branch name.""" - - return 7 if branch == 'main' else int(branch.split('.')[0]) - - -def get_all_version_tags(ctx) -> list[str]: - """Returns the tags for all the versions of the Agent in git.""" - - cmd = "bash -c 'git tag | grep -E \"^[0-9]\\.[0-9]+\\.[0-9]+$\"'" - - return ctx.run(cmd, hide=True).stdout.strip().split('\n') - - -def get_next_version_from_branch(ctx, branch: str, as_str=True) -> str | Version: - """Returns the latest version + 1 belonging to a branch. - - Example: - get_latest_version_from_branch("7.55.x") -> Version(7, 55, 4) if there are 7.55.0, 7.55.1, 7.55.2, 7.55.3 tags. - get_latest_version_from_branch("6.99.x") -> Version(6, 99, 0) if there are no 6.99.* tags. - """ - - re_branch = re.compile(r"^([0-9]\.[0-9]+\.)x$") - - try: - matched = re_branch.match(branch).group(1) - except Exception as e: - raise Exit( - f'{color_message("Error:", "red")}: Branch {branch} is not a release branch (should be X.Y.x)', code=1 - ) from e - - tags = [tuple(map(int, tag.split('.'))) for tag in get_all_version_tags(ctx) if tag.startswith(matched)] - versions = sorted(Version(*tag) for tag in tags) - - minor, major = tuple(map(int, branch.split('.')[:2])) - - latest = versions[-1].next_version(bump_patch=True) if versions else Version(minor, major, 0) - - return str(latest) if as_str else latest - - @task def list_major_change(_, milestone): """List all PR labeled "major_changed" for this release.""" @@ -170,7 +115,7 @@ def update_modules(ctx, release_branch=None, version=None, trust=False): assert release_branch or version - agent_version = version or deduce_and_ask_version(ctx, release_branch, trust=trust) + agent_version = version or deduce_version(ctx, release_branch, trust=trust) with agent_context(ctx, release_branch, skip_checkout=release_branch is None): modules = get_default_modules() @@ -235,7 +180,7 @@ def tag_modules( assert release_branch or version - agent_version = version or deduce_and_ask_version(ctx, release_branch, trust=trust) + agent_version = version or deduce_version(ctx, release_branch, trust=trust) tags = [] with agent_context(ctx, release_branch, skip_checkout=release_branch is None): @@ -274,7 +219,7 @@ def tag_version( assert release_branch or version - agent_version = version or deduce_and_ask_version(ctx, release_branch, trust=trust) + agent_version = version or deduce_version(ctx, release_branch, trust=trust) # Always tag the main module force_option = __get_force_option(force) @@ -427,11 +372,16 @@ def create_rc(ctx, release_branch, patch_version=False, upstream="origin", slack This also requires that there are no local uncommitted changes, that the current branch is 'main' or the release branch, and that no branch named 'release/' already exists locally or upstream. """ - major_version = get_version_major(release_branch) with agent_context(ctx, release_branch): github = GithubAPI(repository=GITHUB_REPO_NAME) + github_action = os.environ.get("GITHUB_ACTIONS") + + if github_action: + set_git_config('user.name', 'github-actions[bot]') + set_git_config('user.email', 'github-actions[bot]@users.noreply.github.com') + upstream = f"https://x-access-token:{os.environ.get('GITHUB_TOKEN')}@github.com/{GITHUB_REPO_NAME}.git" # Get the version of the highest major: useful for some logging & to get # the version to use for Go submodules updates @@ -463,12 +413,6 @@ def create_rc(ctx, release_branch, patch_version=False, upstream="origin", slack # Step 1: Update release entries print(color_message("Updating release entries", "bold")) new_version = next_rc_version(ctx, major_version, patch_version) - if not yes_no_question( - f'Do you want to create release candidate with:\n- new version: {new_version}\n- new highest version: {new_highest_version}\n- new final version: {new_final_version}?', - color="bold", - default=False, - ): - raise Exit(color_message("Aborting.", "red"), code=1) update_release_json(new_version, new_final_version) @@ -492,7 +436,9 @@ def create_rc(ctx, release_branch, patch_version=False, upstream="origin", slack ctx.run("git ls-files . | grep 'go.mod$' | xargs git add") ok = try_git_command( - ctx, f"git commit --no-verify -m 'Update release.json and Go modules for {new_highest_version}'" + ctx, + f"git commit --no-verify -m 'Update release.json and Go modules for {new_highest_version}'", + github_action, ) if not ok: raise Exit( @@ -620,7 +566,7 @@ def build_rc(ctx, release_branch, patch_version=False, k8s_deployments=False): @task(help={'key': "Path to an existing release.json key, separated with double colons, eg. 'last_stable::6'"}) -def set_release_json(ctx, key, value, release_branch=None, skip_checkout=False, worktree=True): +def set_release_json(ctx, key, value, release_branch=None, skip_checkout=False, worktree=False): def _main(): nonlocal key @@ -724,10 +670,8 @@ def create_release_branches(ctx, base_directory="~/dd", major_version: int = 7, github = GithubAPI(repository=GITHUB_REPO_NAME) current = current_version(ctx, major_version) - next = current.next_version(bump_minor=True) current.rc = False current.devel = False - next.devel = False # Strings with proper branch/tag names release_branch = current.branch() @@ -765,43 +709,7 @@ def create_release_branches(ctx, base_directory="~/dd", major_version: int = 7, ) # Step 2 - Create PRs with new settings in datadog-agent repository - # Step 2.0 - Create milestone update - milestone_branch = f"release_milestone-{int(time.time())}" - ctx.run(f"git switch -c {milestone_branch}") - rj = load_release_json() - rj["current_milestone"] = f"{next}" - _save_release_json(rj) - # Commit release.json - ctx.run("git add release.json") - ok = try_git_command(ctx, f"git commit -m 'Update release.json with current milestone to {next}'") - - if not ok: - raise Exit( - color_message( - f"Could not create commit. Please commit manually and push the commit to the {milestone_branch} branch.", - "red", - ), - code=1, - ) - - res = ctx.run(f"git push --set-upstream {upstream} {milestone_branch}", warn=True) - if res.exited is None or res.exited > 0: - raise Exit( - color_message( - f"Could not push branch {milestone_branch} to the upstream '{upstream}'. Please push it manually and then open a PR against {release_branch}.", - "red", - ), - code=1, - ) - - create_release_pr( - f"[release] Update current milestone to {next}", - get_default_branch(), - milestone_branch, - next, - ) - - # Step 2.1 - Update release.json + # Step 2.0 - Update release.json update_branch = f"{release_branch}-updates" ctx.run(f"git checkout {release_branch}") @@ -868,10 +776,6 @@ def _update_last_stable(_, version, major_version: int = 7): return release_json["current_milestone"] -def _get_agent6_latest_release(gh): - return max((r for r in gh.get_releases() if r.title.startswith('6.53')), key=lambda r: r.created_at).title - - @task def cleanup(ctx, release_branch): """Perform the post release cleanup steps @@ -881,13 +785,13 @@ def cleanup(ctx, release_branch): - Updates the release.json last_stable fields """ - with agent_context(ctx, release_branch): + # This task will create a PR to update the last_stable field in release.json + # It must create the PR against the default branch (6 or 7), so setting the context on it + main_branch = get_default_branch() + with agent_context(ctx, main_branch): gh = GithubAPI() major_version = get_version_major(release_branch) - if major_version == 6: - latest_release = _get_agent6_latest_release(gh) - else: - latest_release = gh.latest_release() + latest_release = gh.latest_release(major_version) match = VERSION_RE.search(latest_release) if not match: raise Exit(f'Unexpected version fetched from github {latest_release}', code=1) @@ -896,7 +800,6 @@ def cleanup(ctx, release_branch): current_milestone = _update_last_stable(ctx, version, major_version=major_version) # create pull request to update last stable version - main_branch = get_default_branch() cleanup_branch = f"release/{version}-cleanup" ctx.run(f"git checkout -b {cleanup_branch}") ctx.run("git add release.json") @@ -1065,7 +968,7 @@ def get_active_release_branch(ctx, release_branch): with agent_context(ctx, branch=release_branch): gh = GithubAPI() - next_version = get_next_version(gh, latest_release=_get_agent6_latest_release(gh) if is_agent6(ctx) else None) + next_version = get_next_version(gh, latest_release=gh.latest_release(6) if is_agent6(ctx) else None) release_branch = gh.get_branch(next_version.branch()) if release_branch: print(f"{release_branch.name}") @@ -1126,12 +1029,13 @@ def generate_release_metrics(ctx, milestone, freeze_date, release_date): print(code_stats) +# TODO rename to freeze_date to cutoff_date @task def create_schedule(_, version, freeze_date): """Create confluence pages for the release schedule. Args: - freeze_date: Date when the code freeze was started. Expected format YYYY-MM-DD, like '2022-02-01' + freeze_date: Date when the code cut-off happened. Expected format YYYY-MM-DD, like '2022-02-01' """ required_environment_variables = ["ATLASSIAN_USERNAME", "ATLASSIAN_PASSWORD"] @@ -1257,7 +1161,7 @@ def create_github_release(ctx, release_branch, draft=True): ) notes = [] - version = deduce_and_ask_version(ctx, release_branch) + version = deduce_version(ctx, release_branch, next_version=False) with agent_context(ctx, release_branch): for section, filename in sections: @@ -1296,3 +1200,63 @@ def create_github_release(ctx, release_branch, draft=True): ) print(f"Link to the release note: {release.html_url}") + + +@task +def update_current_milestone(ctx, major_version: int = 7, upstream="origin"): + """ + Create a PR to bump the current_milestone in the release.json file + """ + import github + + gh = GithubAPI() + + current = current_version(ctx, major_version) + next = current.next_version(bump_minor=True) + next.devel = False + + print(f"Creating the {next} milestone...") + + try: + gh.create_milestone(str(next)) + except github.GithubException as e: + if e.status == 422: + print(f"Milestone {next} already exists") + else: + raise e + + with agent_context(ctx, get_default_branch(major=major_version)): + milestone_branch = f"release_milestone-{int(time.time())}" + ctx.run(f"git switch -c {milestone_branch}") + rj = load_release_json() + rj["current_milestone"] = f"{next}" + _save_release_json(rj) + # Commit release.json + ctx.run("git add release.json") + ok = try_git_command(ctx, f"git commit -m 'Update release.json with current milestone to {next}'") + + if not ok: + raise Exit( + color_message( + f"Could not create commit. Please commit manually and push the commit to the {milestone_branch} branch.", + Color.RED, + ), + code=1, + ) + + res = ctx.run(f"git push --set-upstream {upstream} {milestone_branch}", warn=True) + if res.exited is None or res.exited > 0: + raise Exit( + color_message( + f"Could not push branch {milestone_branch} to the upstream '{upstream}'. Please push it manually and then open a PR against main.", + Color.RED, + ), + code=1, + ) + + create_release_pr( + f"[release] Update current milestone to {next}", + get_default_branch(), + milestone_branch, + next, + ) diff --git a/tasks/setup.py b/tasks/setup.py index 5e1eeee98d1f1..cf75c396f5779 100644 --- a/tasks/setup.py +++ b/tasks/setup.py @@ -19,7 +19,7 @@ from tasks.libs.common.color import Color, color_message from tasks.libs.common.git import get_default_branch from tasks.libs.common.status import Status -from tasks.libs.common.utils import running_in_pyapp +from tasks.libs.common.utils import is_linux, is_windows, running_in_pyapp if TYPE_CHECKING: from collections.abc import Generator @@ -145,10 +145,15 @@ def check_python_version(_ctx) -> SetupResult: status = Status.OK if tuple(sys.version_info)[:2] != tuple(int(d) for d in expected_version.split(".")): status = Status.FAIL - message = ( - f"Python version is {sys.version_info[0]}.{sys.version_info[1]}.{sys.version_info[2]}. " - "Please update your environment: https://datadoghq.dev/datadog-agent/setup/#python-dependencies" - ) + install_message = f"Please install Python {expected_version} with 'brew install python@{expected_version}'" + if is_windows(): + install_message = f"Please install Python {expected_version} from https://www.python.org/downloads/windows/" + elif is_linux(): + install_message = ( + f"Please install Python {expected_version} with 'sudo apt-get install python{expected_version}-dev'" + ) + + message = f"Python version out of date, current is {sys.version_info[0]}.{sys.version_info[1]} while expected is {expected_version}.\n{install_message}" return SetupResult("Check Python version", status, message) diff --git a/tasks/system_probe.py b/tasks/system_probe.py index 6f8e4e1f7457e..45e2c249552a6 100644 --- a/tasks/system_probe.py +++ b/tasks/system_probe.py @@ -525,7 +525,7 @@ def ninja_cgo_type_files(nw: NinjaWriter): "pkg/ebpf/types.go": [ "pkg/ebpf/c/lock_contention.h", ], - "pkg/dynamicinstrumentation/ditypes/ebpf.go": ["pkg/dynamicinstrumentation/codegen/c/types.h"], + "pkg/dynamicinstrumentation/ditypes/ebpf.go": ["pkg/dynamicinstrumentation/codegen/c/base_event.h"], "pkg/gpu/ebpf/kprobe_types.go": [ "pkg/gpu/ebpf/c/types.h", ], @@ -2024,3 +2024,40 @@ def copy_ebpf_and_related_files(ctx: Context, target: Path | str, arch: Arch | N ctx.run(f"chmod 0444 {target}/*.o {target}/*.c {target}/co-re/*.o") ctx.run(f"cp /opt/datadog-agent/embedded/bin/clang-bpf {target}") ctx.run(f"cp /opt/datadog-agent/embedded/bin/llc-bpf {target}") + + +@task +def build_usm_debugger( + ctx, + arch: str = CURRENT_ARCH, + strip_binary=False, +): + build_object_files(ctx) + + build_dir = os.path.join("pkg", "ebpf", "bytecode", "build", arch) + + # copy compilation artifacts to the debugger root directory for the purposes of embedding + usm_programs = [ + os.path.join(build_dir, "co-re", "usm-debug.o"), + os.path.join(build_dir, "co-re", "shared-libraries-debug.o"), + ] + + embedded_dir = os.path.join(".", "pkg", "network", "usm", "debugger", "cmd") + + for p in usm_programs: + print(p) + shutil.copy(p, embedded_dir) + + arch_obj = Arch.from_str(arch) + ldflags, gcflags, env = get_build_flags(ctx, arch=arch_obj) + + cmd = 'go build -tags="linux_bpf,usm_debugger" -o bin/usm-debugger -ldflags="{ldflags}" ./pkg/network/usm/debugger/cmd/' + + if strip_binary: + ldflags += ' -s -w' + + args = { + "ldflags": ldflags, + } + + ctx.run(cmd.format(**args), env=env) 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/tasks/trace_agent.py b/tasks/trace_agent.py index d65ae6861fcd8..0ec1dd1956aa8 100644 --- a/tasks/trace_agent.py +++ b/tasks/trace_agent.py @@ -5,7 +5,8 @@ from tasks.build_tags import add_fips_tags, filter_incompatible_tags, get_build_tags, get_default_build_tags from tasks.flavor import AgentFlavor -from tasks.libs.common.utils import REPO_PATH, TestsNotSupportedError, bin_name, get_build_flags +from tasks.gointegrationtest import TRACE_AGENT_IT_CONF, containerized_integration_tests +from tasks.libs.common.utils import REPO_PATH, bin_name, get_build_flags from tasks.windows_resources import build_messagetable, build_rc, versioninfo_vars BIN_PATH = os.path.join(".", "bin", "trace-agent") @@ -81,15 +82,14 @@ def integration_tests(ctx, race=False, go_mod="readonly", timeout="10m"): """ Run integration tests for trace agent """ - if sys.platform == 'win32': - raise TestsNotSupportedError('Trace Agent integration tests are not supported on Windows') - - go_build_tags = " ".join(get_default_build_tags(build="test")) - race_opt = "-race" if race else "" - timeout_opt = f"-timeout {timeout}" if timeout else "" - - go_cmd = f'go test {timeout_opt} -mod={go_mod} {race_opt} -v -tags "{go_build_tags}"' - ctx.run(f"{go_cmd} ./cmd/trace-agent/test/testsuite/...", env={"INTEGRATION": "yes"}) + containerized_integration_tests( + ctx, + TRACE_AGENT_IT_CONF, + race=race, + remote_docker=False, + go_mod=go_mod, + timeout=timeout, + ) @task diff --git a/tasks/unit_tests/components_tests.py b/tasks/unit_tests/components_tests.py index e5d02cab45530..b6b29acc68164 100644 --- a/tasks/unit_tests/components_tests.py +++ b/tasks/unit_tests/components_tests.py @@ -214,6 +214,7 @@ def test_validate_component_implementation(self): implfolder = os.path.join(comps[3].path, 'impl') newfolder = os.path.join(comps[3].path, 'impl-alt') + replace_line(filename, 'package newstyleimpl', 'package altimpl') shutil.move(implfolder, newfolder) comps, _ = components.get_components_and_bundles() diff --git a/tasks/unit_tests/modules_tests.py b/tasks/unit_tests/modules_tests.py index 876f10b5c6ede..d2d41d726d175 100644 --- a/tasks/unit_tests/modules_tests.py +++ b/tasks/unit_tests/modules_tests.py @@ -133,7 +133,6 @@ def test_to_dict(self): lint_targets=['.'], should_test_condition='always', should_tag=True, - importable=True, independent=True, used_by_otel=True, ) @@ -159,7 +158,6 @@ def test_from_dict(self): 'lint_targets': ['.'], 'should_test_condition': 'always', 'should_tag': True, - 'importable': True, 'independent': True, 'used_by_otel': True, } @@ -185,7 +183,6 @@ def test_from_to(self): 'lint_targets': ['.'], 'should_test_condition': 'always', 'should_tag': True, - 'importable': True, 'independent': True, 'used_by_otel': True, 'legacy_go_mod_version': None, diff --git a/tasks/unit_tests/omnibus_tests.py b/tasks/unit_tests/omnibus_tests.py index cf22abaf2623d..4886304f2ea7a 100644 --- a/tasks/unit_tests/omnibus_tests.py +++ b/tasks/unit_tests/omnibus_tests.py @@ -40,7 +40,7 @@ def _run_calls_to_string(mock_calls): 'CI_PROJECT_DIR': '', 'CI_PIPELINE_ID': '', 'RELEASE_VERSION_7': 'nightly', - 'S3_OMNIBUS_CACHE_BUCKET': 'omnibus-cache', + 'S3_OMNIBUS_GIT_CACHE_BUCKET': 'omnibus-cache', 'API_KEY_ORG2': 'api-key', 'AGENT_API_KEY_ORG2': 'agent-api-key', }, @@ -89,7 +89,7 @@ def test_successful_cache_hit(self): self.assertRunLines( [ # We copied the cache from remote cache - r'aws s3 cp (\S* )?s3://omnibus-cache/builds/\w+/slug \S+/omnibus-git-cache-bundle', + r'aws s3 cp (\S* )?s3://omnibus-cache/\w+/slug \S+/omnibus-git-cache-bundle', # We cloned the repo r'git clone --mirror /\S+/omnibus-git-cache-bundle omnibus-git-cache/opt/datadog-agent', # We listed the tags to get current cache state @@ -104,7 +104,7 @@ def test_successful_cache_hit(self): commands = _run_calls_to_string(self.mock_ctx.run.mock_calls) lines = [ r'git -C omnibus-git-cache/opt/datadog-agent bundle create /\S+/omnibus-git-cache-bundle --tags', - r'aws s3 cp (\S* )?/\S+/omnibus-git-cache-bundle s3://omnibus-cache/builds/\w+/slug', + r'aws s3 cp (\S* )?/\S+/omnibus-git-cache-bundle s3://omnibus-cache/\w+/slug', ] for line in lines: self.assertIsNone(re.search(line, commands)) @@ -112,7 +112,7 @@ def test_successful_cache_hit(self): def test_cache_miss(self): self.mock_ctx.set_result_for( 'run', - re.compile(r'aws s3 cp (\S* )?s3://omnibus-cache/builds/\S* /\S+/omnibus-git-cache-bundle'), + re.compile(r'aws s3 cp (\S* )?s3://omnibus-cache/\S* /\S+/omnibus-git-cache-bundle'), Result(exited=1), ) self.mock_ctx.set_result_for( @@ -147,7 +147,7 @@ def test_cache_miss(self): r'git -C omnibus-git-cache/opt/datadog-agent tag -l', # And we created and uploaded the new cache r'git -C omnibus-git-cache/opt/datadog-agent bundle create /\S+/omnibus-git-cache-bundle --tags', - r'aws s3 cp (\S* )?/\S+/omnibus-git-cache-bundle s3://omnibus-cache/builds/\w+/slug', + r'aws s3 cp (\S* )?/\S+/omnibus-git-cache-bundle s3://omnibus-cache/\w+/slug', ], ) diff --git a/tasks/unit_tests/package_lib_tests.py b/tasks/unit_tests/package_lib_tests.py index 57816701fd07c..72f3c6c190252 100644 --- a/tasks/unit_tests/package_lib_tests.py +++ b/tasks/unit_tests/package_lib_tests.py @@ -6,13 +6,12 @@ from invoke import MockContext, Result from tasks.libs.package.size import ( - PACKAGE_SIZE_TEMPLATE, SCANNED_BINARIES, _get_uncompressed_size, compare, compute_package_size_metrics, ) -from tasks.libs.package.utils import get_ancestor, list_packages +from tasks.libs.package.utils import PackageSize, get_ancestor, list_packages class TestProduceSizeStats(unittest.TestCase): @@ -167,6 +166,28 @@ def test_get_suse_uncompressed_size(self): self.assertEqual(_get_uncompressed_size(c, flavor, 'suse'), 69) +class TestPackageSizeMethods(unittest.TestCase): + def test_markdown_row(self): + size = PackageSize("amd64", "datadog-agent", "deb", 70000000) + size.compare(67000000, 68000000) + self.assertEqual("|datadog-agent-amd64-deb|-1.00MB|✅|67.00MB|68.00MB|70.00MB|", size.markdown()) + + @patch.dict('os.environ', {'OMNIBUS_PACKAGE_DIR': 'root'}) + def test_path_deb(self): + size = PackageSize("amd64", "datadog-agent", "deb", 70000000) + self.assertEqual("root/datadog-agent_7*amd64.deb", size.path()) + + @patch.dict('os.environ', {'OMNIBUS_PACKAGE_DIR': 'root'}) + def test_path_rpm(self): + size = PackageSize("x86_64", "datadog-agent", "rpm", 70000000) + self.assertEqual("root/datadog-agent-7*x86_64.rpm", size.path()) + + @patch.dict('os.environ', {'OMNIBUS_PACKAGE_DIR_SUSE': 'rout'}) + def test_path_suse(self): + size = PackageSize("x86_64", "datadog-agent", "suse", 70000000) + self.assertEqual("rout/datadog-agent-7*x86_64.rpm", size.path()) + + class TestCompare(unittest.TestCase): package_sizes = {} pkg_root = 'tasks/unit_tests/testdata/packages' @@ -181,6 +202,7 @@ def setUp(self) -> None: @patch('builtins.print') def test_on_main(self, mock_print): flavor, arch, os_name = 'datadog-heroku-agent', 'amd64', 'deb' + s = PackageSize(arch, flavor, os_name, 2001) c = MockContext( run={ 'git merge-base HEAD origin/main': Result('12345'), @@ -189,9 +211,9 @@ def test_on_main(self, mock_print): ), } ) - self.package_sizes['12345'] = PACKAGE_SIZE_TEMPLATE + self.package_sizes['12345'] = {arch: {flavor: {os_name: 70000000}}} self.assertEqual(self.package_sizes['12345'][arch][flavor][os_name], 70000000) - res = compare(c, self.package_sizes, '12345', arch, flavor, os_name, 2001) + res = compare(c, self.package_sizes, '12345', s) self.assertIsNone(res) self.assertEqual(self.package_sizes['12345'][arch][flavor][os_name], 43008) mock_print.assert_not_called() @@ -203,16 +225,37 @@ def test_on_main(self, mock_print): @patch('builtins.print') def test_on_branch_warning(self, mock_print): flavor, arch, os_name = 'datadog-agent', 'aarch64', 'suse' + s = PackageSize(arch, flavor, os_name, 70000000) c = MockContext( run={ 'git merge-base HEAD origin/main': Result('25'), f"rpm -qip {self.pkg_root}/{flavor}-7.{arch}.rpm | grep Size | cut -d : -f 2 | xargs": Result(69000000), } ) - res = compare(c, self.package_sizes, '25', arch, flavor, os_name, 70000000) - self.assertEqual(res, "|datadog-agent-aarch64-suse|1.00MB|⚠️|69.00MB|68.00MB|70.00MB|") + res = compare(c, self.package_sizes, '25', s) + self.assertEqual(res.markdown(), "|datadog-agent-aarch64-suse|1.00MB|⚠️|69.00MB|68.00MB|70.00MB|") + mock_print.assert_called_with( + f"⚠️ - {flavor}-{arch}-{os_name} size 69.00MB: 1.00MB diff[1000000] with previous 68.00MB (max: 70.00MB)" + ) + + @patch.dict( + 'os.environ', + {'OMNIBUS_PACKAGE_DIR_SUSE': 'tasks/unit_tests/testdata/packages', 'CI_COMMIT_REF_NAME': 'pikachu'}, + ) + @patch('builtins.print') + def test_on_branch_ok_small_diff(self, mock_print): + flavor, arch, os_name = 'datadog-agent', 'aarch64', 'suse' + s = PackageSize(arch, flavor, os_name, 70000000) + c = MockContext( + run={ + 'git merge-base HEAD origin/main': Result('25'), + f"rpm -qip {self.pkg_root}/{flavor}-7.{arch}.rpm | grep Size | cut -d : -f 2 | xargs": Result(68004999), + } + ) + res = compare(c, self.package_sizes, '25', s) + self.assertEqual(res.markdown(), "|datadog-agent-aarch64-suse|0.00MB|✅|68.00MB|68.00MB|70.00MB|") mock_print.assert_called_with( - f"{flavor}-{arch}-{os_name} size 69.00MB is OK: 1.00MB diff with previous 68.00MB (max: 70.00MB)" + f"✅ - {flavor}-{arch}-{os_name} size 68.00MB: 0.00MB diff[4999] with previous 68.00MB (max: 70.00MB)" ) @patch.dict( @@ -221,6 +264,7 @@ def test_on_branch_warning(self, mock_print): @patch('builtins.print') def test_on_branch_ok_rpm(self, mock_print): flavor, arch, os_name = 'datadog-iot-agent', 'x86_64', 'rpm' + s = PackageSize(arch, flavor, os_name, 70000000) c = MockContext( run={ 'git merge-base HEAD origin/main': Result('25'), @@ -229,10 +273,10 @@ def test_on_branch_ok_rpm(self, mock_print): ), } ) - res = compare(c, self.package_sizes, '25', arch, flavor, os_name, 70000000) - self.assertEqual(res, "|datadog-iot-agent-x86_64-rpm|-9.00MB|✅|69.00MB|78.00MB|70.00MB|") + res = compare(c, self.package_sizes, '25', s) + self.assertEqual(res.markdown(), "|datadog-iot-agent-x86_64-rpm|-9.00MB|✅|69.00MB|78.00MB|70.00MB|") mock_print.assert_called_with( - f"{flavor}-{arch}-{os_name} size 69.00MB is OK: -9.00MB diff with previous 78.00MB (max: 70.00MB)" + f"✅ - {flavor}-{arch}-{os_name} size 69.00MB: -9.00MB diff[-9000000] with previous 78.00MB (max: 70.00MB)" ) @patch.dict( @@ -242,6 +286,7 @@ def test_on_branch_ok_rpm(self, mock_print): @patch('builtins.print') def test_on_branch_ko(self, mock_print): flavor, arch, os_name = 'datadog-agent', 'aarch64', 'suse' + s = PackageSize(arch, flavor, os_name, 70000000) c = MockContext( run={ 'git merge-base HEAD origin/main': Result('25'), @@ -250,9 +295,9 @@ def test_on_branch_ko(self, mock_print): ), } ) - res = compare(c, self.package_sizes, '25', arch, flavor, os_name, 70000000) - self.assertEqual(res, "|datadog-agent-aarch64-suse|71.00MB|❌|139.00MB|68.00MB|70.00MB|") + res = compare(c, self.package_sizes, '25', s) + self.assertEqual(res.markdown(), "|datadog-agent-aarch64-suse|71.00MB|❌|139.00MB|68.00MB|70.00MB|") mock_print.assert_called_with( - "\x1b[91mdatadog-agent-aarch64-suse size 139.00MB is too large: 71.00MB diff with previous 68.00MB (max: 70.00MB)\x1b[0m", + "\x1b[91m❌ - datadog-agent-aarch64-suse size 139.00MB: 71.00MB diff[71000000] with previous 68.00MB (max: 70.00MB)\x1b[0m", file=sys.stderr, ) diff --git a/tasks/unit_tests/package_tests.py b/tasks/unit_tests/package_tests.py index b1698695b8e5e..1c7e0c47dc249 100644 --- a/tasks/unit_tests/package_tests.py +++ b/tasks/unit_tests/package_tests.py @@ -16,19 +16,25 @@ class TestCheckSize(unittest.TestCase): 'CI_COMMIT_REF_NAME': 'pikachu', }, ) - @patch('tasks.libs.package.size.get_package_path', new=MagicMock(return_value='datadog-agent')) - @patch('tasks.package.display_message', new=MagicMock()) - def test_dev_branch_ko(self): + @patch('tasks.libs.package.size.find_package', new=MagicMock(return_value='datadog-agent')) + @patch('tasks.package.display_message') + def test_dev_branch_ko(self, display_mock): flavor = 'datadog-agent' c = MockContext( run={ 'git merge-base HEAD origin/main': Result('25'), f"dpkg-deb --info {flavor} | grep Installed-Size | cut -d : -f 2 | xargs": Result(42), - f"rpm -qip {flavor} | grep Size | cut -d : -f 2 | xargs": Result(69000000), + f"rpm -qip {flavor} | grep Size | cut -d : -f 2 | xargs": Result(141000000), } ) with self.assertRaises(Exit): check_size(c, filename='tasks/unit_tests/testdata/package_sizes_real.json', dry_run=True) + display_mock.assert_called_with( + c, + '12345', + '|datadog-dogstatsd-x86_64-rpm|131.00MB|❌|141.00MB|10.00MB|10.00MB|\n|datadog-dogstatsd-x86_64-suse|131.00MB|❌|141.00MB|10.00MB|10.00MB|\n|datadog-iot-agent-x86_64-rpm|131.00MB|❌|141.00MB|10.00MB|10.00MB|\n|datadog-iot-agent-x86_64-suse|131.00MB|❌|141.00MB|10.00MB|10.00MB|\n|datadog-iot-agent-aarch64-rpm|131.00MB|❌|141.00MB|10.00MB|10.00MB|\n|datadog-agent-x86_64-rpm|1.00MB|⚠️|141.00MB|140.00MB|140.00MB|\n|datadog-agent-x86_64-suse|1.00MB|⚠️|141.00MB|140.00MB|140.00MB|\n|datadog-agent-aarch64-rpm|1.00MB|⚠️|141.00MB|140.00MB|140.00MB|\n|datadog-dogstatsd-amd64-deb|-9.96MB|✅|0.04MB|10.00MB|10.00MB|\n|datadog-dogstatsd-arm64-deb|-9.96MB|✅|0.04MB|10.00MB|10.00MB|\n|datadog-iot-agent-amd64-deb|-9.96MB|✅|0.04MB|10.00MB|10.00MB|\n|datadog-iot-agent-arm64-deb|-9.96MB|✅|0.04MB|10.00MB|10.00MB|\n|datadog-heroku-agent-amd64-deb|-69.96MB|✅|0.04MB|70.00MB|70.00MB|\n|datadog-agent-amd64-deb|-139.96MB|✅|0.04MB|140.00MB|140.00MB|\n|datadog-agent-arm64-deb|-139.96MB|✅|0.04MB|140.00MB|140.00MB|\n', + '❌ Failed', + ) @patch('builtins.print') @patch.dict( @@ -39,7 +45,7 @@ def test_dev_branch_ko(self): 'CI_COMMIT_REF_NAME': 'pikachu', }, ) - @patch('tasks.libs.package.size.get_package_path', new=MagicMock(return_value='datadog-agent')) + @patch('tasks.libs.package.size.find_package', new=MagicMock(return_value='datadog-agent')) @patch('tasks.package.display_message', new=MagicMock()) @patch('tasks.package.upload_package_sizes') def test_dev_branch_ok(self, upload_mock, print_mock): @@ -64,7 +70,7 @@ def test_dev_branch_ok(self, upload_mock, print_mock): 'CI_COMMIT_REF_NAME': 'main', }, ) - @patch('tasks.libs.package.size.get_package_path', new=MagicMock(return_value='datadog-agent')) + @patch('tasks.libs.package.size.find_package', new=MagicMock(return_value='datadog-agent')) @patch('tasks.package.display_message', new=MagicMock()) def test_main_branch_ok(self): flavor = 'datadog-agent' diff --git a/tasks/unit_tests/testdata/collector/awscontainerinsightreceiver_manifest.yaml b/tasks/unit_tests/testdata/collector/awscontainerinsightreceiver_manifest.yaml index 874909021b9bd..8bdd044b92298 100644 --- a/tasks/unit_tests/testdata/collector/awscontainerinsightreceiver_manifest.yaml +++ b/tasks/unit_tests/testdata/collector/awscontainerinsightreceiver_manifest.yaml @@ -3,10 +3,10 @@ dist: description: Manifest that contains awscontainerinsight receiver (should fail collector_tests.py) extensions: - - gomod: go.opentelemetry.io/collector/extension/zpagesextension v0.114.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/healthcheckextension v0.114.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/pprofextension v0.114.0 + - gomod: go.opentelemetry.io/collector/extension/zpagesextension v0.115.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/healthcheckextension v0.115.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/pprofextension v0.115.0 receivers: - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awscontainerinsightreceiver v0.114.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusreceiver v0.114.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awscontainerinsightreceiver v0.115.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusreceiver v0.115.0 diff --git a/tasks/unit_tests/testdata/collector/datadogconnector_manifest.yaml b/tasks/unit_tests/testdata/collector/datadogconnector_manifest.yaml index 89aaab438f3b2..6789bc23b3fc3 100644 --- a/tasks/unit_tests/testdata/collector/datadogconnector_manifest.yaml +++ b/tasks/unit_tests/testdata/collector/datadogconnector_manifest.yaml @@ -3,12 +3,12 @@ dist: description: Manifest that contains datadog connector (should get stripped and pass collector_tests.py) extensions: - - gomod: go.opentelemetry.io/collector/extension/zpagesextension v0.114.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/healthcheckextension v0.114.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/pprofextension v0.114.0 + - gomod: go.opentelemetry.io/collector/extension/zpagesextension v0.115.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/healthcheckextension v0.115.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/pprofextension v0.115.0 receivers: - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusreceiver v0.114.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusreceiver v0.115.0 connectors: - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/connector/datadogconnector v0.114.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/connector/datadogconnector v0.115.0 diff --git a/tasks/unit_tests/testdata/collector/datadogexporter_manifest.yaml b/tasks/unit_tests/testdata/collector/datadogexporter_manifest.yaml index 9b95b7df0d6a8..3a96edc271b5a 100644 --- a/tasks/unit_tests/testdata/collector/datadogexporter_manifest.yaml +++ b/tasks/unit_tests/testdata/collector/datadogexporter_manifest.yaml @@ -3,12 +3,12 @@ dist: description: Manifest that contains datadog exporter (should get stripped and pass collector_tests.py) extensions: - - gomod: go.opentelemetry.io/collector/extension/zpagesextension v0.114.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/healthcheckextension v0.114.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/pprofextension v0.114.0 + - gomod: go.opentelemetry.io/collector/extension/zpagesextension v0.115.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/healthcheckextension v0.115.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/pprofextension v0.115.0 exporters: - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/datadogexporter v0.114.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/datadogexporter v0.115.0 receivers: - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusreceiver v0.114.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusreceiver v0.115.0 diff --git a/tasks/unit_tests/testdata/collector/healthcheckextension_manifest.yaml b/tasks/unit_tests/testdata/collector/healthcheckextension_manifest.yaml index 7555406e42bba..848c2e22024c4 100644 --- a/tasks/unit_tests/testdata/collector/healthcheckextension_manifest.yaml +++ b/tasks/unit_tests/testdata/collector/healthcheckextension_manifest.yaml @@ -3,8 +3,8 @@ dist: description: Manifest that does not contain health check extension (should fail collector_tests.py) extensions: - - gomod: go.opentelemetry.io/collector/extension/zpagesextension v0.114.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/pprofextension v0.114.0 + - gomod: go.opentelemetry.io/collector/extension/zpagesextension v0.115.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/pprofextension v0.115.0 receivers: - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusreceiver v0.114.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusreceiver v0.115.0 diff --git a/tasks/unit_tests/testdata/collector/mismatched_versions_manifest.yaml b/tasks/unit_tests/testdata/collector/mismatched_versions_manifest.yaml index b2e8423416320..a4f2fb7829030 100644 --- a/tasks/unit_tests/testdata/collector/mismatched_versions_manifest.yaml +++ b/tasks/unit_tests/testdata/collector/mismatched_versions_manifest.yaml @@ -1,12 +1,12 @@ --- dist: description: Manifest that has mismatched otelcol and component versions (should fail collector_tests.py) - otelcol_version: 0.114.0 + otelcol_version: 0.115.0 extensions: - gomod: go.opentelemetry.io/collector/extension/zpagesextension v0.99.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/healthcheckextension v0.114.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/pprofextension v0.114.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/healthcheckextension v0.115.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/pprofextension v0.115.0 receivers: - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusreceiver v0.114.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusreceiver v0.115.0 diff --git a/tasks/unit_tests/testdata/collector/pprofextension_manifest.yaml b/tasks/unit_tests/testdata/collector/pprofextension_manifest.yaml index d7dccca404219..82bb7e9059be7 100644 --- a/tasks/unit_tests/testdata/collector/pprofextension_manifest.yaml +++ b/tasks/unit_tests/testdata/collector/pprofextension_manifest.yaml @@ -3,8 +3,8 @@ dist: description: Manifest that does not contain pprof extension (should fail collector_tests.py) extensions: - - gomod: go.opentelemetry.io/collector/extension/zpagesextension v0.114.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/healthcheckextension v0.114.0 + - gomod: go.opentelemetry.io/collector/extension/zpagesextension v0.115.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/healthcheckextension v0.115.0 receivers: - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusreceiver v0.114.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusreceiver v0.115.0 diff --git a/tasks/unit_tests/testdata/collector/prometheusreceiver_manifest.yaml b/tasks/unit_tests/testdata/collector/prometheusreceiver_manifest.yaml index 5b019879cc656..02b932462e778 100644 --- a/tasks/unit_tests/testdata/collector/prometheusreceiver_manifest.yaml +++ b/tasks/unit_tests/testdata/collector/prometheusreceiver_manifest.yaml @@ -3,6 +3,6 @@ dist: description: Manifest that does not contain prometheus receiver (should fail collector_tests.py) extensions: - - gomod: go.opentelemetry.io/collector/extension/zpagesextension v0.114.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/healthcheckextension v0.114.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/pprofextension v0.114.0 + - gomod: go.opentelemetry.io/collector/extension/zpagesextension v0.115.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/healthcheckextension v0.115.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/pprofextension v0.115.0 diff --git a/tasks/unit_tests/testdata/collector/valid_datadog_manifest.yaml b/tasks/unit_tests/testdata/collector/valid_datadog_manifest.yaml index 0f12f2cc26ca1..6c3849f10dc0e 100644 --- a/tasks/unit_tests/testdata/collector/valid_datadog_manifest.yaml +++ b/tasks/unit_tests/testdata/collector/valid_datadog_manifest.yaml @@ -3,55 +3,55 @@ dist: module: github.com/DataDog/datadog-agent/comp/otelcol/collector-contrib/impl name: otelcol-contrib description: Valid (default) datadog converged Agent ocb manifest (should pass collector_tests.py) - version: 0.114.0 + version: 0.115.0 output_path: ./comp/otelcol/collector-contrib/impl - otelcol_version: 0.114.0 + otelcol_version: 0.115.0 extensions: - - gomod: go.opentelemetry.io/collector/extension/zpagesextension v0.114.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/healthcheckextension v0.114.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/pprofextension v0.114.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/dockerobserver v0.114.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/ecsobserver v0.114.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/ecstaskobserver v0.114.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/hostobserver v0.114.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/k8sobserver v0.114.0 + - gomod: go.opentelemetry.io/collector/extension/zpagesextension v0.115.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/healthcheckextension v0.115.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/pprofextension v0.115.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/dockerobserver v0.115.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/ecsobserver v0.115.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/ecstaskobserver v0.115.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/hostobserver v0.115.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/k8sobserver v0.115.0 exporters: - - gomod: go.opentelemetry.io/collector/exporter/debugexporter v0.114.0 - - gomod: go.opentelemetry.io/collector/exporter/nopexporter v0.114.0 - - gomod: go.opentelemetry.io/collector/exporter/otlpexporter v0.114.0 - - gomod: go.opentelemetry.io/collector/exporter/otlphttpexporter v0.114.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/sapmexporter v0.114.0 + - gomod: go.opentelemetry.io/collector/exporter/debugexporter v0.115.0 + - gomod: go.opentelemetry.io/collector/exporter/nopexporter v0.115.0 + - gomod: go.opentelemetry.io/collector/exporter/otlpexporter v0.115.0 + - gomod: go.opentelemetry.io/collector/exporter/otlphttpexporter v0.115.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/sapmexporter v0.115.0 processors: - - gomod: go.opentelemetry.io/collector/processor/batchprocessor v0.114.0 - - gomod: go.opentelemetry.io/collector/processor/memorylimiterprocessor v0.114.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/attributesprocessor v0.114.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/cumulativetodeltaprocessor v0.114.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/filterprocessor v0.114.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/groupbyattrsprocessor v0.114.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/k8sattributesprocessor v0.114.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/probabilisticsamplerprocessor v0.114.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.114.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourceprocessor v0.114.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/routingprocessor v0.114.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/tailsamplingprocessor v0.114.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor v0.114.0 + - gomod: go.opentelemetry.io/collector/processor/batchprocessor v0.115.0 + - gomod: go.opentelemetry.io/collector/processor/memorylimiterprocessor v0.115.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/attributesprocessor v0.115.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/cumulativetodeltaprocessor v0.115.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/filterprocessor v0.115.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/groupbyattrsprocessor v0.115.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/k8sattributesprocessor v0.115.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/probabilisticsamplerprocessor v0.115.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.115.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourceprocessor v0.115.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/routingprocessor v0.115.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/tailsamplingprocessor v0.115.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor v0.115.0 receivers: - - gomod: go.opentelemetry.io/collector/receiver/nopreceiver v0.114.0 - - gomod: go.opentelemetry.io/collector/receiver/otlpreceiver v0.114.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filelogreceiver v0.114.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/fluentforwardreceiver v0.114.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver v0.114.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/jaegerreceiver v0.114.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusreceiver v0.114.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/receivercreator v0.114.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/zipkinreceiver v0.114.0 + - gomod: go.opentelemetry.io/collector/receiver/nopreceiver v0.115.0 + - gomod: go.opentelemetry.io/collector/receiver/otlpreceiver v0.115.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filelogreceiver v0.115.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/fluentforwardreceiver v0.115.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver v0.115.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/jaegerreceiver v0.115.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusreceiver v0.115.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/receivercreator v0.115.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/zipkinreceiver v0.115.0 connectors: - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/connector/spanmetricsconnector v0.114.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/connector/spanmetricsconnector v0.115.0 # When adding a replace, add a comment before it to document why it's needed and when it can be removed replaces: diff --git a/tasks/unit_tests/testdata/collector/valid_manifest_without_specified_version.yaml b/tasks/unit_tests/testdata/collector/valid_manifest_without_specified_version.yaml index 7a11140cbb107..d49a640f62279 100644 --- a/tasks/unit_tests/testdata/collector/valid_manifest_without_specified_version.yaml +++ b/tasks/unit_tests/testdata/collector/valid_manifest_without_specified_version.yaml @@ -6,12 +6,12 @@ dist: output_path: ./comp/otelcol/collector-contrib/impl extensions: - - gomod: go.opentelemetry.io/collector/extension/zpagesextension v0.114.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/healthcheckextension v0.114.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/pprofextension v0.114.0 + - gomod: go.opentelemetry.io/collector/extension/zpagesextension v0.115.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/healthcheckextension v0.115.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/pprofextension v0.115.0 receivers: - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusreceiver v0.114.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusreceiver v0.115.0 # When adding a replace, add a comment before it to document why it's needed and when it can be removed replaces: diff --git a/tasks/unit_tests/testdata/collector/zpagesextension_manifest.yaml b/tasks/unit_tests/testdata/collector/zpagesextension_manifest.yaml index 9dd5800f47088..272c5cd90204d 100644 --- a/tasks/unit_tests/testdata/collector/zpagesextension_manifest.yaml +++ b/tasks/unit_tests/testdata/collector/zpagesextension_manifest.yaml @@ -3,8 +3,8 @@ dist: description: manifest without zpages extension (should fail collector_tests.py) extensions: - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/healthcheckextension v0.114.0 - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/pprofextension v0.114.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/healthcheckextension v0.115.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/pprofextension v0.115.0 receivers: - - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusreceiver v0.114.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusreceiver v0.115.0 diff --git a/tasks/unit_tests/testdata/components_src/comp/multiple/impl-one/multiple.go b/tasks/unit_tests/testdata/components_src/comp/multiple/impl-one/multiple.go index 19e6f23129500..ac4b78b3aeb69 100644 --- a/tasks/unit_tests/testdata/components_src/comp/multiple/impl-one/multiple.go +++ b/tasks/unit_tests/testdata/components_src/comp/multiple/impl-one/multiple.go @@ -3,7 +3,7 @@ // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2016-present Datadog, Inc. -package multipleimpl +package oneimpl import ( multiple "github.com/DataDog/datadog-agent/comp/multiple/def" diff --git a/tasks/unit_tests/testdata/components_src/comp/multiple/impl-two/multiple.go b/tasks/unit_tests/testdata/components_src/comp/multiple/impl-two/multiple.go index 6ca0f53345424..5be15c220b450 100644 --- a/tasks/unit_tests/testdata/components_src/comp/multiple/impl-two/multiple.go +++ b/tasks/unit_tests/testdata/components_src/comp/multiple/impl-two/multiple.go @@ -3,7 +3,7 @@ // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2016-present Datadog, Inc. -package multipleimpl +package twoimpl import ( multiple "github.com/DataDog/datadog-agent/comp/multiple/def" diff --git a/tasks/winbuildscripts/Generate-Chocolatey-Package.ps1 b/tasks/winbuildscripts/Generate-Chocolatey-Package.ps1 index 9780b4a3a4103..41bf71748cc2b 100644 --- a/tasks/winbuildscripts/Generate-Chocolatey-Package.ps1 +++ b/tasks/winbuildscripts/Generate-Chocolatey-Package.ps1 @@ -1,97 +1,168 @@ +<# +.SYNOPSIS +Generates a Chocolatey package for the Datadog Agent. + +.PARAMETER msiDirectory +Specifies the directory containing the MSI file that will be used to calculate the checksum. + +.PARAMETER Flavor +Specifies the flavor of the Datadog Agent. The default value is "datadog-agent". + +.PARAMETER VersionOverride +Overrides the Agent version when building packages locally for testing. + +.PARAMETER InstallDeps +Indicates whether to install dependencies. The default value is $true. + +.EXAMPLE +.\Generate-Chocolatey-Package.ps1 -Flavor datadog-agent -VersionOverride "7.62.0" -msiDirectory C:\mnt\omnibus\pkg + +Generates a chocolatey package for 7.62.0, requires the MSI file to be present in MSIDirectory. + +.EXAMPLE +$env:CI_PIPELINE_ID="50910739"; .\Generate-Chocolatey-Package.ps1 -Flavor datadog-agent -VersionOverride "7.62.0-devel.git.276.e59b1b3.pipeline.50910739" -msiDirectory C:\mnt\omnibus\pkg + +Generates a chocolatey package for PR/devel build 7.62.0-devel.git.276.e59b1b3.pipeline.50910739, requires the MSI file to be present in MSIDirectory. +The generated chocolatey package requires the MSI be uploaded to the dd-agent-mstesting bucket. +#> Param( - [Parameter(Mandatory=$true,Position=0)] - [ValidateSet("offline", "online")] + [Parameter(Mandatory=$true)] [String] - $installMethod, + $msiDirectory, - [Parameter(Mandatory=$false,Position=1)] - [String] - $msiDirectory + [Parameter(Mandatory=$false)] + [ValidateSet("datadog-agent", "datadog-fips-agent")] + [String] + $Flavor = "datadog-agent", + + [Parameter(Mandatory=$false)] + [String] + $VersionOverride, + + [bool] $InstallDeps = $true ) $ErrorActionPreference = 'Stop'; Set-Location c:\mnt -# Install chocolatey binary -$env:chocolateyUseWindowsCompression = 'true'; Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) - -# Install dev tools, including invoke -pip3 install -r requirements.txt +if ($InstallDeps) { + # Install chocolatey + $env:chocolateyUseWindowsCompression = 'true'; Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) + # Install dev tools, including invoke + pip3 install -r requirements.txt +} -$outputDirectory = "c:\mnt\build-out" -$rawAgentVersion = (inv agent.version --url-safe --major-version 7) +$repoRoot = "C:\mnt" +$outputDirectory = "$repoRoot\build-out" +if (![string]::IsNullOrEmpty($VersionOverride)) { + $rawAgentVersion = $VersionOverride +} else { + $rawAgentVersion = (inv agent.version --url-safe --major-version 7) +} $copyright = "Datadog {0}" -f (Get-Date).Year -$releasePattern = "(\d+\.\d+\.\d+)" -$releaseCandidatePattern = "(\d+\.\d+\.\d+)-rc\.(\d+)" -$develPattern = "(\d+\.\d+\.\d+)-devel\.git\.\d+\.(.+)" - -$nuspecFile = "c:\mnt\chocolatey\datadog-agent-online.nuspec" -$licensePath = "c:\mnt\chocolatey\tools-online\LICENSE.txt" -$installScript = "c:\mnt\chocolatey\tools-online\chocolateyinstall.ps1" +$releasePattern = "^(\d+\.\d+\.\d+)$" +$releaseCandidatePattern = "^(\d+\.\d+\.\d+)-rc\.(\d+)$" +$develPattern = "^(\d+\.\d+\.\d+)-devel\.git\.\d+\.(.+)" -if ($installMethod -eq "offline") { - $nuspecFile = "c:\mnt\chocolatey\datadog-agent-offline.nuspec" - $licensePath = "c:\mnt\chocolatey\tools-offline\LICENSE.txt" +# Build the package in a temporary directory +# Some of the build steps modify the package source, so we don't want to do this in the source directory +$buildTempDir = [System.IO.Path]::GetTempPath() + "\datadog-choco-build" +if (Test-Path $buildTempDir) { + Remove-Item -Recurse -Force $buildTempDir } - -if ($rawAgentVersion -match $releaseCandidatePattern) { - $agentVersionMatches = $rawAgentVersion | Select-String -Pattern $releaseCandidatePattern - $agentVersion = "{0}-rc-{1}" -f $agentVersionMatches.Matches.Groups[1], $agentVersionMatches.Matches.Groups[2].Value - # We don't have release notes for RCs but this way the user can always see what commits are included in this RC - $releaseNotes = "https://github.com/DataDog/datadog-agent/releases/tag/{0}-rc.{1}" -f $agentVersionMatches.Matches.Groups[1], $agentVersionMatches.Matches.Groups[2] - $url = "https://s3.amazonaws.com/dd-agent-mstesting/builds/beta/ddagent-cli-$($agentVersionMatches.Matches.Groups[1])-rc.$($agentVersionMatches.Matches.Groups[2]).msi" -} elseif ($rawAgentVersion -match $develPattern) { - if ($installMethod -eq "online") { - # We don't publish online chocolatey packages for dev branches, error out - Write-Host "Chocolatey packages are not built for dev branches aborting" - exit 2 +New-Item -ItemType Directory -Path $buildTempDir | Out-Null +Push-Location -Path $buildTempDir +try { + # Set the artifact name and package source based on the flavor + if ($Flavor -eq "datadog-agent") { + # For historical reasons, use a different artifact name for the datadog-agent flavor + # See agent-release-management for more details + $artifactName = "ddagent-cli" + } elseif ($Flavor -eq "datadog-fips-agent") { + $artifactName = "datadog-fips-agent" + } else { + Write-Error "Unknown flavor $Flavor" + exit 1 } - $agentVersionMatches = $rawAgentVersion | Select-String -Pattern $develPattern - $agentVersion = "{0}-devel-{1}" -f $agentVersionMatches.Matches.Groups[1], $agentVersionMatches.Matches.Groups[2].Value - # We don't have release notes for devel, so point it to the generic url - $releaseNotes = "https://github.com/DataDog/datadog-agent/releases" -} elseif ($rawAgentVersion -match $releasePattern) { - $agentVersionMatches = $rawAgentVersion | Select-String -Pattern $releasePattern - $agentVersion = $agentVersionMatches.Matches.Groups[1].Value - $releaseNotes = "https://github.com/DataDog/datadog-agent/releases/tag/$agentVersion" - $url = "https://s3.amazonaws.com/ddagent-windows-stable/ddagent-cli-$($agentVersion).msi" -} else { - Write-Host "Unknown agent version '$rawAgentVersion', aborting" - exit 3 -} - -Invoke-WebRequest -Uri "https://raw.githubusercontent.com/DataDog/datadog-agent/main/LICENSE" -OutFile $licensePath -Write-Host "Generating Chocolatey $installMethod package version $agentVersion in $outputDirectory" + $packageSource = "$repoRoot\chocolatey\$Flavor" + $nuspecFile = "$Flavor.nuspec" + + # These files/directories are referenced in the nuspec file + $licensePath = "tools\LICENSE.txt" + $installScript = "tools\chocolateyinstall.ps1" + + # Copy package source to build temp dir + Copy-Item -Recurse -Force -Path $packageSource\* -Destination $buildTempDir + Copy-Item -Force -Path $repoRoot\LICENSE -Destination $licensePath + + # Generate URLs based on the Agent version + if ($rawAgentVersion -match $releaseCandidatePattern) { + $agentVersionMatches = $rawAgentVersion | Select-String -Pattern $releaseCandidatePattern + $agentVersion = "{0}-rc-{1}" -f $agentVersionMatches.Matches.Groups[1], $agentVersionMatches.Matches.Groups[2].Value + # We don't have release notes for RCs but this way the user can always see what commits are included in this RC + $releaseNotes = "https://github.com/DataDog/datadog-agent/releases/tag/{0}-rc.{1}" -f $agentVersionMatches.Matches.Groups[1], $agentVersionMatches.Matches.Groups[2] + $url = "https://s3.amazonaws.com/dd-agent-mstesting/builds/beta/$artifactName-$($agentVersionMatches.Matches.Groups[1])-rc.$($agentVersionMatches.Matches.Groups[2]).msi" + } elseif ($rawAgentVersion -match $develPattern) { + # For devel builds/branches, use the dd-agent-mstesting bucket URL + # This allows us to build and test the package in PRs, and locally + # by using the `-VersionOverride` param. + if ([string]::IsNullOrEmpty($env:CI_PIPELINE_ID)) { + Write-Error "CI_PIPELINE_ID is not set, aborting" + exit 1 + } else { + if ($rawAgentVersion -notmatch $env:CI_PIPELINE_ID) { + Write-Error "CI_PIPELINE_ID is not found in the agent version, aborting" -ErrorAction Continue + if ([string]::IsNullOrEmpty($env:BUCKET_BRANCH)) { + # inv agent.version requires BUCKET_BRANCH to be set when including pipeline in version + Write-Error "BUCKET_BRANCH is not set, if you are running this locally, set `$env:BUCKET_BRANCH='dev' or pass the -VersionOverride parameter" -ErrorAction Continue + } + exit 1 + } + $url = "https://s3.amazonaws.com/dd-agent-mstesting/pipelines/A7/$env:CI_PIPELINE_ID/$flavor-$rawAgentVersion-1-x86_64.msi" + } + $agentVersionMatches = $rawAgentVersion | Select-String -Pattern $develPattern + $agentVersion = "{0}-devel-{1}" -f $agentVersionMatches.Matches.Groups[1], $agentVersionMatches.Matches.Groups[2].Value + # We don't have release notes for devel, so point it to the generic url + $releaseNotes = "https://github.com/DataDog/datadog-agent/releases" + } elseif ($rawAgentVersion -match $releasePattern) { + $agentVersionMatches = $rawAgentVersion | Select-String -Pattern $releasePattern + $agentVersion = $agentVersionMatches.Matches.Groups[1].Value + $releaseNotes = "https://github.com/DataDog/datadog-agent/releases/tag/$agentVersion" + $url = "https://s3.amazonaws.com/ddagent-windows-stable/$artifactName-$($agentVersion).msi" + } else { + Write-Host "Unknown agent version '$rawAgentVersion', aborting" + exit 1 + } -if (!(Test-Path $outputDirectory)) { - New-Item -ItemType Directory -Path $outputDirectory -} + Write-Host "Generating Chocolatey package $flavor version $agentVersion in $(Get-Location)" -if ($installMethod -eq "online") { + # Template the install script with the URL and checksum try { - $tempMsi = Join-Path -Path "$msiDirectory" "datadog-agent-$rawAgentVersion-1-x86_64.msi" - if (!(Test-Path $tempMsi)) { - Write-Host "Error: Could not find MSI file in $tempMsi" + $msiPath = Join-Path -Path "$msiDirectory" "$flavor-$rawAgentVersion-1-x86_64.msi" + if (!(Test-Path $msiPath)) { + Write-Host "Error: Could not find MSI file in $msiPath" Get-ChildItem "$msiDirectory" - exit 1 + exit 1 } - $checksum = (Get-FileHash $tempMsi -Algorithm SHA256).Hash - } + $checksum = (Get-FileHash $msiPath -Algorithm SHA256).Hash + } catch { - Write-Host "Error: Could not generate checksum for package $($tempMsi): $($_)" - exit 4 + Write-Host "Error: Could not generate checksum for package $($msiPath): $($_)" + exit 1 } # Set the $url in the install script (Get-Content $installScript).replace('$__url_from_ci__', '"' + $url + '"').replace('$__checksum_from_ci__', '"' + $checksum + '"') | Set-Content $installScript -} -Write-Host "Generated nupsec file:" -Write-Host (Get-Content $installScript | Out-String) + Write-Host "Generated nuspec file:" + Write-Host (Get-Content $installScript | Out-String) -Write-Host choco pack --out=$outputDirectory $nuspecFile --version $agentVersion release_notes=$releaseNotes copyright=$copyright -choco pack --out=$outputDirectory $nuspecFile --version $agentVersion release_notes=$releaseNotes copyright=$copyright - -# restore installScript (useful for local testing/deployment) -git checkout $installScript + if (!(Test-Path $outputDirectory)) { + New-Item -ItemType Directory -Path $outputDirectory + } + Write-Host choco pack --out=$outputDirectory $nuspecFile --version $agentVersion release_notes=$releaseNotes copyright=$copyright + choco pack --out=$outputDirectory $nuspecFile --version $agentVersion release_notes=$releaseNotes copyright=$copyright +} finally { + Pop-Location +} diff --git a/tasks/winbuildscripts/Publish-Chocolatey-Package.ps1 b/tasks/winbuildscripts/Publish-Chocolatey-Package.ps1 deleted file mode 100644 index e8879285da1ee..0000000000000 --- a/tasks/winbuildscripts/Publish-Chocolatey-Package.ps1 +++ /dev/null @@ -1,12 +0,0 @@ -$ErrorActionPreference = 'Stop'; - -# Install chocolatey binary -$env:chocolateyUseWindowsCompression = 'true'; Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) - -Set-Location c:\mnt -$nupkgs = Get-ChildItem .\nupkg\datadog-agent*.nupkg -foreach($nupkg in $nupkgs) { - Write-Host "Publishing Chocolatey package $($nupkg.Name) for agent version $agentVersion" - choco push $nupkg.FullName --verbose --key $env:CHOCOLATEY_API_KEY --source https://push.chocolatey.org/ - If ($lastExitCode -ne "0") { throw "Previous command returned $lastExitCode" } -} diff --git a/tasks/winbuildscripts/chocopack.bat b/tasks/winbuildscripts/chocopack.bat deleted file mode 100644 index df8915ae14698..0000000000000 --- a/tasks/winbuildscripts/chocopack.bat +++ /dev/null @@ -1,11 +0,0 @@ -if not exist c:\mnt\ goto nomntdir - -@echo c:\mnt found, continuing - -Powershell -C "C:\mnt\tasks\winbuildscripts\Generate-Chocolatey-Package.ps1 %1 %2" || exit /b 1 -goto :EOF - -:nomntdir -@echo directory not mounted, parameters incorrect -exit /b 2 -goto :EOF diff --git a/tasks/winbuildscripts/chocopush.bat b/tasks/winbuildscripts/chocopush.bat deleted file mode 100644 index d359e3c5c2dec..0000000000000 --- a/tasks/winbuildscripts/chocopush.bat +++ /dev/null @@ -1,11 +0,0 @@ -if not exist c:\mnt\ goto nomntdir - -@echo c:\mnt found, continuing - -Powershell -C "C:\mnt\tasks\winbuildscripts\Publish-Chocolatey-Package.ps1" || exit /b 1 -goto :EOF - -:nomntdir -@echo directory not mounted, parameters incorrect -exit /b 2 -goto :EOF \ No newline at end of file diff --git a/tasks/winbuildscripts/common.ps1 b/tasks/winbuildscripts/common.ps1 index 35ef863d57535..d1e51fc5b2b1d 100644 --- a/tasks/winbuildscripts/common.ps1 +++ b/tasks/winbuildscripts/common.ps1 @@ -42,6 +42,23 @@ function Exit-BuildRoot() { Pop-Location -StackName AgentBuildRoot } +<# +.SYNOPSIS +Sets the current directory to the root of the repository. +#> +function Enter-RepoRoot() { + # Expected PSScriptRoot: datadog-agent\tasks\winbuildscripts\ + Push-Location "$PSScriptRoot\..\.." -ErrorAction Stop -StackName AgentRepoRoot | Out-Null +} + +<# +.SYNOPSIS +Leaves the repository root directory and returns to the original working directory. +#> +function Exit-RepoRoot() { + Pop-Location -StackName AgentRepoRoot +} + <# .SYNOPSIS Expands the Go module cache from an archive file. @@ -209,6 +226,8 @@ function Invoke-BuildScript { if ($BuildOutOfSource) { Enter-BuildRoot + } else { + Enter-RepoRoot } Expand-ModCache -modcache modcache @@ -234,9 +253,11 @@ function Invoke-BuildScript { # This finally block is executed regardless of whether the try block completes successfully, throws an exception, # or uses `exit` to terminate the script. + # Restore the original working directory if ($BuildOutOfSource) { - # Restore the original working directory Exit-BuildRoot + } else { + Exit-RepoRoot } } } diff --git a/test/fakeintake/client/client.go b/test/fakeintake/client/client.go index 6890eb51cc6a8..83a767596e689 100644 --- a/test/fakeintake/client/client.go +++ b/test/fakeintake/client/client.go @@ -775,9 +775,6 @@ func (c *Client) get(route string) ([]byte, error) { var body []byte err := backoff.Retry(func() error { tmpResp, err := http.Get(fmt.Sprintf("%s/%s", c.fakeIntakeURL, route)) - if err, ok := err.(net.Error); ok && err.Timeout() { - panic(fmt.Sprintf("fakeintake call timed out: %v", err)) - } if err != nil { return err } @@ -812,6 +809,9 @@ func (c *Client) get(route string) ([]byte, error) { body, err = io.ReadAll(tmpResp.Body) return err }, backoff.WithMaxRetries(backoff.NewConstantBackOff(5*time.Second), 4)) + if err, ok := err.(net.Error); ok && err.Timeout() { + panic(fmt.Sprintf("fakeintake call timed out: %v", err)) + } return body, err } diff --git a/test/fakeintake/go.mod b/test/fakeintake/go.mod index cdbf263570de1..eeb575694baa4 100644 --- a/test/fakeintake/go.mod +++ b/test/fakeintake/go.mod @@ -9,7 +9,7 @@ replace ( ) require ( - github.com/DataDog/agent-payload/v5 v5.0.137 + github.com/DataDog/agent-payload/v5 v5.0.138 github.com/DataDog/datadog-agent/comp/netflow/payload v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/proto v0.56.0-rc.3 github.com/DataDog/zstd v1.5.6 @@ -45,6 +45,7 @@ require ( github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/ncruces/go-strftime v0.1.9 // indirect github.com/philhofer/fwd v1.1.3-0.20240916144458-20a13a1f6b7c // indirect + github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/prometheus/client_model v0.6.1 // indirect github.com/prometheus/common v0.60.1 // indirect @@ -53,9 +54,9 @@ require ( github.com/rivo/uniseg v0.4.7 // indirect github.com/rogpeppe/go-internal v1.13.1 // indirect github.com/spf13/pflag v1.0.5 // indirect - golang.org/x/sys v0.27.0 // indirect - golang.org/x/text v0.20.0 // indirect - golang.org/x/tools v0.27.0 // indirect + golang.org/x/sys v0.28.0 // indirect + golang.org/x/text v0.21.0 // indirect + golang.org/x/tools v0.28.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect modernc.org/gc/v3 v3.0.0-20240107210532-573471604cb6 // indirect modernc.org/libc v1.55.3 // indirect diff --git a/test/fakeintake/go.sum b/test/fakeintake/go.sum index be9d0519b91f7..c9e0f74e8772b 100644 --- a/test/fakeintake/go.sum +++ b/test/fakeintake/go.sum @@ -1,5 +1,5 @@ -github.com/DataDog/agent-payload/v5 v5.0.137 h1:nV02RrYj6AwlQBGIEv6yG23CuxGtG0YWoFZAVE6vwxY= -github.com/DataDog/agent-payload/v5 v5.0.137/go.mod h1:lxh9lb5xYrBXjblpIWYUi4deJqVbkIfkjwesi5nskDc= +github.com/DataDog/agent-payload/v5 v5.0.138 h1:Wg7hmWuoLC/o0X3zZ+uGcfRHPyaytljudgSY9O59zjc= +github.com/DataDog/agent-payload/v5 v5.0.138/go.mod h1:lxh9lb5xYrBXjblpIWYUi4deJqVbkIfkjwesi5nskDc= 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/zstd v1.5.6 h1:LbEglqepa/ipmmQJUDnSsfvA8e8IStVcGaFWDuxvGOY= @@ -60,6 +60,8 @@ github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6 github.com/philhofer/fwd v1.1.3-0.20240916144458-20a13a1f6b7c h1:dAMKvw0MlJT1GshSTtih8C2gDs04w8dReiOGXrGLNoY= github.com/philhofer/fwd v1.1.3-0.20240916144458-20a13a1f6b7c/go.mod h1:RqIHx9QI14HlwKwm98g9Re5prTQ6LdeRQn+gXJFxsJM= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= +github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 h1:GFCKgmp0tecUJ0sJuv4pzYCqS9+RGSn52M3FUwPs+uo= +github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10/go.mod h1:t/avpk3KcrXxUnYOhZhMXJlSEyie6gQbtLq5NM3loB8= 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/prometheus/client_golang v1.20.5 h1:cxppBPuYhUnsO6yo/aoRol4L7q7UFfdm+bR9r+8l63Y= @@ -109,24 +111,24 @@ golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.9.0 h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ= -golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= +golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.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/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= -golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.27.0 h1:qEKojBykQkQ4EynWy4S8Weg69NumxKdn40Fce3uc/8o= -golang.org/x/tools v0.27.0/go.mod h1:sUi0ZgbwW9ZPAq26Ekut+weQPR5eIM6GQLQ1Yjm1H0Q= +golang.org/x/tools v0.28.0 h1:WuB6qZ4RPCQo5aP3WdKZS7i595EdWqWR8vqJTlwTVK8= +golang.org/x/tools v0.28.0/go.mod h1:dcIOrVd3mfQKTgrDVQHqCPMWy6lnhfhtX3hLXYVLfRw= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/test/integration/serverless_perf/compute.sh b/test/integration/serverless_perf/compute.sh index c8421c24a84c9..06be249e90867 100755 --- a/test/integration/serverless_perf/compute.sh +++ b/test/integration/serverless_perf/compute.sh @@ -2,7 +2,7 @@ set -o pipefail -STARTUP_TIME_THRESHOLD=25 +STARTUP_TIME_THRESHOLD=28 calculate_median() { local sorted=($(printf "%s\n" "${@}" | sort -n)) diff --git a/test/new-e2e/examples/agentenv_checkruns_test.go b/test/new-e2e/examples/agentenv_checkruns_test.go index 7a7b73b77aab5..d62d0cfc05bc5 100644 --- a/test/new-e2e/examples/agentenv_checkruns_test.go +++ b/test/new-e2e/examples/agentenv_checkruns_test.go @@ -9,11 +9,12 @@ import ( "testing" "time" - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" ) type agentSuiteEx5 struct { diff --git a/test/new-e2e/examples/agentenv_copyfolder_test.go b/test/new-e2e/examples/agentenv_copyfolder_test.go index 0aff0e3273db3..2c93589669d22 100644 --- a/test/new-e2e/examples/agentenv_copyfolder_test.go +++ b/test/new-e2e/examples/agentenv_copyfolder_test.go @@ -10,11 +10,12 @@ import ( "path" "testing" - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" "github.com/DataDog/test-infra-definitions/components/datadog/agentparams" "github.com/stretchr/testify/require" + + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" ) type agentSuiteEx6 struct { diff --git a/test/new-e2e/examples/agentenv_file_permissions_test.go b/test/new-e2e/examples/agentenv_file_permissions_test.go index a00fe133b4ba1..516498473859d 100644 --- a/test/new-e2e/examples/agentenv_file_permissions_test.go +++ b/test/new-e2e/examples/agentenv_file_permissions_test.go @@ -8,13 +8,14 @@ package examples import ( "testing" - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" - secrets "github.com/DataDog/datadog-agent/test/new-e2e/tests/agent-shared-components/secretsutils" "github.com/DataDog/test-infra-definitions/components/datadog/agentparams" perms "github.com/DataDog/test-infra-definitions/components/datadog/agentparams/filepermissions" "github.com/stretchr/testify/assert" + + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" + secrets "github.com/DataDog/datadog-agent/test/new-e2e/tests/agent-shared-components/secretsutils" ) type filePermissionsTestSuite struct { diff --git a/test/new-e2e/examples/agentenv_file_permissions_win_test.go b/test/new-e2e/examples/agentenv_file_permissions_win_test.go index b35e4cceb003a..faf7fae0f2e96 100644 --- a/test/new-e2e/examples/agentenv_file_permissions_win_test.go +++ b/test/new-e2e/examples/agentenv_file_permissions_win_test.go @@ -17,7 +17,7 @@ import ( "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" secrets "github.com/DataDog/datadog-agent/test/new-e2e/tests/agent-shared-components/secretsutils" ) diff --git a/test/new-e2e/examples/agentenv_logs_test.go b/test/new-e2e/examples/agentenv_logs_test.go index 1f9ae6f347b34..0306d113c06de 100644 --- a/test/new-e2e/examples/agentenv_logs_test.go +++ b/test/new-e2e/examples/agentenv_logs_test.go @@ -13,7 +13,7 @@ import ( fi "github.com/DataDog/datadog-agent/test/fakeintake/client" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" "github.com/DataDog/test-infra-definitions/components/datadog/agentparams" diff --git a/test/new-e2e/examples/agentenv_metrics_test.go b/test/new-e2e/examples/agentenv_metrics_test.go index 86150b5a5b26c..d3fb580e17f1e 100644 --- a/test/new-e2e/examples/agentenv_metrics_test.go +++ b/test/new-e2e/examples/agentenv_metrics_test.go @@ -12,7 +12,7 @@ import ( "github.com/DataDog/datadog-agent/test/fakeintake/client" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" "github.com/stretchr/testify/assert" ) diff --git a/test/new-e2e/examples/agentenv_updateenv_test.go b/test/new-e2e/examples/agentenv_updateenv_test.go index b1f19447229b2..b13705226530e 100644 --- a/test/new-e2e/examples/agentenv_updateenv_test.go +++ b/test/new-e2e/examples/agentenv_updateenv_test.go @@ -8,10 +8,11 @@ package examples import ( "testing" + "github.com/DataDog/test-infra-definitions/components/datadog/agentparams" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" - "github.com/DataDog/test-infra-definitions/components/datadog/agentparams" + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" "github.com/stretchr/testify/assert" ) diff --git a/test/new-e2e/examples/aks_test.go b/test/new-e2e/examples/aks_test.go index 4df8cfc7728c8..991999c300b81 100644 --- a/test/new-e2e/examples/aks_test.go +++ b/test/new-e2e/examples/aks_test.go @@ -17,7 +17,7 @@ import ( "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - azurekubernetes "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/azure/kubernetes" + azurekubernetes "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/azure/kubernetes" ) type aksSuite struct { diff --git a/test/new-e2e/examples/azure_vm_test.go b/test/new-e2e/examples/azure_vm_test.go index 227b4b2ea28e7..64c59f9c156bf 100644 --- a/test/new-e2e/examples/azure_vm_test.go +++ b/test/new-e2e/examples/azure_vm_test.go @@ -6,9 +6,10 @@ package examples import ( - azurehost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/azure/host/windows" "testing" + azurehost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/azure/host/windows" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" ) diff --git a/test/new-e2e/examples/customenv_with_docker_app_test.go b/test/new-e2e/examples/customenv_with_docker_app_test.go index 8eb86a38054fe..71815e2a9631a 100644 --- a/test/new-e2e/examples/customenv_with_docker_app_test.go +++ b/test/new-e2e/examples/customenv_with_docker_app_test.go @@ -11,11 +11,13 @@ import ( "testing" "time" - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/components" - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/components" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners" + "github.com/DataDog/test-infra-definitions/components/docker" "github.com/DataDog/test-infra-definitions/components/os" "github.com/DataDog/test-infra-definitions/resources/aws" @@ -47,7 +49,7 @@ var lighttpdConfigContent string //go:embed testfixtures/lighttpd_integration.conf.yaml var lighttpdIntegrationConfigContent string -func vmPlusDockerEnvProvisioner() e2e.PulumiEnvRunFunc[vmPlusDockerEnv] { +func vmPlusDockerEnvProvisioner() provisioners.PulumiEnvRunFunc[vmPlusDockerEnv] { return func(ctx *pulumi.Context, env *vmPlusDockerEnv) error { awsEnv, err := aws.NewEnvironment(ctx) if err != nil { diff --git a/test/new-e2e/examples/customenv_with_filemanager_test.go b/test/new-e2e/examples/customenv_with_filemanager_test.go index 219a36fdb0331..40938ba05c957 100644 --- a/test/new-e2e/examples/customenv_with_filemanager_test.go +++ b/test/new-e2e/examples/customenv_with_filemanager_test.go @@ -10,9 +10,11 @@ import ( "path" "testing" + "github.com/stretchr/testify/require" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - "github.com/stretchr/testify/require" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners" osComp "github.com/DataDog/test-infra-definitions/components/os" "github.com/DataDog/test-infra-definitions/resources/aws" @@ -25,7 +27,7 @@ type fileManagerSuiteEx7 struct { e2e.BaseSuite[environments.Host] } -func customProvisionerFileManager(localFolderPath string, remoteFolderPath string) e2e.PulumiEnvRunFunc[environments.Host] { +func customProvisionerFileManager(localFolderPath string, remoteFolderPath string) provisioners.PulumiEnvRunFunc[environments.Host] { return func(ctx *pulumi.Context, env *environments.Host) error { awsEnv, err := aws.NewEnvironment(ctx) if err != nil { diff --git a/test/new-e2e/examples/customenv_with_two_vm_test.go b/test/new-e2e/examples/customenv_with_two_vm_test.go index 4d45a35a62c04..c400927784c19 100644 --- a/test/new-e2e/examples/customenv_with_two_vm_test.go +++ b/test/new-e2e/examples/customenv_with_two_vm_test.go @@ -10,6 +10,7 @@ import ( "github.com/DataDog/datadog-agent/test/new-e2e/pkg/components" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners" "github.com/DataDog/test-infra-definitions/components/os" "github.com/DataDog/test-infra-definitions/resources/aws" @@ -23,7 +24,7 @@ type multiVMEnv struct { AppVM *components.RemoteHost } -func multiVMEnvProvisioner() e2e.PulumiEnvRunFunc[multiVMEnv] { +func multiVMEnvProvisioner() provisioners.PulumiEnvRunFunc[multiVMEnv] { return func(ctx *pulumi.Context, env *multiVMEnv) error { awsEnv, err := aws.NewEnvironment(ctx) if err != nil { diff --git a/test/new-e2e/examples/dockerenv_test.go b/test/new-e2e/examples/dockerenv_test.go index 22913d26f4251..729ea7b1d50a0 100644 --- a/test/new-e2e/examples/dockerenv_test.go +++ b/test/new-e2e/examples/dockerenv_test.go @@ -12,7 +12,7 @@ import ( "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awsdocker "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/docker" + awsdocker "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/docker" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/e2e/client/agentclient" ) diff --git a/test/new-e2e/examples/dockerenv_with_extra_compose_test.go b/test/new-e2e/examples/dockerenv_with_extra_compose_test.go index cf416c968b966..a99d8153bf3a3 100644 --- a/test/new-e2e/examples/dockerenv_with_extra_compose_test.go +++ b/test/new-e2e/examples/dockerenv_with_extra_compose_test.go @@ -10,13 +10,14 @@ import ( "strings" "testing" - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awsdocker "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/docker" "github.com/DataDog/test-infra-definitions/components/datadog/dockeragentparams" "github.com/pulumi/pulumi/sdk/v3/go/pulumi" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" + awsdocker "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/docker" ) type dockerSuiteWithExtraCompose struct { diff --git a/test/new-e2e/examples/ecs_test.go b/test/new-e2e/examples/ecs_test.go index 7a30eb6dfd7b4..e7e21ebb09c97 100644 --- a/test/new-e2e/examples/ecs_test.go +++ b/test/new-e2e/examples/ecs_test.go @@ -14,7 +14,7 @@ import ( "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/ecs" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/ecs" tifEcs "github.com/DataDog/test-infra-definitions/scenarios/aws/ecs" awsecs "github.com/aws/aws-sdk-go-v2/service/ecs" diff --git a/test/new-e2e/examples/gcp_vm_test.go b/test/new-e2e/examples/gcp_vm_test.go index 1f897a87bbfe3..ec1d5fdb3a716 100644 --- a/test/new-e2e/examples/gcp_vm_test.go +++ b/test/new-e2e/examples/gcp_vm_test.go @@ -6,9 +6,10 @@ package examples import ( - gcphost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/gcp/host/linux" "testing" + gcphost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/gcp/host/linux" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" ) diff --git a/test/new-e2e/examples/gke_autopilot_test.go b/test/new-e2e/examples/gke_autopilot_test.go index 9317ace5b67be..82ced93302b4a 100644 --- a/test/new-e2e/examples/gke_autopilot_test.go +++ b/test/new-e2e/examples/gke_autopilot_test.go @@ -16,7 +16,7 @@ import ( corev1 "k8s.io/api/core/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - gcpkubernetes "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/gcp/kubernetes" + gcpkubernetes "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/gcp/kubernetes" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" diff --git a/test/new-e2e/examples/gke_test.go b/test/new-e2e/examples/gke_test.go index 5f01481914652..d2ffd1dcf444c 100644 --- a/test/new-e2e/examples/gke_test.go +++ b/test/new-e2e/examples/gke_test.go @@ -6,13 +6,15 @@ package examples import ( "context" - gcpkubernetes "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/gcp/kubernetes" + "strings" + "testing" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" corev1 "k8s.io/api/core/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "strings" - "testing" + + gcpkubernetes "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/gcp/kubernetes" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" diff --git a/test/new-e2e/examples/kind_local_test.go b/test/new-e2e/examples/kind_local_test.go index dd5aa8f878c3a..a559f78be50a1 100644 --- a/test/new-e2e/examples/kind_local_test.go +++ b/test/new-e2e/examples/kind_local_test.go @@ -19,7 +19,7 @@ import ( "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - localkubernetes "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/local/kubernetes" + localkubernetes "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/local/kubernetes" ) type myLocalKindSuite struct { diff --git a/test/new-e2e/examples/kind_test.go b/test/new-e2e/examples/kind_test.go index dcfa50dbc3f64..00677a5f673f9 100644 --- a/test/new-e2e/examples/kind_test.go +++ b/test/new-e2e/examples/kind_test.go @@ -15,7 +15,7 @@ import ( "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awskubernetes "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/kubernetes" + awskubernetes "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/kubernetes" "github.com/DataDog/test-infra-definitions/common/config" "github.com/DataDog/test-infra-definitions/components/datadog/apps/dogstatsd" diff --git a/test/new-e2e/examples/vm_localpodman_test.go b/test/new-e2e/examples/vm_localpodman_test.go index 92941a6d7a8a4..c7157468e6219 100644 --- a/test/new-e2e/examples/vm_localpodman_test.go +++ b/test/new-e2e/examples/vm_localpodman_test.go @@ -14,7 +14,7 @@ import ( "github.com/DataDog/datadog-agent/test/fakeintake/client" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - localhost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/local/host" + localhost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/local/host" ) type vmLocalPodmanSuite struct { diff --git a/test/new-e2e/examples/vm_test.go b/test/new-e2e/examples/vm_test.go index a2fea62f01969..d3d8375a4937d 100644 --- a/test/new-e2e/examples/vm_test.go +++ b/test/new-e2e/examples/vm_test.go @@ -10,7 +10,7 @@ import ( "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" ) type vmSuite struct { diff --git a/test/new-e2e/examples/vm_with_file_operations_test.go b/test/new-e2e/examples/vm_with_file_operations_test.go index 02f8592388bd6..d97764dac8daa 100644 --- a/test/new-e2e/examples/vm_with_file_operations_test.go +++ b/test/new-e2e/examples/vm_with_file_operations_test.go @@ -11,12 +11,13 @@ import ( "golang.org/x/crypto/ssh" + "github.com/DataDog/test-infra-definitions/components/os" + "github.com/DataDog/test-infra-definitions/scenarios/aws/ec2" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/e2e/client" - "github.com/DataDog/test-infra-definitions/components/os" - "github.com/DataDog/test-infra-definitions/scenarios/aws/ec2" "github.com/stretchr/testify/assert" ) diff --git a/test/new-e2e/examples/vmenv_withami_test.go b/test/new-e2e/examples/vmenv_withami_test.go index 1bf202cd16d86..eaae1d898408a 100644 --- a/test/new-e2e/examples/vmenv_withami_test.go +++ b/test/new-e2e/examples/vmenv_withami_test.go @@ -10,7 +10,7 @@ import ( "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/e2e/client" "github.com/DataDog/test-infra-definitions/components/os" diff --git a/test/new-e2e/examples/vmenv_withos_test.go b/test/new-e2e/examples/vmenv_withos_test.go index 6ec8775df5905..aa64c8483f8f0 100644 --- a/test/new-e2e/examples/vmenv_withos_test.go +++ b/test/new-e2e/examples/vmenv_withos_test.go @@ -8,12 +8,13 @@ package examples import ( "testing" - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" "github.com/DataDog/test-infra-definitions/components/os" "github.com/DataDog/test-infra-definitions/scenarios/aws/ec2" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" + "github.com/stretchr/testify/assert" ) diff --git a/test/new-e2e/go.mod b/test/new-e2e/go.mod index b2f25362d4739..a23fccb9754f0 100644 --- a/test/new-e2e/go.mod +++ b/test/new-e2e/go.mod @@ -43,52 +43,51 @@ replace ( ) require ( - github.com/DataDog/agent-payload/v5 v5.0.137 + github.com/DataDog/agent-payload/v5 v5.0.138 github.com/DataDog/datadog-agent/comp/otelcol/ddflareextension/def v0.56.2 - github.com/DataDog/datadog-agent/pkg/util/optional v0.59.0 + github.com/DataDog/datadog-agent/pkg/util/optional v0.59.1 github.com/DataDog/datadog-agent/pkg/util/pointer v0.59.0 github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.0 github.com/DataDog/datadog-agent/pkg/util/testutil v0.56.2 - github.com/DataDog/datadog-agent/pkg/version v0.59.0 + github.com/DataDog/datadog-agent/pkg/version v0.59.1 github.com/DataDog/datadog-agent/test/fakeintake v0.56.0-rc.3 github.com/DataDog/datadog-api-client-go v1.16.0 - github.com/DataDog/datadog-api-client-go/v2 v2.31.0 + github.com/DataDog/datadog-api-client-go/v2 v2.33.0 // Are you bumping github.com/DataDog/test-infra-definitions ? // You should bump `TEST_INFRA_DEFINITIONS_BUILDIMAGES` in `.gitlab/common/test_infra_version.yml` // `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/aws/aws-sdk-go-v2 v1.32.5 - github.com/aws/aws-sdk-go-v2/config v1.28.5 + github.com/DataDog/test-infra-definitions v0.0.0-20241224112147-36860d3c29b4 + github.com/aws/aws-sdk-go-v2 v1.32.7 + github.com/aws/aws-sdk-go-v2/config v1.28.7 github.com/aws/aws-sdk-go-v2/service/ec2 v1.190.0 - github.com/aws/aws-sdk-go-v2/service/eks v1.44.1 - github.com/aws/aws-sdk-go-v2/service/ssm v1.50.7 + github.com/aws/aws-sdk-go-v2/service/eks v1.51.0 + github.com/aws/aws-sdk-go-v2/service/ssm v1.55.2 github.com/cenkalti/backoff v2.2.1+incompatible - github.com/docker/cli v27.1.1+incompatible - github.com/docker/docker v27.3.1+incompatible + github.com/docker/cli v27.4.0+incompatible + github.com/docker/docker v27.4.0+incompatible github.com/fatih/color v1.18.0 github.com/google/uuid v1.6.0 github.com/kr/pretty v0.3.1 github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c - 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/sdk/v3 v3.140.0 + github.com/pkg/sftp v1.13.7 + github.com/pulumi/pulumi-aws/sdk/v6 v6.65.0 + github.com/pulumi/pulumi-awsx/sdk/v2 v2.19.0 + github.com/pulumi/pulumi-kubernetes/sdk/v4 v4.19.0 + github.com/pulumi/pulumi/sdk/v3 v3.142.0 github.com/samber/lo v1.47.0 github.com/stretchr/testify v1.10.0 github.com/xeipuuv/gojsonschema v1.2.0 - golang.org/x/crypto v0.29.0 - golang.org/x/sys v0.27.0 - golang.org/x/term v0.26.0 + golang.org/x/crypto v0.31.0 + golang.org/x/sys v0.28.0 + golang.org/x/term v0.27.0 gopkg.in/yaml.v2 v2.4.0 gopkg.in/zorkian/go-datadog-api.v2 v2.30.0 - k8s.io/api v0.31.2 - k8s.io/apimachinery v0.31.2 + k8s.io/api v0.31.4 + k8s.io/apimachinery v0.31.4 k8s.io/cli-runtime v0.31.2 - k8s.io/client-go v0.31.2 + k8s.io/client-go v0.31.3 k8s.io/kubectl v0.31.2 ) @@ -104,29 +103,28 @@ require ( github.com/MakeNowJust/heredoc v1.0.0 // indirect github.com/Masterminds/semver v1.5.0 // indirect github.com/Microsoft/go-winio v0.6.2 // indirect - github.com/ProtonMail/go-crypto v1.1.0-alpha.0 // indirect + github.com/ProtonMail/go-crypto v1.1.3 // indirect github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da // indirect github.com/agext/levenshtein v1.2.3 // indirect github.com/alessio/shellescape v1.4.2 // indirect github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect github.com/atotto/clipboard v0.1.4 // indirect - github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.6 // indirect - github.com/aws/aws-sdk-go-v2/credentials v1.17.46 // indirect - github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.20 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.24 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.24 // indirect + github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.7 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.17.48 // indirect + github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.22 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.26 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.26 // indirect github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 // indirect - github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.19 // indirect - github.com/aws/aws-sdk-go-v2/service/ecr v1.36.2 // indirect - github.com/aws/aws-sdk-go-v2/service/ecs v1.47.4 + github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.26 // indirect + github.com/aws/aws-sdk-go-v2/service/ecr v1.36.8 // indirect + github.com/aws/aws-sdk-go-v2/service/ecs v1.53.1 github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.1 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.4.0 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.5 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.0 // indirect - github.com/aws/aws-sdk-go-v2/service/s3 v1.65.0 - github.com/aws/aws-sdk-go-v2/service/sso v1.24.6 // indirect - github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.5 // indirect - github.com/aws/aws-sdk-go-v2/service/sts v1.33.1 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.4.7 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.7 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.7 // indirect + github.com/aws/aws-sdk-go-v2/service/sso v1.24.8 // indirect + github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.7 // indirect + github.com/aws/aws-sdk-go-v2/service/sts v1.33.3 // indirect github.com/aws/smithy-go v1.22.1 // indirect github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect github.com/blang/semver v3.5.1+incompatible // indirect @@ -135,8 +133,7 @@ require ( github.com/charmbracelet/bubbles v0.18.0 // indirect github.com/charmbracelet/bubbletea v0.25.0 // indirect github.com/charmbracelet/lipgloss v0.10.0 // indirect - github.com/cheggaaa/pb v1.0.29 // indirect - github.com/cloudflare/circl v1.3.7 // indirect + github.com/cloudflare/circl v1.3.8 // indirect github.com/containerd/console v1.0.4 // indirect github.com/containerd/log v0.1.0 // indirect github.com/cyphar/filepath-securejoin v0.3.4 // indirect @@ -156,16 +153,16 @@ require ( github.com/go-git/go-git/v5 v5.12.0 // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect - github.com/go-openapi/jsonpointer v0.20.2 // indirect - github.com/go-openapi/jsonreference v0.20.4 // indirect - github.com/go-openapi/swag v0.22.9 // indirect + github.com/go-openapi/jsonpointer v0.21.0 // indirect + github.com/go-openapi/jsonreference v0.21.0 // indirect + github.com/go-openapi/swag v0.23.0 // indirect github.com/goccy/go-json v0.10.3 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/glog v1.2.2 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.4 // indirect github.com/google/btree v1.1.3 // indirect - github.com/google/gnostic-models v0.6.8 // indirect + github.com/google/gnostic-models v0.6.9-0.20230804172637-c7be7c783f49 // indirect github.com/google/go-cmp v0.6.0 // indirect github.com/google/gofuzz v1.2.0 // indirect github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect @@ -174,7 +171,7 @@ require ( github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect - github.com/hashicorp/hcl/v2 v2.20.1 // indirect + github.com/hashicorp/hcl/v2 v2.22.0 // indirect github.com/imdario/mergo v0.3.16 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect @@ -219,9 +216,9 @@ require ( github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/pulumi/appdash v0.0.0-20231130102222-75f619a67231 // indirect github.com/pulumi/esc v0.10.0 // indirect - github.com/pulumi/pulumi-command/sdk v1.0.1 // indirect - github.com/pulumi/pulumi-docker/sdk/v4 v4.5.5 // indirect - github.com/pulumi/pulumi-libvirt/sdk v0.4.7 // indirect + github.com/pulumi/pulumi-command/sdk v1.0.1 + github.com/pulumi/pulumi-docker/sdk/v4 v4.5.7 // indirect + github.com/pulumi/pulumi-libvirt/sdk v0.5.3 // indirect github.com/pulumi/pulumi-random/sdk/v4 v4.16.7 // indirect github.com/pulumi/pulumi-tls/sdk/v4 v4.11.1 // indirect github.com/pulumiverse/pulumi-time/sdk v0.1.0 // indirect @@ -245,7 +242,7 @@ require ( github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect github.com/xlab/treeprint v1.2.0 // indirect - github.com/zclconf/go-cty v1.14.4 // indirect + github.com/zclconf/go-cty v1.15.0 // indirect github.com/zorkian/go-datadog-api v2.30.0+incompatible // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.56.0 // indirect go.opentelemetry.io/otel v1.32.0 // indirect @@ -254,14 +251,14 @@ require ( go.opentelemetry.io/otel/trace v1.32.0 // indirect go.starlark.net v0.0.0-20231101134539-556fd59b42f6 // indirect go.uber.org/atomic v1.11.0 // indirect - golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f + golang.org/x/exp v0.0.0-20241210194714-1829a127f884 golang.org/x/mod v0.22.0 // indirect - golang.org/x/net v0.31.0 + golang.org/x/net v0.33.0 golang.org/x/oauth2 v0.23.0 // indirect - golang.org/x/sync v0.9.0 // indirect - golang.org/x/text v0.20.0 + golang.org/x/sync v0.10.0 // indirect + golang.org/x/text v0.21.0 golang.org/x/time v0.8.0 // indirect - golang.org/x/tools v0.27.0 // indirect + golang.org/x/tools v0.28.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect google.golang.org/grpc v1.67.1 // indirect google.golang.org/protobuf v1.35.2 // indirect @@ -285,38 +282,41 @@ require ( require ( github.com/DataDog/datadog-agent/comp/core/tagger/types v0.0.0-00010101000000-000000000000 github.com/DataDog/datadog-agent/pkg/trace v0.56.0-rc.3 - github.com/DataDog/datadog-go/v5 v5.5.0 + github.com/DataDog/datadog-go/v5 v5.6.0 github.com/aws/aws-sdk-go v1.55.5 - github.com/aws/session-manager-plugin v0.0.0-20241010233726-61cf1288c7c6 + github.com/aws/aws-sdk-go-v2/service/s3 v1.71.1 + github.com/aws/session-manager-plugin v0.0.0-20241119210807-82dc72922492 github.com/digitalocean/go-libvirt v0.0.0-20240812180835-9c6c0a310c6c - github.com/hairyhenderson/go-codeowners v0.5.0 + github.com/hairyhenderson/go-codeowners v0.7.0 ) require ( github.com/DataDog/datadog-agent/comp/core/tagger/utils v0.59.0 // indirect github.com/blang/semver/v4 v4.0.0 // indirect + github.com/cheggaaa/pb v1.0.29 // indirect github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 // indirect - github.com/creack/pty v1.1.20 // indirect + github.com/creack/pty v1.1.21 // indirect github.com/fxamacker/cbor/v2 v2.7.0 // indirect github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.23.0 // indirect 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/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // 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.4.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 - go.opentelemetry.io/collector/component v0.114.0 // indirect - go.opentelemetry.io/collector/config/configtelemetry v0.114.0 // indirect - go.opentelemetry.io/collector/extension v0.114.0 // indirect - go.opentelemetry.io/collector/pdata v1.20.0 // indirect + go.opentelemetry.io/collector/component v0.115.0 // indirect + go.opentelemetry.io/collector/config/configtelemetry v0.115.0 // indirect + go.opentelemetry.io/collector/extension v0.115.0 // indirect + go.opentelemetry.io/collector/pdata v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect google.golang.org/genproto v0.0.0-20240903143218-8af14fe29dc1 // indirect diff --git a/test/new-e2e/go.sum b/test/new-e2e/go.sum index e36e556cf02ed..7884b1456c213 100644 --- a/test/new-e2e/go.sum +++ b/test/new-e2e/go.sum @@ -7,18 +7,18 @@ github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg6 github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c h1:pxW6RcqyfI9/kWtOwnv/G+AzdKuy2ZrqINhenH4HyNs= github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= -github.com/DataDog/agent-payload/v5 v5.0.137 h1:nV02RrYj6AwlQBGIEv6yG23CuxGtG0YWoFZAVE6vwxY= -github.com/DataDog/agent-payload/v5 v5.0.137/go.mod h1:lxh9lb5xYrBXjblpIWYUi4deJqVbkIfkjwesi5nskDc= +github.com/DataDog/agent-payload/v5 v5.0.138 h1:Wg7hmWuoLC/o0X3zZ+uGcfRHPyaytljudgSY9O59zjc= +github.com/DataDog/agent-payload/v5 v5.0.138/go.mod h1:lxh9lb5xYrBXjblpIWYUi4deJqVbkIfkjwesi5nskDc= github.com/DataDog/datadog-api-client-go v1.16.0 h1:5jOZv1m98criCvYTa3qpW8Hzv301nbZX3K9yJtwGyWY= github.com/DataDog/datadog-api-client-go v1.16.0/go.mod h1:PgrP2ABuJWL3Auw2iEkemAJ/r72ghG4DQQmb5sgnKW4= -github.com/DataDog/datadog-api-client-go/v2 v2.31.0 h1:JfJhYlHfLzvauI8u6h23smTooWYe6quNhhg9gpTszWY= -github.com/DataDog/datadog-api-client-go/v2 v2.31.0/go.mod h1:d3tOEgUd2kfsr9uuHQdY+nXrWp4uikgTgVCPdKNK30U= -github.com/DataDog/datadog-go/v5 v5.5.0 h1:G5KHeB8pWBNXT4Jtw0zAkhdxEAWSpWH00geHI6LDrKU= -github.com/DataDog/datadog-go/v5 v5.5.0/go.mod h1:K9kcYBlxkcPP8tvvjZZKs/m1edNAUFzBbdpTUKfCsuw= +github.com/DataDog/datadog-api-client-go/v2 v2.33.0 h1:OI6kDnJeQmkjfGzxmP0XUQUxMD4tp6oAPXnnJ4VpgUM= +github.com/DataDog/datadog-api-client-go/v2 v2.33.0/go.mod h1:d3tOEgUd2kfsr9uuHQdY+nXrWp4uikgTgVCPdKNK30U= +github.com/DataDog/datadog-go/v5 v5.6.0 h1:2oCLxjF/4htd55piM75baflj/KoE6VYS7alEUqFvRDw= +github.com/DataDog/datadog-go/v5 v5.6.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-20241224112147-36860d3c29b4 h1:HbJmStrQyp4UgpPmiyHekb0iC1q5Kyi+h7/OL71NjMU= +github.com/DataDog/test-infra-definitions v0.0.0-20241224112147-36860d3c29b4/go.mod h1:aA4nXHm22yn8O/Ka35+SQcqqhW2kRm5fnoI6PO0BmwE= 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= @@ -33,8 +33,8 @@ github.com/Microsoft/go-winio v0.5.0/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpz github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY= github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= -github.com/ProtonMail/go-crypto v1.1.0-alpha.0 h1:nHGfwXmFvJrSR9xu8qL7BkO4DqTHXE9N5vPhgY2I+j0= -github.com/ProtonMail/go-crypto v1.1.0-alpha.0/go.mod h1:rA3QumHc/FZ8pAHreoekgiAbzpNsfQAosU5td4SnOrE= +github.com/ProtonMail/go-crypto v1.1.3 h1:nRBOetoydLeUb4nHajyO2bKqMLfWQ/ZPwkXqXxPxCFk= +github.com/ProtonMail/go-crypto v1.1.3/go.mod h1:rA3QumHc/FZ8pAHreoekgiAbzpNsfQAosU5td4SnOrE= github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da h1:KjTM2ks9d14ZYCvmHS9iAKVt9AyzRSqNU1qabPih5BY= github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da/go.mod h1:eHEWzANqSiWQsof+nXEI9bUVUyV6F53Fp89EuCh2EAA= github.com/agext/levenshtein v1.2.3 h1:YB2fHEn0UJagG8T1rrWknE3ZQzWM06O8AMAatNn7lmo= @@ -52,52 +52,52 @@ github.com/atotto/clipboard v0.1.4 h1:EH0zSVneZPSuFR11BlR9YppQTVDbh5+16AmcJi4g1z github.com/atotto/clipboard v0.1.4/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI= github.com/aws/aws-sdk-go v1.55.5 h1:KKUZBfBoyqy5d3swXyiC7Q76ic40rYcbqH7qjh59kzU= github.com/aws/aws-sdk-go v1.55.5/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU= -github.com/aws/aws-sdk-go-v2 v1.32.5 h1:U8vdWJuY7ruAkzaOdD7guwJjD06YSKmnKCJs7s3IkIo= -github.com/aws/aws-sdk-go-v2 v1.32.5/go.mod h1:P5WJBrYqqbWVaOxgH0X/FYYD47/nooaPOZPlQdmiN2U= -github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.6 h1:pT3hpW0cOHRJx8Y0DfJUEQuqPild8jRGmSFmBgvydr0= -github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.6/go.mod h1:j/I2++U0xX+cr44QjHay4Cvxj6FUbnxrgmqN3H1jTZA= -github.com/aws/aws-sdk-go-v2/config v1.28.5 h1:Za41twdCXbuyyWv9LndXxZZv3QhTG1DinqlFsSuvtI0= -github.com/aws/aws-sdk-go-v2/config v1.28.5/go.mod h1:4VsPbHP8JdcdUDmbTVgNL/8w9SqOkM5jyY8ljIxLO3o= -github.com/aws/aws-sdk-go-v2/credentials v1.17.46 h1:AU7RcriIo2lXjUfHFnFKYsLCwgbz1E7Mm95ieIRDNUg= -github.com/aws/aws-sdk-go-v2/credentials v1.17.46/go.mod h1:1FmYyLGL08KQXQ6mcTlifyFXfJVCNJTVGuQP4m0d/UA= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.20 h1:sDSXIrlsFSFJtWKLQS4PUWRvrT580rrnuLydJrCQ/yA= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.20/go.mod h1:WZ/c+w0ofps+/OUqMwWgnfrgzZH1DZO1RIkktICsqnY= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.24 h1:4usbeaes3yJnCFC7kfeyhkdkPtoRYPa/hTmCqMpKpLI= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.24/go.mod h1:5CI1JemjVwde8m2WG3cz23qHKPOxbpkq0HaoreEgLIY= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.24 h1:N1zsICrQglfzaBnrfM0Ys00860C+QFwu6u/5+LomP+o= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.24/go.mod h1:dCn9HbJ8+K31i8IQ8EWmWj0EiIk0+vKiHNMxTTYveAg= +github.com/aws/aws-sdk-go-v2 v1.32.7 h1:ky5o35oENWi0JYWUZkB7WYvVPP+bcRF5/Iq7JWSb5Rw= +github.com/aws/aws-sdk-go-v2 v1.32.7/go.mod h1:P5WJBrYqqbWVaOxgH0X/FYYD47/nooaPOZPlQdmiN2U= +github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.7 h1:lL7IfaFzngfx0ZwUGOZdsFFnQ5uLvR0hWqqhyE7Q9M8= +github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.7/go.mod h1:QraP0UcVlQJsmHfioCrveWOC1nbiWUl3ej08h4mXWoc= +github.com/aws/aws-sdk-go-v2/config v1.28.7 h1:GduUnoTXlhkgnxTD93g1nv4tVPILbdNQOzav+Wpg7AE= +github.com/aws/aws-sdk-go-v2/config v1.28.7/go.mod h1:vZGX6GVkIE8uECSUHB6MWAUsd4ZcG2Yq/dMa4refR3M= +github.com/aws/aws-sdk-go-v2/credentials v1.17.48 h1:IYdLD1qTJ0zanRavulofmqut4afs45mOWEI+MzZtTfQ= +github.com/aws/aws-sdk-go-v2/credentials v1.17.48/go.mod h1:tOscxHN3CGmuX9idQ3+qbkzrjVIx32lqDSU1/0d/qXs= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.22 h1:kqOrpojG71DxJm/KDPO+Z/y1phm1JlC8/iT+5XRmAn8= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.22/go.mod h1:NtSFajXVVL8TA2QNngagVZmUtXciyrHOt7xgz4faS/M= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.26 h1:I/5wmGMffY4happ8NOCuIUEWGUvvFp5NSeQcXl9RHcI= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.26/go.mod h1:FR8f4turZtNy6baO0KJ5FJUmXH/cSkI9fOngs0yl6mA= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.26 h1:zXFLuEuMMUOvEARXFUVJdfqZ4bvvSgdGRq/ATcrQxzM= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.26/go.mod h1:3o2Wpy0bogG1kyOPrgkXA8pgIfEEv0+m19O9D5+W8y8= github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 h1:VaRN3TlFdd6KxX1x3ILT5ynH6HvKgqdiXoTxAF4HQcQ= github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1/go.mod h1:FbtygfRFze9usAadmnGJNc8KsP346kEe+y2/oyhGAGc= -github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.19 h1:FKdiFzTxlTRO71p0C7VrLbkkdW8qfMKF5+ej6bTmkT0= -github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.19/go.mod h1:abO3pCj7WLQPTllnSeYImqFfkGrmJV0JovWo/gqT5N0= +github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.26 h1:GeNJsIFHB+WW5ap2Tec4K6dzcVTsRbsT1Lra46Hv9ME= +github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.26/go.mod h1:zfgMpwHDXX2WGoG84xG2H+ZlPTkJUU4YUvx2svLQYWo= github.com/aws/aws-sdk-go-v2/service/ec2 v1.190.0 h1:k97fGog9Tl0woxTiSIHN14Qs5ehqK6GXejUwkhJYyL0= github.com/aws/aws-sdk-go-v2/service/ec2 v1.190.0/go.mod h1:mzj8EEjIHSN2oZRXiw1Dd+uB4HZTl7hC8nBzX9IZMWw= -github.com/aws/aws-sdk-go-v2/service/ecr v1.36.2 h1:VDQaVwGOokbd3VUbHF+wupiffdrbAZPdQnr5XZMJqrs= -github.com/aws/aws-sdk-go-v2/service/ecr v1.36.2/go.mod h1:lvUlMghKYmSxSfv0vU7pdU/8jSY+s0zpG8xXhaGKCw0= -github.com/aws/aws-sdk-go-v2/service/ecs v1.47.4 h1:CTkPGE8fiElvLtYWl/U+Eu5+1fVXiZbJUjyVCRSRgxk= -github.com/aws/aws-sdk-go-v2/service/ecs v1.47.4/go.mod h1:sMFLFhL27cKYa/eQYZp4asvIwHsnJWrAzTUpy9AQdnU= -github.com/aws/aws-sdk-go-v2/service/eks v1.44.1 h1:onUAzZXDsyXzyrmOGw/9p8Csl1NZkTDEs4URZ8covUY= -github.com/aws/aws-sdk-go-v2/service/eks v1.44.1/go.mod h1:dg9l/W4hXygeRNydRB4LWKY/MwHJhfUomGJUBwI29Dw= +github.com/aws/aws-sdk-go-v2/service/ecr v1.36.8 h1:cPdeSR2y0BDAr2S054U4ERlJ5mM1OWYazW7Jm/o+b1o= +github.com/aws/aws-sdk-go-v2/service/ecr v1.36.8/go.mod h1:NqKnlZvLl4Tp2UH/GEc/nhbjmPQhwOXmLp2eldiszLM= +github.com/aws/aws-sdk-go-v2/service/ecs v1.53.1 h1:sAT2jzHkds1cv7VvNpzFfCw2w3zAkh306x3MTLPjuoA= +github.com/aws/aws-sdk-go-v2/service/ecs v1.53.1/go.mod h1:YpTRClSDOPvN2e3kiIrYOx1sI+YKTZVmlMiNO2AwYhE= +github.com/aws/aws-sdk-go-v2/service/eks v1.51.0 h1:BYyB+byjQ7oyupe3v+YjTp1yfmfNEwChYA2naCc85xI= +github.com/aws/aws-sdk-go-v2/service/eks v1.51.0/go.mod h1:oaPCqTzAe8C5RQZJGRD4RENcV7A4n99uGxbD4rULbNg= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.1 h1:iXtILhvDxB6kPvEXgsDhGaZCSC6LQET5ZHSdJozeI0Y= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.1/go.mod h1:9nu0fVANtYiAePIBh2/pFUSwtJ402hLnp854CNoDOeE= -github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.4.0 h1:FQNWhRuSq8QwW74GtU0MrveNhZbqvHsA4dkA9w8fTDQ= -github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.4.0/go.mod h1:j/zZ3zmWfGCK91K73YsfHP53BSTLSjL/y6YN39XbBLM= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.5 h1:wtpJ4zcwrSbwhECWQoI/g6WM9zqCcSpHDJIWSbMLOu4= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.5/go.mod h1:qu/W9HXQbbQ4+1+JcZp0ZNPV31ym537ZJN+fiS7Ti8E= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.0 h1:1NKXS8XfhMM0bg5wVYa/eOH8AM2f6JijugbKEyQFTIg= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.0/go.mod h1:ph931DUfVfgrhZR7py9olSvHCiRpvaGxNvlWBcXxFds= -github.com/aws/aws-sdk-go-v2/service/s3 v1.65.0 h1:2dSm7frMrw2tdJ0QvyccQNJyPGaP24dyDgZ6h1QJMGU= -github.com/aws/aws-sdk-go-v2/service/s3 v1.65.0/go.mod h1:4XSVpw66upN8wND3JZA29eXl2NOZvfFVq7DIP6xvfuQ= -github.com/aws/aws-sdk-go-v2/service/ssm v1.50.7 h1:GkRsyFS9MmX/ybCvOncmp1A4XYn75v0x/ReWnIUao6E= -github.com/aws/aws-sdk-go-v2/service/ssm v1.50.7/go.mod h1:oBlt+H2x16bM5mSUNhmzIR2BWWnMsLUa1Qqs5auS1Bs= -github.com/aws/aws-sdk-go-v2/service/sso v1.24.6 h1:3zu537oLmsPfDMyjnUS2g+F2vITgy5pB74tHI+JBNoM= -github.com/aws/aws-sdk-go-v2/service/sso v1.24.6/go.mod h1:WJSZH2ZvepM6t6jwu4w/Z45Eoi75lPN7DcydSRtJg6Y= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.5 h1:K0OQAsDywb0ltlFrZm0JHPY3yZp/S9OaoLU33S7vPS8= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.5/go.mod h1:ORITg+fyuMoeiQFiVGoqB3OydVTLkClw/ljbblMq6Cc= -github.com/aws/aws-sdk-go-v2/service/sts v1.33.1 h1:6SZUVRQNvExYlMLbHdlKB48x0fLbc2iVROyaNEwBHbU= -github.com/aws/aws-sdk-go-v2/service/sts v1.33.1/go.mod h1:GqWyYCwLXnlUB1lOAXQyNSPqPLQJvmo8J0DWBzp9mtg= -github.com/aws/session-manager-plugin v0.0.0-20241010233726-61cf1288c7c6 h1:iQc6pdTje/w3D3vrocVIvcosNVQGjoGxqBgPpwG28BY= -github.com/aws/session-manager-plugin v0.0.0-20241010233726-61cf1288c7c6/go.mod h1:7n17tunRPUsniNBu5Ja9C7WwJWTdOzaLqr/H0Ns3uuI= +github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.4.7 h1:tB4tNw83KcajNAzaIMhkhVI2Nt8fAZd5A5ro113FEMY= +github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.4.7/go.mod h1:lvpyBGkZ3tZ9iSsUIcC2EWp+0ywa7aK3BLT+FwZi+mQ= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.7 h1:8eUsivBQzZHqe/3FE+cqwfH+0p5Jo8PFM/QYQSmeZ+M= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.7/go.mod h1:kLPQvGUmxn/fqiCrDeohwG33bq2pQpGeY62yRO6Nrh0= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.7 h1:Hi0KGbrnr57bEHWM0bJ1QcBzxLrL/k2DHvGYhb8+W1w= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.7/go.mod h1:wKNgWgExdjjrm4qvfbTorkvocEstaoDl4WCvGfeCy9c= +github.com/aws/aws-sdk-go-v2/service/s3 v1.71.1 h1:aOVVZJgWbaH+EJYPvEgkNhCEbXXvH7+oML36oaPK3zE= +github.com/aws/aws-sdk-go-v2/service/s3 v1.71.1/go.mod h1:r+xl5yzMk9083rMR+sJ5TYj9Tihvf/l1oxzZXDgGj2Q= +github.com/aws/aws-sdk-go-v2/service/ssm v1.55.2 h1:z6Pq4+jtKlhK4wWJGHRGwMLGjC1HZwAO3KJr/Na0tSU= +github.com/aws/aws-sdk-go-v2/service/ssm v1.55.2/go.mod h1:DSmu/VZzpQlAubWBbAvNpt+S4k/XweglJi4XaDGyvQk= +github.com/aws/aws-sdk-go-v2/service/sso v1.24.8 h1:CvuUmnXI7ebaUAhbJcDy9YQx8wHR69eZ9I7q5hszt/g= +github.com/aws/aws-sdk-go-v2/service/sso v1.24.8/go.mod h1:XDeGv1opzwm8ubxddF0cgqkZWsyOtw4lr6dxwmb6YQg= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.7 h1:F2rBfNAL5UyswqoeWv9zs74N/NanhK16ydHW1pahX6E= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.7/go.mod h1:JfyQ0g2JG8+Krq0EuZNnRwX0mU0HrwY/tG6JNfcqh4k= +github.com/aws/aws-sdk-go-v2/service/sts v1.33.3 h1:Xgv/hyNgvLda/M9l9qxXc4UFSgppnRczLxlMs5Ae/QY= +github.com/aws/aws-sdk-go-v2/service/sts v1.33.3/go.mod h1:5Gn+d+VaaRgsjewpMvGazt0WfcFO+Md4wLOuBfGR9Bc= +github.com/aws/session-manager-plugin v0.0.0-20241119210807-82dc72922492 h1:Ihams/fjKo4iWwM313ng2gCJWoetsL7ZQkXhOTmVUq4= +github.com/aws/session-manager-plugin v0.0.0-20241119210807-82dc72922492/go.mod h1:7n17tunRPUsniNBu5Ja9C7WwJWTdOzaLqr/H0Ns3uuI= github.com/aws/smithy-go v1.22.1 h1:/HPHZQ0g7f4eUeK6HKglFz8uwVfZKgoI25rb/J+dnro= github.com/aws/smithy-go v1.22.1/go.mod h1:irrKGvNn1InZwb2d7fkIRNucdfwR8R+Ts3wxYa/cJHg= github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k= @@ -130,8 +130,8 @@ github.com/cheggaaa/pb v1.0.29/go.mod h1:W40334L7FMC5JKWldsTWbdGjLo0RxUKK73K+TuP github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 h1:kHaBemcxl8o/pQ5VM1c8PVE1PubbNx3mjUr09OqWGCs= github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575/go.mod h1:9d6lWj8KzO/fd/NrVaLscBKmPigpZpn5YawRPw+e3Yo= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cloudflare/circl v1.3.7 h1:qlCDlTPz2n9fu58M0Nh1J/JzcFpfgkFHHX3O35r5vcU= -github.com/cloudflare/circl v1.3.7/go.mod h1:sRTcRWXGLrKw6yIGJ+l7amYJFfAXbZG0kBSc8r4zxgA= +github.com/cloudflare/circl v1.3.8 h1:j+V8jJt09PoeMFIu2uh5JUyEaIHTXVOHslFoLNAKqwI= +github.com/cloudflare/circl v1.3.8/go.mod h1:PDRU+oXvdD7KCtgKxW95M5Z8BpSCJXQORiZFnBQS5QU= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/containerd/console v1.0.4 h1:F2g4+oChYvBTsASRTz8NP6iIAi97J3TtSAsLbIFn4ro= github.com/containerd/console v1.0.4/go.mod h1:YynlIjWYF8myEu6sdkwKIvGQq+cOckRm6So2avqoYAk= @@ -139,8 +139,8 @@ github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I= github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo= github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/creack/pty v1.1.20 h1:VIPb/a2s17qNeQgDnkfZC35RScx+blkKF8GV68n80J4= -github.com/creack/pty v1.1.20/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4= +github.com/creack/pty v1.1.21 h1:1/QdRyBaHHJP61QkWMXlOIBfsgdDeeKfK8SYVUWJKf0= +github.com/creack/pty v1.1.21/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4= github.com/cyphar/filepath-securejoin v0.3.4 h1:VBWugsJh2ZxJmLFSM06/0qzQyiQX2Qs0ViKrUAcqdZ8= github.com/cyphar/filepath-securejoin v0.3.4/go.mod h1:8s/MCNJREmFK0H02MF6Ihv1nakJe4L/w3WZLHNkvlYM= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -153,10 +153,10 @@ github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5Qvfr github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= github.com/djherbis/times v1.6.0 h1:w2ctJ92J8fBvWPxugmXIv7Nz7Q3iDMKNx9v5ocVH20c= github.com/djherbis/times v1.6.0/go.mod h1:gOHeRAz2h+VJNZ5Gmc/o7iD9k4wW7NMVqieYCY99oc0= -github.com/docker/cli v27.1.1+incompatible h1:goaZxOqs4QKxznZjjBWKONQci/MywhtRv2oNn0GkeZE= -github.com/docker/cli v27.1.1+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= -github.com/docker/docker v27.3.1+incompatible h1:KttF0XoteNTicmUtBO0L2tP+J7FGRFTjaEF4k6WdhfI= -github.com/docker/docker v27.3.1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/cli v27.4.0+incompatible h1:/nJzWkcI1MDMN+U+px/YXnQWJqnu4J+QKGTfD6ptiTc= +github.com/docker/cli v27.4.0+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= +github.com/docker/docker v27.4.0+incompatible h1:I9z7sQ5qyzO0BfAb9IMOawRkAGxhYsidKiTMcm0DU+A= +github.com/docker/docker v27.4.0+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj1Br63c= github.com/docker/go-connections v0.5.0/go.mod h1:ov60Kzw0kKElRwhNs9UlUHAE/F9Fe6GLaXnqyDdmEXc= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= @@ -205,12 +205,12 @@ github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= -github.com/go-openapi/jsonpointer v0.20.2 h1:mQc3nmndL8ZBzStEo3JYF8wzmeWffDH4VbXz58sAx6Q= -github.com/go-openapi/jsonpointer v0.20.2/go.mod h1:bHen+N0u1KEO3YlmqOjTT9Adn1RfD91Ar825/PuiRVs= -github.com/go-openapi/jsonreference v0.20.4 h1:bKlDxQxQJgwpUSgOENiMPzCTBVuc7vTdXSSgNeAhojU= -github.com/go-openapi/jsonreference v0.20.4/go.mod h1:5pZJyJP2MnYCpoeoMAql78cCHauHj0V9Lhc506VOpw4= -github.com/go-openapi/swag v0.22.9 h1:XX2DssF+mQKM2DHsbgZK74y/zj4mo9I99+89xUmuZCE= -github.com/go-openapi/swag v0.22.9/go.mod h1:3/OXnFfnMAwBD099SwYRk7GD3xOrr1iL7d/XNLXVVwE= +github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ= +github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY= +github.com/go-openapi/jsonreference v0.21.0 h1:Rs+Y7hSXT83Jacb7kFyjn4ijOuVGSvOdF2+tg1TRrwQ= +github.com/go-openapi/jsonreference v0.21.0/go.mod h1:LmZmgsrTkVg9LG4EaHeY8cBDslNPMo06cago5JNLkm4= +github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE= +github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ= github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= github.com/goccy/go-json v0.10.3 h1:KZ5WoDbxAIgm2HNbYckL0se1fHD6rz5j4ywS6ebzDqA= @@ -232,8 +232,8 @@ github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/google/btree v1.1.3 h1:CVpQJjYgC4VbzxeGVHfvZrv1ctoYCAI8vbl07Fcxlyg= github.com/google/btree v1.1.3/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= -github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I= -github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U= +github.com/google/gnostic-models v0.6.9-0.20230804172637-c7be7c783f49 h1:0VpGH+cDhbDtdcweoyCVsF3fhN8kejK6rFe/2FFX2nU= +github.com/google/gnostic-models v0.6.9-0.20230804172637-c7be7c783f49/go.mod h1:BkkQ4L1KS1xMt2aWSPStnn55ChGC0DPOn2FQYj+f25M= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= @@ -259,8 +259,8 @@ github.com/grpc-ecosystem/grpc-gateway/v2 v2.23.0 h1:ad0vkEBuk23VJzZR9nkLVG0YAoN github.com/grpc-ecosystem/grpc-gateway/v2 v2.23.0/go.mod h1:igFoXX2ELCW06bol23DWPB5BEWfZISOzSP5K2sbLea0= github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645 h1:MJG/KsmcqMwFAkh8mTnAwhyKoB+sTAnY4CACC110tbU= github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645/go.mod h1:6iZfnjpejD4L/4DwD7NryNaJyCQdzwWwH2MWhCA90Kw= -github.com/hairyhenderson/go-codeowners v0.5.0 h1:dpQB+hVHiRc2VVvc2BHxkuM+tmu9Qej/as3apqUbsWc= -github.com/hairyhenderson/go-codeowners v0.5.0/go.mod h1:R3uW1OQXEj2Gu6/OvZ7bt6hr0qdkLvUWPiqNaWnexpo= +github.com/hairyhenderson/go-codeowners v0.7.0 h1:s0W4wF8bdsBEjTWzwzSlsatSthWtTAF2xLgo4a4RwAo= +github.com/hairyhenderson/go-codeowners v0.7.0/go.mod h1:wUlNgQ3QjqC4z8DnM5nnCYVq/icpqXJyJOukKx5U8/Q= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= @@ -268,8 +268,8 @@ github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+l github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= -github.com/hashicorp/hcl/v2 v2.20.1 h1:M6hgdyz7HYt1UN9e61j+qKJBqR3orTWbI1HKBJEdxtc= -github.com/hashicorp/hcl/v2 v2.20.1/go.mod h1:TZDqQ4kNKCbh1iJp99FdPiUaVDDUPivbqxZulxDYqL4= +github.com/hashicorp/hcl/v2 v2.22.0 h1:hkZ3nCtqeJsDhPRFz5EA9iwcG1hNWGePOTw6oyul12M= +github.com/hashicorp/hcl/v2 v2.22.0/go.mod h1:62ZYHrXgPoX8xBnzl8QzbWq4dyDsDtfCRgIq1rbJEvA= github.com/imdario/mergo v0.3.16 h1:wwQJbIsHYGMUyLSPrEq1CT16AhnhNJQ51+4fdHUnCl4= github.com/imdario/mergo v0.3.16/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= @@ -381,10 +381,12 @@ github.com/pjbgf/sha1cd v0.3.0/go.mod h1:nZ1rrWOcGJ5uZgEEVL1VUM9iRQiZvWdbZjkKyFz github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/sftp v1.13.6 h1:JFZT4XbOU7l77xGSpOdW+pwIMqP044IyjXX6FGyEKFo= -github.com/pkg/sftp v1.13.6/go.mod h1:tz1ryNURKu77RL+GuCzmoJYxQczL3wLNNpPWagdg4Qk= +github.com/pkg/sftp v1.13.7 h1:uv+I3nNJvlKZIQGSr8JVQLNHFU9YhhNpvC14Y6KgmSM= +github.com/pkg/sftp v1.13.7/go.mod h1:KMKI0t3T6hfA+lTR/ssZdunHo+uwq7ghoN09/FSu3DY= github.com/pkg/term v1.1.0 h1:xIAAdCMh3QIAy+5FrE8Ad8XoDhEU4ufwbaSozViP9kk= github.com/pkg/term v1.1.0/go.mod h1:E25nymQcrSllhX42Ok8MRm1+hyBdHY0dCeiKZ9jpNGw= +github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 h1:GFCKgmp0tecUJ0sJuv4pzYCqS9+RGSn52M3FUwPs+uo= +github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10/go.mod h1:t/avpk3KcrXxUnYOhZhMXJlSEyie6gQbtLq5NM3loB8= 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= @@ -401,42 +403,40 @@ github.com/pulumi/appdash v0.0.0-20231130102222-75f619a67231 h1:vkHw5I/plNdTr435 github.com/pulumi/appdash v0.0.0-20231130102222-75f619a67231/go.mod h1:murToZ2N9hNJzewjHBgfFdXhZKjY3z5cYC1VXk+lbFE= github.com/pulumi/esc v0.10.0 h1:jzBKzkLVW0mePeanDRfqSQoCJ5yrkux0jIwAkUxpRKE= github.com/pulumi/esc v0.10.0/go.mod h1:2Bfa+FWj/xl8CKqRTWbWgDX0SOD4opdQgvYSURTGK2c= -github.com/pulumi/pulumi-aws/sdk/v6 v6.56.1 h1:wA38Ep4sEphX+3YGwFfaxRHs7NQv8dNObFepX6jaRa4= -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-aws/sdk/v6 v6.65.0 h1:OvCLqUueOja9YE2WEGPYAw+lKHFRbLQ7QjwX55+uNsA= +github.com/pulumi/pulumi-aws/sdk/v6 v6.65.0/go.mod h1:FFzye44v9E0BgaFXVB/9X7KH0S0MapoXEy2YonrQfz4= +github.com/pulumi/pulumi-awsx/sdk/v2 v2.19.0 h1:jil2EBzZnKsRDrLfvx2gnAaq17HQLrTbpPsIb3h+98U= +github.com/pulumi/pulumi-awsx/sdk/v2 v2.19.0/go.mod h1:r+K4M7jnLqvvQDeR/0mBRq2EPZaqsDg24Ciy3ml/thA= +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-docker/sdk/v4 v4.5.7 h1:cuIl5YyIghqtnFMGsdtPOeaNSix5S2CrqO0/UZ1Yjsc= +github.com/pulumi/pulumi-docker/sdk/v4 v4.5.7/go.mod h1:f2ek887nKRSwNtqTqCFENJSOH0PXm1b3FhzSXYL0IyM= +github.com/pulumi/pulumi-eks/sdk/v3 v3.4.0 h1:s2Cpu6E2lmADNUbutbJGm6O+O9j0mBLlrhQmc40ukt0= +github.com/pulumi/pulumi-eks/sdk/v3 v3.4.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-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-kubernetes/sdk/v4 v4.19.0 h1:7AjJpUyW6YHHpZr0bI6Fy1A3/b7ERxq1LAo5mlyNN1Y= +github.com/pulumi/pulumi-kubernetes/sdk/v4 v4.19.0/go.mod h1:ATS+UN8pguMxypQAK+SaPewesU+UN5dpf93PNqVuHzs= +github.com/pulumi/pulumi-libvirt/sdk v0.5.3 h1:CiUGTweLLIxbAbADxxnwPv4BK8pxXfU8urokJvK1ihM= +github.com/pulumi/pulumi-libvirt/sdk v0.5.3/go.mod h1:gAhyIZKtzs4rknrl8fu8BQnyqijAmViFbaUkyuHt4xY= github.com/pulumi/pulumi-random/sdk/v4 v4.16.7 h1:39rhOe/PTUGMYia8pR5T2wbxxMt2pwrlonf0ncYKSzE= github.com/pulumi/pulumi-random/sdk/v4 v4.16.7/go.mod h1:cxxDhJzUPt/YElfvlWa15Q4NGF6XXS8kUs4OQsCxSBk= github.com/pulumi/pulumi-tls/sdk/v4 v4.11.1 h1:tXemWrzeVTqG8zq6hBdv1TdPFXjgZ+dob63a/6GlF1o= github.com/pulumi/pulumi-tls/sdk/v4 v4.11.1/go.mod h1:hODo3iEmmXDFOXqPK+V+vwI0a3Ww7BLjs5Tgamp86Ng= -github.com/pulumi/pulumi/sdk/v3 v3.140.0 h1:+Z/RBvdYg7tBNkBwk4p/FzlV7niBT3TbLAICq/Y0LDU= -github.com/pulumi/pulumi/sdk/v3 v3.140.0/go.mod h1:PvKsX88co8XuwuPdzolMvew5lZV+4JmZfkeSjj7A6dI= +github.com/pulumi/pulumi/sdk/v3 v3.142.0 h1:SmcVddGuvwAh3g3XUVQQ5gVRQUKH1yZ6iETpDNHIHlw= +github.com/pulumi/pulumi/sdk/v3 v3.142.0/go.mod h1:PvKsX88co8XuwuPdzolMvew5lZV+4JmZfkeSjj7A6dI= github.com/pulumiverse/pulumi-time/sdk v0.1.0 h1:xfi9HKDgV+GgDxQ23oSv9KxC3DQqViGTcMrJICRgJv0= github.com/pulumiverse/pulumi-time/sdk v0.1.0/go.mod h1:NUa1zA74DF002WrM6iF111A6UjX9knPpXufVRvBwNyg= github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE= @@ -517,18 +517,18 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -github.com/zclconf/go-cty v1.14.4 h1:uXXczd9QDGsgu0i/QFR/hzI5NYCHLf6NQw/atrbnhq8= -github.com/zclconf/go-cty v1.14.4/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE= +github.com/zclconf/go-cty v1.15.0 h1:tTCRWxsexYUmtt/wVxgDClUe+uQusuI443uL6e+5sXQ= +github.com/zclconf/go-cty v1.15.0/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE= github.com/zorkian/go-datadog-api v2.30.0+incompatible h1:R4ryGocppDqZZbnNc5EDR8xGWF/z/MxzWnqTUijDQes= github.com/zorkian/go-datadog-api v2.30.0+incompatible/go.mod h1:PkXwHX9CUQa/FpB9ZwAD45N1uhCW4MT/Wj7m36PbKss= -go.opentelemetry.io/collector/component v0.114.0 h1:SVGbm5LvHGSTEDv7p92oPuBgK5tuiWR82I9+LL4TtBE= -go.opentelemetry.io/collector/component v0.114.0/go.mod h1:MLxtjZ6UVHjDxSdhGLuJfHBHvfl1iT/Y7IaQPD24Eww= -go.opentelemetry.io/collector/config/configtelemetry v0.114.0 h1:kjLeyrumge6wsX6ZIkicdNOlBXaEyW2PI2ZdVXz/rzY= -go.opentelemetry.io/collector/config/configtelemetry v0.114.0/go.mod h1:R0MBUxjSMVMIhljuDHWIygzzJWQyZHXXWIgQNxcFwhc= -go.opentelemetry.io/collector/extension v0.114.0 h1:9Qb92y8hD2WDC5aMDoj4JNQN+/5BQYJWPUPzLXX+iGw= -go.opentelemetry.io/collector/extension v0.114.0/go.mod h1:Yk2/1ptVgfTr12t+22v93nYJpioP14pURv2YercSzU0= -go.opentelemetry.io/collector/pdata v1.20.0 h1:ePcwt4bdtISP0loHaE+C9xYoU2ZkIvWv89Fob16o9SM= -go.opentelemetry.io/collector/pdata v1.20.0/go.mod h1:Ox1YVLe87cZDB/TL30i4SUz1cA5s6AM6SpFMfY61ICs= +go.opentelemetry.io/collector/component v0.115.0 h1:iLte1oCiXzjiCnaOBKdsXacfFiECecpWxW3/LeriMoo= +go.opentelemetry.io/collector/component v0.115.0/go.mod h1:oIUFiH7w1eOimdeYhFI+gAIxYSiLDocKVJ0PTvX7d6s= +go.opentelemetry.io/collector/config/configtelemetry v0.115.0 h1:U07FinCDop+r2RjWQ3aP9ZWONC7r7kQIp1GkXQi6nsI= +go.opentelemetry.io/collector/config/configtelemetry v0.115.0/go.mod h1:SlBEwQg0qly75rXZ6W1Ig8jN25KBVBkFIIAUI1GiAAE= +go.opentelemetry.io/collector/extension v0.115.0 h1:/cBb8AUdD0KMWC6V3lvCC16eP9Fg0wd1Upcp5rgvuGI= +go.opentelemetry.io/collector/extension v0.115.0/go.mod h1:HI7Ak6loyi6ZrZPsQJW1OO1wbaAW8OqXLFNQlTZnreQ= +go.opentelemetry.io/collector/pdata v1.21.0 h1:PG+UbiFMJ35X/WcAR7Rf/PWmWtRdW0aHlOidsR6c5MA= +go.opentelemetry.io/collector/pdata v1.21.0/go.mod h1:GKb1/zocKJMvxKbS+sl0W85lxhYBTFJ6h6I1tphVyDU= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.56.0 h1:UP6IpuHFkUgOQL9FFQFrZ+5LiwhhYRbi7VZSIx6Nj5s= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.56.0/go.mod h1:qxuZLtbq5QDtdeSHsS7bcf6EH6uO6jUAgk764zd3rhM= go.opentelemetry.io/otel v1.32.0 h1:WnBN+Xjcteh0zdk01SVqV55d/m62NJLJdIyb4y/WO5U= @@ -560,12 +560,12 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= -golang.org/x/crypto v0.29.0 h1:L5SG1JTTXupVV3n6sUqMTeWbjAyfPwoda2DLX8J8FrQ= -golang.org/x/crypto v0.29.0/go.mod h1:+F4F4N5hv6v38hfeYwTdx20oUvLLc+QfrE9Ax9HtgRg= +golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= +golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U= +golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f h1:XdNn9LlyWAhLVp6P/i8QYBW+hlyhrhei9uErw2B5GJo= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f/go.mod h1:D5SMRVC3C2/4+F/DB1wZsLRnSNimn2Sp/NPsCrsv8ak= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884 h1:Y/Mj/94zIQQGHVSv1tTtQBDaQaJe62U9bkDZKKyhPCU= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -575,6 +575,7 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.22.0 h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4= golang.org/x/mod v0.22.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -592,9 +593,10 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= -golang.org/x/net v0.31.0 h1:68CPQngjLL0r2AlUKiSxtQFKvzRVbnzLwMUn5SzcLHo= -golang.org/x/net v0.31.0/go.mod h1:P4fl1q7dY2hnZFxEk4pPSkDHF+QqjitcnDjUQyMM+pM= +golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= +golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.23.0 h1:PbgcYx2W7i4LvjJWEbf0ngHV6qJYr86PkAV3bXdLEbs= @@ -607,8 +609,9 @@ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.9.0 h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ= -golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= +golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -632,21 +635,28 @@ golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.15.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= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.26.0 h1:WEQa6V3Gja/BhNxg540hBip/kkaYtRg3cxg4oXSw4AU= -golang.org/x/term v0.26.0/go.mod h1:Si5m1o57C5nBNQo5z1iq+XDijt21BDBDp2bK0QI8e3E= +golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= +golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= +golang.org/x/term v0.27.0 h1:WP60Sv1nlK1T6SupCHbXzSaN0b9wUmsPoRS9b61A23Q= +golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= -golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.8.0 h1:9i3RxcPv3PZnitoVGMPDKZSq1xW1gK1Xy3ArNOGZfEg= golang.org/x/time v0.8.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -661,8 +671,9 @@ golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.27.0 h1:qEKojBykQkQ4EynWy4S8Weg69NumxKdn40Fce3uc/8o= -golang.org/x/tools v0.27.0/go.mod h1:sUi0ZgbwW9ZPAq26Ekut+weQPR5eIM6GQLQ1Yjm1H0Q= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= +golang.org/x/tools v0.28.0 h1:WuB6qZ4RPCQo5aP3WdKZS7i595EdWqWR8vqJTlwTVK8= +golang.org/x/tools v0.28.0/go.mod h1:dcIOrVd3mfQKTgrDVQHqCPMWy6lnhfhtX3hLXYVLfRw= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -715,14 +726,14 @@ gotest.tools/v3 v3.5.1 h1:EENdUnS3pdur5nybKYIh2Vfgc8IUNBjxDPSjtiJcOzU= gotest.tools/v3 v3.5.1/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -k8s.io/api v0.31.2 h1:3wLBbL5Uom/8Zy98GRPXpJ254nEFpl+hwndmk9RwmL0= -k8s.io/api v0.31.2/go.mod h1:bWmGvrGPssSK1ljmLzd3pwCQ9MgoTsRCuK35u6SygUk= -k8s.io/apimachinery v0.31.2 h1:i4vUt2hPK56W6mlT7Ry+AO8eEsyxMD1U44NR22CLTYw= -k8s.io/apimachinery v0.31.2/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo= +k8s.io/api v0.31.4 h1:I2QNzitPVsPeLQvexMEsj945QumYraqv9m74isPDKhM= +k8s.io/api v0.31.4/go.mod h1:d+7vgXLvmcdT1BCo79VEgJxHHryww3V5np2OYTr6jdw= +k8s.io/apimachinery v0.31.4 h1:8xjE2C4CzhYVm9DGf60yohpNUh5AEBnPxCryPBECmlM= +k8s.io/apimachinery v0.31.4/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo= k8s.io/cli-runtime v0.31.2 h1:7FQt4C4Xnqx8V1GJqymInK0FFsoC+fAZtbLqgXYVOLQ= k8s.io/cli-runtime v0.31.2/go.mod h1:XROyicf+G7rQ6FQJMbeDV9jqxzkWXTYD6Uxd15noe0Q= -k8s.io/client-go v0.31.2 h1:Y2F4dxU5d3AQj+ybwSMqQnpZH9F30//1ObxOKlTI9yc= -k8s.io/client-go v0.31.2/go.mod h1:NPa74jSVR/+eez2dFsEIHNa+3o09vtNaWwWwb1qSxSs= +k8s.io/client-go v0.31.3 h1:CAlZuM+PH2cm+86LOBemaJI/lQ5linJ6UFxKX/SoG+4= +k8s.io/client-go v0.31.3/go.mod h1:2CgjPUTpv3fE5dNygAr2NcM8nhHzXvxB8KL5gYc3kJs= k8s.io/component-base v0.31.2 h1:Z1J1LIaC0AV+nzcPRFqfK09af6bZ4D1nAOpWsy9owlA= k8s.io/component-base v0.31.2/go.mod h1:9PeyyFN/drHjtJZMCTkSpQJS3U9OXORnHQqMLDz0sUQ= k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= diff --git a/test/new-e2e/pkg/components/docker_agent.go b/test/new-e2e/pkg/components/docker_agent.go index deacbdab7d9ca..ca251deb8bca1 100644 --- a/test/new-e2e/pkg/components/docker_agent.go +++ b/test/new-e2e/pkg/components/docker_agent.go @@ -6,7 +6,7 @@ package components import ( - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/common" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/e2e/client" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/e2e/client/agentclient" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/e2e/client/agentclientparams" @@ -23,10 +23,10 @@ type DockerAgent struct { ClientOptions []agentclientparams.Option } -var _ e2e.Initializable = (*DockerAgent)(nil) +var _ common.Initializable = (*DockerAgent)(nil) // Init is called by e2e test Suite after the component is provisioned. -func (a *DockerAgent) Init(ctx e2e.Context) (err error) { +func (a *DockerAgent) Init(ctx common.Context) (err error) { a.Client, err = client.NewDockerAgentClient(ctx, a.DockerAgentOutput, a.ClientOptions...) return err } diff --git a/test/new-e2e/pkg/components/ecs_cluster.go b/test/new-e2e/pkg/components/ecs_cluster.go index 781dc6f3edd59..8a3c1a003ab99 100644 --- a/test/new-e2e/pkg/components/ecs_cluster.go +++ b/test/new-e2e/pkg/components/ecs_cluster.go @@ -8,8 +8,7 @@ package components import ( "github.com/DataDog/test-infra-definitions/components/ecs" - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" - + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/common" clientecs "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/e2e/client/ecs" ) @@ -20,10 +19,10 @@ type ECSCluster struct { ECSClient *clientecs.Client } -var _ e2e.Initializable = &ECSCluster{} +var _ common.Initializable = &ECSCluster{} // Init is called by e2e test Suite after the component is provisioned. -func (c *ECSCluster) Init(e2e.Context) error { +func (c *ECSCluster) Init(common.Context) error { ecsClient, err := clientecs.NewClient(c.ClusterOutput.ClusterName) if err != nil { diff --git a/test/new-e2e/pkg/components/fakeintake.go b/test/new-e2e/pkg/components/fakeintake.go index 7f8a4ca55ee6a..83e521c0474c5 100644 --- a/test/new-e2e/pkg/components/fakeintake.go +++ b/test/new-e2e/pkg/components/fakeintake.go @@ -7,7 +7,7 @@ package components import ( "github.com/DataDog/datadog-agent/test/fakeintake/client" - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/common" "github.com/DataDog/test-infra-definitions/components/datadog/fakeintake" ) @@ -19,10 +19,10 @@ type FakeIntake struct { client *client.Client } -var _ e2e.Initializable = &FakeIntake{} +var _ common.Initializable = &FakeIntake{} // Init is called by e2e test Suite after the component is provisioned. -func (fi *FakeIntake) Init(e2e.Context) error { +func (fi *FakeIntake) Init(common.Context) error { fi.client = client.NewClient(fi.URL) return nil } diff --git a/test/new-e2e/pkg/components/kubernetes_cluster.go b/test/new-e2e/pkg/components/kubernetes_cluster.go index 618fc07e9e57b..10e2ae6652952 100644 --- a/test/new-e2e/pkg/components/kubernetes_cluster.go +++ b/test/new-e2e/pkg/components/kubernetes_cluster.go @@ -8,7 +8,7 @@ package components import ( "time" - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/common" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/e2e/client" "github.com/DataDog/test-infra-definitions/components/kubernetes" @@ -26,10 +26,10 @@ type KubernetesCluster struct { KubernetesClient *client.KubernetesClient } -var _ e2e.Initializable = &KubernetesCluster{} +var _ common.Initializable = &KubernetesCluster{} // Init is called by e2e test Suite after the component is provisioned. -func (kc *KubernetesCluster) Init(e2e.Context) error { +func (kc *KubernetesCluster) Init(common.Context) error { config, err := clientcmd.RESTConfigFromKubeConfig([]byte(kc.KubeConfig)) if err != nil { return err diff --git a/test/new-e2e/pkg/components/remotehost.go b/test/new-e2e/pkg/components/remotehost.go index 1bca18704e1f9..305d451f8ad5a 100644 --- a/test/new-e2e/pkg/components/remotehost.go +++ b/test/new-e2e/pkg/components/remotehost.go @@ -6,7 +6,7 @@ package components import ( - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/common" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/e2e/client" osComp "github.com/DataDog/test-infra-definitions/components/os" @@ -18,13 +18,13 @@ type RemoteHost struct { remote.HostOutput *client.Host - context e2e.Context + context common.Context } -var _ e2e.Initializable = (*RemoteHost)(nil) +var _ common.Initializable = (*RemoteHost)(nil) // Init is called by e2e test Suite after the component is provisioned. -func (h *RemoteHost) Init(ctx e2e.Context) (err error) { +func (h *RemoteHost) Init(ctx common.Context) (err error) { h.context = ctx h.Host, err = client.NewHost(ctx, h.HostOutput) return err diff --git a/test/new-e2e/pkg/components/remotehost_agent.go b/test/new-e2e/pkg/components/remotehost_agent.go index b836eda7a2efe..07c976c72af78 100644 --- a/test/new-e2e/pkg/components/remotehost_agent.go +++ b/test/new-e2e/pkg/components/remotehost_agent.go @@ -6,7 +6,7 @@ package components import ( - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/common" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/e2e/client" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/e2e/client/agentclient" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/e2e/client/agentclientparams" @@ -22,10 +22,10 @@ type RemoteHostAgent struct { ClientOptions []agentclientparams.Option } -var _ e2e.Initializable = (*RemoteHostAgent)(nil) +var _ common.Initializable = (*RemoteHostAgent)(nil) // Init is called by e2e test Suite after the component is provisioned. -func (a *RemoteHostAgent) Init(ctx e2e.Context) (err error) { +func (a *RemoteHostAgent) Init(ctx common.Context) (err error) { a.Client, err = client.NewHostAgentClientWithParams(ctx, a.HostAgentOutput.Host, a.ClientOptions...) return err } diff --git a/test/new-e2e/pkg/components/remotehost_docker.go b/test/new-e2e/pkg/components/remotehost_docker.go index f646949910771..ffe6c672042aa 100644 --- a/test/new-e2e/pkg/components/remotehost_docker.go +++ b/test/new-e2e/pkg/components/remotehost_docker.go @@ -6,9 +6,10 @@ package components import ( - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/e2e/client" "github.com/DataDog/test-infra-definitions/components/docker" + + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/common" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/e2e/client" ) // RemoteHostDocker represents an Agent running directly on a Host @@ -18,10 +19,10 @@ type RemoteHostDocker struct { Client *client.Docker } -var _ e2e.Initializable = (*RemoteHostDocker)(nil) +var _ common.Initializable = (*RemoteHostDocker)(nil) // Init is called by e2e test Suite after the component is provisioned. -func (d *RemoteHostDocker) Init(ctx e2e.Context) (err error) { +func (d *RemoteHostDocker) Init(ctx common.Context) (err error) { d.Client, err = client.NewDocker(ctx.T(), d.ManagerOutput) return err } diff --git a/test/new-e2e/pkg/e2e/suite.go b/test/new-e2e/pkg/e2e/suite.go index bb15e92e7ce2e..f6f65cf172a18 100644 --- a/test/new-e2e/pkg/e2e/suite.go +++ b/test/new-e2e/pkg/e2e/suite.go @@ -154,8 +154,10 @@ import ( "github.com/DataDog/test-infra-definitions/components" "gopkg.in/zorkian/go-datadog-api.v2" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/runner" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/runner/parameters" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/common" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/infra" "github.com/stretchr/testify/suite" @@ -175,7 +177,7 @@ type Suite[Env any] interface { init(params []SuiteOption, self Suite[Env]) - UpdateEnv(...Provisioner) + UpdateEnv(...provisioners.Provisioner) Env() *Env } @@ -189,8 +191,8 @@ type BaseSuite[Env any] struct { datadogClient *datadog.Client params suiteParams - originalProvisioners ProvisionerMap - currentProvisioners ProvisionerMap + originalProvisioners provisioners.ProvisionerMap + currentProvisioners provisioners.ProvisionerMap firstFailTest string startTime time.Time @@ -211,9 +213,9 @@ func (bs *BaseSuite[Env]) Env() *Env { } // UpdateEnv updates the environment with new provisioners. -func (bs *BaseSuite[Env]) UpdateEnv(newProvisioners ...Provisioner) { +func (bs *BaseSuite[Env]) UpdateEnv(newProvisioners ...provisioners.Provisioner) { uniqueIDs := make(map[string]struct{}) - targetProvisioners := make(ProvisionerMap, len(newProvisioners)) + targetProvisioners := make(provisioners.ProvisionerMap, len(newProvisioners)) for _, provisioner := range newProvisioners { if _, found := uniqueIDs[provisioner.ID()]; found { panic(fmt.Errorf("Multiple providers with same id found, provisioner with id %s already exists", provisioner.ID())) @@ -275,7 +277,7 @@ func (bs *BaseSuite[Env]) init(options []SuiteOption, self Suite[Env]) { bs.originalProvisioners = bs.params.provisioners } -func (bs *BaseSuite[Env]) reconcileEnv(targetProvisioners ProvisionerMap) error { +func (bs *BaseSuite[Env]) reconcileEnv(targetProvisioners provisioners.ProvisionerMap) error { if reflect.DeepEqual(bs.currentProvisioners, targetProvisioners) { bs.T().Logf("No change in provisioners, skipping environment update") return nil @@ -303,23 +305,23 @@ func (bs *BaseSuite[Env]) reconcileEnv(targetProvisioners ProvisionerMap) error } // Then we provision new resources - resources := make(RawResources) + resources := make(provisioners.RawResources) for id, provisioner := range targetProvisioners { - var provisionerResources RawResources + var provisionerResources provisioners.RawResources var err error bs.T().Logf("Provisioning environment stack %s with provisioner %s", bs.params.stackName, id) switch pType := provisioner.(type) { - case TypedProvisioner[Env]: + case provisioners.TypedProvisioner[Env]: provisionerResources, err = pType.ProvisionEnv(ctx, bs.params.stackName, logger, newEnv) - case UntypedProvisioner: + case provisioners.UntypedProvisioner: provisionerResources, err = pType.Provision(ctx, bs.params.stackName, logger) default: return fmt.Errorf("provisioner of type %T does not implement UntypedProvisioner nor TypedProvisioner", provisioner) } if err != nil { - if diagnosableProvisioner, ok := provisioner.(Diagnosable); ok { + if diagnosableProvisioner, ok := provisioner.(provisioners.Diagnosable); ok { stackName, err := infra.GetStackManager().GetPulumiStackName(bs.params.stackName) if err != nil { bs.T().Logf("unable to get stack name for diagnose, err: %v", err) @@ -351,7 +353,7 @@ func (bs *BaseSuite[Env]) reconcileEnv(targetProvisioners ProvisionerMap) error } // If env implements Initializable, we call Init - if initializable, ok := any(newEnv).(Initializable); ok { + if initializable, ok := any(newEnv).(common.Initializable); ok { if err := initializable.Init(bs); err != nil { return fmt.Errorf("failed to init environment, err: %v", err) } @@ -359,7 +361,7 @@ func (bs *BaseSuite[Env]) reconcileEnv(targetProvisioners ProvisionerMap) error // On success we update the current environment // We need top copy provisioners to protect against external modifications - bs.currentProvisioners = copyProvisioners(targetProvisioners) + bs.currentProvisioners = provisioners.CopyProvisioners(targetProvisioners) bs.env = newEnv return nil } @@ -407,7 +409,7 @@ func (bs *BaseSuite[Env]) createEnv() (*Env, []reflect.StructField, []reflect.Va return &env, retainedFields, retainedValues, nil } -func (bs *BaseSuite[Env]) buildEnvFromResources(resources RawResources, fields []reflect.StructField, values []reflect.Value) error { +func (bs *BaseSuite[Env]) buildEnvFromResources(resources provisioners.RawResources, fields []reflect.StructField, values []reflect.Value) error { if len(fields) != len(values) { panic("fields and values must have the same length") } @@ -446,7 +448,7 @@ func (bs *BaseSuite[Env]) buildEnvFromResources(resources RawResources, fields [ } // See if the component requires init - if initializable, ok := fieldValue.Interface().(Initializable); ok { + if initializable, ok := fieldValue.Interface().(common.Initializable); ok { if err := initializable.Init(bs); err != nil { return fmt.Errorf("failed to init resource named: %s with key: %s, err: %w", field.Name, resourceKey, err) } @@ -582,7 +584,7 @@ func (bs *BaseSuite[Env]) TearDownSuite() { for id, provisioner := range bs.originalProvisioners { // Run provisioner Diagnose before tearing down the stack - if diagnosableProvisioner, ok := provisioner.(Diagnosable); ok { + if diagnosableProvisioner, ok := provisioner.(provisioners.Diagnosable); ok { stackName, err := infra.GetStackManager().GetPulumiStackName(bs.params.stackName) if err != nil { bs.T().Logf("unable to get stack name for diagnose, err: %v", err) diff --git a/test/new-e2e/pkg/e2e/suite_params.go b/test/new-e2e/pkg/e2e/suite_params.go index bc38e26005a45..111da630670d2 100644 --- a/test/new-e2e/pkg/e2e/suite_params.go +++ b/test/new-e2e/pkg/e2e/suite_params.go @@ -8,8 +8,10 @@ package e2e import ( "fmt" - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/runner" "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/runner" ) // Params implements [BaseSuite] options @@ -22,7 +24,7 @@ type suiteParams struct { skipDeleteOnFailure bool - provisioners ProvisionerMap + provisioners provisioners.ProvisionerMap } // SuiteOption is an optional function parameter type for e2e options @@ -53,14 +55,14 @@ func WithSkipDeleteOnFailure() SuiteOption { } // WithProvisioner adds a provisioner to the suite -func WithProvisioner(provisioner Provisioner) SuiteOption { +func WithProvisioner(provisioner provisioners.Provisioner) SuiteOption { return func(options *suiteParams) { if _, found := options.provisioners[provisioner.ID()]; found { panic(fmt.Sprintf("Duplicate provider in test Suite: %s", provisioner.ID())) } if options.provisioners == nil { - options.provisioners = make(ProvisionerMap) + options.provisioners = make(provisioners.ProvisionerMap) } options.provisioners[provisioner.ID()] = provisioner @@ -69,10 +71,10 @@ func WithProvisioner(provisioner Provisioner) SuiteOption { // WithUntypedPulumiProvisioner adds an untyped Pulumi provisioner to the suite func WithUntypedPulumiProvisioner(runFunc pulumi.RunFunc, configMap runner.ConfigMap) SuiteOption { - return WithProvisioner(NewUntypedPulumiProvisioner("", runFunc, configMap)) + return WithProvisioner(provisioners.NewUntypedPulumiProvisioner("", runFunc, configMap)) } // WithPulumiProvisioner adds a typed Pulumi provisioner to the suite -func WithPulumiProvisioner[Env any](runFunc PulumiEnvRunFunc[Env], configMap runner.ConfigMap) SuiteOption { - return WithProvisioner(NewTypedPulumiProvisioner("", runFunc, configMap)) +func WithPulumiProvisioner[Env any](runFunc provisioners.PulumiEnvRunFunc[Env], configMap runner.ConfigMap) SuiteOption { + return WithProvisioner(provisioners.NewTypedPulumiProvisioner("", runFunc, configMap)) } diff --git a/test/new-e2e/pkg/e2e/suite_test.go b/test/new-e2e/pkg/e2e/suite_test.go index 37219945b2389..1e48730729eaa 100644 --- a/test/new-e2e/pkg/e2e/suite_test.go +++ b/test/new-e2e/pkg/e2e/suite_test.go @@ -14,6 +14,9 @@ import ( "github.com/DataDog/test-infra-definitions/components" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/common" ) type testTypeOutput struct { @@ -28,9 +31,9 @@ type testTypeWrapper struct { unrelatedField string //nolint:unused // mimic actual struct to validate reflection code } -var _ Initializable = &testTypeWrapper{} +var _ common.Initializable = &testTypeWrapper{} -func (t *testTypeWrapper) Init(Context) error { +func (t *testTypeWrapper) Init(common.Context) error { return nil } @@ -47,8 +50,8 @@ type testSuite struct { BaseSuite[testEnv] } -func testRawResources(key, value string) RawResources { - return RawResources{key: []byte(fmt.Sprintf(`{"myField":"%s"}`, value))} +func testRawResources(key, value string) provisioners.RawResources { + return provisioners.RawResources{key: []byte(fmt.Sprintf(`{"myField":"%s"}`, value))} } func TestCreateEnv(t *testing.T) { @@ -69,16 +72,16 @@ type testProvisioner struct { mock.Mock } -var _ UntypedProvisioner = &testProvisioner{} +var _ provisioners.UntypedProvisioner = &testProvisioner{} func (m *testProvisioner) ID() string { args := m.Called() return args.Get(0).(string) } -func (m *testProvisioner) Provision(arg0 context.Context, arg1 string, arg2 io.Writer) (RawResources, error) { +func (m *testProvisioner) Provision(arg0 context.Context, arg1 string, arg2 io.Writer) (provisioners.RawResources, error) { args := m.Called(arg0, arg1, arg2) - return args.Get(0).(RawResources), args.Error(1) + return args.Get(0).(provisioners.RawResources), args.Error(1) } func (m *testProvisioner) Destroy(arg0 context.Context, arg1 string, arg2 io.Writer) error { diff --git a/test/new-e2e/pkg/environments/dockerhost.go b/test/new-e2e/pkg/environments/dockerhost.go index 0b871efd721eb..a1c25b8a85256 100644 --- a/test/new-e2e/pkg/environments/dockerhost.go +++ b/test/new-e2e/pkg/environments/dockerhost.go @@ -7,7 +7,7 @@ package environments import ( "github.com/DataDog/datadog-agent/test/new-e2e/pkg/components" - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/common" ) // DockerHost is an environment that contains a Docker VM, FakeIntake and Agent configured to talk to each other. @@ -19,9 +19,9 @@ type DockerHost struct { Docker *components.RemoteHostDocker } -var _ e2e.Initializable = &DockerHost{} +var _ common.Initializable = &DockerHost{} // Init initializes the environment -func (e *DockerHost) Init(_ e2e.Context) error { +func (e *DockerHost) Init(_ common.Context) error { return nil } diff --git a/test/new-e2e/pkg/environments/doc.go b/test/new-e2e/pkg/environments/environments.go similarity index 100% rename from test/new-e2e/pkg/environments/doc.go rename to test/new-e2e/pkg/environments/environments.go diff --git a/test/new-e2e/pkg/environments/host.go b/test/new-e2e/pkg/environments/host.go index 20c49c3fc7762..e9b584335e0b0 100644 --- a/test/new-e2e/pkg/environments/host.go +++ b/test/new-e2e/pkg/environments/host.go @@ -7,7 +7,7 @@ package environments import ( "github.com/DataDog/datadog-agent/test/new-e2e/pkg/components" - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/common" ) // Host is an environment that contains a Host, FakeIntake and Agent configured to talk to each other. @@ -18,9 +18,9 @@ type Host struct { Updater *components.RemoteHostUpdater } -var _ e2e.Initializable = (*Host)(nil) +var _ common.Initializable = (*Host)(nil) // Init initializes the environment -func (e *Host) Init(_ e2e.Context) error { +func (e *Host) Init(_ common.Context) error { return nil } diff --git a/test/new-e2e/pkg/environments/host_win.go b/test/new-e2e/pkg/environments/host_win.go index 7c20375f0ffe1..6af84c06288f2 100644 --- a/test/new-e2e/pkg/environments/host_win.go +++ b/test/new-e2e/pkg/environments/host_win.go @@ -6,9 +6,10 @@ package environments import ( - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/components" - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/test-infra-definitions/common/config" + + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/components" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/common" ) // WindowsHost is an environment based on environments.Host but that is specific to Windows. @@ -22,9 +23,9 @@ type WindowsHost struct { Installer *components.RemoteDatadogInstaller } -var _ e2e.Initializable = &WindowsHost{} +var _ common.Initializable = &WindowsHost{} // Init initializes the environment -func (e *WindowsHost) Init(_ e2e.Context) error { +func (e *WindowsHost) Init(_ common.Context) error { return nil } diff --git a/test/new-e2e/pkg/environments/aws/docker/host.go b/test/new-e2e/pkg/provisioners/aws/docker/host.go similarity index 95% rename from test/new-e2e/pkg/environments/aws/docker/host.go rename to test/new-e2e/pkg/provisioners/aws/docker/host.go index 0e39ed8b74b20..0a730bdcf5e72 100644 --- a/test/new-e2e/pkg/environments/aws/docker/host.go +++ b/test/new-e2e/pkg/provisioners/aws/docker/host.go @@ -9,8 +9,8 @@ package awsdocker import ( "fmt" - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/runner" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/optional" @@ -224,10 +224,10 @@ func Run(ctx *pulumi.Context, env *environments.DockerHost, runParams RunParams) // Provisioner creates a VM environment with an EC2 VM with Docker, an ECS Fargate FakeIntake and a Docker Agent configured to talk to each other. // FakeIntake and Agent creation can be deactivated by using [WithoutFakeIntake] and [WithoutAgent] options. -func Provisioner(opts ...ProvisionerOption) e2e.TypedProvisioner[environments.DockerHost] { +func Provisioner(opts ...ProvisionerOption) provisioners.TypedProvisioner[environments.DockerHost] { // We need to build params here to be able to use params.name in the provisioner name params := GetProvisionerParams(opts...) - provisioner := e2e.NewTypedPulumiProvisioner(provisionerBaseID+params.name, func(ctx *pulumi.Context, env *environments.DockerHost) error { + provisioner := provisioners.NewTypedPulumiProvisioner(provisionerBaseID+params.name, func(ctx *pulumi.Context, env *environments.DockerHost) error { return Run(ctx, env, RunParams{ProvisionerParams: params}) }, params.extraConfigParams) diff --git a/test/new-e2e/pkg/environments/aws/ecs/ecs.go b/test/new-e2e/pkg/provisioners/aws/ecs/ecs.go similarity index 97% rename from test/new-e2e/pkg/environments/aws/ecs/ecs.go rename to test/new-e2e/pkg/provisioners/aws/ecs/ecs.go index 280920f2196a8..8e11e8a3ad0b9 100644 --- a/test/new-e2e/pkg/environments/aws/ecs/ecs.go +++ b/test/new-e2e/pkg/provisioners/aws/ecs/ecs.go @@ -28,8 +28,8 @@ import ( "github.com/DataDog/test-infra-definitions/scenarios/aws/ecs" "github.com/DataDog/test-infra-definitions/scenarios/aws/fakeintake" - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/runner" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/optional" ) @@ -300,10 +300,10 @@ func Run(ctx *pulumi.Context, env *environments.ECS, params *ProvisionerParams) // Provisioner creates a VM environment with an EC2 VM with Docker, an ECS Fargate FakeIntake and a Docker Agent configured to talk to each other. // FakeIntake and Agent creation can be deactivated by using [WithoutFakeIntake] and [WithoutAgent] options. -func Provisioner(opts ...ProvisionerOption) e2e.TypedProvisioner[environments.ECS] { +func Provisioner(opts ...ProvisionerOption) provisioners.TypedProvisioner[environments.ECS] { // We need to build params here to be able to use params.name in the provisioner name params := GetProvisionerParams(opts...) - provisioner := e2e.NewTypedPulumiProvisioner(provisionerBaseID+params.name, func(ctx *pulumi.Context, env *environments.ECS) error { + provisioner := provisioners.NewTypedPulumiProvisioner(provisionerBaseID+params.name, func(ctx *pulumi.Context, env *environments.ECS) error { return Run(ctx, env, params) }, params.extraConfigParams) diff --git a/test/new-e2e/pkg/environments/aws/host/host.go b/test/new-e2e/pkg/provisioners/aws/host/host.go similarity index 94% rename from test/new-e2e/pkg/environments/aws/host/host.go rename to test/new-e2e/pkg/provisioners/aws/host/host.go index 4668905ac83a8..ea652309c06e2 100644 --- a/test/new-e2e/pkg/environments/aws/host/host.go +++ b/test/new-e2e/pkg/provisioners/aws/host/host.go @@ -9,8 +9,8 @@ package awshost import ( "fmt" - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/runner" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/e2e/client/agentclientparams" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/optional" @@ -151,7 +151,7 @@ func WithDocker() ProvisionerOption { } // ProvisionerNoAgentNoFakeIntake wraps Provisioner with hardcoded WithoutAgent and WithoutFakeIntake options. -func ProvisionerNoAgentNoFakeIntake(opts ...ProvisionerOption) e2e.TypedProvisioner[environments.Host] { +func ProvisionerNoAgentNoFakeIntake(opts ...ProvisionerOption) provisioners.TypedProvisioner[environments.Host] { mergedOpts := make([]ProvisionerOption, 0, len(opts)+2) mergedOpts = append(mergedOpts, opts...) mergedOpts = append(mergedOpts, WithoutAgent(), WithoutFakeIntake()) @@ -160,7 +160,7 @@ func ProvisionerNoAgentNoFakeIntake(opts ...ProvisionerOption) e2e.TypedProvisio } // ProvisionerNoFakeIntake wraps Provisioner with hardcoded WithoutFakeIntake option. -func ProvisionerNoFakeIntake(opts ...ProvisionerOption) e2e.TypedProvisioner[environments.Host] { +func ProvisionerNoFakeIntake(opts ...ProvisionerOption) provisioners.TypedProvisioner[environments.Host] { mergedOpts := make([]ProvisionerOption, 0, len(opts)+1) mergedOpts = append(mergedOpts, opts...) mergedOpts = append(mergedOpts, WithoutFakeIntake()) @@ -283,11 +283,11 @@ func Run(ctx *pulumi.Context, env *environments.Host, runParams RunParams) error // Provisioner creates a VM environment with an EC2 VM, an ECS Fargate FakeIntake and a Host Agent configured to talk to each other. // FakeIntake and Agent creation can be deactivated by using [WithoutFakeIntake] and [WithoutAgent] options. -func Provisioner(opts ...ProvisionerOption) e2e.TypedProvisioner[environments.Host] { +func Provisioner(opts ...ProvisionerOption) provisioners.TypedProvisioner[environments.Host] { // We need to build params here to be able to use params.name in the provisioner name params := GetProvisionerParams(opts...) - provisioner := e2e.NewTypedPulumiProvisioner(provisionerBaseID+params.name, func(ctx *pulumi.Context, env *environments.Host) error { + provisioner := provisioners.NewTypedPulumiProvisioner(provisionerBaseID+params.name, func(ctx *pulumi.Context, env *environments.Host) error { // We ALWAYS need to make a deep copy of `params`, as the provisioner can be called multiple times. // and it's easy to forget about it, leading to hard to debug issues. params := GetProvisionerParams(opts...) diff --git a/test/new-e2e/pkg/environments/aws/host/windows/host.go b/test/new-e2e/pkg/provisioners/aws/host/windows/host.go similarity index 93% rename from test/new-e2e/pkg/environments/aws/host/windows/host.go rename to test/new-e2e/pkg/provisioners/aws/host/windows/host.go index 1fd5885a88c4d..642a1a7dcc2e2 100644 --- a/test/new-e2e/pkg/environments/aws/host/windows/host.go +++ b/test/new-e2e/pkg/provisioners/aws/host/windows/host.go @@ -19,8 +19,8 @@ import ( "github.com/pulumi/pulumi/sdk/v3/go/pulumi" installer "github.com/DataDog/datadog-agent/test/new-e2e/pkg/components/datadog-installer" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners" - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/e2e/client/agentclientparams" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/optional" @@ -253,10 +253,10 @@ func getProvisionerParams(opts ...ProvisionerOption) *ProvisionerParams { // Provisioner creates a VM environment with a Windows EC2 VM, an ECS Fargate FakeIntake and a Host Agent configured to talk to each other. // FakeIntake and Agent creation can be deactivated by using [WithoutFakeIntake] and [WithoutAgent] options. -func Provisioner(opts ...ProvisionerOption) e2e.TypedProvisioner[environments.WindowsHost] { +func Provisioner(opts ...ProvisionerOption) provisioners.TypedProvisioner[environments.WindowsHost] { // We need to build params here to be able to use params.name in the provisioner name params := getProvisionerParams(opts...) - provisioner := e2e.NewTypedPulumiProvisioner(provisionerBaseID+params.name, func(ctx *pulumi.Context, env *environments.WindowsHost) error { + provisioner := provisioners.NewTypedPulumiProvisioner(provisionerBaseID+params.name, func(ctx *pulumi.Context, env *environments.WindowsHost) error { // We ALWAYS need to make a deep copy of `params`, as the provisioner can be called multiple times. // and it's easy to forget about it, leading to hard to debug issues. params := getProvisionerParams(opts...) @@ -267,7 +267,7 @@ func Provisioner(opts ...ProvisionerOption) e2e.TypedProvisioner[environments.Wi } // ProvisionerNoAgent wraps Provisioner with hardcoded WithoutAgent options. -func ProvisionerNoAgent(opts ...ProvisionerOption) e2e.TypedProvisioner[environments.WindowsHost] { +func ProvisionerNoAgent(opts ...ProvisionerOption) provisioners.TypedProvisioner[environments.WindowsHost] { mergedOpts := make([]ProvisionerOption, 0, len(opts)+1) mergedOpts = append(mergedOpts, opts...) mergedOpts = append(mergedOpts, WithoutAgent()) @@ -276,7 +276,7 @@ func ProvisionerNoAgent(opts ...ProvisionerOption) e2e.TypedProvisioner[environm } // ProvisionerNoAgentNoFakeIntake wraps Provisioner with hardcoded WithoutAgent and WithoutFakeIntake options. -func ProvisionerNoAgentNoFakeIntake(opts ...ProvisionerOption) e2e.TypedProvisioner[environments.WindowsHost] { +func ProvisionerNoAgentNoFakeIntake(opts ...ProvisionerOption) provisioners.TypedProvisioner[environments.WindowsHost] { mergedOpts := make([]ProvisionerOption, 0, len(opts)+2) mergedOpts = append(mergedOpts, opts...) mergedOpts = append(mergedOpts, WithoutAgent(), WithoutFakeIntake()) @@ -285,7 +285,7 @@ func ProvisionerNoAgentNoFakeIntake(opts ...ProvisionerOption) e2e.TypedProvisio } // ProvisionerNoFakeIntake wraps Provisioner with hardcoded WithoutFakeIntake option. -func ProvisionerNoFakeIntake(opts ...ProvisionerOption) e2e.TypedProvisioner[environments.WindowsHost] { +func ProvisionerNoFakeIntake(opts ...ProvisionerOption) provisioners.TypedProvisioner[environments.WindowsHost] { mergedOpts := make([]ProvisionerOption, 0, len(opts)+1) mergedOpts = append(mergedOpts, opts...) mergedOpts = append(mergedOpts, WithoutFakeIntake()) diff --git a/test/new-e2e/pkg/environments/aws/kubernetes/eks.go b/test/new-e2e/pkg/provisioners/aws/kubernetes/eks.go similarity index 82% rename from test/new-e2e/pkg/environments/aws/kubernetes/eks.go rename to test/new-e2e/pkg/provisioners/aws/kubernetes/eks.go index 22971ae20f9ed..d65388d9746cb 100644 --- a/test/new-e2e/pkg/environments/aws/kubernetes/eks.go +++ b/test/new-e2e/pkg/provisioners/aws/kubernetes/eks.go @@ -22,12 +22,13 @@ import ( dogstatsdstandalone "github.com/DataDog/test-infra-definitions/components/datadog/dogstatsd-standalone" fakeintakeComp "github.com/DataDog/test-infra-definitions/components/datadog/fakeintake" "github.com/DataDog/test-infra-definitions/components/datadog/kubernetesagentparams" + "github.com/DataDog/test-infra-definitions/components/kubernetes/vpa" "github.com/DataDog/test-infra-definitions/resources/aws" "github.com/DataDog/test-infra-definitions/scenarios/aws/eks" "github.com/DataDog/test-infra-definitions/scenarios/aws/fakeintake" - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/optional" "github.com/pulumi/pulumi/sdk/v3/go/pulumi" @@ -42,13 +43,13 @@ func eksDiagnoseFunc(ctx context.Context, stackName string) (string, error) { } // EKSProvisioner creates a new provisioner -func EKSProvisioner(opts ...ProvisionerOption) e2e.TypedProvisioner[environments.Kubernetes] { +func EKSProvisioner(opts ...ProvisionerOption) provisioners.TypedProvisioner[environments.Kubernetes] { // We ALWAYS need to make a deep copy of `params`, as the provisioner can be called multiple times. // and it's easy to forget about it, leading to hard to debug issues. params := newProvisionerParams() _ = optional.ApplyOptions(params, opts) - provisioner := e2e.NewTypedPulumiProvisioner(provisionerBaseID+params.name, func(ctx *pulumi.Context, env *environments.Kubernetes) error { + provisioner := provisioners.NewTypedPulumiProvisioner(provisionerBaseID+params.name, func(ctx *pulumi.Context, env *environments.Kubernetes) error { // We ALWAYS need to make a deep copy of `params`, as the provisioner can be called multiple times. // and it's easy to forget about it, leading to hard to debug issues. params := newProvisionerParams() @@ -88,6 +89,12 @@ func EKSRunFunc(ctx *pulumi.Context, env *environments.Kubernetes, params *Provi return nil } + vpaCrd, err := vpa.DeployCRD(&awsEnv, cluster.KubeProvider) + if err != nil { + return err + } + dependsOnVPA := utils.PulumiDependsOn(vpaCrd) + var fakeIntake *fakeintakeComp.Fakeintake if params.fakeintakeOptions != nil { fakeIntakeOptions := []fakeintake.Option{ @@ -108,10 +115,19 @@ func EKSRunFunc(ctx *pulumi.Context, env *environments.Kubernetes, params *Provi env.FakeIntake = nil } - workloadWithCRDDeps := []pulumi.Resource{cluster} + var dependsOnDDAgent pulumi.ResourceOption // Deploy the agent if params.agentOptions != nil { params.agentOptions = append(params.agentOptions, kubernetesagentparams.WithPulumiResourceOptions(utils.PulumiDependsOn(cluster)), kubernetesagentparams.WithFakeintake(fakeIntake), kubernetesagentparams.WithTags([]string{"stackid:" + ctx.Stack()})) + + eksParams, err := eks.NewParams(params.eksOptions...) + if err != nil { + return err + } + if eksParams.WindowsNodeGroup { + params.agentOptions = append(params.agentOptions, kubernetesagentparams.WithDeployWindows()) + } + kubernetesAgent, err := helm.NewKubernetesAgent(&awsEnv, "eks", cluster.KubeProvider, params.agentOptions...) if err != nil { return err @@ -120,7 +136,7 @@ func EKSRunFunc(ctx *pulumi.Context, env *environments.Kubernetes, params *Provi if err != nil { return err } - workloadWithCRDDeps = append(workloadWithCRDDeps, kubernetesAgent) + dependsOnDDAgent = utils.PulumiDependsOn(kubernetesAgent) } else { env.Agent = nil } @@ -133,18 +149,18 @@ func EKSRunFunc(ctx *pulumi.Context, env *environments.Kubernetes, params *Provi if params.deployTestWorkload { - if _, err := cpustress.K8sAppDefinition(&awsEnv, cluster.KubeProvider, "workload-cpustress", utils.PulumiDependsOn(cluster)); err != nil { + if _, err := cpustress.K8sAppDefinition(&awsEnv, cluster.KubeProvider, "workload-cpustress"); err != nil { return err } // dogstatsd clients that report to the Agent - if _, err := dogstatsd.K8sAppDefinition(&awsEnv, cluster.KubeProvider, "workload-dogstatsd", 8125, "/var/run/datadog/dsd.socket", utils.PulumiDependsOn(cluster)); err != nil { + if _, err := dogstatsd.K8sAppDefinition(&awsEnv, cluster.KubeProvider, "workload-dogstatsd", 8125, "/var/run/datadog/dsd.socket", dependsOnDDAgent /* for admission */); err != nil { return err } if params.deployDogstatsd { // dogstatsd clients that report to the dogstatsd standalone deployment - if _, err := dogstatsd.K8sAppDefinition(&awsEnv, cluster.KubeProvider, "workload-dogstatsd-standalone", dogstatsdstandalone.HostPort, dogstatsdstandalone.Socket, utils.PulumiDependsOn(cluster)); err != nil { + if _, err := dogstatsd.K8sAppDefinition(&awsEnv, cluster.KubeProvider, "workload-dogstatsd-standalone", dogstatsdstandalone.HostPort, dogstatsdstandalone.Socket, dependsOnDDAgent /* for admission */); err != nil { return err } } @@ -157,17 +173,17 @@ func EKSRunFunc(ctx *pulumi.Context, env *environments.Kubernetes, params *Provi return err } - if _, err := mutatedbyadmissioncontroller.K8sAppDefinition(&awsEnv, cluster.KubeProvider, "workload-mutated", "workload-mutated-lib-injection", utils.PulumiDependsOn(cluster)); err != nil { + if _, err := mutatedbyadmissioncontroller.K8sAppDefinition(&awsEnv, cluster.KubeProvider, "workload-mutated", "workload-mutated-lib-injection", dependsOnDDAgent /* for admission */); err != nil { return err } // These resources cannot be deployed if the Agent is not installed, it requires some CRDs provided by the Helm chart if params.agentOptions != nil { - if _, err := nginx.K8sAppDefinition(&awsEnv, cluster.KubeProvider, "workload-nginx", "", true, utils.PulumiDependsOn(workloadWithCRDDeps...)); err != nil { + if _, err := nginx.K8sAppDefinition(&awsEnv, cluster.KubeProvider, "workload-nginx", "", true, dependsOnDDAgent /* for DDM */, dependsOnVPA); err != nil { return err } - if _, err := redis.K8sAppDefinition(&awsEnv, cluster.KubeProvider, "workload-redis", true, utils.PulumiDependsOn(workloadWithCRDDeps...)); err != nil { + if _, err := redis.K8sAppDefinition(&awsEnv, cluster.KubeProvider, "workload-redis", true, dependsOnDDAgent /* for DDM */, dependsOnVPA); err != nil { return err } } diff --git a/test/new-e2e/pkg/environments/aws/kubernetes/kind.go b/test/new-e2e/pkg/provisioners/aws/kubernetes/kind.go similarity index 83% rename from test/new-e2e/pkg/environments/aws/kubernetes/kind.go rename to test/new-e2e/pkg/provisioners/aws/kubernetes/kind.go index 60da0620167f9..b1c958cde8200 100644 --- a/test/new-e2e/pkg/environments/aws/kubernetes/kind.go +++ b/test/new-e2e/pkg/provisioners/aws/kubernetes/kind.go @@ -12,8 +12,8 @@ import ( "github.com/DataDog/test-infra-definitions/common/utils" - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/optional" "github.com/DataDog/test-infra-definitions/components/datadog/agent/helm" @@ -28,6 +28,7 @@ import ( fakeintakeComp "github.com/DataDog/test-infra-definitions/components/datadog/fakeintake" "github.com/DataDog/test-infra-definitions/components/datadog/kubernetesagentparams" kubeComp "github.com/DataDog/test-infra-definitions/components/kubernetes" + "github.com/DataDog/test-infra-definitions/components/kubernetes/vpa" "github.com/DataDog/test-infra-definitions/resources/aws" "github.com/DataDog/test-infra-definitions/scenarios/aws/ec2" "github.com/DataDog/test-infra-definitions/scenarios/aws/fakeintake" @@ -51,13 +52,13 @@ func kindDiagnoseFunc(ctx context.Context, stackName string) (string, error) { } // KindProvisioner creates a new provisioner -func KindProvisioner(opts ...ProvisionerOption) e2e.TypedProvisioner[environments.Kubernetes] { +func KindProvisioner(opts ...ProvisionerOption) provisioners.TypedProvisioner[environments.Kubernetes] { // We ALWAYS need to make a deep copy of `params`, as the provisioner can be called multiple times. // and it's easy to forget about it, leading to hard to debug issues. params := newProvisionerParams() _ = optional.ApplyOptions(params, opts) - provisioner := e2e.NewTypedPulumiProvisioner(provisionerBaseID+params.name, func(ctx *pulumi.Context, env *environments.Kubernetes) error { + provisioner := provisioners.NewTypedPulumiProvisioner(provisionerBaseID+params.name, func(ctx *pulumi.Context, env *environments.Kubernetes) error { // We ALWAYS need to make a deep copy of `params`, as the provisioner can be called multiple times. // and it's easy to forget about it, leading to hard to debug issues. params := newProvisionerParams() @@ -106,6 +107,12 @@ func KindRunFunc(ctx *pulumi.Context, env *environments.Kubernetes, params *Prov return err } + vpaCrd, err := vpa.DeployCRD(&awsEnv, kubeProvider) + if err != nil { + return err + } + dependsOnVPA := utils.PulumiDependsOn(vpaCrd) + var fakeIntake *fakeintakeComp.Fakeintake if params.fakeintakeOptions != nil { fakeintakeOpts := []fakeintake.Option{fakeintake.WithLoadBalancer()} @@ -127,21 +134,19 @@ func KindRunFunc(ctx *pulumi.Context, env *environments.Kubernetes, params *Prov env.FakeIntake = nil } - var dependsOnCrd []pulumi.Resource + var dependsOnDDAgent pulumi.ResourceOption if params.agentOptions != nil { - kindClusterName := ctx.Stack() - helmValues := fmt.Sprintf(` + helmValues := ` datadog: kubelet: tlsVerify: false - clusterName: "%s" agents: useHostNetwork: true -`, kindClusterName) +` - newOpts := []kubernetesagentparams.Option{kubernetesagentparams.WithHelmValues(helmValues), kubernetesagentparams.WithTags([]string{"stackid:" + ctx.Stack()})} + newOpts := []kubernetesagentparams.Option{kubernetesagentparams.WithHelmValues(helmValues), kubernetesagentparams.WithClusterName(kindCluster.ClusterName), kubernetesagentparams.WithTags([]string{"stackid:" + ctx.Stack()})} params.agentOptions = append(newOpts, params.agentOptions...) - agent, err := helm.NewKubernetesAgent(&awsEnv, kindClusterName, kubeProvider, params.agentOptions...) + agent, err := helm.NewKubernetesAgent(&awsEnv, "kind", kubeProvider, params.agentOptions...) if err != nil { return err } @@ -149,7 +154,7 @@ agents: if err != nil { return err } - dependsOnCrd = append(dependsOnCrd, agent) + dependsOnDDAgent = utils.PulumiDependsOn(agent) } else { env.Agent = nil } @@ -163,13 +168,13 @@ agents: // Deploy testing workload if params.deployTestWorkload { // dogstatsd clients that report to the Agent - if _, err := dogstatsd.K8sAppDefinition(&awsEnv, kubeProvider, "workload-dogstatsd", 8125, "/var/run/datadog/dsd.socket"); err != nil { + if _, err := dogstatsd.K8sAppDefinition(&awsEnv, kubeProvider, "workload-dogstatsd", 8125, "/var/run/datadog/dsd.socket", dependsOnDDAgent /* for admission */); err != nil { return err } if params.deployDogstatsd { // dogstatsd clients that report to the dogstatsd standalone deployment - if _, err := dogstatsd.K8sAppDefinition(&awsEnv, kubeProvider, "workload-dogstatsd-standalone", dogstatsdstandalone.HostPort, dogstatsdstandalone.Socket); err != nil { + if _, err := dogstatsd.K8sAppDefinition(&awsEnv, kubeProvider, "workload-dogstatsd-standalone", dogstatsdstandalone.HostPort, dogstatsdstandalone.Socket, dependsOnDDAgent /* for admission */); err != nil { return err } } @@ -182,21 +187,21 @@ agents: return err } - if _, err := mutatedbyadmissioncontroller.K8sAppDefinition(&awsEnv, kubeProvider, "workload-mutated", "workload-mutated-lib-injection"); err != nil { + if _, err := mutatedbyadmissioncontroller.K8sAppDefinition(&awsEnv, kubeProvider, "workload-mutated", "workload-mutated-lib-injection", dependsOnDDAgent /* for admission */); err != nil { return err } // These workloads can be deployed only if the agent is installed, they rely on CRDs installed by Agent helm chart if params.agentOptions != nil { - if _, err := nginx.K8sAppDefinition(&awsEnv, kubeProvider, "workload-nginx", "", true, utils.PulumiDependsOn(dependsOnCrd...)); err != nil { + if _, err := nginx.K8sAppDefinition(&awsEnv, kubeProvider, "workload-nginx", "", true, dependsOnDDAgent /* for DDM */, dependsOnVPA); err != nil { return err } - if _, err := redis.K8sAppDefinition(&awsEnv, kubeProvider, "workload-redis", true, utils.PulumiDependsOn(dependsOnCrd...)); err != nil { + if _, err := redis.K8sAppDefinition(&awsEnv, kubeProvider, "workload-redis", true, dependsOnDDAgent /* for DDM */, dependsOnVPA); err != nil { return err } - if _, err := cpustress.K8sAppDefinition(&awsEnv, kubeProvider, "workload-cpustress", utils.PulumiDependsOn(dependsOnCrd...)); err != nil { + if _, err := cpustress.K8sAppDefinition(&awsEnv, kubeProvider, "workload-cpustress"); err != nil { return err } } diff --git a/test/new-e2e/pkg/environments/aws/kubernetes/kubernetes_dump.go b/test/new-e2e/pkg/provisioners/aws/kubernetes/kubernetes_dump.go similarity index 100% rename from test/new-e2e/pkg/environments/aws/kubernetes/kubernetes_dump.go rename to test/new-e2e/pkg/provisioners/aws/kubernetes/kubernetes_dump.go diff --git a/test/new-e2e/pkg/environments/aws/kubernetes/params.go b/test/new-e2e/pkg/provisioners/aws/kubernetes/params.go similarity index 100% rename from test/new-e2e/pkg/environments/aws/kubernetes/params.go rename to test/new-e2e/pkg/provisioners/aws/kubernetes/params.go diff --git a/test/new-e2e/pkg/environments/azure/host/linux/host.go b/test/new-e2e/pkg/provisioners/azure/host/linux/host.go similarity index 92% rename from test/new-e2e/pkg/environments/azure/host/linux/host.go rename to test/new-e2e/pkg/provisioners/azure/host/linux/host.go index 5006c4c4750e3..30aa4cecedafa 100644 --- a/test/new-e2e/pkg/environments/azure/host/linux/host.go +++ b/test/new-e2e/pkg/provisioners/azure/host/linux/host.go @@ -7,13 +7,13 @@ package azurehost import ( - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/test-infra-definitions/components/os" "github.com/DataDog/test-infra-definitions/resources/azure" "github.com/DataDog/test-infra-definitions/scenarios/azure/compute" "github.com/DataDog/test-infra-definitions/scenarios/azure/fakeintake" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners" "github.com/DataDog/test-infra-definitions/components/datadog/agent" "github.com/DataDog/test-infra-definitions/components/datadog/agentparams" @@ -28,11 +28,11 @@ const ( // Provisioner creates a VM environment with an VM, a FakeIntake and a Host Agent configured to talk to each other. // FakeIntake and Agent creation can be deactivated by using [WithoutFakeIntake] and [WithoutAgent] options. -func Provisioner(opts ...ProvisionerOption) e2e.TypedProvisioner[environments.Host] { +func Provisioner(opts ...ProvisionerOption) provisioners.TypedProvisioner[environments.Host] { // We need to build params here to be able to use params.name in the provisioner name params := GetProvisionerParams(opts...) - provisioner := e2e.NewTypedPulumiProvisioner(provisionerBaseID+params.name, func(ctx *pulumi.Context, env *environments.Host) error { + provisioner := provisioners.NewTypedPulumiProvisioner(provisionerBaseID+params.name, func(ctx *pulumi.Context, env *environments.Host) error { // We ALWAYS need to make a deep copy of `params`, as the provisioner can be called multiple times. // and it's easy to forget about it, leading to hard-to-debug issues. params := GetProvisionerParams(opts...) diff --git a/test/new-e2e/pkg/environments/azure/host/linux/params.go b/test/new-e2e/pkg/provisioners/azure/host/linux/params.go similarity index 94% rename from test/new-e2e/pkg/environments/azure/host/linux/params.go rename to test/new-e2e/pkg/provisioners/azure/host/linux/params.go index ff32a326f06eb..923d4ac1778d8 100644 --- a/test/new-e2e/pkg/environments/azure/host/linux/params.go +++ b/test/new-e2e/pkg/provisioners/azure/host/linux/params.go @@ -7,15 +7,17 @@ package azurehost import ( "fmt" - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/runner" - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/e2e/client/agentclientparams" - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/optional" + "github.com/DataDog/test-infra-definitions/components/datadog/agentparams" "github.com/DataDog/test-infra-definitions/resources/azure" "github.com/DataDog/test-infra-definitions/scenarios/azure/compute" "github.com/DataDog/test-infra-definitions/scenarios/azure/fakeintake" + + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/runner" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/e2e/client/agentclientparams" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/optional" ) // ProvisionerParams is a set of parameters for the Provisioner. @@ -128,7 +130,7 @@ func WithUpdater() ProvisionerOption { } // ProvisionerNoAgentNoFakeIntake wraps Provisioner with hardcoded WithoutAgent and WithoutFakeIntake options. -func ProvisionerNoAgentNoFakeIntake(opts ...ProvisionerOption) e2e.TypedProvisioner[environments.Host] { +func ProvisionerNoAgentNoFakeIntake(opts ...ProvisionerOption) provisioners.TypedProvisioner[environments.Host] { mergedOpts := make([]ProvisionerOption, 0, len(opts)+2) mergedOpts = append(mergedOpts, opts...) mergedOpts = append(mergedOpts, WithoutAgent(), WithoutFakeIntake()) @@ -137,7 +139,7 @@ func ProvisionerNoAgentNoFakeIntake(opts ...ProvisionerOption) e2e.TypedProvisio } // ProvisionerNoFakeIntake wraps Provisioner with hardcoded WithoutFakeIntake option. -func ProvisionerNoFakeIntake(opts ...ProvisionerOption) e2e.TypedProvisioner[environments.Host] { +func ProvisionerNoFakeIntake(opts ...ProvisionerOption) provisioners.TypedProvisioner[environments.Host] { mergedOpts := make([]ProvisionerOption, 0, len(opts)+1) mergedOpts = append(mergedOpts, opts...) mergedOpts = append(mergedOpts, WithoutFakeIntake()) diff --git a/test/new-e2e/pkg/environments/azure/host/windows/host.go b/test/new-e2e/pkg/provisioners/azure/host/windows/host.go similarity index 89% rename from test/new-e2e/pkg/environments/azure/host/windows/host.go rename to test/new-e2e/pkg/provisioners/azure/host/windows/host.go index 414c6e8e469b0..dc32cff8ed9a4 100644 --- a/test/new-e2e/pkg/environments/azure/host/windows/host.go +++ b/test/new-e2e/pkg/provisioners/azure/host/windows/host.go @@ -7,7 +7,6 @@ package winazurehost import ( - installer "github.com/DataDog/datadog-agent/test/new-e2e/pkg/components/datadog-installer" "github.com/DataDog/test-infra-definitions/components/activedirectory" "github.com/DataDog/test-infra-definitions/components/datadog/agent" "github.com/DataDog/test-infra-definitions/components/datadog/agentparams" @@ -16,7 +15,9 @@ import ( "github.com/DataDog/test-infra-definitions/scenarios/azure/fakeintake" "github.com/pulumi/pulumi/sdk/v3/go/pulumi" - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" + installer "github.com/DataDog/datadog-agent/test/new-e2e/pkg/components/datadog-installer" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" "github.com/DataDog/datadog-agent/test/new-e2e/tests/windows/components/defender" ) @@ -28,10 +29,10 @@ const ( // Provisioner creates a VM environment with a Windows VM, a FakeIntake and a Host Agent configured to talk to each other. // FakeIntake and Agent creation can be deactivated by using [WithoutFakeIntake] and [WithoutAgent] options. -func Provisioner(opts ...ProvisionerOption) e2e.TypedProvisioner[environments.WindowsHost] { +func Provisioner(opts ...ProvisionerOption) provisioners.TypedProvisioner[environments.WindowsHost] { // We need to build params here to be able to use params.name in the provisioner name params := getProvisionerParams(opts...) - provisioner := e2e.NewTypedPulumiProvisioner(provisionerBaseID+params.name, func(ctx *pulumi.Context, env *environments.WindowsHost) error { + provisioner := provisioners.NewTypedPulumiProvisioner(provisionerBaseID+params.name, func(ctx *pulumi.Context, env *environments.WindowsHost) error { // We ALWAYS need to make a deep copy of `params`, as the provisioner can be called multiple times. // and it's easy to forget about it, leading to hard-to-debug issues. params := getProvisionerParams(opts...) @@ -42,7 +43,7 @@ func Provisioner(opts ...ProvisionerOption) e2e.TypedProvisioner[environments.Wi } // ProvisionerNoAgent wraps Provisioner with hardcoded WithoutAgent options. -func ProvisionerNoAgent(opts ...ProvisionerOption) e2e.TypedProvisioner[environments.WindowsHost] { +func ProvisionerNoAgent(opts ...ProvisionerOption) provisioners.TypedProvisioner[environments.WindowsHost] { mergedOpts := make([]ProvisionerOption, 0, len(opts)+1) mergedOpts = append(mergedOpts, opts...) mergedOpts = append(mergedOpts, WithoutAgent()) @@ -51,7 +52,7 @@ func ProvisionerNoAgent(opts ...ProvisionerOption) e2e.TypedProvisioner[environm } // ProvisionerNoAgentNoFakeIntake wraps Provisioner with hardcoded WithoutAgent and WithoutFakeIntake options. -func ProvisionerNoAgentNoFakeIntake(opts ...ProvisionerOption) e2e.TypedProvisioner[environments.WindowsHost] { +func ProvisionerNoAgentNoFakeIntake(opts ...ProvisionerOption) provisioners.TypedProvisioner[environments.WindowsHost] { mergedOpts := make([]ProvisionerOption, 0, len(opts)+2) mergedOpts = append(mergedOpts, opts...) mergedOpts = append(mergedOpts, WithoutAgent(), WithoutFakeIntake()) @@ -60,7 +61,7 @@ func ProvisionerNoAgentNoFakeIntake(opts ...ProvisionerOption) e2e.TypedProvisio } // ProvisionerNoFakeIntake wraps Provisioner with hardcoded WithoutFakeIntake option. -func ProvisionerNoFakeIntake(opts ...ProvisionerOption) e2e.TypedProvisioner[environments.WindowsHost] { +func ProvisionerNoFakeIntake(opts ...ProvisionerOption) provisioners.TypedProvisioner[environments.WindowsHost] { mergedOpts := make([]ProvisionerOption, 0, len(opts)+1) mergedOpts = append(mergedOpts, opts...) mergedOpts = append(mergedOpts, WithoutFakeIntake()) diff --git a/test/new-e2e/pkg/environments/azure/host/windows/params.go b/test/new-e2e/pkg/provisioners/azure/host/windows/params.go similarity index 100% rename from test/new-e2e/pkg/environments/azure/host/windows/params.go rename to test/new-e2e/pkg/provisioners/azure/host/windows/params.go diff --git a/test/new-e2e/pkg/environments/azure/kubernetes/aks.go b/test/new-e2e/pkg/provisioners/azure/kubernetes/aks.go similarity index 91% rename from test/new-e2e/pkg/environments/azure/kubernetes/aks.go rename to test/new-e2e/pkg/provisioners/azure/kubernetes/aks.go index 829a76675469c..53075f5f230fd 100644 --- a/test/new-e2e/pkg/environments/azure/kubernetes/aks.go +++ b/test/new-e2e/pkg/provisioners/azure/kubernetes/aks.go @@ -15,8 +15,8 @@ import ( "github.com/DataDog/test-infra-definitions/scenarios/azure/aks" "github.com/DataDog/test-infra-definitions/scenarios/azure/fakeintake" - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/optional" ) @@ -25,13 +25,13 @@ const ( ) // AKSProvisioner creates a new provisioner for AKS on Azure -func AKSProvisioner(opts ...ProvisionerOption) e2e.TypedProvisioner[environments.Kubernetes] { +func AKSProvisioner(opts ...ProvisionerOption) provisioners.TypedProvisioner[environments.Kubernetes] { // We ALWAYS need to make a deep copy of `params`, as the provisioner can be called multiple times. // and it's easy to forget about it, leading to hard to debug issues. params := newProvisionerParams() _ = optional.ApplyOptions(params, opts) - provisioner := e2e.NewTypedPulumiProvisioner(provisionerBaseID+params.name, func(ctx *pulumi.Context, env *environments.Kubernetes) error { + provisioner := provisioners.NewTypedPulumiProvisioner(provisionerBaseID+params.name, func(ctx *pulumi.Context, env *environments.Kubernetes) error { // We ALWAYS need to make a deep copy of `params`, as the provisioner can be called multiple times. // and it's easy to forget about it, leading to hard to debug issues. params := newProvisionerParams() diff --git a/test/new-e2e/pkg/environments/azure/kubernetes/params.go b/test/new-e2e/pkg/provisioners/azure/kubernetes/params.go similarity index 100% rename from test/new-e2e/pkg/environments/azure/kubernetes/params.go rename to test/new-e2e/pkg/provisioners/azure/kubernetes/params.go diff --git a/test/new-e2e/pkg/e2e/file_provisioner.go b/test/new-e2e/pkg/provisioners/file_provisioner.go similarity index 98% rename from test/new-e2e/pkg/e2e/file_provisioner.go rename to test/new-e2e/pkg/provisioners/file_provisioner.go index de8d0a4c22bd3..c0284816be6ef 100644 --- a/test/new-e2e/pkg/e2e/file_provisioner.go +++ b/test/new-e2e/pkg/provisioners/file_provisioner.go @@ -3,7 +3,7 @@ // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2016-present Datadog, Inc. -package e2e +package provisioners import ( "context" diff --git a/test/new-e2e/pkg/environments/gcp/host/linux/host.go b/test/new-e2e/pkg/provisioners/gcp/host/linux/host.go similarity index 92% rename from test/new-e2e/pkg/environments/gcp/host/linux/host.go rename to test/new-e2e/pkg/provisioners/gcp/host/linux/host.go index 0e479d8a51bdf..09e7be211d665 100644 --- a/test/new-e2e/pkg/environments/gcp/host/linux/host.go +++ b/test/new-e2e/pkg/provisioners/gcp/host/linux/host.go @@ -7,12 +7,12 @@ package gcphost import ( - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/test-infra-definitions/resources/gcp" "github.com/DataDog/test-infra-definitions/scenarios/gcp/compute" "github.com/DataDog/test-infra-definitions/scenarios/gcp/fakeintake" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners" "github.com/DataDog/test-infra-definitions/components/datadog/agent" "github.com/DataDog/test-infra-definitions/components/datadog/agentparams" @@ -27,11 +27,11 @@ const ( // Provisioner creates a VM environment with an VM, a FakeIntake and a Host Agent configured to talk to each other. // FakeIntake and Agent creation can be deactivated by using [WithoutFakeIntake] and [WithoutAgent] options. -func Provisioner(opts ...ProvisionerOption) e2e.TypedProvisioner[environments.Host] { +func Provisioner(opts ...ProvisionerOption) provisioners.TypedProvisioner[environments.Host] { // We need to build params here to be able to use params.name in the provisioner name params := GetProvisionerParams(opts...) - provisioner := e2e.NewTypedPulumiProvisioner(provisionerBaseID+params.name, func(ctx *pulumi.Context, env *environments.Host) error { + provisioner := provisioners.NewTypedPulumiProvisioner(provisionerBaseID+params.name, func(ctx *pulumi.Context, env *environments.Host) error { // We ALWAYS need to make a deep copy of `params`, as the provisioner can be called multiple times. // and it's easy to forget about it, leading to hard-to-debug issues. params := GetProvisionerParams(opts...) diff --git a/test/new-e2e/pkg/environments/gcp/host/linux/params.go b/test/new-e2e/pkg/provisioners/gcp/host/linux/params.go similarity index 94% rename from test/new-e2e/pkg/environments/gcp/host/linux/params.go rename to test/new-e2e/pkg/provisioners/gcp/host/linux/params.go index 442fd28b889b0..0542b3e045a66 100644 --- a/test/new-e2e/pkg/environments/gcp/host/linux/params.go +++ b/test/new-e2e/pkg/provisioners/gcp/host/linux/params.go @@ -7,15 +7,17 @@ package gcphost import ( "fmt" - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/runner" - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/e2e/client/agentclientparams" - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/optional" + "github.com/DataDog/test-infra-definitions/components/datadog/agentparams" "github.com/DataDog/test-infra-definitions/resources/gcp" "github.com/DataDog/test-infra-definitions/scenarios/gcp/compute" "github.com/DataDog/test-infra-definitions/scenarios/gcp/fakeintake" + + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/runner" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/e2e/client/agentclientparams" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/optional" ) // ProvisionerParams is a set of parameters for the Provisioner. @@ -128,7 +130,7 @@ func WithUpdater() ProvisionerOption { } // ProvisionerNoAgentNoFakeIntake wraps Provisioner with hardcoded WithoutAgent and WithoutFakeIntake options. -func ProvisionerNoAgentNoFakeIntake(opts ...ProvisionerOption) e2e.TypedProvisioner[environments.Host] { +func ProvisionerNoAgentNoFakeIntake(opts ...ProvisionerOption) provisioners.TypedProvisioner[environments.Host] { mergedOpts := make([]ProvisionerOption, 0, len(opts)+2) mergedOpts = append(mergedOpts, opts...) mergedOpts = append(mergedOpts, WithoutAgent(), WithoutFakeIntake()) @@ -137,7 +139,7 @@ func ProvisionerNoAgentNoFakeIntake(opts ...ProvisionerOption) e2e.TypedProvisio } // ProvisionerNoFakeIntake wraps Provisioner with hardcoded WithoutFakeIntake option. -func ProvisionerNoFakeIntake(opts ...ProvisionerOption) e2e.TypedProvisioner[environments.Host] { +func ProvisionerNoFakeIntake(opts ...ProvisionerOption) provisioners.TypedProvisioner[environments.Host] { mergedOpts := make([]ProvisionerOption, 0, len(opts)+1) mergedOpts = append(mergedOpts, opts...) mergedOpts = append(mergedOpts, WithoutFakeIntake()) diff --git a/test/new-e2e/pkg/environments/gcp/kubernetes/gke.go b/test/new-e2e/pkg/provisioners/gcp/kubernetes/gke.go similarity index 89% rename from test/new-e2e/pkg/environments/gcp/kubernetes/gke.go rename to test/new-e2e/pkg/provisioners/gcp/kubernetes/gke.go index 10c315fb7b254..80107a6369ce0 100644 --- a/test/new-e2e/pkg/environments/gcp/kubernetes/gke.go +++ b/test/new-e2e/pkg/provisioners/gcp/kubernetes/gke.go @@ -15,8 +15,8 @@ import ( "github.com/DataDog/test-infra-definitions/components/datadog/kubernetesagentparams" "github.com/DataDog/test-infra-definitions/scenarios/gcp/fakeintake" - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/optional" ) @@ -25,13 +25,13 @@ const ( ) // GKEProvisioner creates a new provisioner for GKE on GCP -func GKEProvisioner(opts ...ProvisionerOption) e2e.TypedProvisioner[environments.Kubernetes] { +func GKEProvisioner(opts ...ProvisionerOption) provisioners.TypedProvisioner[environments.Kubernetes] { // We ALWAYS need to make a deep copy of `params`, as the provisioner can be called multiple times. // and it's easy to forget about it, leading to hard to debug issues. params := newProvisionerParams() _ = optional.ApplyOptions(params, opts) - provisioner := e2e.NewTypedPulumiProvisioner(provisionerBaseID+params.name, func(ctx *pulumi.Context, env *environments.Kubernetes) error { + provisioner := provisioners.NewTypedPulumiProvisioner(provisionerBaseID+params.name, func(ctx *pulumi.Context, env *environments.Kubernetes) error { // We ALWAYS need to make a deep copy of `params`, as the provisioner can be called multiple times. // and it's easy to forget about it, leading to hard to debug issues. params := newProvisionerParams() diff --git a/test/new-e2e/pkg/environments/gcp/kubernetes/params.go b/test/new-e2e/pkg/provisioners/gcp/kubernetes/params.go similarity index 100% rename from test/new-e2e/pkg/environments/gcp/kubernetes/params.go rename to test/new-e2e/pkg/provisioners/gcp/kubernetes/params.go diff --git a/test/new-e2e/pkg/environments/local/host/podman.go b/test/new-e2e/pkg/provisioners/local/host/podman.go similarity index 91% rename from test/new-e2e/pkg/environments/local/host/podman.go rename to test/new-e2e/pkg/provisioners/local/host/podman.go index 911a91f36ab76..85e73718dbcbe 100644 --- a/test/new-e2e/pkg/environments/local/host/podman.go +++ b/test/new-e2e/pkg/provisioners/local/host/podman.go @@ -7,8 +7,8 @@ package localhost import ( - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/runner" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/optional" @@ -89,7 +89,7 @@ func WithExtraConfigParams(configMap runner.ConfigMap) ProvisionerOption { } // PodmanProvisionerNoAgentNoFakeIntake wraps Provisioner with hardcoded WithoutAgent and WithoutFakeIntake options. -func PodmanProvisionerNoAgentNoFakeIntake(opts ...ProvisionerOption) e2e.TypedProvisioner[environments.Host] { +func PodmanProvisionerNoAgentNoFakeIntake(opts ...ProvisionerOption) provisioners.TypedProvisioner[environments.Host] { mergedOpts := make([]ProvisionerOption, 0, len(opts)+2) mergedOpts = append(mergedOpts, opts...) mergedOpts = append(mergedOpts, WithoutAgent(), WithoutFakeIntake()) @@ -98,7 +98,7 @@ func PodmanProvisionerNoAgentNoFakeIntake(opts ...ProvisionerOption) e2e.TypedPr } // PodmanProvisionerNoFakeIntake wraps Provisioner with hardcoded WithoutFakeIntake option. -func PodmanProvisionerNoFakeIntake(opts ...ProvisionerOption) e2e.TypedProvisioner[environments.Host] { +func PodmanProvisionerNoFakeIntake(opts ...ProvisionerOption) provisioners.TypedProvisioner[environments.Host] { mergedOpts := make([]ProvisionerOption, 0, len(opts)+1) mergedOpts = append(mergedOpts, opts...) mergedOpts = append(mergedOpts, WithoutFakeIntake()) @@ -107,13 +107,13 @@ func PodmanProvisionerNoFakeIntake(opts ...ProvisionerOption) e2e.TypedProvision } // PodmanProvisioner creates a new provisioner -func PodmanProvisioner(opts ...ProvisionerOption) e2e.TypedProvisioner[environments.Host] { +func PodmanProvisioner(opts ...ProvisionerOption) provisioners.TypedProvisioner[environments.Host] { // We ALWAYS need to make a deep copy of `params`, as the provisioner can be called multiple times. // and it's easy to forget about it, leading to hard to debug issues. params := newProvisionerParams() _ = optional.ApplyOptions(params, opts) - provisioner := e2e.NewTypedPulumiProvisioner(provisionerBaseID+params.name, func(ctx *pulumi.Context, env *environments.Host) error { + provisioner := provisioners.NewTypedPulumiProvisioner(provisionerBaseID+params.name, func(ctx *pulumi.Context, env *environments.Host) error { // We ALWAYS need to make a deep copy of `params`, as the provisioner can be called multiple times. // and it's easy to forget about it, leading to hard to debug issues. params := newProvisionerParams() diff --git a/test/new-e2e/pkg/environments/local/kubernetes/kind.go b/test/new-e2e/pkg/provisioners/local/kubernetes/kind.go similarity index 95% rename from test/new-e2e/pkg/environments/local/kubernetes/kind.go rename to test/new-e2e/pkg/provisioners/local/kubernetes/kind.go index 99703f64eb402..e754b6f57af91 100644 --- a/test/new-e2e/pkg/environments/local/kubernetes/kind.go +++ b/test/new-e2e/pkg/provisioners/local/kubernetes/kind.go @@ -9,8 +9,8 @@ package localkubernetes import ( "fmt" - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/runner" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/optional" @@ -105,13 +105,13 @@ func WithWorkloadApp(appFunc WorkloadAppFunc) ProvisionerOption { } // Provisioner creates a new provisioner -func Provisioner(opts ...ProvisionerOption) e2e.TypedProvisioner[environments.Kubernetes] { +func Provisioner(opts ...ProvisionerOption) provisioners.TypedProvisioner[environments.Kubernetes] { // We ALWAYS need to make a deep copy of `params`, as the provisioner can be called multiple times. // and it's easy to forget about it, leading to hard to debug issues. params := newProvisionerParams() _ = optional.ApplyOptions(params, opts) - provisioner := e2e.NewTypedPulumiProvisioner(provisionerBaseID+params.name, func(ctx *pulumi.Context, env *environments.Kubernetes) error { + provisioner := provisioners.NewTypedPulumiProvisioner(provisionerBaseID+params.name, func(ctx *pulumi.Context, env *environments.Kubernetes) error { // We ALWAYS need to make a deep copy of `params`, as the provisioner can be called multiple times. // and it's easy to forget about it, leading to hard to debug issues. params := newProvisionerParams() diff --git a/test/new-e2e/pkg/e2e/provisioner.go b/test/new-e2e/pkg/provisioners/provisioners.go similarity index 71% rename from test/new-e2e/pkg/e2e/provisioner.go rename to test/new-e2e/pkg/provisioners/provisioners.go index a537cc7a05ce4..7dd64c4468740 100644 --- a/test/new-e2e/pkg/e2e/provisioner.go +++ b/test/new-e2e/pkg/provisioners/provisioners.go @@ -3,7 +3,8 @@ // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2016-present Datadog, Inc. -package e2e +// Package provisioners contains the definitions of the different provisioners that can be used in a test to setup an environment. +package provisioners import ( "context" @@ -21,6 +22,16 @@ type Provisioner interface { Destroy(context.Context, string, io.Writer) error } +// RawResources is the common types returned by provisioners +type RawResources map[string][]byte + +// Merge merges two RawResources maps +func (rr RawResources) Merge(in RawResources) { + for k, v := range in { + rr[k] = v + } +} + // UntypedProvisioner defines the interface for a provisioner without env binding type UntypedProvisioner interface { Provisioner @@ -36,7 +47,8 @@ type TypedProvisioner[Env any] interface { // ProvisionerMap is a map of provisioners. type ProvisionerMap map[string]Provisioner -func copyProvisioners(in ProvisionerMap) ProvisionerMap { +// CopyProvisioners copies a map of provisioners +func CopyProvisioners(in ProvisionerMap) ProvisionerMap { out := make(ProvisionerMap, len(in)) for k, v := range in { out[k] = v diff --git a/test/new-e2e/pkg/e2e/pulumi_provisioner.go b/test/new-e2e/pkg/provisioners/pulumi_provisioner.go similarity index 99% rename from test/new-e2e/pkg/e2e/pulumi_provisioner.go rename to test/new-e2e/pkg/provisioners/pulumi_provisioner.go index ef8aba2b8d295..ab9e6e69ca03c 100644 --- a/test/new-e2e/pkg/e2e/pulumi_provisioner.go +++ b/test/new-e2e/pkg/provisioners/pulumi_provisioner.go @@ -3,7 +3,7 @@ // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2016-present Datadog, Inc. -package e2e +package provisioners import ( "context" diff --git a/test/new-e2e/pkg/runner/configmap.go b/test/new-e2e/pkg/runner/configmap.go index bb4fd0a9fb0f7..9541320664572 100644 --- a/test/new-e2e/pkg/runner/configmap.go +++ b/test/new-e2e/pkg/runner/configmap.go @@ -127,14 +127,19 @@ func BuildStackParameters(profile Profile, scenarioConfig ConfigMap) (ConfigMap, // Parameters from profile cm.Set(InfraEnvironmentVariables, profile.EnvironmentNames(), false) params := map[parameters.StoreKey][]string{ - parameters.KeyPairName: {AWSKeyPairName}, - parameters.PublicKeyPath: {AWSPublicKeyPath, AzurePublicKeyPath, GCPPublicKeyPath, LocalPublicKeyPath}, - parameters.PrivateKeyPath: {AWSPrivateKeyPath, AzurePrivateKeyPath, GCPPrivateKeyPath}, - parameters.ExtraResourcesTags: {InfraExtraResourcesTags}, - parameters.PipelineID: {AgentPipelineID}, - parameters.MajorVersion: {AgentMajorVersion}, - parameters.CommitSHA: {AgentCommitSHA}, - parameters.InitOnly: {InfraInitOnly}, + parameters.KeyPairName: {AWSKeyPairName}, + parameters.AWSPublicKeyPath: {AWSPublicKeyPath}, + parameters.AzurePublicKeyPath: {AzurePublicKeyPath}, + parameters.GCPPublicKeyPath: {GCPPublicKeyPath}, + parameters.AWSPrivateKeyPath: {AWSPrivateKeyPath}, + parameters.AzurePrivateKeyPath: {AzurePrivateKeyPath}, + parameters.GCPPrivateKeyPath: {GCPPrivateKeyPath}, + parameters.LocalPublicKeyPath: {LocalPublicKeyPath}, + parameters.ExtraResourcesTags: {InfraExtraResourcesTags}, + parameters.PipelineID: {AgentPipelineID}, + parameters.MajorVersion: {AgentMajorVersion}, + parameters.CommitSHA: {AgentCommitSHA}, + parameters.InitOnly: {InfraInitOnly}, } for storeKey, configMapKeys := range params { @@ -149,9 +154,11 @@ func BuildStackParameters(profile Profile, scenarioConfig ConfigMap) (ConfigMap, // Secret parameters from profile store secretParams := map[parameters.StoreKey][]string{ - parameters.APIKey: {AgentAPIKey}, - parameters.APPKey: {AgentAPPKey}, - parameters.PrivateKeyPassword: {AWSPrivateKeyPassword, AzurePrivateKeyPassword, GCPPrivateKeyPassword}, + parameters.APIKey: {AgentAPIKey}, + parameters.APPKey: {AgentAPPKey}, + parameters.AWSPrivateKeyPassword: {AWSPrivateKeyPassword}, + parameters.AzurePrivateKeyPassword: {AzurePrivateKeyPassword}, + parameters.GCPPrivateKeyPassword: {GCPPrivateKeyPassword}, } for storeKey, configMapKeys := range secretParams { diff --git a/test/new-e2e/pkg/runner/configmap_test.go b/test/new-e2e/pkg/runner/configmap_test.go index 2e9bf966a53a2..23b02f0a0156c 100644 --- a/test/new-e2e/pkg/runner/configmap_test.go +++ b/test/new-e2e/pkg/runner/configmap_test.go @@ -37,16 +37,16 @@ func Test_BuildStackParameters(t *testing.T) { "ddinfra:env": auto.ConfigValue{Value: "", Secret: false}, "ddinfra:extraResourcesTags": auto.ConfigValue{Value: "extra_resources_tags", Secret: false}, "ddinfra:initOnly": auto.ConfigValue{Value: "init_only", Secret: false}, - "ddinfra:aws/defaultPublicKeyPath": auto.ConfigValue{Value: "public_key_path", Secret: false}, - "ddinfra:aws/defaultPrivateKeyPath": auto.ConfigValue{Value: "private_key_path", Secret: false}, - "ddinfra:aws/defaultPrivateKeyPassword": auto.ConfigValue{Value: "private_key_password", Secret: true}, - "ddinfra:az/defaultPublicKeyPath": auto.ConfigValue{Value: "public_key_path", Secret: false}, - "ddinfra:az/defaultPrivateKeyPath": auto.ConfigValue{Value: "private_key_path", Secret: false}, - "ddinfra:az/defaultPrivateKeyPassword": auto.ConfigValue{Value: "private_key_password", Secret: true}, - "ddinfra:gcp/defaultPublicKeyPath": auto.ConfigValue{Value: "public_key_path", Secret: false}, - "ddinfra:gcp/defaultPrivateKeyPath": auto.ConfigValue{Value: "private_key_path", Secret: false}, - "ddinfra:gcp/defaultPrivateKeyPassword": auto.ConfigValue{Value: "private_key_password", Secret: true}, - "ddinfra:local/defaultPublicKeyPath": auto.ConfigValue{Value: "public_key_path", Secret: false}, + "ddinfra:aws/defaultPublicKeyPath": auto.ConfigValue{Value: "aws_public_key_path", Secret: false}, + "ddinfra:aws/defaultPrivateKeyPath": auto.ConfigValue{Value: "aws_private_key_path", Secret: false}, + "ddinfra:aws/defaultPrivateKeyPassword": auto.ConfigValue{Value: "aws_private_key_password", Secret: true}, + "ddinfra:az/defaultPublicKeyPath": auto.ConfigValue{Value: "azure_public_key_path", Secret: false}, + "ddinfra:az/defaultPrivateKeyPath": auto.ConfigValue{Value: "azure_private_key_path", Secret: false}, + "ddinfra:az/defaultPrivateKeyPassword": auto.ConfigValue{Value: "azure_private_key_password", Secret: true}, + "ddinfra:gcp/defaultPublicKeyPath": auto.ConfigValue{Value: "gcp_public_key_path", Secret: false}, + "ddinfra:gcp/defaultPrivateKeyPath": auto.ConfigValue{Value: "gcp_private_key_path", Secret: false}, + "ddinfra:gcp/defaultPrivateKeyPassword": auto.ConfigValue{Value: "gcp_private_key_password", Secret: true}, + "ddinfra:local/defaultPublicKeyPath": auto.ConfigValue{Value: "local_public_key_path", Secret: false}, "ddagent:pipeline_id": auto.ConfigValue{Value: "pipeline_id", Secret: false}, "ddagent:commit_sha": auto.ConfigValue{Value: "commit_sha", Secret: false}, "ddagent:majorVersion": auto.ConfigValue{Value: "major_version", Secret: false}, diff --git a/test/new-e2e/pkg/runner/parameters/const.go b/test/new-e2e/pkg/runner/parameters/const.go index c23c1502946b6..227abac7f651f 100644 --- a/test/new-e2e/pkg/runner/parameters/const.go +++ b/test/new-e2e/pkg/runner/parameters/const.go @@ -5,6 +5,8 @@ package parameters +import "github.com/DataDog/test-infra-definitions/components" + // StoreKey alias to string type StoreKey string @@ -19,14 +21,28 @@ const ( ExtraResourcesTags StoreKey = "extra_resources_tags" // KeyPairName aws keypairname, used to access EC2 instances KeyPairName StoreKey = "key_pair_name" - // PrivateKeyPassword private ssh key password - PrivateKeyPassword StoreKey = "private_key_password" - // PrivateKeyPath private ssh key path - PrivateKeyPath StoreKey = "private_key_path" + // AWSPrivateKeyPassword private ssh key password + AWSPrivateKeyPassword StoreKey = StoreKey(components.CloudProviderAWS + PrivateKeyPasswordSuffix) + // AWSPrivateKeyPath private ssh key path + AWSPrivateKeyPath StoreKey = StoreKey(components.CloudProviderAWS + PrivateKeyPathSuffix) // Profile aws profile name Profile StoreKey = "profile" - // PublicKeyPath public ssh key path - PublicKeyPath StoreKey = "public_key_path" + // AWSPublicKeyPath public ssh key path + AWSPublicKeyPath StoreKey = StoreKey(components.CloudProviderAWS + PublicKeyPathSuffix) + //AzurePrivateKeyPassword private ssh key password + AzurePrivateKeyPassword StoreKey = StoreKey(components.CloudProviderAzure + PrivateKeyPasswordSuffix) + //AzurePrivateKeyPath private ssh key path + AzurePrivateKeyPath StoreKey = StoreKey(components.CloudProviderAzure + PrivateKeyPathSuffix) + //AzurePublicKeyPath public ssh key path + AzurePublicKeyPath StoreKey = StoreKey(components.CloudProviderAzure + PublicKeyPathSuffix) + //GCPPrivateKeyPassword private ssh key password + GCPPrivateKeyPassword StoreKey = StoreKey(components.CloudProviderGCP + PrivateKeyPasswordSuffix) + //GCPPrivateKeyPath private ssh key path + GCPPrivateKeyPath StoreKey = StoreKey(components.CloudProviderGCP + PrivateKeyPathSuffix) + //GCPPublicKeyPath public ssh key path + GCPPublicKeyPath StoreKey = StoreKey(components.CloudProviderGCP + PublicKeyPathSuffix) + // LocalPublicKeyPath public ssh key path + LocalPublicKeyPath StoreKey = "local_public_key_path" // PulumiPassword config file parameter name PulumiPassword StoreKey = "pulumi_password" // SkipDeleteOnFailure keep the stack on test failure @@ -56,3 +72,12 @@ const ( // MajorVersion config flag parameter name MajorVersion StoreKey = "major_version" ) + +const ( + // PrivateKeyPathSuffix private ssh key path suffix + PrivateKeyPathSuffix = "_private_key_path" + // PublicKeyPathSuffix public ssh key path suffix + PublicKeyPathSuffix = "_public_key_path" + // PrivateKeyPasswordSuffix private ssh key password suffix + PrivateKeyPasswordSuffix = "_private_key_password" +) diff --git a/test/new-e2e/pkg/runner/parameters/store_config_file.go b/test/new-e2e/pkg/runner/parameters/store_config_file.go index e9f20051e3708..8fd564adfb636 100644 --- a/test/new-e2e/pkg/runner/parameters/store_config_file.go +++ b/test/new-e2e/pkg/runner/parameters/store_config_file.go @@ -38,6 +38,8 @@ type Config struct { type ConfigParams struct { AWS AWS `yaml:"aws"` Azure Azure `yaml:"azure"` + GCP GCP `yaml:"gcp"` + Local Local `yaml:"local"` Agent Agent `yaml:"agent"` OutputDir string `yaml:"outputDir"` Pulumi Pulumi `yaml:"pulumi"` @@ -62,6 +64,19 @@ type Azure struct { PrivateKeyPassword string `yaml:"privateKeyPassword"` } +// GCP instance contains GCP related parameters +type GCP struct { + Account string `yaml:"account"` + PublicKeyPath string `yaml:"publicKeyPath"` + PrivateKeyPath string `yaml:"privateKeyPath"` + PrivateKeyPassword string `yaml:"privateKeyPassword"` +} + +// Local instance contains local related parameters +type Local struct { + PublicKeyPath string `yaml:"publicKeyPath"` +} + // Agent instance contains agent related parameters type Agent struct { APIKey string `yaml:"apiKey"` @@ -135,12 +150,26 @@ func (s configFileValueStore) get(key StoreKey) (string, error) { value = s.config.ConfigParams.Agent.APPKey case KeyPairName: value = s.config.ConfigParams.AWS.KeyPairName - case PublicKeyPath: + case AWSPublicKeyPath: value = s.config.ConfigParams.AWS.PublicKeyPath - case PrivateKeyPath: + case AWSPrivateKeyPath: value = s.config.ConfigParams.AWS.PrivateKeyPath - case PrivateKeyPassword: + case AWSPrivateKeyPassword: value = s.config.ConfigParams.AWS.PrivateKeyPassword + case AzurePrivateKeyPassword: + value = s.config.ConfigParams.Azure.PrivateKeyPassword + case AzurePrivateKeyPath: + value = s.config.ConfigParams.Azure.PrivateKeyPath + case AzurePublicKeyPath: + value = s.config.ConfigParams.Azure.PublicKeyPath + case GCPPrivateKeyPassword: + value = s.config.ConfigParams.GCP.PrivateKeyPassword + case GCPPrivateKeyPath: + value = s.config.ConfigParams.GCP.PrivateKeyPath + case GCPPublicKeyPath: + value = s.config.ConfigParams.GCP.PublicKeyPath + case LocalPublicKeyPath: + value = s.config.ConfigParams.Local.PublicKeyPath case StackParameters: value = s.stackParamsJSON case ExtraResourcesTags: diff --git a/test/new-e2e/pkg/runner/parameters/store_config_file_test.go b/test/new-e2e/pkg/runner/parameters/store_config_file_test.go index 68826e44f3b67..0c99a5a6d7314 100644 --- a/test/new-e2e/pkg/runner/parameters/store_config_file_test.go +++ b/test/new-e2e/pkg/runner/parameters/store_config_file_test.go @@ -52,7 +52,7 @@ func Test_NewConfigFileStore(t *testing.T) { assert.NoError(t, err) assert.Equal(t, "totoro", value) - value, err = store.Get(PublicKeyPath) + value, err = store.Get(AWSPublicKeyPath) assert.NoError(t, err) assert.Equal(t, "/Users/totoro/.ssh/id_rsa.pub", value) @@ -81,7 +81,7 @@ func Test_NewConfigFileStoreNoAWSAccount(t *testing.T) { assert.NoError(t, err) assert.Equal(t, "totoro", value) - value, err = store.Get(PublicKeyPath) + value, err = store.Get(AWSPublicKeyPath) assert.NoError(t, err) assert.Equal(t, "/Users/totoro/.ssh/id_rsa.pub", value) diff --git a/test/new-e2e/pkg/runner/parameters/store_env.go b/test/new-e2e/pkg/runner/parameters/store_env.go index 6e43128a2af69..1aba3ce15de34 100644 --- a/test/new-e2e/pkg/runner/parameters/store_env.go +++ b/test/new-e2e/pkg/runner/parameters/store_env.go @@ -19,10 +19,16 @@ var envVariablesByStoreKey = map[StoreKey]string{ Environments: "E2E_ENVIRONMENTS", ExtraResourcesTags: "E2E_EXTRA_RESOURCES_TAGS", KeyPairName: "E2E_KEY_PAIR_NAME", - PrivateKeyPassword: "E2E_PRIVATE_KEY_PASSWORD", - PrivateKeyPath: "E2E_PRIVATE_KEY_PATH", + AWSPrivateKeyPassword: "E2E_AWS_PRIVATE_KEY_PASSWORD", + AWSPrivateKeyPath: "E2E_AWS_PRIVATE_KEY_PATH", Profile: "E2E_PROFILE", - PublicKeyPath: "E2E_PUBLIC_KEY_PATH", + AWSPublicKeyPath: "E2E_AWS_PUBLIC_KEY_PATH", + AzurePrivateKeyPath: "E2E_AZURE_PRIVATE_KEY_PATH", + AzurePublicKeyPath: "E2E_AZURE_PUBLIC_KEY_PATH", + AzurePrivateKeyPassword: "E2E_AZURE_PRIVATE_KEY_PASSWORD", + GCPPrivateKeyPath: "E2E_GCP_PRIVATE_KEY_PATH", + GCPPublicKeyPath: "E2E_GCP_PUBLIC_KEY_PATH", + GCPPrivateKeyPassword: "E2E_GCP_PRIVATE_KEY_PASSWORD", PulumiPassword: "E2E_PULUMI_PASSWORD", SkipDeleteOnFailure: "E2E_SKIP_DELETE_ON_FAILURE", StackParameters: "E2E_STACK_PARAMS", diff --git a/test/new-e2e/pkg/e2e/types.go b/test/new-e2e/pkg/utils/common/types.go similarity index 61% rename from test/new-e2e/pkg/e2e/types.go rename to test/new-e2e/pkg/utils/common/types.go index 73d088edc104f..d07d9e9323e24 100644 --- a/test/new-e2e/pkg/e2e/types.go +++ b/test/new-e2e/pkg/utils/common/types.go @@ -1,13 +1,11 @@ // 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 e2e +package common -import ( - "testing" -) +import "testing" // Context defines an interface that allows to get information about current test context type Context interface { @@ -18,13 +16,3 @@ type Context interface { type Initializable interface { Init(Context) error } - -// RawResources is the common types returned by provisioners -type RawResources map[string][]byte - -// Merge merges two RawResources maps -func (rr RawResources) Merge(in RawResources) { - for k, v := range in { - rr[k] = v - } -} diff --git a/test/new-e2e/pkg/utils/e2e/client/agent_client.go b/test/new-e2e/pkg/utils/e2e/client/agent_client.go index 1a362ac6e4f32..e98ba7750dd0f 100644 --- a/test/new-e2e/pkg/utils/e2e/client/agent_client.go +++ b/test/new-e2e/pkg/utils/e2e/client/agent_client.go @@ -20,6 +20,7 @@ import ( "github.com/stretchr/testify/require" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/common" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/e2e/client/agentclient" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/e2e/client/agentclientparams" ) @@ -29,7 +30,7 @@ const ( ) // NewHostAgentClient creates an Agent client for host install -func NewHostAgentClient(context e2e.Context, hostOutput remote.HostOutput, waitForAgentReady bool) (agentclient.Agent, error) { +func NewHostAgentClient(context common.Context, hostOutput remote.HostOutput, waitForAgentReady bool) (agentclient.Agent, error) { params := agentclientparams.NewParams(hostOutput.OSFamily) params.ShouldWaitForReady = waitForAgentReady @@ -51,7 +52,7 @@ func NewHostAgentClient(context e2e.Context, hostOutput remote.HostOutput, waitF } // NewHostAgentClientWithParams creates an Agent client for host install with custom parameters -func NewHostAgentClientWithParams(context e2e.Context, hostOutput remote.HostOutput, options ...agentclientparams.Option) (agentclient.Agent, error) { +func NewHostAgentClientWithParams(context common.Context, hostOutput remote.HostOutput, options ...agentclientparams.Option) (agentclient.Agent, error) { params := agentclientparams.NewParams(hostOutput.OSFamily, options...) host, err := NewHost(context, hostOutput) @@ -74,7 +75,7 @@ func NewHostAgentClientWithParams(context e2e.Context, hostOutput remote.HostOut } // NewDockerAgentClient creates an Agent client for a Docker install -func NewDockerAgentClient(context e2e.Context, dockerAgentOutput agent.DockerAgentOutput, options ...agentclientparams.Option) (agentclient.Agent, error) { +func NewDockerAgentClient(context common.Context, dockerAgentOutput agent.DockerAgentOutput, options ...agentclientparams.Option) (agentclient.Agent, error) { params := agentclientparams.NewParams(dockerAgentOutput.DockerManager.Host.OSFamily, options...) ae := newAgentDockerExecutor(context, dockerAgentOutput) commandRunner := newAgentCommandRunner(context.T(), ae) @@ -126,7 +127,7 @@ func waitForAgentsReady(tt *testing.T, host *Host, params *agentclientparams.Par } func processAgentRequest(params *agentclientparams.Params, host *Host) (*http.Request, bool, error) { - return makeStatusEndpointRequest(params, host, "http://localhost:%d/agent/status", params.ProcessAgentPort) + return makeStatusEndpointRequest(params, host, "https://localhost:%d/agent/status", params.ProcessAgentPort) } func traceAgentRequest(params *agentclientparams.Params, host *Host) (*http.Request, bool, error) { diff --git a/test/new-e2e/pkg/utils/e2e/client/agent_docker.go b/test/new-e2e/pkg/utils/e2e/client/agent_docker.go index 218d001049435..6240f5e5fe455 100644 --- a/test/new-e2e/pkg/utils/e2e/client/agent_docker.go +++ b/test/new-e2e/pkg/utils/e2e/client/agent_docker.go @@ -6,8 +6,9 @@ package client import ( - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/test-infra-definitions/components/datadog/agent" + + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/common" ) type agentDockerExecutor struct { @@ -17,7 +18,7 @@ type agentDockerExecutor struct { var _ agentCommandExecutor = &agentDockerExecutor{} -func newAgentDockerExecutor(context e2e.Context, dockerAgentOutput agent.DockerAgentOutput) *agentDockerExecutor { +func newAgentDockerExecutor(context common.Context, dockerAgentOutput agent.DockerAgentOutput) *agentDockerExecutor { dockerClient, err := NewDocker(context.T(), dockerAgentOutput.DockerManager) if err != nil { panic(err) diff --git a/test/new-e2e/pkg/utils/e2e/client/docker.go b/test/new-e2e/pkg/utils/e2e/client/docker.go index b31aba4ce7e85..1235bc56c0c2a 100644 --- a/test/new-e2e/pkg/utils/e2e/client/docker.go +++ b/test/new-e2e/pkg/utils/e2e/client/docker.go @@ -40,7 +40,7 @@ func NewDocker(t *testing.T, dockerOutput docker.ManagerOutput) (*Docker, error) sshOpts := []string{"-o", "StrictHostKeyChecking no"} - privateKeyPath, err := runner.GetProfile().ParamStore().GetWithDefault(parameters.PrivateKeyPath, "") + privateKeyPath, err := runner.GetProfile().ParamStore().GetWithDefault(parameters.StoreKey(dockerOutput.Host.CloudProvider+parameters.PrivateKeyPathSuffix), "") if err != nil { return nil, err } diff --git a/test/new-e2e/pkg/utils/e2e/client/host.go b/test/new-e2e/pkg/utils/e2e/client/host.go index e446f56ff32db..94b982b0ac51c 100644 --- a/test/new-e2e/pkg/utils/e2e/client/host.go +++ b/test/new-e2e/pkg/utils/e2e/client/host.go @@ -28,9 +28,9 @@ import ( "golang.org/x/crypto/ssh" "github.com/DataDog/datadog-agent/pkg/util/scrubber" - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/runner" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/runner/parameters" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/common" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/optional" ) @@ -48,7 +48,7 @@ type convertPathSeparatorFn func(string) string type Host struct { client *ssh.Client - context e2e.Context + context common.Context username string host string privateKey []byte @@ -63,14 +63,14 @@ type Host struct { // NewHost creates a new ssh client to connect to a remote host with // reconnect retry logic -func NewHost(context e2e.Context, hostOutput remote.HostOutput) (*Host, error) { +func NewHost(context common.Context, hostOutput remote.HostOutput) (*Host, error) { var privateSSHKey []byte - privateKeyPath, err := runner.GetProfile().ParamStore().GetWithDefault(parameters.PrivateKeyPath, "") + + privateKeyPath, err := runner.GetProfile().ParamStore().GetWithDefault(parameters.StoreKey(hostOutput.CloudProvider+parameters.PrivateKeyPathSuffix), "") if err != nil { return nil, err } - - privateKeyPassword, err := runner.GetProfile().SecretStore().GetWithDefault(parameters.PrivateKeyPassword, "") + privateKeyPassword, err := runner.GetProfile().SecretStore().GetWithDefault(parameters.StoreKey(hostOutput.CloudProvider+parameters.PrivateKeyPasswordSuffix), "") if err != nil { return nil, err } @@ -143,6 +143,30 @@ func (h *Host) executeAndReconnectOnError(command string) (string, error) { return stdout, err } +// Start a command and returns session, and an error if any. +func (h *Host) Start(command string, options ...ExecuteOption) (*ssh.Session, io.WriteCloser, io.Reader, error) { + params, err := optional.MakeParams(options...) + if err != nil { + return nil, nil, nil, err + } + command = h.buildCommand(command, params.EnvVariables) + return h.startAndReconnectOnError(command) +} + +func (h *Host) startAndReconnectOnError(command string) (*ssh.Session, io.WriteCloser, io.Reader, error) { + scrubbedCommand := h.scrubber.ScrubLine(command) // scrub the command in case it contains secrets + h.context.T().Logf("%s - %s - Executing command `%s`", time.Now().Format("02-01-2006 15:04:05"), h.context.T().Name(), scrubbedCommand) + session, stdin, stdout, err := start(h.client, command) + if err != nil && strings.Contains(err.Error(), "failed to create session:") { + err = h.Reconnect() + if err != nil { + return nil, nil, nil, err + } + session, stdin, stdout, err = start(h.client, command) + } + return session, stdin, stdout, err +} + // MustExecute executes a command and requires no error. func (h *Host) MustExecute(command string, options ...ExecuteOption) string { stdout, err := h.Execute(command, options...) diff --git a/test/new-e2e/pkg/utils/e2e/client/host_ssh.go b/test/new-e2e/pkg/utils/e2e/client/host_ssh.go index 79a53dd4b87e2..9e39bfa901354 100644 --- a/test/new-e2e/pkg/utils/e2e/client/host_ssh.go +++ b/test/new-e2e/pkg/utils/e2e/client/host_ssh.go @@ -7,14 +7,15 @@ package client import ( "fmt" - "github.com/pkg/sftp" - "golang.org/x/crypto/ssh" - "golang.org/x/crypto/ssh/agent" "io" "net" "os" "path" "strings" + + "github.com/pkg/sftp" + "golang.org/x/crypto/ssh" + "golang.org/x/crypto/ssh/agent" ) func execute(sshClient *ssh.Client, command string) (string, error) { @@ -26,6 +27,23 @@ func execute(sshClient *ssh.Client, command string) (string, error) { return string(stdout), err } +func start(sshClient *ssh.Client, command string) (*ssh.Session, io.WriteCloser, io.Reader, error) { + session, err := sshClient.NewSession() + if err != nil { + return nil, nil, nil, fmt.Errorf("failed to create session: %v", err) + } + stdin, err := session.StdinPipe() + if err != nil { + return nil, nil, nil, fmt.Errorf("failed to create stdin pipe: %v", err) + } + stdout, err := session.StdoutPipe() + if err != nil { + return nil, nil, nil, fmt.Errorf("failed to create stdout pipe: %v", err) + } + err = session.Start(command) + return session, stdin, stdout, err +} + func getSSHClient(user, host string, privateKey, privateKeyPassphrase []byte) (*ssh.Client, error) { var auth ssh.AuthMethod diff --git a/test/new-e2e/pkg/utils/infra/retriable_errors.go b/test/new-e2e/pkg/utils/infra/retriable_errors.go index b940cbcd2e064..211c9179511cb 100644 --- a/test/new-e2e/pkg/utils/infra/retriable_errors.go +++ b/test/new-e2e/pkg/utils/infra/retriable_errors.go @@ -55,5 +55,11 @@ func getKnownErrors() []knownError { errorMessage: `ssh: handshake failed: ssh: unable to authenticate`, retryType: ReCreate, }, + { + // https://datadoghq.atlassian.net/browse/ADXT-798 + // https://datadoghq.atlassian.net/browse/ADXT-813 + errorMessage: `error: awsx:ecs:FargateTaskDefinition resource '.+fakeintake.+' has a problem: grpc: the client connection is closing`, + retryType: ReCreate, + }, } } diff --git a/test/new-e2e/system-probe/test-runner/files/cws_fentry.json b/test/new-e2e/system-probe/test-runner/files/cws_fentry.json deleted file mode 100644 index 8330f6d6048af..0000000000000 --- a/test/new-e2e/system-probe/test-runner/files/cws_fentry.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "filters": { - "*": { - "exclude": false - } - }, - "additional_env_vars": [ - "DD_EVENT_MONITORING_CONFIG_EVENT_STREAM_USE_FENTRY=true" - ] -} diff --git a/test/new-e2e/test-infra-definition/agent_test.go b/test/new-e2e/test-infra-definition/agent_test.go index 0452841024795..deae9e07d8916 100644 --- a/test/new-e2e/test-infra-definition/agent_test.go +++ b/test/new-e2e/test-infra-definition/agent_test.go @@ -8,11 +8,12 @@ package testinfradefinition import ( "testing" - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" ) type agentSuite struct { diff --git a/test/new-e2e/test-infra-definition/docker_test.go b/test/new-e2e/test-infra-definition/docker_test.go index 1ede9e48f9d66..a3c18fa65262d 100644 --- a/test/new-e2e/test-infra-definition/docker_test.go +++ b/test/new-e2e/test-infra-definition/docker_test.go @@ -12,12 +12,13 @@ import ( "testing" "time" + "github.com/DataDog/test-infra-definitions/scenarios/aws/fakeintake" + "github.com/stretchr/testify/assert" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awsdocker "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/docker" + awsdocker "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/docker" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/e2e/client/agentclient" - "github.com/DataDog/test-infra-definitions/scenarios/aws/fakeintake" - "github.com/stretchr/testify/assert" ) type dockerSuite struct { diff --git a/test/new-e2e/test-infra-definition/kind_test.go b/test/new-e2e/test-infra-definition/kind_test.go index 5312afb891f34..e31fa3c5c87f3 100644 --- a/test/new-e2e/test-infra-definition/kind_test.go +++ b/test/new-e2e/test-infra-definition/kind_test.go @@ -12,7 +12,7 @@ import ( "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awskubernetes "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/kubernetes" + awskubernetes "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/kubernetes" "github.com/DataDog/test-infra-definitions/common/config" "github.com/DataDog/test-infra-definitions/components/datadog/apps/nginx" diff --git a/test/new-e2e/test-infra-definition/vm_test.go b/test/new-e2e/test-infra-definition/vm_test.go index a396b65a7eb25..0d5c098bc8d9b 100644 --- a/test/new-e2e/test-infra-definition/vm_test.go +++ b/test/new-e2e/test-infra-definition/vm_test.go @@ -10,7 +10,8 @@ import ( "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners" + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/e2e/client" "github.com/DataDog/test-infra-definitions/components/os" @@ -46,7 +47,7 @@ type vmSuiteWithUserData struct { type vmTestCase struct { testName string - provisioner e2e.Provisioner + provisioner provisioners.Provisioner suite e2e.Suite[environments.Host] } diff --git a/test/new-e2e/tests/agent-metrics-logs/jmxfetch/jmxfetch_nix_test.go b/test/new-e2e/tests/agent-metrics-logs/jmxfetch/jmxfetch_nix_test.go index c8f573f95307d..7e13406586659 100644 --- a/test/new-e2e/tests/agent-metrics-logs/jmxfetch/jmxfetch_nix_test.go +++ b/test/new-e2e/tests/agent-metrics-logs/jmxfetch/jmxfetch_nix_test.go @@ -14,7 +14,7 @@ import ( "github.com/DataDog/datadog-agent/test/fakeintake/client" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awsdocker "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/docker" + awsdocker "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/docker" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/e2e/client/agentclient" "github.com/DataDog/test-infra-definitions/components/datadog/apps/jmxfetch" diff --git a/test/new-e2e/tests/agent-metrics-logs/kindfilelogging/kind.go b/test/new-e2e/tests/agent-metrics-logs/kindfilelogging/kind.go index d66fa4f20746d..f863a3142877c 100644 --- a/test/new-e2e/tests/agent-metrics-logs/kindfilelogging/kind.go +++ b/test/new-e2e/tests/agent-metrics-logs/kindfilelogging/kind.go @@ -10,8 +10,8 @@ package kindfilelogging import ( "fmt" - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/runner" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/optional" @@ -112,13 +112,13 @@ func WithExtraConfigParams(configMap runner.ConfigMap) ProvisionerOption { } // Provisioner creates a new provisioner -func Provisioner(opts ...ProvisionerOption) e2e.TypedProvisioner[environments.Kubernetes] { +func Provisioner(opts ...ProvisionerOption) provisioners.TypedProvisioner[environments.Kubernetes] { // We ALWAYS need to make a deep copy of `params`, as the provisioner can be called multiple times. // and it's easy to forget about it, leading to issues that are hard to debug. params := newProvisionerParams() _ = optional.ApplyOptions(params, opts) - provisioner := e2e.NewTypedPulumiProvisioner(provisionerBaseID+params.name, func(ctx *pulumi.Context, env *environments.Kubernetes) error { + provisioner := provisioners.NewTypedPulumiProvisioner(provisionerBaseID+params.name, func(ctx *pulumi.Context, env *environments.Kubernetes) error { // We ALWAYS need to make a deep copy of `params`, as the provisioner can be called multiple times. // and it's easy to forget about it, leading to issues that are hard to debug. params := newProvisionerParams() diff --git a/test/new-e2e/tests/agent-metrics-logs/log-agent/linux-log/file-tailing/file_tailing_test.go b/test/new-e2e/tests/agent-metrics-logs/log-agent/linux-log/file-tailing/file_tailing_test.go index e2067a24f8cd7..9f442afa76893 100644 --- a/test/new-e2e/tests/agent-metrics-logs/log-agent/linux-log/file-tailing/file_tailing_test.go +++ b/test/new-e2e/tests/agent-metrics-logs/log-agent/linux-log/file-tailing/file_tailing_test.go @@ -18,7 +18,7 @@ import ( "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" "github.com/DataDog/datadog-agent/test/new-e2e/tests/agent-metrics-logs/log-agent/utils" ) diff --git a/test/new-e2e/tests/agent-metrics-logs/log-agent/linux-log/file-tailing/multi_line_test.go b/test/new-e2e/tests/agent-metrics-logs/log-agent/linux-log/file-tailing/multi_line_test.go index 47c155ad6cc44..c8fb16ac43dde 100644 --- a/test/new-e2e/tests/agent-metrics-logs/log-agent/linux-log/file-tailing/multi_line_test.go +++ b/test/new-e2e/tests/agent-metrics-logs/log-agent/linux-log/file-tailing/multi_line_test.go @@ -17,7 +17,7 @@ import ( fi "github.com/DataDog/datadog-agent/test/fakeintake/client" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" "github.com/DataDog/datadog-agent/test/new-e2e/tests/agent-metrics-logs/log-agent/utils" ) diff --git a/test/new-e2e/tests/agent-metrics-logs/log-agent/linux-log/file-tailing/utf_test.go b/test/new-e2e/tests/agent-metrics-logs/log-agent/linux-log/file-tailing/utf_test.go index 1851a6e8d4ba6..d038e2624109b 100644 --- a/test/new-e2e/tests/agent-metrics-logs/log-agent/linux-log/file-tailing/utf_test.go +++ b/test/new-e2e/tests/agent-metrics-logs/log-agent/linux-log/file-tailing/utf_test.go @@ -17,7 +17,7 @@ import ( fi "github.com/DataDog/datadog-agent/test/fakeintake/client" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" ) //go:embed config/utf-16-le.yaml diff --git a/test/new-e2e/tests/agent-metrics-logs/log-agent/linux-log/integrations/logs_test.go b/test/new-e2e/tests/agent-metrics-logs/log-agent/linux-log/integrations/logs_test.go index bd70db87ca4c3..e29aaef83d61e 100644 --- a/test/new-e2e/tests/agent-metrics-logs/log-agent/linux-log/integrations/logs_test.go +++ b/test/new-e2e/tests/agent-metrics-logs/log-agent/linux-log/integrations/logs_test.go @@ -9,11 +9,12 @@ import ( _ "embed" "testing" + "github.com/DataDog/test-infra-definitions/components/datadog/agentparams" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" "github.com/DataDog/datadog-agent/test/new-e2e/tests/agent-metrics-logs/log-agent/utils" - "github.com/DataDog/test-infra-definitions/components/datadog/agentparams" ) type IntegrationsLogsSuite struct { diff --git a/test/new-e2e/tests/agent-metrics-logs/log-agent/linux-log/journald/journald_tailing_test.go b/test/new-e2e/tests/agent-metrics-logs/log-agent/linux-log/journald/journald_tailing_test.go index 3a37f3ccda671..7472f18ad5d0d 100644 --- a/test/new-e2e/tests/agent-metrics-logs/log-agent/linux-log/journald/journald_tailing_test.go +++ b/test/new-e2e/tests/agent-metrics-logs/log-agent/linux-log/journald/journald_tailing_test.go @@ -15,11 +15,12 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "github.com/DataDog/test-infra-definitions/components/datadog/agentparams" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" "github.com/DataDog/datadog-agent/test/new-e2e/tests/agent-metrics-logs/log-agent/utils" - "github.com/DataDog/test-infra-definitions/components/datadog/agentparams" ) const eventuallyWithTickDuration = 5 * time.Second diff --git a/test/new-e2e/tests/agent-metrics-logs/log-agent/listener/listener_test.go b/test/new-e2e/tests/agent-metrics-logs/log-agent/listener/listener_test.go index 6a11c2f7d2852..8dc817a250776 100644 --- a/test/new-e2e/tests/agent-metrics-logs/log-agent/listener/listener_test.go +++ b/test/new-e2e/tests/agent-metrics-logs/log-agent/listener/listener_test.go @@ -18,7 +18,7 @@ import ( "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awsdocker "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/docker" + awsdocker "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/docker" appslogger "github.com/DataDog/test-infra-definitions/components/datadog/apps/logger" "github.com/DataDog/test-infra-definitions/components/datadog/dockeragentparams" diff --git a/test/new-e2e/tests/agent-metrics-logs/log-agent/windows-log/file-tailing/file_tailing_test.go b/test/new-e2e/tests/agent-metrics-logs/log-agent/windows-log/file-tailing/file_tailing_test.go index bd61e8cebde0d..f4bd94512b90e 100644 --- a/test/new-e2e/tests/agent-metrics-logs/log-agent/windows-log/file-tailing/file_tailing_test.go +++ b/test/new-e2e/tests/agent-metrics-logs/log-agent/windows-log/file-tailing/file_tailing_test.go @@ -20,7 +20,7 @@ import ( "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" "github.com/DataDog/datadog-agent/test/new-e2e/tests/agent-metrics-logs/log-agent/utils" ) diff --git a/test/new-e2e/tests/agent-platform/common/test_client.go b/test/new-e2e/tests/agent-platform/common/test_client.go index bf827544135ca..b7560b04b006c 100644 --- a/test/new-e2e/tests/agent-platform/common/test_client.go +++ b/test/new-e2e/tests/agent-platform/common/test_client.go @@ -12,8 +12,13 @@ import ( "strings" "time" + componentos "github.com/DataDog/test-infra-definitions/components/os" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "gopkg.in/yaml.v2" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/components" - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/common" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/e2e/client" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/e2e/client/agentclient" boundport "github.com/DataDog/datadog-agent/test/new-e2e/tests/agent-platform/common/bound-port" @@ -22,10 +27,6 @@ import ( pkgmanager "github.com/DataDog/datadog-agent/test/new-e2e/tests/agent-platform/common/pkg-manager" "github.com/DataDog/datadog-agent/test/new-e2e/tests/agent-platform/common/process" svcmanager "github.com/DataDog/datadog-agent/test/new-e2e/tests/agent-platform/common/svc-manager" - componentos "github.com/DataDog/test-infra-definitions/components/os" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "gopkg.in/yaml.v2" "testing" ) @@ -34,7 +35,8 @@ type tHelper interface { Helper() } -func getServiceManager(host *components.RemoteHost) svcmanager.ServiceManager { +// GetServiceManager returns the service manager for the host +func GetServiceManager(host *components.RemoteHost) svcmanager.ServiceManager { if _, err := host.Execute("command -v systemctl"); err == nil { return svcmanager.NewSystemctl(host) } @@ -77,7 +79,7 @@ type TestClient struct { // NewTestClient create a an ExtendedClient from VMClient and AgentCommandRunner, includes svcManager and pkgManager to write agent-platform tests func NewTestClient(host *components.RemoteHost, agentClient agentclient.Agent, fileManager filemanager.FileManager, helper helpers.Helper) *TestClient { - svcManager := getServiceManager(host) + svcManager := GetServiceManager(host) pkgManager := getPackageManager(host) return &TestClient{ Host: host, @@ -181,7 +183,7 @@ func (c *TestClient) ExecuteWithRetry(cmd string) (string, error) { } // NewWindowsTestClient create a TestClient for Windows VM -func NewWindowsTestClient(context e2e.Context, host *components.RemoteHost) *TestClient { +func NewWindowsTestClient(context common.Context, host *components.RemoteHost) *TestClient { fileManager := filemanager.NewRemoteHost(host) t := context.T() diff --git a/test/new-e2e/tests/agent-platform/install-script/install_script_test.go b/test/new-e2e/tests/agent-platform/install-script/install_script_test.go index 150dc1792462c..83ae2407654d4 100644 --- a/test/new-e2e/tests/agent-platform/install-script/install_script_test.go +++ b/test/new-e2e/tests/agent-platform/install-script/install_script_test.go @@ -15,7 +15,7 @@ import ( "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/e2e/client" "github.com/DataDog/datadog-agent/test/new-e2e/tests/agent-platform/common" filemanager "github.com/DataDog/datadog-agent/test/new-e2e/tests/agent-platform/common/file-manager" diff --git a/test/new-e2e/tests/agent-platform/package-signing/package_signing_test.go b/test/new-e2e/tests/agent-platform/package-signing/package_signing_test.go index 0613fba20236b..52aa09e27a60e 100644 --- a/test/new-e2e/tests/agent-platform/package-signing/package_signing_test.go +++ b/test/new-e2e/tests/agent-platform/package-signing/package_signing_test.go @@ -10,13 +10,14 @@ import ( "fmt" "regexp" + "github.com/DataDog/test-infra-definitions/scenarios/aws/ec2" + "github.com/stretchr/testify/assert" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/e2e/client/agentclient" "github.com/DataDog/datadog-agent/test/new-e2e/tests/agent-platform/platforms" - "github.com/DataDog/test-infra-definitions/scenarios/aws/ec2" - "github.com/stretchr/testify/assert" "testing" diff --git a/test/new-e2e/tests/agent-platform/persisting-integrations/persisting_integrations_test.go b/test/new-e2e/tests/agent-platform/persisting-integrations/persisting_integrations_test.go index 425f9b88d33c8..39fd4e5327ef1 100644 --- a/test/new-e2e/tests/agent-platform/persisting-integrations/persisting_integrations_test.go +++ b/test/new-e2e/tests/agent-platform/persisting-integrations/persisting_integrations_test.go @@ -16,7 +16,7 @@ import ( "github.com/DataDog/datadog-agent/pkg/util/testutil/flake" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/e2e/client" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/e2e/client/agentclient" "github.com/DataDog/datadog-agent/test/new-e2e/tests/agent-platform/common" diff --git a/test/new-e2e/tests/agent-platform/rpm/rpm_test.go b/test/new-e2e/tests/agent-platform/rpm/rpm_test.go index feeaaa5bfb5bf..19a5d221a58dd 100644 --- a/test/new-e2e/tests/agent-platform/rpm/rpm_test.go +++ b/test/new-e2e/tests/agent-platform/rpm/rpm_test.go @@ -19,7 +19,7 @@ import ( "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/e2e/client" "github.com/DataDog/datadog-agent/test/new-e2e/tests/agent-platform/common" filemanager "github.com/DataDog/datadog-agent/test/new-e2e/tests/agent-platform/common/file-manager" diff --git a/test/new-e2e/tests/agent-platform/step-by-step/step_by_step_test.go b/test/new-e2e/tests/agent-platform/step-by-step/step_by_step_test.go index 01ba9d04182a5..6c88086a0ab2b 100644 --- a/test/new-e2e/tests/agent-platform/step-by-step/step_by_step_test.go +++ b/test/new-e2e/tests/agent-platform/step-by-step/step_by_step_test.go @@ -15,7 +15,7 @@ import ( "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/e2e/client" "github.com/DataDog/datadog-agent/test/new-e2e/tests/agent-platform/common" filemanager "github.com/DataDog/datadog-agent/test/new-e2e/tests/agent-platform/common/file-manager" diff --git a/test/new-e2e/tests/agent-platform/upgrade/upgrade_test.go b/test/new-e2e/tests/agent-platform/upgrade/upgrade_test.go index 06ecdf8d39273..1ac124114add3 100644 --- a/test/new-e2e/tests/agent-platform/upgrade/upgrade_test.go +++ b/test/new-e2e/tests/agent-platform/upgrade/upgrade_test.go @@ -15,7 +15,7 @@ import ( "github.com/DataDog/datadog-agent/pkg/util/testutil/flake" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/e2e/client" "github.com/DataDog/datadog-agent/test/new-e2e/tests/agent-platform/common" filemanager "github.com/DataDog/datadog-agent/test/new-e2e/tests/agent-platform/common/file-manager" diff --git a/test/new-e2e/tests/agent-shared-components/api/api_test.go b/test/new-e2e/tests/agent-shared-components/api/api_test.go index 97a0ee3553fa2..db7b22ffcdc49 100644 --- a/test/new-e2e/tests/agent-shared-components/api/api_test.go +++ b/test/new-e2e/tests/agent-shared-components/api/api_test.go @@ -26,7 +26,7 @@ import ( "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" "github.com/DataDog/datadog-agent/test/new-e2e/tests/agent-shared-components/secretsutils" ) diff --git a/test/new-e2e/tests/agent-shared-components/config-refresh/config_endpoint.go b/test/new-e2e/tests/agent-shared-components/config-refresh/config_endpoint.go index 47c732d2569dc..19bfbc503ae18 100644 --- a/test/new-e2e/tests/agent-shared-components/config-refresh/config_endpoint.go +++ b/test/new-e2e/tests/agent-shared-components/config-refresh/config_endpoint.go @@ -20,11 +20,11 @@ type agentConfigEndpointInfo struct { } func traceConfigEndpoint(port int) agentConfigEndpointInfo { - return agentConfigEndpointInfo{"trace-agent", "http", port, "/config"} + return agentConfigEndpointInfo{"trace-agent", "https", port, "/config"} } func processConfigEndpoint(port int) agentConfigEndpointInfo { - return agentConfigEndpointInfo{"process-agent", "http", port, "/config/all"} + return agentConfigEndpointInfo{"process-agent", "https", port, "/config/all"} } func securityConfigEndpoint(port int) agentConfigEndpointInfo { diff --git a/test/new-e2e/tests/agent-shared-components/config-refresh/non_core_agents_sync_nix_test.go b/test/new-e2e/tests/agent-shared-components/config-refresh/non_core_agents_sync_nix_test.go index 6ffb0a57472c6..d12913b0ea296 100644 --- a/test/new-e2e/tests/agent-shared-components/config-refresh/non_core_agents_sync_nix_test.go +++ b/test/new-e2e/tests/agent-shared-components/config-refresh/non_core_agents_sync_nix_test.go @@ -18,7 +18,7 @@ import ( "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/e2e/client/agentclient" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/e2e/client/agentclientparams" secrets "github.com/DataDog/datadog-agent/test/new-e2e/tests/agent-shared-components/secretsutils" diff --git a/test/new-e2e/tests/agent-shared-components/config-refresh/non_core_agents_sync_win_test.go b/test/new-e2e/tests/agent-shared-components/config-refresh/non_core_agents_sync_win_test.go index 5499a802a5e65..a68e94ec1d6fe 100644 --- a/test/new-e2e/tests/agent-shared-components/config-refresh/non_core_agents_sync_win_test.go +++ b/test/new-e2e/tests/agent-shared-components/config-refresh/non_core_agents_sync_win_test.go @@ -18,7 +18,7 @@ import ( "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/e2e/client/agentclient" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/e2e/client/agentclientparams" secrets "github.com/DataDog/datadog-agent/test/new-e2e/tests/agent-shared-components/secretsutils" diff --git a/test/new-e2e/tests/agent-shared-components/forwarder/nss_failover_test.go b/test/new-e2e/tests/agent-shared-components/forwarder/nss_failover_test.go index 373bd61ce39af..1eec25ddd5555 100644 --- a/test/new-e2e/tests/agent-shared-components/forwarder/nss_failover_test.go +++ b/test/new-e2e/tests/agent-shared-components/forwarder/nss_failover_test.go @@ -31,6 +31,8 @@ import ( fi "github.com/DataDog/datadog-agent/test/fakeintake/client" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/components" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/common" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/e2e/client" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/e2e/client/agentclient" ) @@ -42,7 +44,7 @@ type multiFakeIntakeEnv struct { Fakeintake2 *components.FakeIntake } -func (e *multiFakeIntakeEnv) Init(ctx e2e.Context) error { +func (e *multiFakeIntakeEnv) Init(ctx common.Context) error { if e.Agent != nil { agent, err := client.NewHostAgentClient(ctx, e.Host.HostOutput, true) if err != nil { @@ -82,7 +84,7 @@ var customLogsConfigTmplFile string //go:embed testfixtures/config.yaml.tmpl var configTmplFile string -func multiFakeIntakeAWS(agentOptions ...agentparams.Option) e2e.Provisioner { +func multiFakeIntakeAWS(agentOptions ...agentparams.Option) provisioners.Provisioner { runFunc := func(ctx *pulumi.Context, env *multiFakeIntakeEnv) error { awsEnv, err := aws.NewEnvironment(ctx) if err != nil { @@ -116,7 +118,7 @@ func multiFakeIntakeAWS(agentOptions ...agentparams.Option) e2e.Provisioner { return nil } - return e2e.NewTypedPulumiProvisioner("aws-nssfailover", runFunc, nil) + return provisioners.NewTypedPulumiProvisioner("aws-nssfailover", runFunc, nil) } type multiFakeIntakeSuite struct { diff --git a/test/new-e2e/tests/agent-shared-components/gui/gui_nix_test.go b/test/new-e2e/tests/agent-shared-components/gui/gui_nix_test.go index c0396429d896d..2f1656483cfe1 100644 --- a/test/new-e2e/tests/agent-shared-components/gui/gui_nix_test.go +++ b/test/new-e2e/tests/agent-shared-components/gui/gui_nix_test.go @@ -19,7 +19,7 @@ import ( "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/e2e/client/agentclientparams" ) diff --git a/test/new-e2e/tests/agent-shared-components/gui/gui_win_test.go b/test/new-e2e/tests/agent-shared-components/gui/gui_win_test.go index b20b3fb5ce01e..c20ff3f1be9a3 100644 --- a/test/new-e2e/tests/agent-shared-components/gui/gui_win_test.go +++ b/test/new-e2e/tests/agent-shared-components/gui/gui_win_test.go @@ -19,7 +19,7 @@ import ( "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/e2e/client/agentclientparams" ) diff --git a/test/new-e2e/tests/agent-shared-components/hostname/imdsv2_transition_common_test.go b/test/new-e2e/tests/agent-shared-components/hostname/imdsv2_transition_common_test.go index 5fa5c05dffc73..1e5ae1e964feb 100644 --- a/test/new-e2e/tests/agent-shared-components/hostname/imdsv2_transition_common_test.go +++ b/test/new-e2e/tests/agent-shared-components/hostname/imdsv2_transition_common_test.go @@ -19,7 +19,7 @@ import ( "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/e2e/client" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/e2e/client/agentclient" ) diff --git a/test/new-e2e/tests/agent-shared-components/inventory/inventory_agent_test.go b/test/new-e2e/tests/agent-shared-components/inventory/inventory_agent_test.go index c06ca14096431..415493d5c7ebd 100644 --- a/test/new-e2e/tests/agent-shared-components/inventory/inventory_agent_test.go +++ b/test/new-e2e/tests/agent-shared-components/inventory/inventory_agent_test.go @@ -14,7 +14,7 @@ import ( "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/e2e/client/agentclient" ) diff --git a/test/new-e2e/tests/agent-shared-components/secret/secret_nix_test.go b/test/new-e2e/tests/agent-shared-components/secret/secret_nix_test.go index b60e9a1bf594f..1cb11d89fffa0 100644 --- a/test/new-e2e/tests/agent-shared-components/secret/secret_nix_test.go +++ b/test/new-e2e/tests/agent-shared-components/secret/secret_nix_test.go @@ -16,7 +16,7 @@ import ( "github.com/stretchr/testify/require" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" - awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" secrets "github.com/DataDog/datadog-agent/test/new-e2e/tests/agent-shared-components/secretsutils" ) diff --git a/test/new-e2e/tests/agent-shared-components/secret/secret_win_test.go b/test/new-e2e/tests/agent-shared-components/secret/secret_win_test.go index 0528334d553c0..f5bc2fbea85b0 100644 --- a/test/new-e2e/tests/agent-shared-components/secret/secret_win_test.go +++ b/test/new-e2e/tests/agent-shared-components/secret/secret_win_test.go @@ -17,7 +17,7 @@ import ( "github.com/stretchr/testify/require" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" - awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" secrets "github.com/DataDog/datadog-agent/test/new-e2e/tests/agent-shared-components/secretsutils" ) diff --git a/test/new-e2e/tests/agent-subcommands/check/check_nix_test.go b/test/new-e2e/tests/agent-subcommands/check/check_nix_test.go index 253ecc8075cc3..69dde70ecfc02 100644 --- a/test/new-e2e/tests/agent-subcommands/check/check_nix_test.go +++ b/test/new-e2e/tests/agent-subcommands/check/check_nix_test.go @@ -13,7 +13,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" - awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/e2e/client/agentclient" ) diff --git a/test/new-e2e/tests/agent-subcommands/check/check_win_test.go b/test/new-e2e/tests/agent-subcommands/check/check_win_test.go index 383663c37f0e6..c9398ad1e8d80 100644 --- a/test/new-e2e/tests/agent-subcommands/check/check_win_test.go +++ b/test/new-e2e/tests/agent-subcommands/check/check_win_test.go @@ -14,7 +14,7 @@ import ( "github.com/DataDog/test-infra-definitions/scenarios/aws/ec2" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" - awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" ) type windowsCheckSuite struct { diff --git a/test/new-e2e/tests/agent-subcommands/config/config_common_test.go b/test/new-e2e/tests/agent-subcommands/config/config_common_test.go index b7b289647a097..9c0c0e589f1d1 100644 --- a/test/new-e2e/tests/agent-subcommands/config/config_common_test.go +++ b/test/new-e2e/tests/agent-subcommands/config/config_common_test.go @@ -10,14 +10,15 @@ import ( _ "embed" "fmt" - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/e2e/client/agentclient" "github.com/DataDog/test-infra-definitions/components/datadog/agentparams" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "gopkg.in/yaml.v2" + + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/e2e/client/agentclient" ) type baseConfigSuite struct { diff --git a/test/new-e2e/tests/agent-subcommands/config/config_nix_test.go b/test/new-e2e/tests/agent-subcommands/config/config_nix_test.go index 595f088a3d644..139bf58d4c2c2 100644 --- a/test/new-e2e/tests/agent-subcommands/config/config_nix_test.go +++ b/test/new-e2e/tests/agent-subcommands/config/config_nix_test.go @@ -9,10 +9,11 @@ package config import ( "testing" - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" - awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" "github.com/DataDog/test-infra-definitions/components/os" "github.com/DataDog/test-infra-definitions/scenarios/aws/ec2" + + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" ) type linuxConfigSuite struct { diff --git a/test/new-e2e/tests/agent-subcommands/config/config_win_test.go b/test/new-e2e/tests/agent-subcommands/config/config_win_test.go index d9b8684de8ec1..7d56eba5c8c82 100644 --- a/test/new-e2e/tests/agent-subcommands/config/config_win_test.go +++ b/test/new-e2e/tests/agent-subcommands/config/config_win_test.go @@ -13,7 +13,7 @@ import ( "github.com/DataDog/test-infra-definitions/scenarios/aws/ec2" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" - awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" ) type windowsConfigSuite struct { diff --git a/test/new-e2e/tests/agent-subcommands/configcheck/configcheck_nix_test.go b/test/new-e2e/tests/agent-subcommands/configcheck/configcheck_nix_test.go index 6f6e744e09bcb..23df3f5210443 100644 --- a/test/new-e2e/tests/agent-subcommands/configcheck/configcheck_nix_test.go +++ b/test/new-e2e/tests/agent-subcommands/configcheck/configcheck_nix_test.go @@ -13,7 +13,7 @@ import ( "github.com/stretchr/testify/require" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" - awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" ) type linuxConfigCheckSuite struct { diff --git a/test/new-e2e/tests/agent-subcommands/configcheck/configcheck_win_test.go b/test/new-e2e/tests/agent-subcommands/configcheck/configcheck_win_test.go index c82fa2c31f5fb..b53ea9629f151 100644 --- a/test/new-e2e/tests/agent-subcommands/configcheck/configcheck_win_test.go +++ b/test/new-e2e/tests/agent-subcommands/configcheck/configcheck_win_test.go @@ -12,7 +12,7 @@ import ( "github.com/stretchr/testify/require" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" - awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" "github.com/DataDog/test-infra-definitions/components/datadog/agentparams" "github.com/DataDog/test-infra-definitions/components/os" diff --git a/test/new-e2e/tests/agent-subcommands/diagnose/diagnose_nix_test.go b/test/new-e2e/tests/agent-subcommands/diagnose/diagnose_nix_test.go index bc32af4f6e4ba..88203b0db4931 100644 --- a/test/new-e2e/tests/agent-subcommands/diagnose/diagnose_nix_test.go +++ b/test/new-e2e/tests/agent-subcommands/diagnose/diagnose_nix_test.go @@ -13,7 +13,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" - awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" svcmanager "github.com/DataDog/datadog-agent/test/new-e2e/tests/agent-platform/common/svc-manager" ) diff --git a/test/new-e2e/tests/agent-subcommands/diagnose/diagnose_win_test.go b/test/new-e2e/tests/agent-subcommands/diagnose/diagnose_win_test.go index bce881ffc8179..a8537e2887690 100644 --- a/test/new-e2e/tests/agent-subcommands/diagnose/diagnose_win_test.go +++ b/test/new-e2e/tests/agent-subcommands/diagnose/diagnose_win_test.go @@ -14,7 +14,7 @@ import ( "github.com/DataDog/test-infra-definitions/scenarios/aws/ec2" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" - awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" ) type windowsDiagnoseSuite struct { diff --git a/test/new-e2e/tests/agent-subcommands/flare/flare_nix_test.go b/test/new-e2e/tests/agent-subcommands/flare/flare_nix_test.go index a027956ba8939..c0935a712cd28 100644 --- a/test/new-e2e/tests/agent-subcommands/flare/flare_nix_test.go +++ b/test/new-e2e/tests/agent-subcommands/flare/flare_nix_test.go @@ -14,7 +14,7 @@ import ( "github.com/DataDog/test-infra-definitions/components/datadog/agentparams" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" - awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/e2e/client/agentclient" ) diff --git a/test/new-e2e/tests/agent-subcommands/flare/flare_win_test.go b/test/new-e2e/tests/agent-subcommands/flare/flare_win_test.go index 45c68f64a1507..144ffa170e54f 100644 --- a/test/new-e2e/tests/agent-subcommands/flare/flare_win_test.go +++ b/test/new-e2e/tests/agent-subcommands/flare/flare_win_test.go @@ -13,7 +13,7 @@ import ( "github.com/DataDog/test-infra-definitions/scenarios/aws/ec2" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" - awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/e2e/client/agentclient" "github.com/stretchr/testify/assert" diff --git a/test/new-e2e/tests/agent-subcommands/health/health_common_test.go b/test/new-e2e/tests/agent-subcommands/health/health_common_test.go index 572282b7e1875..8aec70e72c28c 100644 --- a/test/new-e2e/tests/agent-subcommands/health/health_common_test.go +++ b/test/new-e2e/tests/agent-subcommands/health/health_common_test.go @@ -16,7 +16,7 @@ import ( "github.com/DataDog/datadog-agent/test/fakeintake/api" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" "github.com/cenkalti/backoff" "github.com/stretchr/testify/assert" diff --git a/test/new-e2e/tests/agent-subcommands/health/health_nix_test.go b/test/new-e2e/tests/agent-subcommands/health/health_nix_test.go index 4a064a2d88f93..50e5ecef69919 100644 --- a/test/new-e2e/tests/agent-subcommands/health/health_nix_test.go +++ b/test/new-e2e/tests/agent-subcommands/health/health_nix_test.go @@ -12,7 +12,7 @@ import ( "github.com/DataDog/test-infra-definitions/scenarios/aws/ec2" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" - awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" ) type linuxHealthSuite struct { diff --git a/test/new-e2e/tests/agent-subcommands/health/health_win_test.go b/test/new-e2e/tests/agent-subcommands/health/health_win_test.go index 84da19fdcadc5..33b0285dd31ea 100644 --- a/test/new-e2e/tests/agent-subcommands/health/health_win_test.go +++ b/test/new-e2e/tests/agent-subcommands/health/health_win_test.go @@ -12,7 +12,7 @@ import ( "github.com/DataDog/test-infra-definitions/scenarios/aws/ec2" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" - awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" ) type windowsHealthSuite struct { diff --git a/test/new-e2e/tests/agent-subcommands/hostname/hostname_azure_nix_test.go b/test/new-e2e/tests/agent-subcommands/hostname/hostname_azure_nix_test.go index 7ddd73a1b1bdc..c22d8e08c4abe 100644 --- a/test/new-e2e/tests/agent-subcommands/hostname/hostname_azure_nix_test.go +++ b/test/new-e2e/tests/agent-subcommands/hostname/hostname_azure_nix_test.go @@ -17,7 +17,7 @@ import ( "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - azurehost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/azure/host/linux" + azurehost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/azure/host/linux" ) type linuxAzureHostnameSuite struct { diff --git a/test/new-e2e/tests/agent-subcommands/hostname/hostname_ec2_common_test.go b/test/new-e2e/tests/agent-subcommands/hostname/hostname_ec2_common_test.go index f691a97c6bfd5..6636a8a00c0bb 100644 --- a/test/new-e2e/tests/agent-subcommands/hostname/hostname_ec2_common_test.go +++ b/test/new-e2e/tests/agent-subcommands/hostname/hostname_ec2_common_test.go @@ -6,11 +6,12 @@ package hostname import ( - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" "github.com/DataDog/test-infra-definitions/components/datadog/agentparams" "github.com/stretchr/testify/assert" + + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" ) type baseHostnameSuite struct { diff --git a/test/new-e2e/tests/agent-subcommands/hostname/hostname_ec2_nix_test.go b/test/new-e2e/tests/agent-subcommands/hostname/hostname_ec2_nix_test.go index 2437c5a4306ad..f8e181b6608f2 100644 --- a/test/new-e2e/tests/agent-subcommands/hostname/hostname_ec2_nix_test.go +++ b/test/new-e2e/tests/agent-subcommands/hostname/hostname_ec2_nix_test.go @@ -8,13 +8,14 @@ package hostname import ( "testing" - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" - awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/e2e/client" "github.com/DataDog/test-infra-definitions/components/datadog/agentparams" "github.com/DataDog/test-infra-definitions/components/os" "github.com/DataDog/test-infra-definitions/scenarios/aws/ec2" "github.com/stretchr/testify/assert" + + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/e2e/client" ) type linuxHostnameSuite struct { diff --git a/test/new-e2e/tests/agent-subcommands/hostname/hostname_ec2_win_test.go b/test/new-e2e/tests/agent-subcommands/hostname/hostname_ec2_win_test.go index 3429569e29e7a..d07857f633922 100644 --- a/test/new-e2e/tests/agent-subcommands/hostname/hostname_ec2_win_test.go +++ b/test/new-e2e/tests/agent-subcommands/hostname/hostname_ec2_win_test.go @@ -14,7 +14,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" - awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/e2e/client" ) diff --git a/test/new-e2e/tests/agent-subcommands/hostname/hostname_gcp_nix_test.go b/test/new-e2e/tests/agent-subcommands/hostname/hostname_gcp_nix_test.go index 72cdc02690437..540baa3fcfa4f 100644 --- a/test/new-e2e/tests/agent-subcommands/hostname/hostname_gcp_nix_test.go +++ b/test/new-e2e/tests/agent-subcommands/hostname/hostname_gcp_nix_test.go @@ -14,7 +14,7 @@ import ( "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - gcphost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/gcp/host/linux" + gcphost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/gcp/host/linux" ) type linuxGCPHostnameSuite struct { diff --git a/test/new-e2e/tests/agent-subcommands/run/run_common_test.go b/test/new-e2e/tests/agent-subcommands/run/run_common_test.go index ad971aa5d4dde..403fa77448ac5 100644 --- a/test/new-e2e/tests/agent-subcommands/run/run_common_test.go +++ b/test/new-e2e/tests/agent-subcommands/run/run_common_test.go @@ -6,10 +6,14 @@ package status import ( + "bytes" "context" "errors" + "io" "time" + "github.com/stretchr/testify/assert" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/components" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" @@ -40,3 +44,18 @@ func runCommandWithTimeout(host *components.RemoteHost, cmd string, timeout time // return the timeout error return out, ctx.Err() } + +func (s *baseRunSuite) readUntil(stdout io.Reader, str string) { + s.Assert().EventuallyWithT(func(c *assert.CollectT) { + out := make([]byte, 0x4000) + _, e := stdout.Read(out) + if e != nil && !errors.Is(e, io.EOF) { + c.Errorf("error reading stdout %s", e) + c.FailNow() + } + if !assert.True(c, bytes.Contains(out, []byte(str)), "Did not fine %s", str) { + s.T().Logf("Waiting for %s", str) + } + + }, 3*time.Minute, 1*time.Second, "Did Not find %s", str) +} diff --git a/test/new-e2e/tests/agent-subcommands/run/run_nix_test.go b/test/new-e2e/tests/agent-subcommands/run/run_nix_test.go index 0213be598c452..9bc5744a03765 100644 --- a/test/new-e2e/tests/agent-subcommands/run/run_nix_test.go +++ b/test/new-e2e/tests/agent-subcommands/run/run_nix_test.go @@ -7,9 +7,15 @@ package status import ( "context" + "fmt" + "time" + + "github.com/stretchr/testify/assert" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" - awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" + "github.com/DataDog/datadog-agent/test/new-e2e/tests/agent-platform/common" + "github.com/DataDog/datadog-agent/test/new-e2e/tests/agent-platform/common/process" "testing" ) @@ -44,3 +50,59 @@ func (s *linuxRunSuite) TestRunWhenAgentAlreadyRunning() { s.Require().ErrorContains(err, " listen tcp 127.0.0.1:5001: bind: address already in use") // TODO: Once host.Execute is fixed to return the exit code, check that the exit code is ?? } + +func (s *linuxRunSuite) TestRunAgentCtrlC() { + host := s.Env().RemoteHost + + // stop the agent + svcManager := common.GetServiceManager(host) + s.Require().NotNil(svcManager) + _, err := svcManager.Stop("datadog-agent") + s.Require().NoError(err) + + // execute the `agent run` subcommand + cmd := `sudo datadog-agent run` + + // run command with timeout it + _, _, stdout, err := host.Start(cmd) + if err != nil { + s.FailNow("failed to start agent run command", err) + } + + s.T().Log("Agent run command started") + // wait for the agent and checks to start + s.readUntil(stdout, "Running") + + // get PID of the agent + pids, err := process.FindPID(host, "datadog-agent") + s.Require().NoError(err) + s.T().Log(pids) + + // should be two the sudo command and the subproces + s.Require().Len(pids, 2) + pid := pids[1] + + // send ctrl+c to the agent + _, err = host.Execute(fmt.Sprintf(`sudo kill -INT %d`, pid)) + s.Require().NoError(err) + + // verify it recives the stop command + s.readUntil(stdout, "shutting") + + // wait for the agent to stop + s.Assert().EventuallyWithT(func(c *assert.CollectT) { + pids, err := process.FindPID(host, "datadog-agent") + s.T().Log(pids) + // verify there is an error + assert.Error(c, err) + }, 1*time.Minute, 1*time.Second, "%s should be stopped", "datadog-agent") + + // restart the agent + _, err = svcManager.Start("datadog-agent") + s.Require().NoError(err) + + // wait for the agent to start + s.Assert().EventuallyWithT(func(c *assert.CollectT) { + assert.True(c, s.Env().Agent.Client.IsReady(), "agent should be running") + }, 1*time.Minute, 1*time.Second, "%s should be ready", "datadog-agent") +} diff --git a/test/new-e2e/tests/agent-subcommands/run/run_win_test.go b/test/new-e2e/tests/agent-subcommands/run/run_win_test.go index 521eb1400fe07..04673cadd6934 100644 --- a/test/new-e2e/tests/agent-subcommands/run/run_win_test.go +++ b/test/new-e2e/tests/agent-subcommands/run/run_win_test.go @@ -15,7 +15,7 @@ import ( "github.com/DataDog/test-infra-definitions/scenarios/aws/ec2" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" - awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" windowsAgent "github.com/DataDog/datadog-agent/test/new-e2e/tests/windows/common/agent" ) diff --git a/test/new-e2e/tests/agent-subcommands/secret/secret_nix_test.go b/test/new-e2e/tests/agent-subcommands/secret/secret_nix_test.go index 69de472cab0f4..7050698056943 100644 --- a/test/new-e2e/tests/agent-subcommands/secret/secret_nix_test.go +++ b/test/new-e2e/tests/agent-subcommands/secret/secret_nix_test.go @@ -10,7 +10,7 @@ import ( "time" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" - awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/e2e/client/agentclient" secrets "github.com/DataDog/datadog-agent/test/new-e2e/tests/agent-shared-components/secretsutils" diff --git a/test/new-e2e/tests/agent-subcommands/secret/secret_win_test.go b/test/new-e2e/tests/agent-subcommands/secret/secret_win_test.go index d4e099410dda6..bbeeef59ec1dd 100644 --- a/test/new-e2e/tests/agent-subcommands/secret/secret_win_test.go +++ b/test/new-e2e/tests/agent-subcommands/secret/secret_win_test.go @@ -17,7 +17,7 @@ import ( "github.com/stretchr/testify/require" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" - awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/e2e/client/agentclient" secrets "github.com/DataDog/datadog-agent/test/new-e2e/tests/agent-shared-components/secretsutils" ) diff --git a/test/new-e2e/tests/agent-subcommands/status/status_nix_test.go b/test/new-e2e/tests/agent-subcommands/status/status_nix_test.go index ab805b2d90db7..35841716f6463 100644 --- a/test/new-e2e/tests/agent-subcommands/status/status_nix_test.go +++ b/test/new-e2e/tests/agent-subcommands/status/status_nix_test.go @@ -12,7 +12,7 @@ import ( "github.com/DataDog/test-infra-definitions/components/datadog/agentparams" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" - awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/e2e/client" ) diff --git a/test/new-e2e/tests/agent-subcommands/status/status_win_test.go b/test/new-e2e/tests/agent-subcommands/status/status_win_test.go index eef19d962c363..2a66687fe7303 100644 --- a/test/new-e2e/tests/agent-subcommands/status/status_win_test.go +++ b/test/new-e2e/tests/agent-subcommands/status/status_win_test.go @@ -14,7 +14,7 @@ import ( "github.com/DataDog/test-infra-definitions/scenarios/aws/ec2" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" - awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/e2e/client" ) diff --git a/test/new-e2e/tests/apm/docker_test.go b/test/new-e2e/tests/apm/docker_test.go index 04cdf2045e79f..4c7fc8451145f 100644 --- a/test/new-e2e/tests/apm/docker_test.go +++ b/test/new-e2e/tests/apm/docker_test.go @@ -12,7 +12,7 @@ import ( "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awsdocker "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/docker" + awsdocker "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/docker" "github.com/DataDog/test-infra-definitions/components/datadog/dockeragentparams" "github.com/pulumi/pulumi/sdk/v3/go/pulumi" diff --git a/test/new-e2e/tests/apm/vm_test.go b/test/new-e2e/tests/apm/vm_test.go index 90f78554db9e2..006cd6353bd79 100644 --- a/test/new-e2e/tests/apm/vm_test.go +++ b/test/new-e2e/tests/apm/vm_test.go @@ -26,7 +26,7 @@ import ( "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/e2e/client/agentclient" "github.com/DataDog/datadog-agent/test/new-e2e/tests/agent-shared-components/secretsutils" ) diff --git a/test/new-e2e/tests/containers/base_test.go b/test/new-e2e/tests/containers/base_test.go index 84bce8ea70197..7bc4735a43dd2 100644 --- a/test/new-e2e/tests/containers/base_test.go +++ b/test/new-e2e/tests/containers/base_test.go @@ -14,7 +14,6 @@ import ( "github.com/samber/lo" "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/suite" "gopkg.in/yaml.v3" "gopkg.in/zorkian/go-datadog-api.v2" @@ -23,39 +22,21 @@ import ( "github.com/DataDog/datadog-agent/pkg/util/pointer" "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/runner" - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/runner/parameters" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" ) -type baseSuite struct { - suite.Suite +type baseSuite[Env any] struct { + e2e.BaseSuite[Env] - startTime time.Time - endTime time.Time - datadogClient *datadog.Client - Fakeintake *fakeintake.Client - clusterName string + Fakeintake *fakeintake.Client + clusterName string } -func (suite *baseSuite) SetupSuite() { - apiKey, err := runner.GetProfile().SecretStore().Get(parameters.APIKey) - suite.Require().NoError(err) - appKey, err := runner.GetProfile().SecretStore().Get(parameters.APPKey) - suite.Require().NoError(err) - suite.datadogClient = datadog.NewClient(apiKey, appKey) - - suite.startTime = time.Now() -} - -func (suite *baseSuite) TearDownSuite() { - suite.endTime = time.Now() -} - -func (suite *baseSuite) BeforeTest(suiteName, testName string) { +func (suite *baseSuite[Env]) BeforeTest(suiteName, testName string) { suite.T().Logf("START %s/%s %s", suiteName, testName, time.Now()) } -func (suite *baseSuite) AfterTest(suiteName, testName string) { +func (suite *baseSuite[Env]) AfterTest(suiteName, testName string) { suite.T().Logf("FINISH %s/%s %s", suiteName, testName, time.Now()) } @@ -98,7 +79,7 @@ func (mc *myCollectT) Errorf(format string, args ...interface{}) { mc.CollectT.Errorf(format, args...) } -func (suite *baseSuite) testMetric(args *testMetricArgs) { +func (suite *baseSuite[Env]) testMetric(args *testMetricArgs) { prettyMetricQuery := fmt.Sprintf("%s{%s}", args.Filter.Name, strings.Join(args.Filter.Tags, ",")) suite.Run("metric "+prettyMetricQuery, func() { @@ -107,7 +88,7 @@ func (suite *baseSuite) testMetric(args *testMetricArgs) { expectedTags = lo.Map(*args.Expect.Tags, func(tag string, _ int) *regexp.Regexp { return regexp.MustCompile(tag) }) } - var optionalTags []*regexp.Regexp + optionalTags := []*regexp.Regexp{regexp.MustCompile("stackid:.*")} // The stackid tag is added by the framework itself to allow filtering on the stack id if args.Optional.Tags != nil { optionalTags = lo.Map(*args.Optional.Tags, func(tag string, _ int) *regexp.Regexp { return regexp.MustCompile(tag) }) } @@ -120,7 +101,7 @@ func (suite *baseSuite) testMetric(args *testMetricArgs) { return "filter_tag_" + tag }) - if _, err := suite.datadogClient.PostEvent(&datadog.Event{ + if _, err := suite.DatadogClient().PostEvent(&datadog.Event{ Title: pointer.Ptr(fmt.Sprintf("testMetric %s", prettyMetricQuery)), Text: pointer.Ptr(fmt.Sprintf(`%%%%%% ### Result @@ -227,7 +208,7 @@ type testLogExpectArgs struct { Message string } -func (suite *baseSuite) testLog(args *testLogArgs) { +func (suite *baseSuite[Env]) testLog(args *testLogArgs) { prettyLogQuery := fmt.Sprintf("%s{%s}", args.Filter.Service, strings.Join(args.Filter.Tags, ",")) suite.Run("log "+prettyLogQuery, func() { @@ -249,7 +230,7 @@ func (suite *baseSuite) testLog(args *testLogArgs) { return "filter_tag_" + tag }) - if _, err := suite.datadogClient.PostEvent(&datadog.Event{ + if _, err := suite.DatadogClient().PostEvent(&datadog.Event{ Title: pointer.Ptr(fmt.Sprintf("testLog %s", prettyLogQuery)), Text: pointer.Ptr(fmt.Sprintf(`%%%%%% ### Result @@ -356,7 +337,7 @@ type testCheckRunExpectArgs struct { AcceptUnexpectedTags bool } -func (suite *baseSuite) testCheckRun(args *testCheckRunArgs) { +func (suite *baseSuite[Env]) testCheckRun(args *testCheckRunArgs) { prettyCheckRunQuery := fmt.Sprintf("%s{%s}", args.Filter.Name, strings.Join(args.Filter.Tags, ",")) suite.Run("checkRun "+prettyCheckRunQuery, func() { @@ -378,7 +359,7 @@ func (suite *baseSuite) testCheckRun(args *testCheckRunArgs) { return "filter_tag_" + tag }) - if _, err := suite.datadogClient.PostEvent(&datadog.Event{ + if _, err := suite.DatadogClient().PostEvent(&datadog.Event{ Title: pointer.Ptr(fmt.Sprintf("testCheckRun %s", prettyCheckRunQuery)), Text: pointer.Ptr(fmt.Sprintf(`%%%%%% ### Result diff --git a/test/new-e2e/tests/containers/docker_test.go b/test/new-e2e/tests/containers/docker_test.go index a7d27f4fa2987..46c2cd83fe1b4 100644 --- a/test/new-e2e/tests/containers/docker_test.go +++ b/test/new-e2e/tests/containers/docker_test.go @@ -6,53 +6,24 @@ package containers 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" - "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/e2e" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" + awsdocker "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/docker" ) type DockerSuite struct { - baseSuite + baseSuite[environments.DockerHost] } func TestDockerSuite(t *testing.T) { - suite.Run(t, &DockerSuite{}) + e2e.Run(t, &DockerSuite{}, e2e.WithProvisioner(awsdocker.Provisioner(awsdocker.WithTestingWorkload()))) } func (suite *DockerSuite) SetupSuite() { - ctx := context.Background() - - stackConfig := runner.ConfigMap{ - "ddagent:deploy": auto.ConfigValue{Value: "true"}, - "ddagent:fakeintake": auto.ConfigValue{Value: "true"}, - } - - _, stackOutput, err := infra.GetStackManager().GetStack(ctx, "dockerstack", stackConfig, ec2.VMRunWithDocker, false) - suite.Require().NoError(err) - - var fakeintake components.FakeIntake - fiSerialized, err := json.Marshal(stackOutput.Outputs["dd-Fakeintake-aws-aws-vm"].Value) - suite.Require().NoError(err) - suite.Require().NoError(fakeintake.Import(fiSerialized, &fakeintake)) - suite.Require().NoError(fakeintake.Init(suite)) - suite.Fakeintake = fakeintake.Client() - - var host components.RemoteHost - hostSerialized, err := json.Marshal(stackOutput.Outputs["dd-Host-aws-vm"].Value) - suite.Require().NoError(err) - suite.Require().NoError(host.Import(hostSerialized, &host)) - suite.Require().NoError(host.Init(suite)) - suite.clusterName = fmt.Sprintf("%s-%v", os.Getenv("USER"), host.Address) - suite.baseSuite.SetupSuite() + suite.Fakeintake = suite.Env().FakeIntake.Client() } func (suite *DockerSuite) TestDSDWithUDS() { diff --git a/test/new-e2e/tests/containers/dump_cluster_state.go b/test/new-e2e/tests/containers/dump_cluster_state.go deleted file mode 100644 index ddf546d889d09..0000000000000 --- a/test/new-e2e/tests/containers/dump_cluster_state.go +++ /dev/null @@ -1,341 +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 containers - -import ( - "bytes" - "context" - "encoding/base64" - "fmt" - "io" - "net" - "os" - "os/user" - "strings" - "sync" - - "github.com/DataDog/datadog-agent/pkg/util/pointer" - awsconfig "github.com/aws/aws-sdk-go-v2/config" - awsec2 "github.com/aws/aws-sdk-go-v2/service/ec2" - awsec2types "github.com/aws/aws-sdk-go-v2/service/ec2/types" - awseks "github.com/aws/aws-sdk-go-v2/service/eks" - awsekstypes "github.com/aws/aws-sdk-go-v2/service/eks/types" - "golang.org/x/crypto/ssh" - "golang.org/x/crypto/ssh/agent" - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/cli-runtime/pkg/genericclioptions" - "k8s.io/cli-runtime/pkg/genericiooptions" - "k8s.io/client-go/kubernetes" - "k8s.io/client-go/tools/clientcmd" - clientcmdapi "k8s.io/client-go/tools/clientcmd/api" - kubectlget "k8s.io/kubectl/pkg/cmd/get" - kubectlutil "k8s.io/kubectl/pkg/cmd/util" -) - -func dumpEKSClusterState(ctx context.Context, name string) (ret string) { - var out strings.Builder - defer func() { ret = out.String() }() - - cfg, err := awsconfig.LoadDefaultConfig(ctx) - if err != nil { - fmt.Fprintf(&out, "Failed to load AWS config: %v\n", err) - return - } - - client := awseks.NewFromConfig(cfg) - - clusterDescription, err := client.DescribeCluster(ctx, &awseks.DescribeClusterInput{ - Name: &name, - }) - if err != nil { - fmt.Fprintf(&out, "Failed to describe cluster %s: %v\n", name, err) - return - } - - cluster := clusterDescription.Cluster - if cluster.Status != awsekstypes.ClusterStatusActive { - fmt.Fprintf(&out, "EKS cluster %s is not in active state. Current status: %s\n", name, cluster.Status) - return - } - - kubeconfig := clientcmdapi.NewConfig() - kubeconfig.Clusters[name] = &clientcmdapi.Cluster{ - Server: *cluster.Endpoint, - } - if kubeconfig.Clusters[name].CertificateAuthorityData, err = base64.StdEncoding.DecodeString(*cluster.CertificateAuthority.Data); err != nil { - fmt.Fprintf(&out, "Failed to decode certificate authority: %v\n", err) - } - kubeconfig.AuthInfos[name] = &clientcmdapi.AuthInfo{ - Exec: &clientcmdapi.ExecConfig{ - APIVersion: "client.authentication.k8s.io/v1beta1", - Command: "aws", - Args: []string{ - "--region", - cfg.Region, - "eks", - "get-token", - "--cluster-name", - name, - "--output", - "json", - }, - }, - } - kubeconfig.Contexts[name] = &clientcmdapi.Context{ - Cluster: name, - AuthInfo: name, - } - kubeconfig.CurrentContext = name - - dumpK8sClusterState(ctx, kubeconfig, &out) - - return -} - -func dumpKindClusterState(ctx context.Context, name string) (ret string) { - var out strings.Builder - defer func() { ret = out.String() }() - - cfg, err := awsconfig.LoadDefaultConfig(ctx) - if err != nil { - fmt.Fprintf(&out, "Failed to load AWS config: %v\n", err) - return - } - - ec2Client := awsec2.NewFromConfig(cfg) - - user, _ := user.Current() - instancesDescription, err := ec2Client.DescribeInstances(ctx, &awsec2.DescribeInstancesInput{ - Filters: []awsec2types.Filter{ - { - Name: pointer.Ptr("tag:managed-by"), - Values: []string{"pulumi"}, - }, - { - Name: pointer.Ptr("tag:username"), - Values: []string{user.Username}, - }, - { - Name: pointer.Ptr("tag:Name"), - Values: []string{name + "-aws-kind"}, - }, - }, - }) - if err != nil { - fmt.Fprintf(&out, "Failed to describe instances: %v\n", err) - return - } - - if instancesDescription == nil || (len(instancesDescription.Reservations) != 1 && len(instancesDescription.Reservations[0].Instances) != 1) { - fmt.Fprintf(&out, "Didn’t find exactly one instance for cluster %s\n", name) - return - } - - instanceIP := instancesDescription.Reservations[0].Instances[0].PrivateIpAddress - - auth := []ssh.AuthMethod{} - - if sshAgentSocket, found := os.LookupEnv("SSH_AUTH_SOCK"); found { - sshAgent, err := net.Dial("unix", sshAgentSocket) - if err != nil { - fmt.Fprintf(&out, "Failed to connect to SSH agent: %v\n", err) - return - } - defer sshAgent.Close() - - auth = append(auth, ssh.PublicKeysCallback(agent.NewClient(sshAgent).Signers)) - } - - if sshKeyPath, found := os.LookupEnv("E2E_PRIVATE_KEY_PATH"); found { - sshKey, err := os.ReadFile(sshKeyPath) - if err != nil { - fmt.Fprintf(&out, "Failed to read SSH key: %v\n", err) - return - } - - signer, err := ssh.ParsePrivateKey(sshKey) - if err != nil { - fmt.Fprintf(&out, "Failed to parse SSH key: %v\n", err) - return - } - - auth = append(auth, ssh.PublicKeys(signer)) - } - - var sshClient *ssh.Client - err = nil - for _, user := range []string{"ec2-user", "ubuntu"} { - sshClient, err = ssh.Dial("tcp", *instanceIP+":22", &ssh.ClientConfig{ - User: user, - Auth: auth, - HostKeyCallback: ssh.InsecureIgnoreHostKey(), - }) - if err == nil { - break - } - } - if err != nil { - fmt.Fprintf(&out, "Failed to dial SSH server %s: %v\n", *instanceIP, err) - return - } - defer sshClient.Close() - - sshSession, err := sshClient.NewSession() - if err != nil { - fmt.Fprintf(&out, "Failed to create SSH session: %v\n", err) - return - } - defer sshSession.Close() - - stdout, err := sshSession.StdoutPipe() - if err != nil { - fmt.Fprintf(&out, "Failed to create stdout pipe: %v\n", err) - return - } - - stderr, err := sshSession.StderrPipe() - if err != nil { - fmt.Fprintf(&out, "Failed to create stderr pipe: %v\n", err) - return - } - - err = sshSession.Start("kind get kubeconfig --name \"$(kind get clusters | head -n 1)\"") - if err != nil { - fmt.Fprintf(&out, "Failed to start remote command: %v\n", err) - return - } - - var stdoutBuf bytes.Buffer - - var wg sync.WaitGroup - wg.Add(2) - - go func() { - if _, err := io.Copy(&stdoutBuf, stdout); err != nil { - fmt.Fprintf(&out, "Failed to read stdout: %v\n", err) - } - wg.Done() - }() - - go func() { - if _, err := io.Copy(&out, stderr); err != nil { - fmt.Fprintf(&out, "Failed to read stderr: %v\n", err) - } - wg.Done() - }() - - err = sshSession.Wait() - wg.Wait() - if err != nil { - fmt.Fprintf(&out, "Remote command exited with error: %v\n", err) - return - } - - kubeconfig, err := clientcmd.Load(stdoutBuf.Bytes()) - if err != nil { - fmt.Fprintf(&out, "Failed to parse kubeconfig: %v\n", err) - return - } - - for _, cluster := range kubeconfig.Clusters { - cluster.Server = strings.Replace(cluster.Server, "0.0.0.0", *instanceIP, 1) - cluster.CertificateAuthorityData = nil - cluster.InsecureSkipTLSVerify = true - } - - dumpK8sClusterState(ctx, kubeconfig, &out) - - return -} - -func dumpK8sClusterState(ctx context.Context, kubeconfig *clientcmdapi.Config, out *strings.Builder) { - kubeconfigFile, err := os.CreateTemp("", "kubeconfig") - if err != nil { - fmt.Fprintf(out, "Failed to create kubeconfig temporary file: %v\n", err) - return - } - defer os.Remove(kubeconfigFile.Name()) - - if err := clientcmd.WriteToFile(*kubeconfig, kubeconfigFile.Name()); err != nil { - fmt.Fprintf(out, "Failed to write kubeconfig file: %v\n", err) - return - } - - if err := kubeconfigFile.Close(); err != nil { - fmt.Fprintf(out, "Failed to close kubeconfig file: %v\n", err) - } - - fmt.Fprintf(out, "\n") - - configFlags := genericclioptions.NewConfigFlags(false) - kubeconfigFileName := kubeconfigFile.Name() - configFlags.KubeConfig = &kubeconfigFileName - - factory := kubectlutil.NewFactory(configFlags) - - streams := genericiooptions.IOStreams{ - Out: out, - ErrOut: out, - } - - getCmd := kubectlget.NewCmdGet("", factory, streams) - getCmd.SetOut(out) - getCmd.SetErr(out) - getCmd.SetContext(ctx) - getCmd.SetArgs([]string{ - "nodes,all", - "--all-namespaces", - "-o", - "wide", - }) - if err := getCmd.ExecuteContext(ctx); err != nil { - fmt.Fprintf(out, "Failed to execute Get command: %v\n", err) - return - } - - // Get the logs of containers that have restarted - config, err := clientcmd.BuildConfigFromFlags("", kubeconfigFile.Name()) - if err != nil { - fmt.Fprintf(out, "Failed to build Kubernetes config: %v\n", err) - return - } - k8sClient, err := kubernetes.NewForConfig(config) - if err != nil { - fmt.Fprintf(out, "Failed to create Kubernetes client: %v\n", err) - return - } - - pods, err := k8sClient.CoreV1().Pods("").List(ctx, metav1.ListOptions{}) - if err != nil { - fmt.Fprintf(out, "Failed to list pods: %v\n", err) - return - } - - for _, pod := range pods.Items { - for _, containerStatus := range pod.Status.ContainerStatuses { - if containerStatus.RestartCount > 0 { - fmt.Fprintf(out, "\nLOGS FOR POD %s/%s CONTAINER %s:\n", pod.Namespace, pod.Name, containerStatus.Name) - logs, err := k8sClient.CoreV1().Pods(pod.Namespace).GetLogs(pod.Name, &corev1.PodLogOptions{ - Container: containerStatus.Name, - Previous: true, - // TailLines: pointer.Ptr(int64(100)), - }).Stream(ctx) - if err != nil { - fmt.Fprintf(out, "Failed to get logs: %v\n", err) - continue - } - defer logs.Close() - - _, err = io.Copy(out, logs) - if err != nil { - fmt.Fprintf(out, "Failed to copy logs: %v\n", err) - continue - } - } - } - } -} diff --git a/test/new-e2e/tests/containers/ecs_test.go b/test/new-e2e/tests/containers/ecs_test.go index 9498aa9414deb..cdf19396f01ec 100644 --- a/test/new-e2e/tests/containers/ecs_test.go +++ b/test/new-e2e/tests/containers/ecs_test.go @@ -7,29 +7,26 @@ package containers import ( "context" - "encoding/json" "regexp" "strings" "testing" "time" - ecsComp "github.com/DataDog/test-infra-definitions/components/ecs" - "github.com/DataDog/test-infra-definitions/scenarios/aws/ecs" - "github.com/DataDog/datadog-agent/pkg/util/pointer" - "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" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" awsconfig "github.com/aws/aws-sdk-go-v2/config" awsecs "github.com/aws/aws-sdk-go-v2/service/ecs" awsecstypes "github.com/aws/aws-sdk-go-v2/service/ecs/types" "github.com/fatih/color" - "github.com/pulumi/pulumi/sdk/v3/go/auto" "github.com/samber/lo" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/stretchr/testify/suite" + + tifecs "github.com/DataDog/test-infra-definitions/scenarios/aws/ecs" + + envecs "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/ecs" ) const ( @@ -41,52 +38,27 @@ const ( ) type ecsSuite struct { - baseSuite - + baseSuite[environments.ECS] ecsClusterName string } func TestECSSuite(t *testing.T) { - suite.Run(t, &ecsSuite{}) + e2e.Run(t, &ecsSuite{}, e2e.WithProvisioner(envecs.Provisioner( + envecs.WithECSOptions( + tifecs.WithFargateCapacityProvider(), + tifecs.WithLinuxNodeGroup(), + tifecs.WithWindowsNodeGroup(), + tifecs.WithLinuxBottleRocketNodeGroup(), + ), + envecs.WithTestingWorkload(), + ))) } func (suite *ecsSuite) SetupSuite() { - ctx := context.Background() - - // Creating the stack - stackConfig := runner.ConfigMap{ - "ddinfra:aws/ecs/linuxECSOptimizedNodeGroup": auto.ConfigValue{Value: "true"}, - "ddinfra:aws/ecs/linuxBottlerocketNodeGroup": auto.ConfigValue{Value: "true"}, - "ddinfra:aws/ecs/windowsLTSCNodeGroup": auto.ConfigValue{Value: "true"}, - "ddagent:deploy": auto.ConfigValue{Value: "true"}, - "ddagent:fakeintake": auto.ConfigValue{Value: "true"}, - "ddtestworkload:deploy": auto.ConfigValue{Value: "true"}, - } - - _, stackOutput, err := infra.GetStackManager().GetStackNoDeleteOnFailure( - ctx, - "ecs-cluster", - ecs.Run, - infra.WithConfigMap(stackConfig), - ) - suite.Require().NoError(err) - - fakeintake := &components.FakeIntake{} - fiSerialized, err := json.Marshal(stackOutput.Outputs["dd-Fakeintake-aws-ecs"].Value) - suite.Require().NoError(err) - suite.Require().NoError(fakeintake.Import(fiSerialized, fakeintake)) - suite.Require().NoError(fakeintake.Init(suite)) - suite.Fakeintake = fakeintake.Client() - - clusterSerialized, err := json.Marshal(stackOutput.Outputs["dd-Cluster-ecs"].Value) - suite.Require().NoError(err) - ecsCluster := &ecsComp.ClusterOutput{} - suite.Require().NoError(ecsCluster.Import(clusterSerialized, ecsCluster)) - - suite.ecsClusterName = ecsCluster.ClusterName - suite.clusterName = suite.ecsClusterName - suite.baseSuite.SetupSuite() + suite.Fakeintake = suite.Env().FakeIntake.Client() + suite.ecsClusterName = suite.Env().ECSCluster.ClusterName + suite.clusterName = suite.Env().ECSCluster.ClusterName } func (suite *ecsSuite) TearDownSuite() { @@ -99,8 +71,8 @@ func (suite *ecsSuite) TearDownSuite() { suite.T().Log(c("https://dddev.datadoghq.com/dashboard/mnw-tdr-jd8/e2e-tests-containers-ecs?refresh_mode=paused&tpl_var_ecs_cluster_name%%5B0%%5D=%s&tpl_var_fake_intake_task_family%%5B0%%5D=%s-fakeintake-ecs&from_ts=%d&to_ts=%d&live=false", suite.ecsClusterName, strings.TrimSuffix(suite.ecsClusterName, "-ecs"), - suite.startTime.UnixMilli(), - suite.endTime.UnixMilli(), + suite.StartTime().UnixMilli(), + suite.EndTime().UnixMilli(), )) } diff --git a/test/new-e2e/tests/containers/eks_test.go b/test/new-e2e/tests/containers/eks_test.go index 6562eff6abb80..40446d85f6398 100644 --- a/test/new-e2e/tests/containers/eks_test.go +++ b/test/new-e2e/tests/containers/eks_test.go @@ -6,104 +6,34 @@ package containers import ( - "context" - "encoding/json" "testing" - "github.com/DataDog/test-infra-definitions/scenarios/aws/eks" + "github.com/DataDog/test-infra-definitions/components/datadog/kubernetesagentparams" + tifeks "github.com/DataDog/test-infra-definitions/scenarios/aws/eks" - "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/runner/parameters" - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/infra" - - "github.com/pulumi/pulumi/sdk/v3/go/auto" - "github.com/stretchr/testify/suite" - "k8s.io/client-go/tools/clientcmd" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" + awskubernetes "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/kubernetes" ) type eksSuite struct { k8sSuite - initOnly bool } func TestEKSSuite(t *testing.T) { - var initOnly bool - initOnlyParam, err := runner.GetProfile().ParamStore().GetBoolWithDefault(parameters.InitOnly, false) - if err == nil { - initOnly = initOnlyParam - } - suite.Run(t, &eksSuite{initOnly: initOnly}) + e2e.Run(t, &eksSuite{}, e2e.WithProvisioner(awskubernetes.EKSProvisioner( + awskubernetes.WithEKSOptions( + tifeks.WithLinuxNodeGroup(), + tifeks.WithWindowsNodeGroup(), + tifeks.WithBottlerocketNodeGroup(), + tifeks.WithLinuxARMNodeGroup(), + ), + awskubernetes.WithDeployDogstatsd(), + awskubernetes.WithDeployTestWorkload(), + awskubernetes.WithAgentOptions(kubernetesagentparams.WithDualShipping()), + ))) } func (suite *eksSuite) SetupSuite() { - ctx := context.Background() - - stackConfig := runner.ConfigMap{ - "ddagent:deploy": auto.ConfigValue{Value: "true"}, - "ddagent:fakeintake": auto.ConfigValue{Value: "true"}, - "ddtestworkload:deploy": auto.ConfigValue{Value: "true"}, - "dddogstatsd:deploy": auto.ConfigValue{Value: "true"}, - } - - _, stackOutput, err := infra.GetStackManager().GetStackNoDeleteOnFailure( - ctx, - "eks-cluster", - eks.Run, - infra.WithConfigMap(stackConfig), - ) - - if !suite.Assert().NoError(err) { - stackName, err := infra.GetStackManager().GetPulumiStackName("eks-cluster") - suite.Require().NoError(err) - suite.T().Log(dumpEKSClusterState(ctx, stackName)) - if !runner.GetProfile().AllowDevMode() || !*keepStacks { - infra.GetStackManager().DeleteStack(ctx, "eks-cluster", nil) - } - suite.T().FailNow() - } - - if suite.initOnly { - suite.T().Skip("E2E_INIT_ONLY is set, skipping tests") - } - - fakeintake := &components.FakeIntake{} - fiSerialized, err := json.Marshal(stackOutput.Outputs["dd-Fakeintake-aws-ecs"].Value) - suite.Require().NoError(err) - suite.Require().NoError(fakeintake.Import(fiSerialized, &fakeintake)) - suite.Require().NoError(fakeintake.Init(suite)) - suite.Fakeintake = fakeintake.Client() - - kubeCluster := &components.KubernetesCluster{} - kubeSerialized, err := json.Marshal(stackOutput.Outputs["dd-Cluster-eks"].Value) - suite.Require().NoError(err) - suite.Require().NoError(kubeCluster.Import(kubeSerialized, &kubeCluster)) - suite.Require().NoError(kubeCluster.Init(suite)) - suite.KubeClusterName = kubeCluster.ClusterName - suite.K8sClient = kubeCluster.Client() - suite.K8sConfig, err = clientcmd.RESTConfigFromKubeConfig([]byte(kubeCluster.KubeConfig)) - suite.Require().NoError(err) - - kubernetesAgent := &components.KubernetesAgent{} - kubernetesAgentSerialized, err := json.Marshal(stackOutput.Outputs["dd-KubernetesAgent-aws-datadog-agent"].Value) - suite.Require().NoError(err) - suite.Require().NoError(kubernetesAgent.Import(kubernetesAgentSerialized, &kubernetesAgent)) - - suite.KubernetesAgentRef = kubernetesAgent - suite.k8sSuite.SetupSuite() -} - -func (suite *eksSuite) TearDownSuite() { - if suite.initOnly { - suite.T().Logf("E2E_INIT_ONLY is set, skipping deletion") - return - } - - suite.k8sSuite.TearDownSuite() - - ctx := context.Background() - stackName, err := infra.GetStackManager().GetPulumiStackName("eks-cluster") - suite.Require().NoError(err) - suite.T().Log(dumpEKSClusterState(ctx, stackName)) + suite.Fakeintake = suite.Env().FakeIntake.Client() } diff --git a/test/new-e2e/tests/containers/k8s_test.go b/test/new-e2e/tests/containers/k8s_test.go index fbb1195a976c3..ceb84e59d7319 100644 --- a/test/new-e2e/tests/containers/k8s_test.go +++ b/test/new-e2e/tests/containers/k8s_test.go @@ -19,10 +19,9 @@ import ( "gopkg.in/zorkian/go-datadog-api.v2" "github.com/DataDog/datadog-agent/pkg/util/pointer" - "github.com/DataDog/datadog-agent/pkg/util/testutil/flake" "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" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" "github.com/fatih/color" "github.com/samber/lo" @@ -32,9 +31,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/fields" "k8s.io/apimachinery/pkg/types" - "k8s.io/client-go/kubernetes" "k8s.io/client-go/kubernetes/scheme" - restclient "k8s.io/client-go/rest" "k8s.io/client-go/tools/remotecommand" ) @@ -42,6 +39,7 @@ const ( kubeNamespaceDogstatsWorkload = "workload-dogstatsd" kubeNamespaceDogstatsStandaloneWorkload = "workload-dogstatsd-standalone" kubeNamespaceTracegenWorkload = "workload-tracegen" + kubeDeploymentDogstatsdUDP = "dogstatsd-udp" kubeDeploymentDogstatsdUDPOrigin = "dogstatsd-udp-origin-detection" kubeDeploymentDogstatsdUDPExternalData = "dogstatsd-udp-external-data-only" kubeDeploymentDogstatsdUDS = "dogstatsd-uds" @@ -52,21 +50,12 @@ const ( var GitCommit string type k8sSuite struct { - baseSuite - - KubeClusterName string - AgentLinuxHelmInstallName string - AgentWindowsHelmInstallName string - KubernetesAgentRef *components.KubernetesAgent - - K8sConfig *restclient.Config - K8sClient kubernetes.Interface + baseSuite[environments.Kubernetes] } func (suite *k8sSuite) SetupSuite() { - suite.clusterName = suite.KubeClusterName - suite.baseSuite.SetupSuite() + suite.clusterName = suite.Env().KubernetesCluster.ClusterName } func (suite *k8sSuite) TearDownSuite() { @@ -77,10 +66,10 @@ func (suite *k8sSuite) TearDownSuite() { suite.T().Log(c("The data produced and asserted by these tests can be viewed on this dashboard:")) c = color.New(color.Bold, color.FgBlue).SprintfFunc() suite.T().Log(c("https://dddev.datadoghq.com/dashboard/qcp-brm-ysc/e2e-tests-containers-k8s?refresh_mode=paused&tpl_var_kube_cluster_name%%5B0%%5D=%s&tpl_var_fake_intake_task_family%%5B0%%5D=%s-fakeintake-ecs&from_ts=%d&to_ts=%d&live=false", - suite.KubeClusterName, - suite.KubeClusterName, - suite.startTime.UnixMilli(), - suite.endTime.UnixMilli(), + suite.clusterName, + suite.clusterName, + suite.StartTime().UnixMilli(), + suite.EndTime().UnixMilli(), )) } @@ -120,7 +109,7 @@ func (suite *k8sSuite) testUpAndRunning(waitFor time.Duration) { suite.Run("agent pods are ready and not restarting", func() { suite.EventuallyWithTf(func(c *assert.CollectT) { - linuxNodes, err := suite.K8sClient.CoreV1().Nodes().List(ctx, metav1.ListOptions{ + linuxNodes, err := suite.Env().KubernetesCluster.Client().CoreV1().Nodes().List(ctx, metav1.ListOptions{ LabelSelector: fields.OneTermEqualSelector("kubernetes.io/os", "linux").String(), }) // Can be replaced by require.NoErrorf(…) once https://github.com/stretchr/testify/pull/1481 is merged @@ -128,7 +117,7 @@ func (suite *k8sSuite) testUpAndRunning(waitFor time.Duration) { return } - windowsNodes, err := suite.K8sClient.CoreV1().Nodes().List(ctx, metav1.ListOptions{ + windowsNodes, err := suite.Env().KubernetesCluster.Client().CoreV1().Nodes().List(ctx, metav1.ListOptions{ LabelSelector: fields.OneTermEqualSelector("kubernetes.io/os", "windows").String(), }) // Can be replaced by require.NoErrorf(…) once https://github.com/stretchr/testify/pull/1481 is merged @@ -136,39 +125,39 @@ func (suite *k8sSuite) testUpAndRunning(waitFor time.Duration) { return } - linuxPods, err := suite.K8sClient.CoreV1().Pods("datadog").List(ctx, metav1.ListOptions{ - LabelSelector: fields.OneTermEqualSelector("app", suite.KubernetesAgentRef.LinuxNodeAgent.LabelSelectors["app"]).String(), + linuxPods, err := suite.Env().KubernetesCluster.Client().CoreV1().Pods("datadog").List(ctx, metav1.ListOptions{ + LabelSelector: fields.OneTermEqualSelector("app", suite.Env().Agent.LinuxNodeAgent.LabelSelectors["app"]).String(), }) // Can be replaced by require.NoErrorf(…) once https://github.com/stretchr/testify/pull/1481 is merged if !assert.NoErrorf(c, err, "Failed to list Linux datadog agent pods") { return } - windowsPods, err := suite.K8sClient.CoreV1().Pods("datadog").List(ctx, metav1.ListOptions{ - LabelSelector: fields.OneTermEqualSelector("app", suite.KubernetesAgentRef.WindowsNodeAgent.LabelSelectors["app"]).String(), + windowsPods, err := suite.Env().KubernetesCluster.Client().CoreV1().Pods("datadog").List(ctx, metav1.ListOptions{ + LabelSelector: fields.OneTermEqualSelector("app", suite.Env().Agent.WindowsNodeAgent.LabelSelectors["app"]).String(), }) // Can be replaced by require.NoErrorf(…) once https://github.com/stretchr/testify/pull/1481 is merged if !assert.NoErrorf(c, err, "Failed to list Windows datadog agent pods") { return } - clusterAgentPods, err := suite.K8sClient.CoreV1().Pods("datadog").List(ctx, metav1.ListOptions{ - LabelSelector: fields.OneTermEqualSelector("app", suite.KubernetesAgentRef.LinuxClusterAgent.LabelSelectors["app"]).String(), + clusterAgentPods, err := suite.Env().KubernetesCluster.Client().CoreV1().Pods("datadog").List(ctx, metav1.ListOptions{ + LabelSelector: fields.OneTermEqualSelector("app", suite.Env().Agent.LinuxClusterAgent.LabelSelectors["app"]).String(), }) // Can be replaced by require.NoErrorf(…) once https://github.com/stretchr/testify/pull/1481 is merged if !assert.NoErrorf(c, err, "Failed to list datadog cluster agent pods") { return } - clusterChecksPods, err := suite.K8sClient.CoreV1().Pods("datadog").List(ctx, metav1.ListOptions{ - LabelSelector: fields.OneTermEqualSelector("app", suite.KubernetesAgentRef.LinuxClusterChecks.LabelSelectors["app"]).String(), + clusterChecksPods, err := suite.Env().KubernetesCluster.Client().CoreV1().Pods("datadog").List(ctx, metav1.ListOptions{ + LabelSelector: fields.OneTermEqualSelector("app", suite.Env().Agent.LinuxClusterChecks.LabelSelectors["app"]).String(), }) // Can be replaced by require.NoErrorf(…) once https://github.com/stretchr/testify/pull/1481 is merged if !assert.NoErrorf(c, err, "Failed to list datadog cluster checks runner pods") { return } - dogstatsdPods, err := suite.K8sClient.CoreV1().Pods("dogstatsd-standalone").List(ctx, metav1.ListOptions{ + dogstatsdPods, err := suite.Env().KubernetesCluster.Client().CoreV1().Pods("dogstatsd-standalone").List(ctx, metav1.ListOptions{ LabelSelector: fields.OneTermEqualSelector("app", "dogstatsd-standalone").String(), }) // Can be replaced by require.NoErrorf(…) once https://github.com/stretchr/testify/pull/1481 is merged @@ -199,13 +188,13 @@ func (suite *k8sSuite) TestAdmissionControllerWebhooksExist() { expectedWebhookName := "datadog-webhook" suite.Run("agent registered mutating webhook configuration", func() { - mutatingConfig, err := suite.K8sClient.AdmissionregistrationV1().MutatingWebhookConfigurations().Get(ctx, expectedWebhookName, metav1.GetOptions{}) + mutatingConfig, err := suite.Env().KubernetesCluster.Client().AdmissionregistrationV1().MutatingWebhookConfigurations().Get(ctx, expectedWebhookName, metav1.GetOptions{}) suite.Require().NoError(err) suite.NotNilf(mutatingConfig, "None of the mutating webhook configurations have the name '%s'", expectedWebhookName) }) suite.Run("agent registered validating webhook configuration", func() { - validatingConfig, err := suite.K8sClient.AdmissionregistrationV1().ValidatingWebhookConfigurations().Get(ctx, expectedWebhookName, metav1.GetOptions{}) + validatingConfig, err := suite.Env().KubernetesCluster.Client().AdmissionregistrationV1().ValidatingWebhookConfigurations().Get(ctx, expectedWebhookName, metav1.GetOptions{}) suite.Require().NoError(err) suite.NotNilf(validatingConfig, "None of the validating webhook configurations have the name '%s'", expectedWebhookName) }) @@ -222,27 +211,27 @@ func (suite *k8sSuite) TestVersion() { }{ { "Linux agent", - suite.KubernetesAgentRef.LinuxNodeAgent.LabelSelectors["app"], + suite.Env().Agent.LinuxNodeAgent.LabelSelectors["app"], "agent", }, { "Windows agent", - suite.KubernetesAgentRef.WindowsNodeAgent.LabelSelectors["app"], + suite.Env().Agent.WindowsNodeAgent.LabelSelectors["app"], "agent", }, { "cluster agent", - suite.KubernetesAgentRef.LinuxClusterAgent.LabelSelectors["app"], + suite.Env().Agent.LinuxClusterAgent.LabelSelectors["app"], "cluster-agent", }, { "cluster checks", - suite.KubernetesAgentRef.LinuxClusterChecks.LabelSelectors["app"], + suite.Env().Agent.LinuxClusterChecks.LabelSelectors["app"], "agent", }, } { suite.Run(tt.podType+" pods are running the good version", func() { - linuxPods, err := suite.K8sClient.CoreV1().Pods("datadog").List(ctx, metav1.ListOptions{ + linuxPods, err := suite.Env().KubernetesCluster.Client().CoreV1().Pods("datadog").List(ctx, metav1.ListOptions{ LabelSelector: fields.OneTermEqualSelector("app", tt.appSelector).String(), Limit: 1, }) @@ -277,8 +266,8 @@ func (suite *k8sSuite) TestCLI() { func (suite *k8sSuite) testAgentCLI() { ctx := context.Background() - pod, err := suite.K8sClient.CoreV1().Pods("datadog").List(ctx, metav1.ListOptions{ - LabelSelector: fields.OneTermEqualSelector("app", suite.KubernetesAgentRef.LinuxNodeAgent.LabelSelectors["app"]).String(), + pod, err := suite.Env().KubernetesCluster.Client().CoreV1().Pods("datadog").List(ctx, metav1.ListOptions{ + LabelSelector: fields.OneTermEqualSelector("app", suite.Env().Agent.LinuxNodeAgent.LabelSelectors["app"]).String(), Limit: 1, }) suite.Require().NoError(err) @@ -384,8 +373,8 @@ func (suite *k8sSuite) testAgentCLI() { func (suite *k8sSuite) testClusterAgentCLI() { ctx := context.Background() - pod, err := suite.K8sClient.CoreV1().Pods("datadog").List(ctx, metav1.ListOptions{ - LabelSelector: fields.OneTermEqualSelector("app", suite.KubernetesAgentRef.LinuxClusterAgent.LabelSelectors["app"]).String(), + pod, err := suite.Env().KubernetesCluster.Client().CoreV1().Pods("datadog").List(ctx, metav1.ListOptions{ + LabelSelector: fields.OneTermEqualSelector("app", suite.Env().Agent.LinuxClusterAgent.LabelSelectors["app"]).String(), Limit: 1, }) suite.Require().NoError(err) @@ -469,7 +458,10 @@ func (suite *k8sSuite) TestNginx() { `^pod_name:nginx-[[:alnum:]]+-[[:alnum:]]+$`, `^pod_phase:running$`, `^short_image:apps-nginx-server$`, - `^email:team-container-platform@datadoghq.com$`, + `^domain:deployment$`, + `^mail:team-container-platform@datadoghq.com$`, + `^org:agent-org$`, + `^parent-name:nginx$`, `^team:contp$`, }, AcceptUnexpectedTags: true, @@ -544,7 +536,10 @@ func (suite *k8sSuite) TestNginx() { `^pod_name:nginx-[[:alnum:]]+-[[:alnum:]]+$`, `^pod_phase:running$`, `^short_image:apps-nginx-server$`, - `^email:team-container-platform@datadoghq.com$`, + `^domain:deployment$`, + `^mail:team-container-platform@datadoghq.com$`, + `^org:agent-org$`, + `^parent-name:nginx$`, `^team:contp$`, }, Message: `GET / HTTP/1\.1`, @@ -795,89 +790,44 @@ func (suite *k8sSuite) TestCPU() { }) } +func (suite *k8sSuite) TestKSM() { + suite.testMetric(&testMetricArgs{ + Filter: testMetricFilterArgs{ + Name: "kubernetes_state.vpa.count", + }, + Expect: testMetricExpectArgs{ + Tags: &[]string{ + `^kube_cluster_name:` + regexp.QuoteMeta(suite.clusterName) + `$`, + `^kube_namespace:workload-(?:nginx|redis)$`, + }, + Value: &testMetricExpectValueArgs{ + Max: 1, + Min: 1, + }, + }, + }) +} + func (suite *k8sSuite) TestDogstatsdInAgent() { // Test with UDS - suite.testDogstatsdContainerID(kubeNamespaceDogstatsWorkload, kubeDeploymentDogstatsdUDS) + suite.testDogstatsd(kubeNamespaceDogstatsWorkload, kubeDeploymentDogstatsdUDS) // Test with UDP + Origin detection - suite.testDogstatsdContainerID(kubeNamespaceDogstatsWorkload, kubeDeploymentDogstatsdUDPOrigin) + suite.testDogstatsd(kubeNamespaceDogstatsWorkload, kubeDeploymentDogstatsdUDPOrigin) // Test with UDP + DD_ENTITY_ID - suite.testDogstatsdPodUID(kubeNamespaceDogstatsWorkload) + suite.testDogstatsd(kubeNamespaceDogstatsWorkload, kubeDeploymentDogstatsdUDP) // Test with UDP + External Data - suite.testDogstatsdExternalData(kubeNamespaceDogstatsWorkload, kubeDeploymentDogstatsdUDPExternalData) + suite.testDogstatsd(kubeNamespaceDogstatsWorkload, kubeDeploymentDogstatsdUDPExternalData) } func (suite *k8sSuite) TestDogstatsdStandalone() { // Test with UDS - suite.testDogstatsdContainerID(kubeNamespaceDogstatsStandaloneWorkload, kubeDeploymentDogstatsdUDS) + suite.testDogstatsd(kubeNamespaceDogstatsStandaloneWorkload, kubeDeploymentDogstatsdUDS) // Dogstatsd standalone does not support origin detection // Test with UDP + DD_ENTITY_ID - suite.testDogstatsdPodUID(kubeNamespaceDogstatsWorkload) + suite.testDogstatsd(kubeNamespaceDogstatsWorkload, kubeDeploymentDogstatsdUDP) } -func (suite *k8sSuite) testDogstatsdPodUID(kubeNamespace string) { - // Test dogstatsd origin detection with UDP + DD_ENTITY_ID - suite.testMetric(&testMetricArgs{ - Filter: testMetricFilterArgs{ - Name: "custom.metric", - Tags: []string{ - "^kube_deployment:dogstatsd-udp$", - "^kube_namespace:" + regexp.QuoteMeta(kubeNamespace) + "$", - }, - }, - Expect: testMetricExpectArgs{ - Tags: &[]string{ - `^kube_deployment:dogstatsd-udp$`, - "^kube_namespace:" + regexp.QuoteMeta(kubeNamespace) + "$", - `^kube_ownerref_kind:replicaset$`, - `^kube_ownerref_name:dogstatsd-udp-[[:alnum:]]+$`, - `^kube_qos:Burstable$`, - `^kube_replica_set:dogstatsd-udp-[[:alnum:]]+$`, - `^pod_name:dogstatsd-udp-[[:alnum:]]+-[[:alnum:]]+$`, - `^pod_phase:running$`, - `^series:`, - }, - }, - }) -} - -// testDogstatsdExternalData tests that the External Data origin resolution works for the dogstatsd. -func (suite *k8sSuite) testDogstatsdExternalData(kubeNamespace, kubeDeployment string) { - ctx := context.Background() - - // Record old pod, so we can be sure we are not looking at the incorrect one after deletion - oldPods, err := suite.K8sClient.CoreV1().Pods(kubeNamespace).List(ctx, metav1.ListOptions{ - LabelSelector: fields.OneTermEqualSelector("app", kubeDeployment).String(), - }) - suite.Require().NoError(err) - suite.Require().Len(oldPods.Items, 1) - oldPod := oldPods.Items[0] - - // Delete the pod to ensure it is recreated after the admission controller is deployed - err = suite.K8sClient.CoreV1().Pods(kubeNamespace).DeleteCollection(ctx, metav1.DeleteOptions{}, metav1.ListOptions{ - LabelSelector: fields.OneTermEqualSelector("app", kubeDeployment).String(), - }) - suite.Require().NoError(err) - - // Wait for the fresh pod to be created - var pod corev1.Pod - suite.Require().EventuallyWithTf(func(c *assert.CollectT) { - pods, err := suite.K8sClient.CoreV1().Pods(kubeNamespace).List(ctx, metav1.ListOptions{ - LabelSelector: fields.OneTermEqualSelector("app", kubeDeployment).String(), - }) - if !assert.NoError(c, err) { - return - } - if !assert.Len(c, pods.Items, 1) { - return - } - pod = pods.Items[0] - if !assert.NotEqual(c, oldPod.Name, pod.Name) { - return - } - }, 2*time.Minute, 10*time.Second, "Failed to witness the creation of pod with name %s in namespace %s", kubeDeployment, kubeNamespace) - - suite.Require().Len(pod.Spec.Containers, 1) - +func (suite *k8sSuite) testDogstatsd(kubeNamespace, kubeDeployment string) { suite.testMetric(&testMetricArgs{ Filter: testMetricFilterArgs{ Name: "custom.metric", @@ -912,41 +862,6 @@ func (suite *k8sSuite) testDogstatsdExternalData(kubeNamespace, kubeDeployment s }) } -func (suite *k8sSuite) testDogstatsdContainerID(kubeNamespace, kubeDeployment string) { - suite.testMetric(&testMetricArgs{ - Filter: testMetricFilterArgs{ - Name: "custom.metric", - Tags: []string{ - "^kube_deployment:" + regexp.QuoteMeta(kubeDeployment) + "$", - "^kube_namespace:" + regexp.QuoteMeta(kubeNamespace) + "$", - }, - }, - Expect: testMetricExpectArgs{ - Tags: &[]string{ - `^container_id:`, - `^container_name:dogstatsd$`, - `^display_container_name:dogstatsd`, - `^git.commit.sha:`, // org.opencontainers.image.revision docker image label - `^git.repository_url:https://github.com/DataDog/test-infra-definitions$`, // org.opencontainers.image.source docker image label - `^image_id:ghcr.io/datadog/apps-dogstatsd@sha256:`, - `^image_name:ghcr.io/datadog/apps-dogstatsd$`, - `^image_tag:main$`, - `^kube_container_name:dogstatsd$`, - `^kube_deployment:` + regexp.QuoteMeta(kubeDeployment) + `$`, - "^kube_namespace:" + regexp.QuoteMeta(kubeNamespace) + "$", - `^kube_ownerref_kind:replicaset$`, - `^kube_ownerref_name:` + regexp.QuoteMeta(kubeDeployment) + `-[[:alnum:]]+$`, - `^kube_qos:Burstable$`, - `^kube_replica_set:` + regexp.QuoteMeta(kubeDeployment) + `-[[:alnum:]]+$`, - `^pod_name:` + regexp.QuoteMeta(kubeDeployment) + `-[[:alnum:]]+-[[:alnum:]]+$`, - `^pod_phase:running$`, - `^series:`, - `^short_image:apps-dogstatsd$`, - }, - }, - }) -} - func (suite *k8sSuite) TestPrometheus() { // Test Prometheus check suite.testMetric(&testMetricArgs{ @@ -993,8 +908,6 @@ func (suite *k8sSuite) TestAdmissionControllerWithLibraryAnnotation() { } func (suite *k8sSuite) TestAdmissionControllerWithAutoDetectedLanguage() { - // CONTINT-4009 - flake.Mark(suite.T()) suite.testAdmissionControllerPod("workload-mutated-lib-injection", "mutated-with-auto-detected-language", "python", true) } @@ -1007,7 +920,7 @@ func (suite *k8sSuite) testAdmissionControllerPod(namespace string, name string, // libraries for the detected language are injected if languageShouldBeAutoDetected { suite.Require().EventuallyWithTf(func(c *assert.CollectT) { - deployment, err := suite.K8sClient.AppsV1().Deployments(namespace).Get(ctx, name, metav1.GetOptions{}) + deployment, err := suite.Env().KubernetesCluster.Client().AppsV1().Deployments(namespace).Get(ctx, name, metav1.GetOptions{}) if !assert.NoError(c, err) { return } @@ -1024,37 +937,12 @@ func (suite *k8sSuite) testAdmissionControllerPod(namespace string, name string, }, 5*time.Minute, 10*time.Second, "The deployment with name %s in namespace %s does not exist or does not have the auto detected languages annotation", name, namespace) } - // Record old pod, so we can be sure we are not looking at the incorrect one after deletion - oldPods, err := suite.K8sClient.CoreV1().Pods(namespace).List(ctx, metav1.ListOptions{ + pods, err := suite.Env().KubernetesCluster.Client().CoreV1().Pods(namespace).List(ctx, metav1.ListOptions{ LabelSelector: fields.OneTermEqualSelector("app", name).String(), }) suite.Require().NoError(err) - suite.Require().Len(oldPods.Items, 1) - oldPod := oldPods.Items[0] - - // Delete the pod to ensure it is recreated after the admission controller is deployed - err = suite.K8sClient.CoreV1().Pods(namespace).DeleteCollection(ctx, metav1.DeleteOptions{}, metav1.ListOptions{ - LabelSelector: fields.OneTermEqualSelector("app", name).String(), - }) - suite.Require().NoError(err) - - // Wait for the fresh pod to be created - var pod corev1.Pod - suite.Require().EventuallyWithTf(func(c *assert.CollectT) { - pods, err := suite.K8sClient.CoreV1().Pods(namespace).List(ctx, metav1.ListOptions{ - LabelSelector: fields.OneTermEqualSelector("app", name).String(), - }) - if !assert.NoError(c, err) { - return - } - if !assert.Len(c, pods.Items, 1) { - return - } - pod = pods.Items[0] - if !assert.NotEqual(c, oldPod.Name, pod.Name) { - return - } - }, 2*time.Minute, 10*time.Second, "Failed to witness the creation of pod with name %s in namespace %s", name, namespace) + suite.Require().Len(pods.Items, 1) + pod := pods.Items[0] suite.Require().Len(pod.Spec.Containers, 1) @@ -1137,7 +1025,7 @@ func (suite *k8sSuite) testAdmissionControllerPod(namespace string, name string, func (suite *k8sSuite) TestContainerImage() { sendEvent := func(alertType, text string) { - if _, err := suite.datadogClient.PostEvent(&datadog.Event{ + if _, err := suite.DatadogClient().PostEvent(&datadog.Event{ Title: pointer.Ptr(suite.T().Name()), Text: pointer.Ptr(fmt.Sprintf(`%%%%%% `+"```"+` @@ -1207,7 +1095,7 @@ func (suite *k8sSuite) TestContainerImage() { func (suite *k8sSuite) TestSBOM() { sendEvent := func(alertType, text string) { - if _, err := suite.datadogClient.PostEvent(&datadog.Event{ + if _, err := suite.DatadogClient().PostEvent(&datadog.Event{ Title: pointer.Ptr(suite.T().Name()), Text: pointer.Ptr(fmt.Sprintf(`%%%%%% `+"```"+` @@ -1332,7 +1220,7 @@ func (suite *k8sSuite) TestSBOM() { func (suite *k8sSuite) TestContainerLifecycleEvents() { sendEvent := func(alertType, text string) { - if _, err := suite.datadogClient.PostEvent(&datadog.Event{ + if _, err := suite.DatadogClient().PostEvent(&datadog.Event{ Title: pointer.Ptr(suite.T().Name()), Text: pointer.Ptr(fmt.Sprintf(`%%%%%% `+"```"+` @@ -1362,7 +1250,7 @@ func (suite *k8sSuite) TestContainerLifecycleEvents() { var nginxPod corev1.Pod suite.Require().EventuallyWithTf(func(c *assert.CollectT) { - pods, err := suite.K8sClient.CoreV1().Pods("workload-nginx").List(context.Background(), metav1.ListOptions{ + pods, err := suite.Env().KubernetesCluster.Client().CoreV1().Pods("workload-nginx").List(context.Background(), metav1.ListOptions{ LabelSelector: fields.OneTermEqualSelector("app", "nginx").String(), FieldSelector: fields.OneTermEqualSelector("status.phase", "Running").String(), }) @@ -1382,7 +1270,7 @@ func (suite *k8sSuite) TestContainerLifecycleEvents() { }) }, 1*time.Minute, 10*time.Second, "Failed to find an nginx pod") - err := suite.K8sClient.CoreV1().Pods("workload-nginx").Delete(context.Background(), nginxPod.Name, metav1.DeleteOptions{}) + err := suite.Env().KubernetesCluster.Client().CoreV1().Pods("workload-nginx").Delete(context.Background(), nginxPod.Name, metav1.DeleteOptions{}) suite.Require().NoError(err) suite.EventuallyWithTf(func(collect *assert.CollectT) { @@ -1425,7 +1313,7 @@ func (suite *k8sSuite) TestContainerLifecycleEvents() { func (suite *k8sSuite) testHPA(namespace, deployment string) { suite.Run(fmt.Sprintf("hpa kubernetes_state.deployment.replicas_available{kube_namespace:%s,kube_deployment:%s}", namespace, deployment), func() { sendEvent := func(alertType, text string, time *int) { - if _, err := suite.datadogClient.PostEvent(&datadog.Event{ + if _, err := suite.DatadogClient().PostEvent(&datadog.Event{ Title: pointer.Ptr(fmt.Sprintf("testHPA %s/%s", namespace, deployment)), Text: pointer.Ptr(fmt.Sprintf(`%%%%%% %s @@ -1513,7 +1401,7 @@ func (suite *k8sSuite) testHPA(namespace, deployment string) { type podExecOption func(*corev1.PodExecOptions) func (suite *k8sSuite) podExec(namespace, pod, container string, cmd []string, podOptions ...podExecOption) (stdout, stderr string, err error) { - req := suite.K8sClient.CoreV1().RESTClient().Post().Resource("pods").Namespace(namespace).Name(pod).SubResource("exec") + req := suite.Env().KubernetesCluster.Client().CoreV1().RESTClient().Post().Resource("pods").Namespace(namespace).Name(pod).SubResource("exec") option := &corev1.PodExecOptions{ Stdin: false, Stdout: true, @@ -1532,7 +1420,7 @@ func (suite *k8sSuite) podExec(namespace, pod, container string, cmd []string, p scheme.ParameterCodec, ) - exec, err := remotecommand.NewSPDYExecutor(suite.K8sConfig, "POST", req.URL()) + exec, err := remotecommand.NewSPDYExecutor(suite.Env().KubernetesCluster.KubernetesClient.K8sConfig, "POST", req.URL()) if err != nil { return "", "", err } diff --git a/test/new-e2e/tests/containers/kindvm_test.go b/test/new-e2e/tests/containers/kindvm_test.go index 08e327fced435..bad94d3094d30 100644 --- a/test/new-e2e/tests/containers/kindvm_test.go +++ b/test/new-e2e/tests/containers/kindvm_test.go @@ -6,21 +6,14 @@ package containers import ( - "context" - "encoding/json" "testing" - "github.com/DataDog/datadog-agent/pkg/util/testutil/flake" + "github.com/DataDog/test-infra-definitions/components/datadog/kubernetesagentparams" + "github.com/DataDog/test-infra-definitions/scenarios/aws/ec2" + "github.com/DataDog/test-infra-definitions/scenarios/aws/fakeintake" - "github.com/DataDog/test-infra-definitions/scenarios/aws/kindvm" - - "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" - - "github.com/pulumi/pulumi/sdk/v3/go/auto" - "github.com/stretchr/testify/suite" - "k8s.io/client-go/tools/clientcmd" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" + awskubernetes "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/kubernetes" ) type kindSuite struct { @@ -28,70 +21,20 @@ type kindSuite struct { } func TestKindSuite(t *testing.T) { - flake.Mark(t) - suite.Run(t, &kindSuite{}) + e2e.Run(t, &kindSuite{}, e2e.WithProvisioner(awskubernetes.KindProvisioner( + awskubernetes.WithEC2VMOptions( + ec2.WithInstanceType("t3.xlarge"), + ), + awskubernetes.WithFakeIntakeOptions(fakeintake.WithMemory(2048)), + awskubernetes.WithDeployDogstatsd(), + awskubernetes.WithDeployTestWorkload(), + awskubernetes.WithAgentOptions(kubernetesagentparams.WithDualShipping()), + ))) } func (suite *kindSuite) SetupSuite() { - ctx := context.Background() - - stackConfig := runner.ConfigMap{ - "ddinfra:aws/defaultInstanceType": auto.ConfigValue{Value: "t3.xlarge"}, - "ddagent:deploy": auto.ConfigValue{Value: "true"}, - "ddagent:fakeintake": auto.ConfigValue{Value: "true"}, - "ddtestworkload:deploy": auto.ConfigValue{Value: "true"}, - "dddogstatsd:deploy": auto.ConfigValue{Value: "true"}, - } - - _, stackOutput, err := infra.GetStackManager().GetStackNoDeleteOnFailure( - ctx, - "kind-cluster", - kindvm.Run, - infra.WithConfigMap(stackConfig), - ) - if !suite.Assert().NoError(err) { - stackName, err := infra.GetStackManager().GetPulumiStackName("kind-cluster") - suite.Require().NoError(err) - suite.T().Log(dumpKindClusterState(ctx, stackName)) - if !runner.GetProfile().AllowDevMode() || !*keepStacks { - infra.GetStackManager().DeleteStack(ctx, "kind-cluster", nil) - } - suite.T().FailNow() - } - - var fakeintake components.FakeIntake - fiSerialized, err := json.Marshal(stackOutput.Outputs["dd-Fakeintake-aws-kind"].Value) - suite.Require().NoError(err) - suite.Require().NoError(fakeintake.Import(fiSerialized, &fakeintake)) - suite.Require().NoError(fakeintake.Init(suite)) - suite.Fakeintake = fakeintake.Client() - - var kubeCluster components.KubernetesCluster - kubeSerialized, err := json.Marshal(stackOutput.Outputs["dd-Cluster-kind"].Value) - suite.Require().NoError(err) - suite.Require().NoError(kubeCluster.Import(kubeSerialized, &kubeCluster)) - suite.Require().NoError(kubeCluster.Init(suite)) - suite.KubeClusterName = kubeCluster.ClusterName - suite.K8sClient = kubeCluster.Client() - suite.K8sConfig, err = clientcmd.RESTConfigFromKubeConfig([]byte(kubeCluster.KubeConfig)) - suite.Require().NoError(err) - - kubernetesAgent := &components.KubernetesAgent{} - kubernetesAgentSerialized, err := json.Marshal(stackOutput.Outputs["dd-KubernetesAgent-aws-datadog-agent"].Value) - suite.Require().NoError(err) - suite.Require().NoError(kubernetesAgent.Import(kubernetesAgentSerialized, &kubernetesAgent)) - suite.KubernetesAgentRef = kubernetesAgent - suite.k8sSuite.SetupSuite() -} - -func (suite *kindSuite) TearDownSuite() { - suite.k8sSuite.TearDownSuite() - - ctx := context.Background() - stackName, err := infra.GetStackManager().GetPulumiStackName("kind-cluster") - suite.Require().NoError(err) - suite.T().Log(dumpKindClusterState(ctx, stackName)) + suite.Fakeintake = suite.Env().FakeIntake.Client() } func (suite *kindSuite) TestControlPlane() { diff --git a/test/new-e2e/tests/cspm/cspm_test.go b/test/new-e2e/tests/cspm/cspm_test.go index 2c7a03f8b67b1..929027e7595cd 100644 --- a/test/new-e2e/tests/cspm/cspm_test.go +++ b/test/new-e2e/tests/cspm/cspm_test.go @@ -24,7 +24,7 @@ import ( "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awskubernetes "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/kubernetes" + awskubernetes "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/kubernetes" ) type cspmTestSuite struct { @@ -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/cws/ec2_test.go b/test/new-e2e/tests/cws/ec2_test.go index 9266609f74ce0..c9fa1febb4efc 100644 --- a/test/new-e2e/tests/cws/ec2_test.go +++ b/test/new-e2e/tests/cws/ec2_test.go @@ -23,7 +23,7 @@ import ( "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/runner" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/runner/parameters" "github.com/DataDog/datadog-agent/test/new-e2e/tests/cws/api" diff --git a/test/new-e2e/tests/cws/kind_test.go b/test/new-e2e/tests/cws/kind_test.go index 9dcfd5ef7da3b..31c93018509f7 100644 --- a/test/new-e2e/tests/cws/kind_test.go +++ b/test/new-e2e/tests/cws/kind_test.go @@ -18,7 +18,7 @@ import ( "github.com/DataDog/test-infra-definitions/components/datadog/kubernetesagentparams" "github.com/DataDog/test-infra-definitions/scenarios/aws/ec2" - awskubernetes "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/kubernetes" + awskubernetes "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/kubernetes" "github.com/DataDog/datadog-agent/test/new-e2e/tests/agent-platform/platforms" "github.com/DataDog/datadog-agent/test/new-e2e/tests/cws/api" diff --git a/test/new-e2e/tests/cws/windows_test.go b/test/new-e2e/tests/cws/windows_test.go index 4533befdf1653..ce840e6fe05dc 100644 --- a/test/new-e2e/tests/cws/windows_test.go +++ b/test/new-e2e/tests/cws/windows_test.go @@ -19,10 +19,11 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + testos "github.com/DataDog/test-infra-definitions/components/os" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" - testos "github.com/DataDog/test-infra-definitions/components/os" + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/runner" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/runner/parameters" diff --git a/test/new-e2e/tests/discovery/linux_test.go b/test/new-e2e/tests/discovery/linux_test.go index ec7d0aa339be3..a833bb7457346 100644 --- a/test/new-e2e/tests/discovery/linux_test.go +++ b/test/new-e2e/tests/discovery/linux_test.go @@ -20,7 +20,7 @@ import ( "github.com/DataDog/datadog-agent/test/new-e2e/pkg/components" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" ) //go:embed testdata/config/agent_config.yaml @@ -170,7 +170,19 @@ func assertRunningCheck(t *assert.CollectT, remoteHost *components.RemoteHost, c func (s *linuxTestSuite) provisionServer() { err := s.Env().RemoteHost.CopyFolder("testdata/provision", "/home/ubuntu/e2e-test") require.NoError(s.T(), err) - s.Env().RemoteHost.MustExecute("sudo bash /home/ubuntu/e2e-test/provision.sh") + + cmd := "sudo bash /home/ubuntu/e2e-test/provision.sh" + _, err = s.Env().RemoteHost.Execute(cmd) + if err != nil { + // Sometimes temporary network errors are seen which cause the provision + // script to fail. + s.T().Log("Retrying provision due to failure", err) + time.Sleep(30 * time.Second) + _, err := s.Env().RemoteHost.Execute(cmd) + if err != nil { + s.T().Skip("Unable to provision server") + } + } } func (s *linuxTestSuite) startServices() { diff --git a/test/new-e2e/tests/gpu/gpu_test.go b/test/new-e2e/tests/gpu/gpu_test.go index 74b1229437a46..6ba889a89550b 100644 --- a/test/new-e2e/tests/gpu/gpu_test.go +++ b/test/new-e2e/tests/gpu/gpu_test.go @@ -3,6 +3,7 @@ // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2024-present Datadog, Inc. +// Package gpu contains e2e tests for the GPU monitoring module package gpu import ( @@ -14,18 +15,13 @@ import ( "testing" "time" - "github.com/DataDog/test-infra-definitions/scenarios/aws/ec2" "github.com/stretchr/testify/assert" "github.com/DataDog/datadog-agent/pkg/util/testutil/flake" "github.com/DataDog/datadog-agent/test/fakeintake/client" - "github.com/DataDog/test-infra-definitions/components/datadog/agentparams" - "github.com/DataDog/test-infra-definitions/components/os" - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/e2e/client/agentclient" ) @@ -34,63 +30,37 @@ var imageTag = flag.String("image-tag", "main", "Docker image tag to use") type gpuSuite struct { e2e.BaseSuite[environments.Host] - imageTag string containerNameCounter int } -const defaultGpuCheckConfig = ` -init_config: - min_collection_interval: 5 - -instances: - - {} -` - -const defaultSysprobeConfig = ` -gpu_monitoring: - enabled: true -` - const vectorAddDockerImg = "ghcr.io/datadog/apps-cuda-basic" -const gpuEnabledAMI = "ami-0f71e237bb2ba34be" // Ubuntu 22.04 with GPU drivers + +func dockerImageName() string { + return fmt.Sprintf("%s:%s", vectorAddDockerImg, *imageTag) +} // TestGPUSuite runs tests for the VM interface to ensure its implementation is correct. // Not to be run in parallel, as some tests wait until the checks are available. func TestGPUSuite(t *testing.T) { - provisioner := awshost.Provisioner( - awshost.WithEC2InstanceOptions( - ec2.WithInstanceType("g4dn.xlarge"), - ec2.WithAMI(gpuEnabledAMI, os.Ubuntu2204, os.AMD64Arch), - ), - awshost.WithAgentOptions( - agentparams.WithIntegration("gpu.d", defaultGpuCheckConfig), - agentparams.WithSystemProbeConfig(defaultSysprobeConfig), - ), - awshost.WithDocker(), - ) + // incident-33572 + flake.Mark(t) + provParams := getDefaultProvisionerParams() + + // Append our vectorAdd image for testing + provParams.dockerImages = append(provParams.dockerImages, dockerImageName()) + + provisioner := gpuInstanceProvisioner(provParams) suiteParams := []e2e.SuiteOption{e2e.WithProvisioner(provisioner)} if *devMode { suiteParams = append(suiteParams, e2e.WithDevMode()) } - suite := &gpuSuite{ - imageTag: *imageTag, - } + suite := &gpuSuite{} e2e.Run(t, suite, suiteParams...) } -func (v *gpuSuite) SetupSuite() { - v.BaseSuite.SetupSuite() - - v.Env().RemoteHost.MustExecute(fmt.Sprintf("docker pull %s", v.dockerImageName())) -} - -func (v *gpuSuite) dockerImageName() string { - return fmt.Sprintf("%s:%s", vectorAddDockerImg, v.imageTag) -} - // TODO: Extract this to common package? service_discovery uses it too type checkStatus struct { CheckID string `json:"CheckID"` @@ -118,7 +88,7 @@ func (v *gpuSuite) runCudaDockerWorkload() string { containerName := fmt.Sprintf("cuda-basic-%d", v.containerNameCounter) v.containerNameCounter++ - cmd := fmt.Sprintf("docker run --gpus all --name %s %s %s %d %d %d", containerName, v.dockerImageName(), binary, vectorSize, numLoops, waitTimeSeconds) + cmd := fmt.Sprintf("docker run --gpus all --name %s %s %s %d %d %d", containerName, dockerImageName(), binary, vectorSize, numLoops, waitTimeSeconds) out, err := v.Env().RemoteHost.Execute(cmd) v.Require().NoError(err) v.Require().NotEmpty(out) diff --git a/test/new-e2e/tests/gpu/provisioner.go b/test/new-e2e/tests/gpu/provisioner.go new file mode 100644 index 0000000000000..678b069eec31e --- /dev/null +++ b/test/new-e2e/tests/gpu/provisioner.go @@ -0,0 +1,251 @@ +// 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. + +package gpu + +import ( + "fmt" + "strconv" + + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + + "github.com/pulumi/pulumi-command/sdk/go/command/remote" + + "github.com/DataDog/test-infra-definitions/common/utils" + "github.com/DataDog/test-infra-definitions/components/command" + "github.com/DataDog/test-infra-definitions/components/datadog/agent" + "github.com/DataDog/test-infra-definitions/components/datadog/agentparams" + "github.com/DataDog/test-infra-definitions/components/docker" + "github.com/DataDog/test-infra-definitions/components/os" + componentsremote "github.com/DataDog/test-infra-definitions/components/remote" + "github.com/DataDog/test-infra-definitions/resources/aws" + "github.com/DataDog/test-infra-definitions/scenarios/aws/ec2" + "github.com/DataDog/test-infra-definitions/scenarios/aws/fakeintake" + + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners" +) + +// gpuEnabledAMI is an AMI that has GPU drivers pre-installed. In this case it's +// an Ubuntu 22.04 with NVIDIA drivers +const gpuEnabledAMI = "ami-03ee78da2beb5b622" + +// gpuInstanceType is the instance type to use. By default we use g4dn.xlarge, +// which is the cheapest GPU instance type +const gpuInstanceType = "g4dn.xlarge" + +// nvidiaPCIVendorID is the PCI vendor ID for NVIDIA GPUs, used to identify the +// GPU devices with lspci +const nvidiaPCIVendorID = "10de" + +// cudaSanityCheckImage is a Docker image that contains a CUDA sample to +// validate the GPU setup with the default CUDA installation. Note that the CUDA +// version in this image must be equal or less than the one installed in the +// AMI. +const cudaSanityCheckImage = "669783387624.dkr.ecr.us-east-1.amazonaws.com/dockerhub/nvidia/cuda:12.6.3-base-ubuntu22.04" + +// nvidiaSMIValidationCmd is a command that checks if the nvidia-smi command is +// available and can list the GPUs +const nvidiaSMIValidationCmd = "nvidia-smi -L | grep GPU" + +// validationCommandMarker is a command that can be appended to all validation commands +// to identify them in the output, which can be useful to later force retries. Retries +// are controlled in test/new-e2e/pkg/utils/infra/retriable_errors.go, and the way to +// identify them are based on the pulumi logs. This command will be echoed to the output +// and can be used to identify the validation commands. +const validationCommandMarker = "echo 'gpu-validation-command'" + +const defaultGpuCheckConfig = ` +init_config: + min_collection_interval: 5 + +instances: + - {} +` + +const defaultSysprobeConfig = ` +gpu_monitoring: + enabled: true +` + +type provisionerParams struct { + agentOptions []agentparams.Option + ami string + amiOS os.Descriptor + instanceType string + dockerImages []string +} + +func getDefaultProvisionerParams() *provisionerParams { + return &provisionerParams{ + agentOptions: []agentparams.Option{ + agentparams.WithIntegration("gpu.d", defaultGpuCheckConfig), + agentparams.WithSystemProbeConfig(defaultSysprobeConfig), + }, + ami: gpuEnabledAMI, + amiOS: os.Ubuntu2204, + instanceType: gpuInstanceType, + dockerImages: []string{cudaSanityCheckImage}, + } +} + +func gpuInstanceProvisioner(params *provisionerParams) provisioners.Provisioner { + return provisioners.NewTypedPulumiProvisioner[environments.Host]("gpu", func(ctx *pulumi.Context, env *environments.Host) error { + name := "gpuvm" + awsEnv, err := aws.NewEnvironment(ctx) + if err != nil { + return err + } + + // Create the EC2 instance + host, err := ec2.NewVM(awsEnv, name, + ec2.WithInstanceType(params.instanceType), + ec2.WithAMI(params.ami, params.amiOS, os.AMD64Arch), + ) + if err != nil { + return err + } + err = host.Export(ctx, &env.RemoteHost.HostOutput) + if err != nil { + return err + } + + // Create the fakeintake instance + fakeIntake, err := fakeintake.NewECSFargateInstance(awsEnv, name) + if err != nil { + return err + } + err = fakeIntake.Export(ctx, &env.FakeIntake.FakeintakeOutput) + if err != nil { + return err + } + + // install the ECR credentials helper + // required to get pipeline agent images or other internally hosted images + installEcrCredsHelperCmd, err := ec2.InstallECRCredentialsHelper(awsEnv, host) + if err != nil { + return err + } + + // Validate GPU devices + validateGPUDevicesCmd, err := validateGPUDevices(awsEnv, host) + if err != nil { + return err + } + + // Install Docker (only after GPU devices are validated and the ECR credentials helper is installed) + dockerManager, err := docker.NewManager(&awsEnv, host, utils.PulumiDependsOn(installEcrCredsHelperCmd)) + if err != nil { + return err + } + + // Pull all the docker images required for the tests + dockerPullCmds, err := downloadDockerImages(awsEnv, host, params.dockerImages, dockerManager) + if err != nil { + return err + } + + // Validate that Docker can run CUDA samples + dockerCudaDeps := append(dockerPullCmds, validateGPUDevicesCmd...) + dockerCudaValidateCmd, err := validateDockerCuda(awsEnv, host, dockerCudaDeps...) + if err != nil { + return fmt.Errorf("validateDockerCuda failed: %w", err) + } + // incident-33572: log the output of the CUDA validation command + pulumi.All(dockerCudaValidateCmd.Stdout, dockerCudaValidateCmd.Stderr).ApplyT(func(outputs []string) error { + stdout := outputs[0] + stderr := outputs[1] + err := ctx.Log.Info(fmt.Sprintf("Docker CUDA validation stdout: %s", stdout), nil) + if err != nil { + return err + } + err = ctx.Log.Info(fmt.Sprintf("Docker CUDA validation stderr: %s", stderr), nil) + if err != nil { + return err + } + return nil + }) + + // Combine agent options from the parameters with the fakeintake and docker dependencies + params.agentOptions = append(params.agentOptions, + agentparams.WithFakeintake(fakeIntake), + agentparams.WithPulumiResourceOptions(utils.PulumiDependsOn(dockerManager, dockerCudaValidateCmd)), // Depend on Docker to avoid apt lock issues + ) + + // Set updater to nil as we're not using it + env.Updater = nil + + // Install the agent + agent, err := agent.NewHostAgent(&awsEnv, host, params.agentOptions...) + if err != nil { + return fmt.Errorf("NewHostAgent failed: %w", err) + } + + err = agent.Export(ctx, &env.Agent.HostAgentOutput) + if err != nil { + return fmt.Errorf("agent export failed: %w", err) + } + + return nil + }, nil) +} + +// validateGPUDevices checks that there are GPU devices present and accesible +func validateGPUDevices(e aws.Environment, vm *componentsremote.Host) ([]pulumi.Resource, error) { + commands := map[string]string{ + "pci": fmt.Sprintf("lspci -d %s:: | grep NVIDIA", nvidiaPCIVendorID), + "driver": "lsmod | grep nvidia", + "nvidia": "nvidia-smi -L | grep GPU", + } + + var cmds []pulumi.Resource + + for name, cmd := range commands { + c, err := vm.OS.Runner().Command( + e.CommonNamer().ResourceName("gpu-validate", name), + &command.Args{ + Create: pulumi.Sprintf("%s && %s", validationCommandMarker, cmd), + Sudo: false, + }, + ) + if err != nil { + return nil, err + } + cmds = append(cmds, c) + } + + return cmds, nil +} + +func downloadDockerImages(e aws.Environment, vm *componentsremote.Host, images []string, dependsOn ...pulumi.Resource) ([]pulumi.Resource, error) { + var cmds []pulumi.Resource + + for i, image := range images { + cmd, err := vm.OS.Runner().Command( + e.CommonNamer().ResourceName("docker-pull", strconv.Itoa(i)), + &command.Args{ + Create: pulumi.Sprintf("docker pull %s", image), + }, + utils.PulumiDependsOn(dependsOn...), + ) + if err != nil { + return nil, err + } + + cmds = append(cmds, cmd) + } + + return cmds, nil +} + +func validateDockerCuda(e aws.Environment, vm *componentsremote.Host, dependsOn ...pulumi.Resource) (*remote.Command, error) { + return vm.OS.Runner().Command( + e.CommonNamer().ResourceName("docker-cuda-validate"), + &command.Args{ + Create: pulumi.Sprintf("%s && docker run --gpus all --rm %s bash -c \"%s\"", validationCommandMarker, cudaSanityCheckImage, nvidiaSMIValidationCmd), + }, + utils.PulumiDependsOn(dependsOn...), + ) +} diff --git a/test/new-e2e/tests/ha-agent/haagent_test.go b/test/new-e2e/tests/ha-agent/haagent_test.go index 2dc700bec2be8..12019455df4ab 100644 --- a/test/new-e2e/tests/ha-agent/haagent_test.go +++ b/test/new-e2e/tests/ha-agent/haagent_test.go @@ -20,7 +20,7 @@ import ( fakeintakeclient "github.com/DataDog/datadog-agent/test/fakeintake/client" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" ) type haAgentTestSuite struct { @@ -44,21 +44,6 @@ log_level: debug func (s *haAgentTestSuite) TestHaAgentRunningMetrics() { fakeClient := s.Env().FakeIntake.Client() - s.EventuallyWithT(func(c *assert.CollectT) { - s.T().Log("try assert datadog.agent.running metric") - metrics, err := fakeClient.FilterMetrics("datadog.agent.running") - require.NoError(c, err) - assert.NotEmpty(c, metrics) - for _, metric := range metrics { - s.T().Logf(" datadog.agent.running metric tags: %+v", metric.Tags) - } - - tags := []string{"agent_group:test-group01"} - metrics, err = fakeClient.FilterMetrics("datadog.agent.running", fakeintakeclient.WithTags[*aggregator.MetricSeries](tags)) - require.NoError(c, err) - assert.NotEmpty(c, metrics) - }, 5*time.Minute, 3*time.Second) - s.EventuallyWithT(func(c *assert.CollectT) { s.T().Log("try assert datadog.agent.ha_agent.running metric") metrics, err := fakeClient.FilterMetrics("datadog.agent.ha_agent.running") @@ -68,7 +53,7 @@ func (s *haAgentTestSuite) TestHaAgentRunningMetrics() { s.T().Logf(" datadog.agent.ha_agent.running metric tags: %+v", metric.Tags) } - tags := []string{"agent_group:test-group01", "agent_state:unknown"} + tags := []string{"agent_state:unknown"} metrics, err = fakeClient.FilterMetrics("datadog.agent.ha_agent.running", fakeintakeclient.WithTags[*aggregator.MetricSeries](tags)) require.NoError(c, err) assert.NotEmpty(c, metrics) diff --git a/test/new-e2e/tests/installer/host/host.go b/test/new-e2e/tests/installer/host/host.go index 79b43ef730fec..222271fe7691a 100644 --- a/test/new-e2e/tests/installer/host/host.go +++ b/test/new-e2e/tests/installer/host/host.go @@ -79,7 +79,14 @@ func (h *Host) setSystemdVersion() { // InstallDocker installs Docker on the host if it is not already installed. func (h *Host) InstallDocker() { - defer func() { h.remote.MustExecute("sudo systemctl start docker") }() + defer func() { + _, err := h.remote.Execute("sudo systemctl reset-failed docker") + if err != nil { + h.t.Logf("warn: failed to reset-failed for docker.d: %v", err) + } + _, err = h.remote.Execute("sudo systemctl start docker") + require.NoErrorf(h.t, err, "failed to start Docker, logs: %s", h.remote.MustExecute("sudo journalctl -xeu docker")) + }() if _, err := h.remote.Execute("command -v docker"); err == nil { return } diff --git a/test/new-e2e/tests/installer/script/all_scripts_test.go b/test/new-e2e/tests/installer/script/all_scripts_test.go new file mode 100644 index 0000000000000..e50d01b0e18d7 --- /dev/null +++ b/test/new-e2e/tests/installer/script/all_scripts_test.go @@ -0,0 +1,161 @@ +// 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 installscript + +import ( + "fmt" + "os" + "regexp" + "strings" + "testing" + + e2eos "github.com/DataDog/test-infra-definitions/components/os" + "github.com/DataDog/test-infra-definitions/scenarios/aws/ec2" + "github.com/stretchr/testify/require" + + "github.com/DataDog/datadog-agent/pkg/util/testutil/flake" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" + "github.com/DataDog/datadog-agent/test/new-e2e/tests/installer/host" +) + +type installerScriptTests func(os e2eos.Descriptor, arch e2eos.Architecture) installerScriptSuite + +type installerScriptTestsWithSkipedFlavors struct { + t installerScriptTests + skippedFlavors []e2eos.Descriptor +} + +var ( + amd64Flavors = []e2eos.Descriptor{ + e2eos.Ubuntu2204, + e2eos.AmazonLinux2, + e2eos.Debian12, + e2eos.RedHat9, + e2eos.FedoraDefault, + e2eos.CentOS7, + e2eos.Suse15, + } + arm64Flavors = []e2eos.Descriptor{ + e2eos.Ubuntu2204, + e2eos.AmazonLinux2, + e2eos.Suse15, + } + scriptTestsWithSkippedFlavors = []installerScriptTestsWithSkipedFlavors{ + {t: testDatabricksScript}, + } +) + +func shouldSkipFlavor(flavors []e2eos.Descriptor, flavor e2eos.Descriptor) bool { + for _, f := range flavors { + if f.Flavor == flavor.Flavor && f.Version == flavor.Version { + return true + } + } + return false +} + +func TestScripts(t *testing.T) { + if _, ok := os.LookupEnv("CI_COMMIT_SHA"); !ok { + t.Log("CI_COMMIT_SHA env var is not set, this test requires this variable to be set to work") + t.FailNow() + } + + var flavors []e2eos.Descriptor + for _, flavor := range amd64Flavors { + flavor.Architecture = e2eos.AMD64Arch + flavors = append(flavors, flavor) + } + for _, flavor := range arm64Flavors { + flavor.Architecture = e2eos.ARM64Arch + flavors = append(flavors, flavor) + } + for _, f := range flavors { + for _, test := range scriptTestsWithSkippedFlavors { + flavor := f // capture range variable for parallel tests closure + if shouldSkipFlavor(test.skippedFlavors, flavor) { + continue + } + + suite := test.t(flavor, flavor.Architecture) + t.Run(suite.Name(), func(t *testing.T) { + t.Parallel() + // FIXME: Fedora currently has DNS issues + if flavor.Flavor == e2eos.Fedora { + flake.Mark(t) + } + + opts := []awshost.ProvisionerOption{ + awshost.WithEC2InstanceOptions(ec2.WithOSArch(flavor, flavor.Architecture)), + awshost.WithoutAgent(), + } + opts = append(opts, suite.ProvisionerOptions()...) + e2e.Run(t, suite, + e2e.WithProvisioner(awshost.Provisioner(opts...)), + e2e.WithStackName(suite.Name()), + ) + }) + } + } +} + +type installerScriptSuite interface { + e2e.Suite[environments.Host] + + Name() string + ProvisionerOptions() []awshost.ProvisionerOption +} + +func newInstallerScriptSuite(pkg string, e2eos e2eos.Descriptor, arch e2eos.Architecture, opts ...awshost.ProvisionerOption) installerScriptBaseSuite { + return installerScriptBaseSuite{ + commitHash: os.Getenv("CI_COMMIT_SHA"), + os: e2eos, + arch: arch, + pkg: pkg, + opts: opts, + } +} + +func (s *installerScriptBaseSuite) Name() string { + return regexp.MustCompile("[^a-zA-Z0-9]+").ReplaceAllString(fmt.Sprintf("%s/%s", s.pkg, s.os), "_") +} + +func (s *installerScriptBaseSuite) ProvisionerOptions() []awshost.ProvisionerOption { + return s.opts +} + +func (s *installerScriptBaseSuite) SetupSuite() { + s.BaseSuite.SetupSuite() + s.host = host.New(s.T(), s.Env().RemoteHost, s.os, s.arch) +} + +type installerScriptBaseSuite struct { + commitHash string + e2e.BaseSuite[environments.Host] + + host *host.Host + opts []awshost.ProvisionerOption + pkg string + arch e2eos.Architecture + os e2eos.Descriptor +} + +func (s *installerScriptBaseSuite) RunInstallScript(url string, params ...string) { + err := s.RunInstallScriptWithError(url, params...) + require.NoErrorf(s.T(), err, "install script failed") +} + +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; %s bash install_script", url, strings.Join(scriptParams, " "))) + return err +} + +func (s *installerScriptBaseSuite) Purge() { + s.Env().RemoteHost.MustExecute("sudo rm -rf install_script") + s.Env().RemoteHost.Execute("sudo datadog-installer purge") +} diff --git a/test/new-e2e/tests/installer/script/databricks_test.go b/test/new-e2e/tests/installer/script/databricks_test.go new file mode 100644 index 0000000000000..820de6a627152 --- /dev/null +++ b/test/new-e2e/tests/installer/script/databricks_test.go @@ -0,0 +1,63 @@ +// 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 installscript + +import ( + "fmt" + + e2eos "github.com/DataDog/test-infra-definitions/components/os" + + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" +) + +const ( + databricksAgentVersion = "7.58.2-1" + databricksApmInjectVersion = "0.26.0" + databricksApmLibraryJavaVersion = "1.42.2" +) + +type installScriptDatabricksSuite struct { + installerScriptBaseSuite + url string +} + +func testDatabricksScript(os e2eos.Descriptor, arch e2eos.Architecture) installerScriptSuite { + s := &installScriptDatabricksSuite{ + installerScriptBaseSuite: newInstallerScriptSuite("installer", os, arch, awshost.WithoutFakeIntake(), awshost.WithoutAgent()), + } + s.url = fmt.Sprintf("https://installtesting.datad0g.com/%s/scripts/install-databricks.sh", s.commitHash) + + return s +} + +func (s *installScriptDatabricksSuite) TestDatabricksWorkerInstallScript() { + s.RunInstallScript(s.url) + state := s.host.State() + agentPath := fmt.Sprintf("/opt/datadog-packages/datadog-agent/%s", databricksAgentVersion) + state.AssertDirExists(agentPath, 0755, "dd-agent", "dd-agent") + state.AssertSymlinkExists("/opt/datadog-packages/datadog-agent/stable", agentPath, "root", "root") + + state.AssertFileExists("/etc/datadog-agent/datadog.yaml", 0640, "dd-agent", "dd-agent") +} + +func (s *installScriptDatabricksSuite) TestDatabricksDriverInstallScript() { + s.RunInstallScript(s.url, "DB_IS_DRIVER=TRUE") + state := s.host.State() + agentPath := fmt.Sprintf("/opt/datadog-packages/datadog-agent/%s", databricksAgentVersion) + javaPath := fmt.Sprintf("/opt/datadog-packages/datadog-apm-library-java/%s", databricksApmLibraryJavaVersion) + injectPath := fmt.Sprintf("/opt/datadog-packages/datadog-apm-inject/%s", databricksApmInjectVersion) + + state.AssertDirExists(agentPath, 0755, "dd-agent", "dd-agent") + state.AssertSymlinkExists("/opt/datadog-packages/datadog-agent/stable", agentPath, "root", "root") + state.AssertDirExists(injectPath, 0755, "root", "root") + state.AssertSymlinkExists("/opt/datadog-packages/datadog-apm-inject/stable", injectPath, "root", "root") + state.AssertDirExists(javaPath, 0755, "root", "root") + state.AssertSymlinkExists("/opt/datadog-packages/datadog-apm-library-java/stable", javaPath, "root", "root") + + state.AssertFileExists("/etc/datadog-agent/datadog.yaml", 0640, "dd-agent", "dd-agent") + state.AssertFileExists("/etc/datadog-agent/conf.d/spark.d/databricks.yaml", 0644, "dd-agent", "dd-agent") + state.AssertFileExists("/etc/datadog-agent/inject/tracer.yaml", 0644, "root", "root") +} diff --git a/test/new-e2e/tests/installer/unix/all_packages_test.go b/test/new-e2e/tests/installer/unix/all_packages_test.go index 82f3d6bf44c12..eeaa3a4916110 100644 --- a/test/new-e2e/tests/installer/unix/all_packages_test.go +++ b/test/new-e2e/tests/installer/unix/all_packages_test.go @@ -18,10 +18,9 @@ import ( "github.com/DataDog/test-infra-definitions/scenarios/aws/ec2" "github.com/stretchr/testify/require" - "github.com/DataDog/datadog-agent/pkg/util/testutil/flake" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/e2e/client" "github.com/DataDog/datadog-agent/test/new-e2e/tests/installer/host" ) @@ -40,7 +39,7 @@ var ( e2eos.AmazonLinux2, e2eos.Debian12, e2eos.RedHat9, - e2eos.FedoraDefault, + // e2eos.FedoraDefault, // Skipped instead of marked as flaky to avoid useless logs e2eos.CentOS7, e2eos.Suse15, } @@ -108,11 +107,6 @@ func TestPackages(t *testing.T) { suite := test.t(flavor, flavor.Architecture, method) t.Run(suite.Name(), func(t *testing.T) { t.Parallel() - // FIXME: Fedora currently has DNS issues - if flavor.Flavor == e2eos.Fedora { - flake.Mark(t) - } - opts := []awshost.ProvisionerOption{ awshost.WithEC2InstanceOptions(ec2.WithOSArch(flavor, flavor.Architecture)), awshost.WithoutAgent(), @@ -217,7 +211,7 @@ func (s *packageBaseSuite) RunInstallScript(params ...string) { playbookPath := s.writeAnsiblePlaybook(env, params...) // Run the playbook - s.Env().RemoteHost.MustExecute(fmt.Sprintf("%sansible-playbook %s > /dev/null 2> /dev/null", ansiblePrefix, playbookPath)) + s.Env().RemoteHost.MustExecute(fmt.Sprintf("%sansible-playbook -vvv %s", ansiblePrefix, playbookPath)) // touch install files for compatibility s.Env().RemoteHost.MustExecute("touch /tmp/datadog-installer-stdout.log") diff --git a/test/new-e2e/tests/installer/unix/package_agent_test.go b/test/new-e2e/tests/installer/unix/package_agent_test.go index 70ddeff75c676..d419ba8f02585 100644 --- a/test/new-e2e/tests/installer/unix/package_agent_test.go +++ b/test/new-e2e/tests/installer/unix/package_agent_test.go @@ -12,11 +12,12 @@ import ( "strings" "time" - awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" - "github.com/DataDog/datadog-agent/test/new-e2e/tests/installer/host" e2eos "github.com/DataDog/test-infra-definitions/components/os" "github.com/stretchr/testify/assert" "gopkg.in/yaml.v3" + + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" + "github.com/DataDog/datadog-agent/test/new-e2e/tests/installer/host" ) const ( diff --git a/test/new-e2e/tests/installer/unix/package_definitions.go b/test/new-e2e/tests/installer/unix/package_definitions.go index 2f7c2d15057dd..78c5ac64fd75b 100644 --- a/test/new-e2e/tests/installer/unix/package_definitions.go +++ b/test/new-e2e/tests/installer/unix/package_definitions.go @@ -67,8 +67,8 @@ func WithAlias(alias string) PackageOption { // PackagesConfig is the list of known packages configuration for testing var PackagesConfig = []TestPackageConfig{ - {Name: "datadog-installer", Version: fmt.Sprintf("pipeline-%v", os.Getenv("E2E_PIPELINE_ID")), Registry: "669783387624.dkr.ecr.us-east-1.amazonaws.com", Auth: "ecr"}, - {Name: "datadog-agent", Alias: "agent-package", Version: fmt.Sprintf("pipeline-%v", os.Getenv("E2E_PIPELINE_ID")), Registry: "669783387624.dkr.ecr.us-east-1.amazonaws.com", Auth: "ecr"}, + {Name: "datadog-installer", Version: fmt.Sprintf("pipeline-%v", os.Getenv("E2E_PIPELINE_ID")), Registry: "installtesting.datad0g.com"}, + {Name: "datadog-agent", Alias: "agent-package", Version: fmt.Sprintf("pipeline-%v", os.Getenv("E2E_PIPELINE_ID")), Registry: "installtesting.datad0g.com"}, {Name: "datadog-apm-inject", Version: "latest"}, {Name: "datadog-apm-library-java", Version: "latest"}, {Name: "datadog-apm-library-ruby", Version: "latest"}, diff --git a/test/new-e2e/tests/installer/unix/package_installer_test.go b/test/new-e2e/tests/installer/unix/package_installer_test.go index 8588ee018d210..304cd12383e7b 100644 --- a/test/new-e2e/tests/installer/unix/package_installer_test.go +++ b/test/new-e2e/tests/installer/unix/package_installer_test.go @@ -6,9 +6,13 @@ package installer import ( - awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" + "strings" + "time" + e2eos "github.com/DataDog/test-infra-definitions/components/os" "github.com/stretchr/testify/assert" + + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" ) type packageInstallerSuite struct { @@ -102,20 +106,33 @@ func (s *packageInstallerSuite) TestReInstall() { func (s *packageInstallerSuite) TestUpdateInstallerOCI() { // Install prod err := s.RunInstallScriptProdOci( + "DD_REMOTE_UPDATES=true", envForceVersion("datadog-installer", "7.58.0-installer-0.5.1-1"), ) defer s.Purge() assert.NoError(s.T(), err) - version := s.Env().RemoteHost.MustExecute("/opt/datadog-packages/datadog-installer/stable/bin/installer/installer version") - assert.Equal(s.T(), "7.58.0-installer-0.5.1\n", version) + versionDisk := s.Env().RemoteHost.MustExecute("/opt/datadog-packages/datadog-installer/stable/bin/installer/installer version") + assert.Equal(s.T(), "7.58.0-installer-0.5.1\n", versionDisk) + assert.Eventually(s.T(), func() bool { + versionRunning, err := s.Env().RemoteHost.Execute("sudo datadog-installer status") + s.T().Logf("checking version: %s, err: %v", versionRunning, err) + return err == nil && strings.Contains(versionRunning, "7.58.0-installer-0.5.1") + }, 30*time.Second, 1*time.Second) // Install from QA registry - err = s.RunInstallScriptWithError() + err = s.RunInstallScriptWithError( + "DD_REMOTE_UPDATES=true", + ) assert.NoError(s.T(), err) - version = s.Env().RemoteHost.MustExecute("/opt/datadog-packages/datadog-installer/stable/bin/installer/installer version") - assert.NotEqual(s.T(), "7.58.0-installer-0.5.1\n", version) + versionDisk = s.Env().RemoteHost.MustExecute("/opt/datadog-packages/datadog-installer/stable/bin/installer/installer version") + assert.NotEqual(s.T(), "7.58.0-installer-0.5.1\n", versionDisk) + assert.Eventually(s.T(), func() bool { + versionRunning, err := s.Env().RemoteHost.Execute("sudo datadog-installer status") + s.T().Logf("checking version: %s, err: %v", versionRunning, err) + return err == nil && !strings.Contains(versionRunning, "7.58.0-installer-0.5.1") + }, 30*time.Second, 1*time.Second) } func (s *packageInstallerSuite) TestInstallWithUmask() { diff --git a/test/new-e2e/tests/installer/unix/upgrade_scenario_test.go b/test/new-e2e/tests/installer/unix/upgrade_scenario_test.go index 74d3b888cab58..5fdf6a24c60eb 100644 --- a/test/new-e2e/tests/installer/unix/upgrade_scenario_test.go +++ b/test/new-e2e/tests/installer/unix/upgrade_scenario_test.go @@ -404,10 +404,14 @@ func (s *upgradeScenarioSuite) TestConfigUpgradeSuccessful() { s.host.WaitForFileExists(true, "/opt/datadog-packages/run/installer.sock") state := s.host.State() + // Assert setup successful + state.AssertDirExists("/etc/datadog-agent/managed", 0755, "root", "root") + state.AssertDirExists("/etc/datadog-agent/managed/datadog-apm-libraries", 0755, "root", "root") + state.AssertDirExists("/etc/datadog-agent/managed/datadog-agent", 0755, "root", "root") state.AssertSymlinkExists("/etc/datadog-agent/managed/datadog-agent/stable", "/etc/datadog-agent/managed/datadog-agent/e94406c45ae766b7d34d2793e4759b9c4d15ed5d5e2b7f73ce1bf0e6836f728d", "root", "root") // Verify metadata - state.AssertFileExists("/etc/datadog-agent/managed/datadog-agent/e94406c45ae766b7d34d2793e4759b9c4d15ed5d5e2b7f73ce1bf0e6836f728d/policy.metadata", 0440, "dd-agent", "dd-agent") - file := s.Env().RemoteHost.MustExecute("sudo cat /etc/datadog-agent/managed/datadog-agent/e94406c45ae766b7d34d2793e4759b9c4d15ed5d5e2b7f73ce1bf0e6836f728d/policy.metadata") + state.AssertFileExists("/etc/datadog-agent/managed/datadog-agent/e94406c45ae766b7d34d2793e4759b9c4d15ed5d5e2b7f73ce1bf0e6836f728d/policy.metadata", 0444, "root", "root") + file := s.Env().RemoteHost.MustExecute("cat /etc/datadog-agent/managed/datadog-agent/e94406c45ae766b7d34d2793e4759b9c4d15ed5d5e2b7f73ce1bf0e6836f728d/policy.metadata") policiesState := &pbgo.PoliciesState{} err := json.Unmarshal([]byte(file), policiesState) require.NoError(s.T(), err) diff --git a/test/new-e2e/tests/installer/windows/suites/agent-package/agent-user_test.go b/test/new-e2e/tests/installer/windows/suites/agent-package/agent-user_test.go index 9c7d4d716e468..6a1029294f235 100644 --- a/test/new-e2e/tests/installer/windows/suites/agent-package/agent-user_test.go +++ b/test/new-e2e/tests/installer/windows/suites/agent-package/agent-user_test.go @@ -8,13 +8,14 @@ package agenttests import ( installer "github.com/DataDog/datadog-agent/test/new-e2e/pkg/components/datadog-installer" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host/windows" + winawshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host/windows" installerwindows "github.com/DataDog/datadog-agent/test/new-e2e/tests/installer/windows" windowsCommon "github.com/DataDog/datadog-agent/test/new-e2e/tests/windows/common" windowsAgent "github.com/DataDog/datadog-agent/test/new-e2e/tests/windows/common/agent" - "github.com/stretchr/testify/require" "testing" + + "github.com/stretchr/testify/require" ) type testAgentInstallWithAgentUserSuite struct { diff --git a/test/new-e2e/tests/installer/windows/suites/agent-package/install_test.go b/test/new-e2e/tests/installer/windows/suites/agent-package/install_test.go index 38fd858783940..a7c186c31cac2 100644 --- a/test/new-e2e/tests/installer/windows/suites/agent-package/install_test.go +++ b/test/new-e2e/tests/installer/windows/suites/agent-package/install_test.go @@ -10,7 +10,7 @@ import ( "path/filepath" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host/windows" + winawshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host/windows" installerwindows "github.com/DataDog/datadog-agent/test/new-e2e/tests/installer/windows" windowsAgent "github.com/DataDog/datadog-agent/test/new-e2e/tests/windows/common/agent" diff --git a/test/new-e2e/tests/installer/windows/suites/agent-package/upgrade_test.go b/test/new-e2e/tests/installer/windows/suites/agent-package/upgrade_test.go index cad8fab208066..af28bc4d66b66 100644 --- a/test/new-e2e/tests/installer/windows/suites/agent-package/upgrade_test.go +++ b/test/new-e2e/tests/installer/windows/suites/agent-package/upgrade_test.go @@ -9,7 +9,7 @@ import ( "testing" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" - winawshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host/windows" + winawshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host/windows" installer "github.com/DataDog/datadog-agent/test/new-e2e/tests/installer/unix" installerwindows "github.com/DataDog/datadog-agent/test/new-e2e/tests/installer/windows" ) diff --git a/test/new-e2e/tests/installer/windows/suites/install-script/agent-user_test.go b/test/new-e2e/tests/installer/windows/suites/install-script/agent-user_test.go index ad2ab623c5b57..b8aceac530e26 100644 --- a/test/new-e2e/tests/installer/windows/suites/install-script/agent-user_test.go +++ b/test/new-e2e/tests/installer/windows/suites/install-script/agent-user_test.go @@ -7,13 +7,14 @@ package agenttests import ( "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host/windows" + winawshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host/windows" installerwindows "github.com/DataDog/datadog-agent/test/new-e2e/tests/installer/windows" windowsCommon "github.com/DataDog/datadog-agent/test/new-e2e/tests/windows/common" windowsAgent "github.com/DataDog/datadog-agent/test/new-e2e/tests/windows/common/agent" - "github.com/stretchr/testify/require" "testing" + + "github.com/stretchr/testify/require" ) type testInstallScriptWithAgentUserSuite struct { diff --git a/test/new-e2e/tests/installer/windows/suites/installer-package/install_test.go b/test/new-e2e/tests/installer/windows/suites/installer-package/install_test.go index 7bfa29e502797..9d2e4f4799351 100644 --- a/test/new-e2e/tests/installer/windows/suites/installer-package/install_test.go +++ b/test/new-e2e/tests/installer/windows/suites/installer-package/install_test.go @@ -7,11 +7,12 @@ package installertests import ( + "testing" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" - awsHostWindows "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host/windows" + awsHostWindows "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host/windows" installerwindows "github.com/DataDog/datadog-agent/test/new-e2e/tests/installer/windows" "github.com/DataDog/datadog-agent/test/new-e2e/tests/windows/common" - "testing" ) type testInstallerSuite struct { diff --git a/test/new-e2e/tests/installer/windows/suites/installer-package/rollback_test.go b/test/new-e2e/tests/installer/windows/suites/installer-package/rollback_test.go index b211dce84ead1..8863214eca148 100644 --- a/test/new-e2e/tests/installer/windows/suites/installer-package/rollback_test.go +++ b/test/new-e2e/tests/installer/windows/suites/installer-package/rollback_test.go @@ -6,10 +6,11 @@ package installertests import ( + "testing" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" - awsHostWindows "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host/windows" + awsHostWindows "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host/windows" installerwindows "github.com/DataDog/datadog-agent/test/new-e2e/tests/installer/windows" - "testing" ) type testInstallerRollbackSuite struct { diff --git a/test/new-e2e/tests/installer/windows/suites/installer-package/system_integrity_test.go b/test/new-e2e/tests/installer/windows/suites/installer-package/system_integrity_test.go index 088bd9f80aee7..568e1159adc27 100644 --- a/test/new-e2e/tests/installer/windows/suites/installer-package/system_integrity_test.go +++ b/test/new-e2e/tests/installer/windows/suites/installer-package/system_integrity_test.go @@ -6,12 +6,13 @@ package installertests import ( + "testing" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host/windows" + winawshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host/windows" installerwindows "github.com/DataDog/datadog-agent/test/new-e2e/tests/installer/windows" "github.com/DataDog/datadog-agent/test/new-e2e/tests/windows/common" - "github.com/DataDog/datadog-agent/test/new-e2e/tests/windows/install-test" - "testing" + installtest "github.com/DataDog/datadog-agent/test/new-e2e/tests/windows/install-test" ) type testSystemIntegrityInstallerSuite struct { diff --git a/test/new-e2e/tests/installer/windows/suites/installer-package/upgrade_test.go b/test/new-e2e/tests/installer/windows/suites/installer-package/upgrade_test.go index a2fc1d9970507..e145109d62b75 100644 --- a/test/new-e2e/tests/installer/windows/suites/installer-package/upgrade_test.go +++ b/test/new-e2e/tests/installer/windows/suites/installer-package/upgrade_test.go @@ -6,13 +6,14 @@ package installertests import ( + "testing" + agentVersion "github.com/DataDog/datadog-agent/pkg/version" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host/windows" + winawshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host/windows" installerwindows "github.com/DataDog/datadog-agent/test/new-e2e/tests/installer/windows" "github.com/DataDog/datadog-agent/test/new-e2e/tests/windows/common/agent" "github.com/DataDog/datadog-agent/test/new-e2e/tests/windows/common/pipeline" - "testing" ) type testInstallerUpgradesSuite struct { diff --git a/test/new-e2e/tests/language-detection/language_detection_test.go b/test/new-e2e/tests/language-detection/language_detection_test.go index 29ce07db52c7a..52d06d382ec5a 100644 --- a/test/new-e2e/tests/language-detection/language_detection_test.go +++ b/test/new-e2e/tests/language-detection/language_detection_test.go @@ -17,10 +17,11 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "github.com/DataDog/test-infra-definitions/components/datadog/agentparams" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" - "github.com/DataDog/test-infra-definitions/components/datadog/agentparams" + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" ) //go:embed etc/process_config.yaml diff --git a/test/new-e2e/tests/language-detection/python_test.go b/test/new-e2e/tests/language-detection/python_test.go index 2be850b1da5a9..875ac519ce602 100644 --- a/test/new-e2e/tests/language-detection/python_test.go +++ b/test/new-e2e/tests/language-detection/python_test.go @@ -11,7 +11,7 @@ import ( "github.com/DataDog/test-infra-definitions/components/datadog/agentparams" "github.com/stretchr/testify/require" - awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" ) func (s *languageDetectionSuite) installPython() { diff --git a/test/new-e2e/tests/ndm/netflow/netflow_test.go b/test/new-e2e/tests/ndm/netflow/netflow_test.go index 3694560cbbe44..cf2564c974db5 100644 --- a/test/new-e2e/tests/ndm/netflow/netflow_test.go +++ b/test/new-e2e/tests/ndm/netflow/netflow_test.go @@ -13,9 +13,11 @@ import ( "testing" "time" + "github.com/stretchr/testify/assert" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - "github.com/stretchr/testify/assert" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners" "github.com/DataDog/test-infra-definitions/common/utils" "github.com/DataDog/test-infra-definitions/components/datadog/agent" @@ -37,8 +39,8 @@ var datadogYaml string // netflowDockerProvisioner defines a stack with a docker agent on an AmazonLinuxECS VM // with the netflow-generator running and sending netflow payloads to the agent -func netflowDockerProvisioner() e2e.Provisioner { - return e2e.NewTypedPulumiProvisioner[environments.DockerHost]("", func(ctx *pulumi.Context, env *environments.DockerHost) error { +func netflowDockerProvisioner() provisioners.Provisioner { + return provisioners.NewTypedPulumiProvisioner[environments.DockerHost]("", func(ctx *pulumi.Context, env *environments.DockerHost) error { name := "netflowvm" awsEnv, err := aws.NewEnvironment(ctx) if err != nil { diff --git a/test/new-e2e/tests/ndm/snmp/snmp_test.go b/test/new-e2e/tests/ndm/snmp/snmp_test.go index e4b2b56e53324..abdc91b3a69b8 100644 --- a/test/new-e2e/tests/ndm/snmp/snmp_test.go +++ b/test/new-e2e/tests/ndm/snmp/snmp_test.go @@ -13,11 +13,13 @@ import ( "testing" "time" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/DataDog/datadog-agent/test/fakeintake/aggregator" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners" "github.com/DataDog/test-infra-definitions/common/utils" "github.com/DataDog/test-infra-definitions/components/datadog/agent" @@ -43,8 +45,8 @@ const ( // snmpDockerProvisioner defines a stack with a docker agent on an AmazonLinuxECS VM // with snmpsim installed and configured with snmp recordings -func snmpDockerProvisioner() e2e.Provisioner { - return e2e.NewTypedPulumiProvisioner("", func(ctx *pulumi.Context, env *environments.DockerHost) error { +func snmpDockerProvisioner() provisioners.Provisioner { + return provisioners.NewTypedPulumiProvisioner("", func(ctx *pulumi.Context, env *environments.DockerHost) error { name := "snmpvm" awsEnv, err := aws.NewEnvironment(ctx) if err != nil { diff --git a/test/new-e2e/tests/netpath/network-path-integration/common_test.go b/test/new-e2e/tests/netpath/network-path-integration/common_test.go new file mode 100644 index 0000000000000..44a3fe90560c9 --- /dev/null +++ b/test/new-e2e/tests/netpath/network-path-integration/common_test.go @@ -0,0 +1,56 @@ +// 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 netpath contains e2e tests for Network Path Integration feature +package networkpathintegration + +import ( + _ "embed" + "fmt" + + "github.com/DataDog/datadog-agent/test/fakeintake/aggregator" + fakeintakeclient "github.com/DataDog/datadog-agent/test/fakeintake/client" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/components" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" +) + +//go:embed fixtures/system-probe.yaml +var sysProbeConfig []byte + +//go:embed fixtures/network_path.yaml +var networkPathIntegration []byte + +var testAgentRunningMetricTagsTCP = []string{"destination_hostname:api.datadoghq.eu", "protocol:TCP", "destination_port:443"} +var testAgentRunningMetricTagsUDP = []string{"destination_hostname:8.8.8.8", "protocol:UDP"} + +type baseNetworkPathIntegrationTestSuite struct { + e2e.BaseSuite[environments.Host] +} + +func assertMetrics(fakeIntake *components.FakeIntake, c *assert.CollectT, metricTags [][]string) { + fakeClient := fakeIntake.Client() + + metrics, err := fakeClient.FilterMetrics("datadog.network_path.path.monitored") + require.NoError(c, err) + assert.NotEmpty(c, metrics) + for _, tags := range metricTags { + // assert destination is monitored + metrics, err = fakeClient.FilterMetrics("datadog.network_path.path.monitored", fakeintakeclient.WithTags[*aggregator.MetricSeries](tags)) + assert.NoError(c, err) + assert.NotEmpty(c, metrics, fmt.Sprintf("metric with tags `%v` not found", tags)) + + // assert hops + metrics, err = fakeClient.FilterMetrics("datadog.network_path.path.hops", + fakeintakeclient.WithTags[*aggregator.MetricSeries](tags), + fakeintakeclient.WithMetricValueHigherThan(0), + ) + assert.NoError(c, err) + assert.NotEmpty(c, metrics, fmt.Sprintf("metric with tags `%v` not found", tags)) + } +} diff --git a/test/new-e2e/tests/netpath/network-path-integration/fixtures/network_path.yaml b/test/new-e2e/tests/netpath/network-path-integration/fixtures/network_path.yaml new file mode 100644 index 0000000000000..b81ddbb2d1f18 --- /dev/null +++ b/test/new-e2e/tests/netpath/network-path-integration/fixtures/network_path.yaml @@ -0,0 +1,6 @@ +instances: + - hostname: api.datadoghq.eu + protocol: TCP + port: 443 + - hostname: 8.8.8.8 + protocol: UDP diff --git a/test/new-e2e/tests/netpath/network-path-integration/fixtures/system-probe.yaml b/test/new-e2e/tests/netpath/network-path-integration/fixtures/system-probe.yaml new file mode 100644 index 0000000000000..4f90e64d11446 --- /dev/null +++ b/test/new-e2e/tests/netpath/network-path-integration/fixtures/system-probe.yaml @@ -0,0 +1,2 @@ +traceroute: + enabled: true diff --git a/test/new-e2e/tests/netpath/network-path-integration/netpath_int_nix_test.go b/test/new-e2e/tests/netpath/network-path-integration/netpath_int_nix_test.go new file mode 100644 index 0000000000000..964382b9af13a --- /dev/null +++ b/test/new-e2e/tests/netpath/network-path-integration/netpath_int_nix_test.go @@ -0,0 +1,45 @@ +// 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 netpath contains e2e tests for Network Path Integration feature +package networkpathintegration + +import ( + _ "embed" + "testing" + "time" + + "github.com/DataDog/test-infra-definitions/components/datadog/agentparams" + "github.com/stretchr/testify/assert" + + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" +) + +type linuxNetworkPathIntegrationTestSuite struct { + baseNetworkPathIntegrationTestSuite +} + +// TestNetworkPathIntegrationSuiteLinux runs the Network Path Integration e2e suite for linux +func TestLinuxNetworkPathIntegrationSuite(t *testing.T) { + t.Parallel() + e2e.Run(t, &linuxNetworkPathIntegrationTestSuite{}, e2e.WithProvisioner(awshost.Provisioner( + awshost.WithAgentOptions( + agentparams.WithSystemProbeConfig(string(sysProbeConfig)), + agentparams.WithIntegration("network_path.d", string(networkPathIntegration)), + )), + )) + +} + +func (s *linuxNetworkPathIntegrationTestSuite) TestLinuxNetworkPathIntegrationMetrics() { + fakeIntake := s.Env().FakeIntake + s.EventuallyWithT(func(c *assert.CollectT) { + assertMetrics(fakeIntake, c, [][]string{ + testAgentRunningMetricTagsTCP, + testAgentRunningMetricTagsUDP, + }) + }, 5*time.Minute, 3*time.Second) +} diff --git a/test/new-e2e/tests/netpath/network-path-integration/netpath_int_win_test.go b/test/new-e2e/tests/netpath/network-path-integration/netpath_int_win_test.go new file mode 100644 index 0000000000000..ae449f2b8ca5b --- /dev/null +++ b/test/new-e2e/tests/netpath/network-path-integration/netpath_int_win_test.go @@ -0,0 +1,48 @@ +// 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 netpath contains e2e tests for Network Path Integration feature +package networkpathintegration + +import ( + _ "embed" + "testing" + "time" + + "github.com/DataDog/test-infra-definitions/components/datadog/agentparams" + "github.com/DataDog/test-infra-definitions/components/os" + "github.com/DataDog/test-infra-definitions/scenarios/aws/ec2" + "github.com/stretchr/testify/assert" + + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" +) + +type windowsNetworkPathIntegrationTestSuite struct { + baseNetworkPathIntegrationTestSuite +} + +// TestNetworkPathIntegrationSuiteLinux runs the Network Path Integration e2e suite for linux +func TestWindowsNetworkPathIntegrationSuite(t *testing.T) { + t.Parallel() + e2e.Run(t, &windowsNetworkPathIntegrationTestSuite{}, e2e.WithProvisioner(awshost.Provisioner( + awshost.WithAgentOptions( + agentparams.WithSystemProbeConfig(string(sysProbeConfig)), + agentparams.WithIntegration("network_path.d", string(networkPathIntegration)), + ), + awshost.WithEC2InstanceOptions(ec2.WithOS(os.WindowsDefault)), + ))) +} + +func (s *windowsNetworkPathIntegrationTestSuite) TestWindowsNetworkPathIntegrationMetrics() { + fakeIntake := s.Env().FakeIntake + s.EventuallyWithT(func(c *assert.CollectT) { + assertMetrics(fakeIntake, c, [][]string{ + testAgentRunningMetricTagsTCP, + // TODO: Test UDP once implemented for windows, uncomment line below + //testAgentRunningMetricTagsUDP, + }) + }, 5*time.Minute, 3*time.Second) +} diff --git a/test/new-e2e/tests/npm/agentenv_npm_test.go b/test/new-e2e/tests/npm/agentenv_npm_test.go index 1dae47d257bfb..7fd062b40ac97 100644 --- a/test/new-e2e/tests/npm/agentenv_npm_test.go +++ b/test/new-e2e/tests/npm/agentenv_npm_test.go @@ -11,7 +11,7 @@ import ( "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" "github.com/DataDog/test-infra-definitions/components/datadog/agentparams" diff --git a/test/new-e2e/tests/npm/ec2_1host_containerized_test.go b/test/new-e2e/tests/npm/ec2_1host_containerized_test.go index 68e1d68a92107..8fd4b25051591 100644 --- a/test/new-e2e/tests/npm/ec2_1host_containerized_test.go +++ b/test/new-e2e/tests/npm/ec2_1host_containerized_test.go @@ -13,7 +13,8 @@ import ( "github.com/DataDog/datadog-agent/test/new-e2e/pkg/components" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awsdocker "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/docker" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners" + awsdocker "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/docker" "github.com/DataDog/test-infra-definitions/components/docker" "github.com/DataDog/test-infra-definitions/resources/aws" @@ -30,7 +31,7 @@ type ec2VMContainerizedSuite struct { e2e.BaseSuite[dockerHostNginxEnv] } -func dockerHostHttpbinEnvProvisioner() e2e.PulumiEnvRunFunc[dockerHostNginxEnv] { +func dockerHostHttpbinEnvProvisioner() provisioners.PulumiEnvRunFunc[dockerHostNginxEnv] { return func(ctx *pulumi.Context, env *dockerHostNginxEnv) error { awsEnv, err := aws.NewEnvironment(ctx) if err != nil { @@ -76,7 +77,7 @@ func TestEC2VMContainerizedSuite(t *testing.T) { t.Parallel() s := &ec2VMContainerizedSuite{} - e2eParams := []e2e.SuiteOption{e2e.WithProvisioner(e2e.NewTypedPulumiProvisioner("dockerHostHttpbin", dockerHostHttpbinEnvProvisioner(), nil))} + e2eParams := []e2e.SuiteOption{e2e.WithProvisioner(provisioners.NewTypedPulumiProvisioner("dockerHostHttpbin", dockerHostHttpbinEnvProvisioner(), nil))} // Source of our kitchen CI images test/kitchen/platforms.json // Other VM image can be used, our kitchen CI images test/kitchen/platforms.json diff --git a/test/new-e2e/tests/npm/ec2_1host_selinux_test.go b/test/new-e2e/tests/npm/ec2_1host_selinux_test.go index 67afaa540c9a4..2aaf28eb7138c 100644 --- a/test/new-e2e/tests/npm/ec2_1host_selinux_test.go +++ b/test/new-e2e/tests/npm/ec2_1host_selinux_test.go @@ -9,7 +9,8 @@ import ( "testing" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" - awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners" + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" compos "github.com/DataDog/test-infra-definitions/components/os" "github.com/DataDog/test-infra-definitions/scenarios/aws/ec2" @@ -25,7 +26,7 @@ func TestEC2VMSELinuxSuite(t *testing.T) { s := &ec2VMSELinuxSuite{} e2eParams := []e2e.SuiteOption{e2e.WithProvisioner( - e2e.NewTypedPulumiProvisioner("hostHttpbin", hostDockerHttpbinEnvProvisioner(awshost.WithEC2InstanceOptions( + provisioners.NewTypedPulumiProvisioner("hostHttpbin", hostDockerHttpbinEnvProvisioner(awshost.WithEC2InstanceOptions( // RHEL9 ec2.WithAMI("ami-0fe630eb857a6ec83", compos.AmazonLinux2, compos.AMD64Arch), ec2.WithInstanceType("t3.medium"))), nil)), } diff --git a/test/new-e2e/tests/npm/ec2_1host_test.go b/test/new-e2e/tests/npm/ec2_1host_test.go index ba07540f58ca7..78776323315a7 100644 --- a/test/new-e2e/tests/npm/ec2_1host_test.go +++ b/test/new-e2e/tests/npm/ec2_1host_test.go @@ -13,7 +13,8 @@ import ( "github.com/DataDog/datadog-agent/test/new-e2e/pkg/components" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners" + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" "github.com/DataDog/test-infra-definitions/components/datadog/agentparams" "github.com/DataDog/test-infra-definitions/components/docker" @@ -30,7 +31,7 @@ type ec2VMSuite struct { e2e.BaseSuite[hostHttpbinEnv] } -func hostDockerHttpbinEnvProvisioner(opt ...awshost.ProvisionerOption) e2e.PulumiEnvRunFunc[hostHttpbinEnv] { +func hostDockerHttpbinEnvProvisioner(opt ...awshost.ProvisionerOption) provisioners.PulumiEnvRunFunc[hostHttpbinEnv] { return func(ctx *pulumi.Context, env *hostHttpbinEnv) error { awsEnv, err := aws.NewEnvironment(ctx) if err != nil { @@ -77,7 +78,7 @@ func TestEC2VMSuite(t *testing.T) { t.Parallel() s := &ec2VMSuite{} - e2eParams := []e2e.SuiteOption{e2e.WithProvisioner(e2e.NewTypedPulumiProvisioner("hostHttpbin", hostDockerHttpbinEnvProvisioner(), nil))} + e2eParams := []e2e.SuiteOption{e2e.WithProvisioner(provisioners.NewTypedPulumiProvisioner("hostHttpbin", hostDockerHttpbinEnvProvisioner(), nil))} // Source of our E2E CI images test/new-e2e/tests/agent-platform/platforms.json // Other VM image can be used, our E2E CI images test/new-e2e/tests/agent-platform/platforms.json diff --git a/test/new-e2e/tests/npm/ec2_1host_wkit_test.go b/test/new-e2e/tests/npm/ec2_1host_wkit_test.go index 1dd04c1541990..e6d02c3c07186 100644 --- a/test/new-e2e/tests/npm/ec2_1host_wkit_test.go +++ b/test/new-e2e/tests/npm/ec2_1host_wkit_test.go @@ -12,7 +12,8 @@ import ( "github.com/DataDog/test-infra-definitions/scenarios/aws/ec2" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" - awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners" + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" ) type ec2VMWKitSuite struct { @@ -25,7 +26,7 @@ func TestEC2VMWKitSuite(t *testing.T) { s := &ec2VMWKitSuite{} - e2eParams := []e2e.SuiteOption{e2e.WithProvisioner(e2e.NewTypedPulumiProvisioner("hostHttpbin", hostDockerHttpbinEnvProvisioner(awshost.WithEC2InstanceOptions(ec2.WithOS(os.WindowsDefault))), nil))} + e2eParams := []e2e.SuiteOption{e2e.WithProvisioner(provisioners.NewTypedPulumiProvisioner("hostHttpbin", hostDockerHttpbinEnvProvisioner(awshost.WithEC2InstanceOptions(ec2.WithOS(os.WindowsDefault))), nil))} e2e.Run(t, s, e2eParams...) } diff --git a/test/new-e2e/tests/npm/ecs_1host_test.go b/test/new-e2e/tests/npm/ecs_1host_test.go index ae617ac4040ae..c829ccdaa1b46 100644 --- a/test/new-e2e/tests/npm/ecs_1host_test.go +++ b/test/new-e2e/tests/npm/ecs_1host_test.go @@ -15,7 +15,8 @@ import ( "github.com/DataDog/datadog-agent/test/new-e2e/pkg/components" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - envecs "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/ecs" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners" + envecs "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/ecs" npmtools "github.com/DataDog/test-infra-definitions/components/datadog/apps/npm-tools" "github.com/DataDog/test-infra-definitions/components/datadog/ecsagentparams" @@ -39,7 +40,7 @@ type ecsVMSuite struct { e2e.BaseSuite[ecsHttpbinEnv] } -func ecsHttpbinEnvProvisioner() e2e.PulumiEnvRunFunc[ecsHttpbinEnv] { +func ecsHttpbinEnvProvisioner() provisioners.PulumiEnvRunFunc[ecsHttpbinEnv] { return func(ctx *pulumi.Context, env *ecsHttpbinEnv) error { awsEnv, err := aws.NewEnvironment(ctx) if err != nil { @@ -86,7 +87,7 @@ func ecsHttpbinEnvProvisioner() e2e.PulumiEnvRunFunc[ecsHttpbinEnv] { func TestECSVMSuite(t *testing.T) { t.Parallel() s := &ecsVMSuite{} - e2eParams := []e2e.SuiteOption{e2e.WithProvisioner(e2e.NewTypedPulumiProvisioner("ecsHttpbin", ecsHttpbinEnvProvisioner(), nil))} + e2eParams := []e2e.SuiteOption{e2e.WithProvisioner(provisioners.NewTypedPulumiProvisioner("ecsHttpbin", ecsHttpbinEnvProvisioner(), nil))} e2e.Run(t, s, e2eParams...) } diff --git a/test/new-e2e/tests/npm/eks_1host_test.go b/test/new-e2e/tests/npm/eks_1host_test.go index 12f86c5fd37e2..bfdd551266b86 100644 --- a/test/new-e2e/tests/npm/eks_1host_test.go +++ b/test/new-e2e/tests/npm/eks_1host_test.go @@ -22,7 +22,8 @@ import ( "github.com/DataDog/datadog-agent/test/new-e2e/pkg/components" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - envkube "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/kubernetes" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners" + envkube "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/kubernetes" "github.com/pulumi/pulumi-kubernetes/sdk/v4/go/kubernetes" ) @@ -38,7 +39,7 @@ type eksVMSuite struct { e2e.BaseSuite[eksHttpbinEnv] } -func eksHttpbinEnvProvisioner(opts ...envkube.ProvisionerOption) e2e.PulumiEnvRunFunc[eksHttpbinEnv] { +func eksHttpbinEnvProvisioner(opts ...envkube.ProvisionerOption) provisioners.PulumiEnvRunFunc[eksHttpbinEnv] { return func(ctx *pulumi.Context, env *eksHttpbinEnv) error { awsEnv, err := aws.NewEnvironment(ctx) if err != nil { @@ -94,7 +95,7 @@ func TestEKSVMSuite(t *testing.T) { t.Parallel() s := &eksVMSuite{} - e2eParams := []e2e.SuiteOption{e2e.WithProvisioner(e2e.NewTypedPulumiProvisioner("eksHttpbin", eksHttpbinEnvProvisioner(), nil))} + e2eParams := []e2e.SuiteOption{e2e.WithProvisioner(provisioners.NewTypedPulumiProvisioner("eksHttpbin", eksHttpbinEnvProvisioner(), nil))} e2e.Run(t, s, e2eParams...) } diff --git a/test/new-e2e/tests/orchestrator/apply.go b/test/new-e2e/tests/orchestrator/apply.go index f7300ddc78833..45b3d792102a7 100644 --- a/test/new-e2e/tests/orchestrator/apply.go +++ b/test/new-e2e/tests/orchestrator/apply.go @@ -18,6 +18,7 @@ import ( dogstatsdstandalone "github.com/DataDog/test-infra-definitions/components/datadog/dogstatsd-standalone" fakeintakeComp "github.com/DataDog/test-infra-definitions/components/datadog/fakeintake" localKubernetes "github.com/DataDog/test-infra-definitions/components/kubernetes" + "github.com/DataDog/test-infra-definitions/components/kubernetes/vpa" resAws "github.com/DataDog/test-infra-definitions/resources/aws" "github.com/DataDog/test-infra-definitions/scenarios/aws/ec2" "github.com/DataDog/test-infra-definitions/scenarios/aws/fakeintake" @@ -86,6 +87,12 @@ func createCluster(ctx *pulumi.Context) (*resAws.Environment, *localKubernetes.C if err != nil { return nil, nil, nil, err } + + // Deploy VPA CRD + if _, err := vpa.DeployCRD(&awsEnv, kindKubeProvider); err != nil { + return nil, nil, nil, err + } + return &awsEnv, kindCluster, kindKubeProvider, nil } @@ -114,6 +121,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..37789d8b59766 100644 --- a/test/new-e2e/tests/otel/otel-agent/complete_test.go +++ b/test/new-e2e/tests/otel/otel-agent/complete_test.go @@ -14,7 +14,7 @@ import ( "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awskubernetes "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/kubernetes" + awskubernetes "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/kubernetes" "github.com/DataDog/datadog-agent/test/new-e2e/tests/otel/utils" ) @@ -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/config/no-dd-exporter.yml b/test/new-e2e/tests/otel/otel-agent/config/no-dd-exporter.yml new file mode 100644 index 0000000000000..b952fe8d38811 --- /dev/null +++ b/test/new-e2e/tests/otel/otel-agent/config/no-dd-exporter.yml @@ -0,0 +1,23 @@ +receivers: + otlp: + protocols: + grpc: + endpoint: 0.0.0.0:4317 + http: + endpoint: 0.0.0.0:4318 + +exporters: + debug: + verbosity: detailed + +service: + pipelines: + traces: + receivers: [otlp] + exporters: [debug] + metrics: + receivers: [otlp] + exporters: [debug] + logs: + receivers: [otlp] + exporters: [debug] 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..2003c8c6e210e 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 @@ -16,7 +16,7 @@ import ( "github.com/DataDog/datadog-agent/comp/core/tagger/types" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awskubernetes "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/kubernetes" + awskubernetes "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/kubernetes" "github.com/DataDog/datadog-agent/test/new-e2e/tests/otel/utils" ) @@ -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..f97d9dfa62cb8 100644 --- a/test/new-e2e/tests/otel/otel-agent/infraattributes_test.go +++ b/test/new-e2e/tests/otel/otel-agent/infraattributes_test.go @@ -15,7 +15,7 @@ import ( "github.com/DataDog/datadog-agent/comp/core/tagger/types" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awskubernetes "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/kubernetes" + awskubernetes "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/kubernetes" "github.com/DataDog/datadog-agent/test/new-e2e/tests/otel/utils" ) @@ -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..ee33ec9d6cbac 100644 --- a/test/new-e2e/tests/otel/otel-agent/minimal_test.go +++ b/test/new-e2e/tests/otel/otel-agent/minimal_test.go @@ -15,7 +15,7 @@ import ( "github.com/DataDog/datadog-agent/comp/core/tagger/types" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awskubernetes "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/kubernetes" + awskubernetes "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/kubernetes" "github.com/DataDog/datadog-agent/test/new-e2e/tests/otel/utils" ) @@ -32,8 +32,8 @@ var minimalProvidedConfig string //go:embed testdata/minimal-full-config.yml var minimalFullConfig string -//go:embed testdata/minimal-sources.json -var minimalSources string +//go:embed testdata/sources.json +var sources string func TestOTelAgentMinimal(t *testing.T) { values := ` @@ -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{ @@ -82,7 +82,7 @@ func (s *minimalTestSuite) TestOTelAgentInstalled() { } func (s *minimalTestSuite) TestOTelFlareExtensionResponse() { - utils.TestOTelFlareExtensionResponse(s, minimalProvidedConfig, minimalFullConfig, minimalSources) + utils.TestOTelFlareExtensionResponse(s, minimalProvidedConfig, minimalFullConfig, sources) } func (s *minimalTestSuite) TestOTelFlareFiles() { diff --git a/test/new-e2e/tests/otel/otel-agent/no_dd_exporter_test.go b/test/new-e2e/tests/otel/otel-agent/no_dd_exporter_test.go new file mode 100644 index 0000000000000..471e0c41d9dbd --- /dev/null +++ b/test/new-e2e/tests/otel/otel-agent/no_dd_exporter_test.go @@ -0,0 +1,58 @@ +// 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 otelagent contains e2e otel agent tests +package otelagent + +import ( + _ "embed" + "testing" + + "github.com/DataDog/test-infra-definitions/components/datadog/kubernetesagentparams" + + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" + awskubernetes "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/kubernetes" + "github.com/DataDog/datadog-agent/test/new-e2e/tests/otel/utils" +) + +type noDDExporterTestSuite struct { + e2e.BaseSuite[environments.Kubernetes] +} + +//go:embed config/no-dd-exporter.yml +var noDDExporterConfig string + +//go:embed testdata/no-dd-exporter-provided-config.yml +var noDDExporterProvidedConfig string + +//go:embed testdata/no-dd-exporter-full-config.yml +var noDDExporterFullConfig string + +func TestOTelAgentWithNoDDExporter(t *testing.T) { + values := ` +datadog: + logs: + containerCollectAll: false + containerCollectUsingFiles: false +` + t.Parallel() + e2e.Run(t, &noDDExporterTestSuite{}, + e2e.WithProvisioner( + awskubernetes.KindProvisioner( + awskubernetes.WithAgentOptions( + kubernetesagentparams.WithHelmValues(values), + kubernetesagentparams.WithOTelAgent(), + kubernetesagentparams.WithOTelConfig(noDDExporterConfig), + )))) +} + +func (s *noDDExporterTestSuite) TestOTelAgentInstalled() { + utils.TestOTelAgentInstalled(s) +} + +func (s *noDDExporterTestSuite) TestOTelFlareExtensionResponse() { + utils.TestOTelFlareExtensionResponse(s, noDDExporterProvidedConfig, noDDExporterFullConfig, sources) +} 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..6dee2b5052230 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 @@ -12,7 +12,7 @@ import ( "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awskubernetes "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/kubernetes" + awskubernetes "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/kubernetes" "github.com/DataDog/datadog-agent/test/new-e2e/tests/otel/utils" ) @@ -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..6fc08ce59c78b 100644 --- a/test/new-e2e/tests/otel/otel-agent/sampling_test.go +++ b/test/new-e2e/tests/otel/otel-agent/sampling_test.go @@ -14,7 +14,7 @@ import ( "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awskubernetes "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/kubernetes" + awskubernetes "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/kubernetes" "github.com/DataDog/datadog-agent/test/new-e2e/tests/otel/utils" ) @@ -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/otel-agent/testdata/minimal-full-config.yml b/test/new-e2e/tests/otel/otel-agent/testdata/minimal-full-config.yml index 5156e26fabee3..633b5e66522f6 100644 --- a/test/new-e2e/tests/otel/otel-agent/testdata/minimal-full-config.yml +++ b/test/new-e2e/tests/otel/otel-agent/testdata/minimal-full-config.yml @@ -27,6 +27,7 @@ exporters: host_metadata: enabled: false hostname_source: config_or_system + reporter_period: 30m0s tags: [] hostname: otelcol-docker http2_ping_timeout: 0s diff --git a/test/new-e2e/tests/otel/otel-agent/testdata/minimal-provided-config.yml b/test/new-e2e/tests/otel/otel-agent/testdata/minimal-provided-config.yml index af090ab56d217..e018b94bf7d23 100644 --- a/test/new-e2e/tests/otel/otel-agent/testdata/minimal-provided-config.yml +++ b/test/new-e2e/tests/otel/otel-agent/testdata/minimal-provided-config.yml @@ -27,6 +27,7 @@ exporters: host_metadata: enabled: false hostname_source: config_or_system + reporter_period: 30m0s tags: [] hostname: otelcol-docker http2_ping_timeout: 0s diff --git a/test/new-e2e/tests/otel/otel-agent/testdata/no-dd-exporter-full-config.yml b/test/new-e2e/tests/otel/otel-agent/testdata/no-dd-exporter-full-config.yml new file mode 100644 index 0000000000000..e0276e1bb2aa3 --- /dev/null +++ b/test/new-e2e/tests/otel/otel-agent/testdata/no-dd-exporter-full-config.yml @@ -0,0 +1,281 @@ +connectors: {} +exporters: + datadog: + api: + fail_on_invalid_key: false + key: '[REDACTED]' + site: datadoghq.com + auth: null + compression: "" + cookies: null + disable_keep_alives: false + endpoint: "" + headers: {} + host_metadata: + enabled: false + hostname_source: config_or_system + reporter_period: 30m0s + tags: [] + hostname: "" + http2_ping_timeout: 0s + http2_read_idle_timeout: 0s + idle_conn_timeout: 1m30s + logs: + batch_wait: 5 + compression_level: 6 + dialer: + timeout: 0s + dump_payloads: false + use_compression: true + max_conns_per_host: 0 + max_idle_conns: 100 + max_idle_conns_per_host: 0 + metrics: + delta_ttl: 3600 + dialer: + timeout: 0s + histograms: + mode: distributions + send_aggregation_metrics: false + send_count_sum_metrics: false + instrumentation_scope_metadata_as_tags: false + resource_attributes_as_tags: false + summaries: + mode: gauges + sums: + cumulative_monotonic_mode: to_delta + initial_cumulative_monotonic_value: auto + only_metadata: false + proxy_url: "" + read_buffer_size: 0 + retry_on_failure: + enabled: true + initial_interval: 5s + max_elapsed_time: 5m0s + max_interval: 30s + multiplier: 1.5 + randomization_factor: 0.5 + sending_queue: + enabled: true + num_consumers: 10 + queue_size: 1000 + storage: null + timeout: 15s + tls: + ca_file: "" + ca_pem: '[REDACTED]' + cert_file: "" + cert_pem: '[REDACTED]' + cipher_suites: [] + include_system_ca_certs_pool: false + insecure: false + insecure_skip_verify: false + key_file: "" + key_pem: '[REDACTED]' + max_version: "" + min_version: "" + reload_interval: 0s + server_name_override: "" + traces: + compute_stats_by_span_kind: false + compute_top_level_by_span_kind: true + dialer: + timeout: 0s + ignore_resources: [] + peer_service_aggregation: false + peer_tags: [] + peer_tags_aggregation: false + span_name_as_resource_name: false + span_name_remappings: {} + trace_buffer: 0 + write_buffer_size: 0 + debug: + sampling_initial: 2 + sampling_thereafter: 1 + use_internal_logger: true + verbosity: Detailed +extensions: + ddflare/dd-autoconfigured: + auth: null + compression_algorithms: [] + cors: null + endpoint: localhost:7777 + idle_timeout: 0s + include_metadata: false + max_request_body_size: 0 + read_header_timeout: 0s + read_timeout: 0s + response_headers: {} + tls: null + write_timeout: 0s + health_check/dd-autoconfigured: + auth: null + check_collector_pipeline: + enabled: false + exporter_failure_threshold: 5 + interval: 5m + compression_algorithms: [] + cors: null + endpoint: localhost:13133 + idle_timeout: 0s + include_metadata: false + max_request_body_size: 0 + path: / + read_header_timeout: 0s + read_timeout: 0s + response_body: null + response_headers: {} + tls: null + write_timeout: 0s + pprof/dd-autoconfigured: + block_profile_fraction: 0 + dialer: + timeout: 0s + endpoint: localhost:1777 + mutex_profile_fraction: 0 + save_to_file: "" + zpages/dd-autoconfigured: + auth: null + compression_algorithms: [] + cors: null + endpoint: localhost:55679 + idle_timeout: 0s + include_metadata: false + max_request_body_size: 0 + read_header_timeout: 0s + read_timeout: 0s + response_headers: {} + tls: null + write_timeout: 0s +processors: {} +receivers: + otlp: + protocols: + grpc: + auth: null + dialer: + timeout: 0s + endpoint: 0.0.0.0:4317 + include_metadata: false + keepalive: null + max_concurrent_streams: 0 + max_recv_msg_size_mib: 0 + read_buffer_size: 524288 + tls: null + transport: tcp + write_buffer_size: 0 + http: + auth: null + compression_algorithms: [] + cors: null + endpoint: 0.0.0.0:4318 + idle_timeout: 0s + include_metadata: false + logs_url_path: /v1/logs + max_request_body_size: 0 + metrics_url_path: /v1/metrics + read_header_timeout: 0s + read_timeout: 0s + response_headers: {} + tls: null + traces_url_path: /v1/traces + write_timeout: 0s + prometheus/dd-autoconfigured: + config: + global: + evaluation_interval: 1m + scrape_interval: 1m + scrape_protocols: + - OpenMetricsText1.0.0 + - OpenMetricsText0.0.1 + - PrometheusText0.0.4 + scrape_timeout: 10s + runtime: + gogc: 75 + scrape_configs: + - enable_compression: true + enable_http2: true + follow_redirects: true + honor_timestamps: true + job_name: datadog-agent + metrics_path: /metrics + scheme: http + scrape_interval: 10s + scrape_protocols: + - OpenMetricsText1.0.0 + - OpenMetricsText0.0.1 + - PrometheusText0.0.4 + scrape_timeout: 10s + static_configs: + - targets: + - 0.0.0.0:8888 + track_timestamps_staleness: false + report_extra_scrape_metrics: false + start_time_metric_regex: "" + target_allocator: null + trim_metric_suffixes: false + use_start_time_metric: false +service: + extensions: + - pprof/dd-autoconfigured + - zpages/dd-autoconfigured + - health_check/dd-autoconfigured + - ddflare/dd-autoconfigured + pipelines: + logs: + exporters: + - debug + processors: [] + receivers: + - otlp + metrics: + exporters: + - debug + processors: [] + receivers: + - otlp + metrics/dd-autoconfigured/datadog: + exporters: + - datadog + processors: [] + receivers: + - prometheus/dd-autoconfigured + traces: + exporters: + - debug + processors: [] + receivers: + - otlp + telemetry: + logs: + development: false + disable_caller: false + disable_stacktrace: false + encoding: console + error_output_paths: + - stderr + initial_fields: {} + level: info + output_paths: + - stderr + processors: [] + sampling: + enabled: true + initial: 10 + thereafter: 100 + tick: 10s + metrics: + address: "" + level: Normal + readers: + - pull: + exporter: + additionalproperties: null + prometheus: + host: localhost + port: 8888 + resource: {} + traces: + level: Basic + processors: [] + propagators: [] diff --git a/test/new-e2e/tests/otel/otel-agent/testdata/no-dd-exporter-provided-config.yml b/test/new-e2e/tests/otel/otel-agent/testdata/no-dd-exporter-provided-config.yml new file mode 100644 index 0000000000000..b97863a32c71c --- /dev/null +++ b/test/new-e2e/tests/otel/otel-agent/testdata/no-dd-exporter-provided-config.yml @@ -0,0 +1,184 @@ +connectors: {} +exporters: + datadog: + api: + fail_on_invalid_key: false + key: '[REDACTED]' + site: datadoghq.com + auth: null + compression: "" + cookies: null + disable_keep_alives: false + endpoint: "" + headers: {} + host_metadata: + enabled: false + hostname_source: config_or_system + reporter_period: 30m0s + tags: [] + hostname: "" + http2_ping_timeout: 0s + http2_read_idle_timeout: 0s + idle_conn_timeout: 1m30s + logs: + batch_wait: 5 + compression_level: 6 + dialer: + timeout: 0s + dump_payloads: false + use_compression: true + max_conns_per_host: 0 + max_idle_conns: 100 + max_idle_conns_per_host: 0 + metrics: + delta_ttl: 3600 + dialer: + timeout: 0s + histograms: + mode: distributions + send_aggregation_metrics: false + send_count_sum_metrics: false + instrumentation_scope_metadata_as_tags: false + resource_attributes_as_tags: false + summaries: + mode: gauges + sums: + cumulative_monotonic_mode: to_delta + initial_cumulative_monotonic_value: auto + only_metadata: false + proxy_url: "" + read_buffer_size: 0 + retry_on_failure: + enabled: true + initial_interval: 5s + max_elapsed_time: 5m0s + max_interval: 30s + multiplier: 1.5 + randomization_factor: 0.5 + sending_queue: + enabled: true + num_consumers: 10 + queue_size: 1000 + storage: null + timeout: 15s + tls: + ca_file: "" + ca_pem: '[REDACTED]' + cert_file: "" + cert_pem: '[REDACTED]' + cipher_suites: [] + include_system_ca_certs_pool: false + insecure: false + insecure_skip_verify: false + key_file: "" + key_pem: '[REDACTED]' + max_version: "" + min_version: "" + reload_interval: 0s + server_name_override: "" + traces: + compute_stats_by_span_kind: false + compute_top_level_by_span_kind: true + dialer: + timeout: 0s + ignore_resources: [] + peer_service_aggregation: false + peer_tags: [] + peer_tags_aggregation: false + span_name_as_resource_name: false + span_name_remappings: {} + trace_buffer: 0 + write_buffer_size: 0 + debug: + sampling_initial: 2 + sampling_thereafter: 1 + use_internal_logger: true + verbosity: Detailed +extensions: {} +processors: {} +receivers: + otlp: + protocols: + grpc: + auth: null + dialer: + timeout: 0s + endpoint: 0.0.0.0:4317 + include_metadata: false + keepalive: null + max_concurrent_streams: 0 + max_recv_msg_size_mib: 0 + read_buffer_size: 524288 + tls: null + transport: tcp + write_buffer_size: 0 + http: + auth: null + compression_algorithms: [] + cors: null + endpoint: 0.0.0.0:4318 + idle_timeout: 0s + include_metadata: false + logs_url_path: /v1/logs + max_request_body_size: 0 + metrics_url_path: /v1/metrics + read_header_timeout: 0s + read_timeout: 0s + response_headers: {} + tls: null + traces_url_path: /v1/traces + write_timeout: 0s +service: + extensions: [] + pipelines: + logs: + exporters: + - debug + processors: [] + receivers: + - otlp + metrics: + exporters: + - debug + processors: [] + receivers: + - otlp + traces: + exporters: + - debug + processors: [] + receivers: + - otlp + telemetry: + logs: + development: false + disable_caller: false + disable_stacktrace: false + encoding: console + error_output_paths: + - stderr + initial_fields: {} + level: info + output_paths: + - stderr + processors: [] + sampling: + enabled: true + initial: 10 + thereafter: 100 + tick: 10s + metrics: + address: "" + level: Normal + readers: + - pull: + exporter: + additionalproperties: null + prometheus: + host: localhost + port: 8888 + resource: {} + traces: + level: Basic + processors: [] + propagators: [] \ No newline at end of file diff --git a/test/new-e2e/tests/otel/otel-agent/testdata/minimal-sources.json b/test/new-e2e/tests/otel/otel-agent/testdata/sources.json similarity index 100% rename from test/new-e2e/tests/otel/otel-agent/testdata/minimal-sources.json rename to test/new-e2e/tests/otel/otel-agent/testdata/sources.json 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..dff8498f51fa0 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 @@ -12,7 +12,7 @@ import ( "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awskubernetes "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/kubernetes" + awskubernetes "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/kubernetes" "github.com/DataDog/datadog-agent/test/new-e2e/tests/otel/utils" ) @@ -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..acbf90ad5a02a 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 @@ -14,7 +14,7 @@ import ( "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awskubernetes "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/kubernetes" + awskubernetes "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/kubernetes" "github.com/DataDog/datadog-agent/test/new-e2e/tests/otel/utils" ) @@ -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..9be18d44c52e3 100644 --- a/test/new-e2e/tests/otel/otlp-ingest/pipelines_test.go +++ b/test/new-e2e/tests/otel/otlp-ingest/pipelines_test.go @@ -14,7 +14,7 @@ import ( "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awskubernetes "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/kubernetes" + awskubernetes "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/kubernetes" "github.com/DataDog/datadog-agent/test/new-e2e/tests/otel/utils" ) @@ -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..74f5bcfa679d0 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 @@ -12,7 +12,7 @@ import ( "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awskubernetes "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/kubernetes" + awskubernetes "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/kubernetes" "github.com/DataDog/datadog-agent/test/new-e2e/tests/otel/utils" ) @@ -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/new-e2e/tests/otel/utils/config_utils.go b/test/new-e2e/tests/otel/utils/config_utils.go index ddee2793648fa..3d10d5267bc2e 100644 --- a/test/new-e2e/tests/otel/utils/config_utils.go +++ b/test/new-e2e/tests/otel/utils/config_utils.go @@ -211,13 +211,15 @@ func validateConfigs(t *testing.T, expectedCfg string, actualCfg string) { // Traces, metrics and logs endpoints are set dynamically to the fake intake address in the config // These endpoints vary from test to test and should be ignored in the comparison exps, _ := actualConfRaw["exporters"].(map[string]any) - ddExp, _ := exps["datadog"].(map[string]any) - tcfg := ddExp["traces"].(map[string]any) - delete(tcfg, "endpoint") - mcfg := ddExp["metrics"].(map[string]any) - delete(mcfg, "endpoint") - lcfg := ddExp["logs"].(map[string]any) - delete(lcfg, "endpoint") + if ddExp, ok := exps["datadog"]; ok { + ddExpCfg := ddExp.(map[string]any) + tcfg := ddExpCfg["traces"].(map[string]any) + delete(tcfg, "endpoint") + mcfg := ddExpCfg["metrics"].(map[string]any) + delete(mcfg, "endpoint") + lcfg := ddExpCfg["logs"].(map[string]any) + delete(lcfg, "endpoint") + } actualCfgBytes, err := yaml.Marshal(actualConfRaw) require.NoError(t, err) diff --git a/test/new-e2e/tests/process/docker_test.go b/test/new-e2e/tests/process/docker_test.go index c33a48f0a7473..536529b180750 100644 --- a/test/new-e2e/tests/process/docker_test.go +++ b/test/new-e2e/tests/process/docker_test.go @@ -16,7 +16,7 @@ import ( "github.com/DataDog/datadog-agent/test/fakeintake/aggregator" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awsdocker "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/docker" + awsdocker "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/docker" ) type dockerTestSuite struct { diff --git a/test/new-e2e/tests/process/ecs_test.go b/test/new-e2e/tests/process/ecs_test.go index 45881701fde06..a1c1e3d1b9e44 100644 --- a/test/new-e2e/tests/process/ecs_test.go +++ b/test/new-e2e/tests/process/ecs_test.go @@ -21,9 +21,10 @@ import ( "github.com/DataDog/datadog-agent/test/fakeintake/aggregator" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/ecs" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/ecs" ) type ECSEC2Suite struct { @@ -34,7 +35,7 @@ type ecsCPUStressEnv struct { environments.ECS } -func ecsEC2CPUStressProvisioner(runInCoreAgent bool) e2e.PulumiEnvRunFunc[ecsCPUStressEnv] { +func ecsEC2CPUStressProvisioner(runInCoreAgent bool) provisioners.PulumiEnvRunFunc[ecsCPUStressEnv] { return func(ctx *pulumi.Context, env *ecsCPUStressEnv) error { awsEnv, err := aws.NewEnvironment(ctx) if err != nil { @@ -65,7 +66,7 @@ func TestECSEC2TestSuite(t *testing.T) { t.Parallel() s := ECSEC2Suite{} e2eParams := []e2e.SuiteOption{e2e.WithProvisioner( - e2e.NewTypedPulumiProvisioner("ecsEC2CPUStress", ecsEC2CPUStressProvisioner(false), nil))} + provisioners.NewTypedPulumiProvisioner("ecsEC2CPUStress", ecsEC2CPUStressProvisioner(false), nil))} e2e.Run(t, &s, e2eParams...) } @@ -98,7 +99,7 @@ func TestECSEC2CoreAgentSuite(t *testing.T) { t.Parallel() s := ECSEC2CoreAgentSuite{} e2eParams := []e2e.SuiteOption{e2e.WithProvisioner( - e2e.NewTypedPulumiProvisioner("ecsEC2CoreAgentCPUStress", ecsEC2CPUStressProvisioner(true), nil))} + provisioners.NewTypedPulumiProvisioner("ecsEC2CoreAgentCPUStress", ecsEC2CPUStressProvisioner(true), nil))} e2e.Run(t, &s, e2eParams...) } diff --git a/test/new-e2e/tests/process/fargate_test.go b/test/new-e2e/tests/process/fargate_test.go index 709139df4cdb0..11aa844f1170a 100644 --- a/test/new-e2e/tests/process/fargate_test.go +++ b/test/new-e2e/tests/process/fargate_test.go @@ -15,6 +15,7 @@ import ( "github.com/pulumi/pulumi/sdk/v3/go/pulumi" "github.com/stretchr/testify/assert" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/runner" fakeintakeComp "github.com/DataDog/test-infra-definitions/components/datadog/fakeintake" @@ -25,14 +26,14 @@ import ( "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/ecs" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/ecs" ) type ECSFargateSuite struct { e2e.BaseSuite[environments.ECS] } -func getFargateProvisioner(configMap runner.ConfigMap) e2e.TypedProvisioner[environments.ECS] { +func getFargateProvisioner(configMap runner.ConfigMap) provisioners.TypedProvisioner[environments.ECS] { return ecs.Provisioner( ecs.WithECSOptions(tifEcs.WithFargateCapacityProvider()), ecs.WithFargateWorkloadApp(func(e aws.Environment, clusterArn pulumi.StringInput, apiKeySSMParamName pulumi.StringInput, fakeIntake *fakeintakeComp.Fakeintake) (*ecsComp.Workload, error) { @@ -73,14 +74,27 @@ func (s *ECSFargateSuite) TestProcessCheck() { assertContainersCollected(t, payloads, []string{"stress-ng"}) } -func (s *ECSFargateSuite) TestProcessCheckInCoreAgent() { - t := s.T() +type ECSFargateCoreAgentSuite struct { + e2e.BaseSuite[environments.ECS] +} + +func TestECSFargateCoreAgentTestSuite(t *testing.T) { + t.Parallel() + s := ECSFargateCoreAgentSuite{} extraConfig := runner.ConfigMap{ "ddagent:extraEnvVars": auto.ConfigValue{Value: "DD_PROCESS_CONFIG_RUN_IN_CORE_AGENT_ENABLED=true"}, } + e2eParams := []e2e.SuiteOption{e2e.WithProvisioner( + getFargateProvisioner(extraConfig), + ), + } + + e2e.Run(t, &s, e2eParams...) +} - s.UpdateEnv(getFargateProvisioner(extraConfig)) +func (s *ECSFargateCoreAgentSuite) TestProcessCheckInCoreAgent() { + t := s.T() // Flush fake intake to remove any payloads which may have s.Env().FakeIntake.Client().FlushServerAndResetAggregators() diff --git a/test/new-e2e/tests/process/k8s_test.go b/test/new-e2e/tests/process/k8s_test.go index 1533bea01cb36..8d72e17fb535f 100644 --- a/test/new-e2e/tests/process/k8s_test.go +++ b/test/new-e2e/tests/process/k8s_test.go @@ -30,7 +30,7 @@ import ( "github.com/DataDog/datadog-agent/test/new-e2e/pkg/components" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awskubernetes "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/kubernetes" + awskubernetes "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/kubernetes" ) // helmTemplate define the embedded minimal configuration for NPM @@ -156,21 +156,32 @@ func (s *K8sSuite) TestProcessDiscoveryCheck() { assertProcessDiscoveryCollected(t, payloads, "stress-ng-cpu [run]") } -func (s *K8sSuite) TestProcessCheckInCoreAgent() { - t := s.T() +type K8sCoreAgentSuite struct { + e2e.BaseSuite[environments.Kubernetes] +} +func TestK8sCoreAgentTestSuite(t *testing.T) { + t.Parallel() helmValues, err := createHelmValues(helmConfig{ ProcessCollection: true, RunInCoreAgent: true, }) require.NoError(t, err) - s.UpdateEnv(awskubernetes.KindProvisioner( - awskubernetes.WithWorkloadApp(func(e config.Env, kubeProvider *kubernetes.Provider) (*kubeComp.Workload, error) { - return cpustress.K8sAppDefinition(e, kubeProvider, "workload-stress") - }), - awskubernetes.WithAgentOptions(kubernetesagentparams.WithHelmValues(helmValues)), - )) + options := []e2e.SuiteOption{ + e2e.WithProvisioner(awskubernetes.KindProvisioner( + awskubernetes.WithWorkloadApp(func(e config.Env, kubeProvider *kubernetes.Provider) (*kubeComp.Workload, error) { + return cpustress.K8sAppDefinition(e, kubeProvider, "workload-stress") + }), + awskubernetes.WithAgentOptions(kubernetesagentparams.WithHelmValues(helmValues)), + )), + } + + e2e.Run(t, &K8sCoreAgentSuite{}, options...) +} + +func (s *K8sCoreAgentSuite) TestProcessCheckInCoreAgent() { + t := s.T() var status AgentStatus defer func() { @@ -207,7 +218,7 @@ func (s *K8sSuite) TestProcessCheckInCoreAgent() { assertContainersNotCollected(t, payloads, []string{"process-agent"}) } -func (s *K8sSuite) TestProcessCheckInCoreAgentWithNPM() { +func (s *K8sCoreAgentSuite) TestProcessCheckInCoreAgentWithNPM() { t := s.T() helmValues, err := createHelmValues(helmConfig{ diff --git a/test/new-e2e/tests/process/linux_test.go b/test/new-e2e/tests/process/linux_test.go index 7b5e093d5bf83..1934d33d6cbd6 100644 --- a/test/new-e2e/tests/process/linux_test.go +++ b/test/new-e2e/tests/process/linux_test.go @@ -16,7 +16,7 @@ import ( "github.com/DataDog/datadog-agent/test/fakeintake/aggregator" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" ) type linuxTestSuite struct { @@ -117,7 +117,7 @@ func (s *linuxTestSuite) TestProcessChecksInCoreAgent() { // Verify that the process agent is not running assert.EventuallyWithT(t, func(c *assert.CollectT) { - status := s.Env().RemoteHost.MustExecute("/opt/datadog-agent/embedded/bin/process-agent status") + status := s.Env().RemoteHost.MustExecute("sudo /opt/datadog-agent/embedded/bin/process-agent status") assert.Contains(c, status, "The Process Agent is not running") }, 1*time.Minute, 5*time.Second) diff --git a/test/new-e2e/tests/process/windows_test.go b/test/new-e2e/tests/process/windows_test.go index 5c7f7ef84711b..ba27cfc014703 100644 --- a/test/new-e2e/tests/process/windows_test.go +++ b/test/new-e2e/tests/process/windows_test.go @@ -19,7 +19,7 @@ import ( "github.com/DataDog/datadog-agent/test/fakeintake/aggregator" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" ) type windowsTestSuite struct { diff --git a/test/new-e2e/tests/remote-config/rc_ssl_config_test.go b/test/new-e2e/tests/remote-config/rc_ssl_config_test.go index 6fadad1dc47ff..b542f5fb18e36 100644 --- a/test/new-e2e/tests/remote-config/rc_ssl_config_test.go +++ b/test/new-e2e/tests/remote-config/rc_ssl_config_test.go @@ -16,7 +16,7 @@ import ( "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" ) type sslConfigSuite struct { diff --git a/test/new-e2e/tests/remote-config/tracer_test.go b/test/new-e2e/tests/remote-config/tracer_test.go index 6abc19e49c0ad..51150329e3caa 100644 --- a/test/new-e2e/tests/remote-config/tracer_test.go +++ b/test/new-e2e/tests/remote-config/tracer_test.go @@ -16,7 +16,7 @@ import ( "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" ) type tracerSuite struct { diff --git a/test/new-e2e/tests/security-agent-functional/security_agent_test.go b/test/new-e2e/tests/security-agent-functional/security_agent_test.go index 1b693e1b43b21..81f737f39f953 100644 --- a/test/new-e2e/tests/security-agent-functional/security_agent_test.go +++ b/test/new-e2e/tests/security-agent-functional/security_agent_test.go @@ -19,7 +19,7 @@ import ( "github.com/DataDog/datadog-agent/pkg/util/testutil/flake" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" "github.com/DataDog/datadog-agent/test/new-e2e/tests/windows" windowsAgent "github.com/DataDog/datadog-agent/test/new-e2e/tests/windows/common/agent" ) diff --git a/test/new-e2e/tests/sysprobe-functional/apmtags_test.go b/test/new-e2e/tests/sysprobe-functional/apmtags_test.go index 3aff8ab90c5ae..7895154561a10 100644 --- a/test/new-e2e/tests/sysprobe-functional/apmtags_test.go +++ b/test/new-e2e/tests/sysprobe-functional/apmtags_test.go @@ -23,7 +23,7 @@ import ( "github.com/DataDog/datadog-agent/test/new-e2e/pkg/components" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awsHostWindows "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host/windows" + awsHostWindows "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host/windows" "github.com/DataDog/datadog-agent/test/new-e2e/tests/windows" ) diff --git a/test/new-e2e/tests/sysprobe-functional/sysprobe_test.go b/test/new-e2e/tests/sysprobe-functional/sysprobe_test.go index 888f9427e4413..710f3541de0fc 100644 --- a/test/new-e2e/tests/sysprobe-functional/sysprobe_test.go +++ b/test/new-e2e/tests/sysprobe-functional/sysprobe_test.go @@ -14,14 +14,15 @@ import ( "testing" "time" + componentsos "github.com/DataDog/test-infra-definitions/components/os" + "github.com/DataDog/test-infra-definitions/scenarios/aws/ec2" + "github.com/stretchr/testify/require" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" "github.com/DataDog/datadog-agent/test/new-e2e/tests/windows" windowsAgent "github.com/DataDog/datadog-agent/test/new-e2e/tests/windows/common/agent" - componentsos "github.com/DataDog/test-infra-definitions/components/os" - "github.com/DataDog/test-infra-definitions/scenarios/aws/ec2" - "github.com/stretchr/testify/require" ) type vmSuite struct { diff --git a/test/new-e2e/tests/windows/domain-test/domain_test.go b/test/new-e2e/tests/windows/domain-test/domain_test.go index 698d45fd0c138..47c779edf3acb 100644 --- a/test/new-e2e/tests/windows/domain-test/domain_test.go +++ b/test/new-e2e/tests/windows/domain-test/domain_test.go @@ -7,21 +7,24 @@ package domain import ( "fmt" - awsHostWindows "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host/windows" - "github.com/DataDog/datadog-agent/test/new-e2e/tests/windows" - "github.com/DataDog/test-infra-definitions/components/activedirectory" "path/filepath" "reflect" "testing" "time" + "github.com/DataDog/test-infra-definitions/components/activedirectory" + + awsHostWindows "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host/windows" + "github.com/DataDog/datadog-agent/test/new-e2e/tests/windows" + + "github.com/stretchr/testify/assert" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" platformCommon "github.com/DataDog/datadog-agent/test/new-e2e/tests/agent-platform/common" windowsCommon "github.com/DataDog/datadog-agent/test/new-e2e/tests/windows/common" windowsAgent "github.com/DataDog/datadog-agent/test/new-e2e/tests/windows/common/agent" - "github.com/DataDog/datadog-agent/test/new-e2e/tests/windows/install-test" - "github.com/stretchr/testify/assert" + installtest "github.com/DataDog/datadog-agent/test/new-e2e/tests/windows/install-test" ) const ( @@ -32,8 +35,9 @@ const ( func TestInstallsOnDomainController(t *testing.T) { suites := []e2e.Suite[environments.WindowsHost]{ - &testInstallSuite{}, + &testBasicInstallSuite{}, &testUpgradeSuite{}, + &testInstallUserSyntaxSuite{}, } for _, suite := range suites { @@ -53,12 +57,12 @@ type testInstallSuite struct { windows.BaseAgentInstallerSuite[environments.WindowsHost] } -func (suite *testInstallSuite) TestGivenDomainUserCanInstallAgent() { +func (suite *testInstallSuite) testGivenDomainUserCanInstallAgent(username string) { host := suite.Env().RemoteHost _, err := suite.InstallAgent(host, windowsAgent.WithPackage(suite.AgentPackage), - windowsAgent.WithAgentUser(fmt.Sprintf("%s\\%s", TestDomain, TestUser)), + windowsAgent.WithAgentUser(username), windowsAgent.WithAgentUserPassword(fmt.Sprintf("\"%s\"", TestPassword)), windowsAgent.WithValidAPIKey(), windowsAgent.WithFakeIntake(suite.Env().FakeIntake), @@ -81,6 +85,22 @@ func (suite *testInstallSuite) TestGivenDomainUserCanInstallAgent() { }, 5*time.Minute, 10*time.Second) } +type testBasicInstallSuite struct { + testInstallSuite +} + +func (suite *testBasicInstallSuite) TestGivenDomainUserCanInstallAgent() { + suite.testGivenDomainUserCanInstallAgent(fmt.Sprintf("%s\\%s", TestDomain, TestUser)) +} + +type testInstallUserSyntaxSuite struct { + testInstallSuite +} + +func (suite *testInstallUserSyntaxSuite) TestGivenDomainUserCanInstallAgent() { + suite.testGivenDomainUserCanInstallAgent(fmt.Sprintf("%s@%s", TestUser, TestDomain)) +} + type testUpgradeSuite struct { windows.BaseAgentInstallerSuite[environments.WindowsHost] } diff --git a/test/new-e2e/tests/windows/fips-test/fips_test.go b/test/new-e2e/tests/windows/fips-test/fips_test.go index e46be55c5a941..48313099eed29 100644 --- a/test/new-e2e/tests/windows/fips-test/fips_test.go +++ b/test/new-e2e/tests/windows/fips-test/fips_test.go @@ -13,7 +13,7 @@ import ( "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awsHostWindows "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host/windows" + awsHostWindows "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host/windows" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/e2e/client" "github.com/DataDog/datadog-agent/test/new-e2e/tests/windows" windowsCommon "github.com/DataDog/datadog-agent/test/new-e2e/tests/windows/common" diff --git a/test/new-e2e/tests/windows/install-test/base.go b/test/new-e2e/tests/windows/install-test/base.go index 566ee7c6225cc..958c171160f05 100644 --- a/test/new-e2e/tests/windows/install-test/base.go +++ b/test/new-e2e/tests/windows/install-test/base.go @@ -15,7 +15,7 @@ import ( "github.com/DataDog/datadog-agent/test/new-e2e/pkg/components" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awsHostWindows "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host/windows" + awsHostWindows "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host/windows" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/runner" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/runner/parameters" "github.com/DataDog/datadog-agent/test/new-e2e/tests/windows" diff --git a/test/new-e2e/tests/windows/install-test/installtester.go b/test/new-e2e/tests/windows/install-test/installtester.go index e0fbee6886600..178782f8892a7 100644 --- a/test/new-e2e/tests/windows/install-test/installtester.go +++ b/test/new-e2e/tests/windows/install-test/installtester.go @@ -14,7 +14,7 @@ import ( "time" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/components" - "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" + utilscommon "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/common" agentClient "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/e2e/client" agentClientParams "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/e2e/client/agentclientparams" "github.com/DataDog/datadog-agent/test/new-e2e/tests/agent-platform/common" @@ -51,7 +51,7 @@ type Tester struct { type TesterOption func(*Tester) // NewTester creates a new Tester -func NewTester(context e2e.Context, host *components.RemoteHost, opts ...TesterOption) (*Tester, error) { +func NewTester(context utilscommon.Context, host *components.RemoteHost, opts ...TesterOption) (*Tester, error) { t := &Tester{} tt := context.T() @@ -536,31 +536,6 @@ func (t *Tester) testInstalledFilePermissions(tt *testing.T, ddAgentUserIdentity }) } - // expect to have standard inherited permissions, plus an explciit ACE for ddagentuser - embeddedPaths := []string{ - filepath.Join(t.expectedInstallPath, "embedded3"), - } - if t.ExpectPython2Installed() { - embeddedPaths = append(embeddedPaths, - filepath.Join(t.expectedInstallPath, "embedded2"), - ) - } - agentUserFullAccessDirRule := windows.NewExplicitAccessRuleWithFlags( - ddAgentUserIdentity, - windows.FileFullControl, - windows.AccessControlTypeAllow, - windows.InheritanceFlagsContainer|windows.InheritanceFlagsObject, - windows.PropagationFlagsNone, - ) - for _, path := range embeddedPaths { - out, err := windows.GetSecurityInfoForPath(t.host, path) - require.NoError(tt, err) - if !windows.IsIdentityLocalSystem(ddAgentUserIdentity) { - windows.AssertContainsEqualable(tt, out.Access, agentUserFullAccessDirRule, "%s should have full access rule for %s", path, ddAgentUserIdentity) - } - assert.False(tt, out.AreAccessRulesProtected, "%s should inherit access rules", path) - } - // ensure the agent user does not have an ACE on the install dir out, err := windows.GetSecurityInfoForPath(t.host, t.expectedInstallPath) require.NoError(tt, err) diff --git a/test/new-e2e/tests/windows/powershell-module-test/install_test.go b/test/new-e2e/tests/windows/powershell-module-test/install_test.go index 1e289c567cb02..1bf62393b9e48 100644 --- a/test/new-e2e/tests/windows/powershell-module-test/install_test.go +++ b/test/new-e2e/tests/windows/powershell-module-test/install_test.go @@ -14,14 +14,15 @@ import ( "testing" "time" + "github.com/DataDog/test-infra-definitions/components/os" + "github.com/DataDog/test-infra-definitions/scenarios/aws/ec2" + "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host" + awshost "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host" "github.com/DataDog/datadog-agent/test/new-e2e/tests/agent-platform/common" windowsCommon "github.com/DataDog/datadog-agent/test/new-e2e/tests/windows/common" windowsAgent "github.com/DataDog/datadog-agent/test/new-e2e/tests/windows/common/agent" - "github.com/DataDog/test-infra-definitions/components/os" - "github.com/DataDog/test-infra-definitions/scenarios/aws/ec2" ) var ( diff --git a/test/new-e2e/tests/windows/service-test/startstop_test.go b/test/new-e2e/tests/windows/service-test/startstop_test.go index 837766c78f5e7..d4c3090f3d69d 100644 --- a/test/new-e2e/tests/windows/service-test/startstop_test.go +++ b/test/new-e2e/tests/windows/service-test/startstop_test.go @@ -19,7 +19,7 @@ import ( "github.com/DataDog/datadog-agent/test/new-e2e/pkg/components" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/e2e" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments" - awsHostWindows "github.com/DataDog/datadog-agent/test/new-e2e/pkg/environments/aws/host/windows" + awsHostWindows "github.com/DataDog/datadog-agent/test/new-e2e/pkg/provisioners/aws/host/windows" "github.com/DataDog/datadog-agent/test/new-e2e/pkg/utils/e2e/client/agentclientparams" windowsCommon "github.com/DataDog/datadog-agent/test/new-e2e/tests/windows/common" windowsAgent "github.com/DataDog/datadog-agent/test/new-e2e/tests/windows/common/agent" diff --git a/test/otel/go.mod b/test/otel/go.mod index 7fb2f3b6d5f1e..c2f9bb806a7d0 100644 --- a/test/otel/go.mod +++ b/test/otel/go.mod @@ -12,6 +12,7 @@ replace ( github.com/DataDog/datadog-agent/comp/core/log/mock => ./../../comp/core/log/mock github.com/DataDog/datadog-agent/comp/core/secrets => ./../../comp/core/secrets github.com/DataDog/datadog-agent/comp/core/status => ../../comp/core/status + github.com/DataDog/datadog-agent/comp/core/tagger/origindetection => ../../comp/core/tagger/origindetection github.com/DataDog/datadog-agent/comp/core/telemetry => ./../../comp/core/telemetry github.com/DataDog/datadog-agent/comp/def => ./../../comp/def github.com/DataDog/datadog-agent/comp/forwarder/defaultforwarder => ../../comp/forwarder/defaultforwarder @@ -107,28 +108,29 @@ require ( github.com/DataDog/datadog-agent/pkg/config/setup v0.59.0 github.com/DataDog/datadog-agent/pkg/proto v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/trace v0.56.0-rc.3 - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/datadog v0.114.0 + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/datadog v0.115.0 ) 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/opentelemetry-mapping-go/pkg/otlp/metrics v0.22.0 // indirect + github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.22.0 // indirect github.com/hashicorp/go-version v1.7.0 // indirect github.com/patrickmn/go-cache v2.1.0+incompatible // indirect - go.opentelemetry.io/collector/featuregate v1.20.0 // indirect + go.opentelemetry.io/collector/featuregate v1.21.0 // indirect ) require ( github.com/pierrec/lz4/v4 v4.1.21 // indirect - go.opentelemetry.io/collector/consumer/consumererror v0.114.0 // indirect - go.opentelemetry.io/collector/pdata/pprofile v0.114.0 // indirect + go.opentelemetry.io/collector/consumer/consumererror v0.115.0 // indirect + go.opentelemetry.io/collector/pdata/pprofile v0.115.0 // indirect ) require ( - github.com/DataDog/agent-payload/v5 v5.0.137 // indirect + github.com/DataDog/agent-payload/v5 v5.0.138 // indirect github.com/DataDog/datadog-agent/comp/core/flare/builder v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/comp/core/flare/types v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/comp/core/secrets v0.59.0 // indirect + github.com/DataDog/datadog-agent/comp/core/tagger/origindetection v0.0.0-20241217122454-175edb6c74f2 // indirect github.com/DataDog/datadog-agent/comp/core/telemetry v0.57.1 // indirect github.com/DataDog/datadog-agent/comp/def v0.59.0 // indirect github.com/DataDog/datadog-agent/comp/logs/agent/config v0.56.0-rc.3 // indirect @@ -164,25 +166,25 @@ require ( github.com/DataDog/datadog-agent/pkg/util/fxutil v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/http v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/log v0.59.1 // indirect github.com/DataDog/datadog-agent/pkg/util/optional v0.59.0 // indirect github.com/DataDog/datadog-agent/pkg/util/pointer v0.59.0 // indirect - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.1 // indirect github.com/DataDog/datadog-agent/pkg/util/startstop v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/pkg/util/statstracker v0.56.0-rc.3 // indirect 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.0 // indirect - github.com/DataDog/datadog-agent/pkg/version v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-api-client-go/v2 v2.31.0 // indirect - github.com/DataDog/datadog-go/v5 v5.5.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/datadog-api-client-go/v2 v2.33.0 // indirect + github.com/DataDog/datadog-go/v5 v5.6.0 // indirect github.com/DataDog/dd-sensitive-data-scanner/sds-go/go v0.0.0-20240816154533-f7f9beb53a42 // indirect github.com/DataDog/go-sqllexer v0.0.17 // indirect github.com/DataDog/go-tuf v1.1.0-0.5.2 // indirect - 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/opentelemetry-mapping-go/pkg/otlp/attributes v0.22.0 // indirect + github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.22.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 +198,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 @@ -213,7 +216,7 @@ require ( github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hashicorp/hcl v1.0.1-vault-5 // indirect - github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 // indirect + github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 // indirect @@ -222,7 +225,7 @@ require ( github.com/knadh/koanf/maps v0.1.1 // indirect github.com/knadh/koanf/providers/confmap v0.1.0 // indirect github.com/knadh/koanf/v2 v2.1.2 // indirect - github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c // indirect + github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect @@ -234,22 +237,21 @@ require ( github.com/modern-go/reflect2 v1.0.2 // indirect github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.114.0 // indirect github.com/opencontainers/runtime-spec v1.2.0 // indirect github.com/outcaste-io/ristretto v0.2.3 // indirect github.com/pelletier/go-toml v1.9.5 // indirect github.com/philhofer/fwd v1.1.3-0.20240916144458-20a13a1f6b7c // indirect github.com/pkg/errors v0.9.1 // indirect + github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // 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/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect github.com/prometheus/client_golang v1.20.5 // indirect 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/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 @@ -261,26 +263,26 @@ require ( 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 - go.opentelemetry.io/collector/client v1.20.0 // indirect - go.opentelemetry.io/collector/component v0.114.0 // indirect - go.opentelemetry.io/collector/config/configauth v0.114.0 // indirect - go.opentelemetry.io/collector/config/configcompression v1.20.0 // indirect - go.opentelemetry.io/collector/config/confighttp v0.114.0 // indirect - go.opentelemetry.io/collector/config/confignet v1.20.0 // indirect - go.opentelemetry.io/collector/config/configopaque v1.20.0 // indirect - go.opentelemetry.io/collector/config/configretry v1.20.0 // indirect - go.opentelemetry.io/collector/config/configtelemetry v0.114.0 // indirect - go.opentelemetry.io/collector/config/configtls v1.20.0 // indirect - go.opentelemetry.io/collector/config/internal v0.114.0 // indirect - go.opentelemetry.io/collector/confmap v1.20.0 // indirect - go.opentelemetry.io/collector/consumer v0.114.0 // indirect - go.opentelemetry.io/collector/exporter v0.114.0 // indirect - go.opentelemetry.io/collector/extension v0.114.0 // indirect - go.opentelemetry.io/collector/extension/auth v0.114.0 // indirect - go.opentelemetry.io/collector/extension/experimental/storage v0.114.0 // indirect - go.opentelemetry.io/collector/pdata v1.20.0 // indirect - go.opentelemetry.io/collector/pipeline v0.114.0 // indirect - go.opentelemetry.io/collector/semconv v0.114.0 // indirect + go.opentelemetry.io/collector/client v1.21.0 // indirect + go.opentelemetry.io/collector/component v0.115.0 // indirect + go.opentelemetry.io/collector/config/configauth v0.115.0 // indirect + go.opentelemetry.io/collector/config/configcompression v1.21.0 // indirect + go.opentelemetry.io/collector/config/confighttp v0.115.0 // indirect + go.opentelemetry.io/collector/config/confignet v1.21.0 // indirect + go.opentelemetry.io/collector/config/configopaque v1.21.0 // indirect + go.opentelemetry.io/collector/config/configretry v1.21.0 // indirect + go.opentelemetry.io/collector/config/configtelemetry v0.115.0 // indirect + go.opentelemetry.io/collector/config/configtls v1.21.0 // indirect + go.opentelemetry.io/collector/config/internal v0.115.0 // indirect + go.opentelemetry.io/collector/confmap v1.21.0 // indirect + go.opentelemetry.io/collector/consumer v1.21.0 // indirect + go.opentelemetry.io/collector/exporter v0.115.0 // indirect + go.opentelemetry.io/collector/extension v0.115.0 // indirect + go.opentelemetry.io/collector/extension/auth v0.115.0 // indirect + go.opentelemetry.io/collector/extension/experimental/storage v0.115.0 // indirect + go.opentelemetry.io/collector/pdata v1.21.0 // indirect + go.opentelemetry.io/collector/pipeline v0.115.0 // indirect + go.opentelemetry.io/collector/semconv v0.115.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.56.0 // indirect go.opentelemetry.io/otel v1.32.0 // indirect go.opentelemetry.io/otel/metric v1.32.0 // indirect @@ -291,12 +293,12 @@ require ( go.uber.org/fx v1.23.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect - golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f // indirect - golang.org/x/net v0.31.0 // indirect + golang.org/x/exp v0.0.0-20241210194714-1829a127f884 // indirect + golang.org/x/net v0.33.0 // indirect golang.org/x/oauth2 v0.23.0 // indirect - golang.org/x/sys v0.27.0 // indirect - golang.org/x/term v0.26.0 // indirect - golang.org/x/text v0.20.0 // indirect + golang.org/x/sys v0.28.0 // indirect + golang.org/x/term v0.27.0 // indirect + golang.org/x/text v0.21.0 // indirect golang.org/x/time v0.8.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect google.golang.org/grpc v1.67.1 // indirect diff --git a/test/otel/go.sum b/test/otel/go.sum index 1283d3d064631..57882146bd2db 100644 --- a/test/otel/go.sum +++ b/test/otel/go.sum @@ -1,33 +1,33 @@ 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/agent-payload/v5 v5.0.137 h1:nV02RrYj6AwlQBGIEv6yG23CuxGtG0YWoFZAVE6vwxY= -github.com/DataDog/agent-payload/v5 v5.0.137/go.mod h1:lxh9lb5xYrBXjblpIWYUi4deJqVbkIfkjwesi5nskDc= -github.com/DataDog/datadog-api-client-go/v2 v2.31.0 h1:JfJhYlHfLzvauI8u6h23smTooWYe6quNhhg9gpTszWY= -github.com/DataDog/datadog-api-client-go/v2 v2.31.0/go.mod h1:d3tOEgUd2kfsr9uuHQdY+nXrWp4uikgTgVCPdKNK30U= -github.com/DataDog/datadog-go/v5 v5.5.0 h1:G5KHeB8pWBNXT4Jtw0zAkhdxEAWSpWH00geHI6LDrKU= -github.com/DataDog/datadog-go/v5 v5.5.0/go.mod h1:K9kcYBlxkcPP8tvvjZZKs/m1edNAUFzBbdpTUKfCsuw= +github.com/DataDog/agent-payload/v5 v5.0.138 h1:Wg7hmWuoLC/o0X3zZ+uGcfRHPyaytljudgSY9O59zjc= +github.com/DataDog/agent-payload/v5 v5.0.138/go.mod h1:lxh9lb5xYrBXjblpIWYUi4deJqVbkIfkjwesi5nskDc= +github.com/DataDog/datadog-api-client-go/v2 v2.33.0 h1:OI6kDnJeQmkjfGzxmP0XUQUxMD4tp6oAPXnnJ4VpgUM= +github.com/DataDog/datadog-api-client-go/v2 v2.33.0/go.mod h1:d3tOEgUd2kfsr9uuHQdY+nXrWp4uikgTgVCPdKNK30U= +github.com/DataDog/datadog-go/v5 v5.6.0 h1:2oCLxjF/4htd55piM75baflj/KoE6VYS7alEUqFvRDw= +github.com/DataDog/datadog-go/v5 v5.6.0/go.mod h1:K9kcYBlxkcPP8tvvjZZKs/m1edNAUFzBbdpTUKfCsuw= 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/go-sqllexer v0.0.17 h1:u47fJAVg/+5DA74ZW3w0Qu+3qXHd3GtnA8ZBYixdPrM= github.com/DataDog/go-sqllexer v0.0.17/go.mod h1:KwkYhpFEVIq+BfobkTC1vfqm4gTi65skV/DpDBXtexc= github.com/DataDog/go-tuf v1.1.0-0.5.2 h1:4CagiIekonLSfL8GMHRHcHudo1fQnxELS9g4tiAupQ4= github.com/DataDog/go-tuf v1.1.0-0.5.2/go.mod h1:zBcq6f654iVqmkk8n2Cx81E1JnNTMOAx1UEO/wZR+P0= -github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.21.0 h1:U+p1i7+upWb4qOIOOvjS/92iMUGlSzEC1tRxVo0Lg8Y= -github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.21.0/go.mod h1:dOjp1lg4jwYyIbpnqW+DoOV8qD+70C+lgpINFvUqasQ= -github.com/DataDog/opentelemetry-mapping-go/pkg/internal/sketchtest v0.21.0 h1:VS4NTqwczwezMVvI6A7xYR3ugPmMUJ4FcdFrsdnZI2I= -github.com/DataDog/opentelemetry-mapping-go/pkg/internal/sketchtest v0.21.0/go.mod h1:66XlN7QpQKqIvw8e2UbCXV5X8wGnEw851nT9BjJ75dY= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.21.0 h1:hgbTFS6SkqbzOiWSfP58dZ/Jpjlmv6dpD4+V4LDHm2Q= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.21.0/go.mod h1:dvIWN9pA2zWNTw5rhDWZgzZnhcfpH++d+8d1SWW6xkY= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.21.0 h1:XD9Kd+baO66+tfbdanOFSMGEfwWfnrn/IxG/Dc5bv5I= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.21.0/go.mod h1:9ByLz9jISc176DzjIdaRfRKwaitqF8ie6RTvfP8Aufo= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.21.0 h1:8nW8jfcCIWzxWrpI31C0QYoOjTaUGp6USCwiRbP5Fp4= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.21.0/go.mod h1:wuatEozcLYinJ0WYf0MlVTFtTzEmf+qyJet0H9foVAs= -github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.21.0 h1:/Dp1WBvekdusS9Tw9pLE7RG04eluNktQ29arLS4SpGM= -github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.21.0/go.mod h1:asNuwNy1O2HbadkcZVuqmFGonfEzXS/SBvOo8V1MJvQ= +github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.22.0 h1:r1Dx2cRHCBWkVluSZA41i4eoI/nOGbcrrZdkqWjoFCc= +github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.22.0/go.mod h1:+/dkO8ZiMa8rfm4SmtTF6qPUdBbBcvsWWKaO4xPKAIk= +github.com/DataDog/opentelemetry-mapping-go/pkg/internal/sketchtest v0.22.0 h1:cXcKVEU1D0HlguR7GunnvuI70TghkarCa9DApqzMY94= +github.com/DataDog/opentelemetry-mapping-go/pkg/internal/sketchtest v0.22.0/go.mod h1:ES00EXfyEKgUkjd93tAXCxJA6i0seeOhZoS5Cj2qzzg= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.22.0 h1:yfk2cF8Bx98fSFpGrehEHh1FRqewfxcCTAbUDt5r3F8= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.22.0/go.mod h1:9qzpnBSxSOnKzbF/uHket3SSlQihQHix/ZRC2nZUUYQ= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.22.0 h1:Zqj8YUZ/ualUhM8GDCQX6xKnUJKEiG0eYdFGWmIDG30= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.22.0/go.mod h1:lpr4q6g2TB0BHeLHaz/XleKm8YXQjuxiQEb9Q9HXXE0= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.22.0 h1:w9+ngZDYUMLW+GSRA8x1DvVbuMR+cwlGb8VLwZfgBGs= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.22.0/go.mod h1:UsfqLgiD6Sjhpjkg+YzAd+TdKUZ2m6ZZ8t+tEkLNTMA= +github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.22.0 h1:63SzQz9Ab8XJj8fQKQz6UZNBhOm8rucwzbDfwTVF6dQ= +github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.22.0/go.mod h1:E/PY/aQ6S/N5hBPHXZRGmovs5b1BSi4RHGNcB4yP/Z0= 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= @@ -140,7 +142,6 @@ github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/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= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -166,8 +167,8 @@ github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09 github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/hcl v1.0.1-vault-5 h1:kI3hhbbyzr4dldA8UdTb7ZlVVlI2DACdCfz31RPDgJM= github.com/hashicorp/hcl v1.0.1-vault-5/go.mod h1:XYhtn6ijBSAj6n4YqAaf7RBPS4I06AItNorpy+MoQNM= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 h1:S4qyfL2sEm5Budr4KVMyEniCy+PbS55651I/a+Kn/NQ= -github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb h1:PGufWXXDq9yaev6xX1YQauaO1MV90e6Mpoq1I7Lz/VM= +github.com/hectane/go-acl v0.0.0-20230122075934-ca0b05cb1adb/go.mod h1:QiyDdbZLaJ/mZP4Zwc9g2QsfaEA4o7XvvgZegSci5/E= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= @@ -206,8 +207,8 @@ github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0 github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/lightstep/go-expohisto v1.0.0 h1:UPtTS1rGdtehbbAF7o/dhkWLTDI73UifG8LbfQI7cA4= github.com/lightstep/go-expohisto v1.0.0/go.mod h1:xDXD0++Mu2FOaItXtdDfksfgxfV0z1TMPa+e/EUd0cs= -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/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a h1:3Bm7EwfUQUvhNeKIkUct/gl9eod1TcXuj8stxvi/GoI= +github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a/go.mod h1:ilwx/Dta8jXAgpFYFvSWEMwxmbWXyiUHkd5FwyKhb5k= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= @@ -239,16 +240,16 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/datadog v0.114.0 h1:Wq1iTmd0K1SSOIA43Wy2uAU6SB4f9ogyN3ZmvDgTURg= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/datadog v0.114.0/go.mod h1:VCj9H0QxRBWSgbl1pUo8p0NrqnmcxpPo0QjKLFtWkO0= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.114.0 h1:m8uPYU2rTj0sKiYgzCvIPajD3meiYsu+nX0hplUnlEU= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.114.0/go.mod h1:P0BaP92pXPkTyTmObfLYUoRBfMYU+i0hdS3oM1DpGJo= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.114.0 h1:Qg80zPfNMlub7LO07VMDElOu3M2oxqdZgvvB+X72a4U= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.114.0/go.mod h1:5qsGcjFV3WFI6J2onAlkR7Xd/8VtwJcECaDRZfW4Tb4= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/sampling v0.114.0 h1:mtSN/07RGQPi1/zHVSZg4G0qRtOoJpPew5jsQWv9uS0= -github.com/open-telemetry/opentelemetry-collector-contrib/pkg/sampling v0.114.0/go.mod h1:C9Zgh/N3j4NR2D+1FGAA1YizhFW9OS51DwLUFJTdXN4= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/probabilisticsamplerprocessor v0.114.0 h1:I4ZYVRYW3Cjb65sPENZ9kHam/JUMXNEp2n/knJ0C0Vc= -github.com/open-telemetry/opentelemetry-collector-contrib/processor/probabilisticsamplerprocessor v0.114.0/go.mod h1:4BhyIaOn2LS48WS+ZNix4TpP0+goq9gDEtGzth5Cr3M= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/datadog v0.115.0 h1:WOqt8NpU/JPGYDR4CiWx7g/sHV6Oe9FChzhushwmVdo= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/datadog v0.115.0/go.mod h1:wV/+iU7MyXcyTaY8K5Qx+1Z3yUzrxA40nydPQA476Iw= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.115.0 h1:MerLKMrkM4YoGF6Di0D9yMXO02yCX8mrZAi/+jJVVeI= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.115.0/go.mod h1:R8AkVWe9G5Q0oMOapvm9HNS076E3Min8SVlmhBL3QD0= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.115.0 h1:WEqcnWSy9dNSlGb8pYRBX7zhaz2ReyaeImlenbzNTB4= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.115.0/go.mod h1:6Mk71CakHUA3I6oM9hARDiyQypYyOolvb+4PFYyVEFg= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/sampling v0.115.0 h1:R9MRrO+dSkAHBQLZjuwjv2RHXHQqF2Wtm1Ki0VKD5cs= +github.com/open-telemetry/opentelemetry-collector-contrib/pkg/sampling v0.115.0/go.mod h1:rKXLXmwdUVcUHwTilroKSejbg3KSwLeYzNPSpkIEnv4= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/probabilisticsamplerprocessor v0.115.0 h1:vwZQ7k8oqlK0bdZYTsjP/59zjQQfjSD4fNsWIWsTu2w= +github.com/open-telemetry/opentelemetry-collector-contrib/processor/probabilisticsamplerprocessor v0.115.0/go.mod h1:5ObSa9amrbzbYTdAK1Qhv3D/YqCxxnQhP0sk2eWB7Oo= github.com/opencontainers/runtime-spec v1.2.0 h1:z97+pHb3uELt/yiAWD691HNHQIF07bE7dzrbT927iTk= github.com/opencontainers/runtime-spec v1.2.0/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= @@ -267,11 +268,13 @@ github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 h1:GFCKgmp0tecUJ0sJuv4pzYCqS9+RGSn52M3FUwPs+uo= +github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10/go.mod h1:t/avpk3KcrXxUnYOhZhMXJlSEyie6gQbtLq5NM3loB8= 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-20220216144756-c35f1ee13d7c h1:NRoLoZvkBTKvR5gQLgA3e0hqjkY9u1wm+iOL45VN/qI= -github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 h1:o4JXh1EVt9k/+g42oCprj/FisM4qX9L3sZB3upGN2ZU= +github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= @@ -307,12 +310,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= @@ -376,80 +375,82 @@ github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1 github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0= github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.opentelemetry.io/collector/client v1.20.0 h1:o60wPcj5nLtaRenF+1E5p4QXFS3TDL6vHlw+GOon3rg= -go.opentelemetry.io/collector/client v1.20.0/go.mod h1:6aqkszco9FaLWCxyJEVam6PP7cUa8mPRIXeS5eZGj0U= -go.opentelemetry.io/collector/component v0.114.0 h1:SVGbm5LvHGSTEDv7p92oPuBgK5tuiWR82I9+LL4TtBE= -go.opentelemetry.io/collector/component v0.114.0/go.mod h1:MLxtjZ6UVHjDxSdhGLuJfHBHvfl1iT/Y7IaQPD24Eww= -go.opentelemetry.io/collector/component/componentstatus v0.114.0 h1:y9my/xink8KB5lK8zFAjgB2+pEh0QYy5TM972fxZY9w= -go.opentelemetry.io/collector/component/componentstatus v0.114.0/go.mod h1:RIoeCYZpPaae7QLE/1RacqzhHuXBmzRAk9H/EwYtIIs= -go.opentelemetry.io/collector/component/componenttest v0.114.0 h1:GM4FTTlfeXoVm6sZYBHImwlRN8ayh2oAfUhvaFj7Zo8= -go.opentelemetry.io/collector/component/componenttest v0.114.0/go.mod h1:ZZEJMtbJtoVC/3/9R1HzERq+cYQRxuMFQrPCpfZ4Xos= -go.opentelemetry.io/collector/config/configauth v0.114.0 h1:R2sJ6xpsLYGH0yU0vCxotzBYDKR/Hrjv0A7y9lwMyiw= -go.opentelemetry.io/collector/config/configauth v0.114.0/go.mod h1:3Z24KcCpG+WYCeQYfs/cNp5cP2BDeOqLCtOEgs/rPqM= -go.opentelemetry.io/collector/config/configcompression v1.20.0 h1:H/mvz7J/5z+O74YsO0t2tk+REnO2tzLM8TgIQ4AZ5w0= -go.opentelemetry.io/collector/config/configcompression v1.20.0/go.mod h1:pnxkFCLUZLKWzYJvfSwZnPrnm0twX14CYj2ADth5xiU= -go.opentelemetry.io/collector/config/confighttp v0.114.0 h1:DjGsBvVm+mGK3IpJBaXianWhwcxEC1fF33cpuC1LY/I= -go.opentelemetry.io/collector/config/confighttp v0.114.0/go.mod h1:nrlNLxOZ+4JQaV9j0TiqQV7LOHhrRivPrT8nQRHED3Q= -go.opentelemetry.io/collector/config/confignet v1.20.0 h1:LrM6AuiY8N/woTP4SWhL2V0562JXwJs9MRNFZJFLtRY= -go.opentelemetry.io/collector/config/confignet v1.20.0/go.mod h1:o3v4joAEjvLwntqexg5ixMqRrU1+Vst+jWuCUaBNgOg= -go.opentelemetry.io/collector/config/configopaque v1.20.0 h1:2I48zKiyyyYqjm7y0B9OLp24ku2ZSX3nCHG0r5FdWOQ= -go.opentelemetry.io/collector/config/configopaque v1.20.0/go.mod h1:6zlLIyOoRpJJ+0bEKrlZOZon3rOp5Jrz9fMdR4twOS4= -go.opentelemetry.io/collector/config/configretry v1.20.0 h1:z679mrMlW2a6tOOYPGdrS/QfALxdzWLQUOpH8Uu+D5Y= -go.opentelemetry.io/collector/config/configretry v1.20.0/go.mod h1:KvQF5cfphq1rQm1dKR4eLDNQYw6iI2fY72NMZVa+0N0= -go.opentelemetry.io/collector/config/configtelemetry v0.114.0 h1:kjLeyrumge6wsX6ZIkicdNOlBXaEyW2PI2ZdVXz/rzY= -go.opentelemetry.io/collector/config/configtelemetry v0.114.0/go.mod h1:R0MBUxjSMVMIhljuDHWIygzzJWQyZHXXWIgQNxcFwhc= -go.opentelemetry.io/collector/config/configtls v1.20.0 h1:hNlJdwfyY5Qe54RLJ41lfLqKTn9ypkR7sk7JNCcSe2U= -go.opentelemetry.io/collector/config/configtls v1.20.0/go.mod h1:sav/txSHguadTYlSSK+BJO2ljJeYEtRoBahgzWAguYg= -go.opentelemetry.io/collector/config/internal v0.114.0 h1:uWSDWTJb8T6xRjKD9/XmEARakXnxgYVYKUeId78hErc= -go.opentelemetry.io/collector/config/internal v0.114.0/go.mod h1:yC7E4h1Uj0SubxcFImh6OvBHFTjMh99+A5PuyIgDWqc= -go.opentelemetry.io/collector/confmap v1.20.0 h1:ARfOwmkKxFOud1njl03yAHQ30+uenlzqCO6LBYamDTE= -go.opentelemetry.io/collector/confmap v1.20.0/go.mod h1:DMpd9Ay/ffls3JoQBQ73vWeRsz1rNuLbwjo6WtjSQus= -go.opentelemetry.io/collector/consumer v0.114.0 h1:1zVaHvfIZowGwZRitRBRo3i+RP2StlU+GClYiofSw0Q= -go.opentelemetry.io/collector/consumer v0.114.0/go.mod h1:d+Mrzt9hsH1ub3zmwSlnQVPLeTYir4Mgo7CrWfnncN4= -go.opentelemetry.io/collector/consumer/consumererror v0.114.0 h1:r2YiELfWerb40FHD23V04gNjIkLUcjEKGxI4Vtm2iO4= -go.opentelemetry.io/collector/consumer/consumererror v0.114.0/go.mod h1:MzIrLQ5jptO2egypolhlAbZsWZr29WC4FhSxQjnxcvg= -go.opentelemetry.io/collector/consumer/consumerprofiles v0.114.0 h1:5pXYy3E6UK5Huu3aQbsYL8B6E6MyWx4fvXXDn+oXZaA= -go.opentelemetry.io/collector/consumer/consumerprofiles v0.114.0/go.mod h1:PMq3f54KcJQO4v1tue0QxQScu7REFVADlXxXSAYMiN0= -go.opentelemetry.io/collector/consumer/consumertest v0.114.0 h1:isaTwJK5DOy8Bs7GuLq23ejfgj8gLIo5dOUvkRnLF4g= -go.opentelemetry.io/collector/consumer/consumertest v0.114.0/go.mod h1:GNeLPkfRPdh06n/Rv1UKa/cAtCKjN0a7ADyHjIj4HFE= -go.opentelemetry.io/collector/exporter v0.114.0 h1:5/0BBpXuCJQSQ5SQf31g7j6T4XEKkyx9mZMcA2rS5e8= -go.opentelemetry.io/collector/exporter v0.114.0/go.mod h1:atpd0wWXgh5LAZ0REU/d/Ti/q50HDfnlBIjMjJQlKFg= -go.opentelemetry.io/collector/exporter/exporterprofiles v0.114.0 h1:/wmWOSBHcvtz3Pbv7+rWCqPPQuNvYaoidKKaOqZsLKs= -go.opentelemetry.io/collector/exporter/exporterprofiles v0.114.0/go.mod h1:epRYTkyJZTSQZBJflMGHUyUo2EdLPhsaZEyo5Qm848A= -go.opentelemetry.io/collector/exporter/exportertest v0.114.0 h1:vo0idBJT+QACSM1KpjVLm9VeiXVwO7y4UnMpGxN6EyM= -go.opentelemetry.io/collector/exporter/exportertest v0.114.0/go.mod h1:420ssFrhaphneybstbMeSIiqSRoaBARPgO71O17foaM= -go.opentelemetry.io/collector/extension v0.114.0 h1:9Qb92y8hD2WDC5aMDoj4JNQN+/5BQYJWPUPzLXX+iGw= -go.opentelemetry.io/collector/extension v0.114.0/go.mod h1:Yk2/1ptVgfTr12t+22v93nYJpioP14pURv2YercSzU0= -go.opentelemetry.io/collector/extension/auth v0.114.0 h1:1K2qh4yvG8kKR/sTAobI/rw5VxzPZoKcl3FmC195vvo= -go.opentelemetry.io/collector/extension/auth v0.114.0/go.mod h1:IjtsG+jUVJB0utKF8dAK8pLutRun3aEgASshImzsw/U= -go.opentelemetry.io/collector/extension/experimental/storage v0.114.0 h1:hLyX9UvmY0t6iBnk3CqvyNck2U0QjPACekj7pDRx2hA= -go.opentelemetry.io/collector/extension/experimental/storage v0.114.0/go.mod h1:WqYRQVJjJLE1rm+y/ks1wPdPRGWePEvE1VO07xm2J2k= -go.opentelemetry.io/collector/extension/extensiontest v0.114.0 h1:ibXDms1qrswlvlR6b3d2BeyI8sXUXoFV11yOi9Sop8o= -go.opentelemetry.io/collector/extension/extensiontest v0.114.0/go.mod h1:/bOYmqu5yTDfI1bJZUxFqm8ZtmcodpquebiSxiQxtDY= -go.opentelemetry.io/collector/featuregate v1.20.0 h1:Mi7nMy/q52eruI+6jWnMKUOeM55XvwoPnGcdB1++O8c= -go.opentelemetry.io/collector/featuregate v1.20.0/go.mod h1:47xrISO71vJ83LSMm8+yIDsUbKktUp48Ovt7RR6VbRs= -go.opentelemetry.io/collector/pdata v1.20.0 h1:ePcwt4bdtISP0loHaE+C9xYoU2ZkIvWv89Fob16o9SM= -go.opentelemetry.io/collector/pdata v1.20.0/go.mod h1:Ox1YVLe87cZDB/TL30i4SUz1cA5s6AM6SpFMfY61ICs= -go.opentelemetry.io/collector/pdata/pprofile v0.114.0 h1:pUNfTzsI/JUTiE+DScDM4lsrPoxnVNLI2fbTxR/oapo= -go.opentelemetry.io/collector/pdata/pprofile v0.114.0/go.mod h1:4aNcj6WM1n1uXyFSXlhVs4ibrERgNYsTbzcYI2zGhxA= -go.opentelemetry.io/collector/pdata/testdata v0.114.0 h1:+AzszWSL1i4K6meQ8rU0JDDW55SYCXa6FVqfDixhhTo= -go.opentelemetry.io/collector/pdata/testdata v0.114.0/go.mod h1:bv8XFdCTZxG2MQB5l9dKxSxf5zBrcodwO6JOy1+AxXM= -go.opentelemetry.io/collector/pipeline v0.114.0 h1:v3YOhc5z0tD6QbO5n/pnftpIeroihM2ks9Z2yKPCcwY= -go.opentelemetry.io/collector/pipeline v0.114.0/go.mod h1:4vOvjVsoYTHVGTbfFwqfnQOSV2K3RKUHofh3jNRc2Mg= -go.opentelemetry.io/collector/processor v0.114.0 h1:6bqQgLL7BtKrNv4YkEOGjZfkcfZv/ciJSQx1epGG9Zk= -go.opentelemetry.io/collector/processor v0.114.0/go.mod h1:DV/wa+nAmSHIDeD9NblPwkY9PbgtDQAZJ+PE5biZwPc= -go.opentelemetry.io/collector/processor/processorprofiles v0.114.0 h1:+P/1nLouEXTnN8DVQl+qWwO4BTkQyNPG9t/FrpUqrSI= -go.opentelemetry.io/collector/processor/processorprofiles v0.114.0/go.mod h1:3fuHeNIpINwx3bqFMprmDJyr6y5tWoWbJH599kltO5Y= -go.opentelemetry.io/collector/processor/processortest v0.114.0 h1:3FTaVXAp0LoVmUJn1ewBFckAby7AHa6/Kcdj0xuW14c= -go.opentelemetry.io/collector/processor/processortest v0.114.0/go.mod h1:OgsdOs1Fv5ZGTTJPF5nNIUJh2YkuV1acWd73yWgnti4= -go.opentelemetry.io/collector/receiver v0.114.0 h1:90SAnXAjNq7/k52/pFmmb06Cf1YauoPYtbio4aOXafY= -go.opentelemetry.io/collector/receiver v0.114.0/go.mod h1:KUGT0/D953LXbGH/D3lLPU8yrU3HfWnUqpt4W4hSOnE= -go.opentelemetry.io/collector/receiver/receiverprofiles v0.114.0 h1:ibhEfGpvNB3yrtpl2jYFabrunMk1hurxvMYpM0b1Ck4= -go.opentelemetry.io/collector/receiver/receiverprofiles v0.114.0/go.mod h1:UZyRfaasw+NLvN10AN8IQnmj5tQ3BOUH1uP2ctpO9f0= -go.opentelemetry.io/collector/receiver/receivertest v0.114.0 h1:D+Kh9t2n4asTnM+TiSxbrKlUemLZandWntj17BJWWb0= -go.opentelemetry.io/collector/receiver/receivertest v0.114.0/go.mod h1:mNSHQ13vFmqD+VAcRzLjStFBejbcWUn2Mp0pAd7Op+U= -go.opentelemetry.io/collector/semconv v0.114.0 h1:/eKcCJwZepQUtEuFuxa0thx2XIOvhFpaf214ZG1a11k= -go.opentelemetry.io/collector/semconv v0.114.0/go.mod h1:zCJ5njhWpejR+A40kiEoeFm1xq1uzyZwMnRNX6/D82A= +go.opentelemetry.io/collector/client v1.21.0 h1:3Kes8lOFMYVxoxeAmX+DTEAkuS1iTA3NkSfqzGmygJA= +go.opentelemetry.io/collector/client v1.21.0/go.mod h1:jYJGiL0UA975OOyHmjbQSokNWt1OiviI5KjPOMUMGwc= +go.opentelemetry.io/collector/component v0.115.0 h1:iLte1oCiXzjiCnaOBKdsXacfFiECecpWxW3/LeriMoo= +go.opentelemetry.io/collector/component v0.115.0/go.mod h1:oIUFiH7w1eOimdeYhFI+gAIxYSiLDocKVJ0PTvX7d6s= +go.opentelemetry.io/collector/component/componentstatus v0.115.0 h1:pbpUIL+uKDfEiSgKK+S5nuSL6MDIIQYsp4b65ZGVb9M= +go.opentelemetry.io/collector/component/componentstatus v0.115.0/go.mod h1:36A+9XSiOz0Cdhq+UwwPRlEr5CYuSkEnVO9om4BH7d0= +go.opentelemetry.io/collector/component/componenttest v0.115.0 h1:9URDJ9VyP6tuij+YHjp/kSSMecnZOd7oGvzu+rw9SJY= +go.opentelemetry.io/collector/component/componenttest v0.115.0/go.mod h1:PzXvNqKLCiSADZGZFKH+IOHMkaQ0GTHuzysfVbTPKYY= +go.opentelemetry.io/collector/config/configauth v0.115.0 h1:xa+ALdyPgva3rZnLBh1H2oS5MsHP6JxSqMtQmcELnys= +go.opentelemetry.io/collector/config/configauth v0.115.0/go.mod h1:C7anpb3Rf4KswMT+dgOzkW9UX0z/65PLORpUw3p0VYc= +go.opentelemetry.io/collector/config/configcompression v1.21.0 h1:0zbPdZAgPFMAarwJEC4gaR6f/JBP686A3TYSgb3oa+E= +go.opentelemetry.io/collector/config/configcompression v1.21.0/go.mod h1:LvYG00tbPTv0NOLoZN0wXq1F5thcxvukO8INq7xyfWU= +go.opentelemetry.io/collector/config/confighttp v0.115.0 h1:BIy394oNXnqySJwrCqgAJu4gWgAV5aQUDD6k1hy6C8o= +go.opentelemetry.io/collector/config/confighttp v0.115.0/go.mod h1:Wr50ut12NmCEAl4bWLJryw2EjUmJTtYRg89560Q51wc= +go.opentelemetry.io/collector/config/confignet v1.21.0 h1:PeQ5YrMnfftysFL/WVaSrjPOWjD6DfeABY50pf9CZxU= +go.opentelemetry.io/collector/config/confignet v1.21.0/go.mod h1:ZppUH1hgUJOubawEsxsQ9MzEYFytqo2GnVSS7d4CVxc= +go.opentelemetry.io/collector/config/configopaque v1.21.0 h1:PcvRGkBk4Px8BQM7tX+kw4i3jBsfAHGoGQbtZg6Ox7U= +go.opentelemetry.io/collector/config/configopaque v1.21.0/go.mod h1:sW0t0iI/VfRL9VYX7Ik6XzVgPcR+Y5kejTLsYcMyDWs= +go.opentelemetry.io/collector/config/configretry v1.21.0 h1:ZHoOvAkEcv5BBeaJn8IQ6rQ4GMPZWW4S+W7R4QTEbZU= +go.opentelemetry.io/collector/config/configretry v1.21.0/go.mod h1:cleBc9I0DIWpTiiHfu9v83FUaCTqcPXmebpLxjEIqro= +go.opentelemetry.io/collector/config/configtelemetry v0.115.0 h1:U07FinCDop+r2RjWQ3aP9ZWONC7r7kQIp1GkXQi6nsI= +go.opentelemetry.io/collector/config/configtelemetry v0.115.0/go.mod h1:SlBEwQg0qly75rXZ6W1Ig8jN25KBVBkFIIAUI1GiAAE= +go.opentelemetry.io/collector/config/configtls v1.21.0 h1:ZfrlAYgBD8lzp04W0GxwiDmUbrvKsvDYJi+wkyiXlpA= +go.opentelemetry.io/collector/config/configtls v1.21.0/go.mod h1:5EsNefPfVCMOTlOrr3wyj7LrsOgY7V8iqRl8oFZEqtw= +go.opentelemetry.io/collector/config/internal v0.115.0 h1:eVk57iufZpUXyPJFKTb1Ebx5tmcCyroIlt427r5pxS8= +go.opentelemetry.io/collector/config/internal v0.115.0/go.mod h1:OVkadRWlKAoWjHslqjWtBLAne8ceQm8WYT71ZcBWLFc= +go.opentelemetry.io/collector/confmap v1.21.0 h1:1tIcx2/Suwg8VhuPmQw87ba0ludPmumpFCFRZZa6RXA= +go.opentelemetry.io/collector/confmap v1.21.0/go.mod h1:Rrhs+MWoaP6AswZp+ReQ2VO9dfOfcUjdjiSHBsG+nec= +go.opentelemetry.io/collector/consumer v1.21.0 h1:THKZ2Vbi6GkamjTBI2hFq5Dc4kINZTWGwQNa8d/Ty9g= +go.opentelemetry.io/collector/consumer v1.21.0/go.mod h1:FQcC4ThMtRYY41dv+IPNK8POLLhAFY3r1YR5fuP7iiY= +go.opentelemetry.io/collector/consumer/consumererror v0.115.0 h1:yli//xBCQMPZKXNgNlXemo4dvqhnFrAmCZ11DvQgmcY= +go.opentelemetry.io/collector/consumer/consumererror v0.115.0/go.mod h1:LwVzAvQ6ZVNG7mbOvurbAo+W/rKws0IcjOwriuZXqPE= +go.opentelemetry.io/collector/consumer/consumerprofiles v0.115.0 h1:H3fDuyQW1t2HWHkz96WMBQJKUevypOCjBqnqtaAWyoA= +go.opentelemetry.io/collector/consumer/consumerprofiles v0.115.0/go.mod h1:IzEmZ91Tp7TBxVDq8Cc9xvLsmO7H08njr6Pu9P5d9ns= +go.opentelemetry.io/collector/consumer/consumertest v0.115.0 h1:hru0I2447y0TluCdwlKYFFtgcpyCnlM+LiOK1JZyA70= +go.opentelemetry.io/collector/consumer/consumertest v0.115.0/go.mod h1:ybjALRJWR6aKNOzEMy1T1ruCULVDEjj4omtOJMrH/kU= +go.opentelemetry.io/collector/exporter v0.115.0 h1:JnxfpOnsuqhTPKJXVKJLS1Cv3BiVrVLzpHOjJEQw+xw= +go.opentelemetry.io/collector/exporter v0.115.0/go.mod h1:xof3fHQK8wADhaKLIJcQ7ChZaFLNC+haRdPN0wgl6kY= +go.opentelemetry.io/collector/exporter/exporterprofiles v0.115.0 h1:lSQEleCn/q9eFufcuK61NdFKU70ZlgI9dBjPCO/4CrE= +go.opentelemetry.io/collector/exporter/exporterprofiles v0.115.0/go.mod h1:7l5K2AecimX2kx+nZC1gKG3QkP247CO1+SodmJ4fFkQ= +go.opentelemetry.io/collector/exporter/exportertest v0.115.0 h1:P9SMTUXQOtcaq40bGtnnAe14zRmR4/yUgj/Tb2BEf/k= +go.opentelemetry.io/collector/exporter/exportertest v0.115.0/go.mod h1:1jMZ9gFGXglb8wfNrBZIgd+RvpZhSyFwdfE+Jtf9w4U= +go.opentelemetry.io/collector/extension v0.115.0 h1:/cBb8AUdD0KMWC6V3lvCC16eP9Fg0wd1Upcp5rgvuGI= +go.opentelemetry.io/collector/extension v0.115.0/go.mod h1:HI7Ak6loyi6ZrZPsQJW1OO1wbaAW8OqXLFNQlTZnreQ= +go.opentelemetry.io/collector/extension/auth v0.115.0 h1:TTMokbBsSHZRFH48PvGSJmgSS8F3Rkr9MWGHZn8eJDk= +go.opentelemetry.io/collector/extension/auth v0.115.0/go.mod h1:3w+2mzeb2OYNOO4Bi41TUo4jr32ap2y7AOq64IDpxQo= +go.opentelemetry.io/collector/extension/auth/authtest v0.115.0 h1:OZe7dKbZ01qodSpZU0ZYzI6zpmmzJ3UvfdBSFAbSgDw= +go.opentelemetry.io/collector/extension/auth/authtest v0.115.0/go.mod h1:fk9WCXP0x91Q64Z8HZKWTHh9PWtgoWE1KXe3n2Bff3U= +go.opentelemetry.io/collector/extension/experimental/storage v0.115.0 h1:sZXw0+77092pq24CkUoTRoHQPLQUsDq6HFRNB0g5yR4= +go.opentelemetry.io/collector/extension/experimental/storage v0.115.0/go.mod h1:qjFH7Y3QYYs88By2ZB5GMSUN5k3ul4Brrq2J6lKACA0= +go.opentelemetry.io/collector/extension/extensiontest v0.115.0 h1:GBVFxFEskR8jSdu9uaQh2qpXnN5VNXhXjpJ2UjxtE8I= +go.opentelemetry.io/collector/extension/extensiontest v0.115.0/go.mod h1:eu1ecbz5mT+cHoH2H3GmD/rOO0WsicSJD2RLrYuOmRA= +go.opentelemetry.io/collector/featuregate v1.21.0 h1:+EULHPJDLMipcwAGZVp9Nm8NriRvoBBMxp7MSiIZVMI= +go.opentelemetry.io/collector/featuregate v1.21.0/go.mod h1:3GaXqflNDVwWndNGBJ1+XJFy3Fv/XrFgjMN60N3z7yg= +go.opentelemetry.io/collector/pdata v1.21.0 h1:PG+UbiFMJ35X/WcAR7Rf/PWmWtRdW0aHlOidsR6c5MA= +go.opentelemetry.io/collector/pdata v1.21.0/go.mod h1:GKb1/zocKJMvxKbS+sl0W85lxhYBTFJ6h6I1tphVyDU= +go.opentelemetry.io/collector/pdata/pprofile v0.115.0 h1:NI89hy13vNDw7EOnQf7Jtitks4HJFO0SUWznTssmP94= +go.opentelemetry.io/collector/pdata/pprofile v0.115.0/go.mod h1:jGzdNfO0XTtfLjXCL/uCC1livg1LlfR+ix2WE/z3RpQ= +go.opentelemetry.io/collector/pdata/testdata v0.115.0 h1:Rblz+AKXdo3fG626jS+KSd0OSA4uMXcTQfpwed6P8LI= +go.opentelemetry.io/collector/pdata/testdata v0.115.0/go.mod h1:inNnRt6S2Nn260EfCBEcjesjlKOSsr0jPwkPqpBkt4s= +go.opentelemetry.io/collector/pipeline v0.115.0 h1:bmACBqb0e8U9ag+vGGHUP7kCfAO7HHROdtzIEg8ulus= +go.opentelemetry.io/collector/pipeline v0.115.0/go.mod h1:qE3DmoB05AW0C3lmPvdxZqd/H4po84NPzd5MrqgtL74= +go.opentelemetry.io/collector/processor v0.115.0 h1:+fveHGRe24PZPv/F5taahGuZ9HdNW44hgNWEJhIUdyc= +go.opentelemetry.io/collector/processor v0.115.0/go.mod h1:/oLHBlLsm7tFb7zOIrA5C0j14yBtjXKAgxJJ2Bktyk4= +go.opentelemetry.io/collector/processor/processorprofiles v0.115.0 h1:cCZAs+FXaebZPppqAN3m+X3etoSBL6NvyQo8l0hOZoo= +go.opentelemetry.io/collector/processor/processorprofiles v0.115.0/go.mod h1:kMxF0gknlWX4duuAJFi2/HuIRi6C3w95tOenRa0GKOY= +go.opentelemetry.io/collector/processor/processortest v0.115.0 h1:j9HEaYFOeOB6VYl9zGhBnhQbTkqGBa2udUvu5NTh6hc= +go.opentelemetry.io/collector/processor/processortest v0.115.0/go.mod h1:Gws+VEnp/eW3qAqPpqbKsrbnnxxNfyDjqrfUXbZfZic= +go.opentelemetry.io/collector/receiver v0.115.0 h1:55Q3Jvj6zHCIA1psKqi/3kEMJO4OqUF5tNAEYNdB1U8= +go.opentelemetry.io/collector/receiver v0.115.0/go.mod h1:nBSCh2O/WUcfgpJ+Jpz+B0z0Hn5jHeRvF2WmLij5EIY= +go.opentelemetry.io/collector/receiver/receiverprofiles v0.115.0 h1:R9JLaj2Al93smIPUkbJshAkb/cY0H5JBOxIx+Zu0NG4= +go.opentelemetry.io/collector/receiver/receiverprofiles v0.115.0/go.mod h1:05E5hGujWeeXJmzKZwTdHyZ/+rRyrQlQB5p5Q2XY39M= +go.opentelemetry.io/collector/receiver/receivertest v0.115.0 h1:OiB684SbHQi6/Pd3ZH0cXjYvCpBS9ilQBfTQx0wVXHg= +go.opentelemetry.io/collector/receiver/receivertest v0.115.0/go.mod h1:Y8Z9U/bz9Xpyt8GI8DxZZgryw3mnnIw+AeKVLTD2cP8= +go.opentelemetry.io/collector/semconv v0.115.0 h1:SoqMvg4ZEB3mz2EdAb6XYa+TuMo5Mir5FRBr3nVFUDY= +go.opentelemetry.io/collector/semconv v0.115.0/go.mod h1:N6XE8Q0JKgBN2fAhkUQtqK9LT7rEGR6+Wu/Rtbal1iI= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.56.0 h1:UP6IpuHFkUgOQL9FFQFrZ+5LiwhhYRbi7VZSIx6Nj5s= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.56.0/go.mod h1:qxuZLtbq5QDtdeSHsS7bcf6EH6uO6jUAgk764zd3rhM= go.opentelemetry.io/otel v1.32.0 h1:WnBN+Xjcteh0zdk01SVqV55d/m62NJLJdIyb4y/WO5U= @@ -487,11 +488,11 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.29.0 h1:L5SG1JTTXupVV3n6sUqMTeWbjAyfPwoda2DLX8J8FrQ= -golang.org/x/crypto v0.29.0/go.mod h1:+F4F4N5hv6v38hfeYwTdx20oUvLLc+QfrE9Ax9HtgRg= +golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U= +golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f h1:XdNn9LlyWAhLVp6P/i8QYBW+hlyhrhei9uErw2B5GJo= -golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f/go.mod h1:D5SMRVC3C2/4+F/DB1wZsLRnSNimn2Sp/NPsCrsv8ak= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884 h1:Y/Mj/94zIQQGHVSv1tTtQBDaQaJe62U9bkDZKKyhPCU= +golang.org/x/exp v0.0.0-20241210194714-1829a127f884/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -514,8 +515,8 @@ golang.org/x/net v0.0.0-20191002035440-2ec189313ef0/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.31.0 h1:68CPQngjLL0r2AlUKiSxtQFKvzRVbnzLwMUn5SzcLHo= -golang.org/x/net v0.31.0/go.mod h1:P4fl1q7dY2hnZFxEk4pPSkDHF+QqjitcnDjUQyMM+pM= +golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= +golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.23.0 h1:PbgcYx2W7i4LvjJWEbf0ngHV6qJYr86PkAV3bXdLEbs= golang.org/x/oauth2 v0.23.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= @@ -548,15 +549,15 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220829200755-d48e67d00261/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.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= -golang.org/x/term v0.26.0 h1:WEQa6V3Gja/BhNxg540hBip/kkaYtRg3cxg4oXSw4AU= -golang.org/x/term v0.26.0/go.mod h1:Si5m1o57C5nBNQo5z1iq+XDijt21BDBDp2bK0QI8e3E= +golang.org/x/term v0.27.0 h1:WP60Sv1nlK1T6SupCHbXzSaN0b9wUmsPoRS9b61A23Q= +golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= -golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.8.0 h1:9i3RxcPv3PZnitoVGMPDKZSq1xW1gK1Xy3ArNOGZfEg= diff --git a/test/otel/testdata/builder-config.yaml b/test/otel/testdata/builder-config.yaml index b13b478649860..137c635509724 100644 --- a/test/otel/testdata/builder-config.yaml +++ b/test/otel/testdata/builder-config.yaml @@ -1,86 +1,87 @@ +connectors: +- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/connector/spanmetricsconnector + v0.115.0 +- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/connector/datadogconnector + v0.115.0 +converters: +- gomod: github.com/DataDog/datadog-agent/comp/otelcol/converter/impl v0.61.0 + path: ./comp/otelcol/converter/impl dist: description: Basic OTel Collector distribution for Developers name: otelcol-custom output_path: /tmp/otel-ci/otelcol-custom -connectors: -- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/connector/spanmetricsconnector - v0.114.0 -- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/connector/datadogconnector v0.114.0 exporters: -- gomod: go.opentelemetry.io/collector/exporter/debugexporter v0.114.0 -- gomod: go.opentelemetry.io/collector/exporter/nopexporter v0.114.0 -- gomod: go.opentelemetry.io/collector/exporter/otlpexporter v0.114.0 -- gomod: go.opentelemetry.io/collector/exporter/otlphttpexporter v0.114.0 +- gomod: go.opentelemetry.io/collector/exporter/debugexporter v0.115.0 +- gomod: go.opentelemetry.io/collector/exporter/nopexporter v0.115.0 +- gomod: go.opentelemetry.io/collector/exporter/otlpexporter v0.115.0 +- gomod: go.opentelemetry.io/collector/exporter/otlphttpexporter v0.115.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/sapmexporter - v0.114.0 + v0.115.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/datadogexporter - v0.114.0 + v0.115.0 extensions: - gomod: github.com/DataDog/datadog-agent/comp/otelcol/ddflareextension/impl v0.61.0 path: ./comp/otelcol/ddflareextension/impl -- gomod: go.opentelemetry.io/collector/extension/zpagesextension v0.114.0 +- gomod: go.opentelemetry.io/collector/extension/zpagesextension v0.115.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/healthcheckextension - v0.114.0 + v0.115.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/pprofextension - v0.114.0 + v0.115.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/dockerobserver - v0.114.0 + v0.115.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/ecsobserver - v0.114.0 + v0.115.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/ecstaskobserver - v0.114.0 + v0.115.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/hostobserver - v0.114.0 + v0.115.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/k8sobserver - v0.114.0 + v0.115.0 processors: -- gomod: go.opentelemetry.io/collector/processor/batchprocessor v0.114.0 -- gomod: go.opentelemetry.io/collector/processor/memorylimiterprocessor v0.114.0 +- gomod: go.opentelemetry.io/collector/processor/batchprocessor v0.115.0 +- gomod: go.opentelemetry.io/collector/processor/memorylimiterprocessor v0.115.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/attributesprocessor - v0.114.0 + v0.115.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/cumulativetodeltaprocessor - v0.114.0 + v0.115.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/filterprocessor - v0.114.0 + v0.115.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/groupbyattrsprocessor - v0.114.0 + v0.115.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/k8sattributesprocessor - v0.114.0 + v0.115.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/probabilisticsamplerprocessor - v0.114.0 + v0.115.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor - v0.114.0 + v0.115.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourceprocessor - v0.114.0 + v0.115.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/routingprocessor - v0.114.0 + v0.115.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/tailsamplingprocessor - v0.114.0 + v0.115.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor - v0.114.0 + v0.115.0 providers: -- gomod: go.opentelemetry.io/collector/confmap/provider/envprovider v1.20.0 -- gomod: go.opentelemetry.io/collector/confmap/provider/fileprovider v1.20.0 -- gomod: go.opentelemetry.io/collector/confmap/provider/httpprovider v1.20.0 -- gomod: go.opentelemetry.io/collector/confmap/provider/httpsprovider v1.20.0 -- gomod: go.opentelemetry.io/collector/confmap/provider/yamlprovider v1.20.0 +- gomod: go.opentelemetry.io/collector/confmap/provider/envprovider v1.21.0 +- gomod: go.opentelemetry.io/collector/confmap/provider/fileprovider v1.21.0 +- gomod: go.opentelemetry.io/collector/confmap/provider/httpprovider v1.21.0 +- gomod: go.opentelemetry.io/collector/confmap/provider/httpsprovider v1.21.0 +- gomod: go.opentelemetry.io/collector/confmap/provider/yamlprovider v1.21.0 receivers: -- gomod: go.opentelemetry.io/collector/receiver/nopreceiver v0.114.0 -- gomod: go.opentelemetry.io/collector/receiver/otlpreceiver v0.114.0 +- gomod: go.opentelemetry.io/collector/receiver/nopreceiver v0.115.0 +- gomod: go.opentelemetry.io/collector/receiver/otlpreceiver v0.115.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filelogreceiver - v0.114.0 + v0.115.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/fluentforwardreceiver - v0.114.0 + v0.115.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver - v0.114.0 + v0.115.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/jaegerreceiver - v0.114.0 + v0.115.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusreceiver - v0.114.0 + v0.115.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/receivercreator - v0.114.0 + v0.115.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/zipkinreceiver - v0.114.0 -converters: -- gomod: github.com/DataDog/datadog-agent/comp/otelcol/converter/impl v0.61.0 - path: ./comp/otelcol/converter/impl + v0.115.0 diff --git a/test/otel/testdata/ocb_build_script.sh b/test/otel/testdata/ocb_build_script.sh index 6aaf8bfeb36b4..9f451624eb3ae 100755 --- a/test/otel/testdata/ocb_build_script.sh +++ b/test/otel/testdata/ocb_build_script.sh @@ -4,12 +4,22 @@ OTELCOL_PID=0 mkdir -p /tmp/otel-ci trap 'rm -rf /tmp/otel-ci && kill $OTELCOL_PID' EXIT + +current_dir=$(pwd) cp ./test/otel/testdata/builder-config.yaml /tmp/otel-ci/ +# Get path of all datadog modules, in sorted order, without the initial dot +dd_mods=$(find . -type f -name "go.mod" -exec dirname {} \; | sort | sed 's/.//') +echo "replaces:" >> "/tmp/otel-ci/builder-config.yaml" +for mod in $dd_mods; do + echo "- github.com/DataDog/datadog-agent$mod => $current_dir$mod" >> /tmp/otel-ci/builder-config.yaml +done +echo "added all datadog-agent modules to ocb builder-config replacements" + cp ./test/otel/testdata/collector-config.yaml /tmp/otel-ci/ cp ./tools/ci/retry.sh /tmp/otel-ci/ chmod +x /tmp/otel-ci/retry.sh -OCB_VERSION="0.114.0" +OCB_VERSION="0.115.0" CGO_ENABLED=0 go install -trimpath -ldflags="-s -w" go.opentelemetry.io/collector/cmd/builder@v${OCB_VERSION} mv "$(go env GOPATH)/bin/builder" /tmp/otel-ci/ocb diff --git a/test/regression/cases/file_to_blackhole_0ms_latency/experiment.yaml b/test/regression/cases/file_to_blackhole_0ms_latency/experiment.yaml index b445834c940d6..0d3dba0eb57f2 100644 --- a/test/regression/cases/file_to_blackhole_0ms_latency/experiment.yaml +++ b/test/regression/cases/file_to_blackhole_0ms_latency/experiment.yaml @@ -3,9 +3,8 @@ erratic: false target: name: datadog-agent - command: /bin/entrypoint.sh - cpu_allotment: 8 - memory_allotment: 30g + cpu_allotment: 4 + memory_allotment: 2GiB environment: DD_API_KEY: 00000001 diff --git a/test/regression/cases/file_to_blackhole_0ms_latency_http1/experiment.yaml b/test/regression/cases/file_to_blackhole_0ms_latency_http1/experiment.yaml index c51505add2bb6..0d3dba0eb57f2 100644 --- a/test/regression/cases/file_to_blackhole_0ms_latency_http1/experiment.yaml +++ b/test/regression/cases/file_to_blackhole_0ms_latency_http1/experiment.yaml @@ -3,9 +3,8 @@ erratic: false target: name: datadog-agent - command: /bin/entrypoint.sh - cpu_allotment: 8 - memory_allotment: 1.5GiB + cpu_allotment: 4 + memory_allotment: 2GiB environment: DD_API_KEY: 00000001 diff --git a/test/regression/cases/file_to_blackhole_0ms_latency_http2/experiment.yaml b/test/regression/cases/file_to_blackhole_0ms_latency_http2/experiment.yaml index c51505add2bb6..0d3dba0eb57f2 100644 --- a/test/regression/cases/file_to_blackhole_0ms_latency_http2/experiment.yaml +++ b/test/regression/cases/file_to_blackhole_0ms_latency_http2/experiment.yaml @@ -3,9 +3,8 @@ erratic: false target: name: datadog-agent - command: /bin/entrypoint.sh - cpu_allotment: 8 - memory_allotment: 1.5GiB + cpu_allotment: 4 + memory_allotment: 2GiB environment: DD_API_KEY: 00000001 diff --git a/test/regression/cases/file_to_blackhole_1000ms_latency/experiment.yaml b/test/regression/cases/file_to_blackhole_1000ms_latency/experiment.yaml index ccca15933f243..a1b83cb9c0a98 100644 --- a/test/regression/cases/file_to_blackhole_1000ms_latency/experiment.yaml +++ b/test/regression/cases/file_to_blackhole_1000ms_latency/experiment.yaml @@ -3,9 +3,8 @@ erratic: false target: name: datadog-agent - command: /bin/entrypoint.sh - cpu_allotment: 8 - memory_allotment: 4GiB + cpu_allotment: 4 + memory_allotment: 2GiB environment: DD_API_KEY: 00000001 diff --git a/test/regression/cases/file_to_blackhole_1000ms_latency_linear_load/experiment.yaml b/test/regression/cases/file_to_blackhole_1000ms_latency_linear_load/experiment.yaml index 215dcfa86cc48..b252bbe75d094 100644 --- a/test/regression/cases/file_to_blackhole_1000ms_latency_linear_load/experiment.yaml +++ b/test/regression/cases/file_to_blackhole_1000ms_latency_linear_load/experiment.yaml @@ -3,9 +3,8 @@ erratic: false target: name: datadog-agent - command: /bin/entrypoint.sh - cpu_allotment: 8 - memory_allotment: 30g + cpu_allotment: 4 + memory_allotment: 2GiB environment: DD_API_KEY: 00000001 diff --git a/test/regression/cases/file_to_blackhole_100ms_latency/experiment.yaml b/test/regression/cases/file_to_blackhole_100ms_latency/experiment.yaml index 68432ca735b1c..1db5b405767ff 100644 --- a/test/regression/cases/file_to_blackhole_100ms_latency/experiment.yaml +++ b/test/regression/cases/file_to_blackhole_100ms_latency/experiment.yaml @@ -3,9 +3,8 @@ erratic: false target: name: datadog-agent - command: /bin/entrypoint.sh - cpu_allotment: 8 - memory_allotment: 4GiB + cpu_allotment: 4 + memory_allotment: 2GiB environment: DD_API_KEY: 00000001 diff --git a/test/regression/cases/file_to_blackhole_500ms_latency/experiment.yaml b/test/regression/cases/file_to_blackhole_500ms_latency/experiment.yaml index 68432ca735b1c..1db5b405767ff 100644 --- a/test/regression/cases/file_to_blackhole_500ms_latency/experiment.yaml +++ b/test/regression/cases/file_to_blackhole_500ms_latency/experiment.yaml @@ -3,9 +3,8 @@ erratic: false target: name: datadog-agent - command: /bin/entrypoint.sh - cpu_allotment: 8 - memory_allotment: 4GiB + cpu_allotment: 4 + memory_allotment: 2GiB environment: DD_API_KEY: 00000001 diff --git a/test/regression/cases/file_tree/experiment.yaml b/test/regression/cases/file_tree/experiment.yaml index 6c67c51ef14a5..1edff05390f25 100644 --- a/test/regression/cases/file_tree/experiment.yaml +++ b/test/regression/cases/file_tree/experiment.yaml @@ -3,9 +3,8 @@ erratic: false target: name: datadog-agent - command: /bin/entrypoint.sh - cpu_allotment: 8 - memory_allotment: 4GiB + cpu_allotment: 4 + memory_allotment: 2GiB environment: DD_API_KEY: 00000001 diff --git a/test/regression/cases/quality_gate_idle/experiment.yaml b/test/regression/cases/quality_gate_idle/experiment.yaml index 6555258f34601..d17ce5548c2fe 100644 --- a/test/regression/cases/quality_gate_idle/experiment.yaml +++ b/test/regression/cases/quality_gate_idle/experiment.yaml @@ -8,8 +8,7 @@ erratic: false target: name: datadog-agent - command: /bin/entrypoint.sh - cpu_allotment: 8 + cpu_allotment: 4 memory_allotment: 500MiB environment: @@ -36,7 +35,7 @@ checks: description: "Memory usage quality gate. This puts a bound on the total agent memory usage." bounds: series: total_rss_bytes - upper_bound: "390.0 MiB" + upper_bound: "372.0 MiB" report_links: - text: "bounds checks dashboard" diff --git a/test/regression/cases/quality_gate_idle_all_features/experiment.yaml b/test/regression/cases/quality_gate_idle_all_features/experiment.yaml index 624b68caeab20..34e8e63fd4cf5 100644 --- a/test/regression/cases/quality_gate_idle_all_features/experiment.yaml +++ b/test/regression/cases/quality_gate_idle_all_features/experiment.yaml @@ -8,8 +8,7 @@ erratic: false target: name: datadog-agent - command: /bin/entrypoint.sh - cpu_allotment: 8 + cpu_allotment: 4 memory_allotment: 1GiB environment: @@ -47,7 +46,7 @@ checks: description: "Memory usage quality gate. This puts a bound on the total agent memory usage." bounds: series: total_rss_bytes - upper_bound: "795.0 MiB" + upper_bound: "779.0 MiB" report_links: - text: "bounds checks dashboard" diff --git a/test/regression/cases/quality_gate_logs/experiment.yaml b/test/regression/cases/quality_gate_logs/experiment.yaml index b1b2d9ee9c02b..182f50e8679c4 100644 --- a/test/regression/cases/quality_gate_logs/experiment.yaml +++ b/test/regression/cases/quality_gate_logs/experiment.yaml @@ -3,9 +3,8 @@ erratic: false target: name: datadog-agent - command: /bin/entrypoint.sh - cpu_allotment: 8 - memory_allotment: 4GiB + cpu_allotment: 4 + memory_allotment: 500MiB environment: DD_API_KEY: 00000001 @@ -29,7 +28,7 @@ checks: description: "Memory usage" bounds: series: total_rss_bytes - upper_bound: 440MiB + upper_bound: 429MiB - name: lost_bytes description: "Allowable bytes not polled by log Agent" diff --git a/test/regression/cases/tcp_dd_logs_filter_exclude/experiment.yaml b/test/regression/cases/tcp_dd_logs_filter_exclude/experiment.yaml index 17a5adb011dd1..461bbc607eb8b 100644 --- a/test/regression/cases/tcp_dd_logs_filter_exclude/experiment.yaml +++ b/test/regression/cases/tcp_dd_logs_filter_exclude/experiment.yaml @@ -3,9 +3,8 @@ erratic: false target: name: datadog-agent - command: /bin/entrypoint.sh - cpu_allotment: 8 - memory_allotment: 4GiB + cpu_allotment: 4 + memory_allotment: 2GiB environment: DD_API_KEY: 00000001 diff --git a/test/regression/cases/tcp_syslog_to_blackhole/experiment.yaml b/test/regression/cases/tcp_syslog_to_blackhole/experiment.yaml index f9168734cf9e7..5de7351418822 100644 --- a/test/regression/cases/tcp_syslog_to_blackhole/experiment.yaml +++ b/test/regression/cases/tcp_syslog_to_blackhole/experiment.yaml @@ -3,9 +3,8 @@ erratic: false target: name: datadog-agent - command: /bin/entrypoint.sh - cpu_allotment: 8 - memory_allotment: 4GiB + cpu_allotment: 4 + memory_allotment: 2GiB environment: DD_API_KEY: 00000001 diff --git a/test/regression/cases/uds_dogstatsd_to_api/experiment.yaml b/test/regression/cases/uds_dogstatsd_to_api/experiment.yaml index fe93432493ecf..b8e40dac08462 100644 --- a/test/regression/cases/uds_dogstatsd_to_api/experiment.yaml +++ b/test/regression/cases/uds_dogstatsd_to_api/experiment.yaml @@ -3,9 +3,8 @@ erratic: false target: name: datadog-agent - command: /bin/entrypoint.sh - cpu_allotment: 8 - memory_allotment: 4GiB + cpu_allotment: 4 + memory_allotment: 2GiB environment: DD_API_KEY: 00000001 diff --git a/test/regression/cases/uds_dogstatsd_to_api_cpu/experiment.yaml b/test/regression/cases/uds_dogstatsd_to_api_cpu/experiment.yaml index ccb9f7b4e4866..c51909b2f72ee 100644 --- a/test/regression/cases/uds_dogstatsd_to_api_cpu/experiment.yaml +++ b/test/regression/cases/uds_dogstatsd_to_api_cpu/experiment.yaml @@ -3,9 +3,8 @@ erratic: false target: name: datadog-agent - command: /bin/entrypoint.sh - cpu_allotment: 8 - memory_allotment: 4GiB + cpu_allotment: 4 + memory_allotment: 2GiB environment: DD_API_KEY: 00000001 diff --git a/test/regression/config.yaml b/test/regression/config.yaml index 362301357f864..7a9684510426a 100644 --- a/test/regression/config.yaml +++ b/test/regression/config.yaml @@ -1,9 +1,7 @@ lading: - version: 0.24.0 + version: 0.25.2 target: - cpu_allotment: 8 - memory_allotment: 30g # Link templates for reports. # diff --git a/test/regression/cases/otel_to_otel_logs/datadog-agent/datadog.yaml b/test/regression/disabled-cases/otel_to_otel_logs/datadog-agent/datadog.yaml similarity index 100% rename from test/regression/cases/otel_to_otel_logs/datadog-agent/datadog.yaml rename to test/regression/disabled-cases/otel_to_otel_logs/datadog-agent/datadog.yaml diff --git a/test/regression/cases/otel_to_otel_logs/experiment.yaml b/test/regression/disabled-cases/otel_to_otel_logs/experiment.yaml similarity index 96% rename from test/regression/cases/otel_to_otel_logs/experiment.yaml rename to test/regression/disabled-cases/otel_to_otel_logs/experiment.yaml index dfbe54658435f..e4b260015988f 100644 --- a/test/regression/cases/otel_to_otel_logs/experiment.yaml +++ b/test/regression/disabled-cases/otel_to_otel_logs/experiment.yaml @@ -3,7 +3,6 @@ erratic: false target: name: datadog-agent - command: /bin/entrypoint.sh cpu_allotment: 8 memory_allotment: 24GiB diff --git a/test/regression/cases/otel_to_otel_logs/lading/lading.yaml b/test/regression/disabled-cases/otel_to_otel_logs/lading/lading.yaml similarity index 100% rename from test/regression/cases/otel_to_otel_logs/lading/lading.yaml rename to test/regression/disabled-cases/otel_to_otel_logs/lading/lading.yaml diff --git a/tools/windows/DatadogAgentInstaller/CustomActions/ConfigureUserCustomActions.cs b/tools/windows/DatadogAgentInstaller/CustomActions/ConfigureUserCustomActions.cs index 1447f8a080fd0..817f118b0c797 100644 --- a/tools/windows/DatadogAgentInstaller/CustomActions/ConfigureUserCustomActions.cs +++ b/tools/windows/DatadogAgentInstaller/CustomActions/ConfigureUserCustomActions.cs @@ -586,9 +586,6 @@ private List PathsWithAgentAccess() // agent needs to be able to write to run/ // agent needs to be able to create auth_token _session.Property("APPLICATIONDATADIRECTORY"), - // allow agent to write __pycache__ - Path.Combine(_session.Property("PROJECTLOCATION"), "embedded2"), - Path.Combine(_session.Property("PROJECTLOCATION"), "embedded3"), }; }