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
24 changes: 14 additions & 10 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Gopkg.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[[constraint]]
name = "github.com/StackVista/stackstate-agent"
revision = "3185a432dfed61437a6c62ed5622006d9027f513"
revision = "bcfb39d79bc7cd7ad5742b6d62837062af8d62a9"

[[constraint]]
name = "github.com/DataDog/gopsutil"
Expand Down
3 changes: 2 additions & 1 deletion checks/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ package checks

import (
"fmt"
"github.com/StackVista/stackstate-agent/pkg/tagger/collectors"
"github.com/StackVista/stackstate-process-agent/cmd/agent/features"
"runtime"
"strings"
Expand Down Expand Up @@ -110,7 +111,7 @@ func fmtContainers(
sys2, sys1 := ctr.CPU.SystemUsage, lastCtr.CPU.SystemUsage

// Retrieves metadata tags
tags, err := tagger.Tag(ctr.EntityID, true)
tags, err := tagger.Tag(ctr.EntityID, collectors.HighCardinality)
if err != nil {
log.Errorf("unable to retrieve tags for container: %s", err)
tags = []string{}
Expand Down
1 change: 1 addition & 0 deletions checks/net.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ func (c *ConnectionsCheck) RealTime() bool { return false }
func (c *ConnectionsCheck) Run(cfg *config.AgentConfig, features features.Features, groupID int32) ([]model.MessageBody, error) {
// If local tracer failed to initialize, so we shouldn't be doing any checks
if c.useLocalTracer && c.localTracer == nil {
log.Errorf("failed to create network tracer. Set the environment STS_NETWORK_TRACING_ENABLED to false to disable network connections reporting")
return nil, nil
}

Expand Down
4 changes: 2 additions & 2 deletions checks/net_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func (c *ConnectionsCheck) Init(cfg *config.AgentConfig, sysInfo *model.SystemIn
if _, err = tracer.IsTracerSupportedByOS(); err != nil {
// err is always returned when false, so the above catches the !ok case as well
log.Errorf("network tracer unsupported by OS: %s. Set the environment STS_NETWORK_TRACING_ENABLED to false to disable network connections reporting", err)
os.Exit(1)
return
}

conf := tracerConfig.DefaultConfig
Expand All @@ -42,7 +42,7 @@ func (c *ConnectionsCheck) Init(cfg *config.AgentConfig, sysInfo *model.SystemIn
t, err := tracer.NewTracer(conf)
if err != nil {
log.Errorf("failed to create network tracer: %s. Set the environment STS_NETWORK_TRACING_ENABLED to false to disable network connections reporting", err)
os.Exit(1)
return
}

c.localTracer = t
Expand Down
5 changes: 2 additions & 3 deletions checks/net_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
tracerConfig "github.com/StackVista/tcptracer-bpf/pkg/tracer/config"
log "github.com/cihub/seelog"
"github.com/patrickmn/go-cache"
"os"
)

// Init initializes a ConnectionsCheck instance.
Expand All @@ -24,7 +23,7 @@ func (c *ConnectionsCheck) Init(cfg *config.AgentConfig, sysInfo *model.SystemIn
if _, err = tracer.IsTracerSupportedByOS(); err != nil {
// err is always returned when false, so the above catches the !ok case as well
log.Errorf("network tracer unsupported by OS: %s. Set the environment STS_NETWORK_TRACING_ENABLED to false to disable network connections reporting", err)
os.Exit(1)
return
}

conf := tracerConfig.DefaultConfig
Expand All @@ -33,7 +32,7 @@ func (c *ConnectionsCheck) Init(cfg *config.AgentConfig, sysInfo *model.SystemIn
t, err := tracer.NewTracer(conf)
if err != nil {
log.Errorf("failed to create network tracer: %s. Set the environment STS_NETWORK_TRACING_ENABLED to false to disable network connections reporting", err)
os.Exit(1)
return
}

c.localTracer = t
Expand Down
6 changes: 1 addition & 5 deletions cmd/agent/main_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,7 @@ func runAgent(exit chan bool) {
}

// Tagger must be initialized after agent config has been setup (via config.SetupDDAgentConfig)
if err := tagger.Init(); err == nil {
defer tagger.Stop()
} else {
log.Errorf("unable to initialize StackState entity tagger: %s", err)
}
tagger.Init()

networkConf, err := config.NewYamlIfExists(opts.netConfigPath)
if err != nil {
Expand Down
6 changes: 3 additions & 3 deletions conf-dev.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
log_level: TRACE
log_level: INFO
log_to_console: true
# Use this when running process agent locally
#sts_url: http://localhost:7077/stsAgent
sts_url: http://localhost:7077/stsAgent

# Use this when running process agent in the vagrant vms
sts_url: http://192.168.56.1:7077/stsAgent
#sts_url: http://192.168.56.1:7077/stsAgent

# Use this when running process agent with branch deploy
#sts_url: https://<branch-name>.test.stackstate.io/stsAgent
Expand Down
9 changes: 6 additions & 3 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -454,18 +454,21 @@ func NewAgentConfig(agentIni *File, agentYaml *YamlAgentConfig, networkYaml *Yam
// sanity check. This element is used with the modulo operator (%), so it can't be zero.
// if it is, log the error, and assume the config was attempting to disable
if cfg.Windows.ArgsRefreshInterval == 0 {
log.Warnf("invalid configuration: windows_collect_skip_new_args was set to 0. Disabling argument collection")
log.Warnf("invalid configuration: windows_collect_skip_new_args was set to 0. " +
"Disabling argument collection")
cfg.Windows.ArgsRefreshInterval = -1
}

if cfg.EnableShortLivedProcessFilter {
log.Infof("Process ShortLived filter enabled for processes younger than %s", cfg.ShortLivedProcessQualifierSecs)
log.Infof("Process ShortLived filter enabled for processes younger than %s",
cfg.ShortLivedProcessQualifierSecs)
} else {
log.Info("Process ShortLived filter disabled")
}

if cfg.EnableShortLivedNetworkRelationFilter {
log.Infof("Relation ShortLived filter enabled for connections that are once off and were observed for less than %d seconds", cfg.ShortLivedNetworkRelationQualifierSecs)
log.Infof("Relation ShortLived filter enabled for connections that are once off and were observed for "+
"less than %s seconds", cfg.ShortLivedNetworkRelationQualifierSecs)
} else {
log.Infof("Relation ShortLived filter disabled")
}
Expand Down
4 changes: 2 additions & 2 deletions config/yaml_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import (
// YamlAgentConfig is a structure used for marshaling the datadog.yaml configuration
// available in Agent versions >= 6
type YamlAgentConfig struct {
APIKey string `yaml:"api_key"`
Site string `yaml:"site"`
APIKey string `yaml:"api_key"`
Site string `yaml:"site"`
StsURL string `yaml:"sts_url"`
// Whether or not the process-agent should output logs to console
LogToConsole bool `yaml:"log_to_console"`
Expand Down