Ma77Ball commented on code in PR #9445:
URL: https://github.com/apache/texera/pull/9445#discussion_r4650991493


##########
amber/src/main/scala/org/apache/texera/web/resource/SyncExecutionResource.scala:
##########
@@ -357,7 +365,11 @@ class SyncExecutionResource extends LazyLogging {
     } catch {
       case e: Exception =>
         logger.error(s"Sync execution error: ${e.getMessage}", e)
+        span.recordException(e)

Review Comment:
   Moved the execution body into a nested runExecution and now set the span to 
ERROR once from the single result when it is not successful, so the timeout, 
wait-error and null-service returns and the caught exception all mark the span, 
not just record an event.



##########
amber/src/main/scala/org/apache/texera/web/resource/SyncExecutionResource.scala:
##########
@@ -153,6 +154,13 @@ class SyncExecutionResource extends LazyLogging {
         
s"maxOperatorResultCellCharLimit=${request.maxOperatorResultCellCharLimit} 
(capped to $maxOperatorResultCellCharLimit)"
     )
 
+    val span = TexeraTracer.tracer
+      .spanBuilder("SyncExecutionResource.executeWorkflowSync")
+      .setAttribute(SpanAttrs.WorkflowId, Long.box(workflowId))
+      .setAttribute("texera.computing_unit.id", computingUnitId.toLong)

Review Comment:
   Added ComputingUnitId and OperatorCount to SpanAttrs and tagged the span 
with those keys instead of the inline strings.



##########
amber/src/main/scala/org/apache/texera/web/resource/SyncExecutionResource.scala:
##########
@@ -153,6 +154,13 @@ class SyncExecutionResource extends LazyLogging {
         
s"maxOperatorResultCellCharLimit=${request.maxOperatorResultCellCharLimit} 
(capped to $maxOperatorResultCellCharLimit)"
     )
 
+    val span = TexeraTracer.tracer

Review Comment:
   Added a SyncExecutionResourceSpec case that drives a failing run and 
asserts, through an in-memory SpanExporter installed into GlobalOpenTelemetry, 
that the span is named, carries the workflow, computing-unit and operator-count 
labels, and is marked ERROR; used an in-memory exporter like 
WorkflowMetricsRecorderSpec rather than adding the opentelemetry-sdk-testing 
dependency.



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