Restore expvar handler. (#3209)

In #3167 I removed expvar, thinking it was unused, but it turns out the RA
exports the last issuance time, and core/util.go has a function to export
BuildID, both of which are used in monitoring. This wasn't caught at compile
time because the global expvar package was happy to register the exports even
though there was no handler to serve them.
This commit is contained in:
Jacob Hoffman-Andrews 2017-11-02 07:05:54 -07:00 committed by Roland Bracewell Shoemaker
parent 8103ee0b27
commit 3d9b3d4d20
1 changed files with 2 additions and 0 deletions

View File

@ -20,6 +20,7 @@ import (
"encoding/json"
"encoding/pem"
"errors"
"expvar"
"fmt"
"io/ioutil"
"log"
@ -169,6 +170,7 @@ func newScope(addr string, logger blog.Logger) metrics.Scope {
reg("profile")
reg("threadcreate")
reg("trace")
mux.Handle("/debug/vars", expvar.Handler())
mux.Handle("/metrics", promhttp.HandlerFor(registry, promhttp.HandlerOpts{
ErrorLog: promLogger{logger},
}))