Skip to content

Commit

Permalink
Merge branch 'main' into fix_ci_iwyu
Browse files Browse the repository at this point in the history
  • Loading branch information
marcalff authored May 28, 2024
2 parents ceb323a + 277190d commit 1ad587c
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 25 deletions.
5 changes: 5 additions & 0 deletions api/include/opentelemetry/logs/logger_type_traits.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#pragma once

#include <chrono>
#include <memory>
#include <type_traits>

#include "opentelemetry/common/attribute_value.h"
Expand Down Expand Up @@ -145,6 +146,10 @@ struct LogRecordSetterTrait<common::KeyValueIterable>
template <class ValueType>
struct LogRecordSetterTrait
{
static_assert(!std::is_same<nostd::unique_ptr<LogRecord>, ValueType>::value &&
!std::is_same<std::unique_ptr<LogRecord>, ValueType>::value,
"unique_ptr<LogRecord> is not allowed, please use std::move()");

template <class ArgumentType,
nostd::enable_if_t<std::is_convertible<ArgumentType, nostd::string_view>::value ||
std::is_convertible<ArgumentType, common::AttributeValue>::value,
Expand Down
66 changes: 42 additions & 24 deletions cmake/opentelemetry-proto.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,15 @@ else()
message(
STATUS "opentelemetry-proto dependency satisfied by: github download")
if("${opentelemetry-proto}" STREQUAL "")
set(opentelemetry-proto "v1.0.0")
file(READ "${CMAKE_CURRENT_LIST_DIR}/../third_party_release"
OTELCPP_THIRD_PARTY_RELEASE_CONTENT)
if(OTELCPP_THIRD_PARTY_RELEASE_CONTENT MATCHES
"opentelemetry-proto=[ \\t]*([A-Za-z0-9_\\.\\-]+)")
set(opentelemetry-proto "${CMAKE_MATCH_1}")
else()
set(opentelemetry-proto "v1.3.1")
endif()
unset(OTELCPP_THIRD_PARTY_RELEASE_CONTENT)
endif()
include(ExternalProject)
ExternalProject_Add(
Expand Down Expand Up @@ -72,18 +80,23 @@ 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(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")
"${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 @@ -119,30 +132,37 @@ set(TRACE_SERVICE_PB_H_FILE
)

#
# 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.
# 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")
"${GENERATED_PROTOBUF_PATH}/opentelemetry/proto/profiles/v1experimental/profiles.pb.cc"
)
set(PROFILES_H_FILE
"${GENERATED_PROTOBUF_PATH}/opentelemetry/proto/profiles/v1experimental/profiles.pb.h")
"${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")
"${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")
"${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")
"${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")
"${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")
"${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")
"${GENERATED_PROTOBUF_PATH}/opentelemetry/proto/collector/profiles/v1experimental/profiles_service.grpc.pb.cc"
)
endif()

if(WITH_OTLP_GRPC)
Expand Down Expand Up @@ -278,8 +298,8 @@ add_custom_command(
${PROTOBUF_PROTOC_EXECUTABLE} ${PROTOBUF_COMMON_FLAGS}
${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}
${METRICS_SERVICE_PROTO} ${PROFILES_PROTO} ${PROFILES_EXT_PROTO}
${PROFILES_SERVICE_PROTO}
COMMENT "[Run]: ${PROTOBUF_RUN_PROTOC_COMMAND}")

include_directories("${GENERATED_PROTOBUF_PATH}")
Expand Down Expand Up @@ -317,13 +337,11 @@ if(WITH_OTLP_GRPC)
${LOGS_SERVICE_GRPC_PB_CPP_FILE} ${METRICS_SERVICE_GRPC_PB_CPP_FILE})

list(APPEND OPENTELEMETRY_PROTO_TARGETS opentelemetry_proto_grpc)
target_link_libraries(opentelemetry_proto_grpc
PUBLIC opentelemetry_proto)
target_link_libraries(opentelemetry_proto_grpc PUBLIC opentelemetry_proto)

get_target_property(grpc_lib_type gRPC::grpc++ TYPE)
if (grpc_lib_type STREQUAL "SHARED_LIBRARY")
target_link_libraries(opentelemetry_proto_grpc
PUBLIC gRPC::grpc++)
if(grpc_lib_type STREQUAL "SHARED_LIBRARY")
target_link_libraries(opentelemetry_proto_grpc PUBLIC gRPC::grpc++)
endif()
set_target_properties(opentelemetry_proto_grpc PROPERTIES EXPORT_NAME
proto_grpc)
Expand Down
2 changes: 1 addition & 1 deletion third_party_release
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ benchmark=v1.8.3
googletest=1.14.0
ms-gsl=v3.1.0-67-g6f45293
nlohmann-json=v3.11.3
opentelemetry-proto=v1.1.0
opentelemetry-proto=v1.3.1
opentracing-cpp=v1.6.0
prometheus-cpp=v1.2.4
vcpkg=2024.02.14

0 comments on commit 1ad587c

Please sign in to comment.