Skip to content

Commit

Permalink
Expose Go runtime metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
uhthomas committed Feb 18, 2021
1 parent 810f235 commit 1bb17a1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ type Server struct {

func New(ctx context.Context, opts ...Option) (*Server, error) {
r := prometheus.NewRegistry()
if err := r.Register(prometheus.NewGoCollector()); err != nil {
return nil, fmt.Errorf("register go collector: %w", err)
}
s := &Server{
metricHandler: promhttp.InstrumentMetricHandler(
r, promhttp.HandlerFor(r, promhttp.HandlerOpts{}),
Expand Down

0 comments on commit 1bb17a1

Please sign in to comment.