-
-
Notifications
You must be signed in to change notification settings - Fork 105
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
[FEATURE] Delayed startup for polled/manual metrics #119
Comments
Totally missed this issue. Sorry about that! I am not sure that I follow 100% based on the example. But it sounds like you would defer those groups from starting and instead you would manually activate them based on the |
Yeah, that's the idea. We have quite a few periodic or manual metrics, which require our repo to be started, but of course we don't want to miss telemetry of the repo itself. |
For the missed metrics problem, I would suggest adding PromEx as the first item in your That aside, I can totally see this being added to PromEx as it is a useful feature. Is this something that you would be interested in tackling? |
If you put prom_ex first in your
This can be mitigated by checking if the repo is running in your polling callback, or switching the order in |
Should someone want simply skip the first metrics run (to avoid the error), you can add something like this to your metrics callback: if Enum.member?(Ecto.Repo.all_running(), MyApp.Repo) do
:telemetry.execute(
@event_name,
%{count: Function.to_get_count()},
%{}
)
end |
Is your feature request related to a problem? Please describe.
PromEx does start all metrics collection together, but manual or polled metrics might need processes started later in the supervision tree before being able to execute successfully. There's the
:manual_metrics_start_delay
config, but this neither supports polled metrics nor is is it really bullet prove given startup may not take a fixed amount of time.Describe the solution you would like to see
A way to have polled and the initial manual metric fetching be delayed without a timeout.
How would you expect this feature to work
Both polled and manual metrics have a group name.
It would be interesting to just configure starting them like this for the supervision tree.
Besides the plain problem statement, this also allows granular startup based on individual metric groups' dependencies, over the "one fixed deley" of
:manual_metrics_start_delay
.Additional context
Edit:
This approach would also allow clean shutdowns if metric collection is stopped before dependencies of it are stopped.
The text was updated successfully, but these errors were encountered: