First, real-time monitoring
The user clicks on the service instance, the system displays the list of APIs under service instance-version,
The user clicks on the following two icons for an API
1, API request number monitoring
Horizontal axis: Time, granularity is minute
Longitudinal axis: Number of requests for access
Display: Number of failures (red), number of successes (green), total (yellow), "Click Red, display the list of failed logs, click the failure log, and the tree shows the local request end-to-end detail log."
Store:
- At the end of the request, the cumulative number of successes is instid_api_20171852_suc_cnt
- At the end of the request, the cumulative number of failures to instid_api_20171852_err_cnt
2. API Request Duration Monitoring
Horizontal axis: Time, granularity is minute
Longitudinal axis: Request Access length
Show: Average success time of Gateway (green), average success time of server (black)
Store:
- At the end of the request, the cumulative gateway succeeds to Instid_api_20171852_suc_len
- At the end of the request, the cumulative service end succeeds to Instid_svc_20171852_suc_len
3. Recording to Redis storage
The above data in Redis is set to default 120-minute expiration,
When the above 1 and 2 are complete, log the "Request monitoring statistics log" to elk.
Ii. log format 1, request start log
Request Log Request ID request Developer APIID Service Instance client gateway start time server end time Client address success/failure
Gateway End Time service end Time service provider
@[email protected] @[email protected] @[email protected] @[email protected] @[email protected] @[email protected] @[email Protected] @[email protected] @succFlag/f[email protected]
@[email protected] @[email protected] @[email protected]
2. Signature comparison Log
Signature is unsuccessful for failed request ID APIID service instance
@[email protected] @[email protected] @[email protected] @[email protected] @succFlag/[email protected]
3. Request Monitoring Statistics log (collect and send regularly)
@[email protected] @[email protected] @[email protected] @ Date Time @ @ hour @ @ min @
@ Success @ @ Number of failures @ Total @
@ Gateway Average Request response Duration (Success) @ @ Gateway Average Request response Duration (failed) @
@ Service-side average request response Duration (Success) @ @ Server average Request response Duration (failed) @
Api-gateway Practice (7) New service gateway-Gateway request monitoring statistics