Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[exporter/datadog] Use statswriter, client aggregator is for tracer stats only #31173

Merged
merged 17 commits into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Close the channel and log on startup
  • Loading branch information
ajgajg1134 committed Feb 9, 2024
commit 2aa0bcc4a61ac907256efd64bfe3fd7e6b6245d6
5 changes: 5 additions & 0 deletions exporter/datadogexporter/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,8 @@ func (f *factory) createMetricsExporter(
}
statsToAgent := make(chan *pb.StatsPayload)
statsWriter := writer.NewStatsWriter(acfg, statsToAgent, telemetry.NewNoopCollector())
ajgajg1134 marked this conversation as resolved.
Show resolved Hide resolved

set.Logger.Debug("Starting Datadog Trace-Agent StatsWriter")
go statsWriter.Run()

var statsIn chan []byte
Expand Down Expand Up @@ -356,6 +358,9 @@ func (f *factory) createMetricsExporter(
if statsIn != nil {
close(statsIn)
}
if statsToAgent != nil {
close(statsToAgent)
}
return nil
}),
)
Expand Down
2 changes: 1 addition & 1 deletion exporter/datadogexporter/traces_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,6 @@ func newTraceAgent(ctx context.Context, params exporter.CreateSettings, cfg *Con
if err != nil {
return nil, err
}
tracelog.SetLogger(&zaplogger{params.Logger})
return agent.NewAgent(ctx, acfg, telemetry.NewNoopCollector()), nil
}

Expand Down Expand Up @@ -218,5 +217,6 @@ func newTraceAgentConfig(ctx context.Context, params exporter.CreateSettings, cf
if addr := cfg.Traces.Endpoint; addr != "" {
acfg.Endpoints[0].Host = addr
}
tracelog.SetLogger(&zaplogger{params.Logger}) //TODO: This shouldn't be a singleton
return acfg, nil
}
Loading