Request for HTTP Route Information in HttpRequest
Description:
Currently, the HttpRequest class in Activej does not provide a way to retrieve the HTTP route pattern (e.g., /user/:id) separate from the URL path (e.g., /user/1). This functionality is essential for cases like telemetry and monitoring, where grouping requests by their route pattern is needed.
When tracing requests in frameworks like OpenTelemetry, having access to the route pattern (e.g., /user/:id) is important for combining similar requests together, rather than treating different dynamic paths (e.g., /user/1 and /user/2) as separate requests. This is especially useful when analyzing metrics or visualizing request data in monitoring dashboards.
For example, all requests to /user/:id should be considered as one group, regardless of the specific id value, so that they can be tracked and visualized in a consolidated manner. Without this, each dynamic path is treated separately, leading to fragmented insights.
Please read more about http.route here -> https://github.com/open-telemetry/semantic-conventions/blob/main/docs/attributes-registry/http.md#http-route.
Potential Impact:
-
Improved Tracing: This change will enable more accurate tracing and monitoring, as similar routes with different path parameters (e.g.,
/user/1,/user/2) can be grouped together as/user/:id. - Better Dashboard Grouping: This would allow the grouping of requests that match the same route pattern, leading to more insightful metrics and visualizations.
- Enhanced Request Analysis: It will allow better integration with telemetry and monitoring tools, improving the accuracy of request handling and monitoring.
Additional Context:
Please read more about http.route here -> OpenTelemetry Semantic Conventions: HTTP Route.
Thank you for considering this request!