Skip to content

Commit

Permalink
Fix linter
Browse files Browse the repository at this point in the history
  • Loading branch information
liustanley committed May 30, 2024
1 parent 6b4bafe commit 14665bd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
8 changes: 4 additions & 4 deletions exporter/datadogexporter/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ func (f *factory) StopReporter() {
})
}

func (f *factory) TraceAgent(ctx context.Context, wg sync.WaitGroup, params exporter.CreateSettings, cfg *Config, sourceProvider source.Provider, attrsTranslator *attributes.Translator) (*agent.Agent, error) {
func (f *factory) TraceAgent(ctx context.Context, wg *sync.WaitGroup, params exporter.CreateSettings, cfg *Config, sourceProvider source.Provider, attrsTranslator *attributes.Translator) (*agent.Agent, error) {
agnt, err := newTraceAgent(ctx, params, cfg, sourceProvider, metricsclient.InitializeMetricClient(params.MeterProvider, metricsclient.ExporterSourceTag), attrsTranslator)
if err != nil {
return nil, err
Expand Down Expand Up @@ -251,7 +251,7 @@ func checkAndCastConfig(c component.Config, logger *zap.Logger) *Config {
return cfg
}

func (f *factory) consumeStatsPayload(ctx context.Context, wg sync.WaitGroup, statsIn <-chan []byte, statsToAgent chan<- *pb.StatsPayload, tracerVersion string, agentVersion string, logger *zap.Logger) {
func (f *factory) consumeStatsPayload(ctx context.Context, wg *sync.WaitGroup, statsIn <-chan []byte, statsToAgent chan<- *pb.StatsPayload, tracerVersion string, agentVersion string, logger *zap.Logger) {
for i := 0; i < runtime.NumCPU(); i++ {
wg.Add(1)
go func() {
Expand Down Expand Up @@ -323,7 +323,7 @@ func (f *factory) createMetricsExporter(

statsIn := make(chan []byte, 1000)
statsv := set.BuildInfo.Command + set.BuildInfo.Version
f.consumeStatsPayload(ctx, wg, statsIn, statsToAgent, statsv, acfg.AgentVersion, set.Logger)
f.consumeStatsPayload(ctx, &wg, statsIn, statsToAgent, statsv, acfg.AgentVersion, set.Logger)
pcfg := newMetadataConfigfromConfig(cfg)
metadataReporter, err := f.Reporter(set, pcfg)
if err != nil {
Expand Down Expand Up @@ -426,7 +426,7 @@ func (f *factory) createTracesExporter(
return nil, fmt.Errorf("failed to build attributes translator: %w", err)
}

traceagent, err := f.TraceAgent(ctx, wg, set, cfg, hostProvider, attrsTranslator)
traceagent, err := f.TraceAgent(ctx, &wg, set, cfg, hostProvider, attrsTranslator)
if err != nil {
cancel()
return nil, fmt.Errorf("failed to start trace-agent: %w", err)
Expand Down
6 changes: 4 additions & 2 deletions exporter/datadogexporter/factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -780,8 +780,10 @@ func TestStopExporters(t *testing.T) {

finishShutdown := make(chan bool)
go func() {
expMetrics.Shutdown(ctx)
expTraces.Shutdown(ctx)
err = expMetrics.Shutdown(ctx)
assert.NoError(t, err)
err = expTraces.Shutdown(ctx)
assert.NoError(t, err)
finishShutdown <- true
}()

Expand Down

0 comments on commit 14665bd

Please sign in to comment.