Skip to content

Commit

Permalink
fix: do not send broken compressed data to apm server (#257)
Browse files Browse the repository at this point in the history
Return an error if we failed to compress data to buffer
when posting to the apm server.
  • Loading branch information
kruskall authored Aug 1, 2022
1 parent 04494ab commit fcf218b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apm-lambda-extension/apmproxy/apmserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,10 @@ func (c *Client) PostToApmServer(ctx context.Context, agentData AgentData) error
return err
}
if _, err := gw.Write(agentData.Data); err != nil {
extension.Log.Errorf("Failed to compress data: %v", err)
return fmt.Errorf("failed to compress data: %w", err)
}
if err := gw.Close(); err != nil {
extension.Log.Errorf("Failed write compressed data to buffer: %v", err)
return fmt.Errorf("failed to write compressed data to buffer: %w", err)
}
r = buf
}
Expand Down

0 comments on commit fcf218b

Please sign in to comment.