Merged
Conversation
this adds support for specifying runtime config options via cli args. cli args take precedence over the any values in config files. note that we don't support the entire nerve config; service level/check config can still only be done via the config file
use a json schema to encode the docs for nerve config and improve docs
ilkinmammadzada
approved these changes
Mar 5, 2026
giuli007
approved these changes
Mar 5, 2026
giuli007
left a comment
There was a problem hiding this comment.
I haven't read it all in superdetail but looks reasonable to me!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background: We use nerve-tools to restart nerve at Yelp. Notably, rather than doing a hard restart, we launch a second copy of nerve, replace the 'main' nerve process, and then terminate the backup. This prevents us from deregistering all the backends running on a host every time we restart nerve. We run the backup nerve instance using the same config file that we run the main instance with.
In #16 we added support for exporting prometheus metrics from nerve. this requires binding an http server to the configured port. However, this doesn't play nicely with our graceful restart procedure; we can't have 2 nerve processes bind to the same prometheus port.
To overcome this, we've chosen to disable prometheus on the backup nerve instance. Which raises the question: how should we tell the backup nerve instance to not enable prom metrics? We could tell the backup nerve instance to use a backup config file, but that introduces the suprise factor of having 2 config files on disk.
Instead, this PR introduces the ability to set the runtime nerve config (not the service/healthcheck config) via cli args. cli args take precedence over the config file. That'll allow us to just run the backup nerve instance with --prometheus-enabled=false, but still use the same config file for all other options.
I've tried to improve the docs for the config while I'm here, encoding the config in a json schema and using it to auto generate
docs/configuration.md. I've included a make target for generating this automatically.