diff --git a/apps/transport/lib/transport/application.ex b/apps/transport/lib/transport/application.ex index 3693c13a0d..f7e5e34ce9 100644 --- a/apps/transport/lib/transport/application.ex +++ b/apps/transport/lib/transport/application.ex @@ -50,7 +50,7 @@ defmodule Transport.Application do :ok = Transport.Jobs.ObanLogger.setup() :ok = Transport.Telemetry.setup() - :ok = Transport.EctoTelemetry.setup() + :ok = Transport.AppSignal.EctoTelemetry.setup() opts = [strategy: :one_for_one, name: Transport.Supervisor] Supervisor.start_link(children, opts) diff --git a/apps/transport/lib/transport/ecto_telemetry.ex b/apps/transport/lib/transport/appsignal_ecto_telemetry.ex similarity index 92% rename from apps/transport/lib/transport/ecto_telemetry.ex rename to apps/transport/lib/transport/appsignal_ecto_telemetry.ex index da87ce4dac..7175bcb717 100644 --- a/apps/transport/lib/transport/ecto_telemetry.ex +++ b/apps/transport/lib/transport/appsignal_ecto_telemetry.ex @@ -1,4 +1,4 @@ -defmodule Transport.EctoTelemetry do +defmodule Transport.AppSignal.EctoTelemetry do require Logger @moduledoc """ @@ -12,7 +12,7 @@ defmodule Transport.EctoTelemetry do * https://github.com/appsignal/appsignal-elixir/issues/887 (which ensures calls are fast & mostly safe) A few notes extracted from the doc (with extra comments): - * `:idle_time` - the time the connection spent waiting before being checked out for the query. + * `:idle_time` - the time the connection spent waiting before being checked out for the query. the higher the better ; if this gets low (close to 0), the pool is over-used (not good). * `:queue_time` - the time spent waiting to check out a database connection. the lower the better. if this gets too high, the pool is over-used (not good). @@ -65,13 +65,13 @@ defmodule Transport.EctoTelemetry do end def setup do - Logger.info("Setting up telemetry for AppSignal + Ecto") + Logger.info("Setting up telemetry for our custom AppSignal's Ecto integration") :telemetry.attach( - "transport-ecto", + "transport-appsignal-ecto", # NOTE: the first two params are I believe mapped to `DB.Repo` [:db, :repo, :query], - &Transport.EctoTelemetry.handle_event/4, + &Transport.AppSignal.EctoTelemetry.handle_event/4, nil ) end