mcrumm/phoenix_profiler

Unable to use

montogeek opened this issue · 5 comments

Hi!

I am wondering if this library is compatible with:

 defp deps do
    [
      {:phoenix, "~> 1.7.1"},
      {:phoenix_ecto, "~> 4.4"},
      {:ecto_sql, "~> 3.6"},
      {:postgrex, ">= 0.0.0"},
      {:phoenix_html, "~> 3.3"},
      {:phoenix_live_reload, "~> 1.2", only: :dev},
      {:phoenix_live_view, "~> 0.18.16"},
      {:floki, ">= 0.30.0", only: :test},
      {:phoenix_live_dashboard, "~> 0.7.2"},
      {:esbuild, "~> 0.5", runtime: Mix.env() == :dev},
      {:tailwind, "~> 0.1.8", runtime: Mix.env() == :dev},
      {:swoosh, "~> 1.3"},
      {:finch, "~> 0.13"},
      {:telemetry_metrics, "~> 0.6"},
      {:telemetry_poller, "~> 1.0"},
      {:gettext, "~> 0.20"},
      {:jason, "~> 1.2"},
      {:plug_cowboy, "~> 2.5"},
      {:phoenix_profiler, "~> 0.2.0"}
    ]
  end

I have followed the guide and always get this error:

attempted to enable profiling but no profiler is configured on the endpoint

After debugging a bit I found this:
image

Config is correct but still check_profiler_running returns an error.

Hi @montogeek! Did you follow the instructions from the README or from the package docs? Please use the published package docs because the main branch has diverged in preparation for the next release.

For clarity, these are the most important steps, but please reference the full instructions:

  • Start a PhoenixProfiler process on your supervision tree:
# lib/my_app_web/telemetry.ex
children = [
  {PhoenixProfiler, name: MyAppWeb.Profiler},
  # :telemetry_poller, etc.
]
  • Configure your profiler on your Endpoint:
# config/dev.exs
config :my_app, MyAppWeb.Endpoint,
  phoenix_profiler: [server: MyAppWeb.Profiler]
  • Add PhoenixProfiler Plug to the code_reloading? block on your Endpoint module:
# lib/my_app_web/endpoint.ex
if code_reloading? do
  # plugs...
  plug PhoenixProfiler
end

OH yes, I manage to do if after adding the :server, hope you can release it soon.

I am used to read READMEs on GitHub instead of the published version :D

What are you plans long term with the plug? I thought I would get something like Laravel Debugbar, but I couldn't see a way to see assigns for example, would like to contribute :)

I am glad to read it is working for you now :)

My long-term plans are similar, in fact my inspiration was exactly the Symfony Web Debug Toolbar. Please feel free to open issues with ideas– for assigns specifically I am currently working on something that will mimic dump-based debugging, so definitely stay tuned for that!