-
-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Phoenix plugin: path is lost when router forwards to another router #224
Comments
it seems that also the controller is always the router we forward to, and action is "Unknown" |
|
@akoutmos I might have a patch for this, any hints on how to test it? I hope we're not expected to craft https://github.com/aerosol/prom_ex/blob/master/test/support/events/phoenix.exs by hand? 🤢 |
Hey there! Sorry I missed this issue. Those fixtures are automatically generated via https://github.com/akoutmos/prom_ex/blob/master/example_applications/web_app/lib/web_app/recorder_supervisor.ex The way I have been creating them is by adding that to the example app, enabling only the PromEx plugins I want to test, and then interacting with the app in a way that triggers the telemetry events I want to test. You can then fetch all of the recorded events via https://github.com/akoutmos/prom_ex/blob/master/example_applications/web_app/lib/web_app/recorder.ex It's not the easiest thing in the world to work with....but does the job. If you make the fix, I can add to the test suite if that makes it easier :) |
Ugh, it's a bit more involved with the current setup. I've spent a lot of time on this and I don't think I can pull it off reasonably well. Some notes in case someone wants to tackle it: It's a bit of a vendor lock-in situation 😅 - since we can't stop using PromEx easily (due to existing metrics/graphs in a 3rd party storage that are expensive to replicate/replace), the best solution in terms of effort/reward will be to stop using
Hope this helps someone who is clever enough. |
In order to get grafana metrics reported See: akoutmos/prom_ex#224
* Merge `Plugins.API.Router` into main one In order to get grafana metrics reported See: akoutmos/prom_ex#224 * Format
When using
forward
function from a router to forward to another router, the resulting metric will have the first router route aspath
.Maybe I missed some documentation on how to configure for this use case, sorry if it is the case.
To Reproduce
I slightly modified the example application to reproduce this issue:
leolaudouard@b5b2ac9
With these routers, the resulting path is always
/users
, whereas before we had/users/:id
Expected behavior
Same path values as when the router directly forwards to controllers.
I suppose the issue is around here.
The text was updated successfully, but these errors were encountered: