diff --git a/apps/cf/config/config.exs b/apps/cf/config/config.exs index 05b44a01..bed36274 100644 --- a/apps/cf/config/config.exs +++ b/apps/cf/config/config.exs @@ -34,10 +34,6 @@ config :cf, config :guardian, Guardian.DB, repo: DB.Repo -config :scout_apm, - name: "CaptainFact", - key: {:system, "CF_SCOUT_APM_KEY"} - # To send records to Algolia (search engine) config :algoliax, batch_size: 500, diff --git a/apps/cf/mix.exs b/apps/cf/mix.exs index bbe1aaa2..ba0b4420 100644 --- a/apps/cf/mix.exs +++ b/apps/cf/mix.exs @@ -58,7 +58,6 @@ defmodule CF.Mixfile do {:sweet_xml, "~> 0.6"}, {:burnex, "~> 3.1"}, {:yaml_elixir, "~> 2.9.0"}, - {:scout_apm, "~> 1.0.6"}, # ---- Internal ---- {:db, in_umbrella: true}, diff --git a/apps/cf_graphql/lib/endpoint.ex b/apps/cf_graphql/lib/endpoint.ex index 06275d45..0fbd4c6d 100644 --- a/apps/cf_graphql/lib/endpoint.ex +++ b/apps/cf_graphql/lib/endpoint.ex @@ -18,7 +18,6 @@ defmodule CF.GraphQLWeb.Endpoint do json_decoder: Poison ) - plug(ScoutApm.Absinthe.Plug) plug(Plug.MethodOverride) plug(Plug.Head) plug(CF.GraphQLWeb.Router) diff --git a/apps/cf_graphql/lib/scout_apm_absinthe_plug.ex b/apps/cf_graphql/lib/scout_apm_absinthe_plug.ex deleted file mode 100644 index b5c60a71..00000000 --- a/apps/cf_graphql/lib/scout_apm_absinthe_plug.ex +++ /dev/null @@ -1,32 +0,0 @@ -defmodule ScoutApm.Absinthe.Plug do - alias ScoutApm.Internal.Layer - - def init(default), do: default - - def call(conn, _default) do - ScoutApm.TrackedRequest.start_layer("Controller", action_name(conn)) - - conn - |> Plug.Conn.register_before_send(&before_send/1) - end - - def before_send(conn) do - full_name = action_name(conn) - uri = "#{conn.request_path}" - - ScoutApm.TrackedRequest.stop_layer(fn layer -> - layer - |> Layer.update_name(full_name) - |> Layer.update_uri(uri) - end) - - conn - end - - # Takes a connection, extracts the phoenix controller & action, then manipulates & cleans it up. - # Returns a string like "PageController#index" - defp action_name(conn) do - action_name = conn.params["operationName"] - "GraphQL##{action_name}" - end -end diff --git a/apps/cf_graphql/mix.exs b/apps/cf_graphql/mix.exs index b14311ee..a9121937 100644 --- a/apps/cf_graphql/mix.exs +++ b/apps/cf_graphql/mix.exs @@ -42,7 +42,6 @@ defmodule CF.Graphql.Mixfile do {:absinthe_plug, "~> 1.4.1"}, {:kaur, "~> 1.1"}, {:poison, "~> 3.1"}, - {:scout_apm, "~> 1.0.6"}, # Internal dependencies {:db, in_umbrella: true}, diff --git a/apps/cf_jobs/lib/job.ex b/apps/cf_jobs/lib/job.ex index 76a31806..8f89c7f8 100644 --- a/apps/cf_jobs/lib/job.ex +++ b/apps/cf_jobs/lib/job.ex @@ -6,7 +6,6 @@ defmodule CF.Jobs.Job do @type t :: module use GenServer - import ScoutApm.Tracing def init(args) do {:ok, args} diff --git a/apps/cf_jobs/lib/jobs/create_notifications.ex b/apps/cf_jobs/lib/jobs/create_notifications.ex index 7fe475a9..2605dbb6 100644 --- a/apps/cf_jobs/lib/jobs/create_notifications.ex +++ b/apps/cf_jobs/lib/jobs/create_notifications.ex @@ -15,7 +15,6 @@ defmodule CF.Jobs.CreateNotifications do require Logger import Ecto.Query - import ScoutApm.Tracing alias DB.Repo alias DB.Schema.UsersActionsReport @@ -66,7 +65,7 @@ defmodule CF.Jobs.CreateNotifications do end # --- Server callbacks --- - @transaction_opts [type: "background", name: "update_notifications"] + def handle_call({:update, force}, _from, _state) do last_action_id = ReportManager.get_last_action_id(@analyser_id) diff --git a/apps/cf_jobs/lib/jobs/download_captions.ex b/apps/cf_jobs/lib/jobs/download_captions.ex index feeace97..d955ef33 100644 --- a/apps/cf_jobs/lib/jobs/download_captions.ex +++ b/apps/cf_jobs/lib/jobs/download_captions.ex @@ -3,7 +3,6 @@ defmodule CF.Jobs.DownloadCaptions do require Logger import Ecto.Query - import ScoutApm.Tracing alias DB.Repo alias DB.Schema.UserAction @@ -35,7 +34,6 @@ defmodule CF.Jobs.DownloadCaptions do end # --- Server callbacks --- - @transaction_opts [type: "background", name: "download_captions"] def handle_call(:download_captions, _from, _state) do get_videos() |> Enum.map(fn video -> diff --git a/apps/cf_jobs/lib/jobs/flags.ex b/apps/cf_jobs/lib/jobs/flags.ex index cc322030..443ed193 100644 --- a/apps/cf_jobs/lib/jobs/flags.ex +++ b/apps/cf_jobs/lib/jobs/flags.ex @@ -9,7 +9,6 @@ defmodule CF.Jobs.Flags do require Logger import Ecto.Query - import ScoutApm.Tracing alias DB.Repo alias DB.Schema.UserAction @@ -42,7 +41,7 @@ defmodule CF.Jobs.Flags do end # --- Server callbacks --- - @transaction_opts [type: "background", name: "update_flags"] + def handle_call(:update_flags, _from, _state) do last_action_id = ReportManager.get_last_action_id(@analyser_id) diff --git a/apps/cf_jobs/lib/jobs/moderation.ex b/apps/cf_jobs/lib/jobs/moderation.ex index 359868bb..85a68a0b 100644 --- a/apps/cf_jobs/lib/jobs/moderation.ex +++ b/apps/cf_jobs/lib/jobs/moderation.ex @@ -10,7 +10,6 @@ defmodule CF.Jobs.Moderation do require Logger import Ecto.Query - import ScoutApm.Tracing alias DB.Repo alias DB.Schema.ModerationUserFeedback @@ -79,7 +78,6 @@ defmodule CF.Jobs.Moderation do # --- Internal API --- - @transaction_opts [type: "background", name: "update_moderation"] def handle_call(:update, _, _) do UserAction |> join(:inner, [a], uf in ModerationUserFeedback, on: uf.action_id == a.id) diff --git a/apps/cf_jobs/lib/jobs/reputation.ex b/apps/cf_jobs/lib/jobs/reputation.ex index d21d1cb4..672fd5ec 100644 --- a/apps/cf_jobs/lib/jobs/reputation.ex +++ b/apps/cf_jobs/lib/jobs/reputation.ex @@ -8,7 +8,6 @@ defmodule CF.Jobs.Reputation do require Logger import Ecto.Query - import ScoutApm.Tracing alias DB.Repo alias DB.Schema.User @@ -100,7 +99,7 @@ defmodule CF.Jobs.Reputation do do: max(change, @daily_loss_limit - today_change) # --- Server callbacks --- - @transaction_opts [type: "background", name: "update_reputation"] + def handle_call(:update_reputations, _from, _state) do last_action_id = ReportManager.get_last_action_id(@analyser_id) @@ -115,7 +114,6 @@ defmodule CF.Jobs.Reputation do {:reply, :ok, :ok} end - @transaction_opts [type: "background", name: "reset_reputation_limits"] def handle_call(:reset_daily_limits, _from, _state) do Logger.info("[Jobs.Reputation] Reset daily limits") diff --git a/apps/cf_jobs/mix.exs b/apps/cf_jobs/mix.exs index dcbb6406..e88faa14 100644 --- a/apps/cf_jobs/mix.exs +++ b/apps/cf_jobs/mix.exs @@ -36,7 +36,6 @@ defmodule CF.Jobs.Mixfile do [ {:quantum, "~> 2.3"}, {:timex, "~> 3.0"}, - {:scout_apm, "~> 1.0.6"}, # ---- Internal ---- {:cf, in_umbrella: true}, diff --git a/apps/cf_rest_api/lib/channels/video_debate_channel.ex b/apps/cf_rest_api/lib/channels/video_debate_channel.ex index 31171478..a6228ddd 100644 --- a/apps/cf_rest_api/lib/channels/video_debate_channel.ex +++ b/apps/cf_rest_api/lib/channels/video_debate_channel.ex @@ -1,6 +1,6 @@ defmodule CF.RestApi.VideoDebateChannel do use CF.RestApi, :channel - import ScoutApm.Tracing + alias CF.RestApi.Presence import CF.Actions.ActionCreator, only: [ @@ -26,7 +26,6 @@ defmodule CF.RestApi.VideoDebateChannel do alias CF.Notifications.Subscriptions alias CF.RestApi.{VideoView, SpeakerView, ChangesetView} - @transaction_opts [type: "web", name: "VideoDebateChannel.join"] def join("video_debate:" <> video_hash_id, _payload, socket) do Video |> Video.with_speakers() diff --git a/apps/cf_rest_api/lib/rest_api.ex b/apps/cf_rest_api/lib/rest_api.ex index 69cfc34b..6485fcac 100644 --- a/apps/cf_rest_api/lib/rest_api.ex +++ b/apps/cf_rest_api/lib/rest_api.ex @@ -29,7 +29,6 @@ defmodule CF.RestApi do def controller do quote do use Phoenix.Controller, namespace: CF.RestApi - use ScoutApm.Instrumentation alias DB.Repo import Ecto diff --git a/apps/cf_rest_api/mix.exs b/apps/cf_rest_api/mix.exs index aa4a58fa..1da9a4d3 100644 --- a/apps/cf_rest_api/mix.exs +++ b/apps/cf_rest_api/mix.exs @@ -44,7 +44,6 @@ defmodule CF.RestApi.Mixfile do {:phoenix_pubsub, "~> 2.0"}, {:jason, "~> 1.4"}, {:poison, "~> 3.1"}, - {:scout_apm, "~> 1.0.6"}, {:plug_cowboy, "~> 2.1"}, # ---- Internal ---- diff --git a/apps/db/config/config.exs b/apps/db/config/config.exs index 2a0ea654..518d95a0 100644 --- a/apps/db/config/config.exs +++ b/apps/db/config/config.exs @@ -10,8 +10,7 @@ config :db, DB.Repo, adapter: Ecto.Adapters.Postgres, pool_size: 3, loggers: [ - {Ecto.LogEntry, :log, []}, - {ScoutApm.Instruments.EctoLogger, :log, []} + {Ecto.LogEntry, :log, []} ] # Import environment specific config diff --git a/apps/db/mix.exs b/apps/db/mix.exs index faa802cd..c95ec833 100644 --- a/apps/db/mix.exs +++ b/apps/db/mix.exs @@ -55,7 +55,6 @@ defmodule DB.Mixfile do {:kaur, "~> 1.1"}, {:mime, "~> 1.2"}, {:scrivener_ecto, "~> 2.0"}, - {:scout_apm, "~> 1.0.6"}, {:algoliax, "~> 0.7.1"}, # Dev only diff --git a/config/releases.exs b/config/releases.exs index 32d45cf7..933059e3 100644 --- a/config/releases.exs +++ b/config/releases.exs @@ -125,9 +125,6 @@ end # ---- [APP CONFIG] :cf_graphql ---- -config :scout_apm, - key: load_secret.("scout_apm_key") - config :cf_graphql, CF.GraphQLWeb.Endpoint, url: [host: load_secret.("host")], secret_key_base: [host: load_secret.("secret_key_base")]