Skip to content

Commit

Permalink
Merge pull request prometheus#249 from kavirajk/kavirajk/expose-liste…
Browse files Browse the repository at this point in the history
…ner-addr

server: Expose `http` and `grpc` listen addresses.
  • Loading branch information
bboreham authored Aug 9, 2022
2 parents 75757d3 + 4116326 commit 72ba250
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,17 @@ func (s *Server) Run() error {
return <-errChan
}

// HTTPListenAddr exposes `net.Addr` that `Server` is listening to for HTTP connections.
func (s *Server) HTTPListenAddr() net.Addr {
return s.httpListener.Addr()

}

// GRPCListenAddr exposes `net.Addr` that `Server` is listening to for GRPC connections.
func (s *Server) GRPCListenAddr() net.Addr {
return s.grpcListener.Addr()
}

// Stop unblocks Run().
func (s *Server) Stop() {
s.handler.Stop()
Expand Down

0 comments on commit 72ba250

Please sign in to comment.