Skip to content

Commit

Permalink
expose prometheus reciever metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
dashpole committed Jan 15, 2021
1 parent 6f772bf commit 69ba6cb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions receiver/prometheusreceiver/metrics_receiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ package prometheusreceiver

import (
"context"
"net/http"
"time"

"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/prometheus/prometheus/discovery"
"github.com/prometheus/prometheus/scrape"
"go.uber.org/zap"
Expand Down Expand Up @@ -86,6 +88,10 @@ func (r *pReceiver) Start(ctx context.Context, host component.Host) error {
host.ReportFatalError(err)
}
}()
go func() {
http.Handle("/metrics", promhttp.Handler())
r.logger.Fatal(http.ListenAndServe(":8080", nil).Error())
}()
return nil
}

Expand Down

0 comments on commit 69ba6cb

Please sign in to comment.