-
Notifications
You must be signed in to change notification settings - Fork 327
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
Solve the startup and configuration hell. #395
Comments
Is this the container for comments on configuration? One of the issues I just found with using One solution may be to load the configs unresolved and use a manual means to find the |
I think that there are certain things that are kind of defined already for this issue:
The only thing that we really need to answer is this question from above: "what happens if Kamon APIs are used before Kamon is started?"... the options are either to block everything or to allow everything until Kamon is properly started and all filters and settings are known. I am very enthusiastic of going for the allow everything approach. And by "allow everything" I mean that if you request Kamon for an entity, it will give you the entity, if you start a trace, it will measure it but with metrics only mode. Subscriptions will not be working, not reporters will be started until you call |
taking some ideas from kamon-io#395, this commit removes ConfigProviders and allows Kamon to be used in "permissive" mode until it gets started.
There are a few inconveniences related to how Kamon's lifetime is handled (or poorly handled, to be more accurate):
Kamon.start()
is called. This is good in the sense that whenever you access any of Kamon's APIs you will be guaranteed that Kamon is started, but it took away the possibility of callingKamon.start(config)
which many users seem to be missing now. As a side note, we introduced config providers so that you can still kick in and provide a config object, but it might not be the most comfortable API.Proposals (WIP):
Kamon should get a proper and deterministic startup and shutdown behavior. It should be very clear what to expect if you don't start Kamon, if you start it, or if you start it a hundred times, same goes with shutdown.
The shutdown process is the simplest to approach. When Kamon is shutdown, besides shutting down the internal ActorSystem we should also make sure that Kamon's internal state is put back to as if it was never started. We might consider extending the shutdown process to signal Kamon's shutdown to all reporting modules so that they can close any related resources. (Note that this could also be achieved by hooking in the reporting module's actor lifecycle). If we shutdown and start Kamon again it should work exactly as if it was started for the first time, except that all entities that were created with the first Kamon instance will not be linked to the new instance.
We should allow users to pass a custom config object. This is also required for Play! applications where we should always be using the config object form the context on the application loader. So, this leaves a few questions open:
Hope to get some feedback before jumping into implementing this, which I want to start as soon as possible.
The text was updated successfully, but these errors were encountered: