-
-
Notifications
You must be signed in to change notification settings - Fork 106
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
[BUG] Ecto dashboard not showing the repo name #190
Comments
Did you make sure that the PromEx application is first in the children in application.ex? It will not catch the init events if it does not start before ecto/oban/etc. |
Thanks for reaching out. No, it's not always started as first child in our applications. So it needs the init events to find the repo names? |
Correct, I had the exact same behavior, which I fixed by putting PromEx as the first child to be started. |
Are we sure about that, @wkpatrick? I am not disagreeing, but I am getting confused by the code: The telemetry attachment should send the prom_ex/lib/prom_ex/plugins/ecto.ex Line 246 in 6a002fb
What could happen is that you have yet to receive any information; therefore, that list is empty. But I don't see any requirement about the order of the processes. You do need a prom_ex/lib/prom_ex/plugins/ecto.ex Line 55 in 6a002fb
:repos options prom_ex/lib/prom_ex/plugins/ecto.ex Line 54 in 6a002fb
@pallix, please confirm,
|
The ecto dashboard parses the repo name out of the init metrics prom_ex/lib/prom_ex/plugins/ecto.ex Line 74 in 6a002fb
The event is only fired once when the Repo supervisor starts. Therefore, if the prom_ex application starts after Ecto, it will not have received the telemetry event for init. Which means it does not generate the promethus metric format for the init, so the dashboard is unable to generate the label values for it. |
Right right, but that is true only for the Being said, probably prudent to initiate PromEx before, regardless. @pallix please confirm that reordering the processes fix the issue. |
Nope. _prom_ex_ecto_repo_init_status_info is only filled on init. Other metrics contain the repo name, but only init_status_info is parsed to generate the labels in the dashboard. |
I will try to test it this week! Thank you. |
The suggested fix works, than you very much 🤗 |
@pallix do you mind creating a PR updating the docs, or closing the issue? |
Shouldn't it be solve at the code level and the order of the children made irrelevant? or it's not practical? |
🤷🏻 I am not sure. I think we can take baby steps on the topic. The documentation should be enough for now, and I will commit to fixing it. The following person could do that if you don't have time. @wkpatrick is more knowledgeable here, so maybe he knows some limitations and whatnot. Give it a try if you want to 🚀 |
Peeps, any updates over here?! |
Given that the Telemetry events are synchronous and not captured/stored by any other mechanism, the PromEx supervision tree must be started prior to starting the Repo supervision trees or else the Telemetry events will be missed with no way to retroactively get their measurements and metadata. I'll have to look into whether there is a better way to capture Ecto init data (perhaps don't even attach to the init event and just query the repo module directly for the same data), but for now PromEx should come first in the supervision tree. If anyone has some bandwidth, a documentation update would be appreciated! |
@akoutmos do you think we should tell people to start the PromEx supervisor as soon as possible? Even before forming clusters? or what???? |
I will try to find time for a pull request in the next days |
Actually it's already in the doc since two years :-):
I suggest the two followings changes to improve the doc:
I will adress both with a PR. |
This is needed to ensure it detects the Ecto repo properly. See: akoutmos/prom_ex#190
Describe the bug
When using the ecto plugin, the drop list menu on the dashboard does not show the repo:
Environment
The text was updated successfully, but these errors were encountered: