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


##########
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:
   **Must fix:**
   
   `recordException` adds an event but never sets status. A failed run (say, a 
warehouse pick rejected at L175) therefore exports as UNSET, and Jaeger's error 
filter skips it while the nested init span shows red. The sibling span also 
calls `span.setStatus(StatusCode.ERROR)` 
([WorkflowService.scala:389-392](https://github.com/apache/texera/blob/ead92e33a69d2f521b8cb84ae18077f86c3d390e/amber/src/main/scala/org/apache/texera/web/service/WorkflowService.scala#L389-L392)).
 The timeout, wait-error and null-service returns (L281, L290, L204) skip the 
span entirely. I'd move the body into a helper and set ERROR once when 
`!result.success`, which covers this catch too.



##########
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:
   **Advisory:**
   
   `SpanAttrs` is where span keys live, so every callsite uses the same names 
([SpanAttrs.scala:27-28](https://github.com/apache/texera/blob/ead92e33a69d2f521b8cb84ae18077f86c3d390e/common/observability/src/main/scala/org/apache/texera/observability/SpanAttrs.scala#L27-L28)).
 #9233 trimmed it to keys with a caller, and this is the first caller for these 
two. Adding `ComputingUnitId` and `OperatorCount` there lets the next span that 
tags a unit import the key instead of retyping it.



##########
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:
   **Advisory:**
   
   No test asserts this span's name, attributes, nesting or status. The testing 
section says amber didn't compile locally, so the listed spec run and Jaeger 
check didn't happen either. AGENTS.md asks a feature to land with a test, and a 
`SyncExecutionResourceSpec` case with an `InMemorySpanExporter` would have 
caught the L368 issue (amber needs `opentelemetry-sdk-testing` as a test 
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