Merge pull request #71 from prometheus/refactor/new-registry-api

The Prometheus Go client has a new handler API.
This commit is contained in:
juliusv 2013-02-13 10:31:51 -08:00
commit 79fc056090
1 changed files with 1 additions and 2 deletions

View File

@ -30,10 +30,9 @@ var (
func StartServing(persistence metric.MetricPersistence) { func StartServing(persistence metric.MetricPersistence) {
gorest.RegisterService(api.NewMetricsService(persistence)) gorest.RegisterService(api.NewMetricsService(persistence))
exporter := registry.DefaultRegistry.YieldExporter()
http.Handle("/", gorest.Handle()) http.Handle("/", gorest.Handle())
http.Handle("/metrics.json", exporter) http.Handle("/metrics.json", registry.DefaultHandler)
http.Handle("/static/", http.StripPrefix("/static/", http.FileServer(http.Dir("web/static")))) http.Handle("/static/", http.StripPrefix("/static/", http.FileServer(http.Dir("web/static"))))
go http.ListenAndServe(*listenAddress, nil) go http.ListenAndServe(*listenAddress, nil)