opentelemetry-collector icon indicating copy to clipboard operation
opentelemetry-collector copied to clipboard

Support SIGHUP configuration reloading

Open portertech opened this issue 3 years ago • 2 comments

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.

portertech avatar Aug 30 '22 19:08 portertech

CLA Signed

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.

github-actions[bot] avatar Sep 14 '22 04:09 github-actions[bot]

This PR was marked stale due to lack of activity. It will be closed in 14 days.

github-actions[bot] avatar Oct 12 '22 03:10 github-actions[bot]

@swiatekm-sumo any way you can talk to the author, or pickup this?

bogdandrutu avatar Oct 12 '22 20:10 bogdandrutu

@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.

swiatekm avatar Oct 13 '22 15:10 swiatekm

@bogdandrutu any other changes required?

portertech avatar Oct 17 '22 19:10 portertech

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.

codecov[bot] avatar Oct 25 '22 14:10 codecov[bot]

This PR was marked stale due to lack of activity. It will be closed in 14 days.

github-actions[bot] avatar Nov 09 '22 03:11 github-actions[bot]