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



##########
File path: 
gobblin-runtime/src/main/java/org/apache/gobblin/runtime/mapreduce/MRJobLauncher.java
##########
@@ -291,6 +296,14 @@ protected void runWorkUnits(List<WorkUnit> workUnits) 
throws Exception {
       this.eventSubmitter.submit(countEventBuilder);
       LOG.info("Emitting WorkUnitsCreated Count: " + 
countEventBuilder.getCount());
 
+      MetricContext
+          metricContext = 
Instrumented.getMetricContext(ConfigUtils.configToState(ConfigFactory.empty()), 
getClass());
+      String workUnitCountName = 
MetricRegistry.name(ServiceMetricNames.GOBBLIN_SERVICE_PREFIX,
+          jobState.getProp(ConfigurationKeys.FLOW_GROUP_KEY), 
jobState.getProp(ConfigurationKeys.FLOW_NAME_KEY),
+          JobEvent.WORK_UNITS_CREATED);
+      ContextAwareGauge guage = 
metricContext.newContextAwareGauge(workUnitCountName, () -> workUnits.size());

Review comment:
       The issue here is that we don't have access to the number of work units 
easily from the GaaS code. One option will be to use the metadata in the 
CountEvent like you are suggesting and then emit actual metrics from the point 
its landing in GaaS (the KafkaAvroJobStatusMonitor) but that seemed like a 
hackier way of doing it.




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


Reply via email to