Browse Source

Close file handler in textfile

pull/263/head
slene 9 years ago
parent
commit
dea279267a
  1. 1
      collector/textfile.go

1
collector/textfile.go

@ -91,6 +91,7 @@ func (c *textFileCollector) parseTextFiles() []*dto.MetricFamily {
}
var parser expfmt.TextParser
parsedFamilies, err := parser.TextToMetricFamilies(file)
file.Close()
if err != nil {
log.Errorf("Error parsing %s: %v", path, err)
error = 1.0

Loading…
Cancel
Save