Closed akoutmos closed 3 years ago
Hey @akoutmos. The only issue I see here is that this would necessitate dropping support for OTP 20. Let's leave this open for now.
I'm not strongly opposed to bumping the minimum version but OTP 20 is supported through Elixir 1.9 and I'm hesitant to raise it just to add this option, but this would be a good addition as part of a larger update taking advantage of more OTP 21 features.
Hey @bryannaegele! Totally understandable on the OTP 20 front. I can rewrite the async/non_async flag stuff to be done the way it was before versus using a handle_continue if that's ok with you?
Hey @bryannaegele! Totally understandable on the OTP 20 front. I can rewrite the async/non_async flag stuff to be done the way it was before versus using a handle_continue if that's ok with you?
Yeah, that would be totally fine. Just be sure to add documentation for it and test coverage.
@bryannaegele This one should be good to go now! Thanks in advance for the review :).
Added some docs in my latest commit. Hopefully the additional context is useful for future readers :)
Friendly bump :). Was there anything else that needed cleaning up for this PR?
Friendly bump :). Was there anything else that needed cleaning up for this PR?
Sorry. Just a lot going on. :)
Oh! Actually, @akoutmos can you re-open a PR with this pointed at main
? We aren't using master any longer.
It has been done! https://github.com/beam-telemetry/telemetry_metrics_prometheus_core/pull/39 Thanks again :)
The purpose of this PR is two fold.
One is to leverage the GenServer
handle_continue
callback as to guarantee that the initialization steps for the GenServer are the first things that take place upon spawning the process. I ran into some issues wheretelemetry_metrics_prometheus_core
was being started as part of a supervision tree and I was getting inconsistent results on app start.The second change is to add a flag to either init the process in the init function (in turn blocking the rest of the supervision tree from starting) or leveraging the
handle_continue
callback. The reason for this change is that if the supervision tree is allowed to continue without metrics being in place, you have a short window of time where you can miss telemetry events being emitted. The change currently has the default of using thehandle_continue
callback so the process behaviour is in line with what is in master today.Thanks in advance for the review :)