-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat: enable client-side metrics scraping for JindoCache engine #4331
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
feat: enable client-side metrics scraping for JindoCache engine #4331
Conversation
|
/hold |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4331 +/- ##
==========================================
- Coverage 62.90% 58.24% -4.67%
==========================================
Files 483 563 +80
Lines 28570 31367 +2797
==========================================
+ Hits 17972 18269 +297
- Misses 8393 10837 +2444
- Partials 2205 2261 +56
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Signed-off-by: trafalgarzzz <trafalgarz@outlook.com>
….ScrapeTarget Signed-off-by: trafalgarzzz <trafalgarz@outlook.com>
….ScrapeTarget Signed-off-by: trafalgarzzz <trafalgarz@outlook.com>
Signed-off-by: trafalgarzzz <trafalgarz@outlook.com>
Signed-off-by: trafalgarzzz <trafalgarz@outlook.com>
Signed-off-by: trafalgarzzz <trafalgarz@outlook.com>
Signed-off-by: trafalgarzzz <trafalgarz@outlook.com>
Signed-off-by: trafalgarzzz <trafalgarz@outlook.com>
Signed-off-by: trafalgarzzz <trafalgarz@outlook.com>
Signed-off-by: trafalgarzzz <trafalgarz@outlook.com>
Signed-off-by: trafalgarzzz <trafalgarz@outlook.com>
d60b25b to
b0e7f7f
Compare
|
/unhold |
| } | ||
|
|
||
| metricsEnabled, exists := fusesToUpdate.Spec.Template.ObjectMeta.Annotations[common.AnnotationPrometheusFuseMetricsScrapeKey] | ||
| if exists && metricsEnabled != common.True { |
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.
How about letting the code exit early if the annotation exists but is not equal to common.True, reducing nesting?
if exists && metricsEnabled != common.True {
e.Log.V(1).Info(fmt.Sprintf("Found user-defined annotation %s != %s, skip syncing.", common.AnnotationPrometheusFuseMetricsScrapeKey, common.True))
return
}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.
@cheyang The nesting is necessary. L235-L248 updates FUSE's daemonset if changed==true. If the code exits early, the update will be skipped when runtime.Spec.Fuse.Resources is modified(at L213).
Signed-off-by: trafalgarzzz <trafalgarz@outlook.com>
|
cheyang
left a comment
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
/approve
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cheyang The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |



Ⅰ. Describe what this PR does
Three parts of code changes have been made in this pull request:
spec.fuse.metricsto JindoRuntime's CRD. See below for some examples.spec.fuse.metricsFeature API
Two fields can be specified under
spec.fuse.metricsin JindoRuntime CRD.enabled: true, Fluid exposes metrics for all FUSE components, including FUSE mount pods and FUSE sidecar containers.scrapeTargethas four valid values:"": The default value, indicating Fluid will not automatically scrape FUSE metrics. (Under the hood, will not add special annotation that makes Prometheus discover FUSE components.)MountPodOnly: Only FUSE mount pods will be discovered by Prometheus and metrics will be scraped.SidecarOnly: Only FUSE sidecar containers will be discovered by Prometheus and metrics will be scraped.All: Both FUSE mount pods and FUSE sidecar containers will be discovered by Prometheus and metrics will be scraped.Discovered FUSE mount pod example with enabled metrics
Discovered FUSE sidecar container example with enabled metrics
Ⅱ. Does this pull request fix one issue?
NONE
Ⅲ. List the added test cases (unit test/integration test) if any, please explain if no tests are needed.
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews