Skip to content

Commit 62ba4de

Browse files
authored
[CodeHealth] Fix clang-tidy warnings part 6 (open-telemetry#3507)
1 parent 9ee0c27 commit 62ba4de

24 files changed

+89
-36
lines changed

.github/workflows/clang-tidy.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ jobs:
1717
matrix:
1818
include:
1919
- cmake_options: all-options-abiv1-preview
20-
warning_limit: 62
20+
warning_limit: 61
2121
- cmake_options: all-options-abiv2-preview
22-
warning_limit: 62
22+
warning_limit: 61
2323
steps:
2424
- name: Harden the runner (Audit all outbound calls)
2525
uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2

exporters/otlp/include/opentelemetry/exporters/otlp/otlp_file_exporter_options.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ namespace otlp
2222
struct OPENTELEMETRY_EXPORT OtlpFileExporterOptions : public OtlpFileClientOptions
2323
{
2424
OtlpFileExporterOptions();
25+
OtlpFileExporterOptions(const OtlpFileExporterOptions &) = default;
26+
OtlpFileExporterOptions(OtlpFileExporterOptions &&) = default;
27+
OtlpFileExporterOptions &operator=(const OtlpFileExporterOptions &) = default;
28+
OtlpFileExporterOptions &operator=(OtlpFileExporterOptions &&) = default;
29+
~OtlpFileExporterOptions() override;
2530
};
2631

2732
} // namespace otlp

exporters/otlp/include/opentelemetry/exporters/otlp/otlp_file_log_record_exporter_options.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ namespace otlp
2222
struct OPENTELEMETRY_EXPORT OtlpFileLogRecordExporterOptions : public OtlpFileClientOptions
2323
{
2424
OtlpFileLogRecordExporterOptions();
25+
OtlpFileLogRecordExporterOptions(const OtlpFileLogRecordExporterOptions &) = default;
26+
OtlpFileLogRecordExporterOptions(OtlpFileLogRecordExporterOptions &&) = default;
27+
OtlpFileLogRecordExporterOptions &operator=(const OtlpFileLogRecordExporterOptions &) = default;
28+
OtlpFileLogRecordExporterOptions &operator=(OtlpFileLogRecordExporterOptions &&) = default;
29+
~OtlpFileLogRecordExporterOptions() override;
2530
};
2631

2732
} // namespace otlp

exporters/otlp/include/opentelemetry/exporters/otlp/otlp_file_metric_exporter_options.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ namespace otlp
2323
struct OPENTELEMETRY_EXPORT OtlpFileMetricExporterOptions : public OtlpFileClientOptions
2424
{
2525
OtlpFileMetricExporterOptions();
26+
OtlpFileMetricExporterOptions(const OtlpFileMetricExporterOptions &) = default;
27+
OtlpFileMetricExporterOptions(OtlpFileMetricExporterOptions &&) = default;
28+
OtlpFileMetricExporterOptions &operator=(const OtlpFileMetricExporterOptions &) = default;
29+
OtlpFileMetricExporterOptions &operator=(OtlpFileMetricExporterOptions &&) = default;
30+
~OtlpFileMetricExporterOptions() override;
2631

2732
PreferredAggregationTemporality aggregation_temporality;
2833
};

exporters/otlp/include/opentelemetry/exporters/otlp/otlp_grpc_client.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,11 @@ class OtlpGrpcClient
106106
{
107107
public:
108108
OtlpGrpcClient(const OtlpGrpcClientOptions &options);
109-
110109
~OtlpGrpcClient();
110+
OtlpGrpcClient(const OtlpGrpcClient &) = delete;
111+
OtlpGrpcClient(OtlpGrpcClient &&) = delete;
112+
OtlpGrpcClient &operator=(const OtlpGrpcClient &) = delete;
113+
OtlpGrpcClient &operator=(OtlpGrpcClient &&) = delete;
111114

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

exporters/otlp/include/opentelemetry/exporters/otlp/otlp_grpc_client_options.h

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,18 @@ namespace otlp
2323

2424
struct OtlpGrpcClientOptions
2525
{
26+
virtual ~OtlpGrpcClientOptions() = default;
27+
OtlpGrpcClientOptions() = default;
28+
OtlpGrpcClientOptions(const OtlpGrpcClientOptions &) = default;
29+
OtlpGrpcClientOptions(OtlpGrpcClientOptions &&) = default;
30+
OtlpGrpcClientOptions &operator=(const OtlpGrpcClientOptions &) = default;
31+
OtlpGrpcClientOptions &operator=(OtlpGrpcClientOptions &&) = default;
32+
2633
/** The endpoint to export to. */
2734
std::string endpoint;
2835

2936
/** Use SSL. */
30-
bool use_ssl_credentials;
37+
bool use_ssl_credentials{};
3138

3239
/** CA CERT, path to a file. */
3340
std::string ssl_credentials_cacert_path;
@@ -64,14 +71,14 @@ struct OtlpGrpcClientOptions
6471
std::string user_agent;
6572

6673
/** max number of threads that can be allocated from this */
67-
std::size_t max_threads;
74+
std::size_t max_threads{};
6875

6976
/** Compression type. */
7077
std::string compression;
7178

7279
#ifdef ENABLE_ASYNC_EXPORT
7380
// Concurrent requests
74-
std::size_t max_concurrent_requests;
81+
std::size_t max_concurrent_requests{};
7582
#endif
7683

7784
/** The maximum number of call attempts, including the original attempt. */

exporters/otlp/include/opentelemetry/exporters/otlp/otlp_grpc_exporter.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ class OtlpGrpcExporter final : public opentelemetry::sdk::trace::SpanExporter
5858
explicit OtlpGrpcExporter(const OtlpGrpcExporterOptions &options);
5959

6060
~OtlpGrpcExporter() override;
61+
OtlpGrpcExporter(const OtlpGrpcExporter &) = delete;
62+
OtlpGrpcExporter(OtlpGrpcExporter &&) = delete;
63+
OtlpGrpcExporter &operator=(const OtlpGrpcExporter &) = delete;
64+
OtlpGrpcExporter &operator=(OtlpGrpcExporter &&) = delete;
6165

6266
/**
6367
* Create a span recordable.

exporters/otlp/include/opentelemetry/exporters/otlp/otlp_grpc_exporter_options.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@ namespace otlp
2424
struct OPENTELEMETRY_EXPORT OtlpGrpcExporterOptions : public OtlpGrpcClientOptions
2525
{
2626
OtlpGrpcExporterOptions();
27-
~OtlpGrpcExporterOptions();
27+
OtlpGrpcExporterOptions(const OtlpGrpcExporterOptions &) = default;
28+
OtlpGrpcExporterOptions(OtlpGrpcExporterOptions &&) = default;
29+
OtlpGrpcExporterOptions &operator=(const OtlpGrpcExporterOptions &) = default;
30+
OtlpGrpcExporterOptions &operator=(OtlpGrpcExporterOptions &&) = default;
31+
~OtlpGrpcExporterOptions() override;
2832
};
2933

3034
} // namespace otlp

exporters/otlp/include/opentelemetry/exporters/otlp/otlp_grpc_log_record_exporter.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ class OtlpGrpcLogRecordExporter : public opentelemetry::sdk::logs::LogRecordExpo
5757
OtlpGrpcLogRecordExporter(const OtlpGrpcLogRecordExporterOptions &options);
5858

5959
~OtlpGrpcLogRecordExporter() override;
60+
OtlpGrpcLogRecordExporter(const OtlpGrpcLogRecordExporter &) = delete;
61+
OtlpGrpcLogRecordExporter(OtlpGrpcLogRecordExporter &&) = delete;
62+
OtlpGrpcLogRecordExporter &operator=(const OtlpGrpcLogRecordExporter &) = delete;
63+
OtlpGrpcLogRecordExporter &operator=(OtlpGrpcLogRecordExporter &&) = delete;
6064

6165
/**
6266
* Creates a recordable that stores the data in protobuf.

exporters/otlp/include/opentelemetry/exporters/otlp/otlp_grpc_log_record_exporter_options.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@ namespace otlp
2424
struct OPENTELEMETRY_EXPORT OtlpGrpcLogRecordExporterOptions : public OtlpGrpcClientOptions
2525
{
2626
OtlpGrpcLogRecordExporterOptions();
27-
~OtlpGrpcLogRecordExporterOptions();
27+
OtlpGrpcLogRecordExporterOptions(const OtlpGrpcLogRecordExporterOptions &) = default;
28+
OtlpGrpcLogRecordExporterOptions(OtlpGrpcLogRecordExporterOptions &&) = default;
29+
OtlpGrpcLogRecordExporterOptions &operator=(const OtlpGrpcLogRecordExporterOptions &) = default;
30+
OtlpGrpcLogRecordExporterOptions &operator=(OtlpGrpcLogRecordExporterOptions &&) = default;
31+
~OtlpGrpcLogRecordExporterOptions() override;
2832
};
2933

3034
} // namespace otlp

0 commit comments

Comments
 (0)