Skip to content

Commit

Permalink
Fix concurrency issues in emf exporter (#2571)
Browse files Browse the repository at this point in the history
  • Loading branch information
bjrara authored and pmatyjasek-sumo committed Apr 28, 2021
1 parent f5fd956 commit 9352e0d
Show file tree
Hide file tree
Showing 4 changed files with 272 additions and 207 deletions.
4 changes: 2 additions & 2 deletions exporter/awsemfexporter/cwlog_client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ import (
"go.uber.org/zap"
)

func NewAlwaysPassMockLogClient() LogClient {
func NewAlwaysPassMockLogClient(putLogEventsFunc func(args mock.Arguments)) LogClient {
logger := zap.NewNop()
svc := new(mockCloudWatchLogsClient)

svc.On("PutLogEvents", mock.Anything).Return(
&cloudwatchlogs.PutLogEventsOutput{
NextSequenceToken: &expectedNextSequenceToken},
nil)
nil).Run(putLogEventsFunc)

svc.On("CreateLogGroup", mock.Anything).Return(new(cloudwatchlogs.CreateLogGroupOutput), nil)

Expand Down
2 changes: 1 addition & 1 deletion exporter/awsemfexporter/metric_translator.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ func translateCWMetricToEMF(cWMetric *CWMetrics) *LogEvent {
}

metricCreationTime := cWMetric.TimestampMs
logEvent := NewLogEvent(
logEvent := newLogEvent(
metricCreationTime,
string(pleMsg),
)
Expand Down
Loading

0 comments on commit 9352e0d

Please sign in to comment.