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

Remove dependencies from checks agent #33364

Draft
wants to merge 36 commits into
base: checks-agent-process
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
11cf3f6
update grpc-gateway and remove protoc-gen-swagger
GustavoCaso Jan 21, 2025
785a18d
generate protobuf files
GustavoCaso Jan 21, 2025
429e159
use HTTP for autodiscovery stream
GustavoCaso Jan 21, 2025
27cb3b8
Merge branch 'upgrade-grpc-gateway' into http-stream-autodiscovery-ev…
GustavoCaso Jan 21, 2025
5f3eb42
successful autodiscovery event via HTTP
GustavoCaso Jan 22, 2025
c68a050
remove grpc from remote-tagger
GustavoCaso Jan 22, 2025
4e88e3c
remove grpc from pkg/flare
GustavoCaso Jan 22, 2025
793909c
remove grpc from languageutils and cluster agent util
GustavoCaso Jan 22, 2025
fa792fb
remove more stuff
GustavoCaso Jan 23, 2025
b5fb192
WIP
GustavoCaso Jan 24, 2025
701d764
Merge commit 'fa792fbd7437b70ae322f255bad9734a8967f6ea' into deep-dee…
GustavoCaso Jan 24, 2025
1cb1de0
remove clusteragent direct dependencies from hosttags
GustavoCaso Jan 24, 2025
a9b2e21
remove protobuf from foprwarder retry
GustavoCaso Jan 24, 2025
c26ad50
remove cloudfounfry dependencies
GustavoCaso Jan 24, 2025
c49c588
remove svg and update dependency list
GustavoCaso Jan 24, 2025
9dd5725
Merge branch 'main' into checks-agent-no-grpc
GustavoCaso Jan 24, 2025
54d432e
Merge branch 'main' into deep-deep-no-dependencies
GustavoCaso Jan 24, 2025
af84f15
Merge branch 'deep-deep-no-dependencies' into checks-agent-no-grpc
GustavoCaso Jan 24, 2025
ed2879e
fix a few things with build tags to avoid cloudfoundry getting into t…
GustavoCaso Jan 24, 2025
add9bb9
Merge branch 'checks-agent-process' into remove-dependencies-from-che…
GustavoCaso Jan 24, 2025
d43a487
remove svg
GustavoCaso Jan 24, 2025
9e3da56
update go.mod
GustavoCaso Jan 24, 2025
39da17d
comment out test to ensure CI passes
GustavoCaso Jan 25, 2025
e5bb6e7
return logscompression back :)
GustavoCaso Jan 25, 2025
47eedb9
fix tests and linters
GustavoCaso Jan 25, 2025
f91e4dd
emit mem stats
GustavoCaso Jan 27, 2025
1c488b5
remove demultiplexer and all its dependencies
GustavoCaso Jan 27, 2025
fe9923d
Merge branch 'checks-agent-process' into remove-dependencies-from-che…
GustavoCaso Jan 27, 2025
24c3c5b
Merge branch 'checks-agent-process' into remove-dependencies-from-che…
GustavoCaso Jan 27, 2025
7ce461c
remove landing configuration for checks agent
GustavoCaso Jan 27, 2025
f2c4d91
fix remote tagger url
GustavoCaso Jan 29, 2025
6c3c942
expose remote metrics endpoint
GustavoCaso Jan 29, 2025
e3fd951
extract stream http client. Reuse http client for python->core aggreg…
GustavoCaso Jan 30, 2025
bf9232a
reduce logging for python checks
GustavoCaso Jan 30, 2025
8970e07
remote tagger type to string
GustavoCaso Jan 30, 2025
ba3f12a
add RSS information for Go functions
GustavoCaso Jan 31, 2025
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
205 changes: 205 additions & 0 deletions checks_agent_deps.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,205 @@
github.com/DataDog/datadog-agent/cmd/checks-agent
github.com/DataDog/datadog-agent/cmd/checks-agent/command
github.com/DataDog/datadog-agent/cmd/checks-agent/subcommands/start
github.com/DataDog/datadog-agent/cmd/checks-agent/subcommands/version
github.com/DataDog/datadog-agent/comp/api/api/def
github.com/DataDog/datadog-agent/comp/api/authtoken
github.com/DataDog/datadog-agent/comp/api/authtoken/fetchonlyimpl
github.com/DataDog/datadog-agent/comp/collector/collector
github.com/DataDog/datadog-agent/comp/collector/collector/internal/middleware
github.com/DataDog/datadog-agent/comp/collector/collector/onlycollectorimpl
github.com/DataDog/datadog-agent/comp/core/autodiscovery/integration
github.com/DataDog/datadog-agent/comp/core/config
github.com/DataDog/datadog-agent/comp/core/flare/builder
github.com/DataDog/datadog-agent/comp/core/flare/types
github.com/DataDog/datadog-agent/comp/core/hostname
github.com/DataDog/datadog-agent/comp/core/hostname/hostnameimpl
github.com/DataDog/datadog-agent/comp/core/hostname/hostnameinterface
github.com/DataDog/datadog-agent/comp/core/log/def
github.com/DataDog/datadog-agent/comp/core/log/fx
github.com/DataDog/datadog-agent/comp/core/log/impl
github.com/DataDog/datadog-agent/comp/core/pid
github.com/DataDog/datadog-agent/comp/core/pid/pidimpl
github.com/DataDog/datadog-agent/comp/core/secrets
github.com/DataDog/datadog-agent/comp/core/secrets/secretsimpl
github.com/DataDog/datadog-agent/comp/core/tagger/def
github.com/DataDog/datadog-agent/comp/core/tagger/fx-remote
github.com/DataDog/datadog-agent/comp/core/tagger/generic_store
github.com/DataDog/datadog-agent/comp/core/tagger/impl-remote
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
github.com/DataDog/datadog-agent/comp/core/telemetry
github.com/DataDog/datadog-agent/comp/core/telemetry/noopsimpl
github.com/DataDog/datadog-agent/comp/def
github.com/DataDog/datadog-agent/comp/haagent/def
github.com/DataDog/datadog-agent/comp/haagent/fx-noop
github.com/DataDog/datadog-agent/comp/haagent/helpers
github.com/DataDog/datadog-agent/comp/haagent/impl-noop
github.com/DataDog/datadog-agent/comp/logs/integrations/def
github.com/DataDog/datadog-agent/comp/metadata/host/hostimpl/hosttags
github.com/DataDog/datadog-agent/comp/metadata/inventorychecks
github.com/DataDog/datadog-agent/pkg/aggregator/sender
github.com/DataDog/datadog-agent/pkg/api/security
github.com/DataDog/datadog-agent/pkg/api/security/cert
github.com/DataDog/datadog-agent/pkg/api/util
github.com/DataDog/datadog-agent/pkg/collector
github.com/DataDog/datadog-agent/pkg/collector/check
github.com/DataDog/datadog-agent/pkg/collector/check/defaults
github.com/DataDog/datadog-agent/pkg/collector/check/id
github.com/DataDog/datadog-agent/pkg/collector/check/stats
github.com/DataDog/datadog-agent/pkg/collector/externalhost
github.com/DataDog/datadog-agent/pkg/collector/loaders
github.com/DataDog/datadog-agent/pkg/collector/python
github.com/DataDog/datadog-agent/pkg/collector/runner
github.com/DataDog/datadog-agent/pkg/collector/runner/expvars
github.com/DataDog/datadog-agent/pkg/collector/runner/tracker
github.com/DataDog/datadog-agent/pkg/collector/scheduler
github.com/DataDog/datadog-agent/pkg/collector/worker
github.com/DataDog/datadog-agent/pkg/config/env
github.com/DataDog/datadog-agent/pkg/config/model
github.com/DataDog/datadog-agent/pkg/config/nodetreemodel
github.com/DataDog/datadog-agent/pkg/config/setup
github.com/DataDog/datadog-agent/pkg/config/setup/constants
github.com/DataDog/datadog-agent/pkg/config/structure
github.com/DataDog/datadog-agent/pkg/config/teeconfig
github.com/DataDog/datadog-agent/pkg/config/utils
github.com/DataDog/datadog-agent/pkg/diagnose/diagnosis
github.com/DataDog/datadog-agent/pkg/metrics/event
github.com/DataDog/datadog-agent/pkg/metrics/servicecheck
github.com/DataDog/datadog-agent/pkg/obfuscate
github.com/DataDog/datadog-agent/pkg/persistentcache
github.com/DataDog/datadog-agent/pkg/pidfile
github.com/DataDog/datadog-agent/pkg/serializer/types
github.com/DataDog/datadog-agent/pkg/status/health
github.com/DataDog/datadog-agent/pkg/tagger/types
github.com/DataDog/datadog-agent/pkg/tagset
github.com/DataDog/datadog-agent/pkg/telemetry
github.com/DataDog/datadog-agent/pkg/util/cache
github.com/DataDog/datadog-agent/pkg/util/cachedfetch
github.com/DataDog/datadog-agent/pkg/util/cloudproviders/azure
github.com/DataDog/datadog-agent/pkg/util/cloudproviders/gce
github.com/DataDog/datadog-agent/pkg/util/common
github.com/DataDog/datadog-agent/pkg/util/containers
github.com/DataDog/datadog-agent/pkg/util/defaultpaths
github.com/DataDog/datadog-agent/pkg/util/dmi
github.com/DataDog/datadog-agent/pkg/util/docker
github.com/DataDog/datadog-agent/pkg/util/ec2
github.com/DataDog/datadog-agent/pkg/util/executable
github.com/DataDog/datadog-agent/pkg/util/fargate
github.com/DataDog/datadog-agent/pkg/util/filesystem
github.com/DataDog/datadog-agent/pkg/util/flavor
github.com/DataDog/datadog-agent/pkg/util/fxutil
github.com/DataDog/datadog-agent/pkg/util/fxutil/logging
github.com/DataDog/datadog-agent/pkg/util/hostname
github.com/DataDog/datadog-agent/pkg/util/hostname/validate
github.com/DataDog/datadog-agent/pkg/util/http
github.com/DataDog/datadog-agent/pkg/util/kubelet
github.com/DataDog/datadog-agent/pkg/util/kubernetes
github.com/DataDog/datadog-agent/pkg/util/log
github.com/DataDog/datadog-agent/pkg/util/log/setup
github.com/DataDog/datadog-agent/pkg/util/log/setup/internal/seelog
github.com/DataDog/datadog-agent/pkg/util/option
github.com/DataDog/datadog-agent/pkg/util/rss
github.com/DataDog/datadog-agent/pkg/util/scrubber
github.com/DataDog/datadog-agent/pkg/util/sort
github.com/DataDog/datadog-agent/pkg/util/system
github.com/DataDog/datadog-agent/pkg/util/tmplvar
github.com/DataDog/datadog-agent/pkg/util/utilizationtracker
github.com/DataDog/datadog-agent/pkg/version
github.com/DataDog/datadog-go/v5/statsd
github.com/DataDog/go-sqllexer
github.com/DataDog/viper
github.com/benbjohnson/clock
github.com/cespare/xxhash/v2
github.com/cihub/seelog
github.com/dustin/go-humanize
github.com/ebitengine/purego
github.com/ebitengine/purego/internal/cgo
github.com/ebitengine/purego/internal/strings
github.com/fatih/color
github.com/fsnotify/fsnotify
github.com/fsnotify/fsnotify/internal
github.com/google/uuid
github.com/hashicorp/hcl
github.com/hashicorp/hcl/hcl/ast
github.com/hashicorp/hcl/hcl/parser
github.com/hashicorp/hcl/hcl/printer
github.com/hashicorp/hcl/hcl/scanner
github.com/hashicorp/hcl/hcl/strconv
github.com/hashicorp/hcl/hcl/token
github.com/hashicorp/hcl/json/parser
github.com/hashicorp/hcl/json/scanner
github.com/hashicorp/hcl/json/token
github.com/kardianos/osext
github.com/magiconair/properties
github.com/mattn/go-colorable
github.com/mattn/go-isatty
github.com/mitchellh/mapstructure
github.com/mohae/deepcopy
github.com/outcaste-io/ristretto
github.com/outcaste-io/ristretto/z
github.com/outcaste-io/ristretto/z/simd
github.com/patrickmn/go-cache
github.com/pelletier/go-toml
github.com/pkg/errors
github.com/shirou/gopsutil/v4/common
github.com/shirou/gopsutil/v4/cpu
github.com/shirou/gopsutil/v4/disk
github.com/shirou/gopsutil/v4/internal/common
github.com/shirou/gopsutil/v4/mem
github.com/shirou/gopsutil/v4/net
github.com/shirou/gopsutil/v4/process
github.com/spf13/afero
github.com/spf13/afero/internal/common
github.com/spf13/afero/mem
github.com/spf13/cast
github.com/spf13/cobra
github.com/spf13/jwalterweatherman
github.com/spf13/pflag
github.com/tklauser/go-sysconf
github.com/twmb/murmur3
go.uber.org/atomic
go.uber.org/dig
go.uber.org/dig/internal/digclock
go.uber.org/dig/internal/digerror
go.uber.org/dig/internal/digreflect
go.uber.org/dig/internal/dot
go.uber.org/dig/internal/graph
go.uber.org/fx
go.uber.org/fx/fxevent
go.uber.org/fx/internal/fxclock
go.uber.org/fx/internal/fxlog
go.uber.org/fx/internal/fxreflect
go.uber.org/fx/internal/lifecycle
go.uber.org/multierr
go.uber.org/zap
go.uber.org/zap/buffer
go.uber.org/zap/internal
go.uber.org/zap/internal/bufferpool
go.uber.org/zap/internal/color
go.uber.org/zap/internal/exit
go.uber.org/zap/internal/pool
go.uber.org/zap/internal/stacktrace
go.uber.org/zap/zapcore
golang.org/x/exp/maps
golang.org/x/net/http/httpguts
golang.org/x/net/http/httpproxy
golang.org/x/net/http2
golang.org/x/net/http2/hpack
golang.org/x/net/idna
golang.org/x/sys/unix
golang.org/x/text/cases
golang.org/x/text/internal
golang.org/x/text/internal/language
golang.org/x/text/internal/language/compact
golang.org/x/text/internal/tag
golang.org/x/text/language
golang.org/x/text/runes
golang.org/x/text/secure/bidirule
golang.org/x/text/transform
golang.org/x/text/unicode/bidi
golang.org/x/text/unicode/norm
gopkg.in/yaml.v2
gopkg.in/yaml.v3
14 changes: 0 additions & 14 deletions cmd/agent/common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,14 @@ import (
"encoding/json"
"fmt"
"net/http"
"path/filepath"

"github.com/DataDog/datadog-agent/pkg/api/util"
"github.com/DataDog/datadog-agent/pkg/config/settings"
settingshttp "github.com/DataDog/datadog-agent/pkg/config/settings/http"
pkgconfigsetup "github.com/DataDog/datadog-agent/pkg/config/setup"
"github.com/DataDog/datadog-agent/pkg/util/defaultpaths"
"github.com/DataDog/datadog-agent/pkg/version"
)

// GetPythonPaths returns the paths (in order of precedence) from where the agent
// should load python modules and checks
func GetPythonPaths() []string {
// wheels install in default site - already in sys.path; takes precedence over any additional location
return []string{
defaultpaths.GetDistPath(), // common modules are shipped in the dist path directly or under the "checks/" sub-dir
defaultpaths.PyChecksPath, // integrations-core legacy checks
filepath.Join(defaultpaths.GetDistPath(), "checks.d"), // custom checks in the "checks.d/" sub-dir of the dist path
pkgconfigsetup.Datadog().GetString("additional_checksd"), // custom checks, least precedent check location
}
}

// GetVersion returns the version of the agent in a http response json
func GetVersion(w http.ResponseWriter, _ *http.Request) {
w.Header().Set("Content-Type", "application/json")
Expand Down
82 changes: 37 additions & 45 deletions cmd/agent/subcommands/remoteconfig/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,17 @@
package remoteconfig

import (
"context"
"errors"
"fmt"
"os"

"github.com/spf13/cobra"
"go.uber.org/fx"
"google.golang.org/grpc/metadata"
"google.golang.org/protobuf/types/known/emptypb"

"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/api/security"
pkgconfigsetup "github.com/DataDog/datadog-agent/pkg/config/setup"
"github.com/DataDog/datadog-agent/pkg/flare"
pbgo "github.com/DataDog/datadog-agent/pkg/proto/pbgo/core"
"github.com/DataDog/datadog-agent/pkg/util/fxutil"
agentgrpc "github.com/DataDog/datadog-agent/pkg/util/grpc"
)

// cliParams are the command-line arguments for this subcommand
Expand Down Expand Up @@ -63,43 +55,43 @@ func state(_ *cliParams, config config.Component) error {
fmt.Println("Fetching the configuration and director repos state..")
// Call GRPC endpoint returning state tree

token, err := security.FetchAuthToken(config)
if err != nil {
return fmt.Errorf("couldn't get auth token: %w", err)
}

ctx, closeFn := context.WithCancel(context.Background())
defer closeFn()
md := metadata.MD{
"authorization": []string{fmt.Sprintf("Bearer %s", token)},
}
ctx = metadata.NewOutgoingContext(ctx, md)

ipcAddress, err := pkgconfigsetup.GetIPCAddress(pkgconfigsetup.Datadog())
if err != nil {
return err
}

cli, err := agentgrpc.GetDDAgentSecureClient(ctx, ipcAddress, pkgconfigsetup.GetIPCPort())
if err != nil {
return err
}
in := new(emptypb.Empty)

s, err := cli.GetConfigState(ctx, in)
if err != nil {
return fmt.Errorf("couldn't get the repositories state: %w", err)
}

var stateHA *pbgo.GetStateConfigResponse
if pkgconfigsetup.Datadog().GetBool("multi_region_failover.enabled") {
stateHA, err = cli.GetConfigStateHA(ctx, in)
if err != nil {
return fmt.Errorf("couldn't get the HA repositories state: %w", err)
}
}

flare.PrintRemoteConfigStates(os.Stdout, s, stateHA)
// token, err := security.FetchAuthToken(config)
// if err != nil {
// return fmt.Errorf("couldn't get auth token: %w", err)
// }

// ctx, closeFn := context.WithCancel(context.Background())
// defer closeFn()
// md := metadata.MD{
// "authorization": []string{fmt.Sprintf("Bearer %s", token)},
// }
// ctx = metadata.NewOutgoingContext(ctx, md)

// ipcAddress, err := pkgconfigsetup.GetIPCAddress(pkgconfigsetup.Datadog())
// if err != nil {
// return err
// }

// cli, err := agentgrpc.GetDDAgentSecureClient(ctx, ipcAddress, pkgconfigsetup.GetIPCPort())
// if err != nil {
// return err
// }
// in := new(emptypb.Empty)

// s, err := cli.GetConfigState(ctx, in)
// if err != nil {
// return fmt.Errorf("couldn't get the repositories state: %w", err)
// }

// var stateHA *pbgo.GetStateConfigResponse
// if pkgconfigsetup.Datadog().GetBool("multi_region_failover.enabled") {
// stateHA, err = cli.GetConfigStateHA(ctx, in)
// if err != nil {
// return fmt.Errorf("couldn't get the HA repositories state: %w", err)
// }
// }

// flare.PrintRemoteConfigStates(os.Stdout, s, stateHA)

return nil
}
Loading
Loading