Skip to content
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

Dashboard: Grouping of requests with query parameters #51

Open
zaanposni opened this issue Nov 10, 2024 · 2 comments
Open

Dashboard: Grouping of requests with query parameters #51

zaanposni opened this issue Nov 10, 2024 · 2 comments

Comments

@zaanposni
Copy link

zaanposni commented Nov 10, 2024

First of: Thank you for your work. Really appreciate it!

I have been trying to integrate api-analytics into my project and have found that it handles query params a bit differently than I expected it to.

I have an API endpoint that looks like this GET /uploadplan?date=yyyy-mm-dd. Since a HTTP body is not expected for GET requests I chose this approach. However, I have found that the grouping in the dashboard does not expect multiple requests on the same endpoint with different query parameters.

I do understand that there are multiple viewpoints on this topic. My suggestion would be to either

  1. disregard query parameters when grouping requests on the dashboard
  2. add a toggle button on the dashboard that allows the user to choose whether or not to ignore the query params

If this is something you want to address, I would be happy to contribute a solution myself. I have pinpointed the issue to this endpointID which seems to be the identifier for grouping multiple requests.

image

@zaanposni
Copy link
Author

I have found that it makes more sense to handle this sort of thing directly in the api.
For express it would be something like this:

const apiAnalyticsConfig = new Config();
apiAnalyticsConfig.getPath = (req) => req.path.split("?")[0];

Therefore, I would withdraw my request. What do you think about it? I may not be the first one to stumble over this problem. Might it be possible to implement something like this as part of "improving the developer experience"?

@tom-draper
Copy link
Owner

That's a great point!

I think a toggle switch to turn params off in the dashboard would be best the way to go. I'll try and add this feature soon. Thanks for this suggestion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants