slanatech / swagger-stats

API Observability. Trace API calls and Monitor API performance, health and usage statistics in Node.js Microservices.
https://swaggerstats.io/
MIT License
891 stars 136 forks source link

Ability to include response body in the rrr #137

Closed mannharleen closed 3 years ago

mannharleen commented 3 years ago

rrr includes request.body but not response.body. Can this be enabled?

sv2 commented 3 years ago

Responses may vary a lot, could be very big ( i.e. large json payload ). Would not be a good idea just to add all responses in the rrr. Instead, app should decide whether or not to include any response or part of response. What I can suggest: 1) When you are sending response to the request, decide if you want any part of response in the rrr. If yes, add that data into req. 2) Implement onResponseFinish callback, and add desired data into rrr.