Skip to content

Commit

Permalink
Merge pull request #172 from coingaming/fix/remove-unused-telemetry-deps
Browse files Browse the repository at this point in the history
fix: removed unused telemetry deps and enabled live_dashboard for dev only
  • Loading branch information
tsenturk authored Oct 4, 2021
2 parents 395aba8 + 277b9d2 commit 044f4c7
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 85 deletions.
2 changes: 0 additions & 2 deletions lib/moon/application.ex
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ defmodule Moon.Application do
children = [
# Start Mock DB
%{id: :mock_db, start: {MoonWeb.MockDB, :start_link, []}},
# Start the Telemetry supervisor
MoonWeb.Telemetry,
# Start the PubSub system
{Phoenix.PubSub, name: Moon.PubSub},
# Start the Endpoint (http/https)
Expand Down
1 change: 0 additions & 1 deletion lib/moon_web/endpoint.ex
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ defmodule MoonWeb.Endpoint do
cookie_key: "request_logger"

plug Plug.RequestId
plug Plug.Telemetry, event_prefix: [:phoenix, :endpoint]

plug Plug.Parsers,
parsers: [:urlencoded, :multipart, :json],
Expand Down
32 changes: 16 additions & 16 deletions lib/moon_web/router.ex
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,22 @@ defmodule MoonWeb.Router do
get("/healthcheck", MoonWeb.Controllers.HealthcheckController, :index)
end

# Enables LiveDashboard only for development
#
# If you want to use the LiveDashboard in production, you should put
# it behind authentication and allow only admins to access it.
# If your application does not have an admins-only section yet,
# you can use Plug.BasicAuth to set up some basic authentication
# as long as you are also using SSL (which you should anyway).
if Mix.env() in [:dev] do
import Phoenix.LiveDashboard.Router

scope "/" do
pipe_through :browser
live_dashboard "/dashboard"
end
end

Enum.each(["/:theme_name", "/"], fn theme_path ->
scope theme_path do
pipe_through :browser
Expand Down Expand Up @@ -86,20 +102,4 @@ defmodule MoonWeb.Router do
# scope "/api", MoonWeb do
# pipe_through :api
# end

# Enables LiveDashboard only for development
#
# If you want to use the LiveDashboard in production, you should put
# it behind authentication and allow only admins to access it.
# If your application does not have an admins-only section yet,
# you can use Plug.BasicAuth to set up some basic authentication
# as long as you are also using SSL (which you should anyway).
if Mix.env() in [:dev, :test] do
import Phoenix.LiveDashboard.Router

scope "/" do
pipe_through :browser
live_dashboard "/dashboard", metrics: MoonWeb.Telemetry
end
end
end
50 changes: 0 additions & 50 deletions lib/moon_web/telemetry.ex

This file was deleted.

2 changes: 0 additions & 2 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ defmodule Moon.MixProject do
{:phoenix_ecto, "~> 4.0"},
{:ecto_sql, "~> 3.1"},
{:faker, "~> 0.16"},
{:telemetry_metrics, "~> 0.4"},
{:telemetry_poller, "~> 0.4"},
{:gettext, "~> 0.11"},
{:jason, "~> 1.0"},
{:plug_cowboy, "~> 2.0"},
Expand Down
Loading

0 comments on commit 044f4c7

Please sign in to comment.