diff --git a/apache_exporter.go b/apache_exporter.go index 4c1be4600fbe33de00addb18592a6b8027bcd1dd..321c1f3bfd60a965daf4c70a96714bd63edea5dc 100644 --- a/apache_exporter.go +++ b/apache_exporter.go @@ -11,7 +11,7 @@ import ( "sync" "github.com/prometheus/client_golang/prometheus" - "github.com/prometheus/log" + "github.com/prometheus/common/log" ) const ( @@ -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) } @@ -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)) }