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

Check which endpoints are commonly used and get rid of the ones not being used #1329

Closed
Tracked by #1328
kuzdogan opened this issue Apr 5, 2024 · 4 comments
Closed
Tracked by #1328
Assignees

Comments

@kuzdogan
Copy link
Member

kuzdogan commented Apr 5, 2024

While getting rid of the repoV1, we should have a look at the endpoints being used and also get rid of the unused ones to make the migration easier.

Our endpoints: https://docs.sourcify.dev/docs/api/#/

For example, my guess would be, that /files/tree/ endpoints are not used at all. If we remove this unused endpoint, we wouldn't need to work on how to adapt this for the DB or the repoV2.

I know this would be a breaking change to the API but if no one's using it, it's more pragmatic to just drop it here.

The task is to look at our nginx logs and find out the endpoints that were not called or rarely called and report them here.

@manuelwedler
Copy link
Collaborator

So I just manually went through all API routes and checked the logs. I could only find the /files/tree/{chain}/{address} not being used over the last 24 hours. However, the files/tree/any endpoint is used. For me it looks like, we cannot really get rid of one of the endpoints.

@kuzdogan
Copy link
Member Author

Can you please share the stats or the query you used (i.e the Grafana link)? How much is the "used" one used? Is the unused one used in prev days?

@kuzdogan kuzdogan moved this from Todo to In Progress in Sourcify Public Apr 15, 2024
@manuelwedler
Copy link
Collaborator

I created a dashboard in Grafana (production) for checking the API usage. I thought that makes the most sense, so we can check it frequently. It's called Sourcify Server API Usage. Please have a look. The visualizations aggregate the number of API calls for the last 1 minute.

I also found the /repository/contracts endpoint not being used now.

@manuelwedler manuelwedler moved this from In Progress to Blocked in Sourcify Public Apr 16, 2024
@manuelwedler manuelwedler moved this from Blocked to In Progress in Sourcify Public Apr 16, 2024
@kuzdogan
Copy link
Member Author

Thank you. Yes looks like we can't really get rid of any of those endpoints 🫠

Just FYI I've updated the query to be request_uri =~ '/server/(verify)?/?' because we the endpoint POST / is an old alias to POST /verify

@github-project-automation github-project-automation bot moved this from In Progress to Done in Sourcify Public Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

2 participants