You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2022/07/14 13:07:07 UTC

[GitHub] [doris] luozenglin opened a new pull request, #10864: [tracing] Support opentelemtry collector.

luozenglin opened a new pull request, #10864:
URL: https://github.com/apache/doris/pull/10864

   1. support for exporting traces to multiple distributed tracing system via collector;
   2. support using collector to process traces.
   
   # Proposed changes
   
   Issue Number: close #xxx
   DSIP: https://cwiki.apache.org/confluence/display/DORIS/DSIP-012%3A+Introduce+opentelemetry
   
   ## Problem Summary:
   
   Describe the overview of changes.
   
   ## Checklist(Required)
   
   1. Does it affect the original behavior: (Yes/No/I Don't know)
   2. Has unit tests been added: (Yes/No/No Need)
   3. Has document been added or modified: (Yes/No/No Need)
   4. Does it need to update dependencies: (Yes/No)
   5. Are there any changes that cannot be rolled back: (Yes/No)
   
   ## Further comments
   
   If this is a relatively large or complex change, kick off the discussion at [dev@doris.apache.org](mailto:dev@doris.apache.org) by explaining why you chose the solution you did and what alternatives you considered, etc...
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] luozenglin commented on a diff in pull request #10864: [tracing] Support opentelemtry collector.

Posted by GitBox <gi...@apache.org>.
luozenglin commented on code in PR #10864:
URL: https://github.com/apache/doris/pull/10864#discussion_r928553400


##########
be/src/util/telemetry/telemetry.cpp:
##########
@@ -34,16 +35,24 @@ 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;
 
-void doris::telemetry::initTracer() {
+void doris::telemetry::init_tracer() {
     if (!doris::config::enable_tracing) {
         return;
     }
 
-    // ZipkinExporter converts span to zipkin's format and exports span to zipkin.
-    zipkin::ZipkinExporterOptions opts;
-    opts.endpoint = doris::config::trace_export_url;
-    auto exporter = std::unique_ptr<trace_sdk::SpanExporter>(new zipkin::ZipkinExporter(opts));
+    std::unique_ptr<trace_sdk::SpanExporter> exporter = nullptr;
+    if (doris::config::enable_otel_collector) {

Review Comment:
   done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] github-actions[bot] commented on pull request #10864: [tracing] Support opentelemtry collector.

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #10864:
URL: https://github.com/apache/doris/pull/10864#issuecomment-1192135135

   PR approved by anyone and no changes requested.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] yangzhg commented on a diff in pull request #10864: [tracing] Support opentelemtry collector.

Posted by GitBox <gi...@apache.org>.
yangzhg commented on code in PR #10864:
URL: https://github.com/apache/doris/pull/10864#discussion_r921847304


##########
be/src/util/telemetry/telemetry.cpp:
##########
@@ -34,16 +35,24 @@ 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;
 
-void doris::telemetry::initTracer() {
+void doris::telemetry::init_tracer() {
     if (!doris::config::enable_tracing) {
         return;
     }
 
-    // ZipkinExporter converts span to zipkin's format and exports span to zipkin.
-    zipkin::ZipkinExporterOptions opts;
-    opts.endpoint = doris::config::trace_export_url;
-    auto exporter = std::unique_ptr<trace_sdk::SpanExporter>(new zipkin::ZipkinExporter(opts));
+    std::unique_ptr<trace_sdk::SpanExporter> exporter {};

Review Comment:
   ```suggestion
       std::unique_ptr<trace_sdk::SpanExporter> exporter = std::make_unique<trace_sdk::SpanExporter>();
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] github-actions[bot] commented on pull request #10864: [tracing] Support opentelemtry collector.

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #10864:
URL: https://github.com/apache/doris/pull/10864#issuecomment-1192135117

   PR approved by at least one committer and no changes requested.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] yangzhg commented on a diff in pull request #10864: [tracing] Support opentelemtry collector.

Posted by GitBox <gi...@apache.org>.
yangzhg commented on code in PR #10864:
URL: https://github.com/apache/doris/pull/10864#discussion_r921856419


##########
be/src/util/telemetry/telemetry.cpp:
##########
@@ -34,16 +35,24 @@ 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;
 
-void doris::telemetry::initTracer() {
+void doris::telemetry::init_tracer() {
     if (!doris::config::enable_tracing) {
         return;
     }
 
-    // ZipkinExporter converts span to zipkin's format and exports span to zipkin.
-    zipkin::ZipkinExporterOptions opts;
-    opts.endpoint = doris::config::trace_export_url;
-    auto exporter = std::unique_ptr<trace_sdk::SpanExporter>(new zipkin::ZipkinExporter(opts));
+    std::unique_ptr<trace_sdk::SpanExporter> exporter {};
+    if (doris::config::enable_otel_collector) {
+        otlp::OtlpHttpExporterOptions opts {};
+        opts.url = doris::config::trace_export_url;
+        exporter.reset(new otlp::OtlpHttpExporter(opts));
+    } else {
+        // ZipkinExporter converts span to zipkin's format and exports span to zipkin.
+        zipkin::ZipkinExporterOptions opts;
+        opts.endpoint = doris::config::trace_export_url;
+        exporter.reset(new zipkin::ZipkinExporter(opts));
+    }

Review Comment:
   the reset is useless



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] morningman commented on a diff in pull request #10864: [tracing] Support opentelemtry collector.

Posted by GitBox <gi...@apache.org>.
morningman commented on code in PR #10864:
URL: https://github.com/apache/doris/pull/10864#discussion_r928359290


##########
be/src/util/telemetry/telemetry.cpp:
##########
@@ -34,16 +35,24 @@ 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;
 
-void doris::telemetry::initTracer() {
+void doris::telemetry::init_tracer() {
     if (!doris::config::enable_tracing) {
         return;
     }
 
-    // ZipkinExporter converts span to zipkin's format and exports span to zipkin.
-    zipkin::ZipkinExporterOptions opts;
-    opts.endpoint = doris::config::trace_export_url;
-    auto exporter = std::unique_ptr<trace_sdk::SpanExporter>(new zipkin::ZipkinExporter(opts));
+    std::unique_ptr<trace_sdk::SpanExporter> exporter = nullptr;
+    if (doris::config::enable_otel_collector) {

Review Comment:
   maybe we should use `tracing_collector_type` config instead of `enable_otel_collector`?
   So that if we support the 3rd type of collectors, we can simply name it.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] github-actions[bot] commented on pull request #10864: [tracing] Support opentelemtry collector.

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #10864:
URL: https://github.com/apache/doris/pull/10864#issuecomment-1197546783

   PR approved by at least one committer and no changes requested.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] github-actions[bot] commented on pull request #10864: [tracing] Support opentelemtry collector.

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #10864:
URL: https://github.com/apache/doris/pull/10864#issuecomment-1198794871

   PR approved by at least one committer and no changes requested.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] yiguolei merged pull request #10864: [tracing] Support opentelemtry collector.

Posted by GitBox <gi...@apache.org>.
yiguolei merged PR #10864:
URL: https://github.com/apache/doris/pull/10864


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org