VOL-3657 support stack id in rpc events
Change-Id: Ie94fc7aa6f3a4c58803156f75d29ecad7f11e601
diff --git a/rw_core/config/config.go b/rw_core/config/config.go
index 2788e56..2b5017e 100644
--- a/rw_core/config/config.go
+++ b/rw_core/config/config.go
@@ -53,6 +53,7 @@
defaultTraceEnabled = false
defaultTraceAgentAddress = "127.0.0.1:6831"
defaultLogCorrelationEnabled = true
+ defaultVolthaStackID = "voltha"
)
// RWCoreFlags represents the set of configurations used by the read-write core service
@@ -86,6 +87,7 @@
TraceEnabled bool
TraceAgentAddress string
LogCorrelationEnabled bool
+ VolthaStackID string
}
// NewRWCoreFlags returns a new RWCore config
@@ -119,6 +121,7 @@
TraceEnabled: defaultTraceEnabled,
TraceAgentAddress: defaultTraceAgentAddress,
LogCorrelationEnabled: defaultLogCorrelationEnabled,
+ VolthaStackID: defaultVolthaStackID,
}
return &rwCoreFlag
}
@@ -203,5 +206,8 @@
help = fmt.Sprintf("Whether to enrich log statements with fields denoting operation being executed for achieving correlation?")
flag.BoolVar(&(cf.LogCorrelationEnabled), "log_correlation_enabled", defaultLogCorrelationEnabled, help)
+ help = fmt.Sprintf("ID for the current voltha stack")
+ flag.StringVar(&cf.VolthaStackID, "stack_id", defaultVolthaStackID, help)
+
flag.Parse()
}