mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
chore: lint
Signed-off-by: Manik Rana <manikrana54@gmail.com>
This commit is contained in:
parent
0572ddc1c0
commit
72acd0c58f
|
@ -105,9 +105,9 @@ type openMetricsParserOptions struct {
|
||||||
SkipCT bool
|
SkipCT bool
|
||||||
}
|
}
|
||||||
|
|
||||||
type openMetricsOption func(*openMetricsParserOptions)
|
type OpenMetricsOption func(*openMetricsParserOptions)
|
||||||
|
|
||||||
func WithSkipCT(skipCT bool) openMetricsOption {
|
func WithSkipCT(skipCT bool) OpenMetricsOption {
|
||||||
return func(o *openMetricsParserOptions) {
|
return func(o *openMetricsParserOptions) {
|
||||||
o.SkipCT = skipCT
|
o.SkipCT = skipCT
|
||||||
}
|
}
|
||||||
|
@ -123,7 +123,7 @@ func NewOpenMetricsParser(b []byte, st *labels.SymbolTable) Parser {
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewOpenMetricsParserWithOpts returns a new parser of the byte slice with options.
|
// NewOpenMetricsParserWithOpts returns a new parser of the byte slice with options.
|
||||||
func NewOpenMetricsParserWithOpts(b []byte, st *labels.SymbolTable, opts ...openMetricsOption) Parser {
|
func NewOpenMetricsParserWithOpts(b []byte, st *labels.SymbolTable, opts ...OpenMetricsOption) Parser {
|
||||||
parser := &OpenMetricsParser{
|
parser := &OpenMetricsParser{
|
||||||
l: &openMetricsLexer{b: b},
|
l: &openMetricsLexer{b: b},
|
||||||
builder: labels.NewScratchBuilderWithSymbolTable(st, 16),
|
builder: labels.NewScratchBuilderWithSymbolTable(st, 16),
|
||||||
|
@ -629,7 +629,6 @@ func (p *OpenMetricsParser) parseMetricSuffix(t token) (Entry, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if p.skipCT {
|
if p.skipCT {
|
||||||
|
|
||||||
var newLbs labels.Labels
|
var newLbs labels.Labels
|
||||||
p.Metric(&newLbs)
|
p.Metric(&newLbs)
|
||||||
name := newLbs.Get(model.MetricNameLabel)
|
name := newLbs.Get(model.MetricNameLabel)
|
||||||
|
|
Loading…
Reference in a new issue