AdoptOpenJDK / openjdk-api-v3

AdoptOpenJDK API V3 🚀
https://api.adoptopenjdk.net/swagger-ui
Apache License 2.0
34 stars 36 forks source link

Add the capability to track how many V2 request we're getting so we can plan deprecation #328

Closed karianna closed 3 years ago

ParkerM commented 4 years ago

I'd be happy to tackle this if you could provide some leads on available resources for persisting the data.

karianna commented 4 years ago

@johnoliver or @gdams are you able to connect with @ParkerM and give him v2 Bootcamp?

ParkerM commented 4 years ago

Here's a basic impl that uses MongoDB to persist a hit counter for each /v2/ endpoint: https://github.com/AdoptOpenJDK/openjdk-api/compare/master...ParkerM:usage-stats

I tested it on an Atlas free tier instance and it seems stable enough. The v3 API already has a Mongo instance so hooking it up to that should be as simple as adding a collection and plugging the URL/credentials into db.service.js. If that sounds like a plan then I can add an endpoint or two that exposes the gathered metrics and submit a PR.

karianna commented 3 years ago

@gdams - Will App Insights give us this functionality? Else we could look to add ParkerM's feature

joschi commented 3 years ago

Would it be possible to retrieve this information from HTTP access logs to https://api.adoptopenjdk.net/v2/*, assuming that these are recorded?

gdams commented 3 years ago

@johnoliver Can we now verify that we can identify V2 requests coming from the graphql server?