Documentation ¶
Index ¶
- Constants
- Variables
- func AddAgentVersionToDomain(domain string, app string) (string, error)
- func BindEnvAndSetDefault(key string, val interface{})
- func FileUsedDir() string
- func GetMultipleEndpoints() (map[string][]string, error)
- func GetSyslogURI() string
- func IsContainerized() bool
- func IsKubernetes() bool
- func Load() error
- func SetupLogger(logLevel, logFile, uri string, rfc, logToConsole, jsonFormat bool) error
- type ConfigurationProviders
- type ErrorLogWriter
- type Listeners
- type MetadataProviders
- type Proxy
- type SyslogReceiver
Constants ¶
const DefaultForwarderRecoveryInterval = 2
DefaultForwarderRecoveryInterval is the default recovery interval, also used if the user-provided value is invalid.
Variables ¶
var (
Datadog = viper.New()
)
Datadog is the global configuration object
Functions ¶
func AddAgentVersionToDomain ¶
AddAgentVersionToDomain prefix the domain with the agent version: X-Y-Z.domain
func BindEnvAndSetDefault ¶
func BindEnvAndSetDefault(key string, val interface{})
BindEnvAndSetDefault sets the default value for a config parameter, and adds an env binding
func FileUsedDir ¶
func FileUsedDir() string
FileUsedDir returns the absolute path to the folder containing the config file used to populate the registry
func GetMultipleEndpoints ¶
GetMultipleEndpoints returns the api keys per domain specified in the main agent config
func GetSyslogURI ¶
func GetSyslogURI() string
GetSyslogURI returns the configured/default syslog uri
func IsContainerized ¶
func IsContainerized() bool
IsContainerized returns whether the Agent is running on a Docker container
func IsKubernetes ¶
func IsKubernetes() bool
IsKubernetes returns whether the Agent is running on a kubernetes cluster
func SetupLogger ¶
SetupLogger sets up the default logger
Types ¶
type ConfigurationProviders ¶
type ConfigurationProviders struct { Name string `mapstructure:"name"` Polling bool `mapstructure:"polling"` TemplateURL string `mapstructure:"template_url"` TemplateDir string `mapstructure:"template_dir"` Username string `mapstructure:"username"` Password string `mapstructure:"password"` CAFile string `mapstructure:"ca_file"` CAPath string `mapstructure:"ca_path"` CertFile string `mapstructure:"cert_file"` KeyFile string `mapstructure:"key_file"` Token string `mapstructure:"token"` }
ConfigurationProviders helps unmarshalling `config_providers` config param
type ErrorLogWriter ¶
type ErrorLogWriter struct{}
ErrorLogWriter is a Writer that logs all written messages with the global seelog logger at an error level
type Listeners ¶
type Listeners struct {
Name string `mapstructure:"name"`
}
Listeners helps unmarshalling `listeners` config param
type MetadataProviders ¶
type MetadataProviders struct { Name string `mapstructure:"name"` Interval time.Duration `mapstructure:"interval"` }
MetadataProviders helps unmarshalling `metadata_providers` config param
type Proxy ¶
type Proxy struct { HTTP string `mapstructure:"http"` HTTPS string `mapstructure:"https"` NoProxy []string `mapstructure:"no_proxy"` }
Proxy represents the configuration for proxies in the agent
func GetProxies ¶
func GetProxies() *Proxy
GetProxies returns the proxy settings from the configuration
type SyslogReceiver ¶
type SyslogReceiver struct {
// contains filtered or unexported fields
}
SyslogReceiver implements seelog.CustomReceiver
func (*SyslogReceiver) AfterParse ¶
func (s *SyslogReceiver) AfterParse(initArgs seelog.CustomReceiverInitArgs) error
AfterParse parses the receiver configuration
func (*SyslogReceiver) Close ¶
func (s *SyslogReceiver) Close() error
Close is a NOP in current implementation
func (*SyslogReceiver) Flush ¶
func (s *SyslogReceiver) Flush()
Flush is a NOP in current implementation
func (*SyslogReceiver) ReceiveMessage ¶
func (s *SyslogReceiver) ReceiveMessage(message string, level seelog.LogLevel, context seelog.LogContextInterface) error
ReceiveMessage process current log message