Skip to content

Commit

Permalink
Reduced logging level for collector shutdown due to context cancel (#…
Browse files Browse the repository at this point in the history
…5258)

* Reduced logging level for collector shutdown due to context cancel

Signed-off-by: Corbin Phelps <[email protected]>

* Updated changelog with PR number

Signed-off-by: Corbin Phelps <[email protected]>

* Modified logging of context cancel to include error string

Signed-off-by: Corbin Phelps <[email protected]>

* Added back error wrap on zap.Error

Signed-off-by: Corbin Phelps <[email protected]>
  • Loading branch information
Corbin Phelps authored Apr 26, 2022
1 parent a8ad007 commit 15d79e6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
### 💡 Enhancements 💡

- Extend config.Map.Unmarshal hook to check map key string to any TextUnmarshaler not only ComponentID (#5244)
- Collector will no longer print error with stack trace when the collector is shutdown due to a context cancel. (#5258)

### 🧰 Bug fixes 🧰
- Fix translation from otlp.Request to pdata representation, changes to the returned pdata not all reflected to the otlp.Request (#5197)
Expand Down
3 changes: 2 additions & 1 deletion service/collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,8 @@ LOOP:
col.logger.Info("Received shutdown request")
break LOOP
case <-ctx.Done():
col.logger.Error("Context done, terminating process", zap.Error(ctx.Err()))
col.logger.Info("Context done, terminating process", zap.Error(ctx.Err()))

// Call shutdown with background context as the passed in context has been canceled
return col.shutdown(context.Background())
}
Expand Down

0 comments on commit 15d79e6

Please sign in to comment.