Skip to content
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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ To run without errors the process-agent needs the `test-server`. Start the `test
```bash
rake test
# or if you want to use the go command directly
go test -tags 'docker kubelet kubeapiserver linux cri containerd linux_bpf' $(go list ./...)
go test -tags 'kubelet kubeapiserver linux linux_bpf' $(go list ./...)
# To run a specific test in verbose mode
go test -v -run TestPostgresAggregation -tags 'docker kubelet kubeapiserver linux cri containerd linux_bpf' $(go list ./...)
go test -v -run TestPostgresAggregation -tags 'kubelet kubeapiserver linux linux_bpf' $(go list ./...)
```

## Build the docker image
Expand Down
18 changes: 1 addition & 17 deletions cmd/agent/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ var (
infoNotRunningTmpl *template.Template
infoTmpl *template.Template
infoErrorTmpl *template.Template
infoDockerSocket string
infoLastCollectTime string
infoProcCount int
infoContainerCount int
Expand All @@ -41,8 +40,7 @@ const (
Uptime: {{.Status.Uptime}} seconds
Mem alloc: {{.Status.MemStats.Alloc}} bytes

Last collection time: {{.Status.LastCollectTime}}{{if ne .Status.DockerSocket ""}}
Docker socket: {{.Status.DockerSocket}}{{end}}
Last collection time: {{.Status.LastCollectTime}}
Number of processes: {{.Status.ProcessCount}}
Number of containers: {{.Status.ContainerCount}}
Queue length: {{.Status.QueueSize}}
Expand Down Expand Up @@ -82,18 +80,6 @@ func publishVersion() interface{} {
}
}

func publishDockerSocket() interface{} {
infoMutex.RLock()
defer infoMutex.RUnlock()
return infoDockerSocket
}

func updateDockerSocket(path string) {
infoMutex.Lock()
defer infoMutex.Unlock()
infoDockerSocket = path
}

func publishLastCollectTime() interface{} {
infoMutex.RLock()
defer infoMutex.RUnlock()
Expand Down Expand Up @@ -210,7 +196,6 @@ type StatusInfo struct {
MemStats struct{ Alloc uint64 } `json:"memstats"`
Version infoVersion `json:"version"`
Config config.AgentConfig `json:"config"`
DockerSocket string `json:"docker_socket"`
LastCollectTime string `json:"last_collect_time"`
ProcessCount int `json:"process_count"`
ContainerCount int `json:"container_count"`
Expand All @@ -234,7 +219,6 @@ func initInfo(conf *config.AgentConfig) error {
expvar.NewInt("pid").Set(int64(os.Getpid()))
expvar.Publish("uptime", expvar.Func(publishUptime))
expvar.Publish("version", expvar.Func(publishVersion))
expvar.Publish("docker_socket", expvar.Func(publishDockerSocket))
expvar.Publish("last_collect_time", expvar.Func(publishLastCollectTime))
expvar.Publish("process_count", expvar.Func(publishProcCount))
expvar.Publish("container_count", expvar.Func(publishContainerCount))
Expand Down
1 change: 0 additions & 1 deletion cmd/agent/info_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ Processes and Containers Agent (v 0.99.0)
Mem alloc: 2096792 bytes

Last collection time: 2017-09-28 07:10:16
Docker socket: /var/run/docker.sock
Number of processes: 84
Number of containers: 0
Queue length: 0
Expand Down
10 changes: 0 additions & 10 deletions cmd/agent/main_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import (
"github.com/DataDog/datadog-agent/comp/core/telemetry/telemetryimpl"
workloadmeta "github.com/DataDog/datadog-agent/comp/core/workloadmeta/impl"
"github.com/DataDog/datadog-agent/pkg/pidfile"
"github.com/DataDog/datadog-agent/pkg/process/util"
containers "github.com/DataDog/datadog-agent/pkg/process/util/containers"
"github.com/StackVista/stackstate-process-agent/config"
"github.com/StackVista/stackstate-process-agent/pkg/debug"
Expand Down Expand Up @@ -136,15 +135,6 @@ func runAgent(exit chan bool) {
batcher := transactionbatcher.NewTransactionalBatcher(
cfg.HostName, cfg.BatcherMaxBufferSize, fwd, manager, cfg.BatcherLogPayloads)

// update docker socket path in info
dockerSock, err := util.GetDockerSocketPath()
if err != nil {
log.Debugf("Docker is not available on this host")
}
// we shouldn't quit because docker is not required. If no docker socket is available,
// we just pass down empty string
updateDockerSocket(dockerSock)

log.Debug("Running process-agent with DEBUG logging enabled")

if opts.info {
Expand Down
5 changes: 0 additions & 5 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@ type AgentConfig struct {
CheckHealthStateMessageLimit int

// Containers
CriSocketPath string
ContainerBlacklist []string
ContainerWhitelist []string

Expand Down Expand Up @@ -693,10 +692,6 @@ func mergeEnvironmentVariables(c *AgentConfig) *AgentConfig {
c.KubernetesKubeletHost = v
}

if v := os.Getenv("STS_CRI_SOCKET_PATH"); v != "" {
c.CriSocketPath = v
}

if enabled, _ := isAffirmative(os.Getenv("STS_HTTP_STATS_PER_PATH")); enabled {
c.HTTPStatsPerPath = enabled
}
Expand Down
4 changes: 0 additions & 4 deletions config/dd_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ import (
// SetupDDAgentConfig initializes the datadog-agent config with a YAML file.
// This is required for configuration to be available for container listeners.
func SetupDDAgentConfig(cfg *AgentConfig) (modelconfig.Config, error) {
if cfg.CriSocketPath != "" {
os.Setenv("DD_CRI_SOCKET_PATH", cfg.CriSocketPath)
}

os.Setenv("DD_KUBERNETES_KUBELET_HOST", cfg.KubernetesKubeletHost)
os.Setenv("DD_KUBELET_TLS_VERIFY", strconv.FormatBool(!cfg.SkipKubeletTLSVerify))
// Workaround to use only env var for the config
Expand Down
3 changes: 0 additions & 3 deletions config/dd_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ func TestConfigLoading(t *testing.T) {
pkgconfigsetup.InitConfig(conf)
conf.SetConfigFile("")

expectedSocketPath := "/var/run/cri.sock"
expectedKubeletHost := "http://localhost:10255"
t.Setenv("DD_CRI_SOCKET_PATH", expectedSocketPath)
t.Setenv("DD_KUBERNETES_KUBELET_HOST", expectedKubeletHost)
t.Setenv("DD_KUBELET_TLS_VERIFY", "true")
// Workaround to use only env var for the config
Expand All @@ -26,7 +24,6 @@ func TestConfigLoading(t *testing.T) {
if _, err := pkgconfigsetup.LoadWithoutSecret(conf, []string{}); err != nil {
t.Fatal(err.Error())
}
assert.Equal(t, expectedSocketPath, conf.GetString("cri_socket_path"))
assert.Equal(t, expectedKubeletHost, conf.GetString("kubernetes_kubelet_host"))
assert.Equal(t, "true", conf.GetString("kubelet_tls_verify"))
}
7 changes: 0 additions & 7 deletions config/yaml_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,6 @@ type YamlAgentConfig struct {
Kubernetes struct {
KubeletHost string `yaml:"kubelet_host"`
} `yaml:"kubernetes"`
Containers struct {
CriSocketPath string `yaml:"cri_socket_path"`
} `yaml:"containers"`
Proxy struct {
HTTPS string `yaml:"https"`
HTTP string `yaml:"http"`
Expand Down Expand Up @@ -385,10 +382,6 @@ func mergeYamlConfig(agentConf *AgentConfig, yc *YamlAgentConfig) (*AgentConfig,
agentConf.KubernetesKubeletHost = yc.Kubernetes.KubeletHost
}

if yc.Containers.CriSocketPath != "" {
agentConf.CriSocketPath = yc.Containers.CriSocketPath
}

return agentConf, nil
}

Expand Down
Loading
Loading