-
Notifications
You must be signed in to change notification settings - Fork 1
Added 'monitor' and 'report' methods for database monitoring through document store #75
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
Conversation
...g/hypertrace/core/serviceframework/docstore/metrics/DocStoreCustomMetricReportingConfig.java
Show resolved
Hide resolved
| } | ||
|
|
||
| private static void report(final DocStoreMetric metric) { | ||
| PlatformMetricsRegistry.registerGauge(metric.name(), metric.labels(), metric.value()); |
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.
we have to call register every time we report?
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.
We do not need for the standard metrics. I've updated the PR.
But, it may be required for the custom metrics (as the tags might change, rarely).
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.
So basically just taking the assumption that there's no harm in calling register repeatedly (may very well be true, no idea)
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.
Functionally, I tested it and it works. Performance-wise, I'm not sure. But, I don't think performance is critical here (as long as there isn't a huge variation in performance, which may not be the case).
Codecov Report
@@ Coverage Diff @@
## main #75 +/- ##
=========================================
Coverage 70.21% 70.21%
Complexity 106 106
=========================================
Files 15 15
Lines 591 591
Branches 32 32
=========================================
Hits 415 415
Misses 157 157
Partials 19 19
Flags with carried forward coverage won't be shown. Click here to find out more. 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
...main/java/org/hypertrace/core/serviceframework/docstore/metrics/DocStoreMetricsRegistry.java
Outdated
Show resolved
Hide resolved
| } | ||
|
|
||
| private static void report(final DocStoreMetric metric) { | ||
| PlatformMetricsRegistry.registerGauge(metric.name(), metric.labels(), metric.value()); |
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.
So basically just taking the assumption that there's no harm in calling register repeatedly (may very well be true, no idea)
No description provided.