Skip to content

Commit

Permalink
Fix error in puslishing cloud watch metrics (#55)
Browse files Browse the repository at this point in the history
Reported at:
vmware/vmware-go-kcl#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>
  • Loading branch information
Tao Jiang committed Dec 21, 2021
1 parent c979372 commit 9ca9d90
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions clientlibrary/metrics/cloudwatch/cloudwatch.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 9ca9d90

Please sign in to comment.