FrankChen021 commented on code in PR #20706:
URL: https://github.com/apache/druid/pull/20706#discussion_r4359983438


##########
indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:
##########
@@ -738,6 +732,20 @@ public void handle()
       }
     }
 
+    private void emitRequiredTaskCountMetric(int desiredTaskCount, @Nullable 
String skipReason)
+    {
+      final ServiceMetricEvent.Builder event = ServiceMetricEvent
+          .builder()
+          .setDimension(DruidMetrics.SUPERVISOR_ID, supervisorId)
+          .setDimension(DruidMetrics.DATASOURCE, dataSource)
+          .setDimension(DruidMetrics.STREAM, getIoConfig().getStream());
+      if (skipReason != null) {
+        event.setDimension(AUTOSCALER_SKIP_REASON_DIMENSION, skipReason);
+      }
+      event.setMetric(AUTOSCALER_REQUIRED_TASKS_METRIC, desiredTaskCount);
+      emitter.emit(event);

Review Comment:
   [P1] Required-count metrics use the wrong emitter
   
   **Finding:** The new helper emits through the supervisor's emitter, but 
existing SeekableStreamSupervisorSpecTest cases construct LagBasedAutoScaler 
with a separate dynamicActionEmitter and assert required-count events there. 
Those events now go to spec.getEmitter() instead, so the affected tests fail 
and callers relying on the supplied emitter lose the metrics.
   
   **Suggestion:** Preserve the emitter supplied to normal dynamic-allocation 
notices, or update the emitter contract and all existing tests and call sites 
consistently.



-- 
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