PromEx.Plugins.Ecto (PromEx v1.0.0) 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 a REQUIRED option and is the name of you application in snake case (e.g. :my_cool_app).

  • 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