Skip to content

Conversation

@HeartSaVioR
Copy link
Contributor

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.

@HeartSaVioR
Copy link
Contributor Author

@HeartSaVioR
Copy link
Contributor Author

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.
Not sure about more preferred approach: 1. define general format of information for source/sink 2. let individual source/sink manage metric as well.

@HyukjinKwon
Copy link
Member

add to whitelist

@SparkQA
Copy link

SparkQA commented Jun 23, 2018

Test build #92256 has finished for PR 21622 at commit 147c98a.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@HeartSaVioR
Copy link
Contributor Author

retest this, please

@SparkQA
Copy link

SparkQA commented Jun 23, 2018

Test build #92260 has finished for PR 21622 at commit 147c98a.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Jun 23, 2018

Test build #92261 has finished for PR 21622 at commit 147c98a.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

timestampFormat.setTimeZone(DateTimeUtils.getTimeZone("UTC"))

registerGauge("eventTime-watermark",
s => convertStringDateToMillis(s.eventTime.get("watermark")), 0L)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. nit: rename s => progress to make it clear.
  2. 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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. will address
  2. We don't know whether the map will be empty when calling registerGauge, and once we register the metric, getValue in Gauge is called from Dropwizard so I'm not sure we can control whether reporting the value or not.

@arunmahadevan
Copy link
Contributor

Looks good overall, a couple of minor comments.

@SparkQA
Copy link

SparkQA commented Jun 27, 2018

Test build #92355 has finished for PR 21622 at commit 722e6a0.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.


registerGauge("states-rowsTotal", _.stateOperators.map(_.numRowsTotal).sum, 0L)
registerGauge("states-usedBytes", _.stateOperators.map(_.memoryUsedBytes).sum, 0L)

Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Contributor Author

@HeartSaVioR HeartSaVioR Aug 1, 2018

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!

@jose-torres
Copy link
Contributor

lgtm

@HeartSaVioR
Copy link
Contributor Author

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?

@HeartSaVioR
Copy link
Contributor Author

Pinging @tdas and @zsxwing for reviewing. It's small one.

@HyukjinKwon
Copy link
Member

retest this please

@SparkQA
Copy link

SparkQA commented Aug 1, 2018

Test build #93874 has finished for PR 21622 at commit 722e6a0.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@HeartSaVioR
Copy link
Contributor Author

Test failure looks unrelated.

Jenkins, retest this, please

@HyukjinKwon
Copy link
Member

retest this please

@SparkQA
Copy link

SparkQA commented Aug 2, 2018

Test build #93941 has finished for PR 21622 at commit 722e6a0.

  • This patch fails due to an unknown error code, -9.
  • This patch merges cleanly.
  • This patch adds no public classes.

@HeartSaVioR
Copy link
Contributor Author

retest this please

@SparkQA
Copy link

SparkQA commented Aug 6, 2018

Test build #94261 has finished for PR 21622 at commit 722e6a0.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@HeartSaVioR
Copy link
Contributor Author

@HyukjinKwon Could you take this forward given that the patch is minor and CI test is passed? Thanks in advance!

@HyukjinKwon
Copy link
Member

Merged to master.

@asfgit asfgit closed this in 6afe6f3 Aug 7, 2018
@HeartSaVioR
Copy link
Contributor Author

Thanks @HyukjinKwon for merging, and thanks all for reviewing!

@HeartSaVioR HeartSaVioR deleted the SPARK-24637 branch January 25, 2019 22:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants