Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] main from DataDog:main #57

Merged
merged 10 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 0 additions & 42 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -236,58 +236,16 @@ variables:

# Start aws ssm variables
# They must be defined as environment variables in the GitLab CI/CD settings, to ease rotation if needed
AGENT_QA_PROFILE: ci.datadog-agent.agent-qa-profile # agent-devx-infra
API_KEY_ORG2: ci.datadog-agent.datadog_api_key_org2 # agent-devx-infra
API_KEY_DDDEV: ci.datadog-agent.datadog_api_key # agent-devx-infra
APP_KEY_ORG2: ci.datadog-agent.datadog_app_key_org2 # agent-devx-infra
CHANGELOG_COMMIT_SHA: ci.datadog-agent.gitlab_changelog_commit_sha # agent-devx-infra
CHOCOLATEY_API_KEY: ci.datadog-agent.chocolatey_api_key # windows-agent
CODECOV_TOKEN: ci.datadog-agent.codecov_token # agent-devx-infra
DEB_GPG_KEY: ci.datadog-agent.deb_signing_private_key_${DEB_GPG_KEY_ID} # agent-delivery
DEB_SIGNING_PASSPHRASE: ci.datadog-agent.deb_signing_key_passphrase_${DEB_GPG_KEY_ID} # agent-delivery
DOCKER_REGISTRY_LOGIN: ci.datadog-agent.docker_hub_login # container-integrations
DOCKER_REGISTRY_PWD: ci.datadog-agent.docker_hub_pwd # container-integrations
E2E_TESTS_API_KEY: ci.datadog-agent.e2e_tests_api_key # agent-devx-loops
E2E_TESTS_APP_KEY: ci.datadog-agent.e2e_tests_app_key # agent-devx-loops
E2E_TESTS_RC_KEY: ci.datadog-agent.e2e_tests_rc_key # agent-devx-loops
E2E_TESTS_AZURE_CLIENT_ID: ci.datadog-agent.e2e_tests_azure_client_id # agent-devx-loops
E2E_TESTS_AZURE_CLIENT_SECRET: ci.datadog-agent.e2e_tests_azure_client_secret # agent-devx-loops
E2E_TESTS_AZURE_TENANT_ID: ci.datadog-agent.e2e_tests_azure_tenant_id # agent-devx-loops
E2E_TESTS_AZURE_SUBSCRIPTION_ID: ci.datadog-agent.e2e_tests_azure_subscription_id # agent-devx-loops
E2E_TESTS_GCP_CREDENTIALS: ci.datadog-agent.e2e_tests_gcp_credentials # agent-devx-loops
KITCHEN_EC2_SSH_KEY: ci.datadog-agent.aws_ec2_kitchen_ssh_key # agent-devx-loops
KITCHEN_AZURE_CLIENT_ID: ci.datadog-agent.azure_kitchen_client_id # agent-devx-loops
KITCHEN_AZURE_CLIENT_SECRET: ci.datadog-agent.azure_kitchen_client_secret # agent-devx-loops
KITCHEN_AZURE_SUBSCRIPTION_ID: ci.datadog-agent.azure_kitchen_subscription_id # agent-devx-loops
KITCHEN_AZURE_TENANT_ID: ci.datadog-agent.azure_kitchen_tenant_id # agent-devx-loops
GITHUB_PR_COMMENTER_APP_KEY: pr-commenter.github_app_key # agent-devx-infra
GITHUB_PR_COMMENTER_INTEGRATION_ID: pr-commenter.github_integration_id # agent-devx-infra
GITHUB_PR_COMMENTER_INSTALLATION_ID: pr-commenter.github_installation_id # agent-devx-infra
GITLAB_SCHEDULER_TOKEN: ci.datadog-agent.gitlab_pipelines_scheduler_token # ci-cd
GITLAB_READ_API_TOKEN: ci.datadog-agent.gitlab_read_api_token # ci-cd
GITLAB_FULL_API_TOKEN: ci.datadog-agent.gitlab_full_api_token # ci-cd
INSTALL_SCRIPT_API_KEY: ci.agent-linux-install-script.datadog_api_key_2 # agent-delivery
JIRA_READ_API_TOKEN: ci.datadog-agent.jira_read_api_token # agent-devx-infra
AGENT_GITHUB_APP_ID: ci.datadog-agent.platform-github-app-id # agent-devx-infra
AGENT_GITHUB_INSTALLATION_ID: ci.datadog-agent.platform-github-app-installation-id # agent-devx-infra
AGENT_GITHUB_KEY: ci.datadog-agent.platform-github-app-key # agent-devx-infra
MACOS_GITHUB_APP_ID: ci.datadog-agent.macos_github_app_id # agent-devx-infra
MACOS_GITHUB_INSTALLATION_ID: ci.datadog-agent.macos_github_installation_id # agent-devx-infra
MACOS_GITHUB_KEY: ci.datadog-agent.macos_github_key_b64 # agent-devx-infra
MACOS_GITHUB_APP_ID_2: ci.datadog-agent.macos_github_app_id_2 # agent-devx-infra
MACOS_GITHUB_INSTALLATION_ID_2: ci.datadog-agent.macos_github_installation_id_2 # agent-devx-infra
MACOS_GITHUB_KEY_2: ci.datadog-agent.macos_github_key_b64_2 # agent-devx-infra
RPM_GPG_KEY: ci.datadog-agent.rpm_signing_private_key_${RPM_GPG_KEY_ID} # agent-delivery
RPM_SIGNING_PASSPHRASE: ci.datadog-agent.rpm_signing_key_passphrase_${RPM_GPG_KEY_ID} # agent-delivery
SLACK_AGENT_CI_TOKEN: ci.datadog-agent.slack_agent_ci_token # agent-devx-infra
SMP_ACCOUNT_ID: ci.datadog-agent.single-machine-performance-account-id # single-machine-performance
SMP_AGENT_TEAM_ID: ci.datadog-agent.single-machine-performance-agent-team-id # single-machine-performance
SMP_API: ci.datadog-agent.single-machine-performance-api # single-machine-performance
SMP_BOT_ACCESS_KEY: ci.datadog-agent.single-machine-performance-bot-access-key # single-machine-performance
SMP_BOT_ACCESS_KEY_ID: ci.datadog-agent.single-machine-performance-bot-access-key-id # single-machine-performance
SSH_KEY: ci.datadog-agent.ssh_key # system-probe
SSH_KEY_RSA: ci.datadog-agent.ssh_key_rsa # agent-devx-loops
SSH_PUBLIC_KEY_RSA: ci.datadog-agent.ssh_public_key_rsa # agent-devx-loops
VCPKG_BLOB_SAS_URL: ci.datadog-agent-buildimages.vcpkg_blob_sas_url # windows-agent
WINGET_PAT: ci.datadog-agent.winget_pat # windows-agent
# End aws ssm variables
Expand Down
16 changes: 8 additions & 8 deletions .gitlab/container_build/docker_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ docker_build_agent7:
IMAGE: registry.ddbuild.io/ci/datadog-agent/agent
BUILD_CONTEXT: Dockerfiles/agent
TAG_SUFFIX: -7
BUILD_ARG: --target test --build-arg PYTHON_VERSION=3 --build-arg DD_AGENT_ARTIFACT=datadog-agent-7*-amd64.tar.xz
BUILD_ARG: --target test --build-arg DD_AGENT_ARTIFACT=datadog-agent-7*-amd64.tar.xz

single_machine_performance-amd64-a7:
extends: .docker_publish_job_definition
Expand All @@ -87,7 +87,7 @@ docker_build_agent7_arm64:
IMAGE: registry.ddbuild.io/ci/datadog-agent/agent
BUILD_CONTEXT: Dockerfiles/agent
TAG_SUFFIX: -7
BUILD_ARG: --target test --build-arg PYTHON_VERSION=3 --build-arg DD_AGENT_ARTIFACT=datadog-agent-7*-arm64.tar.xz
BUILD_ARG: --target test --build-arg DD_AGENT_ARTIFACT=datadog-agent-7*-arm64.tar.xz

# build agent7 jmx image
docker_build_agent7_jmx:
Expand All @@ -101,7 +101,7 @@ docker_build_agent7_jmx:
IMAGE: registry.ddbuild.io/ci/datadog-agent/agent
BUILD_CONTEXT: Dockerfiles/agent
TAG_SUFFIX: -7-jmx
BUILD_ARG: --target test --build-arg WITH_JMX=true --build-arg PYTHON_VERSION=3 --build-arg DD_AGENT_ARTIFACT=datadog-agent-7*-amd64.tar.xz
BUILD_ARG: --target test --build-arg WITH_JMX=true --build-arg DD_AGENT_ARTIFACT=datadog-agent-7*-amd64.tar.xz

docker_build_agent7_jmx_arm64:
extends: [.docker_build_job_definition_arm64, .docker_build_artifact]
Expand All @@ -114,7 +114,7 @@ docker_build_agent7_jmx_arm64:
IMAGE: registry.ddbuild.io/ci/datadog-agent/agent
BUILD_CONTEXT: Dockerfiles/agent
TAG_SUFFIX: -7-jmx
BUILD_ARG: --target test --build-arg WITH_JMX=true --build-arg PYTHON_VERSION=3 --build-arg DD_AGENT_ARTIFACT=datadog-agent-7*-arm64.tar.xz
BUILD_ARG: --target test --build-arg WITH_JMX=true --build-arg DD_AGENT_ARTIFACT=datadog-agent-7*-arm64.tar.xz

# build agent7 UA image
docker_build_ot_agent7:
Expand All @@ -128,7 +128,7 @@ docker_build_ot_agent7:
IMAGE: registry.ddbuild.io/ci/datadog-agent/agent
BUILD_CONTEXT: Dockerfiles/agent
TAG_SUFFIX: -7-ot-beta
BUILD_ARG: --target test --build-arg PYTHON_VERSION=3 --build-arg DD_AGENT_ARTIFACT=datadog-ot-agent-7*-amd64.tar.xz
BUILD_ARG: --target test --build-arg DD_AGENT_ARTIFACT=datadog-ot-agent-7*-amd64.tar.xz

docker_build_ot_agent7_arm64:
extends: [.docker_build_job_definition_arm64, .docker_build_artifact]
Expand All @@ -141,7 +141,7 @@ docker_build_ot_agent7_arm64:
IMAGE: registry.ddbuild.io/ci/datadog-agent/agent
BUILD_CONTEXT: Dockerfiles/agent
TAG_SUFFIX: -7-ot-beta
BUILD_ARG: --target test --build-arg PYTHON_VERSION=3 --build-arg DD_AGENT_ARTIFACT=datadog-ot-agent-7*-arm64.tar.xz
BUILD_ARG: --target test --build-arg DD_AGENT_ARTIFACT=datadog-ot-agent-7*-arm64.tar.xz

# build agent7 jmx image
docker_build_ot_agent7_jmx:
Expand All @@ -155,7 +155,7 @@ docker_build_ot_agent7_jmx:
IMAGE: registry.ddbuild.io/ci/datadog-agent/agent
BUILD_CONTEXT: Dockerfiles/agent
TAG_SUFFIX: -7-ot-beta-jmx
BUILD_ARG: --target test --build-arg WITH_JMX=true --build-arg PYTHON_VERSION=3 --build-arg DD_AGENT_ARTIFACT=datadog-ot-agent-7*-amd64.tar.xz
BUILD_ARG: --target test --build-arg WITH_JMX=true --build-arg DD_AGENT_ARTIFACT=datadog-ot-agent-7*-amd64.tar.xz

docker_build_ot_agent7_jmx_arm64:
extends: [.docker_build_job_definition_arm64, .docker_build_artifact]
Expand All @@ -168,7 +168,7 @@ docker_build_ot_agent7_jmx_arm64:
IMAGE: registry.ddbuild.io/ci/datadog-agent/agent
BUILD_CONTEXT: Dockerfiles/agent
TAG_SUFFIX: -7-ot-beta-jmx
BUILD_ARG: --target test --build-arg WITH_JMX=true --build-arg PYTHON_VERSION=3 --build-arg DD_AGENT_ARTIFACT=datadog-ot-agent-7*-arm64.tar.xz
BUILD_ARG: --target test --build-arg WITH_JMX=true --build-arg DD_AGENT_ARTIFACT=datadog-ot-agent-7*-arm64.tar.xz

# build the cluster-agent image
docker_build_cluster_agent_amd64:
Expand Down
4 changes: 1 addition & 3 deletions .gitlab/lint/technical_linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
stage: lint
image: registry.ddbuild.io/ci/datadog-agent-buildimages/deb_x64$DATADOG_AGENT_BUILDIMAGES_SUFFIX:$DATADOG_AGENT_BUILDIMAGES
tags: ["arch:amd64"]
needs: []

lint_licenses:
extends: .lint
Expand Down Expand Up @@ -46,19 +47,16 @@ lint_components:

lint_python:
extends: .lint
needs: []
script:
- inv -e linter.python

lint_update_go:
extends: .lint
needs: []
script:
- inv -e linter.update-go

validate_modules:
extends: .lint
needs: []
script:
- inv -e modules.validate
- inv -e modules.validate-used-by-otel
4 changes: 2 additions & 2 deletions .gitlab/source_test/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ tests_macos:
- 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 $COVERAGE_CACHE_FLAG
- 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"
Expand Down Expand Up @@ -51,7 +51,7 @@ tests_macos:
- inv -e gitlab.generate-ci-visibility-links --output=$EXTERNAL_LINKS_PATH
- FAST_TESTS_FLAG=""
- if [[ "$FAST_TESTS" == "true" ]]; then FAST_TESTS_FLAG="--only-impacted-packages"; fi
- inv -e test --rerun-fails=2 --race --profile --cpus 12 --save-result-json $TEST_OUTPUT_FILE --junit-tar "junit-${CI_JOB_NAME}.tgz" $FAST_TESTS_FLAG --test-washer
- inv -e test --rerun-fails=2 --race --profile --cpus 12 --save-result-json $TEST_OUTPUT_FILE --junit-tar "junit-${CI_JOB_NAME}.tgz" $FAST_TESTS_FLAG --test-washer --coverage
- inv -e invoke-unit-tests
artifacts:
expire_in: 2 weeks
Expand Down
29 changes: 0 additions & 29 deletions Dockerfiles/agent/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ RUN gcc -pipe -Wall -Wextra -O2 -shared -fPIC -Wl,--version-script=/tmp/nosys.sy
FROM baseimage AS extract
ARG TARGETARCH
ARG WITH_JMX
ARG PYTHON_VERSION
ARG DD_AGENT_ARTIFACT=datadog-agent*-$TARGETARCH.tar.xz
ARG GENERAL_ARTIFACTS_CACHE_BUCKET_URL

Expand Down Expand Up @@ -75,25 +74,6 @@ RUN find / -maxdepth 1 -name "${DD_AGENT_ARTIFACT}" -exec tar xvf {} -C . \; \
opt/datadog-agent/embedded/share/man \
# self-test certificates that are detected (false positive) as private keys
opt/datadog-agent/embedded/lib/python*/site-packages/future/backports/test \
&& if [ "$PYTHON_VERSION" = "2" ]; then \
rm -rf \
opt/datadog-agent/embedded/bin/2to3-3* \
opt/datadog-agent/embedded/bin/easy_install-3* \
opt/datadog-agent/embedded/bin/idle* \
opt/datadog-agent/embedded/bin/pip3* \
opt/datadog-agent/embedded/bin/pydoc* \
opt/datadog-agent/embedded/bin/python3* \
opt/datadog-agent/embedded/bin/pyvenv* \
opt/datadog-agent/embedded/include/python3* \
opt/datadog-agent/embedded/lib/*python3* || true ;\
fi \
&& if [ "$PYTHON_VERSION" = "3" ]; then \
rm -rf \
opt/datadog-agent/embedded/bin/pip2* \
opt/datadog-agent/embedded/bin/python2* \
opt/datadog-agent/embedded/include/python2* \
opt/datadog-agent/embedded/lib/*python2* || true ;\
fi \
&& find opt/datadog-agent/ -iname "*.a" -delete \
&& if [ -z "$WITH_JMX" ]; then rm -rf opt/datadog-agent/bin/agent/dist/jmx; fi \
&& mkdir conf.d checks.d
Expand All @@ -116,11 +96,9 @@ RUN if [ -n "$WITH_JMX" ]; then cd /opt/bouncycastle-fips && mvn dependency:copy
FROM baseimage AS release
LABEL maintainer="Datadog <package@datadoghq.com>"
ARG WITH_JMX
ARG PYTHON_VERSION
ARG DD_GIT_REPOSITORY_URL
ARG DD_GIT_COMMIT_SHA
ENV DOCKER_DD_AGENT=true \
DD_PYTHON_VERSION=$PYTHON_VERSION \
PATH=/opt/datadog-agent/bin/agent/:/opt/datadog-agent/embedded/bin/:$PATH \
CURL_CA_BUNDLE=/opt/datadog-agent/embedded/ssl/certs/cacert.pem \
# Pass envvar variables to agents
Expand Down Expand Up @@ -202,13 +180,6 @@ RUN tar xzf s6.tgz -C / --exclude="./bin" \
# * https://datadoghq.atlassian.net/wiki/spaces/TS/pages/2615709591/Why+the+containerized+Agent+runs+as+root#Agent-user
RUN [ "$(getent passwd dd-agent | cut -d: -f 3)" -eq 100 ]

# Update links to python binaries
RUN if [ -n "$PYTHON_VERSION" ]; then \
ln -sfn /opt/datadog-agent/embedded/bin/python${PYTHON_VERSION} /opt/datadog-agent/embedded/bin/python \
&& ln -sfn /opt/datadog-agent/embedded/bin/python${PYTHON_VERSION}-config /opt/datadog-agent/embedded/bin/python-config \
&& ln -sfn /opt/datadog-agent/embedded/bin/pip${PYTHON_VERSION} /opt/datadog-agent/embedded/bin/pip ; \
fi

# Override the exit script by ours to fix --pid=host operations
RUN mv /etc/s6/init/init-stage3 /etc/s6/init/init-stage3-original
COPY init-stage3 /etc/s6/init/init-stage3
Expand Down
2 changes: 2 additions & 0 deletions cmd/system-probe/api/module/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ package module
import (
"errors"

tagger "github.com/DataDog/datadog-agent/comp/core/tagger/def"
"github.com/DataDog/datadog-agent/comp/core/telemetry"
workloadmeta "github.com/DataDog/datadog-agent/comp/core/workloadmeta/def"
"go.uber.org/fx"
Expand All @@ -30,5 +31,6 @@ type FactoryDependencies struct {
fx.In

WMeta workloadmeta.Component
Tagger tagger.Component
Telemetry telemetry.Component
}
7 changes: 5 additions & 2 deletions cmd/system-probe/api/module/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"github.com/gorilla/mux"

sysconfigtypes "github.com/DataDog/datadog-agent/cmd/system-probe/config/types"
tagger "github.com/DataDog/datadog-agent/comp/core/tagger/def"
"github.com/DataDog/datadog-agent/comp/core/telemetry"
workloadmeta "github.com/DataDog/datadog-agent/comp/core/workloadmeta/def"
"github.com/DataDog/datadog-agent/pkg/util/log"
Expand Down Expand Up @@ -63,7 +64,7 @@ func withModule(name sysconfigtypes.ModuleName, fn func()) {
// * Initialization using the provided Factory;
// * Registering the HTTP endpoints of each module;
// * Register the gRPC server;
func Register(cfg *sysconfigtypes.Config, httpMux *mux.Router, factories []Factory, wmeta workloadmeta.Component, telemetry telemetry.Component) error {
func Register(cfg *sysconfigtypes.Config, httpMux *mux.Router, factories []Factory, wmeta workloadmeta.Component, tagger tagger.Component, telemetry telemetry.Component) error {
var enabledModulesFactories []Factory
for _, factory := range factories {
if !cfg.ModuleIsEnabled(factory.Name) {
Expand All @@ -83,6 +84,7 @@ func Register(cfg *sysconfigtypes.Config, httpMux *mux.Router, factories []Facto
withModule(factory.Name, func() {
deps := FactoryDependencies{
WMeta: wmeta,
Tagger: tagger,
Telemetry: telemetry,
}
module, err = factory.Fn(cfg, deps)
Expand Down Expand Up @@ -143,7 +145,7 @@ func GetStats() map[string]interface{} {
}

// RestartModule triggers a module restart
func RestartModule(factory Factory, wmeta workloadmeta.Component, telemetry telemetry.Component) error {
func RestartModule(factory Factory, wmeta workloadmeta.Component, tagger tagger.Component, telemetry telemetry.Component) error {
l.Lock()
defer l.Unlock()

Expand All @@ -162,6 +164,7 @@ func RestartModule(factory Factory, wmeta workloadmeta.Component, telemetry tele
currentModule.Close()
deps := FactoryDependencies{
WMeta: wmeta,
Tagger: tagger,
Telemetry: telemetry,
}
newModule, err = factory.Fn(l.cfg, deps)
Expand Down
5 changes: 3 additions & 2 deletions cmd/system-probe/api/restart.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ import (
"github.com/DataDog/datadog-agent/cmd/system-probe/config"
sysconfigtypes "github.com/DataDog/datadog-agent/cmd/system-probe/config/types"
"github.com/DataDog/datadog-agent/cmd/system-probe/modules"
tagger "github.com/DataDog/datadog-agent/comp/core/tagger/def"
"github.com/DataDog/datadog-agent/comp/core/telemetry"
workloadmeta "github.com/DataDog/datadog-agent/comp/core/workloadmeta/def"
)

func restartModuleHandler(w http.ResponseWriter, r *http.Request, wmeta workloadmeta.Component, telemetry telemetry.Component) {
func restartModuleHandler(w http.ResponseWriter, r *http.Request, wmeta workloadmeta.Component, tagger tagger.Component, telemetry telemetry.Component) {
vars := mux.Vars(r)
moduleName := sysconfigtypes.ModuleName(vars["module-name"])

Expand All @@ -39,7 +40,7 @@ func restartModuleHandler(w http.ResponseWriter, r *http.Request, wmeta workload
return
}

err := module.RestartModule(target, wmeta, telemetry)
err := module.RestartModule(target, wmeta, tagger, telemetry)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
Expand Down
7 changes: 4 additions & 3 deletions cmd/system-probe/api/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,23 @@ import (
"github.com/DataDog/datadog-agent/cmd/system-probe/modules"
"github.com/DataDog/datadog-agent/cmd/system-probe/utils"
"github.com/DataDog/datadog-agent/comp/core/settings"
tagger "github.com/DataDog/datadog-agent/comp/core/tagger/def"
"github.com/DataDog/datadog-agent/comp/core/telemetry"
workloadmeta "github.com/DataDog/datadog-agent/comp/core/workloadmeta/def"
"github.com/DataDog/datadog-agent/pkg/ebpf"
"github.com/DataDog/datadog-agent/pkg/util/log"
)

// StartServer starts the HTTP and gRPC servers for the system-probe, which registers endpoints from all enabled modules.
func StartServer(cfg *sysconfigtypes.Config, telemetry telemetry.Component, wmeta workloadmeta.Component, settings settings.Component) error {
func StartServer(cfg *sysconfigtypes.Config, telemetry telemetry.Component, wmeta workloadmeta.Component, tagger tagger.Component, settings settings.Component) error {
conn, err := server.NewListener(cfg.SocketAddress)
if err != nil {
return err
}

mux := gorilla.NewRouter()

err = module.Register(cfg, mux, modules.All, wmeta, telemetry)
err = module.Register(cfg, mux, modules.All, wmeta, tagger, telemetry)
if err != nil {
return fmt.Errorf("failed to create system probe: %s", err)
}
Expand All @@ -49,7 +50,7 @@ func StartServer(cfg *sysconfigtypes.Config, telemetry telemetry.Component, wmet
setupConfigHandlers(mux, settings)

// Module-restart handler
mux.HandleFunc("/module-restart/{module-name}", func(w http.ResponseWriter, r *http.Request) { restartModuleHandler(w, r, wmeta, telemetry) }).Methods("POST")
mux.HandleFunc("/module-restart/{module-name}", func(w http.ResponseWriter, r *http.Request) { restartModuleHandler(w, r, wmeta, tagger, telemetry) }).Methods("POST")

mux.PathPrefix("/debug/pprof").Handler(http.DefaultServeMux)
mux.Handle("/debug/vars", http.DefaultServeMux)
Expand Down
Loading
Loading