-
Notifications
You must be signed in to change notification settings - Fork 31
Add frontend metrics for Kibana reports #277
Add frontend metrics for Kibana reports #277
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #277 +/- ##
==========================================
+ Coverage 74.91% 74.94% +0.02%
==========================================
Files 32 32
Lines 1754 1764 +10
Branches 340 342 +2
==========================================
+ Hits 1314 1322 +8
- Misses 435 437 +2
Partials 5 5
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, minor comments
We need count, total, client_error, system_error for all the Kibana reporting API endpoints.
The metrics that you posted are business metrics and don't require client_error, system_error. They should only be incremented only when we have successful generation of a report. |
What metric do we want to collect from API such as GET |
Same as count, total, client_error, system_error. To alarm on system_errors if they go above a certain threshold. For example the ES is un-responsive you may get 5XX from ES, and thus this API call will be failing as it's not able to read from index. |
try { | ||
const metrics = getMetrics(); | ||
return response.ok({ | ||
body: metrics, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
np: could simplify to body: getMetrics()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM- please address comments
Looks like codecov failed? |
will add some tests |
|
|
Issue #, if available:
Description of changes:
/api/reporting/stats
to collect usage metrics and action metrics(per API)count
: request count in the last minutetotal
: total request count since the server is upuser_error
: 4xx error status code in the last minutesystem_error
: all other error status code in the last minuteBy submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.