Open KScaesar opened 5 days ago
Thanks for opening your first issue here! π Be sure to follow the issue template! If you need help or want to chat with us, join us on Discord https://gofiber.io/discord
for this we are working on a new middleware https://github.com/gofiber/contrib/pull/1032
the behavior you see during routing is normal
because the route of the middleware itself is the βrootβ this is also how it works in expressjs
@gaby what was the development status?
Bug Description
Currently, I'm working on observability (o11y) and need to metric the current API path to track API performance.
In Prometheus' recommendations, it's mentioned that labels should ideally have a static string; if labels are dynamic, performance may degrade.
However, when I use fiber middleware, I'm unable to obtain the expected path. When I use
c.Route().Path
, I expect to get/users/:id
, but I keep getting/
. When I usec.Path()
, I can get the correct path/users/123
, but it doesn't meet Prometheus' requirement for static labels.How to Reproduce
Steps to reproduce the behavior:
c.Route().Path
Expected Behavior
expected path should be
/users/:id
Fiber Version
v2.52.5
Code Snippet (optional)
playground
Checklist: