raulcd commented on code in PR #49383:
URL: https://github.com/apache/arrow/pull/49383#discussion_r2852364170


##########
cpp/src/arrow/flight/server_tracing_middleware.cc:
##########
@@ -136,7 +136,7 @@ class TracingServerMiddlewareFactory : public 
ServerMiddlewareFactory {
     options.kind = otel::trace::SpanKind::kServer;
     options.parent = otel::trace::GetSpan(new_otel_context)->GetContext();
 
-    auto tracer = 
otel::trace::Provider::GetTracerProvider()->GetTracer("arrow");
+    auto tracer = arrow::internal::tracing::GetTracer();

Review Comment:
   @lidavidm I am not entirely sure why this is necessary but using the example 
`middleware.py` enabling otel as updated below with a running server:
   ```
   $ export OTEL_SERVICE_NAME=arrow-raul
   $ ARROW_TRACING_BACKEND=otlp_http python examples/flight/middleware.py 
server --listen grpc://localhost:5050 --otel
   ```
   and client:
   ```
   python examples/flight/middleware.py  client grpc://localhost:5050
   ```
   I wasn't able to get traces unless I update this to use 
`arrow::internal::tracing::GetTracer`. Example of local traces with the built 
wheel and this changes:
   
   <img width="3433" height="489" alt="Image" 
src="https://github.com/user-attachments/assets/6c0a129f-10ac-48b3-81bd-ea7cbc26b76e";
 />
   
   Initially I thought it might be due to the addition of 
`CMAKE_INTERPROCEDURAL_OPTIMIZATION` to the wheels but I've validated is 
unrelated.
   
   Without this change I haven't been able to get opentelemetry traces using 
the `flight.TracingServerMiddlewareFactory`
   



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