Skip to content

Improves organization of manager metrics code#6181

Merged
keith-turner merged 4 commits intoapache:mainfrom
keith-turner:manager-metrics-reorg
Mar 5, 2026
Merged

Improves organization of manager metrics code#6181
keith-turner merged 4 commits intoapache:mainfrom
keith-turner:manager-metrics-reorg

Conversation

@keith-turner
Copy link
Contributor

The manager metrics setup code was spread over multiple classes and functions. Pulled setting up metrics into a single function in the manager.

The tablet group watcher metrics code existed in manager code. Pulled TGW metrics code into the TGW code for better encapsulation and simplification of the manger code.

The manager metrics setup code was spread over multiple classes and
functions.  Pulled setting up metrics into a single function in the
manager.

The tablet group watcher metrics code existed in manager code.  Pulled
TGW metrics code into the TGW code for better encapsulation and
simplification of the manger code.
@keith-turner keith-turner added this to the 4.0.0 milestone Mar 5, 2026
@keith-turner keith-turner changed the title Improves orgination of manager metrics code Improves orginization of manager metrics code Mar 5, 2026
@keith-turner keith-turner changed the title Improves orginization of manager metrics code Improves organization of manager metrics code Mar 5, 2026
private void setupMetrics() {
MetricsInfo metricsInfo = getContext().getMetricsInfo();
metricsInfo.addMetricsProducers(balanceManager.getMetrics());
watchers.forEach(watcher -> metricsInfo.addMetricsProducers(watcher.getMetrics()));
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe want to pass the Watchers into this method instead of referencing it directly. Reason being that if the call to this method was moved in the future, then it might be more apparent that watcher metrics will not longer be emitted.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Made a few defensive updates in 830f54b

Copy link
Contributor

Choose a reason for hiding this comment

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

You could probably remove this file at this point and move the contents into the Manager. It has a registerMetrics method.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

did that in ca1aa4d

@keith-turner keith-turner merged commit 087bf8a into apache:main Mar 5, 2026
9 checks passed
@keith-turner keith-turner deleted the manager-metrics-reorg branch March 5, 2026 21:08
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.

2 participants