Skip to content

Commit

Permalink
[BUILD] Upgrade to opentelemetry-proto 1.3.1 (#2669)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcalff authored May 16, 2024
1 parent 4edcebd commit 2db27dd
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 9 deletions.
6 changes: 3 additions & 3 deletions bazel/repository.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,10 @@ def opentelemetry_cpp_deps():
http_archive,
name = "com_github_opentelemetry_proto",
build_file = "@io_opentelemetry_cpp//bazel:opentelemetry_proto.BUILD",
sha256 = "516dc94685dbaa14fb792788f31d2ef2b0c3ad08dfa8a9a8164e3cf60c1ab6f7",
strip_prefix = "opentelemetry-proto-1.2.0",
sha256 = "bed250ceec8e4a83aa5604d7d5595a61945059dc662edd058a9da082283f7a00",
strip_prefix = "opentelemetry-proto-1.3.1",
urls = [
"https://github.com/open-telemetry/opentelemetry-proto/archive/v1.2.0.tar.gz",
"https://github.com/open-telemetry/opentelemetry-proto/archive/v1.3.1.tar.gz",
],
)

Expand Down
55 changes: 50 additions & 5 deletions cmake/opentelemetry-proto.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,18 @@ set(TRACE_PROTO "${PROTO_PATH}/opentelemetry/proto/trace/v1/trace.proto")
set(LOGS_PROTO "${PROTO_PATH}/opentelemetry/proto/logs/v1/logs.proto")
set(METRICS_PROTO "${PROTO_PATH}/opentelemetry/proto/metrics/v1/metrics.proto")

set(PROFILES_PROTO "${PROTO_PATH}/opentelemetry/proto/profiles/v1experimental/profiles.proto")
set(PROFILES_EXT_PROTO "${PROTO_PATH}/opentelemetry/proto/profiles/v1experimental/pprofextended.proto")

set(TRACE_SERVICE_PROTO
"${PROTO_PATH}/opentelemetry/proto/collector/trace/v1/trace_service.proto")
set(LOGS_SERVICE_PROTO
"${PROTO_PATH}/opentelemetry/proto/collector/logs/v1/logs_service.proto")
set(METRICS_SERVICE_PROTO
"${PROTO_PATH}/opentelemetry/proto/collector/metrics/v1/metrics_service.proto"
)
"${PROTO_PATH}/opentelemetry/proto/collector/metrics/v1/metrics_service.proto")

set(PROFILES_SERVICE_PROTO
"${PROTO_PATH}/opentelemetry/proto/collector/profiles/v1experimental/profiles_service.proto")

set(GENERATED_PROTOBUF_PATH
"${CMAKE_BINARY_DIR}/generated/third_party/opentelemetry-proto")
Expand Down Expand Up @@ -112,6 +117,34 @@ set(TRACE_SERVICE_PB_CPP_FILE
set(TRACE_SERVICE_PB_H_FILE
"${GENERATED_PROTOBUF_PATH}/opentelemetry/proto/collector/trace/v1/trace_service.pb.h"
)

#
# Notes about the PROFILES signal:
# - *.proto files added in opentelemetry-proto 1.3.0
# - C++ code is generated from proto files
# - The generated code is not used yet.
#

set(PROFILES_CPP_FILE
"${GENERATED_PROTOBUF_PATH}/opentelemetry/proto/profiles/v1experimental/profiles.pb.cc")
set(PROFILES_H_FILE
"${GENERATED_PROTOBUF_PATH}/opentelemetry/proto/profiles/v1experimental/profiles.pb.h")
set(PROFILES_EXT_CPP_FILE
"${GENERATED_PROTOBUF_PATH}/opentelemetry/proto/profiles/v1experimental/pprofextended.pb.cc")
set(PROFILES_EXT_H_FILE
"${GENERATED_PROTOBUF_PATH}/opentelemetry/proto/profiles/v1experimental/pprofextended.pb.h")
set(PROFILES_SERVICE_PB_H_FILE
"${GENERATED_PROTOBUF_PATH}/opentelemetry/proto/collector/profiles/v1experimental/profiles_service.pb.h")
set(PROFILES_SERVICE_PB_CPP_FILE
"${GENERATED_PROTOBUF_PATH}/opentelemetry/proto/collector/profiles/v1experimental/profiles_service.pb.cc")

if(WITH_OTLP_GRPC)
set(PROFILES_SERVICE_GRPC_PB_H_FILE
"${GENERATED_PROTOBUF_PATH}/opentelemetry/proto/collector/profiles/v1experimental/profiles_service.grpc.pb.h")
set(PROFILES_SERVICE_GRPC_PB_CPP_FILE
"${GENERATED_PROTOBUF_PATH}/opentelemetry/proto/collector/profiles/v1experimental/profiles_service.grpc.pb.cc")
endif()

if(WITH_OTLP_GRPC)
set(TRACE_SERVICE_GRPC_PB_CPP_FILE
"${GENERATED_PROTOBUF_PATH}/opentelemetry/proto/collector/trace/v1/trace_service.grpc.pb.cc"
Expand Down Expand Up @@ -188,12 +221,18 @@ set(PROTOBUF_GENERATED_FILES
${LOGS_PB_CPP_FILE}
${METRICS_PB_H_FILE}
${METRICS_PB_CPP_FILE}
${PROFILES_H_FILE}
${PROFILES_CPP_FILE}
${PROFILES_EXT_H_FILE}
${PROFILES_EXT_CPP_FILE}
${TRACE_SERVICE_PB_H_FILE}
${TRACE_SERVICE_PB_CPP_FILE}
${LOGS_SERVICE_PB_H_FILE}
${LOGS_SERVICE_PB_CPP_FILE}
${METRICS_SERVICE_PB_H_FILE}
${METRICS_SERVICE_PB_CPP_FILE})
${METRICS_SERVICE_PB_CPP_FILE}
${PROFILES_SERVICE_PB_H_FILE}
${PROFILES_SERVICE_PB_CPP_FILE})

if(WITH_OTLP_GRPC)
list(APPEND PROTOBUF_COMMON_FLAGS
Expand All @@ -208,7 +247,9 @@ if(WITH_OTLP_GRPC)
${LOGS_SERVICE_GRPC_PB_H_FILE}
${LOGS_SERVICE_GRPC_PB_CPP_FILE}
${METRICS_SERVICE_GRPC_PB_H_FILE}
${METRICS_SERVICE_GRPC_PB_CPP_FILE})
${METRICS_SERVICE_GRPC_PB_CPP_FILE}
${PROFILES_SERVICE_GRPC_PB_H_FILE}
${PROFILES_SERVICE_GRPC_PB_CPP_FILE})
endif()

set(PROTOBUF_RUN_PROTOC_COMMAND "\"${PROTOBUF_PROTOC_EXECUTABLE}\"")
Expand All @@ -221,9 +262,12 @@ foreach(
${TRACE_PROTO}
${LOGS_PROTO}
${METRICS_PROTO}
${PROFILES_PROTO}
${PROFILES_EXT_PROTO}
${TRACE_SERVICE_PROTO}
${LOGS_SERVICE_PROTO}
${METRICS_SERVICE_PROTO})
${METRICS_SERVICE_PROTO}
${PROFILES_SERVICE_PROTO})
set(PROTOBUF_RUN_PROTOC_COMMAND
"${PROTOBUF_RUN_PROTOC_COMMAND} \"${PROTOBUF_RUN_PROTOC_ARG}\"")
endforeach()
Expand All @@ -235,6 +279,7 @@ add_custom_command(
${PROTOBUF_INCLUDE_FLAGS} ${COMMON_PROTO} ${RESOURCE_PROTO} ${TRACE_PROTO}
${LOGS_PROTO} ${METRICS_PROTO} ${TRACE_SERVICE_PROTO} ${LOGS_SERVICE_PROTO}
${METRICS_SERVICE_PROTO}
${PROFILES_PROTO} ${PROFILES_EXT_PROTO} ${PROFILES_SERVICE_PROTO}
COMMENT "[Run]: ${PROTOBUF_RUN_PROTOC_COMMAND}")

include_directories("${GENERATED_PROTOBUF_PATH}")
Expand Down

1 comment on commit 2db27dd

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'OpenTelemetry-cpp api Benchmark'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: 2db27dd Previous: 4edcebd Ratio
BM_NestedSpanCreationWithScope 1285.5214960031383 ns/iter 624.4977200299227 ns/iter 2.06

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.