Track your API metrics within ReadMe.
npm install readmeio
Just add the middleware to express, and that's it!
const readme = require('readmeio');
app.use(readme.metrics('<<apiKey>>', req => ({
id: req.project._id,
label: req.project.name,
email: req.project.owner
})));
View full documentation here: https://docs.readme.com/docs/sending-logs-to-readme-with-nodejs
- Currently only supports JSON. Adding a whitelist/blacklist for non-JSON bodies will not work (unless they're added to
req.body
) the same way thatbody-parser
does it. The properties will be converted to JSON in the HAR format. - Needs more support for getting URLs when behind a reverse proxy:
x-forwarded-for
,x-forwarded-proto
, etc. - Needs more support for getting client IP address when behind a reverse proxy.
- Logs are "fire and forget" to the metrics server, so any failed requests (even for incorrect API key!) will currently fail silently.
ISC