Skip to content

Commit

Permalink
Fixing http server startup to not say it is a metric server (#322)
Browse files Browse the repository at this point in the history
* Fixing http server startup to not say it is a metric server

Currently all http servers started log they are metrics servers starting.

This is confusing, now we let you describe what the server your starting does

* Removing serviceDescription and just logging generic starting/stopping on port
  • Loading branch information
JamesMurkin authored Feb 28, 2020
1 parent 165f9d7 commit eb09919
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/common/startup.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,15 @@ func ServeHttp(port uint16, mux http.Handler) (shutdown func()) {
Handler: mux}

go func() {
log.Printf("Metrics listening on %d", port)
log.Printf("Starting server listening on %d", port)
if err := srv.ListenAndServe(); err != http.ErrServerClosed {
panic(err)
}
}()
return func() {
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()
log.Print("Stopping metrics server")
log.Printf("Stopping server listening on %d", port)
e := srv.Shutdown(ctx)
if e != nil {
panic(e)
Expand Down

0 comments on commit eb09919

Please sign in to comment.