Skip to content

Commit

Permalink
optimize: directly use default metrics register (dapr#3053)
Browse files Browse the repository at this point in the history
Co-authored-by: Artur Souza <[email protected]>
  • Loading branch information
1046102779 and artursouza authored May 7, 2021
1 parent 82644c7 commit 560538e
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions pkg/metrics/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,10 @@ func (m *promMetricsExporter) Init() error {
return nil
}

// Add default health metrics for process
registry := prom.NewRegistry()
registry.MustRegister(prom.NewProcessCollector(prom.ProcessCollectorOpts{}))
registry.MustRegister(prom.NewGoCollector())

var err error
if m.ocExporter, err = ocprom.NewExporter(ocprom.Options{
Namespace: m.namespace,
Registry: registry,
Registry: prom.DefaultRegisterer.(*prom.Registry),
}); err != nil {
return errors.Errorf("failed to create Prometheus exporter: %v", err)
}
Expand Down

0 comments on commit 560538e

Please sign in to comment.