mirror of
https://github.com/prometheus/prometheus
synced 2024-12-26 00:23:18 +00:00
Display filename when encountering bad rule file.
Change-Id: I4729371be92c5659a6938145c5fde66771d7be22
This commit is contained in:
parent
fb44580110
commit
77a79d1fc0
@ -14,6 +14,7 @@
|
||||
package rules
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
@ -167,7 +168,7 @@ func (m *ruleManager) AddRulesFromConfig(config config.Config) error {
|
||||
for _, ruleFile := range config.Global.RuleFile {
|
||||
newRules, err := LoadRulesFromFile(ruleFile)
|
||||
if err != nil {
|
||||
return err
|
||||
return fmt.Errorf("%s: %s", ruleFile, err)
|
||||
}
|
||||
m.Lock()
|
||||
m.rules = append(m.rules, newRules...)
|
||||
|
Loading…
Reference in New Issue
Block a user