Documentation ¶
Index ¶
- Constants
- func CopyFile(pathIn string, pathOut string)
- func CreateWindowsEvent(eventLogName string, eventLogLevel string, msg string) error
- func DeleteFile(filePathAbsolute string) error
- func GenerateLogConfig(numberMonitoredLogs int, filePath string) error
- func GenerateLogs(configFilePath string, duration time.Duration, sendingInterval time.Duration, ...) error
- func GenerateWindowsEvents(validationLog []models.LogValidation) error
- func InstallAgent(installerFilePath string) error
- func ReadAgentLogfile(logfile string) string
- func RecreateAgentLogfile(logfile string)
- func ReplaceLocalStackHostName(pathIn string)
- func RunAsyncCommand(cmd string) error
- func RunCommand(cmd string) (string, error)
- func RunCommands(commands []string) error
- func RunShellScript(path string, args ...string) (string, error)
- func SendAppSignalMetrics(duration time.Duration) error
- func SendAppSignalsTraceMetrics(duration time.Duration) error
- func SendCollectDMetrics(metricPerInterval int, sendingInterval, duration time.Duration) error
- func SendEMFMetrics(metricPerInterval int, metricLogGroup, metricNamespace string, ...) error
- func SendStatsdMetrics(metricPerInterval int, metricDimension []string, ...) error
- func StartAgent(configOutputPath string, fatalOnFailure bool, ssm bool) error
- func StartAgentWithCommand(configOutputPath string, fatalOnFailure bool, ssm bool, ...) error
- func StartLogWrite(configFilePath string, duration time.Duration, sendingInterval time.Duration, ...) error
- func StartSendingMetrics(receiver string, duration, sendingInterval time.Duration, ...) (err error)
- func StopAgent()
- func TouchFile(filePathAbsolute string) error
- func UninstallAgent(pm PackageManager) error
- type PackageManager
Constants ¶
const ( CatCommand = "cat " AppOwnerCommand = "ps -u -p " ConfigOutputPath = "/opt/aws/amazon-cloudwatch-agent/bin/config.json" Namespace = "CWAgent" Host = "host" AgentLogFile = "/opt/aws/amazon-cloudwatch-agent/logs/amazon-cloudwatch-agent.log" InstallAgentVersionPath = "/opt/aws/amazon-cloudwatch-agent/bin/CWAGENT_VERSION" )
const MetricEndpoint = "4316/v1/metrics"
const SleepDuration = 5 * time.Second
const TracesEndpoint = "4316/v1/traces"
Variables ¶
This section is empty.
Functions ¶
func CreateWindowsEvent ¶
func DeleteFile ¶
func GenerateLogConfig ¶
GenerateLogConfig takes the number of logs to be monitored and applies it to the supplied config, It writes logs to be monitored of the form /tmp/testNUM.log where NUM is from 1 to number of logs requested to the supplied configuration DEFAULT CONFIG MUST BE SUPPLIED WITH AT LEAST ONE LOG BEING MONITORED (log being monitored will be overwritten - it is needed for json structure) returns the path of the config generated and a list of log stream names
func GenerateLogs ¶
func GenerateWindowsEvents ¶
func GenerateWindowsEvents(validationLog []models.LogValidation) error
func InstallAgent ¶
InstallAgent can determine the package manager based on the installer suffix.
func ReadAgentLogfile ¶
func RecreateAgentLogfile ¶
func RecreateAgentLogfile(logfile string)
func ReplaceLocalStackHostName ¶
func ReplaceLocalStackHostName(pathIn string)
func RunAsyncCommand ¶
func RunCommand ¶
func RunCommands ¶
func SendAppSignalMetrics ¶
func SendCollectDMetrics ¶
func SendEMFMetrics ¶
func SendStatsdMetrics ¶
func StartAgentWithCommand ¶
func StartLogWrite ¶
func StartLogWrite(configFilePath string, duration time.Duration, sendingInterval time.Duration, logLinesPerMinute int) error
StartLogWrite starts go routines to write logs to each of the logs that are monitored by CW Agent according to the config provided
func StartSendingMetrics ¶
func StartSendingMetrics(receiver string, duration, sendingInterval time.Duration, metricPerInterval int, metricLogGroup, metricNamespace string) (err error)
StartSendingMetrics will generate metrics load based on the receiver (e.g 5000 statsd metrics per minute)
func UninstallAgent ¶
func UninstallAgent(pm PackageManager) error