You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/03/18 11:01:09 UTC

[GitHub] [arrow] joosthooz commented on a change in pull request #12609: ARROW-15067: [C++] Add tracing spans to the scanner

joosthooz commented on a change in pull request #12609:
URL: https://github.com/apache/arrow/pull/12609#discussion_r829896797



##########
File path: cpp/src/arrow/dataset/file_csv.cc
##########
@@ -167,9 +168,14 @@ static inline Result<csv::ReadOptions> GetReadOptions(
 static inline Future<std::shared_ptr<csv::StreamingReader>> OpenReaderAsync(
     const FileSource& source, const CsvFileFormat& format,
     const std::shared_ptr<ScanOptions>& scan_options, Executor* cpu_executor) {
+#ifdef ARROW_WITH_OPENTELEMETRY
+  auto tracer = arrow::internal::tracing::GetTracer();
+  auto span = tracer->StartSpan("arrow::dataset::CsvFileFormat::OpenReaderAsync");

Review comment:
       I'd like to, but it results in errors such as 
   ```
   arrow/cpp/src/arrow/dataset/file_csv.cc:205:7: error: use of deleted function ‘arrow::util::tracing::Span::Span(const arrow::util::tracing::Span&)’
     205 |       [=](const Status& err) -> Result<std::shared_ptr<csv::StreamingReader>> {
         |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     206 | #ifdef ARROW_WITH_OPENTELEMETRY
         | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     207 |         arrow::internal::tracing::MarkSpan(err, span.get());
         |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     208 |         span->End();
         |         ~~~~~~~~~~~~
     209 | #endif
         | ~~~~~~ 
     210 |         return err.WithMessage("Could not open CSV input source '", path, "': ", err);
         |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     211 |       });
         |       ~
   ```
   Because I need to create a span to use these macros:
   ```
   util::tracing::Span span;
     START_SPAN(span, "arrow::dataset::CsvFileFormat::OpenReaderAsync");
   ```
   This also happens in other places




-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org