Skip to content

Conversation

@robert3005
Copy link

What changes were proposed in this pull request?

MetricSystem picks up new metrics from sources that are added throughout execution. If you do measurements via dynamic proxies you might not want to redeclare all metrics that the proxies will create and you'd prefer them to get populated as they're being produced. Right now all sources are processed only onceat startup and metrics are picked up only if they have been registered statically at compile time. Behaviour I am proposing lets you not have to declare metrics in two places.

This had been previously suggested in #18406 and #29980. I have reduced the scope of the change to just dynamic metric registration.

Why are the changes needed?

Currently there's no way to access MetricRegistry that MetricsSystem uses to hold its state and as such it's not possible to reprocess a source. MetricsSystem throws if any metric had already been registered previously.

n.b. the MetricRegistry is added as a constructor argument to make testing easier but could as well be accessed via reflection as a private variable.

Does this PR introduce any user-facing change?

No

How was this patch tested?

Added tests

@dongjoon-hyun
Copy link
Member

ok to test

@SparkQA
Copy link

SparkQA commented Feb 21, 2021

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/39905/

@SparkQA
Copy link

SparkQA commented Feb 21, 2021

Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/39905/

@SparkQA
Copy link

SparkQA commented Feb 21, 2021

Test build #135325 has finished for PR 31267 at commit 56706ff.

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

@robert3005
Copy link
Author

Looks like jenkins tests pass fine andn giithub actions flaked

@github-actions
Copy link

Test build #752447031 for PR 31267 at commit a951f24.

@github-actions
Copy link

Test build #752448650 for PR 31267 at commit c808690.

@SparkQA
Copy link

SparkQA commented Apr 15, 2021

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/42000/

@SparkQA
Copy link

SparkQA commented Apr 15, 2021

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/41999/

@SparkQA
Copy link

SparkQA commented Apr 15, 2021

Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/41999/

@SparkQA
Copy link

SparkQA commented Apr 15, 2021

Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/42000/

@SparkQA
Copy link

SparkQA commented Apr 15, 2021

Test build #137423 has finished for PR 31267 at commit c808690.

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

Copy link
Contributor

@mridulm mridulm left a comment

Choose a reason for hiding this comment

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

Thanks for working on this @robert3005, took a quick pass through it.

@mridulm
Copy link
Contributor

mridulm commented Apr 15, 2021

+CC @HyukjinKwon, @jerryshao who have worked on this in past.

@HyukjinKwon
Copy link
Member

Thanks for cc'ing me @mridulm.

Actually I reviewed this. It makes sense but I am not very used to this code path to be honest ...

@mridulm
Copy link
Contributor

mridulm commented Apr 16, 2021

Thanks @HyukjinKwon :-)
+CC @srowen

@SparkQA
Copy link

SparkQA commented Apr 19, 2021

Test build #137635 has finished for PR 31267 at commit c808690.

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

@github-actions
Copy link

We're closing this PR because it hasn't been updated in a while. This isn't a judgement on the merit of the PR in any way. It's just a way of keeping the PR queue manageable.
If you'd like to revive this PR, please reopen it and ask a committer to remove the Stale tag!

@github-actions github-actions bot added the Stale label Jul 29, 2021
@robert3005
Copy link
Author

This pr shouldn't be stale. I forgot about but will address comments eow

@HyukjinKwon HyukjinKwon removed the Stale label Jul 29, 2021
Robert Kruszewski added 2 commits August 5, 2021 23:38
@robert3005
Copy link
Author

Addressed the comments. While reviewing the code I noticed there was a small thing that I missed - the error on duplicate metric name will happen now in the listener so I kept the logic that suppressed that error when registering

@SparkQA
Copy link

SparkQA commented Aug 5, 2021

Kubernetes integration test unable to build dist.

exiting with code: 1
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/46627/

@SparkQA
Copy link

SparkQA commented Aug 5, 2021

Test build #142115 has finished for PR 31267 at commit 2e6f29b.

  • This patch fails to build.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Aug 6, 2021

Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/46686/

@SparkQA
Copy link

SparkQA commented Aug 6, 2021

Kubernetes integration test status failure
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/46686/

@SparkQA
Copy link

SparkQA commented Aug 6, 2021

Test build #142174 has finished for PR 31267 at commit e375448.

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

@SparkQA
Copy link

SparkQA commented Sep 28, 2021

Test build #143664 has finished for PR 31267 at commit e375448.

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

@github-actions
Copy link

github-actions bot commented Jan 7, 2022

We're closing this PR because it hasn't been updated in a while. This isn't a judgement on the merit of the PR in any way. It's just a way of keeping the PR queue manageable.
If you'd like to revive this PR, please reopen it and ask a committer to remove the Stale tag!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants