You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "lidavidm (via GitHub)" <gi...@apache.org> on 2023/03/02 23:48:02 UTC

[GitHub] [arrow] lidavidm commented on a diff in pull request #34419: GH-34417: [C++][Flight] Upgrade OpenTelemetry SemanticConventions header

lidavidm commented on code in PR #34419:
URL: https://github.com/apache/arrow/pull/34419#discussion_r1123874557


##########
cpp/src/arrow/flight/server_tracing_middleware.cc:
##########
@@ -29,15 +29,31 @@
 #include <opentelemetry/context/propagation/global_propagator.h>
 #include <opentelemetry/context/propagation/text_map_propagator.h>
 #include <opentelemetry/trace/context.h>
-#include <opentelemetry/trace/experimental_semantic_conventions.h>
 #include <opentelemetry/trace/propagation/http_trace_context.h>
+#include <opentelemetry/trace/semantic_conventions.h>
 #endif
 
 namespace arrow {
 namespace flight {
 
 #ifdef ARROW_WITH_OPENTELEMETRY
 namespace otel = opentelemetry;
+
+// TODO: Update this once opentelemetry-cpp exposes minor version as a macro
+// https://github.com/open-telemetry/opentelemetry-cpp/issues/2012
+// TODO: Remove once we drop support for opentelemetry-cpp < 1.8.0
+// They switched from ALL_CAPS to kConstantFormat in 1.8.0. But we can't check
+// the minor version until they expose that. So, for now, we vendor these constants.
+namespace SemanticConventions {
+static constexpr const char* kRpcGrpcStatusCode = "rpc.grpc.status_code";

Review Comment:
   nit: maybe const std::string_view to prefer new-style vs raw C constants?



##########
cpp/src/arrow/flight/server_tracing_middleware.cc:
##########
@@ -29,15 +29,31 @@
 #include <opentelemetry/context/propagation/global_propagator.h>
 #include <opentelemetry/context/propagation/text_map_propagator.h>
 #include <opentelemetry/trace/context.h>
-#include <opentelemetry/trace/experimental_semantic_conventions.h>
 #include <opentelemetry/trace/propagation/http_trace_context.h>
+#include <opentelemetry/trace/semantic_conventions.h>
 #endif
 
 namespace arrow {
 namespace flight {
 
 #ifdef ARROW_WITH_OPENTELEMETRY
 namespace otel = opentelemetry;
+
+// TODO: Update this once opentelemetry-cpp exposes minor version as a macro
+// https://github.com/open-telemetry/opentelemetry-cpp/issues/2012
+// TODO: Remove once we drop support for opentelemetry-cpp < 1.8.0
+// They switched from ALL_CAPS to kConstantFormat in 1.8.0. But we can't check
+// the minor version until they expose that. So, for now, we vendor these constants.
+namespace SemanticConventions {

Review Comment:
   This isn't too bad fortunately, since the actual values are supposed to be standardized



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

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

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