Skip to content
Snippets Groups Projects
Commit c1cfe73d authored by neezgee's avatar neezgee Committed by GitHub
Browse files

Merge pull request #17 from filippog/prometheus_log

Use github.com/prometheus/common/log
parents 8e441933 dfc799fb
Branches
No related tags found
No related merge requests found
...@@ -11,7 +11,7 @@ import ( ...@@ -11,7 +11,7 @@ import (
"sync" "sync"
"github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/log" "github.com/prometheus/common/log"
) )
const ( const (
...@@ -267,7 +267,7 @@ func (e *Exporter) Collect(ch chan<- prometheus.Metric) { ...@@ -267,7 +267,7 @@ func (e *Exporter) Collect(ch chan<- prometheus.Metric) {
e.mutex.Lock() // To protect metrics from concurrent collects. e.mutex.Lock() // To protect metrics from concurrent collects.
defer e.mutex.Unlock() defer e.mutex.Unlock()
if err := e.collect(ch); err != nil { 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.Inc()
e.scrapeFailures.Collect(ch) e.scrapeFailures.Collect(ch)
} }
...@@ -280,7 +280,7 @@ func main() { ...@@ -280,7 +280,7 @@ func main() {
exporter := NewExporter(*scrapeURI) exporter := NewExporter(*scrapeURI)
prometheus.MustRegister(exporter) prometheus.MustRegister(exporter)
log.Printf("Starting Server: %s", *listeningAddress) log.Infof("Starting Server: %s", *listeningAddress)
http.Handle(*metricsEndpoint, prometheus.Handler()) http.Handle(*metricsEndpoint, prometheus.Handler())
log.Fatal(http.ListenAndServe(*listeningAddress, nil)) log.Fatal(http.ListenAndServe(*listeningAddress, nil))
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment