Skip to content

Commit

Permalink
Merge pull request #17 from filippog/prometheus_log
Browse files Browse the repository at this point in the history
Use github.com/prometheus/common/log
  • Loading branch information
neezgee authored Nov 29, 2016
2 parents 8e44193 + dfc799f commit c1cfe73
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions apache_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"sync"

"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/log"
"github.com/prometheus/common/log"
)

const (
Expand Down Expand Up @@ -267,7 +267,7 @@ func (e *Exporter) Collect(ch chan<- prometheus.Metric) {
e.mutex.Lock() // To protect metrics from concurrent collects.
defer e.mutex.Unlock()
if err := e.collect(ch); err != nil {
log.Printf("Error scraping apache: %s", err)
log.Errorf("Error scraping apache: %s", err)
e.scrapeFailures.Inc()
e.scrapeFailures.Collect(ch)
}
Expand All @@ -280,7 +280,7 @@ func main() {
exporter := NewExporter(*scrapeURI)
prometheus.MustRegister(exporter)

log.Printf("Starting Server: %s", *listeningAddress)
log.Infof("Starting Server: %s", *listeningAddress)
http.Handle(*metricsEndpoint, prometheus.Handler())
log.Fatal(http.ListenAndServe(*listeningAddress, nil))
}

0 comments on commit c1cfe73

Please sign in to comment.