PromEx.Plugins.Ecto (PromEx v1.1.1) View Source
This plugin captures metrics emitted by Ecto. Be sure that your PromEx module is listed before your Repo module in your supervision tree so that the Ecto init events are not missed. If you miss those events the dashboard variable dropdowns for the repo value will be broken.
This plugin supports the following options:
otp_app
: This is an OPTIONAL option and is the name of you application in snake case (e.g. :my_cool_app). By default the otp_app set for the prom_ex module that this plugin is defined in is used.repos
: This is an OPTIONAL option and is a list with the full module name of your Ecto Repos (e.g [MyApp.Repo]). If you do not provide this value, PromEx will attempt to resolve your Repo modules via the:ecto_repos
configuration on your OTP app.
This plugin exposes the following metric groups:
:ecto_init_event_metrics
:ecto_query_event_metrics
To use plugin in your application, add the following to your PromEx module plugins/0
function:
def plugins do
[
...
{PromEx.Plugins.Ecto, otp_app: :web_app, repos: [WebApp.Repo]}
]
end