Skip to content

Commit

Permalink
APM: Use compressor.Encoding() for error log messages (#29207)
Browse files Browse the repository at this point in the history
  • Loading branch information
keisku authored Sep 10, 2024
1 parent d03ac92 commit f2ee8d8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/trace/writer/trace.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,14 +294,14 @@ func (w *TraceWriter) serialize(pl *pb.AgentPayload) {
if err != nil {
// it will never happen, unless an invalid compression is chosen;
// we know gzip.BestSpeed is valid.
log.Errorf("Failed to initialize gzip writer. No traces can be sent: %v", err)
log.Errorf("Failed to initialize %s writer. No traces can be sent: %v", w.compressor.Encoding(), err)
return
}
if _, err := writer.Write(b); err != nil {
log.Errorf("Error gzipping trace payload: %v", err)
log.Errorf("Error %s trace payload: %v", w.compressor.Encoding(), err)
}
if err := writer.Close(); err != nil {
log.Errorf("Error closing gzip stream when writing trace payload: %v", err)
log.Errorf("Error closing %s stream when writing trace payload: %v", w.compressor.Encoding(), err)
}
sendPayloads(w.senders, p, w.syncMode)

Expand Down

0 comments on commit f2ee8d8

Please sign in to comment.