Skip to content

Commit

Permalink
config: don't log an error on close
Browse files Browse the repository at this point in the history
This is an expected outcome of the server shutdown being called, no
need to log an error about it.

Signed-off-by: Alex Boten <[email protected]>
  • Loading branch information
codeboten committed Nov 6, 2024
1 parent b78f75a commit 098122b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion config/metric.go
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ func prometheusReader(ctx context.Context, prometheusConfig *Prometheus) (sdkmet
}

go func() {
if err := server.Serve(lis); err != nil && errors.Is(err, http.ErrServerClosed) {
if err := server.Serve(lis); err != nil && !errors.Is(err, http.ErrServerClosed) {
otel.Handle(fmt.Errorf("the Prometheus HTTP server exited unexpectedly: %w", err))
}
}()
Expand Down

0 comments on commit 098122b

Please sign in to comment.