joosthooz commented on a change in pull request #12609:
URL: https://github.com/apache/arrow/pull/12609#discussion_r838526243
##########
File path: cpp/src/arrow/util/future.cc
##########
@@ -242,7 +243,23 @@ class ConcreteFutureImpl : public FutureImpl {
void AddCallback(Callback callback, CallbackOptions opts) {
CheckOptions(opts);
std::unique_lock<std::mutex> lock(mutex_);
+#ifdef ARROW_WITH_OPENTELEMETRY
+ struct Wrapstruct {
+ void operator()(const FutureImpl& impl) {
+ auto scope =
::arrow::internal::tracing::GetTracer()->WithActiveSpan(activeSpan);
+ std::move(func)(impl);
+ }
+ Callback func;
+ opentelemetry::nostd::shared_ptr<opentelemetry::trace::Span> activeSpan;
Review comment:
ok, updated
##########
File path: cpp/src/arrow/util/thread_pool.cc
##########
@@ -58,6 +60,19 @@ SerialExecutor::~SerialExecutor() = default;
Status SerialExecutor::SpawnReal(TaskHints hints, FnOnce<void()> task,
StopToken stop_token, StopCallback&&
stop_callback) {
+#ifdef ARROW_WITH_OPENTELEMETRY
+ // Wrap the task to propagate a parent tracing span to it
+ struct {
+ void operator()() {
+ auto scope =
::arrow::internal::tracing::GetTracer()->WithActiveSpan(activeSpan);
+ std::move(func)();
+ }
+ FnOnce<void()> func;
+ opentelemetry::nostd::shared_ptr<opentelemetry::trace::Span> activeSpan;
Review comment:
ok, updated
--
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]