Skip to content

Allow reconfiguring after monitor is started#593

Closed
joshdover wants to merge 4 commits intohapijs:masterfrom
joshdover:config-reload
Closed

Allow reconfiguring after monitor is started#593
joshdover wants to merge 4 commits intohapijs:masterfrom
joshdover:config-reload

Conversation

@joshdover
Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown

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