Skip to content

Commit

Permalink
bump protoc
Browse files Browse the repository at this point in the history
Signed-off-by: jakub-racek-swi <jakub.racek@solarwinds.com>
  • Loading branch information
jakub-racek-swi committed Sep 23, 2024
1 parent e66d1b3 commit bbbf89d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion cmake/protobuf.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ function (build_protobuf NAME)
list(
APPEND
PROTOBUF_ARGS
--go_out="plugins=grpc:${GO_PATH_SRC}"
--go_out="${GO_PATH_SRC}"
--go-grpc_out="${GO_PATH_SRC}"
)

add_dependencies(
Expand Down
5 changes: 4 additions & 1 deletion otlp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ else()
set(_GRPC_CPP_PLUGIN_EXECUTABLE $<TARGET_FILE:gRPC::grpc_cpp_plugin>)
endif()

include_directories(${Protobuf_INCLUDE_DIRS})
include_directories(${CMAKE_INSTALL_PREFIX})

add_library(otlp_grpc_proto
Expand All @@ -37,12 +38,14 @@ add_library(otlp_grpc_proto
"${CMAKE_INSTALL_PREFIX}/opentelemetry/proto/logs/v1/logs.pb.cc"
"${CMAKE_INSTALL_PREFIX}/opentelemetry/proto/collector/metrics/v1/metrics_service.pb.cc"
"${CMAKE_INSTALL_PREFIX}/opentelemetry/proto/collector/metrics/v1/metrics_service.grpc.pb.cc"
"${CMAKE_INSTALL_PREFIX}/opentelemetry/proto/metrics/v1/metrics.pb.cc")
"${CMAKE_INSTALL_PREFIX}/opentelemetry/proto/metrics/v1/metrics.pb.cc"
)

target_link_libraries(
otlp_grpc_proto
gRPC::grpc++
protobuf::libprotobuf
protobuf::libprotoc
)

add_library(
Expand Down
2 changes: 1 addition & 1 deletion otlp/otlp_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ template <typename T> std::string get_request_json(const T &request)
std::string request_json_str;
google::protobuf::util::JsonPrintOptions json_print_options;
json_print_options.add_whitespace = true;
json_print_options.always_print_primitive_fields = true;
json_print_options.always_print_fields_with_no_presence = true;
auto status = google::protobuf::util::MessageToJsonString(request, &request_json_str, json_print_options);
if (!status.ok()) {
std::cerr << "Failed to convert message to JSON: " << status.ToString() << std::endl;
Expand Down

0 comments on commit bbbf89d

Please sign in to comment.