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

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

                Author: ASF GitHub Bot
            Created on: 12/Mar/24 16:24
            Start Date: 12/Mar/24 16:24
    Worklog Time Spent: 10m 
      Work Description: Will-Lo commented on code in PR #3894:
URL: https://github.com/apache/gobblin/pull/3894#discussion_r1521774012


##########
gobblin-temporal/src/main/java/org/apache/gobblin/temporal/workflows/metrics/EventSubmitterContext.java:
##########
@@ -68,6 +75,39 @@ public EventSubmitterContext(EventSubmitter eventSubmitter) {
     this(eventSubmitter.getTags(), eventSubmitter.getNamespace());
   }
 
+  public EventSubmitterContext augmentWithGaaSMetadata(Properties jobProps) {
+    // TODO: Add temporal specific metadata tags
+    List<Tag<?>> metadataTags = new ArrayList<>(this.tags);
+
+    if (jobProps.containsKey(ConfigurationKeys.FLOW_GROUP_KEY)) {
+      metadataTags.add(new 
Tag<>(TimingEvent.FlowEventConstants.FLOW_GROUP_FIELD, 
jobProps.getProperty(ConfigurationKeys.FLOW_GROUP_KEY)));
+      metadataTags.add(new 
Tag<>(TimingEvent.FlowEventConstants.FLOW_NAME_FIELD, 
jobProps.getProperty(ConfigurationKeys.FLOW_NAME_KEY)));
+      metadataTags.add(new 
Tag<>(TimingEvent.FlowEventConstants.FLOW_EXECUTION_ID_FIELD, 
jobProps.getProperty(ConfigurationKeys.FLOW_EXECUTION_ID_KEY)));
+    }
+
+    if (jobProps.containsKey(ConfigurationKeys.JOB_CURRENT_ATTEMPTS)) {
+      metadataTags.add(new 
Tag<>(TimingEvent.FlowEventConstants.CURRENT_ATTEMPTS_FIELD,
+          jobProps.getProperty(ConfigurationKeys.JOB_CURRENT_ATTEMPTS, "1")));
+      metadataTags.add(new 
Tag<>(TimingEvent.FlowEventConstants.CURRENT_GENERATION_FIELD,
+          jobProps.getProperty(ConfigurationKeys.JOB_CURRENT_GENERATION, 
"1")));
+      metadataTags.add(new 
Tag<>(TimingEvent.FlowEventConstants.SHOULD_RETRY_FIELD,
+          "false"));
+    }
+
+    //Use azkaban.flow.execid as the jobExecutionId
+    metadataTags.add(new 
Tag<>(TimingEvent.FlowEventConstants.JOB_EXECUTION_ID_FIELD, "0"));
+
+    metadataTags.add(new Tag<>(TimingEvent.FlowEventConstants.JOB_GROUP_FIELD,
+        jobProps.getProperty(ConfigurationKeys.JOB_GROUP_KEY, "")));
+    metadataTags.add(new Tag<>(TimingEvent.FlowEventConstants.JOB_NAME_FIELD,
+        jobProps.getProperty(ConfigurationKeys.JOB_NAME_KEY, "")));
+    metadataTags.add(new Tag<>(TimingEvent.METADATA_MESSAGE, ""));
+
+    metadataTags.add(new Tag<>(Help.USER_TO_PROXY_KEY, 
jobProps.getProperty(Help.USER_TO_PROXY_KEY, "")));
+    this.tags = metadataTags;
+    return this;

Review Comment:
   In this case I'll adopt a builder pattern





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

    Worklog Id:     (was: 909467)
    Time Spent: 1h 20m  (was: 1h 10m)

> Add metadata tags for events sent from Temporal to be parseable in GaaS
> -----------------------------------------------------------------------
>
>                 Key: GOBBLIN-2014
>                 URL: https://issues.apache.org/jira/browse/GOBBLIN-2014
>             Project: Apache Gobblin
>          Issue Type: Bug
>          Components: gobblin-service
>            Reporter: William Lo
>            Assignee: Abhishek Tiwari
>            Priority: Major
>          Time Spent: 1h 20m
>  Remaining Estimate: 0h
>
> Gobblin's Temporal workflow launches through `ExecuteGobblinJobLauncher`, but 
> the eventSubmitter created in that class does not have the necessary metadata 
> needed in order to send events to GaaS.
> We want to populate the additional tags to read from the job props that 
> contain the information needed for these events to be readable from GaaS.



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

Reply via email to