mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2026-06-28 13:07:50 +03:00
- Properly decode protobuf-encoded Loki request if it has no Content-Encoding header. Protobuf Loki message is snappy-encoded by default, so snappy decoding must be used when Content-Encoding header is missing. - Return back the previous signatures of parseJSONRequest and parseProtobufRequest functions. This eliminates the churn in tests for these functions. This also fixes broken benchmarks BenchmarkParseJSONRequest and BenchmarkParseProtobufRequest, which consume the whole request body on the first iteration and do nothing on subsequent iterations. - Put the CHANGELOG entries into correct places, since they were incorrectly put into already released versions of VictoriaMetrics and VictoriaLogs. - Add support for reading zstd-compressed data ingestion requests into the remaining protocols at VictoriaLogs and VictoriaMetrics. - Remove the `encoding` arg from PutUncompressedReader() - it has enough information about the passed reader arg in order to properly deal with it. - Add ReadUncompressedData to lib/protoparser/common for reading uncompressed data from the reader until EOF. This allows removing repeated code across request-based protocol parsers without streaming mode. - Consistently limit data ingestion request sizes, which can be read by ReadUncompressedData function. Previously this wasn't the case for all the supported protocols. Updates https://github.com/VictoriaMetrics/VictoriaMetrics/pull/8416 Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/8380 Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/8300
26 lines
466 B
Go
26 lines
466 B
Go
//go:build cgo
|
|
|
|
package zstd
|
|
|
|
import (
|
|
"io"
|
|
|
|
"github.com/valyala/gozstd"
|
|
)
|
|
|
|
// Reader is zstd reader
|
|
type Reader = gozstd.Reader
|
|
|
|
// NewReader returns zstd reader for the given r.
|
|
func NewReader(r io.Reader) *Reader {
|
|
return gozstd.NewReader(r)
|
|
}
|
|
|
|
// Writer is zstd writer
|
|
type Writer = gozstd.Writer
|
|
|
|
// NewWriterLevel returns zstd writer for the given w and level.
|
|
func NewWriterLevel(w io.Writer, level int) *Writer {
|
|
return gozstd.NewWriterLevel(w, level)
|
|
}
|