diff --git a/be/cmake/thirdparty.cmake b/be/cmake/thirdparty.cmake index 5adf108ab6..4a83fdc92f 100644 --- a/be/cmake/thirdparty.cmake +++ b/be/cmake/thirdparty.cmake @@ -145,17 +145,6 @@ endif() add_thirdparty(minizip LIB64) add_thirdparty(simdjson LIB64) add_thirdparty(idn LIB64) -add_thirdparty(opentelemetry_common LIB64) -add_thirdparty(opentelemetry_exporter_zipkin_trace LIB64) -add_thirdparty(opentelemetry_resources LIB64) -add_thirdparty(opentelemetry_version LIB64) -add_thirdparty(opentelemetry_exporter_ostream_span LIB64) -add_thirdparty(opentelemetry_trace LIB64) -add_thirdparty(opentelemetry_http_client_curl LIB64) -add_thirdparty(opentelemetry_exporter_otlp_http LIB64) -add_thirdparty(opentelemetry_exporter_otlp_http_client LIB64) -add_thirdparty(opentelemetry_otlp_recordable LIB64) -add_thirdparty(opentelemetry_proto LIB64) add_thirdparty(xml2 LIB64) add_thirdparty(lzma LIB64) add_thirdparty(gsasl) diff --git a/be/src/common/config.cpp b/be/src/common/config.cpp index 0133a78ecf..b2d3f7bc66 100644 --- a/be/src/common/config.cpp +++ b/be/src/common/config.cpp @@ -815,27 +815,6 @@ DEFINE_String(function_service_protocol, "h2:grpc"); // use which load balancer to select server to connect DEFINE_String(rpc_load_balancer, "rr"); -// Enable tracing -// If this configuration is enabled, you should also specify the trace_export_url. -DEFINE_Bool(enable_tracing, "false"); - -// Enable opentelemtry collector -DEFINE_Bool(enable_otel_collector, "false"); - -// Current support for exporting traces: -// zipkin: Export traces directly to zipkin, which is used to enable the tracing feature quickly. -// collector: The collector can be used to receive and process traces and support export to a variety of -// third-party systems. -DEFINE_mString(trace_exporter, "zipkin"); -DEFINE_Validator(trace_exporter, [](const std::string& config) -> bool { - return config == "zipkin" || config == "collector"; -}); - -// The endpoint to export spans to. -// export to zipkin like: http://127.0.0.1:9411/api/v2/spans -// export to collector like: http://127.0.0.1:4318/v1/traces -DEFINE_String(trace_export_url, "http://127.0.0.1:9411/api/v2/spans"); - // The maximum buffer/queue size to collect span. After the size is reached, spans are dropped. // An export will be triggered when the number of spans in the queue reaches half of the maximum. DEFINE_Int32(max_span_queue_size, "2048"); diff --git a/be/src/common/config.h b/be/src/common/config.h index d9276aef9a..14fa716ca3 100644 --- a/be/src/common/config.h +++ b/be/src/common/config.h @@ -873,24 +873,6 @@ DECLARE_String(function_service_protocol); // use which load balancer to select server to connect DECLARE_String(rpc_load_balancer); -// Enable tracing -// If this configuration is enabled, you should also specify the trace_export_url. -DECLARE_Bool(enable_tracing); - -// Enable opentelemtry collector -DECLARE_Bool(enable_otel_collector); - -// Current support for exporting traces: -// zipkin: Export traces directly to zipkin, which is used to enable the tracing feature quickly. -// collector: The collector can be used to receive and process traces and support export to a variety of -// third-party systems. -DECLARE_mString(trace_exporter); - -// The endpoint to export spans to. -// export to zipkin like: http://127.0.0.1:9411/api/v2/spans -// export to collector like: http://127.0.0.1:4318/v1/traces -DECLARE_String(trace_export_url); - // The maximum buffer/queue size to collect span. After the size is reached, spans are dropped. // An export will be triggered when the number of spans in the queue reaches half of the maximum. DECLARE_Int32(max_span_queue_size); diff --git a/be/src/common/status.h b/be/src/common/status.h index 512afa88fe..e8af89706c 100644 --- a/be/src/common/status.h +++ b/be/src/common/status.h @@ -16,7 +16,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #ifdef ENABLE_STACKTRACE #include "util/stack_util.h" diff --git a/be/src/exec/data_sink.h b/be/src/exec/data_sink.h index 89f29b5899..285653c43b 100644 --- a/be/src/exec/data_sink.h +++ b/be/src/exec/data_sink.h @@ -20,9 +20,8 @@ #pragma once -#include #include -// IWYU pragma: no_include + #include #include #include @@ -30,7 +29,6 @@ #include "common/status.h" #include "runtime/descriptors.h" #include "util/runtime_profile.h" -#include "util/telemetry/telemetry.h" namespace doris { @@ -84,7 +82,6 @@ public: // It must be okay to call this multiple times. Subsequent calls should // be ignored. virtual Status close(RuntimeState* state, Status exec_status) { - profile()->add_to_span(_span); _closed = true; return Status::OK(); } @@ -129,8 +126,6 @@ protected: // Maybe this will be transferred to BufferControlBlock. std::shared_ptr _query_statistics; - - OpentelemetrySpan _span {}; }; } // namespace doris diff --git a/be/src/exec/exec_node.cpp b/be/src/exec/exec_node.cpp index ed2c54a070..c416420ef2 100644 --- a/be/src/exec/exec_node.cpp +++ b/be/src/exec/exec_node.cpp @@ -29,7 +29,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "common/config.h" #include "common/logging.h" @@ -127,9 +126,6 @@ Status ExecNode::init(const TPlanNode& tnode, RuntimeState* state) { Status ExecNode::prepare(RuntimeState* state) { DCHECK(_runtime_profile.get() != nullptr); - _span = state->get_tracer()->StartSpan(get_name()); - OpentelemetryScope scope {_span}; - _exec_timer = ADD_TIMER_WITH_LEVEL(runtime_profile(), "ExecTime", 1); _rows_returned_counter = ADD_COUNTER_WITH_LEVEL(_runtime_profile, "RowsReturned", TUnit::UNIT, 1); @@ -201,7 +197,6 @@ void ExecNode::release_resource(doris::RuntimeState* state) { COUNTER_SET(_rows_returned_counter, _num_rows_returned); } - runtime_profile()->add_to_span(_span); _is_resource_released = true; } } diff --git a/be/src/exec/exec_node.h b/be/src/exec/exec_node.h index d4d90546ff..f5f918731f 100644 --- a/be/src/exec/exec_node.h +++ b/be/src/exec/exec_node.h @@ -36,7 +36,6 @@ #include "common/status.h" #include "runtime/descriptors.h" #include "util/runtime_profile.h" -#include "util/telemetry/telemetry.h" #include "vec/core/block.h" #include "vec/exprs/vexpr_fwd.h" @@ -231,8 +230,6 @@ public: MemTracker* mem_tracker() const { return _mem_tracker.get(); } - OpentelemetrySpan get_next_span() { return _span; } - virtual std::string get_name(); // Names of counters shared by all exec nodes @@ -289,9 +286,6 @@ protected: // Account for peak memory used by this node RuntimeProfile::Counter* _peak_memory_usage_counter; - // - OpentelemetrySpan _span; - //NOTICE: now add a faker profile, because sometimes the profile record is useless //so we want remove some counters and timers, eg: in join node, if it's broadcast_join //and shared hash table, some counter/timer about build hash table is useless, diff --git a/be/src/exprs/json_functions.cpp b/be/src/exprs/json_functions.cpp index fe97d8344c..ace18f1090 100644 --- a/be/src/exprs/json_functions.cpp +++ b/be/src/exprs/json_functions.cpp @@ -34,7 +34,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "common/logging.h" diff --git a/be/src/exprs/math_functions.cpp b/be/src/exprs/math_functions.cpp index bbfdc6053d..202a6eabea 100644 --- a/be/src/exprs/math_functions.cpp +++ b/be/src/exprs/math_functions.cpp @@ -23,7 +23,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep // IWYU pragma: no_include #include diff --git a/be/src/io/cache/block/block_lru_file_cache.cpp b/be/src/io/cache/block/block_lru_file_cache.cpp index 0578c82e34..9d81e5c539 100644 --- a/be/src/io/cache/block/block_lru_file_cache.cpp +++ b/be/src/io/cache/block/block_lru_file_cache.cpp @@ -27,7 +27,6 @@ #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep // IWYU pragma: no_include #include // IWYU pragma: keep diff --git a/be/src/io/cache/block/cached_remote_file_reader.cpp b/be/src/io/cache/block/cached_remote_file_reader.cpp index fd19f88af6..bbd7516dfa 100644 --- a/be/src/io/cache/block/cached_remote_file_reader.cpp +++ b/be/src/io/cache/block/cached_remote_file_reader.cpp @@ -26,7 +26,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "common/config.h" #include "io/cache/block/block_file_cache.h" diff --git a/be/src/io/fs/broker_file_reader.cpp b/be/src/io/fs/broker_file_reader.cpp index 3953d20fff..4d370cfb4d 100644 --- a/be/src/io/fs/broker_file_reader.cpp +++ b/be/src/io/fs/broker_file_reader.cpp @@ -28,7 +28,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "common/logging.h" #include "common/status.h" diff --git a/be/src/io/fs/buffered_reader.cpp b/be/src/io/fs/buffered_reader.cpp index 0c4496fd3a..f32e8a3454 100644 --- a/be/src/io/fs/buffered_reader.cpp +++ b/be/src/io/fs/buffered_reader.cpp @@ -24,7 +24,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "common/config.h" #include "common/status.h" diff --git a/be/src/io/fs/hdfs_file_reader.cpp b/be/src/io/fs/hdfs_file_reader.cpp index 0ea9c43015..f37b8551a7 100644 --- a/be/src/io/fs/hdfs_file_reader.cpp +++ b/be/src/io/fs/hdfs_file_reader.cpp @@ -24,7 +24,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "common/logging.h" #include "io/fs/err_utils.h" diff --git a/be/src/io/fs/local_file_reader.cpp b/be/src/io/fs/local_file_reader.cpp index 587a6cb9b5..bca5d815a0 100644 --- a/be/src/io/fs/local_file_reader.cpp +++ b/be/src/io/fs/local_file_reader.cpp @@ -30,7 +30,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "io/fs/err_utils.h" #include "util/async_io.h" diff --git a/be/src/io/fs/local_file_writer.cpp b/be/src/io/fs/local_file_writer.cpp index 9ebdfebe36..af913d60a9 100644 --- a/be/src/io/fs/local_file_writer.cpp +++ b/be/src/io/fs/local_file_writer.cpp @@ -32,7 +32,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "common/status.h" #include "gutil/macros.h" diff --git a/be/src/io/fs/s3_file_reader.cpp b/be/src/io/fs/s3_file_reader.cpp index 2116ed3555..417d2a15f0 100644 --- a/be/src/io/fs/s3_file_reader.cpp +++ b/be/src/io/fs/s3_file_reader.cpp @@ -30,8 +30,6 @@ #include #include -// IWYU pragma: no_include - #include "common/compiler_util.h" // IWYU pragma: keep #include "io/fs/s3_common.h" #include "util/doris_metrics.h" diff --git a/be/src/io/fs/s3_file_system.cpp b/be/src/io/fs/s3_file_system.cpp index 2c3869b28e..9b4e447c56 100644 --- a/be/src/io/fs/s3_file_system.cpp +++ b/be/src/io/fs/s3_file_system.cpp @@ -54,7 +54,6 @@ #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep // IWYU pragma: no_include #include // IWYU pragma: keep diff --git a/be/src/io/fs/stream_load_pipe.cpp b/be/src/io/fs/stream_load_pipe.cpp index 00fa038f98..f93926d612 100644 --- a/be/src/io/fs/stream_load_pipe.cpp +++ b/be/src/io/fs/stream_load_pipe.cpp @@ -23,7 +23,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "common/status.h" #include "runtime/exec_env.h" diff --git a/be/src/olap/cold_data_compaction.cpp b/be/src/olap/cold_data_compaction.cpp index fc3f7569aa..06d6b27f9e 100644 --- a/be/src/olap/cold_data_compaction.cpp +++ b/be/src/olap/cold_data_compaction.cpp @@ -26,7 +26,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "common/config.h" #include "olap/compaction.h" diff --git a/be/src/olap/delta_writer.cpp b/be/src/olap/delta_writer.cpp index 3e91e5efb0..c78f7814c0 100644 --- a/be/src/olap/delta_writer.cpp +++ b/be/src/olap/delta_writer.cpp @@ -28,7 +28,6 @@ #include #include -// IWYU pragma: no_include #include "cloud/config.h" #include "common/compiler_util.h" // IWYU pragma: keep #include "common/config.h" diff --git a/be/src/olap/delta_writer_v2.cpp b/be/src/olap/delta_writer_v2.cpp index 52e22d84b6..c87cf7510a 100644 --- a/be/src/olap/delta_writer_v2.cpp +++ b/be/src/olap/delta_writer_v2.cpp @@ -28,7 +28,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "common/config.h" #include "common/logging.h" diff --git a/be/src/olap/memtable_writer.cpp b/be/src/olap/memtable_writer.cpp index 2ef704f075..bd81fcd785 100644 --- a/be/src/olap/memtable_writer.cpp +++ b/be/src/olap/memtable_writer.cpp @@ -24,7 +24,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "common/config.h" #include "common/logging.h" diff --git a/be/src/olap/primary_key_index.cpp b/be/src/olap/primary_key_index.cpp index 3b8fea52a8..cc39441220 100644 --- a/be/src/olap/primary_key_index.cpp +++ b/be/src/olap/primary_key_index.cpp @@ -21,7 +21,6 @@ #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "common/config.h" #include "io/fs/file_writer.h" diff --git a/be/src/olap/push_handler.cpp b/be/src/olap/push_handler.cpp index ee62c5baf6..f2de44c304 100644 --- a/be/src/olap/push_handler.cpp +++ b/be/src/olap/push_handler.cpp @@ -35,7 +35,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "common/config.h" #include "common/logging.h" diff --git a/be/src/olap/reader.cpp b/be/src/olap/reader.cpp index 41b44d44fd..e98b56a0fc 100644 --- a/be/src/olap/reader.cpp +++ b/be/src/olap/reader.cpp @@ -28,7 +28,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "common/config.h" #include "common/logging.h" diff --git a/be/src/olap/rowset/beta_rowset_writer.cpp b/be/src/olap/rowset/beta_rowset_writer.cpp index e62ff6b33a..f3db8689a3 100644 --- a/be/src/olap/rowset/beta_rowset_writer.cpp +++ b/be/src/olap/rowset/beta_rowset_writer.cpp @@ -28,7 +28,6 @@ #include #include -// IWYU pragma: no_include #include "cloud/config.h" #include "common/compiler_util.h" // IWYU pragma: keep #include "common/config.h" diff --git a/be/src/olap/rowset/beta_rowset_writer_v2.cpp b/be/src/olap/rowset/beta_rowset_writer_v2.cpp index d201ba4044..da3e4bc886 100644 --- a/be/src/olap/rowset/beta_rowset_writer_v2.cpp +++ b/be/src/olap/rowset/beta_rowset_writer_v2.cpp @@ -28,7 +28,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "common/config.h" #include "common/logging.h" diff --git a/be/src/olap/rowset/segcompaction.cpp b/be/src/olap/rowset/segcompaction.cpp index eabf0e830d..21bfcf0da8 100644 --- a/be/src/olap/rowset/segcompaction.cpp +++ b/be/src/olap/rowset/segcompaction.cpp @@ -33,7 +33,6 @@ #include #include "beta_rowset_writer.h" -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "common/logging.h" #include "gutil/stringprintf.h" diff --git a/be/src/olap/rowset/segment_creator.cpp b/be/src/olap/rowset/segment_creator.cpp index c55464783b..15002350f7 100644 --- a/be/src/olap/rowset/segment_creator.cpp +++ b/be/src/olap/rowset/segment_creator.cpp @@ -24,7 +24,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "common/config.h" #include "common/logging.h" diff --git a/be/src/olap/rowset/segment_v2/binary_dict_page.cpp b/be/src/olap/rowset/segment_v2/binary_dict_page.cpp index 69d92f5ede..ff61f1a392 100644 --- a/be/src/olap/rowset/segment_v2/binary_dict_page.cpp +++ b/be/src/olap/rowset/segment_v2/binary_dict_page.cpp @@ -23,7 +23,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "common/logging.h" #include "common/status.h" diff --git a/be/src/olap/rowset/segment_v2/bitshuffle_page.h b/be/src/olap/rowset/segment_v2/bitshuffle_page.h index 54f446070f..89180c2cd1 100644 --- a/be/src/olap/rowset/segment_v2/bitshuffle_page.h +++ b/be/src/olap/rowset/segment_v2/bitshuffle_page.h @@ -24,7 +24,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "common/status.h" #include "gutil/port.h" diff --git a/be/src/olap/rowset/segment_v2/column_reader.cpp b/be/src/olap/rowset/segment_v2/column_reader.cpp index 3c02181573..34659211ba 100644 --- a/be/src/olap/rowset/segment_v2/column_reader.cpp +++ b/be/src/olap/rowset/segment_v2/column_reader.cpp @@ -25,7 +25,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "common/status.h" #include "io/fs/file_reader.h" diff --git a/be/src/olap/rowset/segment_v2/segment_iterator.cpp b/be/src/olap/rowset/segment_v2/segment_iterator.cpp index a86d168144..4e4f4a4601 100644 --- a/be/src/olap/rowset/segment_v2/segment_iterator.cpp +++ b/be/src/olap/rowset/segment_v2/segment_iterator.cpp @@ -30,7 +30,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "common/config.h" #include "common/consts.h" diff --git a/be/src/olap/rowset/segment_v2/segment_writer.cpp b/be/src/olap/rowset/segment_v2/segment_writer.cpp index 8903902692..993c2876cd 100644 --- a/be/src/olap/rowset/segment_v2/segment_writer.cpp +++ b/be/src/olap/rowset/segment_v2/segment_writer.cpp @@ -26,7 +26,6 @@ #include #include -// IWYU pragma: no_include #include "cloud/config.h" #include "common/compiler_util.h" // IWYU pragma: keep #include "common/config.h" diff --git a/be/src/olap/rowset/vertical_beta_rowset_writer.cpp b/be/src/olap/rowset/vertical_beta_rowset_writer.cpp index 59c1afc930..cd9fee5fb4 100644 --- a/be/src/olap/rowset/vertical_beta_rowset_writer.cpp +++ b/be/src/olap/rowset/vertical_beta_rowset_writer.cpp @@ -27,7 +27,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "common/logging.h" #include "io/fs/file_system.h" diff --git a/be/src/olap/rowset_builder.cpp b/be/src/olap/rowset_builder.cpp index 894a782883..e15f6d7054 100644 --- a/be/src/olap/rowset_builder.cpp +++ b/be/src/olap/rowset_builder.cpp @@ -26,7 +26,6 @@ #include #include -// IWYU pragma: no_include #include "cloud/config.h" #include "common/compiler_util.h" // IWYU pragma: keep #include "common/config.h" diff --git a/be/src/olap/tablet.cpp b/be/src/olap/tablet.cpp index d58183a006..746a917a80 100644 --- a/be/src/olap/tablet.cpp +++ b/be/src/olap/tablet.cpp @@ -40,7 +40,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep // IWYU pragma: no_include #include // IWYU pragma: keep diff --git a/be/src/olap/tablet_manager.cpp b/be/src/olap/tablet_manager.cpp index e1d5de5204..3ed08edd9e 100644 --- a/be/src/olap/tablet_manager.cpp +++ b/be/src/olap/tablet_manager.cpp @@ -32,7 +32,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "common/config.h" #include "common/logging.h" diff --git a/be/src/olap/tablet_schema.cpp b/be/src/olap/tablet_schema.cpp index 7b7f5461b8..2bbe0d498a 100644 --- a/be/src/olap/tablet_schema.cpp +++ b/be/src/olap/tablet_schema.cpp @@ -27,7 +27,6 @@ #include // IWYU pragma: keep #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "common/consts.h" #include "common/status.h" diff --git a/be/src/olap/types.cpp b/be/src/olap/types.cpp index 5ed7984bcc..b9a072cc5d 100644 --- a/be/src/olap/types.cpp +++ b/be/src/olap/types.cpp @@ -21,7 +21,6 @@ #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "olap/tablet_schema.h" diff --git a/be/src/pch/pch.h b/be/src/pch/pch.h index eb404a78c8..34428d739d 100644 --- a/be/src/pch/pch.h +++ b/be/src/pch/pch.h @@ -268,39 +268,6 @@ #include #include -// opentelemetry headers -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - // parallel_hashmap headers #include #include diff --git a/be/src/pipeline/exec/olap_scan_operator.cpp b/be/src/pipeline/exec/olap_scan_operator.cpp index 785e2c0aa1..224a58659f 100644 --- a/be/src/pipeline/exec/olap_scan_operator.cpp +++ b/be/src/pipeline/exec/olap_scan_operator.cpp @@ -219,7 +219,6 @@ Status OlapScanLocalState::_init_scanners(std::list* s return Status::OK(); } SCOPED_TIMER(_scanner_init_timer); - auto span = opentelemetry::trace::Tracer::GetCurrentSpan(); if (!_conjuncts.empty()) { std::string message; @@ -310,7 +309,6 @@ void OlapScanLocalState::set_scan_ranges(RuntimeState* state, _scan_ranges.emplace_back(new TPaloScanRange(scan_range.scan_range.palo_scan_range)); // COUNTER_UPDATE(_tablet_counter, 1); } - // telemetry::set_current_span_attribute(_tablet_counter); } static std::string olap_filter_to_string(const doris::TCondition& condition) { diff --git a/be/src/pipeline/exec/streaming_aggregation_sink_operator.cpp b/be/src/pipeline/exec/streaming_aggregation_sink_operator.cpp index 9d8292c558..3052222e24 100644 --- a/be/src/pipeline/exec/streaming_aggregation_sink_operator.cpp +++ b/be/src/pipeline/exec/streaming_aggregation_sink_operator.cpp @@ -21,7 +21,6 @@ #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "pipeline/exec/data_queue.h" #include "pipeline/exec/operator.h" diff --git a/be/src/pipeline/exec/union_sink_operator.cpp b/be/src/pipeline/exec/union_sink_operator.cpp index db43869a77..2a235123bd 100644 --- a/be/src/pipeline/exec/union_sink_operator.cpp +++ b/be/src/pipeline/exec/union_sink_operator.cpp @@ -19,7 +19,6 @@ #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "common/status.h" #include "pipeline/exec/data_queue.h" diff --git a/be/src/pipeline/pipeline_fragment_context.cpp b/be/src/pipeline/pipeline_fragment_context.cpp index 62bc3ca8de..02b991a7aa 100644 --- a/be/src/pipeline/pipeline_fragment_context.cpp +++ b/be/src/pipeline/pipeline_fragment_context.cpp @@ -21,10 +21,6 @@ #include #include #include -#include -#include -#include -#include #include #include // IWYU pragma: no_include @@ -99,7 +95,6 @@ #include "task_scheduler.h" #include "util/container_util.hpp" #include "util/debug_util.h" -#include "util/telemetry/telemetry.h" #include "util/uid_util.h" #include "vec/common/assert_cast.h" #include "vec/exec/join/vhash_join_node.h" @@ -211,10 +206,6 @@ Status PipelineFragmentContext::prepare(const doris::TPipelineFragmentParams& re SCOPED_TIMER(_prepare_timer); auto* fragment_context = this; - OpentelemetryTracer tracer = telemetry::get_noop_tracer(); - if (opentelemetry::trace::Tracer::GetCurrentSpan()->GetContext().IsValid()) { - tracer = telemetry::get_tracer(print_id(_query_id)); - } LOG_INFO("Preparing instance {}, backend_num {}", PrintInstanceStandardInfo(_query_id, local_params.fragment_instance_id), @@ -229,7 +220,6 @@ Status PipelineFragmentContext::prepare(const doris::TPipelineFragmentParams& re } _runtime_state->set_query_ctx(_query_ctx.get()); _runtime_state->set_query_mem_tracker(_query_ctx->query_mem_tracker); - _runtime_state->set_tracer(std::move(tracer)); // TODO should be combine with plan_fragment_executor.prepare funciton SCOPED_ATTACH_TASK(_runtime_state.get()); diff --git a/be/src/pipeline/pipeline_x/operator.cpp b/be/src/pipeline/pipeline_x/operator.cpp index 8a9910514f..f8430a5715 100644 --- a/be/src/pipeline/pipeline_x/operator.cpp +++ b/be/src/pipeline/pipeline_x/operator.cpp @@ -380,7 +380,6 @@ Status PipelineXLocalState::close(RuntimeState* state) { if (_rows_returned_counter != nullptr) { COUNTER_SET(_rows_returned_counter, _num_rows_returned); } - profile()->add_to_span(_span); _closed = true; return Status::OK(); } diff --git a/be/src/pipeline/pipeline_x/operator.h b/be/src/pipeline/pipeline_x/operator.h index 5691d989e4..265579bfaa 100644 --- a/be/src/pipeline/pipeline_x/operator.h +++ b/be/src/pipeline/pipeline_x/operator.h @@ -126,7 +126,6 @@ protected: RuntimeProfile::Counter* _open_timer = nullptr; RuntimeProfile::Counter* _close_timer = nullptr; - OpentelemetrySpan _span; OperatorXBase* _parent; RuntimeState* _state; vectorized::VExprContextSPtrs _conjuncts; diff --git a/be/src/pipeline/pipeline_x/pipeline_x_fragment_context.cpp b/be/src/pipeline/pipeline_x/pipeline_x_fragment_context.cpp index fee49621f0..aa02970971 100644 --- a/be/src/pipeline/pipeline_x/pipeline_x_fragment_context.cpp +++ b/be/src/pipeline/pipeline_x/pipeline_x_fragment_context.cpp @@ -21,10 +21,6 @@ #include #include #include -#include -#include -#include -#include #include #include #include @@ -97,7 +93,6 @@ #include "service/backend_options.h" #include "util/container_util.hpp" #include "util/debug_util.h" -#include "util/telemetry/telemetry.h" #include "util/uid_util.h" #include "vec/common/assert_cast.h" #include "vec/runtime/vdata_stream_mgr.h" @@ -166,10 +161,6 @@ Status PipelineXFragmentContext::prepare(const doris::TPipelineFragmentParams& r SCOPED_TIMER(_prepare_timer); auto* fragment_context = this; - OpentelemetryTracer tracer = telemetry::get_noop_tracer(); - if (opentelemetry::trace::Tracer::GetCurrentSpan()->GetContext().IsValid()) { - tracer = telemetry::get_tracer(print_id(_query_id)); - } LOG_INFO("PipelineXFragmentContext::prepare") .tag("query_id", print_id(_query_id)) @@ -186,7 +177,6 @@ Status PipelineXFragmentContext::prepare(const doris::TPipelineFragmentParams& r _exec_env); _runtime_state->set_query_ctx(_query_ctx.get()); _runtime_state->set_query_mem_tracker(_query_ctx->query_mem_tracker); - _runtime_state->set_tracer(std::move(tracer)); SCOPED_ATTACH_TASK(_runtime_state.get()); if (request.__isset.backend_id) { @@ -400,7 +390,6 @@ Status PipelineXFragmentContext::_build_pipeline_tasks( } _runtime_states[i]->set_query_ctx(_query_ctx.get()); _runtime_states[i]->set_query_mem_tracker(_query_ctx->query_mem_tracker); - _runtime_states[i]->set_tracer(_runtime_state->get_tracer()); static_cast(_runtime_states[i]->runtime_filter_mgr()->init()); _runtime_states[i]->set_be_number(local_params.backend_num); diff --git a/be/src/runtime/descriptors.h b/be/src/runtime/descriptors.h index f77f5fec3b..fbd233a18d 100644 --- a/be/src/runtime/descriptors.h +++ b/be/src/runtime/descriptors.h @@ -32,7 +32,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "common/global_types.h" #include "common/status.h" diff --git a/be/src/runtime/fold_constant_executor.cpp b/be/src/runtime/fold_constant_executor.cpp index c3dd21406e..43319507ab 100644 --- a/be/src/runtime/fold_constant_executor.cpp +++ b/be/src/runtime/fold_constant_executor.cpp @@ -32,7 +32,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "common/status.h" #include "runtime/decimalv2_value.h" diff --git a/be/src/runtime/fragment_mgr.cpp b/be/src/runtime/fragment_mgr.cpp index 266c652ca7..e4b703e792 100644 --- a/be/src/runtime/fragment_mgr.cpp +++ b/be/src/runtime/fragment_mgr.cpp @@ -31,9 +31,6 @@ #include #include #include -#include -#include -#include #include #include #include @@ -58,7 +55,6 @@ #include "common/utils.h" #include "gutil/strings/substitute.h" #include "io/fs/stream_load_pipe.h" -#include "opentelemetry/trace/scope.h" #include "pipeline/pipeline_fragment_context.h" #include "runtime/client_cache.h" #include "runtime/descriptors.h" @@ -85,7 +81,6 @@ #include "util/network_util.h" #include "util/pretty_printer.h" #include "util/runtime_profile.h" -#include "util/telemetry/telemetry.h" #include "util/thread.h" #include "util/threadpool.h" #include "util/thrift_util.h" @@ -725,12 +720,6 @@ Status FragmentMgr::_get_query_ctx(const Params& params, TUniqueId query_id, boo Status FragmentMgr::exec_plan_fragment(const TExecPlanFragmentParams& params, const FinishCallback& cb) { - auto tracer = telemetry::is_current_span_valid() ? telemetry::get_tracer("tracer") - : telemetry::get_noop_tracer(); - auto cur_span = opentelemetry::trace::Tracer::GetCurrentSpan(); - cur_span->SetAttribute("query_id", print_id(params.params.query_id)); - cur_span->SetAttribute("instance_id", print_id(params.params.fragment_instance_id)); - VLOG_ROW << "exec_plan_fragment params is " << apache::thrift::ThriftDebugString(params).c_str(); // sometimes TExecPlanFragmentParams debug string is too long and glog @@ -790,11 +779,7 @@ Status FragmentMgr::exec_plan_fragment(const TExecPlanFragmentParams& params, _cv.notify_all(); } auto st = _thread_pool->submit_func( - [this, fragment_executor, cb, - parent_span = opentelemetry::trace::Tracer::GetCurrentSpan()] { - OpentelemetryScope scope {parent_span}; - _exec_actual(fragment_executor, cb); - }); + [this, fragment_executor, cb] { _exec_actual(fragment_executor, cb); }); if (!st.ok()) { { // Remove the exec state added @@ -814,11 +799,6 @@ Status FragmentMgr::exec_plan_fragment(const TExecPlanFragmentParams& params, Status FragmentMgr::exec_plan_fragment(const TPipelineFragmentParams& params, const FinishCallback& cb) { - auto tracer = telemetry::is_current_span_valid() ? telemetry::get_tracer("tracer") - : telemetry::get_noop_tracer(); - auto cur_span = opentelemetry::trace::Tracer::GetCurrentSpan(); - cur_span->SetAttribute("query_id", print_id(params.query_id)); - VLOG_ROW << "query: " << print_id(params.query_id) << " exec_plan_fragment params is " << apache::thrift::ThriftDebugString(params).c_str(); // sometimes TExecPlanFragmentParams debug string is too long and glog @@ -867,8 +847,6 @@ Status FragmentMgr::exec_plan_fragment(const TPipelineFragmentParams& params, } query_ctx->fragment_instance_ids.push_back(fragment_instance_id); } - START_AND_SCOPE_SPAN(tracer, span, "exec_instance"); - span->SetAttribute("instance_id", print_id(fragment_instance_id)); if (!params.__isset.need_wait_execution_trigger || !params.need_wait_execution_trigger) { @@ -904,8 +882,6 @@ Status FragmentMgr::exec_plan_fragment(const TPipelineFragmentParams& params, } query_ctx->fragment_instance_ids.push_back(fragment_instance_id); } - START_AND_SCOPE_SPAN(tracer, span, "exec_instance"); - span->SetAttribute("instance_id", print_id(fragment_instance_id)); int64_t duration_ns = 0; if (!params.__isset.need_wait_execution_trigger || diff --git a/be/src/runtime/load_channel_mgr.h b/be/src/runtime/load_channel_mgr.h index a77c0b0cc2..d34cb69a9e 100644 --- a/be/src/runtime/load_channel_mgr.h +++ b/be/src/runtime/load_channel_mgr.h @@ -27,7 +27,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "common/status.h" #include "gutil/ref_counted.h" diff --git a/be/src/runtime/load_path_mgr.cpp b/be/src/runtime/load_path_mgr.cpp index 2ae43934df..f961fa9b7e 100644 --- a/be/src/runtime/load_path_mgr.cpp +++ b/be/src/runtime/load_path_mgr.cpp @@ -27,7 +27,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep // IWYU pragma: no_include #include // IWYU pragma: keep diff --git a/be/src/runtime/load_stream.h b/be/src/runtime/load_stream.h index 1c16c086e2..7ecf265450 100644 --- a/be/src/runtime/load_stream.h +++ b/be/src/runtime/load_stream.h @@ -18,6 +18,7 @@ #pragma once #include +#include #include #include @@ -25,8 +26,6 @@ #include #include #include -// IWYU pragma: no_include -#include #include "brpc/stream.h" #include "butil/iobuf.h" diff --git a/be/src/runtime/load_stream_mgr.h b/be/src/runtime/load_stream_mgr.h index 30d4ed069c..debdd2f2fb 100644 --- a/be/src/runtime/load_stream_mgr.h +++ b/be/src/runtime/load_stream_mgr.h @@ -18,6 +18,7 @@ #pragma once #include +#include #include #include @@ -25,8 +26,6 @@ #include #include #include -// IWYU pragma: no_include -#include #include "common/compiler_util.h" // IWYU pragma: keep #include "common/status.h" diff --git a/be/src/runtime/load_stream_writer.cpp b/be/src/runtime/load_stream_writer.cpp index 504e02fb3b..e7fe9abdcf 100644 --- a/be/src/runtime/load_stream_writer.cpp +++ b/be/src/runtime/load_stream_writer.cpp @@ -28,7 +28,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "common/config.h" #include "common/logging.h" diff --git a/be/src/runtime/memory/jemalloc_hook.cpp b/be/src/runtime/memory/jemalloc_hook.cpp index ec40879e4b..2529244425 100644 --- a/be/src/runtime/memory/jemalloc_hook.cpp +++ b/be/src/runtime/memory/jemalloc_hook.cpp @@ -19,7 +19,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "jemalloc/jemalloc.h" #include "runtime/thread_context.h" diff --git a/be/src/runtime/memory/mem_tracker.h b/be/src/runtime/memory/mem_tracker.h index 94d8360157..8af83d299f 100644 --- a/be/src/runtime/memory/mem_tracker.h +++ b/be/src/runtime/memory/mem_tracker.h @@ -31,7 +31,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "util/pretty_printer.h" diff --git a/be/src/runtime/plan_fragment_executor.cpp b/be/src/runtime/plan_fragment_executor.cpp index 39277c1a42..9327f96a5d 100644 --- a/be/src/runtime/plan_fragment_executor.cpp +++ b/be/src/runtime/plan_fragment_executor.cpp @@ -24,10 +24,6 @@ #include #include #include -#include -#include -#include -#include #include #include #include @@ -59,7 +55,6 @@ #include "util/debug_util.h" #include "util/defer_op.h" #include "util/pretty_printer.h" -#include "util/telemetry/telemetry.h" #include "util/threadpool.h" #include "util/time.h" #include "util/uid_util.h" @@ -116,12 +111,6 @@ PlanFragmentExecutor::~PlanFragmentExecutor() { } Status PlanFragmentExecutor::prepare(const TExecPlanFragmentParams& request) { - OpentelemetryTracer tracer = telemetry::get_noop_tracer(); - if (opentelemetry::trace::Tracer::GetCurrentSpan()->GetContext().IsValid()) { - tracer = telemetry::get_tracer(print_id(_query_ctx->query_id())); - } - _span = tracer->StartSpan("Plan_fragment_executor"); - OpentelemetryScope scope {_span}; if (request.__isset.query_options) { _timeout_second = request.query_options.execution_timeout; } @@ -140,7 +129,6 @@ Status PlanFragmentExecutor::prepare(const TExecPlanFragmentParams& request) { RuntimeState::create_unique(params, request.query_options, query_globals, _exec_env); _runtime_state->set_query_ctx(_query_ctx.get()); _runtime_state->set_query_mem_tracker(_query_ctx->query_mem_tracker); - _runtime_state->set_tracer(std::move(tracer)); SCOPED_ATTACH_TASK(_runtime_state.get()); static_cast(_runtime_state->runtime_filter_mgr()->init()); @@ -429,7 +417,6 @@ Status PlanFragmentExecutor::execute() { int64_t duration_ns = 0; { SCOPED_RAW_TIMER(&duration_ns); - opentelemetry::trace::Tracer::GetCurrentSpan()->AddEvent("start executing Fragment"); Status st = open(); WARN_IF_ERROR(st, strings::Substitute("Got error while opening fragment $0, query id: $1", print_id(_fragment_instance_id), @@ -688,7 +675,6 @@ void PlanFragmentExecutor::close() { } } - profile()->add_to_span(_span); _closed = true; } diff --git a/be/src/runtime/plan_fragment_executor.h b/be/src/runtime/plan_fragment_executor.h index 5426626da3..6a73646f52 100644 --- a/be/src/runtime/plan_fragment_executor.h +++ b/be/src/runtime/plan_fragment_executor.h @@ -240,8 +240,6 @@ private: PPlanFragmentCancelReason _cancel_reason; std::string _cancel_msg; - OpentelemetrySpan _span; - bool _group_commit = false; DescriptorTbl* _desc_tbl; diff --git a/be/src/runtime/routine_load/routine_load_task_executor.cpp b/be/src/runtime/routine_load/routine_load_task_executor.cpp index c9769b43b4..ca43ee055c 100644 --- a/be/src/runtime/routine_load/routine_load_task_executor.cpp +++ b/be/src/runtime/routine_load/routine_load_task_executor.cpp @@ -33,7 +33,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "common/config.h" #include "common/logging.h" diff --git a/be/src/runtime/runtime_predicate.cpp b/be/src/runtime/runtime_predicate.cpp index 2b949fb10e..a16984ae70 100644 --- a/be/src/runtime/runtime_predicate.cpp +++ b/be/src/runtime/runtime_predicate.cpp @@ -21,7 +21,6 @@ #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "olap/accept_null_predicate.h" #include "olap/column_predicate.h" diff --git a/be/src/runtime/runtime_state.h b/be/src/runtime/runtime_state.h index e990540d2f..aae2fb3cce 100644 --- a/be/src/runtime/runtime_state.h +++ b/be/src/runtime/runtime_state.h @@ -35,14 +35,12 @@ #include #include "cctz/time_zone.h" -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "common/factory_creator.h" #include "common/status.h" #include "gutil/integral_types.h" #include "util/debug_util.h" #include "util/runtime_profile.h" -#include "util/telemetry/telemetry.h" namespace doris { @@ -429,10 +427,6 @@ public: _query_mem_tracker = tracker; } - OpentelemetryTracer get_tracer() { return _tracer; } - - void set_tracer(OpentelemetryTracer&& tracer) { _tracer = std::move(tracer); } - bool enable_profile() const { return _query_options.__isset.enable_profile && _query_options.enable_profile; } @@ -607,8 +601,6 @@ private: // true if max_filter_ratio is 0 bool _load_zero_tolerance = false; - OpentelemetryTracer _tracer = telemetry::get_noop_tracer(); - // prohibit copies RuntimeState(const RuntimeState&); }; diff --git a/be/src/runtime/tablets_channel.cpp b/be/src/runtime/tablets_channel.cpp index 68a35ccc10..1dc7cf5afa 100644 --- a/be/src/runtime/tablets_channel.cpp +++ b/be/src/runtime/tablets_channel.cpp @@ -22,7 +22,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "common/status.h" // IWYU pragma: no_include diff --git a/be/src/service/doris_main.cpp b/be/src/service/doris_main.cpp index 33fe22b12e..e1fc8f63b3 100644 --- a/be/src/service/doris_main.cpp +++ b/be/src/service/doris_main.cpp @@ -72,7 +72,6 @@ #include "util/debug_util.h" #include "util/disk_info.h" #include "util/mem_info.h" -#include "util/telemetry/telemetry.h" #include "util/thrift_rpc_helper.h" #include "util/thrift_server.h" #include "util/uid_util.h" @@ -488,8 +487,6 @@ int main(int argc, char** argv) { exit(-1); } - doris::telemetry::init_tracer(); - // begin to start services doris::ThriftRpcHelper::setup(exec_env); // 1. thrift server with be_port diff --git a/be/src/service/internal_service.cpp b/be/src/service/internal_service.cpp index d6846c07a1..5a6f190e89 100644 --- a/be/src/service/internal_service.cpp +++ b/be/src/service/internal_service.cpp @@ -107,8 +107,6 @@ #include "util/runtime_profile.h" #include "util/stopwatch.hpp" #include "util/string_util.h" -#include "util/telemetry/brpc_carrier.h" -#include "util/telemetry/telemetry.h" #include "util/thrift_util.h" #include "util/time.h" #include "util/uid_util.h" @@ -303,8 +301,6 @@ void PInternalServiceImpl::exec_plan_fragment(google::protobuf::RpcController* c void PInternalServiceImpl::_exec_plan_fragment_in_pthread( google::protobuf::RpcController* controller, const PExecPlanFragmentRequest* request, PExecPlanFragmentResult* response, google::protobuf::Closure* done) { - auto span = telemetry::start_rpc_server_span("exec_plan_fragment", controller); - auto scope = OpentelemetryScope {span}; brpc::ClosureGuard closure_guard(done); auto st = Status::OK(); bool compact = request->has_compact() ? request->compact() : false; @@ -337,13 +333,11 @@ void PInternalServiceImpl::exec_plan_fragment_prepare(google::protobuf::RpcContr } } -void PInternalServiceImpl::exec_plan_fragment_start(google::protobuf::RpcController* controller, +void PInternalServiceImpl::exec_plan_fragment_start(google::protobuf::RpcController* /*controller*/, const PExecPlanFragmentStartRequest* request, PExecPlanFragmentResult* result, google::protobuf::Closure* done) { - bool ret = _light_work_pool.try_offer([this, controller, request, result, done]() { - auto span = telemetry::start_rpc_server_span("exec_plan_fragment_start", controller); - auto scope = OpentelemetryScope {span}; + bool ret = _light_work_pool.try_offer([this, request, result, done]() { brpc::ClosureGuard closure_guard(done); auto st = _exec_env->fragment_mgr()->start_query_execution(request); st.to_protobuf(result->mutable_status()); @@ -556,13 +550,11 @@ Status PInternalServiceImpl::_exec_plan_fragment_impl( } } -void PInternalServiceImpl::cancel_plan_fragment(google::protobuf::RpcController* controller, +void PInternalServiceImpl::cancel_plan_fragment(google::protobuf::RpcController* /*controller*/, const PCancelPlanFragmentRequest* request, PCancelPlanFragmentResult* result, google::protobuf::Closure* done) { - bool ret = _light_work_pool.try_offer([this, controller, request, result, done]() { - auto span = telemetry::start_rpc_server_span("exec_plan_fragment_start", controller); - auto scope = OpentelemetryScope {span}; + bool ret = _light_work_pool.try_offer([this, request, result, done]() { brpc::ClosureGuard closure_guard(done); TUniqueId tid; tid.__set_hi(request->finst_id().hi()); diff --git a/be/src/util/aligned_new.h b/be/src/util/aligned_new.h index 2800b19e4f..1d97010cad 100644 --- a/be/src/util/aligned_new.h +++ b/be/src/util/aligned_new.h @@ -22,7 +22,6 @@ #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "common/logging.h" diff --git a/be/src/util/bit_util.h b/be/src/util/bit_util.h index 3396b24c9d..230134ade0 100644 --- a/be/src/util/bit_util.h +++ b/be/src/util/bit_util.h @@ -24,7 +24,6 @@ #include #endif -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "gutil/bits.h" #include "gutil/endian.h" diff --git a/be/src/util/brpc_client_cache.h b/be/src/util/brpc_client_cache.h index e050ad53cd..ff53785085 100644 --- a/be/src/util/brpc_client_cache.h +++ b/be/src/util/brpc_client_cache.h @@ -38,7 +38,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "common/config.h" #include "util/network_util.h" diff --git a/be/src/util/core_local.cpp b/be/src/util/core_local.cpp index a6c8676560..1c4b1dd047 100644 --- a/be/src/util/core_local.cpp +++ b/be/src/util/core_local.cpp @@ -22,7 +22,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "common/logging.h" #include "util/spinlock.h" diff --git a/be/src/util/core_local.h b/be/src/util/core_local.h index e23a6820d9..1610ae5a0b 100644 --- a/be/src/util/core_local.h +++ b/be/src/util/core_local.h @@ -29,7 +29,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep namespace doris { diff --git a/be/src/util/hash_util.hpp b/be/src/util/hash_util.hpp index 355303087c..afa8a14538 100644 --- a/be/src/util/hash_util.hpp +++ b/be/src/util/hash_util.hpp @@ -26,7 +26,6 @@ #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "gutil/hash/hash.h" // IWYU pragma: keep #include "runtime/define_primitive_type.h" diff --git a/be/src/util/jsonb_document.h b/be/src/util/jsonb_document.h index fb3dd360e3..05e161e356 100644 --- a/be/src/util/jsonb_document.h +++ b/be/src/util/jsonb_document.h @@ -77,7 +77,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep // #include "util/string_parser.hpp" diff --git a/be/src/util/radix_sort.h b/be/src/util/radix_sort.h index 8cb711d161..1251f6edf1 100644 --- a/be/src/util/radix_sort.h +++ b/be/src/util/radix_sort.h @@ -37,7 +37,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep namespace doris { diff --git a/be/src/util/runtime_profile.cpp b/be/src/util/runtime_profile.cpp index 1eb3a6b139..345035a5c9 100644 --- a/be/src/util/runtime_profile.cpp +++ b/be/src/util/runtime_profile.cpp @@ -21,9 +21,6 @@ #include "util/runtime_profile.h" #include -#include -#include -#include #include #include #include @@ -553,76 +550,6 @@ void RuntimeProfile::pretty_print(std::ostream* s, const std::string& prefix) co } } -void RuntimeProfile::add_to_span(OpentelemetrySpan span) { - if (!span || !span->IsRecording() || _added_to_span) { - return; - } - _added_to_span = true; - - CounterMap counter_map; - ChildCounterMap child_counter_map; - { - std::lock_guard l(_counter_map_lock); - counter_map = _counter_map; - child_counter_map = _child_counter_map; - } - - auto total_time = counter_map.find("TotalTime"); - DCHECK(total_time != counter_map.end()); - - // profile name like "VDataBufferSender (dst_fragment_instance_id=-2608c96868f3b77d--713968f450bfbe0d):" - // to "VDataBufferSender" - auto i = _name.find_first_of("(: "); - auto short_name = _name.substr(0, i); - span->SetAttribute(short_name + SPAN_ATTRIBUTE_KEY_SEPARATOR + "TotalTime", - print_counter(total_time->second)); - - { - std::lock_guard l(_info_strings_lock); - for (const std::string& key : _info_strings_display_order) { - // nlohmann json will core dump when serializing 'KeyRanges', here temporarily skip it. - if (key.compare("KeyRanges") == 0) { - continue; - } - span->SetAttribute(short_name + SPAN_ATTRIBUTE_KEY_SEPARATOR + key, - _info_strings.find(key)->second); - } - } - - RuntimeProfile::add_child_counters_to_span(span, short_name, ROOT_COUNTER, counter_map, - child_counter_map); - - ChildVector children; - { - std::lock_guard l(_children_lock); - children = _children; - } - - for (auto& [profile, flag] : children) { - profile->add_to_span(span); - } -} - -void RuntimeProfile::add_child_counters_to_span(OpentelemetrySpan span, - const std::string& profile_name, - const std::string& counter_name, - const CounterMap& counter_map, - const ChildCounterMap& child_counter_map) { - ChildCounterMap::const_iterator itr = child_counter_map.find(counter_name); - - if (itr != child_counter_map.end()) { - const std::set& child_counters = itr->second; - for (const std::string& child_counter : child_counters) { - CounterMap::const_iterator iter = counter_map.find(child_counter); - DCHECK(iter != counter_map.end()); - span->SetAttribute(profile_name + SPAN_ATTRIBUTE_KEY_SEPARATOR + iter->first, - print_counter(iter->second)); - RuntimeProfile::add_child_counters_to_span(span, profile_name, child_counter, - counter_map, child_counter_map); - } - } -} - void RuntimeProfile::to_thrift(TRuntimeProfileTree* tree) { tree->nodes.clear(); to_thrift(&tree->nodes); diff --git a/be/src/util/runtime_profile.h b/be/src/util/runtime_profile.h index e4ddee2fe4..fed0debbbd 100644 --- a/be/src/util/runtime_profile.h +++ b/be/src/util/runtime_profile.h @@ -37,12 +37,10 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "util/binary_cast.hpp" #include "util/pretty_printer.h" #include "util/stopwatch.hpp" -#include "util/telemetry/telemetry.h" namespace doris { class TRuntimeProfileNode; @@ -339,8 +337,6 @@ public: // Does not hold locks when it makes any function calls. void pretty_print(std::ostream* s, const std::string& prefix = "") const; - void add_to_span(OpentelemetrySpan span); - // Serializes profile to thrift. // Does not hold locks when it makes any function calls. void to_thrift(TRuntimeProfileTree* tree); @@ -498,8 +494,6 @@ private: // of the total time in the entire profile tree. double _local_time_percent; - bool _added_to_span {false}; - enum PeriodicCounterType { RATE_COUNTER = 0, SAMPLING_COUNTER, @@ -538,11 +532,6 @@ private: const CounterMap& counter_map, const ChildCounterMap& child_counter_map, std::ostream* s); - static void add_child_counters_to_span(OpentelemetrySpan span, const std::string& profile_name, - const std::string& counter_name, - const CounterMap& counter_map, - const ChildCounterMap& child_counter_map); - static std::string print_counter(Counter* counter) { return PrettyPrinter::print(counter->value(), counter->type()); } diff --git a/be/src/util/sort_heap.h b/be/src/util/sort_heap.h index f3f6e546b7..b6df8f395e 100644 --- a/be/src/util/sort_heap.h +++ b/be/src/util/sort_heap.h @@ -22,7 +22,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep namespace doris { diff --git a/be/src/util/string_parser.hpp b/be/src/util/string_parser.hpp index a37ffe9d14..9a55f731de 100644 --- a/be/src/util/string_parser.hpp +++ b/be/src/util/string_parser.hpp @@ -35,7 +35,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "common/status.h" #include "runtime/large_int_value.h" diff --git a/be/src/util/telemetry/brpc_carrier.cpp b/be/src/util/telemetry/brpc_carrier.cpp deleted file mode 100644 index a3c9275009..0000000000 --- a/be/src/util/telemetry/brpc_carrier.cpp +++ /dev/null @@ -1,32 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -#include "brpc_carrier.h" - -#include - -opentelemetry::nostd::string_view doris::telemetry::RpcServerCarrier::Get( - opentelemetry::nostd::string_view key) const noexcept { - auto it = cntl_->http_request().GetHeader(key.data()); - if (it != nullptr) { - return it->data(); - } - return ""; -} - -void doris::telemetry::RpcServerCarrier::Set(opentelemetry::nostd::string_view key, - opentelemetry::nostd::string_view value) noexcept {} diff --git a/be/src/util/telemetry/brpc_carrier.h b/be/src/util/telemetry/brpc_carrier.h deleted file mode 100644 index 0e6b4d2d47..0000000000 --- a/be/src/util/telemetry/brpc_carrier.h +++ /dev/null @@ -1,80 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -#pragma once - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include "opentelemetry/context/propagation/global_propagator.h" -#include "opentelemetry/context/propagation/text_map_propagator.h" -#include "opentelemetry/context/runtime_context.h" -#include "opentelemetry/trace/context.h" -#include "opentelemetry/trace/span_metadata.h" -#include "opentelemetry/trace/span_startoptions.h" -#include "util/telemetry/telemetry.h" - -namespace google { -namespace protobuf { -class RpcController; -} // namespace protobuf -} // namespace google - -namespace doris::telemetry { - -class RpcServerCarrier : public opentelemetry::context::propagation::TextMapCarrier { -public: - explicit RpcServerCarrier(const brpc::Controller* cntl) : cntl_(cntl) {} - - RpcServerCarrier() = default; - - opentelemetry::nostd::string_view Get( - opentelemetry::nostd::string_view key) const noexcept override; - - void Set(opentelemetry::nostd::string_view key, - opentelemetry::nostd::string_view value) noexcept override; - -private: - const brpc::Controller* cntl_ {}; -}; - -inline OpentelemetrySpan start_rpc_server_span(std::string span_name, - google::protobuf::RpcController* cntl_base) { - RpcServerCarrier carrier(static_cast(cntl_base)); - auto current_ctx = opentelemetry::context::RuntimeContext::GetCurrent(); - auto prop = opentelemetry::context::propagation::GlobalTextMapPropagator::GetGlobalPropagator(); - auto parent_context = prop->Extract(carrier, current_ctx); - - if (opentelemetry::trace::GetSpan(parent_context)->GetContext().IsValid()) { - opentelemetry::trace::StartSpanOptions options; - options.kind = opentelemetry::trace::SpanKind::kServer; - options.parent = parent_context; - return telemetry::get_tracer("tracer")->StartSpan(std::move(span_name), options); - } else { - return telemetry::get_noop_tracer()->StartSpan(""); - } -} -} // namespace doris::telemetry diff --git a/be/src/util/telemetry/open_telemetry_scop_wrapper.hpp b/be/src/util/telemetry/open_telemetry_scop_wrapper.hpp deleted file mode 100644 index 2f1d8eb7b2..0000000000 --- a/be/src/util/telemetry/open_telemetry_scop_wrapper.hpp +++ /dev/null @@ -1,53 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -#pragma once - -// IWYU pragma: no_include -#include "common/compiler_util.h" // IWYU pragma: keep -#include "opentelemetry/trace/provider.h" - -namespace doris { - -using OpentelemetryTracer = opentelemetry::nostd::shared_ptr; -using OpentelemetryScope = opentelemetry::trace::Scope; -using OpentelemetrySpan = opentelemetry::nostd::shared_ptr; - -class OpenTelemetryScopeWrapper { -public: - OpenTelemetryScopeWrapper(bool enable, OpentelemetryTracer tracer, const std::string& name) { - if (enable) { - auto span = tracer->StartSpan(name); - _scope.reset(new OpentelemetryScope(span)); - } - } - - OpenTelemetryScopeWrapper(bool enable, OpentelemetryTracer tracer, OpentelemetrySpan span, - const std::string& name) { - if (enable) { - if (UNLIKELY(!span)) { - span = tracer->StartSpan(name); - } - _scope.reset(new OpentelemetryScope(span)); - } - } - -private: - std::unique_ptr _scope; -}; - -} // namespace doris diff --git a/be/src/util/telemetry/telemetry.cpp b/be/src/util/telemetry/telemetry.cpp deleted file mode 100644 index 0135112922..0000000000 --- a/be/src/util/telemetry/telemetry.cpp +++ /dev/null @@ -1,119 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -#include "telemetry.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -// IWYU pragma: no_include -#include // IWYU pragma: keep -#include -#include -#include - -#include "common/config.h" -#include "common/logging.h" -#include "opentelemetry/context/propagation/global_propagator.h" -#include "opentelemetry/context/propagation/text_map_propagator.h" -#include "opentelemetry/exporters/otlp/otlp_http_exporter.h" -#include "opentelemetry/exporters/zipkin/zipkin_exporter.h" -#include "opentelemetry/nostd/shared_ptr.h" -#include "opentelemetry/sdk/common/attribute_utils.h" -#include "opentelemetry/sdk/common/global_log_handler.h" -#include "opentelemetry/sdk/trace/batch_span_processor.h" -#include "opentelemetry/sdk/trace/tracer_provider.h" -#include "opentelemetry/trace/propagation/http_trace_context.h" -#include "service/backend_options.h" - -namespace trace = opentelemetry::trace; -namespace nostd = opentelemetry::nostd; -namespace trace_sdk = opentelemetry::sdk::trace; -namespace zipkin = opentelemetry::exporter::zipkin; -namespace resource = opentelemetry::sdk::resource; -namespace propagation = opentelemetry::context::propagation; -namespace otlp = opentelemetry::exporter::otlp; -namespace internal_log = opentelemetry::sdk::common::internal_log; - -class OpenTelemetryLogHandler : public internal_log::LogHandler { -public: - void Handle(internal_log::LogLevel level, const char* file, int line, const char* msg, - const opentelemetry::sdk::common::AttributeMap& attributes) noexcept override { - if ((level == internal_log::LogLevel::Error || level == internal_log::LogLevel::Warning) && - file != nullptr && msg != nullptr) { - LOG(WARNING) << fmt::format("OpenTelemetry File: {}:{} {}", file, line, msg); - } - } -}; - -void doris::telemetry::init_tracer() { - if (!doris::config::enable_tracing) { - return; - } - - std::unique_ptr exporter = nullptr; - std::string trace_exporter = config::trace_exporter; - boost::to_lower(trace_exporter); - if (trace_exporter.compare("collector") == 0) { - otlp::OtlpHttpExporterOptions opts {}; - opts.url = doris::config::trace_export_url; - exporter = std::make_unique(opts); - } else if (trace_exporter.compare("zipkin") == 0) { - // ZipkinExporter converts span to zipkin's format and exports span to zipkin. - zipkin::ZipkinExporterOptions opts {}; - opts.endpoint = doris::config::trace_export_url; - exporter = std::make_unique(opts); - } else { - LOG(FATAL) << "unknown value " << trace_exporter << " of trace_exporter in be.conf"; - } - - // BatchSpanProcessor exports span by batch. - trace_sdk::BatchSpanProcessorOptions batchOptions; - batchOptions.schedule_delay_millis = - std::chrono::milliseconds(doris::config::export_span_schedule_delay_millis); - batchOptions.max_queue_size = doris::config::max_span_queue_size; - batchOptions.max_export_batch_size = doris::config::max_span_export_batch_size; - auto processor = std::unique_ptr( - new trace_sdk::BatchSpanProcessor(std::move(exporter), batchOptions)); - - std::string service_name = "BACKEND:" + BackendOptions::get_localhost(); - resource::ResourceAttributes attributes = {{"service.name", service_name}}; - auto resource = resource::Resource::Create(attributes); - - auto provider = nostd::shared_ptr( - new trace_sdk::TracerProvider(std::move(processor), resource)); - // Set the global trace provider - trace::Provider::SetTracerProvider(std::move(provider)); - - // Specifies the format for parsing trace and span messages propagated via http or gpc. - propagation::GlobalTextMapPropagator::SetGlobalPropagator( - nostd::shared_ptr( - new opentelemetry::trace::propagation::HttpTraceContext())); - - // Output OpenTelemetry logs by glog - internal_log::GlobalLogHandler::SetLogHandler( - nostd::shared_ptr(new OpenTelemetryLogHandler())); -} diff --git a/be/src/util/telemetry/telemetry.h b/be/src/util/telemetry/telemetry.h deleted file mode 100644 index dc71f3cfe0..0000000000 --- a/be/src/util/telemetry/telemetry.h +++ /dev/null @@ -1,87 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -#pragma once - -#include -#include -#include -#include -#include -#include -#include - -#include - -// IWYU pragma: no_include -#include "common/compiler_util.h" // IWYU pragma: keep -#include "opentelemetry/trace/provider.h" - -/// A trace represents the execution process of a single request in the system, span represents a -/// logical operation unit with start time and execution duration in the system, and multiple spans -/// form a trace. -namespace doris { - -using OpentelemetryTracer = opentelemetry::nostd::shared_ptr; -using OpentelemetrySpan = opentelemetry::nostd::shared_ptr; -using OpentelemetryScope = opentelemetry::trace::Scope; - -/// Start a span with the specified tracer, name, and variable name, and create a Scope for this -/// span. -/// -/// span represents the execution time of an operation unit, the time of its construction is the -/// start time, the time of its destructuring is the end time, you can also call the End method to -/// let span terminate, like "span->End();" -/// -/// We can add Event and Attribute to span. Event will record the timestamp and event content, -/// and Attribute can record key-value pairs. -/// For example: -/// span->AddEvent("event content"); -/// span->SetAttribute("key", "value"); -/// -/// Scope will add the span to a thread-local stack during construction, and remove the span from -/// the stack during destructuring. When starting a span, the top-of-stack span will be the parent -/// span by default, and the top-of-stack span can be obtained via the -/// opentelemetry::trace::Tracer::GetCurrentSpan() method. -#define START_AND_SCOPE_SPAN(tracer, span, name) \ - auto span = tracer->StartSpan(name); \ - OpentelemetryScope scope {span}; - -namespace telemetry { - -void init_tracer(); - -/// Return NoopTracer, the span generated by NoopTracer is NoopSpan, and the method bodies of -/// NoopTracer and NoopSpan are empty. -inline OpentelemetryTracer& get_noop_tracer() { - static OpentelemetryTracer noop_tracer = - opentelemetry::nostd::shared_ptr( - new opentelemetry::trace::NoopTracer); - return noop_tracer; -} - -inline OpentelemetryTracer get_tracer(const std::string& tracer_name) { - return opentelemetry::trace::Provider::GetTracerProvider()->GetTracer(tracer_name); -} - -/// Returns true if the active pan stack is not empty. -inline bool is_current_span_valid() { - return opentelemetry::trace::Tracer::GetCurrentSpan()->GetContext().IsValid(); -} - -} // namespace telemetry -} // namespace doris diff --git a/be/src/util/thrift_util.cpp b/be/src/util/thrift_util.cpp index 9356ba8bed..fd141f3c74 100644 --- a/be/src/util/thrift_util.cpp +++ b/be/src/util/thrift_util.cpp @@ -25,7 +25,6 @@ // IWYU pragma: no_include #include // IWYU pragma: keep -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "common/logging.h" #include "util/thrift_server.h" diff --git a/be/src/vec/aggregate_functions/aggregate_function_bitmap.h b/be/src/vec/aggregate_functions/aggregate_function_bitmap.h index 2d707dbebf..aa167b6571 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_bitmap.h +++ b/be/src/vec/aggregate_functions/aggregate_function_bitmap.h @@ -25,7 +25,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "util/bitmap_value.h" #include "vec/aggregate_functions/aggregate_function.h" diff --git a/be/src/vec/aggregate_functions/aggregate_function_quantile_state.h b/be/src/vec/aggregate_functions/aggregate_function_quantile_state.h index a7c22cab48..7c6a9cb9da 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_quantile_state.h +++ b/be/src/vec/aggregate_functions/aggregate_function_quantile_state.h @@ -22,7 +22,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "util/quantile_state.h" #include "vec/aggregate_functions/aggregate_function.h" diff --git a/be/src/vec/aggregate_functions/aggregate_function_uniq.h b/be/src/vec/aggregate_functions/aggregate_function_uniq.h index b9445c4ed7..3ef0359461 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_uniq.h +++ b/be/src/vec/aggregate_functions/aggregate_function_uniq.h @@ -28,7 +28,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "vec/aggregate_functions/aggregate_function.h" #include "vec/columns/column.h" diff --git a/be/src/vec/columns/column_array.h b/be/src/vec/columns/column_array.h index 8c39573ba0..172815d765 100644 --- a/be/src/vec/columns/column_array.h +++ b/be/src/vec/columns/column_array.h @@ -30,7 +30,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "common/status.h" #include "vec/columns/column.h" diff --git a/be/src/vec/columns/column_map.h b/be/src/vec/columns/column_map.h index 8ec97f6c7d..f6fd313208 100644 --- a/be/src/vec/columns/column_map.h +++ b/be/src/vec/columns/column_map.h @@ -30,7 +30,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "common/status.h" #include "vec/columns/column.h" diff --git a/be/src/vec/columns/column_nullable.h b/be/src/vec/columns/column_nullable.h index 6d2c52b23a..8a45c51d23 100644 --- a/be/src/vec/columns/column_nullable.h +++ b/be/src/vec/columns/column_nullable.h @@ -27,7 +27,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "common/status.h" #include "olap/olap_common.h" diff --git a/be/src/vec/columns/column_object.cpp b/be/src/vec/columns/column_object.cpp index a59b52ee0b..cf11b47947 100644 --- a/be/src/vec/columns/column_object.cpp +++ b/be/src/vec/columns/column_object.cpp @@ -32,40 +32,38 @@ #include #include +#include "common/compiler_util.h" // IWYU pragma: keep #include "common/exception.h" +#include "common/logging.h" #include "common/status.h" +#include "exprs/json_functions.h" #include "olap/olap_common.h" #include "util/defer_op.h" #include "util/simd/bits.h" +#include "vec/aggregate_functions/aggregate_function.h" +#include "vec/columns/column.h" #include "vec/columns/column_array.h" #include "vec/columns/column_nullable.h" #include "vec/columns/column_string.h" +#include "vec/columns/column_vector.h" #include "vec/columns/columns_number.h" +#include "vec/common/assert_cast.h" #include "vec/common/field_visitors.h" #include "vec/common/schema_util.h" #include "vec/common/string_buffer.hpp" +#include "vec/common/typeid_cast.h" #include "vec/core/column_with_type_and_name.h" #include "vec/core/field.h" #include "vec/core/types.h" #include "vec/data_types/convert_field_to_type.h" +#include "vec/data_types/data_type.h" #include "vec/data_types/data_type_array.h" +#include "vec/data_types/data_type_decimal.h" #include "vec/data_types/data_type_factory.hpp" #include "vec/data_types/data_type_jsonb.h" #include "vec/data_types/data_type_nothing.h" -#include "vec/data_types/get_least_supertype.h" - -// IWYU pragma: no_include -#include "common/compiler_util.h" // IWYU pragma: keep -#include "common/logging.h" -#include "exprs/json_functions.h" -#include "vec/aggregate_functions/aggregate_function.h" -#include "vec/columns/column.h" -#include "vec/columns/column_vector.h" -#include "vec/common/assert_cast.h" -#include "vec/common/typeid_cast.h" -#include "vec/data_types/data_type.h" -#include "vec/data_types/data_type_decimal.h" #include "vec/data_types/data_type_nullable.h" +#include "vec/data_types/get_least_supertype.h" namespace doris::vectorized { namespace { diff --git a/be/src/vec/columns/column_string.h b/be/src/vec/columns/column_string.h index 5c2d849428..e310817020 100644 --- a/be/src/vec/columns/column_string.h +++ b/be/src/vec/columns/column_string.h @@ -29,7 +29,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "common/exception.h" #include "common/status.h" diff --git a/be/src/vec/columns/column_vector.h b/be/src/vec/columns/column_vector.h index f3cfbb6514..ffb91494c2 100644 --- a/be/src/vec/columns/column_vector.h +++ b/be/src/vec/columns/column_vector.h @@ -34,7 +34,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "common/status.h" #include "gutil/integral_types.h" diff --git a/be/src/vec/common/allocator.h b/be/src/vec/common/allocator.h index 24fef16290..fedfc04f53 100644 --- a/be/src/vec/common/allocator.h +++ b/be/src/vec/common/allocator.h @@ -47,7 +47,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #ifdef THREAD_SANITIZER /// Thread sanitizer does not intercept mremap. The usage of mremap will lead to false positives. diff --git a/be/src/vec/common/pod_array.h b/be/src/vec/common/pod_array.h index 662b5a1b27..91642aebd4 100644 --- a/be/src/vec/common/pod_array.h +++ b/be/src/vec/common/pod_array.h @@ -33,7 +33,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "vec/common/allocator.h" // IWYU pragma: keep #include "vec/common/memcpy_small.h" diff --git a/be/src/vec/common/sip_hash.h b/be/src/vec/common/sip_hash.h index eec48b21d2..e22ebd829e 100644 --- a/be/src/vec/common/sip_hash.h +++ b/be/src/vec/common/sip_hash.h @@ -36,7 +36,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "vec/common/unaligned.h" #include "vec/core/types.h" diff --git a/be/src/vec/common/string_ref.cpp b/be/src/vec/common/string_ref.cpp index 9b36293d6f..413c0338c1 100644 --- a/be/src/vec/common/string_ref.cpp +++ b/be/src/vec/common/string_ref.cpp @@ -20,7 +20,6 @@ #include "string_ref.h" -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep namespace doris { diff --git a/be/src/vec/core/block.cpp b/be/src/vec/core/block.cpp index 8492044215..5f1dc7f512 100644 --- a/be/src/vec/core/block.cpp +++ b/be/src/vec/core/block.cpp @@ -32,7 +32,6 @@ #include #include "agent/be_exec_version_manager.h" -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "common/config.h" #include "common/logging.h" diff --git a/be/src/vec/core/field.h b/be/src/vec/core/field.h index 339776d654..752e8356ab 100644 --- a/be/src/vec/core/field.h +++ b/be/src/vec/core/field.h @@ -37,7 +37,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "olap/hll.h" #include "util/bitmap_value.h" diff --git a/be/src/vec/core/sort_block.h b/be/src/vec/core/sort_block.h index db3592e9a7..ab14c34422 100644 --- a/be/src/vec/core/sort_block.h +++ b/be/src/vec/core/sort_block.h @@ -29,7 +29,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "util/simd/bits.h" #include "vec/columns/column.h" diff --git a/be/src/vec/data_types/data_type_decimal.h b/be/src/vec/data_types/data_type_decimal.h index 9cafe0e3a1..ff24b56712 100644 --- a/be/src/vec/data_types/data_type_decimal.h +++ b/be/src/vec/data_types/data_type_decimal.h @@ -32,7 +32,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "common/consts.h" #include "common/logging.h" diff --git a/be/src/vec/data_types/data_type_time_v2.h b/be/src/vec/data_types/data_type_time_v2.h index 8ea0efe148..369d382cbd 100644 --- a/be/src/vec/data_types/data_type_time_v2.h +++ b/be/src/vec/data_types/data_type_time_v2.h @@ -27,7 +27,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "common/status.h" #include "runtime/define_primitive_type.h" diff --git a/be/src/vec/exec/format/csv/csv_reader.cpp b/be/src/vec/exec/format/csv/csv_reader.cpp index b37a01e600..5aa155e69e 100644 --- a/be/src/vec/exec/format/csv/csv_reader.cpp +++ b/be/src/vec/exec/format/csv/csv_reader.cpp @@ -30,7 +30,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "common/consts.h" #include "common/status.h" diff --git a/be/src/vec/exec/format/json/new_json_reader.cpp b/be/src/vec/exec/format/json/new_json_reader.cpp index 1998663e24..aee5e09be3 100644 --- a/be/src/vec/exec/format/json/new_json_reader.cpp +++ b/be/src/vec/exec/format/json/new_json_reader.cpp @@ -38,7 +38,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "common/config.h" #include "common/status.h" diff --git a/be/src/vec/exec/format/parquet/bool_plain_decoder.h b/be/src/vec/exec/format/parquet/bool_plain_decoder.h index dd01300046..0dc20d6197 100644 --- a/be/src/vec/exec/format/parquet/bool_plain_decoder.h +++ b/be/src/vec/exec/format/parquet/bool_plain_decoder.h @@ -20,7 +20,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "common/status.h" #include "util/bit_stream_utils.h" diff --git a/be/src/vec/exec/format/parquet/byte_array_plain_decoder.h b/be/src/vec/exec/format/parquet/byte_array_plain_decoder.h index 5fb8a9622c..3521d07f49 100644 --- a/be/src/vec/exec/format/parquet/byte_array_plain_decoder.h +++ b/be/src/vec/exec/format/parquet/byte_array_plain_decoder.h @@ -22,7 +22,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "common/status.h" #include "util/bit_util.h" diff --git a/be/src/vec/exec/format/parquet/vparquet_column_chunk_reader.cpp b/be/src/vec/exec/format/parquet/vparquet_column_chunk_reader.cpp index 86fbba8b25..dd63e6f2da 100644 --- a/be/src/vec/exec/format/parquet/vparquet_column_chunk_reader.cpp +++ b/be/src/vec/exec/format/parquet/vparquet_column_chunk_reader.cpp @@ -23,7 +23,6 @@ #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "util/bit_util.h" #include "util/block_compression.h" diff --git a/be/src/vec/exec/format/parquet/vparquet_page_reader.cpp b/be/src/vec/exec/format/parquet/vparquet_page_reader.cpp index 40999d60e3..c41f2cae45 100644 --- a/be/src/vec/exec/format/parquet/vparquet_page_reader.cpp +++ b/be/src/vec/exec/format/parquet/vparquet_page_reader.cpp @@ -23,7 +23,6 @@ #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "common/config.h" #include "io/fs/buffered_reader.h" diff --git a/be/src/vec/exec/format/table/iceberg_reader.cpp b/be/src/vec/exec/format/table/iceberg_reader.cpp index c4bec00f3d..fb3b385270 100644 --- a/be/src/vec/exec/format/table/iceberg_reader.cpp +++ b/be/src/vec/exec/format/table/iceberg_reader.cpp @@ -33,7 +33,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "common/status.h" #include "olap/olap_common.h" diff --git a/be/src/vec/exec/join/vhash_join_node.cpp b/be/src/vec/exec/join/vhash_join_node.cpp index 70eb7dd8a9..dd020d9d38 100644 --- a/be/src/vec/exec/join/vhash_join_node.cpp +++ b/be/src/vec/exec/join/vhash_join_node.cpp @@ -21,7 +21,6 @@ #include #include #include -#include #include #include @@ -34,7 +33,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "common/config.h" #include "common/object_pool.h" @@ -52,7 +50,6 @@ #include "runtime/runtime_state.h" #include "runtime/thread_context.h" #include "util/defer_op.h" -#include "util/telemetry/telemetry.h" #include "util/uid_util.h" #include "vec/columns/column_nullable.h" #include "vec/columns/column_vector.h" diff --git a/be/src/vec/exec/join/vjoin_node_base.cpp b/be/src/vec/exec/join/vjoin_node_base.cpp index 4cdb7aed78..2401993563 100644 --- a/be/src/vec/exec/join/vjoin_node_base.cpp +++ b/be/src/vec/exec/join/vjoin_node_base.cpp @@ -20,8 +20,6 @@ #include #include #include -#include -#include #include #include @@ -31,7 +29,6 @@ #include "runtime/runtime_state.h" #include "runtime/thread_context.h" #include "util/runtime_profile.h" -#include "util/telemetry/telemetry.h" #include "util/threadpool.h" #include "vec/columns/column.h" #include "vec/columns/column_array.h" diff --git a/be/src/vec/exec/join/vnested_loop_join_node.cpp b/be/src/vec/exec/join/vnested_loop_join_node.cpp index b4f5814a3a..04d0b6a2c3 100644 --- a/be/src/vec/exec/join/vnested_loop_join_node.cpp +++ b/be/src/vec/exec/join/vnested_loop_join_node.cpp @@ -21,7 +21,6 @@ #include #include #include -#include #include #include @@ -32,21 +31,18 @@ #include #include -#include "pipeline/exec/nested_loop_join_build_operator.h" - -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "common/status.h" #include "exec/exec_node.h" #include "exprs/runtime_filter.h" #include "exprs/runtime_filter_slots_cross.h" #include "gutil/integral_types.h" +#include "pipeline/exec/nested_loop_join_build_operator.h" #include "runtime/descriptors.h" #include "runtime/runtime_filter_mgr.h" #include "runtime/runtime_state.h" #include "util/runtime_profile.h" #include "util/simd/bits.h" -#include "util/telemetry/telemetry.h" #include "vec/columns/column_const.h" #include "vec/columns/column_filter_helper.h" #include "vec/columns/column_nullable.h" diff --git a/be/src/vec/exec/scan/new_olap_scan_node.cpp b/be/src/vec/exec/scan/new_olap_scan_node.cpp index fca98e5f76..1a8017d37f 100644 --- a/be/src/vec/exec/scan/new_olap_scan_node.cpp +++ b/be/src/vec/exec/scan/new_olap_scan_node.cpp @@ -22,7 +22,6 @@ #include #include #include -#include #include #include @@ -411,7 +410,6 @@ void NewOlapScanNode::set_scan_ranges(RuntimeState* state, _scan_ranges.emplace_back(new TPaloScanRange(scan_range.scan_range.palo_scan_range)); COUNTER_UPDATE(_tablet_counter, 1); } - // telemetry::set_current_span_attribute(_tablet_counter); } std::string NewOlapScanNode::get_name() { @@ -424,7 +422,6 @@ Status NewOlapScanNode::_init_scanners(std::list* scanners) { return Status::OK(); } SCOPED_TIMER(_scanner_init_timer); - auto span = opentelemetry::trace::Tracer::GetCurrentSpan(); if (!_conjuncts.empty()) { std::string message; diff --git a/be/src/vec/exec/scan/scanner_scheduler.cpp b/be/src/vec/exec/scan/scanner_scheduler.cpp index 3a7b7759bf..62fd599665 100644 --- a/be/src/vec/exec/scan/scanner_scheduler.cpp +++ b/be/src/vec/exec/scan/scanner_scheduler.cpp @@ -28,7 +28,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "common/config.h" #include "common/logging.h" diff --git a/be/src/vec/exec/scan/vfile_scanner.cpp b/be/src/vec/exec/scan/vfile_scanner.cpp index 8eda9c1714..7eb93b5984 100644 --- a/be/src/vec/exec/scan/vfile_scanner.cpp +++ b/be/src/vec/exec/scan/vfile_scanner.cpp @@ -31,10 +31,6 @@ #include #include -#include "vec/data_types/data_type_factory.hpp" -#include "vec/exec/format/wal/wal_reader.h" - -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "common/config.h" #include "common/logging.h" @@ -53,6 +49,7 @@ #include "vec/core/columns_with_type_and_name.h" #include "vec/core/field.h" #include "vec/data_types/data_type.h" +#include "vec/data_types/data_type_factory.hpp" #include "vec/data_types/data_type_nullable.h" #include "vec/data_types/data_type_number.h" #include "vec/data_types/data_type_string.h" @@ -66,6 +63,7 @@ #include "vec/exec/format/table/max_compute_jni_reader.h" #include "vec/exec/format/table/paimon_reader.h" #include "vec/exec/format/table/transactional_hive_reader.h" +#include "vec/exec/format/wal/wal_reader.h" #include "vec/exec/scan/new_file_scan_node.h" #include "vec/exec/scan/vscan_node.h" #include "vec/exprs/vexpr.h" diff --git a/be/src/vec/exec/scan/vscan_node.cpp b/be/src/vec/exec/scan/vscan_node.cpp index 0fb60b73d0..f708f4b475 100644 --- a/be/src/vec/exec/scan/vscan_node.cpp +++ b/be/src/vec/exec/scan/vscan_node.cpp @@ -22,7 +22,6 @@ #include #include #include -#include #include #include @@ -46,7 +45,6 @@ #include "udf/udf.h" #include "util/defer_op.h" #include "util/runtime_profile.h" -#include "util/telemetry/telemetry.h" #include "vec/columns/column.h" #include "vec/columns/column_const.h" #include "vec/columns/column_vector.h" diff --git a/be/src/vec/exec/vaggregation_node.cpp b/be/src/vec/exec/vaggregation_node.cpp index 243c85b06e..2fd2be94e9 100644 --- a/be/src/vec/exec/vaggregation_node.cpp +++ b/be/src/vec/exec/vaggregation_node.cpp @@ -21,7 +21,6 @@ #include #include #include -#include #include #include @@ -37,7 +36,6 @@ #include "runtime/primitive_type.h" #include "runtime/runtime_state.h" #include "runtime/thread_context.h" -#include "util/telemetry/telemetry.h" #include "vec/aggregate_functions/aggregate_function.h" #include "vec/common/hash_table/hash.h" #include "vec/common/hash_table/hash_map_context_creator.h" diff --git a/be/src/vec/exec/vaggregation_node.h b/be/src/vec/exec/vaggregation_node.h index 6fab79bb51..f57eb6f10d 100644 --- a/be/src/vec/exec/vaggregation_node.h +++ b/be/src/vec/exec/vaggregation_node.h @@ -32,7 +32,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "common/global_types.h" #include "common/status.h" diff --git a/be/src/vec/exec/vanalytic_eval_node.cpp b/be/src/vec/exec/vanalytic_eval_node.cpp index a73011e24e..a1528c9bb1 100644 --- a/be/src/vec/exec/vanalytic_eval_node.cpp +++ b/be/src/vec/exec/vanalytic_eval_node.cpp @@ -19,21 +19,18 @@ #include #include -#include #include #include #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "common/exception.h" #include "common/logging.h" #include "runtime/descriptors.h" #include "runtime/memory/mem_tracker.h" #include "runtime/runtime_state.h" -#include "util/telemetry/telemetry.h" #include "vec/columns/column_nullable.h" #include "vec/core/column_with_type_and_name.h" #include "vec/data_types/data_type.h" diff --git a/be/src/vec/exec/vassert_num_rows_node.cpp b/be/src/vec/exec/vassert_num_rows_node.cpp index 84421180dd..f01c4a254b 100644 --- a/be/src/vec/exec/vassert_num_rows_node.cpp +++ b/be/src/vec/exec/vassert_num_rows_node.cpp @@ -19,7 +19,6 @@ #include #include -#include #include #include @@ -29,8 +28,6 @@ #include #include "runtime/runtime_state.h" -#include "util/runtime_profile.h" -#include "util/telemetry/telemetry.h" #include "vec/core/block.h" namespace doris { diff --git a/be/src/vec/exec/vempty_set_node.cpp b/be/src/vec/exec/vempty_set_node.cpp index 787bb0990f..f1c35e5035 100644 --- a/be/src/vec/exec/vempty_set_node.cpp +++ b/be/src/vec/exec/vempty_set_node.cpp @@ -17,10 +17,7 @@ #include "vec/exec/vempty_set_node.h" -#include - #include "runtime/runtime_state.h" -#include "util/telemetry/telemetry.h" namespace doris { class DescriptorTbl; diff --git a/be/src/vec/exec/vexchange_node.cpp b/be/src/vec/exec/vexchange_node.cpp index eadc4fee05..6b8142bf58 100644 --- a/be/src/vec/exec/vexchange_node.cpp +++ b/be/src/vec/exec/vexchange_node.cpp @@ -19,7 +19,6 @@ #include #include -#include #include "common/object_pool.h" #include "exec/rowid_fetcher.h" @@ -28,7 +27,6 @@ #include "runtime/query_statistics.h" #include "runtime/runtime_state.h" #include "util/runtime_profile.h" -#include "util/telemetry/telemetry.h" #include "vec/core/block.h" #include "vec/core/column_with_type_and_name.h" #include "vec/exprs/vexpr_context.h" diff --git a/be/src/vec/exec/vrepeat_node.cpp b/be/src/vec/exec/vrepeat_node.cpp index 1e522daa09..aaa7ed17d0 100644 --- a/be/src/vec/exec/vrepeat_node.cpp +++ b/be/src/vec/exec/vrepeat_node.cpp @@ -18,7 +18,6 @@ #include "vec/exec/vrepeat_node.h" #include -#include #include #include @@ -33,7 +32,6 @@ #include "runtime/runtime_state.h" #include "runtime/types.h" #include "util/runtime_profile.h" -#include "util/telemetry/telemetry.h" #include "vec/columns/column.h" #include "vec/columns/column_nullable.h" #include "vec/columns/column_vector.h" diff --git a/be/src/vec/exec/vschema_scan_node.cpp b/be/src/vec/exec/vschema_scan_node.cpp index 57e0de2cca..9ac4362318 100644 --- a/be/src/vec/exec/vschema_scan_node.cpp +++ b/be/src/vec/exec/vschema_scan_node.cpp @@ -20,7 +20,6 @@ #include #include #include -#include #include #include @@ -34,7 +33,6 @@ #include "runtime/runtime_state.h" #include "runtime/types.h" #include "util/runtime_profile.h" -#include "util/telemetry/telemetry.h" #include "vec/columns/column.h" #include "vec/core/block.h" #include "vec/core/column_with_type_and_name.h" diff --git a/be/src/vec/exec/vselect_node.cpp b/be/src/vec/exec/vselect_node.cpp index 0288e0ce1b..a0c60d7096 100644 --- a/be/src/vec/exec/vselect_node.cpp +++ b/be/src/vec/exec/vselect_node.cpp @@ -17,15 +17,12 @@ #include "vec/exec/vselect_node.h" -#include - #include #include #include #include "runtime/runtime_state.h" #include "util/runtime_profile.h" -#include "util/telemetry/telemetry.h" #include "vec/core/block.h" #include "vec/exprs/vexpr_context.h" diff --git a/be/src/vec/exec/vset_operation_node.cpp b/be/src/vec/exec/vset_operation_node.cpp index 791e92679d..7cc025b607 100644 --- a/be/src/vec/exec/vset_operation_node.cpp +++ b/be/src/vec/exec/vset_operation_node.cpp @@ -21,7 +21,6 @@ #include #include #include -#include #include #include @@ -33,7 +32,6 @@ #include "runtime/define_primitive_type.h" #include "runtime/runtime_state.h" #include "util/defer_op.h" -#include "util/telemetry/telemetry.h" #include "vec/columns/column_nullable.h" #include "vec/common/columns_hashing.h" #include "vec/common/hash_table/hash_table_set_build.h" diff --git a/be/src/vec/exec/vsort_node.cpp b/be/src/vec/exec/vsort_node.cpp index 538bed4eb6..7c266a3746 100644 --- a/be/src/vec/exec/vsort_node.cpp +++ b/be/src/vec/exec/vsort_node.cpp @@ -20,7 +20,6 @@ #include #include #include -#include #include #include @@ -35,7 +34,6 @@ #include "runtime/runtime_predicate.h" #include "runtime/runtime_state.h" #include "runtime/types.h" -#include "util/telemetry/telemetry.h" #include "vec/common/sort/heap_sorter.h" #include "vec/common/sort/topn_sorter.h" #include "vec/core/block.h" diff --git a/be/src/vec/exec/vtable_function_node.h b/be/src/vec/exec/vtable_function_node.h index fd9bde2cc9..56d1d50330 100644 --- a/be/src/vec/exec/vtable_function_node.h +++ b/be/src/vec/exec/vtable_function_node.h @@ -17,7 +17,6 @@ #pragma once -#include #include #include @@ -28,7 +27,6 @@ #include "runtime/descriptors.h" #include "runtime/runtime_state.h" #include "util/runtime_profile.h" -#include "util/telemetry/telemetry.h" #include "vec/columns/column.h" #include "vec/core/block.h" #include "vec/core/column_with_type_and_name.h" diff --git a/be/src/vec/exec/vunion_node.cpp b/be/src/vec/exec/vunion_node.cpp index f3063addf5..884b66347b 100644 --- a/be/src/vec/exec/vunion_node.cpp +++ b/be/src/vec/exec/vunion_node.cpp @@ -19,7 +19,6 @@ #include #include -#include #include #include @@ -31,7 +30,6 @@ #include "common/status.h" #include "runtime/runtime_state.h" #include "util/runtime_profile.h" -#include "util/telemetry/telemetry.h" #include "vec/columns/column_vector.h" #include "vec/columns/columns_number.h" #include "vec/core/block.h" diff --git a/be/src/vec/exprs/vexpr_context.cpp b/be/src/vec/exprs/vexpr_context.cpp index 60eb577c65..35eaae5c60 100644 --- a/be/src/vec/exprs/vexpr_context.cpp +++ b/be/src/vec/exprs/vexpr_context.cpp @@ -21,7 +21,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "common/exception.h" #include "common/object_pool.h" diff --git a/be/src/vec/functions/array/function_array_with_constant.cpp b/be/src/vec/functions/array/function_array_with_constant.cpp index fcec2a89d5..f9a8981a33 100644 --- a/be/src/vec/functions/array/function_array_with_constant.cpp +++ b/be/src/vec/functions/array/function_array_with_constant.cpp @@ -23,7 +23,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "common/status.h" #include "runtime/thread_context.h" diff --git a/be/src/vec/functions/function_bitmap.cpp b/be/src/vec/functions/function_bitmap.cpp index cc97fb01d8..ac80542f63 100644 --- a/be/src/vec/functions/function_bitmap.cpp +++ b/be/src/vec/functions/function_bitmap.cpp @@ -31,7 +31,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "common/status.h" #include "gutil/strings/numbers.h" diff --git a/be/src/vec/functions/function_cast.h b/be/src/vec/functions/function_cast.h index 661e36c347..f7cf95861b 100644 --- a/be/src/vec/functions/function_cast.h +++ b/be/src/vec/functions/function_cast.h @@ -42,7 +42,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "common/status.h" #include "runtime/runtime_state.h" diff --git a/be/src/vec/functions/function_json.cpp b/be/src/vec/functions/function_json.cpp index dae0cea227..9eb50ec775 100644 --- a/be/src/vec/functions/function_json.cpp +++ b/be/src/vec/functions/function_json.cpp @@ -38,7 +38,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "common/status.h" #include "exprs/json_functions.h" diff --git a/be/src/vec/functions/function_jsonb.cpp b/be/src/vec/functions/function_jsonb.cpp index a7d43aca4f..4048e5c779 100644 --- a/be/src/vec/functions/function_jsonb.cpp +++ b/be/src/vec/functions/function_jsonb.cpp @@ -28,7 +28,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "common/status.h" #include "udf/udf.h" diff --git a/be/src/vec/functions/function_quantile_state.cpp b/be/src/vec/functions/function_quantile_state.cpp index 6e02c3cdf7..fb059a61c8 100644 --- a/be/src/vec/functions/function_quantile_state.cpp +++ b/be/src/vec/functions/function_quantile_state.cpp @@ -29,7 +29,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "common/status.h" #include "util/quantile_state.h" diff --git a/be/src/vec/functions/function_string.h b/be/src/vec/functions/function_string.h index aa76dafd20..b2508decf7 100644 --- a/be/src/vec/functions/function_string.h +++ b/be/src/vec/functions/function_string.h @@ -33,7 +33,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "common/status.h" #include "gutil/strings/numbers.h" diff --git a/be/src/vec/functions/functions_logical.cpp b/be/src/vec/functions/functions_logical.cpp index b24fcf9139..1eceeac3de 100644 --- a/be/src/vec/functions/functions_logical.cpp +++ b/be/src/vec/functions/functions_logical.cpp @@ -25,7 +25,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "gutil/integral_types.h" #include "vec/aggregate_functions/aggregate_function.h" diff --git a/be/src/vec/olap/block_reader.cpp b/be/src/vec/olap/block_reader.cpp index d767c250f3..33c065dce2 100644 --- a/be/src/vec/olap/block_reader.cpp +++ b/be/src/vec/olap/block_reader.cpp @@ -27,7 +27,6 @@ #include #include -// IWYU pragma: no_include #include "cloud/config.h" #include "common/compiler_util.h" // IWYU pragma: keep #include "common/status.h" diff --git a/be/src/vec/olap/olap_data_convertor.cpp b/be/src/vec/olap/olap_data_convertor.cpp index 5344568e96..e9fe19a048 100644 --- a/be/src/vec/olap/olap_data_convertor.cpp +++ b/be/src/vec/olap/olap_data_convertor.cpp @@ -19,7 +19,6 @@ #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "common/config.h" #include "common/exception.h" diff --git a/be/src/vec/olap/vcollect_iterator.cpp b/be/src/vec/olap/vcollect_iterator.cpp index b34893b630..921e89c3c8 100644 --- a/be/src/vec/olap/vcollect_iterator.cpp +++ b/be/src/vec/olap/vcollect_iterator.cpp @@ -26,7 +26,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "common/status.h" #include "io/io_common.h" diff --git a/be/src/vec/olap/vertical_block_reader.h b/be/src/vec/olap/vertical_block_reader.h index a681aba16d..9230bf211e 100644 --- a/be/src/vec/olap/vertical_block_reader.h +++ b/be/src/vec/olap/vertical_block_reader.h @@ -26,7 +26,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "common/status.h" #include "olap/iterators.h" diff --git a/be/src/vec/olap/vertical_merge_iterator.cpp b/be/src/vec/olap/vertical_merge_iterator.cpp index 3278cdbd84..f912ee7dff 100644 --- a/be/src/vec/olap/vertical_merge_iterator.cpp +++ b/be/src/vec/olap/vertical_merge_iterator.cpp @@ -23,7 +23,6 @@ #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "common/config.h" #include "common/logging.h" diff --git a/be/src/vec/olap/vgeneric_iterators.h b/be/src/vec/olap/vgeneric_iterators.h index 49f96b1634..f2e5e04bcc 100644 --- a/be/src/vec/olap/vgeneric_iterators.h +++ b/be/src/vec/olap/vgeneric_iterators.h @@ -27,7 +27,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "common/status.h" #include "olap/iterators.h" diff --git a/be/src/vec/sink/vdata_stream_sender.cpp b/be/src/vec/sink/vdata_stream_sender.cpp index 728bd0c56f..6c64cf8db0 100644 --- a/be/src/vec/sink/vdata_stream_sender.cpp +++ b/be/src/vec/sink/vdata_stream_sender.cpp @@ -23,7 +23,6 @@ #include #include #include -#include #include #include @@ -41,7 +40,6 @@ #include "runtime/thread_context.h" #include "runtime/types.h" #include "util/proto_util.h" -#include "util/telemetry/telemetry.h" #include "vec/columns/column_const.h" #include "vec/common/sip_hash.h" #include "vec/exprs/vexpr.h" diff --git a/be/src/vec/sink/vmysql_result_writer.cpp b/be/src/vec/sink/vmysql_result_writer.cpp index 714f406d20..867cd7dc1d 100644 --- a/be/src/vec/sink/vmysql_result_writer.cpp +++ b/be/src/vec/sink/vmysql_result_writer.cpp @@ -29,7 +29,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "gutil/integral_types.h" #include "olap/hll.h" diff --git a/be/src/vec/sink/vresult_file_sink.cpp b/be/src/vec/sink/vresult_file_sink.cpp index 503e2a3c68..5bb0de4b50 100644 --- a/be/src/vec/sink/vresult_file_sink.cpp +++ b/be/src/vec/sink/vresult_file_sink.cpp @@ -19,7 +19,6 @@ #include #include -#include #include #include @@ -30,7 +29,6 @@ #include "runtime/buffer_control_block.h" #include "runtime/result_buffer_mgr.h" #include "runtime/runtime_state.h" -#include "util/telemetry/telemetry.h" #include "vec/exprs/vexpr.h" namespace doris { diff --git a/be/src/vec/sink/vresult_sink.cpp b/be/src/vec/sink/vresult_sink.cpp index d5ca67b76c..edccadc320 100644 --- a/be/src/vec/sink/vresult_sink.cpp +++ b/be/src/vec/sink/vresult_sink.cpp @@ -18,7 +18,6 @@ #include "vec/sink/vresult_sink.h" #include -#include #include #include @@ -35,7 +34,6 @@ #include "runtime/runtime_state.h" #include "util/arrow/row_batch.h" #include "util/runtime_profile.h" -#include "util/telemetry/telemetry.h" #include "vec/exprs/vexpr.h" #include "vec/exprs/vexpr_context.h" #include "vec/sink/varrow_flight_result_writer.h" diff --git a/be/src/vec/sink/vtablet_block_convertor.cpp b/be/src/vec/sink/vtablet_block_convertor.cpp index 2466596f78..5e2358fc37 100644 --- a/be/src/vec/sink/vtablet_block_convertor.cpp +++ b/be/src/vec/sink/vtablet_block_convertor.cpp @@ -27,7 +27,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "common/status.h" #include "runtime/descriptors.h" diff --git a/be/src/vec/sink/vtablet_finder.cpp b/be/src/vec/sink/vtablet_finder.cpp index f01add4b22..5c37da6a7c 100644 --- a/be/src/vec/sink/vtablet_finder.cpp +++ b/be/src/vec/sink/vtablet_finder.cpp @@ -27,7 +27,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "common/status.h" #include "exec/tablet_info.h" diff --git a/be/src/vec/sink/vtablet_sink.cpp b/be/src/vec/sink/vtablet_sink.cpp index ba1d6c8c33..25443ab314 100644 --- a/be/src/vec/sink/vtablet_sink.cpp +++ b/be/src/vec/sink/vtablet_sink.cpp @@ -35,7 +35,6 @@ #include #include #include -#include #include #include @@ -67,7 +66,6 @@ #include #endif -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "common/logging.h" #include "common/object_pool.h" @@ -89,7 +87,6 @@ #include "util/network_util.h" #include "util/proto_util.h" #include "util/ref_count_closure.h" -#include "util/telemetry/telemetry.h" #include "util/thread.h" #include "util/threadpool.h" #include "util/thrift_rpc_helper.h" diff --git a/be/src/vec/sink/vtablet_sink_v2.cpp b/be/src/vec/sink/vtablet_sink_v2.cpp index 6e610ee717..08ddfb0381 100644 --- a/be/src/vec/sink/vtablet_sink_v2.cpp +++ b/be/src/vec/sink/vtablet_sink_v2.cpp @@ -25,7 +25,6 @@ #include #include #include -#include #include #include @@ -34,7 +33,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "common/logging.h" #include "common/object_pool.h" @@ -50,7 +48,6 @@ #include "util/brpc_client_cache.h" #include "util/doris_metrics.h" #include "util/network_util.h" -#include "util/telemetry/telemetry.h" #include "util/threadpool.h" #include "util/thrift_util.h" #include "util/uid_util.h" diff --git a/be/src/vec/sink/writer/vfile_result_writer.cpp b/be/src/vec/sink/writer/vfile_result_writer.cpp index 8163624b44..2236abb925 100644 --- a/be/src/vec/sink/writer/vfile_result_writer.cpp +++ b/be/src/vec/sink/writer/vfile_result_writer.cpp @@ -26,7 +26,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "common/consts.h" #include "common/status.h" diff --git a/be/src/vec/sink/writer/vmysql_table_writer.cpp b/be/src/vec/sink/writer/vmysql_table_writer.cpp index a7eca340c7..fdcedf5996 100644 --- a/be/src/vec/sink/writer/vmysql_table_writer.cpp +++ b/be/src/vec/sink/writer/vmysql_table_writer.cpp @@ -25,7 +25,6 @@ #include #include -// IWYU pragma: no_include #include "common/compiler_util.h" // IWYU pragma: keep #include "runtime/decimalv2_value.h" #include "runtime/define_primitive_type.h" diff --git a/be/src/vec/sink/writer/vtablet_writer.cpp b/be/src/vec/sink/writer/vtablet_writer.cpp index 786c0e2110..75e813b134 100644 --- a/be/src/vec/sink/writer/vtablet_writer.cpp +++ b/be/src/vec/sink/writer/vtablet_writer.cpp @@ -57,7 +57,6 @@ #include #endif -// IWYU pragma: no_include #include "bvar/bvar.h" #include "common/compiler_util.h" // IWYU pragma: keep #include "common/logging.h" @@ -77,7 +76,6 @@ #include "util/network_util.h" #include "util/proto_util.h" #include "util/ref_count_closure.h" -#include "util/telemetry/telemetry.h" #include "util/threadpool.h" #include "util/thrift_rpc_helper.h" #include "util/thrift_util.h" diff --git a/docs/en/docs/admin-manual/config/fe-config.md b/docs/en/docs/admin-manual/config/fe-config.md index 11eab19422..56f77d3f77 100644 --- a/docs/en/docs/admin-manual/config/fe-config.md +++ b/docs/en/docs/admin-manual/config/fe-config.md @@ -666,43 +666,6 @@ Default:1048576 (1M) http header size configuration parameter, the default value is 1M. -#### `enable_tracing` - -Default:false - -IsMutable:false - -MasterOnly:false - -Whether to enable tracking - -If this configuration is enabled, you should also specify the trace_export_url. - -#### `trace_exporter` - -Default:zipkin - -IsMutable:false - -MasterOnly:false - -Current support for exporting traces: - zipkin: Export traces directly to zipkin, which is used to enable the tracing feature quickly. - collector: The collector can be used to receive and process traces and support export to a variety of third-party systems. -If this configuration is enabled, you should also specify the enable_tracing=true and trace_export_url. - -#### `trace_export_url` - -Default:`http://127.0.0.1:9411/api/v2/spans` - -IsMutable:false - -MasterOnly:false - -trace export to zipkin like: `http://127.0.0.1:9411/api/v2/spans` - -trace export to collector like: `http://127.0.0.1:4318/v1/traces` - ### Query Engine #### `default_max_query_instances` diff --git a/docs/en/docs/admin-manual/tracing.md b/docs/en/docs/admin-manual/tracing.md deleted file mode 100644 index 17802252b8..0000000000 --- a/docs/en/docs/admin-manual/tracing.md +++ /dev/null @@ -1,205 +0,0 @@ ---- -{ - "title": "tracing", - "language": "en" -} ---- - - - -# tracing - -Tracing records the life cycle of a request execution in the system, including the request and its sub-procedure call links, execution time and statistics, which can be used for slow query location, performance bottleneck analysis, etc. - -## Principle - -doris is responsible for collecting traces and exporting them to a third-party tracing analysis system, which is responsible for the presentation and storage of traces. - -## Quick Start - -doris currently supports exporting traces directly to [zipkin](https://zipkin.io/). - -### Deploy zipkin - -``` -curl -sSL https://zipkin.io/quickstart.sh | bash -s -java -jar zipkin.jar -``` - -### Configuring and starting Doris - -#### Add configuration to fe.conf - -``` -enable_tracing = true - -# Configure traces to export to zipkin -trace_export_url = http://127.0.0.1:9411/api/v2/spans -``` - -#### Add configuration to be.conf -``` -enable_tracing = true - -# Configure traces to export to zipkin -trace_export_url = http://127.0.0.1:9411/api/v2/spans - -# Queue size for caching spans. span export will be triggered once when the number of spans reaches half of the queue capacity. spans arriving in the queue will be discarded when the queue is full. -max_span_queue_size=2048 - -# The maximum number of spans to export in a single pass. -max_span_export_batch_size=512 - -# Maximum interval for exporting span -export_span_schedule_delay_millis=500 -``` - -#### Start fe and be -``` -sh fe/bin/start_fe.sh --daemon -sh be/bin/start_be.sh --daemon -``` - -### Executing a query -``` -... -``` - -### View zipkin UI - -The browser opens `http://127.0.0.1:9411/zipkin/` to view the query tracing. - -## Using opentelemetry collector - -Use the opentelemetry collector to export traces to other systems such as zipkin, jaeger, skywalking, or to database systems and files. For more details, refer to [collector exporter](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter). - -Meanwhile, opentelemetry collector provides a rich set of operators to process traces. For example, [filterprocessor](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/filterprocessor) , [tailsamplingprocessor](hhttps://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/tailsamplingprocessor). For more details, refer to [collector processor](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor). - -traces export path: doris->collector->zipkin etc. - -### Deploy opentelemetry collector - -opentelemetry has released collector [core](https://github.com/open-telemetry/opentelemetry-collector) and [contrib](https://github.com/open-telemetry/opentelemetry-collector-contrib), contrib provides richer features, here is an example of contrib version. - -#### Download collector - -Download otelcol-contrib, available on the official website [more precompiled versions for more platforms](https://github.com/open-telemetry/opentelemetry-collector-releases/releases) - -``` -wget https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/v0.55.0/otelcol-contrib_0.55.0_linux_amd64.tar.gz - -tar -zxvf otelcol-contrib_0.55.0_linux_amd64.tar.gz -``` - -#### Generate configuration file - -The collector configuration file is divided into 5 parts: `receivers`, `processors`, `exporters`, `extensions`, and `service`. Among them, receivers, processors and exporters define the way to receive, process and export data respectively; extensions are optional and are used to extend tasks that do not involve processing telemetry data; service specifies which components are used in the collector. See [collector configuration](https://opentelemetry.io/docs/collector/deployment/). - -The following configuration file uses the otlp (OpenTelemetry Protocol) protocol to receive traces data, perform batch processing and filter out traces longer than 50ms, and finally export them to zipkin and file. - -``` -cat > otel-collector-config.yaml << EOF -receivers: - otlp: - protocols: - http: - -exporters: - zipkin: - endpoint: "http://10.81.85.90:8791/api/v2/spans" - file: - path: ./filename.json - -processors: - batch: - tail_sampling: - policies: - { - name: duration_policy, - type: latency, - latency: {threshold_ms: 50} - } - -extensions: - -service: - pipelines: - traces: - receivers: [otlp] - processors: [batch, tail_sampling] - exporters: [zipkin, file] -EOF -``` - -#### Start collector - -``` -nohup ./otelcol-contrib --config=otel-collector-config.yaml & -``` - -### Configuring and starting Doris - -#### Add configuration to fe.conf - -``` -enable_tracing = true - -# enable opentelemetry collector -trace_exporter = collector - -# Configure traces export to collector, 4318 is the default port for collector otlp http -trace_export_url = http://127.0.0.1:4318/v1/traces -``` - -#### Add configuration to be.conf -``` -enable_tracing = true - -# enable opentelemetry collector -trace_exporter = collector - -# Configure traces export to collector, 4318 is the default port for collector otlp http -trace_export_url = http://127.0.0.1:4318/v1/traces - -# Queue size for caching spans. span export will be triggered once when the number of spans reaches half of the queue capacity. spans arriving in the queue will be discarded when the queue is full. -max_span_queue_size=2048 - -# The maximum number of spans to export in a single pass. -max_span_export_batch_size=512 - -# Maximum interval for exporting span -export_span_schedule_delay_millis=500 -``` - -#### Start fe and be -``` -sh fe/bin/start_fe.sh --daemon -sh be/bin/start_be.sh --daemon -``` - -### Executing a query -``` -... -``` - -### View zipkin UI -``` -... -``` \ No newline at end of file diff --git a/docs/sidebars.json b/docs/sidebars.json index e436221e69..5e719db0d3 100644 --- a/docs/sidebars.json +++ b/docs/sidebars.json @@ -1151,7 +1151,6 @@ }, "admin-manual/sql-interception", "admin-manual/query-profile", - "admin-manual/tracing", "admin-manual/certificate", "admin-manual/fe-certificate", { diff --git a/docs/zh-CN/docs/admin-manual/config/fe-config.md b/docs/zh-CN/docs/admin-manual/config/fe-config.md index 9da440ada3..a69c13b252 100644 --- a/docs/zh-CN/docs/admin-manual/config/fe-config.md +++ b/docs/zh-CN/docs/admin-manual/config/fe-config.md @@ -666,43 +666,6 @@ workers 线程池默认不做设置,根据自己需要进行设置 http header size 配置参数 -#### `enable_tracing` - -默认值:false - -是否可以动态配置:false - -是否为 Master FE 节点独有的配置项:false - -是否开启链路追踪 - -如果启用此配置,您还应该指定 trace_export_url。 - -#### `trace_exporter` - -默认值:zipkin - -是否可以动态配置:false - -是否为 Master FE 节点独有的配置项:false - -当前支持导出的链路追踪: - zipkin:直接将trace导出到zipkin,用于快速开启tracing特性。 - collector:collector可用于接收和处理traces,支持导出到多种第三方系统 -如果启用此配置,您还应该指定 enable_tracing=true 和 trace_export_url。 - -#### `trace_export_url` - -默认值:`http://127.0.0.1:9411/api/v2/spans` - -是否可以动态配置:false - -是否为 Master FE 节点独有的配置项:false - -trace导出到 zipkin: `http://127.0.0.1:9411/api/v2/spans` - -trace导出到 collector: `http://127.0.0.1:4318/v1/traces` - ### 查询引擎 #### `default_max_query_instances` diff --git a/docs/zh-CN/docs/admin-manual/tracing.md b/docs/zh-CN/docs/admin-manual/tracing.md deleted file mode 100644 index aab76ff462..0000000000 --- a/docs/zh-CN/docs/admin-manual/tracing.md +++ /dev/null @@ -1,206 +0,0 @@ ---- -{ - "title": "链路追踪", - "language": "zh-CN" -} ---- - - - -# 链路追踪 - -链路追踪(tracing)记录了一次请求在系统中的执行的生命周期,包括请求及其子过程调用链路、执行时间及统计信息,可用于慢查询定位、性能瓶颈分析等。 - -## 原理 - -doris负责收集traces,并导出到第三方链路分析系统,由链路分析系统负责traces的展示和存储。 - -## 快速搭建 -doris目前支持直接将traces导出到 [zipkin](https://zipkin.io/) 中。 - -### 部署 zipkin - -``` -curl -sSL https://zipkin.io/quickstart.sh | bash -s -java -jar zipkin.jar -``` - -### 配置及启动Doris - -#### 添加配置到fe.conf - -``` -# 开启链路追踪 -enable_tracing = true - -# 配置traces导出到zipkin -trace_export_url = http://127.0.0.1:9411/api/v2/spans -``` - -#### 添加配置到be.conf -``` -# 开启链路追踪。 -enable_tracing = true - -# 配置traces导出到zipkin。 -trace_export_url = http://127.0.0.1:9411/api/v2/spans - -# 可选。缓存span的队列大小。span数量达到队列容量一半时将触发一次span导出,队列满后到达队列的span将被丢弃。 -max_span_queue_size=2048 - -# 可选。单次导出span的最大数量。 -max_span_export_batch_size=512 - -# 可选。导出span的最大间隔时间。 -export_span_schedule_delay_millis=500 -``` - -#### 启动fe和be -``` -sh fe/bin/start_fe.sh --daemon -sh be/bin/start_be.sh --daemon -``` - -### 执行查询 -``` -... -``` - -### 查看zipkin UI - -浏览器打开`http://127.0.0.1:9411/zipkin/` 可查看查询链路。 - -## 使用opentelemetry collector - -使用opentelemetry collector 可将traces导出到其他系统例如zipkin、jaeger、skywalking,或者数据库系统和文件中。 详情参考 [collector exporter](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter) 。 - -同时 opentelemetry collector 提供了丰富的算子用来处理traces。例如[过滤 spans](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/filterprocessor) 、[尾采样](hhttps://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/tailsamplingprocessor)。详情参考[collector processor](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor)。 - -traces导出的路径:doris -> collector -> zipkin等。 - -### 部署 opentelemetry collector - -opentelemetry 发布了collector [core](https://github.com/open-telemetry/opentelemetry-collector) 和 [contrib](https://github.com/open-telemetry/opentelemetry-collector-contrib), contrib提供了更丰富的功能,这里以contrib版举例。 - -#### 下载 collector - -下载 otelcol-contrib, 可在官网下载[更多平台预编译版](https://github.com/open-telemetry/opentelemetry-collector-releases/releases) - -``` -wget https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/v0.55.0/otelcol-contrib_0.55.0_linux_amd64.tar.gz - -tar -zxvf otelcol-contrib_0.55.0_linux_amd64.tar.gz -``` - -#### 生成配置文件 - -collector 配置文件分为5部分:`receivers`、`processors`、`exporters`、`extensions`、`service`。其中receivers、processors、exporters分别定义了接收、处理、导出数据的方式;extensions是可选的,用于扩展主要用于不涉及处理遥测数据的任务;service指定在collector中使用哪些组件。可参考 [collector configuration](https://opentelemetry.io/docs/collector/deployment/)。 - -下面配置文件使用otlp(OpenTelemetry Protocol)协议接收traces数据,进行批处理并过滤掉时间超过50ms的traces, 最终导出到zipkin和文件中。 -``` -cat > otel-collector-config.yaml << EOF -receivers: - otlp: - protocols: - http: - -exporters: - zipkin: - endpoint: "http://10.81.85.90:8791/api/v2/spans" - file: - path: ./filename.json - -processors: - batch: - tail_sampling: - policies: - { - name: duration_policy, - type: latency, - latency: {threshold_ms: 50} - } - -extensions: - -service: - pipelines: - traces: - receivers: [otlp] - processors: [batch, tail_sampling] - exporters: [zipkin, file] -EOF -``` - -#### 启动 collector - -``` -nohup ./otelcol-contrib --config=otel-collector-config.yaml & -``` - -### 配置及启动Doris - -#### 添加配置到fe.conf - -``` -# 开启链路追踪 -enable_tracing = true - -# 启用opentelemetry collector。 -trace_exporter = collector - -# 配置traces导出到collector,4318为collector otlp http默认端口。 -trace_export_url = http://127.0.0.1:4318/v1/traces -``` - -#### 添加配置到be.conf -``` -# 开启链路追踪。 -enable_tracing = true - -# 启用opentelemetry collector。 -trace_exporter = collector - -# 配置traces导出到collector,4318为collector otlp http默认端口。 -trace_export_url = http://127.0.0.1:4318/v1/traces - -# 可选。缓存span的队列大小。span数量达到队列容量一半时将触发一次span导出,队列满后到达队列的span将被丢弃。 -max_span_queue_size=2048 - -# 可选。单次导出span的最大数量。 -max_span_export_batch_size=512 - -# 可选。导出span的最大间隔时间。 -export_span_schedule_delay_millis=500 -``` - -#### 启动fe和be -``` -sh fe/bin/start_fe.sh --daemon -sh be/bin/start_be.sh --daemon -``` - -### 执行查询 -``` -... -``` -### 查看traces -``` -... -``` diff --git a/fe/fe-common/src/main/java/org/apache/doris/common/Config.java b/fe/fe-common/src/main/java/org/apache/doris/common/Config.java index 4bdd96aad6..3db9b7fd52 100644 --- a/fe/fe-common/src/main/java/org/apache/doris/common/Config.java +++ b/fe/fe-common/src/main/java/org/apache/doris/common/Config.java @@ -1530,30 +1530,6 @@ public class Config extends ConfigBase { }) public static int auto_check_statistics_in_minutes = 10; - /** - * If this configuration is enabled, you should also specify the trace_export_url. - */ - @ConfField(mutable = false, masterOnly = false) - public static boolean enable_tracing = false; - - /** - * Current support for exporting traces: - * zipkin: Export traces directly to zipkin, which is used to enable the tracing feature quickly. - * collector: The collector can be used to receive and process traces and support export to a variety of - * third-party systems. - * If this configuration is enabled, you should also specify the enable_tracing=true and trace_export_url. - */ - @ConfField(mutable = false, masterOnly = false) - public static String trace_exporter = "zipkin"; - - /** - * The endpoint to export spans to. - * export to zipkin like: http://127.0.0.1:9411/api/v2/spans - * export to collector like: http://127.0.0.1:4318/v1/traces - */ - @ConfField(mutable = false, masterOnly = false) - public static String trace_export_url = "http://127.0.0.1:9411/api/v2/spans"; - /** * If set to TRUE, the compaction slower replica will be skipped when select get queryable replicas * Default is true. diff --git a/fe/fe-core/pom.xml b/fe/fe-core/pom.xml index fa640dc3ef..e177bae10d 100644 --- a/fe/fe-core/pom.xml +++ b/fe/fe-core/pom.xml @@ -518,23 +518,6 @@ under the License. hadoop-auth - - io.opentelemetry - opentelemetry-api - - - io.opentelemetry - opentelemetry-sdk - - - io.opentelemetry - opentelemetry-exporter-otlp - - - io.opentelemetry - opentelemetry-exporter-zipkin - - org.apache.iceberg iceberg-core diff --git a/fe/fe-core/src/main/java/org/apache/doris/DorisFE.java b/fe/fe-core/src/main/java/org/apache/doris/DorisFE.java index b76f609f74..c10d630e09 100755 --- a/fe/fe-core/src/main/java/org/apache/doris/DorisFE.java +++ b/fe/fe-core/src/main/java/org/apache/doris/DorisFE.java @@ -25,7 +25,6 @@ import org.apache.doris.common.LdapConfig; import org.apache.doris.common.Log4jConfig; import org.apache.doris.common.ThreadPoolManager; import org.apache.doris.common.Version; -import org.apache.doris.common.telemetry.Telemetry; import org.apache.doris.common.util.JdkUtils; import org.apache.doris.common.util.NetUtils; import org.apache.doris.httpv2.HttpServer; @@ -168,8 +167,6 @@ public class DorisFE { Env.getCurrentEnv().initialize(args); Env.getCurrentEnv().waitForReady(); - Telemetry.initOpenTelemetry(); - // init and start: // 1. HttpServer for HTTP Server // 2. FeServer for Thrift Server diff --git a/fe/fe-core/src/main/java/org/apache/doris/common/telemetry/ScopedSpan.java b/fe/fe-core/src/main/java/org/apache/doris/common/telemetry/ScopedSpan.java deleted file mode 100644 index 1bb5584541..0000000000 --- a/fe/fe-core/src/main/java/org/apache/doris/common/telemetry/ScopedSpan.java +++ /dev/null @@ -1,48 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -package org.apache.doris.common.telemetry; - -import io.opentelemetry.api.trace.Span; -import io.opentelemetry.context.Scope; - -/** - * encapsulated {@link Span} and {@link Scope}. - */ -public class ScopedSpan { - private Span span; - private Scope scope; - - public ScopedSpan() { - span = Telemetry.getNoopSpan(); - this.scope = span.makeCurrent(); - } - - public ScopedSpan(Span span) { - this.span = span; - this.scope = span.makeCurrent(); - } - - public Span getSpan() { - return span; - } - - public void endSpan() { - scope.close(); - span.end(); - } -} diff --git a/fe/fe-core/src/main/java/org/apache/doris/common/telemetry/Telemetry.java b/fe/fe-core/src/main/java/org/apache/doris/common/telemetry/Telemetry.java deleted file mode 100644 index eb0c6b6572..0000000000 --- a/fe/fe-core/src/main/java/org/apache/doris/common/telemetry/Telemetry.java +++ /dev/null @@ -1,109 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -package org.apache.doris.common.telemetry; - -import org.apache.doris.catalog.Env; -import org.apache.doris.common.Config; - -import io.opentelemetry.api.OpenTelemetry; -import io.opentelemetry.api.common.AttributeKey; -import io.opentelemetry.api.common.Attributes; -import io.opentelemetry.api.trace.Span; -import io.opentelemetry.api.trace.Tracer; -import io.opentelemetry.api.trace.propagation.W3CTraceContextPropagator; -import io.opentelemetry.context.propagation.ContextPropagators; -import io.opentelemetry.exporter.otlp.http.trace.OtlpHttpSpanExporter; -import io.opentelemetry.exporter.zipkin.ZipkinSpanExporter; -import io.opentelemetry.sdk.OpenTelemetrySdk; -import io.opentelemetry.sdk.resources.Resource; -import io.opentelemetry.sdk.trace.SdkTracerProvider; -import io.opentelemetry.sdk.trace.export.BatchSpanProcessor; -import io.opentelemetry.sdk.trace.export.SpanExporter; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; - -import java.util.concurrent.TimeUnit; - -/** - * Managing OpenTelemetry sdk. - */ -public class Telemetry { - private static final Logger LOG = LogManager.getLogger(Telemetry.class); - - private static OpenTelemetry openTelemetry = OpenTelemetry.noop(); - - public enum DorisTraceExporter { - zipkin, collector - } - - /** - * Initialize {@link OpenTelemetry} with {@link SdkTracerProvider}, {@link BatchSpanProcessor}, - * {@link ZipkinSpanExporter} and {@link W3CTraceContextPropagator}. - */ - public static void initOpenTelemetry() throws Exception { - if (!Config.enable_tracing) { - return; - } - - String traceExportUrl = Config.trace_export_url; - SpanExporter spanExporter; - if (DorisTraceExporter.collector.name().equalsIgnoreCase(Config.trace_exporter)) { - spanExporter = oltpExporter(traceExportUrl); - } else if (DorisTraceExporter.zipkin.name().equalsIgnoreCase(Config.trace_exporter)) { - spanExporter = zipkinExporter(traceExportUrl); - } else { - throw new Exception("unknown value " + Config.trace_exporter + " of trace_exporter in fe.conf"); - } - - String serviceName = "FRONTEND:" + Env.getCurrentEnv().getSelfNode().getHost(); - Resource serviceNameResource = Resource.create( - Attributes.of(AttributeKey.stringKey("service.name"), serviceName)); - // Send a batch of spans if ScheduleDelay time or MaxExportBatchSize is reached - BatchSpanProcessor spanProcessor = - BatchSpanProcessor.builder(spanExporter).setScheduleDelay(100, TimeUnit.MILLISECONDS) - .setMaxExportBatchSize(1000).build(); - - SdkTracerProvider tracerProvider = SdkTracerProvider.builder().addSpanProcessor(spanProcessor) - .setResource(Resource.getDefault().merge(serviceNameResource)).build(); - openTelemetry = OpenTelemetrySdk.builder().setTracerProvider(tracerProvider) - .setPropagators(ContextPropagators.create(W3CTraceContextPropagator.getInstance())).build(); - - // add a shutdown hook to shut down the SDK - Runtime.getRuntime().addShutdownHook(new Thread(tracerProvider::shutdown)); - } - - private static SpanExporter zipkinExporter(String httpUrl) { - return ZipkinSpanExporter.builder().setEndpoint(httpUrl).build(); - } - - private static SpanExporter oltpExporter(String httpUrl) { - return OtlpHttpSpanExporter.builder().setEndpoint(httpUrl).build(); - } - - public static OpenTelemetry getOpenTelemetry() { - return openTelemetry; - } - - public static Tracer getNoopTracer() { - return OpenTelemetry.noop().getTracer("noop"); - } - - public static Span getNoopSpan() { - return getNoopTracer().spanBuilder("noopSpan").startSpan(); - } -} diff --git a/fe/fe-core/src/main/java/org/apache/doris/load/ExportTaskExecutor.java b/fe/fe-core/src/main/java/org/apache/doris/load/ExportTaskExecutor.java index b647154dc1..093b9f5641 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/load/ExportTaskExecutor.java +++ b/fe/fe-core/src/main/java/org/apache/doris/load/ExportTaskExecutor.java @@ -144,8 +144,6 @@ public class ExportTaskExecutor implements TransientTaskExecutor { exportJob.updateExportJobState(ExportJobState.CANCELLED, taskId, null, ExportFailMsg.CancelType.RUN_FAIL, e.getMessage()); throw new JobException(e); - } finally { - stmtExecutor.addProfileToSpan(); } } if (isCanceled.get()) { diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/NereidsPlanner.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/NereidsPlanner.java index fa25c5a6d9..c9c9e7b67b 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/NereidsPlanner.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/NereidsPlanner.java @@ -61,9 +61,6 @@ import org.apache.doris.qe.ResultSetMetaData; import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.Lists; -import io.opentelemetry.api.trace.Span; -import io.opentelemetry.context.Context; -import io.opentelemetry.context.Scope; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -183,19 +180,8 @@ public class NereidsPlanner extends Planner { try (Lock lock = new Lock(plan, cascadesContext)) { // resolve column, table and function - Span queryAnalysisSpan = - statementContext.getConnectContext().getTracer() - .spanBuilder("query analysis").setParent(Context.current()).startSpan(); - try (Scope scope = queryAnalysisSpan.makeCurrent()) { - // analyze this query - analyze(); - } catch (Exception e) { - queryAnalysisSpan.recordException(e); - throw e; - } finally { - queryAnalysisSpan.end(); - } - + // analyze this query + analyze(); // minidump of input must be serialized first, this process ensure minidump string not null try { MinidumpUtils.serializeInputsToDumpFile(plan, cascadesContext.getTables()); diff --git a/fe/fe-core/src/main/java/org/apache/doris/plugin/AuditEvent.java b/fe/fe-core/src/main/java/org/apache/doris/plugin/AuditEvent.java index 8eb539706c..6f8e3c18c9 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/plugin/AuditEvent.java +++ b/fe/fe-core/src/main/java/org/apache/doris/plugin/AuditEvent.java @@ -228,11 +228,6 @@ public class AuditEvent { return this; } - public AuditEventBuilder setTraceId(String traceId) { - auditEvent.traceId = traceId; - return this; - } - public AuditEventBuilder setFuzzyVariables(String variables) { auditEvent.fuzzyVariables = variables; return this; diff --git a/fe/fe-core/src/main/java/org/apache/doris/qe/AuditLogHelper.java b/fe/fe-core/src/main/java/org/apache/doris/qe/AuditLogHelper.java index 0ed0e90025..ff6e666172 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/qe/AuditLogHelper.java +++ b/fe/fe-core/src/main/java/org/apache/doris/qe/AuditLogHelper.java @@ -29,9 +29,6 @@ import org.apache.doris.plugin.AuditEvent.EventType; import org.apache.doris.qe.QueryState.MysqlStateType; import org.apache.doris.service.FrontendOptions; -import io.opentelemetry.api.trace.Span; -import io.opentelemetry.api.trace.SpanContext; -import io.opentelemetry.context.Context; import org.apache.commons.codec.digest.DigestUtils; public class AuditLogHelper { @@ -42,7 +39,6 @@ public class AuditLogHelper { // slow query long endTime = System.currentTimeMillis(); long elapseMs = endTime - ctx.getStartTime(); - SpanContext spanContext = Span.fromContext(Context.current()).getSpanContext(); ctx.getAuditEventBuilder().setEventType(EventType.AFTER_QUERY) .setDb(ClusterNamespace.getNameFromFullName(ctx.getDatabase())) @@ -58,7 +54,6 @@ public class AuditLogHelper { .setReturnRows(ctx.getReturnRows()) .setStmtId(ctx.getStmtId()) .setQueryId(ctx.queryId() == null ? "NaN" : DebugUtil.printId(ctx.queryId())) - .setTraceId(spanContext.isValid() ? spanContext.getTraceId() : "") .setWorkloadGroup(ctx.getWorkloadGroupName()) .setFuzzyVariables(!printFuzzyVariables ? "" : ctx.getSessionVariable().printFuzzyVariables()); diff --git a/fe/fe-core/src/main/java/org/apache/doris/qe/ConnectContext.java b/fe/fe-core/src/main/java/org/apache/doris/qe/ConnectContext.java index 183edb765c..989151ae1a 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/qe/ConnectContext.java +++ b/fe/fe-core/src/main/java/org/apache/doris/qe/ConnectContext.java @@ -25,7 +25,6 @@ import org.apache.doris.catalog.FunctionRegistry; import org.apache.doris.catalog.TableIf; import org.apache.doris.cluster.ClusterNamespace; import org.apache.doris.common.Config; -import org.apache.doris.common.telemetry.Telemetry; import org.apache.doris.common.util.DebugUtil; import org.apache.doris.common.util.TimeUtils; import org.apache.doris.datasource.CatalogIf; @@ -55,7 +54,6 @@ import com.google.common.base.Strings; import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.collect.Sets; -import io.opentelemetry.api.trace.Tracer; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.json.JSONObject; @@ -149,8 +147,6 @@ public class ConnectContext { // Cache thread info for this connection. protected volatile ThreadInfo threadInfo; - protected volatile Tracer tracer = Telemetry.getNoopTracer(); - // Catalog: put catalog here is convenient for unit test, // because catalog is singleton, hard to mock protected Env env; @@ -703,10 +699,6 @@ public class ConnectContext { } } - public void setTraceId(String traceId) { - this.traceId = traceId; - } - public String traceId() { return traceId; } @@ -739,14 +731,6 @@ public class ConnectContext { this.minidump = minidump; } - public Tracer getTracer() { - return tracer; - } - - public void initTracer(String name) { - this.tracer = Telemetry.getOpenTelemetry().getTracer(name); - } - public StatementContext getStatementContext() { return statementContext; } diff --git a/fe/fe-core/src/main/java/org/apache/doris/qe/ConnectProcessor.java b/fe/fe-core/src/main/java/org/apache/doris/qe/ConnectProcessor.java index 3885af944b..bf7a652fd9 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/qe/ConnectProcessor.java +++ b/fe/fe-core/src/main/java/org/apache/doris/qe/ConnectProcessor.java @@ -34,7 +34,6 @@ import org.apache.doris.common.DdlException; import org.apache.doris.common.ErrorCode; import org.apache.doris.common.NotImplementedException; import org.apache.doris.common.UserException; -import org.apache.doris.common.telemetry.Telemetry; import org.apache.doris.common.util.DebugUtil; import org.apache.doris.common.util.SqlParserUtils; import org.apache.doris.common.util.SqlUtils; @@ -59,11 +58,6 @@ import org.apache.doris.thrift.TUniqueId; import com.google.common.base.Preconditions; import com.google.common.base.Strings; -import io.opentelemetry.api.trace.Span; -import io.opentelemetry.api.trace.SpanKind; -import io.opentelemetry.context.Context; -import io.opentelemetry.context.Scope; -import io.opentelemetry.context.propagation.TextMapGetter; import org.apache.commons.codec.digest.DigestUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -72,9 +66,7 @@ import java.io.IOException; import java.io.StringReader; import java.nio.ByteBuffer; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.UUID; /** @@ -87,21 +79,6 @@ public abstract class ConnectProcessor { } private static final Logger LOG = LogManager.getLogger(ConnectProcessor.class); - protected static final TextMapGetter> getter = - new TextMapGetter>() { - @Override - public Iterable keys(Map carrier) { - return carrier.keySet(); - } - - @Override - public String get(Map carrier, String key) { - if (carrier.containsKey(key)) { - return carrier.get(key); - } - return ""; - } - }; protected final ConnectContext ctx; protected StmtExecutor executor = null; protected ConnectType connectType; @@ -292,8 +269,6 @@ public abstract class ConnectProcessor { executor.getQueryStatisticsForAuditLog()); // execute failed, skip remaining stmts break; - } finally { - executor.addProfileToSpan(); } } @@ -524,21 +499,6 @@ public abstract class ConnectProcessor { } } - Map traceCarrier = new HashMap<>(); - if (request.isSetTraceCarrier()) { - traceCarrier = request.getTraceCarrier(); - } - Context extractedContext = Telemetry.getOpenTelemetry().getPropagators().getTextMapPropagator() - .extract(Context.current(), traceCarrier, getter); - // What we want is for the Traceid to remain unchanged during propagation. - // ctx.initTracer() will be called only if the Context is valid, - // so that the Traceid generated by SDKTracer is the same as the follower. Otherwise, - // if the Context is invalid and ctx.initTracer() is called, - // SDKTracer will generate a different Traceid. - if (Span.fromContext(extractedContext).getSpanContext().isValid()) { - ctx.initTracer("master trace"); - } - ctx.setThreadLocalInfo(); StmtExecutor executor = null; try { @@ -560,6 +520,7 @@ public abstract class ConnectProcessor { } } } + TUniqueId queryId; // This query id will be set in ctx if (request.isSetQueryId()) { queryId = request.getQueryId(); @@ -567,17 +528,8 @@ public abstract class ConnectProcessor { UUID uuid = UUID.randomUUID(); queryId = new TUniqueId(uuid.getMostSignificantBits(), uuid.getLeastSignificantBits()); } - Span masterQuerySpan = - ctx.getTracer().spanBuilder("master execute").setParent(extractedContext) - .setSpanKind(SpanKind.SERVER).startSpan(); - try (Scope scope = masterQuerySpan.makeCurrent()) { - executor.execute(queryId); - } catch (Exception e) { - masterQuerySpan.recordException(e); - throw e; - } finally { - masterQuerySpan.end(); - } + + executor.execute(queryId); } catch (IOException e) { // Client failed. LOG.warn("Process one query failed because IOException: ", e); diff --git a/fe/fe-core/src/main/java/org/apache/doris/qe/Coordinator.java b/fe/fe-core/src/main/java/org/apache/doris/qe/Coordinator.java index 6475230b63..90fb91304c 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/qe/Coordinator.java +++ b/fe/fe-core/src/main/java/org/apache/doris/qe/Coordinator.java @@ -28,8 +28,6 @@ import org.apache.doris.common.Reference; import org.apache.doris.common.Status; import org.apache.doris.common.UserException; import org.apache.doris.common.profile.ExecutionProfile; -import org.apache.doris.common.telemetry.ScopedSpan; -import org.apache.doris.common.telemetry.Telemetry; import org.apache.doris.common.util.DebugUtil; import org.apache.doris.common.util.ListUtil; import org.apache.doris.common.util.RuntimeProfile; @@ -120,10 +118,6 @@ import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.collect.Multiset; import com.google.common.collect.Sets; -import io.opentelemetry.api.trace.Span; -import io.opentelemetry.api.trace.SpanKind; -import io.opentelemetry.context.Context; -import io.opentelemetry.context.Scope; import org.apache.commons.lang3.tuple.ImmutableTriple; import org.apache.commons.lang3.tuple.Triple; import org.apache.logging.log4j.LogManager; @@ -780,14 +774,8 @@ public class Coordinator implements CoordInterface { // 4. send and wait fragments rpc List>> futures = Lists.newArrayList(); - Context parentSpanContext = Context.current(); + for (BackendExecStates states : beToExecStates.values()) { - Span span = Telemetry.getNoopSpan(); - if (ConnectContext.get() != null) { - span = ConnectContext.get().getTracer().spanBuilder("execRemoteFragmentsAsync") - .setParent(parentSpanContext).setSpanKind(SpanKind.CLIENT).startSpan(); - } - states.scopedSpan = new ScopedSpan(span); states.unsetFields(); BackendServiceProxy proxy = BackendServiceProxy.getInstance(); futures.add(ImmutableTriple.of(states, proxy, states.execRemoteFragmentsAsync(proxy))); @@ -798,12 +786,6 @@ public class Coordinator implements CoordInterface { // 5. send and wait execution start rpc futures.clear(); for (BackendExecStates states : beToExecStates.values()) { - Span span = Telemetry.getNoopSpan(); - if (ConnectContext.get() != null) { - span = ConnectContext.get().getTracer().spanBuilder("execPlanFragmentStartAsync") - .setParent(parentSpanContext).setSpanKind(SpanKind.CLIENT).startSpan(); - } - states.scopedSpan = new ScopedSpan(span); BackendServiceProxy proxy = BackendServiceProxy.getInstance(); futures.add(ImmutableTriple.of(states, proxy, states.execPlanFragmentStartAsync(proxy))); } @@ -922,14 +904,8 @@ public class Coordinator implements CoordInterface { // 4. send and wait fragments rpc List>> futures = Lists.newArrayList(); - Context parentSpanContext = Context.current(); - for (PipelineExecContexts ctxs : beToPipelineExecCtxs.values()) { - Span span = Telemetry.getNoopSpan(); - if (ConnectContext.get() != null) { - span = ConnectContext.get().getTracer().spanBuilder("execRemoteFragmentsAsync") - .setParent(parentSpanContext).setSpanKind(SpanKind.CLIENT).startSpan(); - } + for (PipelineExecContexts ctxs : beToPipelineExecCtxs.values()) { if (LOG.isDebugEnabled()) { String infos = ""; for (PipelineExecContext pec : ctxs.ctxs) { @@ -939,7 +915,6 @@ public class Coordinator implements CoordInterface { DebugUtil.printId(queryId), infos, ctxs.beId, ctxs.brpcAddr.toString()); } - ctxs.scopedSpan = new ScopedSpan(span); ctxs.unsetFields(); BackendServiceProxy proxy = BackendServiceProxy.getInstance(); futures.add(ImmutableTriple.of(ctxs, proxy, ctxs.execRemoteFragmentsAsync(proxy))); @@ -950,12 +925,6 @@ public class Coordinator implements CoordInterface { // 5. send and wait execution start rpc futures.clear(); for (PipelineExecContexts ctxs : beToPipelineExecCtxs.values()) { - Span span = Telemetry.getNoopSpan(); - if (ConnectContext.get() != null) { - span = ConnectContext.get().getTracer().spanBuilder("execPlanFragmentStartAsync") - .setParent(parentSpanContext).setSpanKind(SpanKind.CLIENT).startSpan(); - } - ctxs.scopedSpan = new ScopedSpan(span); BackendServiceProxy proxy = BackendServiceProxy.getInstance(); futures.add(ImmutableTriple.of(ctxs, proxy, ctxs.execPlanFragmentStartAsync(proxy))); } @@ -981,7 +950,7 @@ public class Coordinator implements CoordInterface { TStatusCode code; String errMsg = null; Exception exception = null; - Span span = triple.getLeft().scopedSpan.getSpan(); + try { PExecPlanFragmentResult result = triple.getRight().get(timeoutMs, TimeUnit.MILLISECONDS); code = TStatusCode.findByValue(result.getStatus().getStatusCode()); @@ -1005,32 +974,25 @@ public class Coordinator implements CoordInterface { code = TStatusCode.TIMEOUT; } - try { - if (code != TStatusCode.OK) { - if (exception != null && errMsg == null) { - errMsg = operation + " failed. " + exception.getMessage(); - } - queryStatus.setStatus(errMsg); - cancelInternal(Types.PPlanFragmentCancelReason.INTERNAL_ERROR); - switch (code) { - case TIMEOUT: - MetricRepo.BE_COUNTER_QUERY_RPC_FAILED.getOrAdd(triple.getLeft().brpcAddr.hostname) - .increase(1L); - throw new RpcException(triple.getLeft().brpcAddr.hostname, errMsg, exception); - case THRIFT_RPC_ERROR: - MetricRepo.BE_COUNTER_QUERY_RPC_FAILED.getOrAdd(triple.getLeft().brpcAddr.hostname) - .increase(1L); - SimpleScheduler.addToBlacklist(triple.getLeft().beId, errMsg); - throw new RpcException(triple.getLeft().brpcAddr.hostname, errMsg, exception); - default: - throw new UserException(errMsg, exception); - } + if (code != TStatusCode.OK) { + if (exception != null && errMsg == null) { + errMsg = operation + " failed. " + exception.getMessage(); + } + queryStatus.setStatus(errMsg); + cancelInternal(Types.PPlanFragmentCancelReason.INTERNAL_ERROR); + switch (code) { + case TIMEOUT: + MetricRepo.BE_COUNTER_QUERY_RPC_FAILED.getOrAdd(triple.getLeft().brpcAddr.hostname) + .increase(1L); + throw new RpcException(triple.getLeft().brpcAddr.hostname, errMsg, exception); + case THRIFT_RPC_ERROR: + MetricRepo.BE_COUNTER_QUERY_RPC_FAILED.getOrAdd(triple.getLeft().brpcAddr.hostname) + .increase(1L); + SimpleScheduler.addToBlacklist(triple.getLeft().beId, errMsg); + throw new RpcException(triple.getLeft().brpcAddr.hostname, errMsg, exception); + default: + throw new UserException(errMsg, exception); } - } catch (Exception e) { - span.recordException(e); - throw e; - } finally { - triple.getLeft().scopedSpan.endSpan(); } } } @@ -1048,7 +1010,7 @@ public class Coordinator implements CoordInterface { TStatusCode code; String errMsg = null; Exception exception = null; - Span span = triple.getLeft().scopedSpan.getSpan(); + try { PExecPlanFragmentResult result = triple.getRight().get(timeoutMs, TimeUnit.MILLISECONDS); code = TStatusCode.findByValue(result.getStatus().getStatusCode()); @@ -1072,32 +1034,25 @@ public class Coordinator implements CoordInterface { code = TStatusCode.TIMEOUT; } - try { - if (code != TStatusCode.OK) { - if (exception != null && errMsg == null) { - errMsg = operation + " failed. " + exception.getMessage(); - } - queryStatus.setStatus(errMsg); - cancelInternal(Types.PPlanFragmentCancelReason.INTERNAL_ERROR); - switch (code) { - case TIMEOUT: - MetricRepo.BE_COUNTER_QUERY_RPC_FAILED.getOrAdd(triple.getLeft().brpcAddr.hostname) - .increase(1L); - throw new RpcException(triple.getLeft().brpcAddr.hostname, errMsg, exception); - case THRIFT_RPC_ERROR: - MetricRepo.BE_COUNTER_QUERY_RPC_FAILED.getOrAdd(triple.getLeft().brpcAddr.hostname) - .increase(1L); - SimpleScheduler.addToBlacklist(triple.getLeft().beId, errMsg); - throw new RpcException(triple.getLeft().brpcAddr.hostname, errMsg, exception); - default: - throw new UserException(errMsg, exception); - } + if (code != TStatusCode.OK) { + if (exception != null && errMsg == null) { + errMsg = operation + " failed. " + exception.getMessage(); + } + queryStatus.setStatus(errMsg); + cancelInternal(Types.PPlanFragmentCancelReason.INTERNAL_ERROR); + switch (code) { + case TIMEOUT: + MetricRepo.BE_COUNTER_QUERY_RPC_FAILED.getOrAdd(triple.getLeft().brpcAddr.hostname) + .increase(1L); + throw new RpcException(triple.getLeft().brpcAddr.hostname, errMsg, exception); + case THRIFT_RPC_ERROR: + MetricRepo.BE_COUNTER_QUERY_RPC_FAILED.getOrAdd(triple.getLeft().brpcAddr.hostname) + .increase(1L); + SimpleScheduler.addToBlacklist(triple.getLeft().beId, errMsg); + throw new RpcException(triple.getLeft().brpcAddr.hostname, errMsg, exception); + default: + throw new UserException(errMsg, exception); } - } catch (Exception e) { - span.recordException(e); - throw e; - } finally { - triple.getLeft().scopedSpan.endSpan(); } } } @@ -2490,7 +2445,7 @@ public class Coordinator implements CoordInterface { // (UpdateStatus() initiates cancellation, if it hasn't already been initiated) if (!(returnedAllResults && status.isCancelled()) && !status.ok()) { LOG.warn("one instance report fail, query_id={} fragment_id={} instance_id={}, be={}," - + " error message: {}", + + " error message: {}", DebugUtil.printId(queryId), params.getFragmentId(), DebugUtil.printId(params.getFragmentInstanceId()), params.getBackendId(), status.getErrorMsg()); @@ -2516,11 +2471,11 @@ public class Coordinator implements CoordInterface { updateErrorTabletInfos(params.getErrorTabletInfos()); } LOG.debug("Query {} instance {} is marked done", - DebugUtil.printId(queryId), DebugUtil.printId(params.getFragmentInstanceId())); + DebugUtil.printId(queryId), DebugUtil.printId(params.getFragmentInstanceId())); executionProfile.markOneInstanceDone(params.getFragmentInstanceId()); } else { LOG.debug("Query {} instance {} is not marked done", - DebugUtil.printId(queryId), DebugUtil.printId(params.getFragmentInstanceId())); + DebugUtil.printId(queryId), DebugUtil.printId(params.getFragmentInstanceId())); } } else { if (params.backend_num >= backendExecStates.size()) { @@ -2998,20 +2953,13 @@ public class Coordinator implements CoordInterface { return false; } - Span span = ConnectContext.get() != null - ? ConnectContext.get().getTracer().spanBuilder("cancelPlanFragmentAsync") - .setParent(Context.current()).setSpanKind(SpanKind.CLIENT).startSpan() - : Telemetry.getNoopSpan(); - try (Scope scope = span.makeCurrent()) { + try { BackendServiceProxy.getInstance().cancelPlanFragmentAsync(brpcAddress, fragmentInstanceId(), cancelReason); } catch (RpcException e) { - span.recordException(e); LOG.warn("cancel plan fragment get a exception, address={}:{}", brpcAddress.getHostname(), brpcAddress.getPort()); SimpleScheduler.addToBlacklist(addressToBackendID.get(brpcAddress), e.getMessage()); - } finally { - span.end(); } this.hasCanceled = true; @@ -3194,20 +3142,13 @@ public class Coordinator implements CoordInterface { this.hasCanceled = true; try { - Span span = ConnectContext.get() != null - ? ConnectContext.get().getTracer().spanBuilder("cancelPlanFragmentAsync") - .setParent(Context.current()).setSpanKind(SpanKind.CLIENT).startSpan() - : Telemetry.getNoopSpan(); - try (Scope scope = span.makeCurrent()) { + try { BackendServiceProxy.getInstance().cancelPlanFragmentAsync(brpcAddress, localParam.fragment_instance_id, cancelReason); } catch (RpcException e) { - span.recordException(e); LOG.warn("cancel plan fragment get a exception, address={}:{}", brpcAddress.getHostname(), brpcAddress.getPort()); SimpleScheduler.addToBlacklist(addressToBackendID.get(brpcAddress), e.getMessage()); - } finally { - span.end(); } } catch (Exception e) { LOG.warn("catch a exception", e); @@ -3258,7 +3199,6 @@ public class Coordinator implements CoordInterface { TNetworkAddress brpcAddr; List states = Lists.newArrayList(); boolean twoPhaseExecution = false; - ScopedSpan scopedSpan = new ScopedSpan(); long beProcessEpoch = 0; public BackendExecStates(long beId, TNetworkAddress brpcAddr, boolean twoPhaseExecution, long beProcessEpoch) { @@ -3357,7 +3297,6 @@ public class Coordinator implements CoordInterface { TNetworkAddress brpcAddr; List ctxs = Lists.newArrayList(); boolean twoPhaseExecution = false; - ScopedSpan scopedSpan = new ScopedSpan(); int instanceNumber; public PipelineExecContexts(long beId, TNetworkAddress brpcAddr, boolean twoPhaseExecution, diff --git a/fe/fe-core/src/main/java/org/apache/doris/qe/MasterOpExecutor.java b/fe/fe-core/src/main/java/org/apache/doris/qe/MasterOpExecutor.java index 5c15007ffa..76763a2264 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/qe/MasterOpExecutor.java +++ b/fe/fe-core/src/main/java/org/apache/doris/qe/MasterOpExecutor.java @@ -21,7 +21,6 @@ import org.apache.doris.analysis.RedirectStatus; import org.apache.doris.catalog.Env; import org.apache.doris.common.ClientPool; import org.apache.doris.common.DdlException; -import org.apache.doris.common.telemetry.Telemetry; import org.apache.doris.thrift.FrontendService; import org.apache.doris.thrift.TMasterOpRequest; import org.apache.doris.thrift.TMasterOpResult; @@ -29,16 +28,12 @@ import org.apache.doris.thrift.TNetworkAddress; import org.apache.doris.thrift.TUniqueId; import com.google.common.collect.ImmutableMap; -import io.opentelemetry.api.trace.Span; -import io.opentelemetry.context.Context; -import io.opentelemetry.context.Scope; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.apache.thrift.TException; import org.apache.thrift.transport.TTransportException; import java.nio.ByteBuffer; -import java.util.HashMap; import java.util.Map; public class MasterOpExecutor { @@ -77,17 +72,7 @@ public class MasterOpExecutor { } public void execute() throws Exception { - Span forwardSpan = - ctx.getTracer().spanBuilder("forward").setParent(Context.current()) - .startSpan(); - try (Scope ignored = forwardSpan.makeCurrent()) { - result = forward(buildStmtForwardParams()); - } catch (Exception e) { - forwardSpan.recordException(e); - throw e; - } finally { - forwardSpan.end(); - } + result = forward(buildStmtForwardParams()); waitOnReplaying(); } @@ -179,14 +164,6 @@ public class MasterOpExecutor { // session variables params.setSessionVariables(ctx.getSessionVariable().getForwardVariables()); - // create a trace carrier - Map traceCarrier = new HashMap<>(); - // Inject the request with the current context - Telemetry.getOpenTelemetry().getPropagators().getTextMapPropagator() - .inject(Context.current(), traceCarrier, (carrier, key, value) -> carrier.put(key, value)); - // carrier send tracing to master - params.setTraceCarrier(traceCarrier); - if (null != ctx.queryId()) { params.setQueryId(ctx.queryId()); } diff --git a/fe/fe-core/src/main/java/org/apache/doris/qe/MysqlConnectProcessor.java b/fe/fe-core/src/main/java/org/apache/doris/qe/MysqlConnectProcessor.java index 63781d2add..1ef617cb2d 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/qe/MysqlConnectProcessor.java +++ b/fe/fe-core/src/main/java/org/apache/doris/qe/MysqlConnectProcessor.java @@ -27,8 +27,6 @@ import org.apache.doris.mysql.MysqlChannel; import org.apache.doris.mysql.MysqlCommand; import org.apache.doris.mysql.MysqlProto; -import io.opentelemetry.api.trace.Span; -import io.opentelemetry.context.Scope; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -186,16 +184,7 @@ public class MysqlConnectProcessor extends ConnectProcessor { case COM_QUERY: case COM_STMT_PREPARE: // Process COM_QUERY statement, - ctx.initTracer("trace"); - Span rootSpan = ctx.getTracer().spanBuilder("handleQuery").setNoParent().startSpan(); - try (Scope scope = rootSpan.makeCurrent()) { - handleQuery(command); - } catch (Exception e) { - rootSpan.recordException(e); - throw e; - } finally { - rootSpan.end(); - } + handleQuery(command); break; case COM_STMT_EXECUTE: handleExecute(); diff --git a/fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java b/fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java index 49a3e45608..5656ce9d4f 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java +++ b/fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java @@ -178,9 +178,6 @@ import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.collect.Sets; import com.google.protobuf.ByteString; -import io.opentelemetry.api.trace.Span; -import io.opentelemetry.context.Context; -import io.opentelemetry.context.Scope; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.apache.thrift.TException; @@ -338,16 +335,6 @@ public class StmtExecutor { return builder.build(); } - public void addProfileToSpan() { - Span span = Span.fromContext(Context.current()); - if (!span.isRecording()) { - return; - } - for (Map.Entry entry : getSummaryInfo(true).entrySet()) { - span.setAttribute(entry.getKey(), entry.getValue()); - } - } - public Planner planner() { return planner; } @@ -448,11 +435,11 @@ public class StmtExecutor { public void execute(TUniqueId queryId) throws Exception { SessionVariable sessionVariable = context.getSessionVariable(); - Span executeSpan = context.getTracer().spanBuilder("execute").setParent(Context.current()).startSpan(); if (context.getConnectType() == ConnectType.ARROW_FLIGHT_SQL) { context.setReturnResultFromLocal(true); } - try (Scope scope = executeSpan.makeCurrent()) { + + try { if (parsedStmt instanceof LogicalPlanAdapter || (parsedStmt == null && sessionVariable.isEnableNereidsPlanner())) { try { @@ -479,7 +466,6 @@ public class StmtExecutor { executeByLegacy(queryId); } } finally { - executeSpan.end(); // revert Session Value try { VariableMgr.revertSessionValue(sessionVariable); @@ -712,17 +698,9 @@ public class StmtExecutor { analyzeVariablesInStmt(); if (!context.isTxnModel()) { - Span queryAnalysisSpan = - context.getTracer().spanBuilder("query analysis").setParent(Context.current()).startSpan(); - try (Scope ignored = queryAnalysisSpan.makeCurrent()) { - // analyze this query - analyze(context.getSessionVariable().toThrift()); - } catch (Exception e) { - queryAnalysisSpan.recordException(e); - throw e; - } finally { - queryAnalysisSpan.end(); - } + // analyze this query + analyze(context.getSessionVariable().toThrift()); + if (isForwardToMaster()) { if (context.getCommand() == MysqlCommand.COM_STMT_PREPARE) { throw new UserException("Forward master command is not supported for prepare statement"); @@ -1474,16 +1452,9 @@ public class StmtExecutor { profile.addExecutionProfile(coord.getExecutionProfile()); coordBase = coord; } - Span queryScheduleSpan = - context.getTracer().spanBuilder("query schedule").setParent(Context.current()).startSpan(); - try (Scope scope = queryScheduleSpan.makeCurrent()) { - coordBase.exec(); - } catch (Exception e) { - queryScheduleSpan.recordException(e); - throw e; - } finally { - queryScheduleSpan.end(); - } + + coordBase.exec(); + profile.getSummaryProfile().setQueryScheduleFinishTime(); updateProfile(false); if (coordBase.getInstanceTotalNum() > 1 && LOG.isDebugEnabled()) { @@ -1513,8 +1484,7 @@ public class StmtExecutor { return; } - Span fetchResultSpan = context.getTracer().spanBuilder("fetch result").setParent(Context.current()).startSpan(); - try (Scope scope = fetchResultSpan.makeCurrent()) { + try { while (true) { // register the fetch result time. profile.getSummaryProfile().setTempStartTime(); @@ -1587,10 +1557,8 @@ public class StmtExecutor { // details see issue https://github.com/apache/doris/issues/16203 LOG.warn("cancel fragment query_id:{} cause {}", DebugUtil.printId(context.queryId()), e.getMessage()); coordBase.cancel(Types.PPlanFragmentCancelReason.INTERNAL_ERROR); - fetchResultSpan.recordException(e); throw e; } finally { - fetchResultSpan.end(); if (coordBase.getInstanceTotalNum() > 1 && LOG.isDebugEnabled()) { try { LOG.debug("Finish to execute fragment. user: {}, db: {}, sql: {}, fragment instance num: {}", @@ -2712,19 +2680,13 @@ public class StmtExecutor { throw new RuntimeException("Failed to execute internal SQL. " + Util.getRootCauseMessage(e), e); } - Span queryScheduleSpan = context.getTracer() - .spanBuilder("internal SQL schedule").setParent(Context.current()).startSpan(); - try (Scope scope = queryScheduleSpan.makeCurrent()) { + try { coord.exec(); } catch (Exception e) { - queryScheduleSpan.recordException(e); throw new InternalQueryExecutionException(e.getMessage() + Util.getRootCauseMessage(e), e); - } finally { - queryScheduleSpan.end(); } - Span fetchResultSpan = context.getTracer().spanBuilder("fetch internal SQL result") - .setParent(Context.current()).startSpan(); - try (Scope scope = fetchResultSpan.makeCurrent()) { + + try { while (true) { batch = coord.getNext(); if (batch == null || batch.isEos()) { @@ -2734,10 +2696,7 @@ public class StmtExecutor { } } } catch (Exception e) { - fetchResultSpan.recordException(e); throw new RuntimeException("Failed to fetch internal SQL result. " + Util.getRootCauseMessage(e), e); - } finally { - fetchResultSpan.end(); } } finally { AuditLogHelper.logAuditLog(context, originStmt.toString(), parsedStmt, getQueryStatisticsForAuditLog(), diff --git a/fe/fe-core/src/main/java/org/apache/doris/qe/VariableVarCallbacks.java b/fe/fe-core/src/main/java/org/apache/doris/qe/VariableVarCallbacks.java index f1dc5e69c3..8726f894f8 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/qe/VariableVarCallbacks.java +++ b/fe/fe-core/src/main/java/org/apache/doris/qe/VariableVarCallbacks.java @@ -63,10 +63,6 @@ public class VariableVarCallbacks { if (innerParts.length != 2) { continue; } - if (innerParts[0].equals("trace_id")) { - ConnectContext.get().setTraceId(innerParts[1]); - break; - } } } } diff --git a/fe/fe-core/src/main/java/org/apache/doris/rpc/BackendServiceClient.java b/fe/fe-core/src/main/java/org/apache/doris/rpc/BackendServiceClient.java index 866c0d8546..17ba83eb63 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/rpc/BackendServiceClient.java +++ b/fe/fe-core/src/main/java/org/apache/doris/rpc/BackendServiceClient.java @@ -18,22 +18,13 @@ package org.apache.doris.rpc; import org.apache.doris.common.Config; -import org.apache.doris.common.telemetry.Telemetry; import org.apache.doris.proto.InternalService; import org.apache.doris.proto.PBackendServiceGrpc; import org.apache.doris.thrift.TNetworkAddress; -import io.grpc.CallOptions; -import io.grpc.Channel; -import io.grpc.ClientCall; -import io.grpc.ClientInterceptor; import io.grpc.ConnectivityState; -import io.grpc.ForwardingClientCall; import io.grpc.ManagedChannel; -import io.grpc.Metadata; -import io.grpc.MethodDescriptor; import io.grpc.netty.NettyChannelBuilder; -import io.opentelemetry.context.Context; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -58,7 +49,7 @@ public class BackendServiceClient { .flowControlWindow(Config.grpc_max_message_size_bytes) .keepAliveWithoutCalls(true) .maxInboundMessageSize(Config.grpc_max_message_size_bytes).enableRetry().maxRetryAttempts(MAX_RETRY_NUM) - .intercept(new OpenTelemetryClientInterceptor()).usePlaintext().build(); + .usePlaintext().build(); stub = PBackendServiceGrpc.newFutureStub(channel); blockingStub = PBackendServiceGrpc.newBlockingStub(channel); // execPlanTimeout should be greater than future.get timeout, otherwise future will throw ExecutionException @@ -69,8 +60,8 @@ public class BackendServiceClient { public boolean isNormalState() { ConnectivityState state = channel.getState(false); return state == ConnectivityState.CONNECTING - || state == ConnectivityState.IDLE - || state == ConnectivityState.READY; + || state == ConnectivityState.IDLE + || state == ConnectivityState.READY; } public Future execPlanFragmentAsync( @@ -195,25 +186,4 @@ public class BackendServiceClient { LOG.warn("shut down backend service client: {}", address); } - - /** - * OpenTelemetry span interceptor. - */ - public static class OpenTelemetryClientInterceptor implements ClientInterceptor { - @Override - public ClientCall interceptCall(MethodDescriptor methodDescriptor, - CallOptions callOptions, Channel channel) { - return new ForwardingClientCall.SimpleForwardingClientCall( - channel.newCall(methodDescriptor, callOptions)) { - @Override - public void start(Listener responseListener, Metadata headers) { - // Inject the request with the current context - Telemetry.getOpenTelemetry().getPropagators().getTextMapPropagator() - .inject(Context.current(), headers, (carrier, key, value) -> carrier.put( - Metadata.Key.of(key, Metadata.ASCII_STRING_MARSHALLER), value)); - super.start(responseListener, headers); - } - }; - } - } } diff --git a/fe/fe-core/src/main/java/org/apache/doris/service/arrowflight/FlightSqlConnectProcessor.java b/fe/fe-core/src/main/java/org/apache/doris/service/arrowflight/FlightSqlConnectProcessor.java index ef5b53c2d1..ae353fdb03 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/service/arrowflight/FlightSqlConnectProcessor.java +++ b/fe/fe-core/src/main/java/org/apache/doris/service/arrowflight/FlightSqlConnectProcessor.java @@ -34,8 +34,6 @@ import org.apache.doris.thrift.TNetworkAddress; import org.apache.doris.thrift.TStatusCode; import org.apache.doris.thrift.TUniqueId; -import io.opentelemetry.api.trace.Span; -import io.opentelemetry.context.Scope; import org.apache.arrow.memory.RootAllocator; import org.apache.arrow.vector.FieldVector; import org.apache.arrow.vector.VectorSchemaRoot; @@ -86,16 +84,7 @@ public class FlightSqlConnectProcessor extends ConnectProcessor implements AutoC prepare(command); ctx.setRunningQuery(query); - ctx.initTracer("trace"); - Span rootSpan = ctx.getTracer().spanBuilder("handleQuery").setNoParent().startSpan(); - try (Scope scope = rootSpan.makeCurrent()) { - handleQuery(command, query); - } catch (Exception e) { - rootSpan.recordException(e); - throw e; - } finally { - rootSpan.end(); - } + handleQuery(command, query); } // TODO diff --git a/fe/fe-core/src/test/java/org/apache/doris/qe/OlapQueryCacheTest.java b/fe/fe-core/src/test/java/org/apache/doris/qe/OlapQueryCacheTest.java index 29201d0871..0179e9cf7e 100644 --- a/fe/fe-core/src/test/java/org/apache/doris/qe/OlapQueryCacheTest.java +++ b/fe/fe-core/src/test/java/org/apache/doris/qe/OlapQueryCacheTest.java @@ -48,7 +48,6 @@ import org.apache.doris.common.Config; import org.apache.doris.common.FeConstants; import org.apache.doris.common.UserException; import org.apache.doris.common.jmockit.Deencapsulation; -import org.apache.doris.common.telemetry.Telemetry; import org.apache.doris.common.util.SqlParserUtils; import org.apache.doris.common.util.Util; import org.apache.doris.datasource.CatalogMgr; @@ -304,10 +303,6 @@ public class OlapQueryCacheTest { minTimes = 0; result = 1L; - ctx.getTracer(); - minTimes = 0; - result = Telemetry.getNoopTracer(); - ctx.getCurrentCatalog(); minTimes = 0; result = catalog; diff --git a/fe/pom.xml b/fe/pom.xml index d47dfa681d..19d2065698 100644 --- a/fe/pom.xml +++ b/fe/pom.xml @@ -307,7 +307,6 @@ under the License. 12.2.0.1 3.4.14 2.3 - 1.26.0 2.4.0 1.70 6.5.1 @@ -382,29 +381,6 @@ under the License. aws-java-sdk-bundle ${aws-java-sdk.version} - - - io.opentelemetry - opentelemetry-api - ${opentelemetry.version} - - - - io.opentelemetry - opentelemetry-sdk - ${opentelemetry.version} - - - - io.opentelemetry - opentelemetry-exporter-otlp - ${opentelemetry.version} - - - io.opentelemetry - opentelemetry-exporter-zipkin - ${opentelemetry.version} - org.apache.orc orc-core diff --git a/thirdparty/build-thirdparty.sh b/thirdparty/build-thirdparty.sh index d6a2e2a1e2..a1913700d6 100755 --- a/thirdparty/build-thirdparty.sh +++ b/thirdparty/build-thirdparty.sh @@ -1591,39 +1591,6 @@ build_nlohmann_json() { "${BUILD_SYSTEM}" install } -# opentelemetry -build_opentelemetry() { - check_if_source_exist "${OPENTELEMETRY_SOURCE}" - cd "${TP_SOURCE_DIR}/${OPENTELEMETRY_SOURCE}" - - mkdir -p "${BUILD_DIR}" - cd "${BUILD_DIR}" - - CXXFLAGS="-O2 -I${TP_INCLUDE_DIR}" \ - LDFLAGS="-L${TP_LIB_DIR}" \ - "${CMAKE_CMD}" -G "${GENERATOR}" -DCMAKE_INSTALL_PREFIX="${TP_INSTALL_DIR}" \ - -DCMAKE_PREFIX_PATH="${TP_INSTALL_DIR}" \ - -DBUILD_TESTING=OFF \ - -DWITH_OTLP_GRPC=ON \ - -DBUILD_SHARED_LIBS=OFF \ - -DWITH_OTLP_HTTP=ON \ - -DWITH_ABSEIL=ON \ - -DWITH_FUNC_TESTS=OFF \ - -DWITH_ZIPKIN=ON \ - -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ - -DWITH_EXAMPLES=OFF .. - - "${BUILD_SYSTEM}" -j "${PARALLEL}" - "${BUILD_SYSTEM}" install - strip_lib libopentelemetry_exporter_zipkin_trace.a - strip_lib libopentelemetry_trace.a - strip_lib libopentelemetry_proto.a - strip_lib libopentelemetry_resources.a - strip_lib libopentelemetry_exporter_ostream_span.a - strip_lib libopentelemetry_http_client_curl.a - strip_lib libopentelemetry_exporter_otlp_http_client.a -} - # sse2neon build_sse2neon() { check_if_source_exist "${SSE2NEON_SOURCE}" @@ -1779,7 +1746,6 @@ if [[ "${#packages[@]}" -eq 0 ]]; then benchmark simdjson nlohmann_json - opentelemetry libbacktrace sse2neon xxhash diff --git a/thirdparty/download-thirdparty.sh b/thirdparty/download-thirdparty.sh index 2bb396b24b..e8c45fa86b 100755 --- a/thirdparty/download-thirdparty.sh +++ b/thirdparty/download-thirdparty.sh @@ -315,23 +315,6 @@ if [[ "${ROCKSDB_SOURCE}" == "rocksdb-5.14.2" ]]; then fi echo "Finished patching ${ROCKSDB_SOURCE}" -# opentelemetry patch is used to solve the problem that threadlocal depends on GLIBC_2.18 -# fix error: unknown type name 'uint64_t' -# see: https://github.com/apache/doris/pull/7911 -if [[ "${OPENTELEMETRY_SOURCE}" == "opentelemetry-cpp-1.10.0" ]]; then - rm -rf "${TP_SOURCE_DIR}/${OPENTELEMETRY_SOURCE}/third_party/opentelemetry-proto"/* - cp -r "${TP_SOURCE_DIR}/${OPENTELEMETRY_PROTO_SOURCE}"/* "${TP_SOURCE_DIR}/${OPENTELEMETRY_SOURCE}/third_party/opentelemetry-proto" - mkdir -p "${TP_SOURCE_DIR}/${OPENTELEMETRY_SOURCE}/third_party/opentelemetry-proto/.git" - - cd "${TP_SOURCE_DIR}/${OPENTELEMETRY_SOURCE}" - if [[ ! -f "${PATCHED_MARK}" ]]; then - patch -p1 <"${TP_PATCH_DIR}/opentelemetry-cpp-1.10.0.patch" - touch "${PATCHED_MARK}" - fi - cd - -fi -echo "Finished patching ${OPENTELEMETRY_SOURCE}" - # arrow patch is used to get the raw orc reader for filter prune. if [[ "${ARROW_SOURCE}" == "arrow-apache-arrow-13.0.0" ]]; then cd "${TP_SOURCE_DIR}/${ARROW_SOURCE}" diff --git a/thirdparty/vars.sh b/thirdparty/vars.sh index e816320fdf..c5c55d4fda 100644 --- a/thirdparty/vars.sh +++ b/thirdparty/vars.sh @@ -430,18 +430,6 @@ NLOHMANN_JSON_NAME=json-3.10.1.tar.gz NLOHMANN_JSON_SOURCE=json-3.10.1 NLOHMANN_JSON_MD5SUM="7b369d567afc0dffdcf5800fd9abb836" -# opentelemetry-proto -OPENTELEMETRY_PROTO_DOWNLOAD="https://github.com/open-telemetry/opentelemetry-proto/archive/refs/tags/v1.0.0.tar.gz" -OPENTELEMETRY_PROTO_NAME="opentelemetry-proto-v1.0.0.tar.gz" -OPENTELEMETRY_PROTO_SOURCE=opentelemetry-proto-1.0.0 -OPENTELEMETRY_PROTO_MD5SUM="8c7495a0dceea7cfdbdbcd53b07436dc" - -# opentelemetry -OPENTELEMETRY_DOWNLOAD="https://github.com/open-telemetry/opentelemetry-cpp/archive/refs/tags/v1.10.0.tar.gz" -OPENTELEMETRY_NAME="opentelemetry-cpp-v1.10.0.tar.gz" -OPENTELEMETRY_SOURCE=opentelemetry-cpp-1.10.0 -OPENTELEMETRY_MD5SUM="89169762241b2f5142b728c775173283" - # libbacktrace LIBBACKTRACE_DOWNLOAD="https://codeload.github.com/ianlancetaylor/libbacktrace/zip/2446c66076480ce07a6bd868badcbceb3eeecc2e" LIBBACKTRACE_NAME=libbacktrace-2446c66076480ce07a6bd868badcbceb3eeecc2e.zip @@ -552,8 +540,6 @@ export TP_ARCHIVES=( 'XSIMD' 'SIMDJSON' 'NLOHMANN_JSON' - 'OPENTELEMETRY_PROTO' - 'OPENTELEMETRY' 'LIBBACKTRACE' 'SSE2NEON' 'XXHASH'