[VOL-3142] Enabled tracing for ofagent-go and added config parameters
Change-Id: I56928a3c43e7b4566abfcc51521c9f3aa85bc707
diff --git a/cmd/ofagent/config.go b/cmd/ofagent/config.go
index ba8b710..a929077 100644
--- a/cmd/ofagent/config.go
+++ b/cmd/ofagent/config.go
@@ -38,6 +38,9 @@
KVStoreTimeout time.Duration
KVStoreAddress string
InstanceID string
+ TraceEnabled bool
+ TraceAgentAddress string
+ LogCorrelationEnabled bool
}
type multiFlag []string
@@ -124,6 +127,19 @@
flag.StringVar(&(config.LogLevel), "log_level", "WARN", "Log level")
+ flag.BoolVar(&(config.TraceEnabled),
+ "trace_enabled",
+ false,
+ "Whether to send logs to tracing agent?")
+ flag.StringVar(&(config.TraceAgentAddress),
+ "trace_agent_address",
+ "127.0.0.1:6831",
+ "The address of tracing agent to which span info should be sent.")
+ flag.BoolVar(&(config.LogCorrelationEnabled),
+ "log_correlation_enabled",
+ true,
+ "Whether to enrich log statements with fields denoting operation being executed for achieving correlation?")
+
containerName := getContainerInfo()
if len(containerName) > 0 {
config.InstanceID = containerName