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

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

                Author: ASF GitHub Bot
            Created on: 31/Jan/24 17:19
            Start Date: 31/Jan/24 17:19
    Worklog Time Spent: 10m 
      Work Description: Will-Lo commented on code in PR #3843:
URL: https://github.com/apache/gobblin/pull/3843#discussion_r1473184203


##########
gobblin-temporal/src/main/java/org/apache/gobblin/temporal/workflows/metrics/TemporalEventTimer.java:
##########
@@ -0,0 +1,108 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.gobblin.temporal.workflows.metrics;
+
+import java.time.Duration;
+import java.time.Instant;
+
+import io.temporal.activity.ActivityOptions;
+import io.temporal.workflow.Workflow;
+import lombok.RequiredArgsConstructor;
+
+import org.apache.gobblin.metrics.event.EventSubmitter;
+import org.apache.gobblin.metrics.event.GobblinEventBuilder;
+import org.apache.gobblin.metrics.event.TimingEvent;
+
+
+/**
+ * Boiler plate for tracking elapsed time of events that is compatible with 
{@link Workflow}
+ * by using activities to record time
+ *
+ * This class is very similar to {@link TimingEvent} but uses {@link Workflow} 
compatible APIs. It's possible to refactor
+ * this class to inherit the {@link TimingEvent} but extra care would be 
needed to remove the {@link EventSubmitter} field
+ * since that class is not serializable without losing some information
+ */
+@RequiredArgsConstructor
+public class TemporalEventTimer implements EventTimer {

Review Comment:
   This may be overkill for the current PR, but as we move to Temporal I think 
it'd be good to leverage some tools Temporal also provides for telemetry via 
interceptors, which other observability libraries use. See: 
https://www.restack.io/docs/temporal-knowledge-temporal-io-interceptor-guide 
and an example
   
https://github.com/temporalio/sdk-python/blob/e1d983e226d055424a6c3404651079b23a44f5f0/temporalio/contrib/opentelemetry.py#L293
   
   We probably need to come up with a design/workflow around this though, and 
probably does not overlap completely with the current strategy of emitting 
Kafka events at certain periods of the job





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

    Worklog Id:     (was: 902860)
    Time Spent: 2h 10m  (was: 2h)

> TemporaI: Implementation of GTE for GaaS Observability Event in MR 
> deprecation for distcp
> -----------------------------------------------------------------------------------------
>
>                 Key: GOBBLIN-1989
>                 URL: https://issues.apache.org/jira/browse/GOBBLIN-1989
>             Project: Apache Gobblin
>          Issue Type: Improvement
>            Reporter: Matthew Ho
>            Priority: Major
>          Time Spent: 2h 10m
>  Remaining Estimate: 0h
>




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

Reply via email to