You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Documentation for config_opts says: "This option can either accept an MFA that will return a string of the full path where the YAML configuration file is, or a keyword list with options so that PromEx can generate a config file for you."
Looking at the code though, it seems pretty clear that it only supports a keyword list - not an MFA.
** (Mix) Could not start application myapp: MyApp.Application.start(:normal, []) returned an error: shutdown: failed to start child: MyApp.PromEx
** (EXIT) an exception was raised:
** (FunctionClauseError) no function clause matching in Keyword.get/3
(elixir 1.13.4) lib/keyword.ex:352: Keyword.get({SomeModule, :foo, []}, :scrape_interval, "15s")
Expected behavior
It starts.
Environment
Elixir version: Elixir 1.13.4
Erlang/OTP version: Erlang/OTP 24
Additional context
fwiw I'm not quite convinced of the usefulness of the MFA option. You end up having to provide a lot of keys that PromEx.Config.extract_opts_for_config/1 sets defaults for.
I think it's probably more useful to specify a custom template when rendering.
The text was updated successfully, but these errors were encountered:
That is definitely a miss on my part. It's something I wanted to implement but haven't gotten around to it. Looks like I put the cart before the horse on the docs though. Is this something that you would like to tackle? It shouldn't take very long to implement.
I don't think so. We started off by defining our config, assuming the MFA thing would work. The args to MFA essentially duplicate the normal config, but also require adding all the missing keys that PromEx sets by default.
Instead, we found it quite elegant to provide a different template file, as in #159
@patmaddox, my apologies if you felt negative emotions from my comment, @akoutmos needs extra hands since he has other priorities and duties, so I am doing my best to support him as much as possible.
Describe the bug
Documentation for
config_opts
says: "This option can either accept an MFA that will return a string of the full path where the YAML configuration file is, or a keyword list with options so that PromEx can generate a config file for you."Looking at the code though, it seems pretty clear that it only supports a keyword list - not an MFA.
Perhaps I'm overlooking something?
To Reproduce
Result:
Expected behavior
It starts.
Environment
Additional context
fwiw I'm not quite convinced of the usefulness of the MFA option. You end up having to provide a lot of keys that
PromEx.Config.extract_opts_for_config/1
sets defaults for.I think it's probably more useful to specify a custom template when rendering.
The text was updated successfully, but these errors were encountered: