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/prometheusremotewrite] fix snappy double alloc #34274

Merged
Prev Previous commit
Next Next commit
Update exporter/prometheusremotewriteexporter/exporter.go
Co-authored-by: Matthew Wear <matthew.wear@gmail.com>
  • Loading branch information
ben-childs-docusign and mwear authored Jul 29, 2024
commit 6fb452011ed59272ec2f294d1cc6eb0ae01c0849
2 changes: 1 addition & 1 deletion exporter/prometheusremotewriteexporter/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ func (prwe *prwExporter) execute(ctx context.Context, writeReq *prompb.WriteRequ
if errMarshal != nil {
return consumererror.NewPermanent(errMarshal)
}
// If we don't pass a bugger large enough, Snappy Encode function will not use it and instead will allocate a new buffer.
// If we don't pass a buffer large enough, Snappy Encode function will not use it and instead will allocate a new buffer.
// Therefore we always let Snappy decide the size of the buffer.
compressedData := snappy.Encode(nil, data)
ben-childs-docusign marked this conversation as resolved.
Show resolved Hide resolved
ben-childs-docusign marked this conversation as resolved.
Show resolved Hide resolved

Expand Down