Merge branch 'fix/prometheus-ecto-error-when-not-configured' into 'develop'

Fix prometheus-ecto error when not configured

Closes #917

See merge request pleroma/pleroma!1180
This commit is contained in:
kaniini 2019-05-21 01:36:06 +00:00
commit 94caca924d

View file

@ -131,6 +131,7 @@ def start(_type, _args) do
defp setup_instrumenters do defp setup_instrumenters do
require Prometheus.Registry require Prometheus.Registry
if Application.get_env(:prometheus, Pleroma.Repo.Instrumenter) do
:ok = :ok =
:telemetry.attach( :telemetry.attach(
"prometheus-ecto", "prometheus-ecto",
@ -139,11 +140,13 @@ defp setup_instrumenters do
%{} %{}
) )
Pleroma.Repo.Instrumenter.setup()
end
Prometheus.Registry.register_collector(:prometheus_process_collector) Prometheus.Registry.register_collector(:prometheus_process_collector)
Pleroma.Web.Endpoint.MetricsExporter.setup() Pleroma.Web.Endpoint.MetricsExporter.setup()
Pleroma.Web.Endpoint.PipelineInstrumenter.setup() Pleroma.Web.Endpoint.PipelineInstrumenter.setup()
Pleroma.Web.Endpoint.Instrumenter.setup() Pleroma.Web.Endpoint.Instrumenter.setup()
Pleroma.Repo.Instrumenter.setup()
end end
def enabled_hackney_pools do def enabled_hackney_pools do