mirror of
https://github.com/prometheus-community/postgres_exporter
synced 2025-04-30 15:08:03 +00:00
PMM-12893 Fix handler logger
This commit is contained in:
parent
5c8b4e27d9
commit
96b7d12d15
@ -4,6 +4,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"crypto/sha256"
|
"crypto/sha256"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
stdlog "log"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
@ -88,7 +89,7 @@ func Handler(logger log.Logger, dsns []string, connSema *semaphore.Weighted, glo
|
|||||||
// Delegate http serving to Prometheus client library, which will call collector.Collect.
|
// Delegate http serving to Prometheus client library, which will call collector.Collect.
|
||||||
h := promhttp.HandlerFor(registry, promhttp.HandlerOpts{
|
h := promhttp.HandlerFor(registry, promhttp.HandlerOpts{
|
||||||
ErrorHandling: promhttp.ContinueOnError,
|
ErrorHandling: promhttp.ContinueOnError,
|
||||||
// ErrorLog: logger, //TODO!!!
|
ErrorLog: stdlog.New(log.NewStdlibAdapter(logger), "handler", 0),
|
||||||
})
|
})
|
||||||
|
|
||||||
h.ServeHTTP(w, r)
|
h.ServeHTTP(w, r)
|
||||||
|
Loading…
Reference in New Issue
Block a user