-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-24637][SS] Add metrics regarding state and watermark to dropwizard metrics #21622
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
|
I think we may want to add metrics regarding sources and sinks as well, but the format of offset information or other metadata information can be different between sources and sinks. |
|
add to whitelist |
|
Test build #92256 has finished for PR 21622 at commit
|
|
retest this, please |
|
Test build #92260 has finished for PR 21622 at commit
|
|
Test build #92261 has finished for PR 21622 at commit
|
| timestampFormat.setTimeZone(DateTimeUtils.getTimeZone("UTC")) | ||
|
|
||
| registerGauge("eventTime-watermark", | ||
| s => convertStringDateToMillis(s.eventTime.get("watermark")), 0L) |
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.
- nit: rename
s=>progressto make it clear. - The eventTime-watermark metrics needs to be reported only if the map is not empty (event time). Could be skipped if the map is empty (processing time) to avoid confusion.
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.
- will address
- We don't know whether the map will be empty when calling
registerGauge, and once we register the metric,getValuein Gauge is called from Dropwizard so I'm not sure we can control whether reporting the value or not.
|
Looks good overall, a couple of minor comments. |
|
Test build #92355 has finished for PR 21622 at commit
|
|
|
||
| registerGauge("states-rowsTotal", _.stateOperators.map(_.numRowsTotal).sum, 0L) | ||
| registerGauge("states-usedBytes", _.stateOperators.map(_.memoryUsedBytes).sum, 0L) | ||
|
|
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 can add more metrics like "providerLoadedMapSizeBytes" after adopting SPARK-24441, so that actual memory usage of state store provider could be tracked via time-series manner.
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.
Those are custom metrics, which may or may not be present depending on the implementation of state store. I dont recommend adding them here directly.
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.
Thanks for the input! I'll keep the patch as it is.
Could you suggest some approaches to extend the maintained metrics? I would like to expand more, and newer things might be coming from custom metrics (like from source and sink) so might be worth to have extension point.
My question is beyond of this PR, so please continue reviewing the patch. Thanks!
|
lgtm |
|
Thanks for reviewing @arunmahadevan and @jose-torres ! Could we finalize review on #21469 to see a chance to include "providerLoadedMapSizeBytes" to here? Or is it OK to handle it with follow-up issue? |
|
retest this please |
|
Test build #93874 has finished for PR 21622 at commit
|
|
Test failure looks unrelated. Jenkins, retest this, please |
|
retest this please |
|
Test build #93941 has finished for PR 21622 at commit
|
|
retest this please |
|
Test build #94261 has finished for PR 21622 at commit
|
|
@HyukjinKwon Could you take this forward given that the patch is minor and CI test is passed? Thanks in advance! |
|
Merged to master. |
|
Thanks @HyukjinKwon for merging, and thanks all for reviewing! |
What changes were proposed in this pull request?
The patch adds metrics regarding state and watermark to dropwizard metrics, so that watermark and state rows/size can be tracked via time-series manner.
How was this patch tested?
Manually tested with CSV metric sink.