We are trying out KrakenD as a primary API gateway for our backend services. The plugins available are only for response manipulation, we want to go a step ahead and start recording all the API calls and persist them in a database. I was checking the example of having a custom HTTPStatusHandler, but that mainly caters to handling the status codes and as a best case we can only return the status codes from our backends as it is. Is there any working example of this scenario that we are trying? We are already using a custom middleware to grant API access based on our role based access rules.
Other commercial solutions offer API monetization out of the box, but we want to stick with KrakenD for performance reasons.
KrakenD plugins are not only for response manipulation, but a much more powerful solution. There are 4 types of plugins in krakend, what you want to do I think that fits best as an HTTP SERVER plugin.
This type of plugin intercepts all incoming traffic and you can record it in a Redis database.
I have improvised a
main.go
of the idea, but you should check the plugin guide in the documentation for more details.Hope this helps illustrating the idea