Support SIGHUP configuration reloading
Description:
Added SIGHUP UNIX signal handling to reload configuration (internal collector restart). I reused the configuration source notification reloading logic, a very small change.
Link to tracking Issue:
This is a possible solution/implementation for https://github.com/open-telemetry/opentelemetry-collector/issues/5966
Testing:
Added a basic SIGHUP signal test to ensure the collector finds itself in a running state.
Manual testing demonstrates that the SIGHUP signal successfully triggers the existing configuration reloading logic.
$ ./bin/otelcorecol_* --config ./examples/local/otel-config.yaml
$ ps aux | grep otel
portert+ 194518 0.3 0.2 1263472 36692 pts/3 SNl+ 12:55 0:00 ./bin/otelcorecol_linux_amd64 --config ./examples/local/otel-config.yaml
portert+ 194534 0.0 0.0 18676 648 pts/4 SN+ 12:55 0:00 grep --color=auto otel
$ kill -HUP 194518
From: https://gist.github.com/portertech/63a33aca67bc0468120abc924eda49e3
2022-08-30T12:01:39.918-0700 info service/service.go:129 Everything is ready. Begin running and processing data.
2022-08-30T12:04:42.226-0700 info service/collector.go:201 Received signal from OS {"signal": "hangup"}
2022-08-30T12:04:42.226-0700 warn service/collector.go:158 Config updated, restart service
2022-08-30T12:04:42.226-0700 info service/service.go:138 Starting shutdown...
Documentation:
Will need to update documentation to cover the newly supported UNIX signal (SIGHUP). This functionality is very common.
The committers listed above are authorized under a signed CLA.
- :white_check_mark: login: portertech / name: Sean Porter (935c46319c5b9b9e5e796a0d4e78357d4a831c8c, b49c7aed67532e1f45cb6bc63924360a058ec7ed)
This PR was marked stale due to lack of activity. It will be closed in 14 days.
This PR was marked stale due to lack of activity. It will be closed in 14 days.
@swiatekm-sumo any way you can talk to the author, or pickup this?
@swiatekm-sumo any way you can talk to the author, or pickup this?
@portertech is on vacation until Monday. I can pick it up in the meantime if we're in a big hurry though.
@bogdandrutu any other changes required?
Codecov Report
Base: 92.04% // Head: 92.00% // Decreases project coverage by -0.03% :warning:
Coverage data is based on head (
d9205d7) compared to base (6313054). Patch coverage: 50.00% of modified lines in pull request are covered.
Additional details and impacted files
@@ Coverage Diff @@
## main #6000 +/- ##
==========================================
- Coverage 92.04% 92.00% -0.04%
==========================================
Files 219 219
Lines 13245 13259 +14
==========================================
+ Hits 12191 12199 +8
- Misses 830 834 +4
- Partials 224 226 +2
| Impacted Files | Coverage Δ | |
|---|---|---|
| service/collector.go | 76.76% <50.00%> (-2.15%) |
:arrow_down: |
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
This PR was marked stale due to lack of activity. It will be closed in 14 days.