You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@gobblin.apache.org by GitBox <gi...@apache.org> on 2021/10/07 23:42:50 UTC

[GitHub] [gobblin] umustafi commented on a change in pull request #3411: [GOBBLIN-1560] Fix WorkUnit Count Reporting to InGraphs

umustafi commented on a change in pull request #3411:
URL: https://github.com/apache/gobblin/pull/3411#discussion_r724603661



##########
File path: gobblin-service/src/main/java/org/apache/gobblin/service/monitoring/KafkaJobStatusMonitor.java
##########
@@ -323,6 +344,11 @@ private void emitWorkUnitCountMetric(GobblinTrackingEvent event) {
           () -> this.flowNameGroupToWorkUnitCount.get(workUnitCountName));
       this.getMetricContext().register(workUnitCountName, gauge);
     }
+
+   // Schedule this gauge to be removed after emission
+    Runnable task = new RunnableWithMetricContext(this.getMetricContext(), workUnitCountName);
+    ScheduledFuture<?> future = this.scheduler.schedule(task, EXPECTED_TIME_FOR_METRICS_REPORTING, TimeUnit.SECONDS);

Review comment:
       One issue I foresee with this is if two jobs in a multi-job flow are initiated shortly after each other and the gauge value is changed, then the future may delete the gauge before it is reported. However, I'm not sure how to deal with this case. Do we expect this to be frequent?




-- 
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: dev-unsubscribe@gobblin.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org