Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow reconfiguring after monitor is started #593

Closed
wants to merge 4 commits into from

Conversation

joshdover
Copy link

This allows consumer apps to reconfigure and restart good's monitor on the fly. This is useful for supporting logrotate (allows our application to handle SIGHUP signals to trigger reopening of files) and supporting on-the-fly configuration changes.

We're using this in https://github.com/elastic/kibana and think it's a useful addition to all users of good. I've included updated tests and documentation. Happy to take feedback and tweaks!

This allows consumer apps to reconfigure and restart good's monitor on
the fly. This is useful for supporting logrotate (SIGHUPs trigger
reopening of files) and supporting on-the-fly configuration changes.
lib/monitor.js Outdated
this._server.events.removeListener('response', this._responseHandler);
// These cannot be removed because Podium does not support unsubscribing from criteria, only event names.
// this._server.events.removeListener({ name: 'request', channels: ['error'] }, this._errorHandler);
// this._server.events.removeListener({ name: 'request', channels: ['app'] }, this._requestLogHandler);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just realized it may be possible that these produce duplicate events if registered more than once. Will need to double check on that.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Turns out it would create duplicates. I've fixed and added a test to verify this doesn't happen.

@joshdover
Copy link
Author

We've moved this to our fork at https://github.com/elastic/good

@joshdover joshdover closed this Aug 28, 2018
@joshdover joshdover deleted the config-reload branch September 26, 2019 13:40
@lock
Copy link

lock bot commented Jan 9, 2020

This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant