mirror of
https://github.com/prometheus/prometheus
synced 2025-03-10 07:29:22 +00:00
Add needed trailing spaces in logs.
This commit is contained in:
parent
da420a5b97
commit
0003027dce
12
main.go
12
main.go
@ -173,7 +173,7 @@ func main() {
|
||||
|
||||
ts, err := metric.NewTieredStorage(uint(*diskAppendQueueCapacity), 100, *arenaFlushInterval, *arenaTTL, *metricsStoragePath)
|
||||
if err != nil {
|
||||
glog.Fatal("Error opening storage:", err)
|
||||
glog.Fatal("Error opening storage: ", err)
|
||||
}
|
||||
|
||||
unwrittenSamples := make(chan *extraction.Result, *samplesQueueCapacity)
|
||||
@ -193,7 +193,7 @@ func main() {
|
||||
// Queue depth will need to be exposed
|
||||
ruleManager := rules.NewRuleManager(unwrittenSamples, notifications, conf.EvaluationInterval(), ts)
|
||||
if err := ruleManager.AddRulesFromConfig(conf); err != nil {
|
||||
glog.Fatal("Error loading rule files:", err)
|
||||
glog.Fatal("Error loading rule files: ", err)
|
||||
}
|
||||
go ruleManager.Run()
|
||||
|
||||
@ -272,7 +272,7 @@ func main() {
|
||||
err := prometheus.compact(*headAge, *headGroupSize)
|
||||
|
||||
if err != nil {
|
||||
glog.Error("could not compact:", err)
|
||||
glog.Error("could not compact: ", err)
|
||||
}
|
||||
glog.Info("Done")
|
||||
}
|
||||
@ -284,7 +284,7 @@ func main() {
|
||||
err := prometheus.compact(*bodyAge, *bodyGroupSize)
|
||||
|
||||
if err != nil {
|
||||
glog.Error("could not compact:", err)
|
||||
glog.Error("could not compact: ", err)
|
||||
}
|
||||
glog.Info("Done")
|
||||
}
|
||||
@ -296,7 +296,7 @@ func main() {
|
||||
err := prometheus.compact(*tailAge, *tailGroupSize)
|
||||
|
||||
if err != nil {
|
||||
glog.Error("could not compact:", err)
|
||||
glog.Error("could not compact: ", err)
|
||||
}
|
||||
glog.Info("Done")
|
||||
}
|
||||
@ -308,7 +308,7 @@ func main() {
|
||||
err := prometheus.delete(*deleteAge, deletionBatchSize)
|
||||
|
||||
if err != nil {
|
||||
glog.Error("could not delete:", err)
|
||||
glog.Error("could not delete: ", err)
|
||||
}
|
||||
glog.Info("Done")
|
||||
}
|
||||
|
@ -96,7 +96,7 @@ func interpolateMessage(msg string, labels clientmodel.LabelSet, value clientmod
|
||||
"{{$value := .Value}}"
|
||||
|
||||
if _, err := t.Parse(defs + msg); err != nil {
|
||||
glog.Warning("Error parsing template:", err)
|
||||
glog.Warning("Error parsing template: ", err)
|
||||
return msg
|
||||
}
|
||||
|
||||
@ -115,7 +115,7 @@ func interpolateMessage(msg string, labels clientmodel.LabelSet, value clientmod
|
||||
|
||||
var buf bytes.Buffer
|
||||
if err := t.Execute(&buf, &tmplData); err != nil {
|
||||
glog.Warning("Error executing template:", err)
|
||||
glog.Warning("Error executing template: ", err)
|
||||
return msg
|
||||
}
|
||||
return buf.String()
|
||||
@ -187,7 +187,7 @@ func (n *NotificationHandler) Run() {
|
||||
recordOutcome(time.Since(begin), err)
|
||||
|
||||
if err != nil {
|
||||
glog.Error("Error sending notification:", err)
|
||||
glog.Error("Error sending notification: ", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -303,7 +303,7 @@ func (t *target) GlobalAddress() string {
|
||||
address := t.address
|
||||
hostname, err := os.Hostname()
|
||||
if err != nil {
|
||||
glog.Warning("Couldn't get hostname: %s, returning target.Address()", err)
|
||||
glog.Warningf("Couldn't get hostname: %s, returning target.Address()", err)
|
||||
return address
|
||||
}
|
||||
for _, localhostRepresentation := range localhostRepresentations {
|
||||
|
@ -78,7 +78,7 @@ func (p *sdTargetProvider) Targets() ([]Target, error) {
|
||||
for _, record := range response.Answer {
|
||||
addr, ok := record.(*dns.SRV)
|
||||
if !ok {
|
||||
glog.Warning("%s is not a valid SRV record", addr)
|
||||
glog.Warningf("%s is not a valid SRV record", addr)
|
||||
continue
|
||||
}
|
||||
// Remove the final dot from rooted DNS names to make them look more usual.
|
||||
|
@ -127,7 +127,7 @@ func (p *TargetPool) runIteration(results chan<- *extraction.Result, interval ti
|
||||
if p.targetProvider != nil {
|
||||
targets, err := p.targetProvider.Targets()
|
||||
if err != nil {
|
||||
glog.Warning("Error looking up targets, keeping old list: %s", err)
|
||||
glog.Warningf("Error looking up targets, keeping old list: %s", err)
|
||||
} else {
|
||||
p.ReplaceTargets(targets)
|
||||
}
|
||||
|
@ -402,7 +402,7 @@ func (node *VectorAggregation) Eval(timestamp time.Time, view *viewAdapter) Vect
|
||||
func (node *VectorLiteral) Eval(timestamp time.Time, view *viewAdapter) Vector {
|
||||
values, err := view.GetValueAtTime(node.fingerprints, timestamp)
|
||||
if err != nil {
|
||||
glog.Error("Unable to get vector values:", err)
|
||||
glog.Error("Unable to get vector values: ", err)
|
||||
return Vector{}
|
||||
}
|
||||
return values
|
||||
@ -590,7 +590,7 @@ func (node *MatrixLiteral) Eval(timestamp time.Time, view *viewAdapter) Matrix {
|
||||
}
|
||||
values, err := view.GetRangeValues(node.fingerprints, interval)
|
||||
if err != nil {
|
||||
glog.Error("Unable to get values for vector interval:", err)
|
||||
glog.Error("Unable to get values for vector interval: ", err)
|
||||
return Matrix{}
|
||||
}
|
||||
return values
|
||||
@ -603,7 +603,7 @@ func (node *MatrixLiteral) EvalBoundaries(timestamp time.Time, view *viewAdapter
|
||||
}
|
||||
values, err := view.GetBoundaryValues(node.fingerprints, interval)
|
||||
if err != nil {
|
||||
glog.Error("Unable to get boundary values for vector interval:", err)
|
||||
glog.Error("Unable to get boundary values for vector interval: ", err)
|
||||
return Matrix{}
|
||||
}
|
||||
return values
|
||||
|
@ -104,7 +104,7 @@ func (l *LevelDBMetricPersistence) Close() {
|
||||
closer.Close()
|
||||
case errorCloser:
|
||||
if err := closer.Close(); err != nil {
|
||||
glog.Error("Error closing persistence:", err)
|
||||
glog.Error("Error closing persistence: ", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -236,7 +236,7 @@ func NewLevelDBMetricPersistence(baseDirectory string) (*LevelDBMetricPersistenc
|
||||
|
||||
if !workers.Wait() {
|
||||
for _, err := range workers.Errors() {
|
||||
glog.Error("Could not open storage:", err)
|
||||
glog.Error("Could not open storage: ", err)
|
||||
}
|
||||
|
||||
return nil, fmt.Errorf("Unable to open metric persistence.")
|
||||
|
@ -110,13 +110,13 @@ func main() {
|
||||
|
||||
entire, err := persistence.MetricSamples.ForEach(dumper, dumper, dumper)
|
||||
if err != nil {
|
||||
glog.Fatal("Error dumping samples:", err)
|
||||
glog.Fatal("Error dumping samples: ", err)
|
||||
}
|
||||
if !entire {
|
||||
glog.Fatal("Didn't scan entire corpus")
|
||||
}
|
||||
dumper.Flush()
|
||||
if err = dumper.Error(); err != nil {
|
||||
glog.Fatal("Error flushing CSV:", err)
|
||||
glog.Fatal("Error flushing CSV: ", err)
|
||||
}
|
||||
}
|
||||
|
@ -44,9 +44,9 @@ func main() {
|
||||
start := time.Now()
|
||||
glog.Info("Starting compaction...")
|
||||
size, _ := persistences.Sizes()
|
||||
glog.Info("Original Size:", size)
|
||||
glog.Info("Original Size: ", size)
|
||||
persistences.Prune()
|
||||
glog.Info("Finished in", time.Since(start))
|
||||
glog.Info("Finished in ", time.Since(start))
|
||||
size, _ = persistences.Sizes()
|
||||
glog.Info("New Size:", size)
|
||||
glog.Info("New Size: ", size)
|
||||
}
|
||||
|
@ -123,14 +123,14 @@ func (serv MetricsService) Metrics() string {
|
||||
serv.setAccessControlHeaders(rb)
|
||||
rb.SetContentType(gorest.Application_Json)
|
||||
if err != nil {
|
||||
glog.Error("Error loading metric names:", err)
|
||||
glog.Error("Error loading metric names: ", err)
|
||||
rb.SetResponseCode(http.StatusInternalServerError)
|
||||
return err.Error()
|
||||
}
|
||||
sort.Sort(metricNames)
|
||||
resultBytes, err := json.Marshal(metricNames)
|
||||
if err != nil {
|
||||
glog.Error("Error marshalling metric names:", err)
|
||||
glog.Error("Error marshalling metric names: ", err)
|
||||
rb.SetResponseCode(http.StatusInternalServerError)
|
||||
return err.Error()
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ func (h Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
file, err := GetFile(StaticFiles, name)
|
||||
if err != nil {
|
||||
if err != io.EOF {
|
||||
glog.Warning("Could not get file:", err)
|
||||
glog.Warning("Could not get file: ", err)
|
||||
}
|
||||
w.WriteHeader(http.StatusNotFound)
|
||||
return
|
||||
|
@ -76,7 +76,7 @@ func (w WebService) ServeForever() error {
|
||||
exp.Handle("/user/", http.StripPrefix("/user/", http.FileServer(http.Dir(*userAssetsPath))))
|
||||
}
|
||||
|
||||
glog.Info("listening on %s", *listenAddress)
|
||||
glog.Info("listening on ", *listenAddress)
|
||||
|
||||
return http.ListenAndServe(*listenAddress, exp.DefaultCoarseMux)
|
||||
}
|
||||
@ -93,7 +93,7 @@ func getEmbeddedTemplate(name string) (*template.Template, error) {
|
||||
|
||||
file, err := blob.GetFile(blob.TemplateFiles, "_base.html")
|
||||
if err != nil {
|
||||
glog.Error("Could not read base template:", err)
|
||||
glog.Error("Could not read base template: ", err)
|
||||
return nil, err
|
||||
}
|
||||
t.Parse(string(file))
|
||||
@ -130,12 +130,12 @@ func getTemplate(name string) (t *template.Template, err error) {
|
||||
func executeTemplate(w http.ResponseWriter, name string, data interface{}) {
|
||||
tpl, err := getTemplate(name)
|
||||
if err != nil {
|
||||
glog.Error("Error preparing layout template:", err)
|
||||
glog.Error("Error preparing layout template: ", err)
|
||||
return
|
||||
}
|
||||
err = tpl.Execute(w, data)
|
||||
if err != nil {
|
||||
glog.Error("Error executing template:", err)
|
||||
glog.Error("Error executing template: ", err)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user