Blazer-007 commented on code in PR #4118:
URL: https://github.com/apache/gobblin/pull/4118#discussion_r2234788884


##########
gobblin-temporal/src/main/java/org/apache/gobblin/temporal/ddm/launcher/ExecuteGobblinJobLauncher.java:
##########
@@ -96,8 +103,21 @@ public void submitJob(List<WorkUnit> workunits) {
       EventSubmitterContext eventSubmitterContext = new 
EventSubmitterContext.Builder(eventSubmitter)
           .withGaaSJobProps(finalProps)
           .build();
+
+      Map<String, String> attributes = new HashMap<>();
+      attributes.put(CURR_STATE, JOB_START);
+      EmitOTelMetricsImpl emitOTelMetrics = new EmitOTelMetricsImpl();
+      
emitOTelMetrics.emitLongCounterMetric(GaaSOpenTelemetryMetrics.GAAS_JOB_STATUS, 
1L, attributes, finalProps);
+
+      long startTimeMillis = System.currentTimeMillis();
       ExecGobblinStats execGobblinStats = workflow.execute(finalProps, 
eventSubmitterContext);
+      double timeTaken = (System.currentTimeMillis() - startTimeMillis) / 
1000.0;
       log.info("FINISHED - ExecuteGobblinWorkflow.execute = {}", 
execGobblinStats);
+      attributes.put(CURR_STATE, JOB_COMPLETE);
+      
emitOTelMetrics.emitLongCounterMetric(GaaSOpenTelemetryMetrics.GAAS_JOB_STATUS, 
1L, attributes, finalProps);
+      attributes.remove(CURR_STATE);

Review Comment:
   Nothing specific, just avoiding creating a new Map object



-- 
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-unsubscr...@gobblin.apache.org

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

Reply via email to