Skip to content
This repository has been archived by the owner on Aug 30, 2019. It is now read-only.

Commit

Permalink
move env constants to merge_env.go
Browse files Browse the repository at this point in the history
  • Loading branch information
gbbr committed Jun 20, 2018
1 parent 2133f28 commit b5e8357
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
14 changes: 0 additions & 14 deletions config/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,6 @@ var (
ErrMissingHostname = errors.New("failed to automatically set the hostname, you must specify it via configuration for or the DD_HOSTNAME env var")
)

const (
envAPIKey = "DD_API_KEY" // API KEY
envAPMEnabled = "DD_APM_ENABLED" // APM enabled
envURL = "DD_APM_DD_URL" // APM URL
envHostname = "DD_HOSTNAME" // agent hostname
envBindHost = "DD_BIND_HOST" // statsd & receiver hostname
envReceiverPort = "DD_RECEIVER_PORT" // receiver port
envDogstatsdPort = "DD_DOGSTATSD_PORT" // dogstatsd port
envRemoteTraffic = "DD_APM_NON_LOCAL_TRAFFIC" // alow non-local traffic
envIgnoreResources = "DD_IGNORE_RESOURCE" // ignored resources
envLogLevel = "DD_LOG_LEVEL" // logging level
envAnalyzedSpans = "DD_APM_ANALYZED_SPANS" // spans to analyze for transactions
)

// AgentConfig handles the interpretation of the configuration (with default
// behaviors) in one place. It is also a simple structure to share across all
// the Agent components, with 100% safe and reliable values.
Expand Down
16 changes: 15 additions & 1 deletion config/merge_env.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,21 @@ import (
log "github.com/cihub/seelog"
)

// mergeEnv applies overrides from environment variables to the trace agent configuration
const (
envAPIKey = "DD_API_KEY" // API KEY
envAPMEnabled = "DD_APM_ENABLED" // APM enabled
envURL = "DD_APM_DD_URL" // APM URL
envHostname = "DD_HOSTNAME" // agent hostname
envBindHost = "DD_BIND_HOST" // statsd & receiver hostname
envReceiverPort = "DD_RECEIVER_PORT" // receiver port
envDogstatsdPort = "DD_DOGSTATSD_PORT" // dogstatsd port
envRemoteTraffic = "DD_APM_NON_LOCAL_TRAFFIC" // alow non-local traffic
envIgnoreResources = "DD_IGNORE_RESOURCE" // ignored resources
envLogLevel = "DD_LOG_LEVEL" // logging level
envAnalyzedSpans = "DD_APM_ANALYZED_SPANS" // spans to analyze for transactions
)

// loadEnv applies overrides from environment variables to the trace agent configuration
func (c *AgentConfig) loadEnv() {
if v := os.Getenv(envAPMEnabled); v == "true" {
c.Enabled = true
Expand Down

0 comments on commit b5e8357

Please sign in to comment.