Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 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
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,11 @@ class OtlpGrpcClient
{
public:
OtlpGrpcClient(const OtlpGrpcClientOptions &options);

~OtlpGrpcClient();
OtlpGrpcClient(const OtlpGrpcClient &) = delete;
OtlpGrpcClient(OtlpGrpcClient &&) = delete;
OtlpGrpcClient &operator=(const OtlpGrpcClient &) = delete;
OtlpGrpcClient &operator=(OtlpGrpcClient &&) = delete;

static std::string GetGrpcTarget(const std::string &endpoint);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,18 @@ namespace otlp

struct OtlpGrpcClientOptions
{
virtual ~OtlpGrpcClientOptions() = default;
OtlpGrpcClientOptions() = default;
OtlpGrpcClientOptions(const OtlpGrpcClientOptions &) = default;
OtlpGrpcClientOptions(OtlpGrpcClientOptions &&) = default;
OtlpGrpcClientOptions &operator=(const OtlpGrpcClientOptions &) = default;
OtlpGrpcClientOptions &operator=(OtlpGrpcClientOptions &&) = default;

/** The endpoint to export to. */
std::string endpoint;

/** Use SSL. */
bool use_ssl_credentials;
bool use_ssl_credentials{};

/** CA CERT, path to a file. */
std::string ssl_credentials_cacert_path;
Expand Down Expand Up @@ -64,14 +71,14 @@ struct OtlpGrpcClientOptions
std::string user_agent;

/** max number of threads that can be allocated from this */
std::size_t max_threads;
std::size_t max_threads{};

/** Compression type. */
std::string compression;

#ifdef ENABLE_ASYNC_EXPORT
// Concurrent requests
std::size_t max_concurrent_requests;
std::size_t max_concurrent_requests{};
#endif

/** The maximum number of call attempts, including the original attempt. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ class OtlpGrpcExporter final : public opentelemetry::sdk::trace::SpanExporter
explicit OtlpGrpcExporter(const OtlpGrpcExporterOptions &options);

~OtlpGrpcExporter() override;
OtlpGrpcExporter(const OtlpGrpcExporter &) = delete;
OtlpGrpcExporter(OtlpGrpcExporter &&) = delete;
OtlpGrpcExporter &operator=(const OtlpGrpcExporter &) = delete;
OtlpGrpcExporter &operator=(OtlpGrpcExporter &&) = delete;

/**
* Create a span recordable.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ namespace otlp
struct OPENTELEMETRY_EXPORT OtlpGrpcExporterOptions : public OtlpGrpcClientOptions
{
OtlpGrpcExporterOptions();
~OtlpGrpcExporterOptions();
};

} // namespace otlp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ class OtlpGrpcLogRecordExporter : public opentelemetry::sdk::logs::LogRecordExpo
OtlpGrpcLogRecordExporter(const OtlpGrpcLogRecordExporterOptions &options);

~OtlpGrpcLogRecordExporter() override;
OtlpGrpcLogRecordExporter(const OtlpGrpcLogRecordExporter &) = delete;
OtlpGrpcLogRecordExporter(OtlpGrpcLogRecordExporter &&) = delete;
OtlpGrpcLogRecordExporter &operator=(const OtlpGrpcLogRecordExporter &) = delete;
OtlpGrpcLogRecordExporter &operator=(OtlpGrpcLogRecordExporter &&) = delete;

/**
* Creates a recordable that stores the data in protobuf.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ namespace otlp
struct OPENTELEMETRY_EXPORT OtlpGrpcLogRecordExporterOptions : public OtlpGrpcClientOptions
{
OtlpGrpcLogRecordExporterOptions();
~OtlpGrpcLogRecordExporterOptions();
};

} // namespace otlp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ class OtlpGrpcMetricExporter : public opentelemetry::sdk::metrics::PushMetricExp
explicit OtlpGrpcMetricExporter(const OtlpGrpcMetricExporterOptions &options);

~OtlpGrpcMetricExporter() override;
OtlpGrpcMetricExporter(const OtlpGrpcMetricExporter &) = delete;
OtlpGrpcMetricExporter(OtlpGrpcMetricExporter &&) = delete;
OtlpGrpcMetricExporter &operator=(const OtlpGrpcMetricExporter &) = delete;
OtlpGrpcMetricExporter &operator=(OtlpGrpcMetricExporter &&) = delete;

/**
* Get the AggregationTemporality for exporter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ namespace otlp
struct OPENTELEMETRY_EXPORT OtlpGrpcMetricExporterOptions : public OtlpGrpcClientOptions
{
OtlpGrpcMetricExporterOptions();
~OtlpGrpcMetricExporterOptions();

/** Preferred Aggregation Temporality. */
PreferredAggregationTemporality aggregation_temporality;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,10 @@ class OtlpHttpClient
explicit OtlpHttpClient(OtlpHttpClientOptions &&options);

~OtlpHttpClient();
OtlpHttpClient(const OtlpHttpClient &) = delete;
OtlpHttpClient &operator=(const OtlpHttpClient &) = delete;
OtlpHttpClient(OtlpHttpClient &&) = delete;
OtlpHttpClient &operator=(OtlpHttpClient &&) = delete;

/**
* Sync export
Expand Down Expand Up @@ -230,28 +234,15 @@ class OtlpHttpClient
std::shared_ptr<opentelemetry::ext::http::client::Session> session;
std::shared_ptr<opentelemetry::ext::http::client::EventHandler> event_handle;

inline HttpSessionData() = default;
HttpSessionData() = default;

inline explicit HttpSessionData(
std::shared_ptr<opentelemetry::ext::http::client::Session> &&input_session,
std::shared_ptr<opentelemetry::ext::http::client::EventHandler> &&input_handle)
explicit HttpSessionData(
std::shared_ptr<opentelemetry::ext::http::client::Session> input_session,
std::shared_ptr<opentelemetry::ext::http::client::EventHandler> input_handle)
{
session.swap(input_session);
event_handle.swap(input_handle);
}

inline HttpSessionData(HttpSessionData &&other)
{
session.swap(other.session);
event_handle.swap(other.event_handle);
}

inline HttpSessionData &operator=(HttpSessionData &&other) noexcept
{
session.swap(other.session);
event_handle.swap(other.event_handle);
return *this;
}
};

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ namespace otlp
struct OPENTELEMETRY_EXPORT OtlpHttpExporterOptions
{
OtlpHttpExporterOptions();
~OtlpHttpExporterOptions();

/** The endpoint to export to. */
std::string url;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ namespace otlp
*/
struct OPENTELEMETRY_EXPORT OtlpHttpExporterRuntimeOptions
{
OtlpHttpExporterRuntimeOptions() = default;
~OtlpHttpExporterRuntimeOptions() = default;
OtlpHttpExporterRuntimeOptions() = default;

std::shared_ptr<sdk::common::ThreadInstrumentation> thread_instrumentation =
std::shared_ptr<sdk::common::ThreadInstrumentation>(nullptr);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ namespace otlp
struct OPENTELEMETRY_EXPORT OtlpHttpLogRecordExporterOptions
{
OtlpHttpLogRecordExporterOptions();
~OtlpHttpLogRecordExporterOptions();

/** The endpoint to export to. */
std::string url;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ namespace otlp
*/
struct OPENTELEMETRY_EXPORT OtlpHttpLogRecordExporterRuntimeOptions
{
OtlpHttpLogRecordExporterRuntimeOptions() = default;
~OtlpHttpLogRecordExporterRuntimeOptions() = default;
OtlpHttpLogRecordExporterRuntimeOptions() = default;

std::shared_ptr<sdk::common::ThreadInstrumentation> thread_instrumentation =
std::shared_ptr<sdk::common::ThreadInstrumentation>(nullptr);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class OtlpHttpMetricExporter final : public opentelemetry::sdk::metrics::PushMet
OtlpHttpMetricExporterRuntimeOptions runtime_options_;

// Aggregation Temporality Selector
const sdk::metrics::AggregationTemporalitySelector aggregation_temporality_selector_;
sdk::metrics::AggregationTemporalitySelector aggregation_temporality_selector_;

// Object that stores the HTTP sessions that have been created
std::unique_ptr<OtlpHttpClient> http_client_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ namespace otlp
struct OPENTELEMETRY_EXPORT OtlpHttpMetricExporterOptions
{
OtlpHttpMetricExporterOptions();
~OtlpHttpMetricExporterOptions();

/** The endpoint to export to. */
std::string url;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ namespace otlp
*/
struct OPENTELEMETRY_EXPORT OtlpHttpMetricExporterRuntimeOptions
{
OtlpHttpMetricExporterRuntimeOptions() = default;
~OtlpHttpMetricExporterRuntimeOptions() = default;
OtlpHttpMetricExporterRuntimeOptions() = default;

std::shared_ptr<sdk::common::ThreadInstrumentation> thread_instrumentation =
std::shared_ptr<sdk::common::ThreadInstrumentation>(nullptr);
Expand Down
2 changes: 1 addition & 1 deletion exporters/otlp/src/otlp_grpc_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ static sdk::common::ExportResult InternalDelegateAsyncExport(
stub->experimental_async()
# endif
->Export(call_data->grpc_context.get(), call_data->request, call_data->response,
[call_data, async_data, export_data_name](::grpc::Status grpc_status) {
[call_data, async_data, export_data_name](const ::grpc::Status &grpc_status) {
{
std::lock_guard<std::mutex> lock{async_data->running_calls_lock};
async_data->running_calls.erase(
Expand Down
2 changes: 0 additions & 2 deletions exporters/otlp/src/otlp_grpc_exporter_options.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ OtlpGrpcExporterOptions::OtlpGrpcExporterOptions()
retry_policy_backoff_multiplier = GetOtlpDefaultTracesRetryBackoffMultiplier();
}

OtlpGrpcExporterOptions::~OtlpGrpcExporterOptions() {}

} // namespace otlp
} // namespace exporter
OPENTELEMETRY_END_NAMESPACE
2 changes: 0 additions & 2 deletions exporters/otlp/src/otlp_grpc_log_record_exporter_options.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ OtlpGrpcLogRecordExporterOptions::OtlpGrpcLogRecordExporterOptions()
retry_policy_backoff_multiplier = GetOtlpDefaultLogsRetryBackoffMultiplier();
}

OtlpGrpcLogRecordExporterOptions::~OtlpGrpcLogRecordExporterOptions() {}

} // namespace otlp
} // namespace exporter
OPENTELEMETRY_END_NAMESPACE
2 changes: 0 additions & 2 deletions exporters/otlp/src/otlp_grpc_metric_exporter_options.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ OtlpGrpcMetricExporterOptions::OtlpGrpcMetricExporterOptions()
retry_policy_backoff_multiplier = GetOtlpDefaultMetricsRetryBackoffMultiplier();
}

OtlpGrpcMetricExporterOptions::~OtlpGrpcMetricExporterOptions() {}

} // namespace otlp
} // namespace exporter
OPENTELEMETRY_END_NAMESPACE
5 changes: 2 additions & 3 deletions exporters/otlp/src/otlp_http_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1000,9 +1000,8 @@ OtlpHttpClient::createSession(

// Returns the created session data
return HttpSessionData{
std::move(session),
std::shared_ptr<opentelemetry::ext::http::client::EventHandler>{
new ResponseHandler(std::move(result_callback), options_.console_debug)}};
session, std::shared_ptr<opentelemetry::ext::http::client::EventHandler>{
new ResponseHandler(std::move(result_callback), options_.console_debug)}};
}

void OtlpHttpClient::addSession(HttpSessionData &&session_data) noexcept
Expand Down
2 changes: 0 additions & 2 deletions exporters/otlp/src/otlp_http_exporter_options.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ OtlpHttpExporterOptions::OtlpHttpExporterOptions()
retry_policy_backoff_multiplier(GetOtlpDefaultTracesRetryBackoffMultiplier())
{}

OtlpHttpExporterOptions::~OtlpHttpExporterOptions() {}

} // namespace otlp
} // namespace exporter
OPENTELEMETRY_END_NAMESPACE
2 changes: 0 additions & 2 deletions exporters/otlp/src/otlp_http_log_record_exporter_options.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ OtlpHttpLogRecordExporterOptions::OtlpHttpLogRecordExporterOptions()
retry_policy_backoff_multiplier(GetOtlpDefaultLogsRetryBackoffMultiplier())
{}

OtlpHttpLogRecordExporterOptions::~OtlpHttpLogRecordExporterOptions() {}

} // namespace otlp
} // namespace exporter
OPENTELEMETRY_END_NAMESPACE
2 changes: 0 additions & 2 deletions exporters/otlp/src/otlp_http_metric_exporter_options.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ OtlpHttpMetricExporterOptions::OtlpHttpMetricExporterOptions()
retry_policy_backoff_multiplier(GetOtlpDefaultMetricsRetryBackoffMultiplier())
{}

OtlpHttpMetricExporterOptions::~OtlpHttpMetricExporterOptions() {}

} // namespace otlp
} // namespace exporter
OPENTELEMETRY_END_NAMESPACE
Loading