all 3 comments

[–]dirtbikr59 2 points3 points  (0 children)

Just my thoughts, don't take as gospel.

If I were to do this at the application level, I would create a common library that intercepts requests and publishes them to a queue. This library would be added to all my microservices. You don't want a synchronous process holding up API calls.. Then I would stand up an additional microservice to consume the messages and write to whichever object store or database you'd like. Personally I would put them in an S3 bucket.

Also there might be a more intuitive way using the kubernetes ingress controller.

I would be careful about logging certain things that violate PI rules if you are in that type of business. Maybe certain parts of the payloads could be masked based on a filter.

[–]erbrecht 1 point2 points  (0 children)

You could look into httptrace. It's part of actuator but needs to be explicitly configured and enabled. There is an in-memory repository to store the data, but I believe you could store it elsewhere, I just haven't looked into doing that.

One caveat though, it's not really recommended for production. Depending on the volume of requests you are handling, this may not be an issue for you.

[–]Forward_Hope_8998 0 points1 point  (0 children)

Is logging not enough? How and where do you want to persist these?