Fix error in puslishing cloud watch metrics (#55)

Reported at:
https://github.com/vmware/vmware-go-kcl/issues/54

The input params are not used to set monitor service in cloudwatch
Init function. The empty appName, streamName and workerID cause
PutMetricData failed with error string "Error in publishing
cloudwatch metrics. Error: InvalidParameter...".

Signed-off-by: Tao Jiang <taoj@vmware.com>
This commit is contained in:
Tao Jiang 2019-11-11 14:11:44 -06:00
parent c9793728a3
commit 9ca9d901ca

View file

@ -89,6 +89,10 @@ func NewMonitoringServiceWithOptions(region string, creds *credentials.Credentia
}
func (cw *MonitoringService) Init(appName, streamName, workerID string) error {
cw.appName = appName
cw.streamName = streamName
cw.workerID = workerID
cfg := &aws.Config{Region: aws.String(cw.region)}
cfg.Credentials = cw.credentials
s, err := session.NewSession(cfg)