Skip to content

Commit e77d0e2

Browse files
committed
Add Scout APM
1 parent 5b2b3f3 commit e77d0e2

File tree

7 files changed

+27
-3
lines changed

7 files changed

+27
-3
lines changed

.env.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ export GITHUB_APP_PEM=
1010
export INTERCOM_IDENTITY_SECRET_KEY=
1111
export POSTMARK_API_KEY=
1212
export S3_BUCKET=
13+
export SCOUT_APP_KEY=
14+
export SCOUT_APP_NAME=
1315
export SEGMENT_WRITE_KEY=
1416
export SENTRY_DSN=
1517
export STRIPE_SECRET_KEY=

config/config.exs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,9 @@ import_config "#{Mix.env}.exs"
8888

8989
# Import Timber, structured logging
9090
import_config "timber.exs"
91+
92+
import_config "scout_apm.exs"
93+
94+
config :code_corps, CodeCorps.Repo,
95+
loggers: [{Ecto.LogEntry, :log, []},
96+
{ScoutApm.Instruments.EctoLogger, :log, []}]

config/dev.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use Mix.Config
77
# watchers to your application. For example, we use it
88
# with brunch.io to recompile .js and .css sources.
99
config :code_corps, CodeCorpsWeb.Endpoint,
10-
http: [port: 4000],
10+
http: [port: 4000, ip: {0, 0, 0, 0, 0, 0, 0, 0}],
1111
debug_errors: true,
1212
code_reloader: true,
1313
check_origin: false

config/scout_apm.exs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# This configuration file is used for Scout APM.
2+
# See our help docs at http://help.apm.scoutapp.com for more information.
3+
# config/scout_apm.exs
4+
use Mix.Config
5+
6+
config :scout_apm,
7+
name: System.get_env("SCOUT_APP_NAME") || "", # The app name that will appear within the Scout UI
8+
key: System.get_env("SCOUT_APP_KEY") || ""
9+
10+
config :phoenix, :template_engines,
11+
eex: ScoutApm.Instruments.EExEngine,
12+
exs: ScoutApm.Instruments.ExsEngine

lib/code_corps_web.ex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ defmodule CodeCorpsWeb do
3131
def controller do
3232
quote do
3333
use Phoenix.Controller, log: false, namespace: CodeCorpsWeb
34+
use ScoutApm.Instrumentation
3435

3536
import Ecto
3637
import Ecto.Query

mix.exs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ defmodule CodeCorps.Mixfile do
2828
def application do
2929
[
3030
mod: {CodeCorps, []},
31-
extra_applications: [:timex, :tzdata]
31+
extra_applications: [:scout_apm, :timex, :tzdata]
3232
]
3333
end
3434

@@ -72,6 +72,7 @@ defmodule CodeCorps.Mixfile do
7272
{:joken, "~> 1.5"}, # JWT encoding
7373
{:money, "~> 1.2.1"},
7474
{:poison, "~> 3.0", override: true},
75+
{:scout_apm, "~> 0.0"},
7576
{:scrivener_ecto, "~> 1.2"}, # DB query pagination
7677
{:segment, "~> 0.1"}, # Segment analytics
7778
{:sentry, "~> 6.0"}, # Sentry error tracking

mix.lock

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
%{"bamboo": {:hex, :bamboo, "0.8.0", "573889a3efcb906bb9d25a1c4caa4ca22f479235e1b8cc3260d8b88dabeb4b14", [:mix], [{:hackney, "~> 1.6", [hex: :hackney, optional: false]}, {:plug, "~> 1.0", [hex: :plug, optional: false]}, {:poison, ">= 1.5.0", [hex: :poison, optional: false]}]},
1+
%{"approximate_histogram": {:hex, :approximate_histogram, "0.1.1", "198eb36681e763ed4baab6ca0682acec4ef642f60ba272f251d3059052f4f378", [], [], "hexpm"},
2+
"bamboo": {:hex, :bamboo, "0.8.0", "573889a3efcb906bb9d25a1c4caa4ca22f479235e1b8cc3260d8b88dabeb4b14", [:mix], [{:hackney, "~> 1.6", [hex: :hackney, optional: false]}, {:plug, "~> 1.0", [hex: :plug, optional: false]}, {:poison, ">= 1.5.0", [hex: :poison, optional: false]}]},
23
"bamboo_postmark": {:hex, :bamboo_postmark, "0.4.1", "2ec8fad4d221944f5169ea4346e6e1aef3578282c352c9f7184306d872aa1c26", [:mix], [{:bamboo, "~> 0.5", [hex: :bamboo, optional: false]}, {:hackney, "~> 1.6", [hex: :hackney, optional: false]}, {:plug, "~> 1.0", [hex: :plug, optional: false]}, {:poison, ">= 1.5.0", [hex: :poison, optional: false]}]},
34
"base64url": {:hex, :base64url, "0.0.1", "36a90125f5948e3afd7be97662a1504b934dd5dac78451ca6e9abf85a10286be", [], []},
45
"benchfella": {:hex, :benchfella, "0.3.5", "b2122c234117b3f91ed7b43b6e915e19e1ab216971154acd0a80ce0e9b8c05f5", [:mix], []},
@@ -52,6 +53,7 @@
5253
"poolboy": {:hex, :poolboy, "1.5.1", "6b46163901cfd0a1b43d692657ed9d7e599853b3b21b95ae5ae0a777cf9b6ca8", [], []},
5354
"postgrex": {:hex, :postgrex, "0.13.3", "c277cfb2a9c5034d445a722494c13359e361d344ef6f25d604c2353185682bfc", [:mix], [{:connection, "~> 1.0", [hex: :connection, optional: false]}, {:db_connection, "~> 1.1", [hex: :db_connection, optional: false]}, {:decimal, "~> 1.0", [hex: :decimal, optional: false]}]},
5455
"ranch": {:hex, :ranch, "1.3.2", "e4965a144dc9fbe70e5c077c65e73c57165416a901bd02ea899cfd95aa890986", [:rebar3], []},
56+
"scout_apm": {:hex, :scout_apm, "0.3.3", "8679378b624b502d7f6e8a1b023b57f4c7ab717380291e2b40ccdb2923457194", [], [{:approximate_histogram, "~>0.1.1", [hex: :approximate_histogram, repo: "hexpm", optional: false]}, {:hackney, "~> 1.0", [hex: :hackney, repo: "hexpm", optional: false]}, {:plug, "~>1.0", [hex: :plug, repo: "hexpm", optional: false]}, {:poison, ">= 0.0.0", [hex: :poison, repo: "hexpm", optional: false]}], "hexpm"},
5557
"scrivener": {:hex, :scrivener, "2.3.0", "16b1d744202d47233798205447b35592d96a209241c566304f84ddef63c718b2", [:mix], []},
5658
"scrivener_ecto": {:hex, :scrivener_ecto, "1.2.3", "3255aee5cabfccedcb350f7e5f9f540fb72b8705a763612399264b11ae34faa9", [:mix], [{:ecto, "~> 2.0", [hex: :ecto, optional: false]}, {:postgrex, "~> 0.11.0 or ~> 0.12.0 or ~> 0.13.0", [hex: :postgrex, optional: true]}, {:scrivener, "~> 2.3", [hex: :scrivener, optional: false]}]},
5759
"segment": {:hex, :segment, "0.1.1", "47bf9191590e7a533c105d1e21518e0d6da47c91e8d98ebb649c624db5dfc359", [:mix], [{:httpoison, "~> 0.8", [hex: :httpoison, optional: false]}, {:poison, "~> 1.3 or ~> 2.0", [hex: :poison, optional: false]}]},

0 commit comments

Comments
 (0)