diff options
Diffstat (limited to 'collector/textfile.go')
-rw-r--r-- | collector/textfile.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/collector/textfile.go b/collector/textfile.go index 64165e6..50c1807 100644 --- a/collector/textfile.go +++ b/collector/textfile.go | |||
@@ -238,14 +238,14 @@ func (c *textFileCollector) processFile(name string, ch chan<- prometheus.Metric | |||
238 | path := filepath.Join(c.path, name) | 238 | path := filepath.Join(c.path, name) |
239 | f, err := os.Open(path) | 239 | f, err := os.Open(path) |
240 | if err != nil { | 240 | if err != nil { |
241 | return nil, fmt.Errorf("failed to open textfile data file %q: %v", path, err) | 241 | return nil, fmt.Errorf("failed to open textfile data file %q: %w", path, err) |
242 | } | 242 | } |
243 | defer f.Close() | 243 | defer f.Close() |
244 | 244 | ||
245 | var parser expfmt.TextParser | 245 | var parser expfmt.TextParser |
246 | families, err := parser.TextToMetricFamilies(f) | 246 | families, err := parser.TextToMetricFamilies(f) |
247 | if err != nil { | 247 | if err != nil { |
248 | return nil, fmt.Errorf("failed to parse textfile data from %q: %v", path, err) | 248 | return nil, fmt.Errorf("failed to parse textfile data from %q: %w", path, err) |
249 | } | 249 | } |
250 | 250 | ||
251 | if hasTimestamps(families) { | 251 | if hasTimestamps(families) { |
@@ -267,7 +267,7 @@ func (c *textFileCollector) processFile(name string, ch chan<- prometheus.Metric | |||
267 | // a failure does not appear fresh. | 267 | // a failure does not appear fresh. |
268 | stat, err := f.Stat() | 268 | stat, err := f.Stat() |
269 | if err != nil { | 269 | if err != nil { |
270 | return nil, fmt.Errorf("failed to stat %q: %v", path, err) | 270 | return nil, fmt.Errorf("failed to stat %q: %w", path, err) |
271 | } | 271 | } |
272 | 272 | ||
273 | t := stat.ModTime() | 273 | t := stat.ModTime() |