Move from client_golang/text to common/expfmt
This commit is contained in:
parent
ca74e8ab3e
commit
8f182d2f02
|
@ -12,13 +12,12 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
dto "github.com/prometheus/client_model/go"
|
|
||||||
|
|
||||||
"github.com/golang/protobuf/proto"
|
"github.com/golang/protobuf/proto"
|
||||||
|
"github.com/prometheus/client_golang/prometheus"
|
||||||
|
"github.com/prometheus/common/expfmt"
|
||||||
"github.com/prometheus/log"
|
"github.com/prometheus/log"
|
||||||
|
|
||||||
"github.com/prometheus/client_golang/prometheus"
|
dto "github.com/prometheus/client_model/go"
|
||||||
"github.com/prometheus/client_golang/text"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
@ -78,7 +77,8 @@ func (c *textFileCollector) parseTextFiles() []*dto.MetricFamily {
|
||||||
error = 1.0
|
error = 1.0
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
parsedFamilies, err := (&text.Parser{}).TextToMetricFamilies(file)
|
var parser expfmt.TextParser
|
||||||
|
parsedFamilies, err := parser.TextToMetricFamilies(file)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Errorf("Error parsing %s: %v", path, err)
|
log.Errorf("Error parsing %s: %v", path, err)
|
||||||
error = 1.0
|
error = 1.0
|
||||||
|
|
Loading…
Reference in New Issue