ricardomaraschini / oomhero

Kubernetes sidecar for memory usage tracking
Apache License 2.0
108 stars 10 forks source link

Configurable signals #13

Closed szarykott closed 1 year ago

szarykott commented 1 year ago

First of all - thank you for this work, this is the only solution on the internet I found to solve my problems!

However, there is an improvement that would facilitate seamless integration with the existing setup at my company - configurable signals that are sent to other processes. As of now, they are hardcoded as SIGUSR1 and SIGUSR2. To take advantage of them we need to implement logic in the application to handle them, whereas what we want to achieve is simply gracefully shutting down the application - and for that, SIGTERM would be perfect.

To keep backward compatibility and flexibility signal to use could be provided via an environment variable or command line argument with defaults that are equal to currently hardcoded signals.

I am willing to code this and make a pull request, but I want to know your opinion first. Please let me know what you think!

ricardomaraschini commented 1 year ago

Hi, looks good to me! My pleasure to merge it.

ricardomaraschini commented 1 year ago

@szarykott thanks again for delivering this.