tejaswini-imply commented on code in PR #12802:
URL: https://github.com/apache/druid/pull/12802#discussion_r925618333


##########
server/src/main/java/org/apache/druid/server/metrics/MetricsModule.java:
##########
@@ -170,13 +174,41 @@ public JvmThreadsMonitor 
getJvmThreadsMonitor(DataSourceTaskIdHolder dataSourceT
   @Provides
   @ManageLifecycle
   public SysMonitor getSysMonitor(
-      DataSourceTaskIdHolder dataSourceTaskIdHolder
+      DataSourceTaskIdHolder dataSourceTaskIdHolder,
+      Injector injector
   )
   {
+    final Set<NodeRole> nodeRoles = getNodeRoles(injector);
     Map<String, String[]> dimensions = MonitorsConfig.mapOfDatasourceAndTaskID(
         dataSourceTaskIdHolder.getDataSource(),
         dataSourceTaskIdHolder.getTaskId()
     );
-    return new SysMonitor(dimensions);
+    return new SysMonitor(dimensions, isPeonRole(nodeRoles));

Review Comment:
   I completely agree although I was a little skeptical to use that if any 
extra functionality might be added in SysMonitor in the future that might want 
to be used on Peons. But that's a long shot. I'll go with `NoopSysMonitor`. 
Thanks.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to