probot: /probot/stats endpoint is not scalable
At app startup, the /probot/stats endpoint fetches all the repositories for all the installations that the app is installed on. This endpoint is used by probot.github.io to show the number of installations and show some of the more popular orgs using an app.
It is frequently timing out on stale, which causes other tests to fail.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 1
- Comments: 15 (12 by maintainers)
We can still collect number of installations by paginating
GET /app/installations. Even if you’re app has ~1000 installations, it’s still only 10 API calls on startup. The change we’re discussing here is to drop the paginated call to fetch all repositories for each installation, which can lead to hundreds of API calls on startup.cc @jeffrafter @chobberoni @tarebyte since I briefly discussed the desire for App status with you a few weeks ago
With the change now that you can list apps on the Marketplace as “unverified”, I’m going to close this issue. The Marketplace listing is the more production-ready solution for larger apps and also includes more data like unique visitors and conversion rate
@jakebolam Personally we end up just disabling stats on larger installations. The Marketplace is starting to show the exact same data anyway (number of installations and top customers), so ultimately listing your app on the marketplace gets you the same thing.