prometheus-plugs icon indicating copy to clipboard operation
prometheus-plugs copied to clipboard

:plug warning when compiling

Open wandersondito opened this issue 2 years ago • 0 comments

Hi! Thanks for the lib!

I'm getting this when compiling:

warning: Plug.Builder.compile/3 defined in application :plug is used by the current application but the current application does not depend on :plug. To fix this, you must do one of:

  1. If :plug is part of Erlang/Elixir, you must include it under :extra_applications inside "def application" in your mix.exs

  2. If :plug is a dependency, make sure it is listed under "def deps" in your mix.exs

  3. In case you don't want to add a requirement to :plug, you may optionally skip this warning by adding [xref: [exclude: [Plug.Builder]]] to your "def project" in mix.exs

  lib/prometheus/plug_instrumenter.ex:227: Prometheus.PlugInstrumenter.__before_compile__/1

warning: Plug.Router.Utils.split/1 defined in application :plug is used by the current application but the current application does not depend on :plug. To fix this, you must do one of:

  1. If :plug is part of Erlang/Elixir, you must include it under :extra_applications inside "def application" in your mix.exs

  2. If :plug is a dependency, make sure it is listed under "def deps" in your mix.exs

  3. In case you don't want to add a requirement to :plug, you may optionally skip this warning by adding [xref: [exclude: [Plug.Router.Utils]]] to your "def project" in mix.exs

  lib/prometheus/plug_exporter.ex:73: Prometheus.PlugExporter.__using__/1

Here are my versions:

Erlang/OTP 24 [erts-12.3.1] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit]

Mix 1.13.4 (compiled with Erlang/OTP 22)

To fix this you need to add the code below to the mix.exs

  def application do
    [
      applications: [:logger, :prometheus_ex, :accept],
      extra_applications: [:plug]  # added this line
    ]
  end

I can open a PR if you don't mind.

wandersondito avatar May 04 '22 21:05 wandersondito