Skip to content

Commit

Permalink
config: don't log an error on close (#6299)
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 <223565+codeboten@users.noreply.github.com>
  • Loading branch information
codeboten authored Nov 7, 2024
1 parent da04e2d commit 8e0db19
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

- Upgrade `go.opentelemetry.io/otel/semconv/v1.17.0` to `go.opentelemetry.io/otel/semconv/v1.21.0` in `go.opentelemetry.io/contrib/instrumentation/go.mongodb.org/mongo-driver/mongo/otelmongo`. (#6272)
- Resource doesn't merge with defaults if a valid resource is configured in `go.opentelemetry.io/contrib/config`. (#6289)
- `otel.Handle` is no longer called on a successful shutdown of the Prometheus exporter in `go.opentelemetry.io/contrib/config`. (#6299)

### Fixed

Expand Down
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 8e0db19

Please sign in to comment.