prom_ex
prom_ex copied to clipboard
[BUG] Potential inefficiency in Plug.Cowboy plugin
Describe the bug
This call in Plug.Cowboy plugin suggests we are doing an extra call to the router in order to resolve the parameterised path if our router is not Phoenix based.
This could impact performance or produce unexpected side effects if for some reason the request we are instrumenting is not idempotent.
Also I think this step would also need to include a call to router.init/1
in order to properly initialise an opts keyword to be included in the call/2
call.
To Reproduce
I don't have any specific steps to reproduce. This is a general observation from reading the code.
Expected behavior
If possible, instrumentation should not perform extra router calls.
Environment
- Elixir version: 1.12
- Erlang/OTP version: OTP 24
- Grafana version:
- Prometheus version:
Additional context Add any other context about the problem here.