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
lint
  • Loading branch information
ben-childs-docusign committed Jul 29, 2024
commit 353132871aafa138b5858e7f8eb06599c0408670
4 changes: 2 additions & 2 deletions exporter/prometheusremotewriteexporter/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -274,8 +274,8 @@ 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.
// Therefore we always let Snappy decide the size of the buffer.
// If we don't pass a bugger large enough, Snappy Encode function will not use it and instead will allocate a new buffer.
ben-childs-docusign marked this conversation as resolved.
Show resolved Hide resolved
// 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

// executeFunc can be used for backoff and non backoff scenarios.
Expand Down
Loading