15 lines
427 B
Elixir
15 lines
427 B
Elixir
defmodule BackendWeb.Plugs.Telemetry do
|
|
@behaviour Plug
|
|
|
|
@impl true
|
|
def init(opts), do: Plug.Telemetry.init(opts)
|
|
|
|
@impl true
|
|
def call(%{path_info: ["api", "health"]} = conn, {start_event, stop_event, opts}) do
|
|
# Suppress logs for health check endpoint
|
|
Plug.Telemetry.call(conn, {start_event, stop_event, Keyword.put(opts, :log, false)})
|
|
end
|
|
|
|
def call(conn, args), do: Plug.Telemetry.call(conn, args)
|
|
end
|