mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
chore: use textparse interface to set om options
Signed-off-by: Manik Rana <manikrana54@gmail.com>
This commit is contained in:
parent
3de6bffae7
commit
0caaa96206
|
@ -61,17 +61,13 @@ const (
|
||||||
var symbolTable = labels.NewSymbolTable()
|
var symbolTable = labels.NewSymbolTable()
|
||||||
|
|
||||||
func fuzzParseMetricWithContentType(in []byte, contentType string) int {
|
func fuzzParseMetricWithContentType(in []byte, contentType string) int {
|
||||||
p, warning := textparse.New(in, contentType, false, symbolTable)
|
p, warning := textparse.New(in, contentType, false, false, symbolTable)
|
||||||
if warning != nil {
|
if warning != nil {
|
||||||
// An invalid content type is being passed, which should not happen
|
// An invalid content type is being passed, which should not happen
|
||||||
// in this context.
|
// in this context.
|
||||||
panic(warning)
|
panic(warning)
|
||||||
}
|
}
|
||||||
|
|
||||||
if contentType == "application/openmetrics-text" {
|
|
||||||
p = textparse.NewOpenMetricsParser(in, symbolTable)
|
|
||||||
}
|
|
||||||
|
|
||||||
var err error
|
var err error
|
||||||
for {
|
for {
|
||||||
_, err = p.Next()
|
_, err = p.Next()
|
||||||
|
|
Loading…
Reference in a new issue