Zazcar - request
This is a small wrapper around the request-promise package, the objective is to do the quests and have some metrics on cloudwatch for later analysis
How to use
const zazcarRequest = require('@zazcar/request');
zazcarRequest.doRequest(options, 'Target api name', 'Your namespace', 'Optional custom path')
.then((result) => {
})
.catch((error) => {
});
What you get
For the Target api name
you will get the aggregated data on:
- latency(ms)
- count - total amount of requests done with the target api
- error4xx - requests that failed with a 4xx error
- error5xx - requests that failed with a 5xx error
- errorTimeout - request that timedout
- errorCount - total amount of requests that failed (4xx, 5xx or other kind of errors)
You also get those metrics for each one of the endpoints that you call, lets say that you make a request to https://api.example.com/user/1
and https://api.example.com/user/
you will have the aggregated metrics given that you did set the same Target api name
and namespace
on the request.
you also have metrics that are arranged by the Integration name, method and Path