1
0
Fork 1
mirror of https://akkoma.dev/AkkomaGang/akkoma.git synced 2024-11-18 02:49:18 +00:00

[#1] fix telemetry

This commit is contained in:
Egor Kislitsyn 2019-03-25 15:29:04 +07:00 committed by Mark Felder
parent bc3618a38d
commit 0b5c818cb7
2 changed files with 19 additions and 8 deletions

View file

@ -10,7 +10,7 @@
config :pleroma, Pleroma.Repo,
types: Pleroma.PostgresTypes,
loggers: [Pleroma.Repo.Instrumenter, Ecto.LogEntry]
telemetry_event: [Pleroma.Repo.Instrumenter]
config :pleroma, Pleroma.Captcha,
enabled: false,

View file

@ -127,6 +127,24 @@ def start(_type, _args) do
Supervisor.start_link(children, opts)
end
defp setup_instrumenters() do
require Prometheus.Registry
:ok =
:telemetry.attach(
"prometheus-ecto",
[:pleroma, :repo, :query],
&Pleroma.Repo.Instrumenter.handle_event/4,
%{}
)
Prometheus.Registry.register_collector(:prometheus_process_collector)
Pleroma.Web.Endpoint.MetricsExporter.setup()
Pleroma.Web.Endpoint.PipelineInstrumenter.setup()
Pleroma.Web.Endpoint.Instrumenter.setup()
Pleroma.Repo.Instrumenter.setup()
end
def enabled_hackney_pools do
[:media] ++
if Application.get_env(:tesla, :adapter) == Tesla.Adapter.Hackney do
@ -141,13 +159,6 @@ def enabled_hackney_pools do
end
end
defp setup_instrumenters() do
Pleroma.Web.Endpoint.MetricsExporter.setup()
Pleroma.Web.Endpoint.PipelineInstrumenter.setup()
Pleroma.Web.Endpoint.Instrumenter.setup()
Pleroma.Repo.Instrumenter.setup()
end
if Mix.env() == :test do
defp streamer_child, do: []
defp chat_child, do: []