Skip to content

Commit bdbc192

Browse files
authored
Fix concurrency issues in emf exporter (#2571)
1 parent 5d91513 commit bdbc192

File tree

4 files changed

+272
-207
lines changed

4 files changed

+272
-207
lines changed

exporter/awsemfexporter/cwlog_client_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ import (
3232
"go.uber.org/zap"
3333
)
3434

35-
func NewAlwaysPassMockLogClient() LogClient {
35+
func NewAlwaysPassMockLogClient(putLogEventsFunc func(args mock.Arguments)) LogClient {
3636
logger := zap.NewNop()
3737
svc := new(mockCloudWatchLogsClient)
3838

3939
svc.On("PutLogEvents", mock.Anything).Return(
4040
&cloudwatchlogs.PutLogEventsOutput{
4141
NextSequenceToken: &expectedNextSequenceToken},
42-
nil)
42+
nil).Run(putLogEventsFunc)
4343

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

exporter/awsemfexporter/metric_translator.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ func translateCWMetricToEMF(cWMetric *CWMetrics) *LogEvent {
315315
}
316316

317317
metricCreationTime := cWMetric.TimestampMs
318-
logEvent := NewLogEvent(
318+
logEvent := newLogEvent(
319319
metricCreationTime,
320320
string(pleMsg),
321321
)

0 commit comments

Comments
 (0)