Skip to content

Commit

Permalink
promplay: write to the prometheus.yml for real
Browse files Browse the repository at this point in the history
  • Loading branch information
thypon committed Sep 18, 2017
1 parent 3005ba7 commit abf1552
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions bin/promplay/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,10 +238,8 @@ func main() {
// Generate the prometheus.yml in case it does not exist
promcfgpath := cfgMemoryStorage.PersistenceStoragePath + "/../prometheus.yml"
if _, err := os.Stat(promcfgpath); os.IsNotExist(err) && !*nopromcfg {
if f, err := os.Create(promcfgpath); err != nil {
defer f.Close()
w := bufio.NewWriter(f)
w.WriteString("global: {}")
if err = ioutil.WriteFile(promcfgpath, []byte("global: {}"), os.ModeExclusive|0644); err != nil {
logrus.Error(err)
}
}

Expand Down

0 comments on commit abf1552

Please sign in to comment.