kfaraz commented on code in PR #13331:
URL: https://github.com/apache/druid/pull/13331#discussion_r1017870092
##########
indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:
##########
@@ -4095,6 +4096,17 @@ protected void emitLag()
}
LagStats lagStats = computeLags(partitionLags);
+ for (Map.Entry<PartitionIdType, Long> entry :
partitionLags.entrySet()) {
+ emitter.emit(
+ ServiceMetricEvent.builder()
+ .setDimension(DruidMetrics.DATASOURCE,
dataSource)
+ .setDimension(DruidMetrics.PARTITION,
entry.getKey())
Review Comment:
We already add the datasource dimension. Will `stream` add any new
information?
##########
indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:
##########
@@ -4075,9 +4076,14 @@ protected void emitNoticesQueueSize()
protected void emitLag()
{
- if (spec.isSuspended() || !(stateManager.isSteadyState() ||
stateManager.isIdle())) {
- // don't emit metrics if supervisor is suspended or not in a healthy
running state
- // (lag should still available in status report)
+ SupervisorStateManager.State basicState =
stateManager.getSupervisorState().getBasicState();
+ boolean unhealthySupervisorOrTasks =
SupervisorStateManager.BasicState.UNHEALTHY_TASKS.equals(basicState)
+ ||
SupervisorStateManager.BasicState.UNHEALTHY_SUPERVISOR.equals(basicState);
+
+ if (spec.isSuspended() || !(stateManager.isSteadyState() ||
stateManager.isIdle() || unhealthySupervisorOrTasks)) {
+ // Don't emit metrics if the supervisor is suspended. Also,
+ // to emit metrics, the state must be in {healthy steady state, idle or
UNHEALTHY_TASKS or UNHEALTHY_SUPERVISOR}
+ // (lag should still be available in the status report)
Review Comment:
```suggestion
// Emit metrics only if the supervisor state is RUNNING, IDLE,
UNHEALTHY_TASKS or UNHEALTHY_SUPERVISOR
// (lag should still be available in the status report in other
supervisor states)
```
--
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]