-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add metrics framework for frontend and backend #1306
Conversation
Signed-off-by: Joshua Li <joshuali925@gmail.com>
Signed-off-by: Joshua Li <joshuali925@gmail.com>
Signed-off-by: Joshua Li <joshuali925@gmail.com>
Signed-off-by: Joshua Li <joshuali925@gmail.com>
Signed-off-by: Joshua Li <joshuali925@gmail.com>
Signed-off-by: Joshua Li <joshuali925@gmail.com>
Signed-off-by: Joshua Li <joshuali925@gmail.com>
Signed-off-by: Joshua Li <joshuali925@gmail.com>
Signed-off-by: Joshua Li <joshuali925@gmail.com>
Signed-off-by: Joshua Li <joshuali925@gmail.com>
Signed-off-by: Joshua Li <joshuali925@gmail.com>
Signed-off-by: Joshua Li <joshuali925@gmail.com>
Signed-off-by: Joshua Li <joshuali925@gmail.com>
Signed-off-by: Joshua Li <joshuali925@gmail.com>
Codecov Report
@@ Coverage Diff @@
## 2.x #1306 +/- ##
============================================
+ Coverage 41.71% 41.82% +0.11%
- Complexity 292 315 +23
============================================
Files 298 302 +4
Lines 17753 17840 +87
Branches 4280 4285 +5
============================================
+ Hits 7405 7462 +57
- Misses 10176 10205 +29
- Partials 172 173 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Signed-off-by: Joshua Li <joshuali925@gmail.com>
@@ -4,20 +4,21 @@ | |||
*/ | |||
|
|||
import { I18nProvider } from '@osd/i18n/react'; | |||
import { QueryManager } from 'common/query_manager'; |
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.
Was 'common/query_manager' instead of './common/query_manager' working for you? I've seen build errors not sure if it's only on my side or not.
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.
this is from tsserver's _typescript.organizeImports
command reordering lines, it shouldn't make any difference functionally
?.closest('[data-click-metric-element]') | ||
?.getAttribute('data-click-metric-element') |
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.
Where is this coming from - is the idea that we label buttons with what they are doing? I see it's being added to some test snapshots, but only for trace analytics refresh? Will it be added for different other operations in the future? Nevermind, seems like you are adding this in the request itself, but why do you need to do this then? Why can't you just have it handled when we send the request?
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.
Are we going to be sending these stats anywhere else other than the local index? Any place where we can get the aggregated stats?
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.
@derek-ho See description. This PR only adds the framework and some basic examples.
Why can't you just have it handled when we send the request?
Instrumenting metrics in each element's onClick is tedious comparing to adding an attribute.
Are we going to be sending these stats anywhere else other than the local index? Any place where we can get the aggregated stats?
Please see description for the "To get metrics" part.
Signed-off-by: Joshua Li <joshuali925@gmail.com>
Description
This PR adds the metrics counters and API to both OpenSearch and Dashboards plugins
Examples to instrument metrics (this PR only adds the framework and basic examples):
REQUEST_TOTAL
counter:{ "trace_analytics": { "refresh_button": count } }
in metrics response:<EuiButton + data-click-metric-element="trace_analytics.refresh_button" iconType="refresh" onClick={props.refresh} >
To get metrics
OpenSearch plugin:
GET http://localhost:9200/_plugins/_observability/_local/stats
Response
Dashboards plugin:
GET http://localhost:5601/api/observability/stats
Response
Issues Resolved
[List any issues this PR will resolve]
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.