Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion api/include/opentelemetry/plugin/detail/utility.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ try
}
#if __EXCEPTIONS
catch (const std::bad_alloc &)
{}
{
return;
}
#endif
} // namespace detail
} // namespace plugin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,6 @@
#include <ostream>
#include <string>

// forward declare google::protobuf::Message
namespace google
{
namespace protobuf
{
class Message;
}
} // namespace google

OPENTELEMETRY_BEGIN_NAMESPACE
namespace exporter
{
Expand Down
21 changes: 12 additions & 9 deletions exporters/otlp/src/otlp_grpc_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -162,13 +162,13 @@ template <class StubType, class RequestType, class ResponseType>
static sdk::common::ExportResult InternalDelegateAsyncExport(
const std::shared_ptr<OtlpGrpcClientAsyncData> &async_data,
StubType *stub,
std::unique_ptr<grpc::ClientContext> &&context,
std::unique_ptr<google::protobuf::Arena> &&arena,
RequestType &&request,
std::unique_ptr<grpc::ClientContext> context,
std::unique_ptr<google::protobuf::Arena> arena,
RequestType request,
std::function<bool(opentelemetry::sdk::common::ExportResult,
std::unique_ptr<google::protobuf::Arena> &&,
const RequestType &,
ResponseType *)> &&result_callback,
ResponseType *)> result_callback,
int32_t export_data_count,
const char *export_data_name) noexcept
{
Expand All @@ -188,11 +188,14 @@ static sdk::common::ExportResult InternalDelegateAsyncExport(

std::shared_ptr<OtlpGrpcAsyncCallData<RequestType, ResponseType>> call_data =
std::make_shared<OtlpGrpcAsyncCallData<RequestType, ResponseType>>();
call_data->arena.swap(arena);
call_data->result_callback.swap(result_callback);
call_data->arena = std::move(arena);
call_data->result_callback = std::move(result_callback);

call_data->request = google::protobuf::Arena::Create<RequestType>(
call_data->arena.get(), std::forward<RequestType>(request));
call_data->request = google::protobuf::Arena::Create<RequestType>(call_data->arena.get());
if (call_data->request != nullptr)
{
call_data->request->Swap(&request);
}
call_data->response = google::protobuf::Arena::Create<ResponseType>(call_data->arena.get());

if (call_data->request == nullptr || call_data->response == nullptr)
Expand All @@ -210,7 +213,7 @@ static sdk::common::ExportResult InternalDelegateAsyncExport(

return opentelemetry::sdk::common::ExportResult::kFailure;
}
call_data->grpc_context.swap(context);
call_data->grpc_context = std::move(context);

call_data->grpc_async_callback = [](OtlpGrpcAsyncCallDataBase *base_call_data) {
OtlpGrpcAsyncCallData<RequestType, ResponseType> *real_call_data =
Expand Down
5 changes: 3 additions & 2 deletions sdk/include/opentelemetry/sdk/common/global_log_handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ OPENTELEMETRY_END_NAMESPACE
{ \
using opentelemetry::sdk::common::internal_log::GlobalLogHandler; \
using opentelemetry::sdk::common::internal_log::LogHandler; \
if (level > GlobalLogHandler::GetLogLevel()) \
if ((level) > GlobalLogHandler::GetLogLevel()) \
{ \
break; \
} \
Expand All @@ -153,8 +153,9 @@ OPENTELEMETRY_END_NAMESPACE
break; \
} \
std::stringstream tmp_stream; \
/* NOLINTNEXTLINE(bugprone-macro-parentheses) */ \
tmp_stream << message; \
log_handler->Handle(level, __FILE__, __LINE__, tmp_stream.str().c_str(), attributes); \
log_handler->Handle((level), __FILE__, __LINE__, tmp_stream.str().c_str(), attributes); \
} while (false);

#define OTEL_INTERNAL_LOG_GET_3RD_ARG(arg1, arg2, arg3, ...) arg3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@
# include "opentelemetry/version.h"

OPENTELEMETRY_BEGIN_NAMESPACE
namespace common
{
class OrderedAttributeMap;
} // namespace common

namespace context
{
class Context;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@
# include "src/common/random.h"

OPENTELEMETRY_BEGIN_NAMESPACE
namespace common
{
class OrderedAttributeMap;
} // namespace common

namespace context
{
class Context;
Expand Down
Loading