[ 
https://issues.apache.org/jira/browse/GOBBLIN-2079?focusedWorklogId=927551&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-927551
 ]

ASF GitHub Bot logged work on GOBBLIN-2079:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 26/Jul/24 12:47
            Start Date: 26/Jul/24 12:47
    Worklog Time Spent: 10m 
      Work Description: phet commented on code in PR #3962:
URL: https://github.com/apache/gobblin/pull/3962#discussion_r1693006907


##########
gobblin-modules/gobblin-kafka-09/src/test/java/org/apache/gobblin/runtime/KafkaAvroJobStatusMonitorTest.java:
##########
@@ -713,6 +715,64 @@ public void testObservabilityEventSingleEmission() throws 
IOException, Reflectiv
     jobStatusMonitor.shutDown();
   }
 
+  @Test (dependsOnMethods = "testObservabilityEventSingleEmission")
+  public void testObservabilityEventFlowLevel() throws IOException, 
ReflectiveOperationException {
+    KafkaEventReporter kafkaReporter = builder.build("localhost:0000", 
"topic7");
+
+    //Submit GobblinTrackingEvents to Kafka
+    ImmutableList.of(
+        createFlowCompiledEvent(),
+        createJobSucceededEvent(),
+        createFlowSucceededEvent()
+    ).forEach(event -> {
+      context.submitEvent(event);
+      kafkaReporter.report();
+    });
+    try {
+      Thread.sleep(1000);
+    } catch (InterruptedException ex) {
+      Thread.currentThread().interrupt();
+    }
+    MultiContextIssueRepository issueRepository = new 
InMemoryMultiContextIssueRepository();
+    MockGaaSJobObservabilityEventProducer mockEventProducer = new 
MockGaaSJobObservabilityEventProducer(ConfigUtils.configToState(ConfigFactory.empty()),
+        issueRepository, false);
+    MockKafkaAvroJobStatusMonitor jobStatusMonitor = 
createMockKafkaAvroJobStatusMonitor(new AtomicBoolean(false), 
ConfigFactory.empty(),
+        mockEventProducer, mock(DagManagementStateStore.class));
+    jobStatusMonitor.buildMetricsContextAndMetrics();
+    Iterator<DecodeableKafkaRecord<byte[], byte[]>> recordIterator = 
Iterators.transform(
+        this.kafkaTestHelper.getIteratorForTopic(TOPIC),
+        this::convertMessageAndMetadataToDecodableKafkaRecord);
+
+    State state = getNextJobStatusState(jobStatusMonitor, recordIterator, 
"NA", "NA");
+    Assert.assertEquals(state.getProp(JobStatusRetriever.EVENT_NAME_FIELD), 
ExecutionStatus.COMPILED.name());
+
+    state = getNextJobStatusState(jobStatusMonitor, recordIterator, 
this.jobGroup, this.jobName);
+    Assert.assertEquals(state.getProp(JobStatusRetriever.EVENT_NAME_FIELD), 
ExecutionStatus.COMPLETE.name());
+
+    state = getNextJobStatusState(jobStatusMonitor, recordIterator, "NA", 
"NA");
+    Assert.assertEquals(state.getProp(JobStatusRetriever.EVENT_NAME_FIELD), 
ExecutionStatus.COMPLETE.name());
+
+    // Only the COMPLETE event should create a GaaSJobObservabilityEvent

Review Comment:
   just wondering... should we verify an event is even emitted when the job 
fails or is cancelled, not just when successful?





Issue Time Tracking
-------------------

    Worklog Id:     (was: 927551)
    Time Spent: 1.5h  (was: 1h 20m)

> GaaSObservabilityEvents should have a dedicated flow level event
> ----------------------------------------------------------------
>
>                 Key: GOBBLIN-2079
>                 URL: https://issues.apache.org/jira/browse/GOBBLIN-2079
>             Project: Apache Gobblin
>          Issue Type: Improvement
>            Reporter: William Lo
>            Priority: Major
>          Time Spent: 1.5h
>  Remaining Estimate: 0h
>
> GaaSJobObservabilityEvents currently encapsulate both jobs and flows in GaaS.
> This is fine for single hop flows, but flows with multiple jobs encapsulated 
> in them now have a mix of job level events with the majority of metadata, and 
> flow level events which provide a better view to users when their flow fails 
> at any given point.
> Since the data in both events differs vastly with most metadata only having 
> contextual sense in the job level event, we should separate job and flow 
> level events to their own respective event types.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to