PromEx.Plugins.Application (PromEx v1.1.1) View Source
This plugin captures metrics regarding your application, and its dependencies. Specifically, it captures the versions of your application and the application dependencies and also how many modules each dependency is bringing into the project.
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).deps
: This option is OPTIONAL and defines what dependencies the plugin should track. A value of:all
means that PromEx will fetch details on all application dependencies. A list of dependency names like[:phoenix, :ecto, :unplug]
means that PromEx will only fetch details regarding those dependencies.git_sha_mfa
: This option is OPTIONAL and defines an MFA that will be called in order to fetch the application's Git SHA at the time of deployment. By default, an Application Plugin function will be called and will attempt to read the GIT_SHA environment variable to populate the value.git_author_mfa
: This option is OPTIONAL and defines an MFA that will be called in order to fetch the application's last Git commit author at the time of deployment. By default, an Application Plugin function will be called and will attempt to read the GIT_AUTHOR environment variable to populate the value.
This plugin exposes the following metric groups:
:application_versions_manual_metrics
To use plugin in your application, add the following to your application supervision tree:
def start(_type, _args) do
children = [
...
{
PromEx,
plugins: [
{PromEx.Plugins.Application, [otp_app: :my_cool_app]},
...
],
delay_manual_start: :no_delay
}
]
opts = [strategy: :one_for_one, name: WebApp.Supervisor]
Supervisor.start_link(children, opts)
end
This plugin exposes manual metrics so be sure to configure the PromEx :delay_manual_start
as required.