Skip to content

Commit

Permalink
Reset code
Browse files Browse the repository at this point in the history
  • Loading branch information
Antoon Prins committed May 13, 2020
1 parent 9b593cf commit 446f9ef
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions internal/http/services/prometheus/prometheus.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@ package prometheus
import (
"net/http"

"contrib.go.opencensus.io/exporter/prometheus"
"github.com/cs3org/reva/pkg/rhttp/global"
"github.com/mitchellh/mapstructure"
"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/pkg/errors"
"go.opencensus.io/stats/view"
)

func init() {
Expand All @@ -41,18 +43,16 @@ func New(m map[string]interface{}) (global.Service, error) {
conf.Prefix = "metrics"
}

// pe, err := prometheus.NewExporter(prometheus.Options{
// Namespace: "revad",
// })
// if err != nil {
// return nil, errors.Wrap(err, "prometheus: error creating exporter")
// }

// view.RegisterExporter(pe)
pe, err := prometheus.NewExporter(prometheus.Options{
Namespace: "revad",
})
if err != nil {
return nil, errors.Wrap(err, "prometheus: error creating exporter")
}

// return &svc{prefix: conf.Prefix, h: pe}, nil
view.RegisterExporter(pe)

return &svc{prefix: conf.Prefix, h: promhttp.Handler()}, nil
return &svc{prefix: conf.Prefix, h: pe}, nil
}

type config struct {
Expand Down

0 comments on commit 446f9ef

Please sign in to comment.