Skip to content
Draft
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: 2 additions & 2 deletions .github/workflows/clang-tidy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ jobs:
matrix:
include:
- cmake_options: all-options-abiv1-preview
warning_limit: 595
warning_limit: 483
- cmake_options: all-options-abiv2-preview
warning_limit: 597
warning_limit: 485
env:
CC: /usr/bin/clang-18
CXX: /usr/bin/clang++-18
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ Increment the:
* [BUILD] Avoid break caused by max() macro on windows
[#3863](https://github.com/open-telemetry/opentelemetry-cpp/pull/3863)

* [CODE HEALTH] Fix clang-tidy warnings, part 2
[#3872](https://github.com/open-telemetry/opentelemetry-cpp/pull/3872)

## [1.25 2026-02-07]

* [RELEASE] Bump main branch to 1.25.0-dev (#3759)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,11 @@ class HttpClientSync : public opentelemetry::ext::http::client::HttpClientSync
public:
HttpClientSync() : curl_global_initializer_(HttpCurlGlobalInitializer::GetInstance()) {}

HttpClientSync(const HttpClientSync &) = delete;
HttpClientSync(HttpClientSync &&) = delete;
HttpClientSync &operator=(const HttpClientSync &) = delete;
HttpClientSync &operator=(HttpClientSync &&) = delete;

opentelemetry::ext::http::client::Result Get(
const nostd::string_view &url,
const opentelemetry::ext::http::client::HttpSslOptions &ssl_options,
Expand Down Expand Up @@ -312,6 +317,12 @@ class HttpClient : public opentelemetry::ext::http::client::HttpClient
// The call (curl_global_init) is not thread safe. Ensure this is called only once.
HttpClient();
HttpClient(const std::shared_ptr<sdk::common::ThreadInstrumentation> &thread_instrumentation);

HttpClient(const HttpClient &) = delete;
HttpClient(HttpClient &&) = delete;
HttpClient &operator=(const HttpClient &) = delete;
HttpClient &operator=(HttpClient &&) = delete;

~HttpClient() override;

std::shared_ptr<opentelemetry::ext::http::client::Session> CreateSession(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ struct HttpCurlEasyResource

HttpCurlEasyResource(const HttpCurlEasyResource &other) = delete;
HttpCurlEasyResource &operator=(const HttpCurlEasyResource &other) = delete;

~HttpCurlEasyResource() = default;
};

class HttpOperation
Expand Down Expand Up @@ -166,6 +168,11 @@ class HttpOperation
bool is_log_enabled = false,
const opentelemetry::ext::http::client::RetryPolicy &retry_policy = {});

HttpOperation(const HttpOperation &) = delete;
HttpOperation(HttpOperation &&) = delete;
HttpOperation &operator=(const HttpOperation &) = delete;
HttpOperation &operator=(HttpOperation &&) = delete;

/**
* Destroy CURL instance
*/
Expand Down
42 changes: 42 additions & 0 deletions ext/include/opentelemetry/ext/http/client/http_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,13 @@ struct RetryPolicy
class Request
{
public:
Request() = default;

Request(const Request &) = delete;
Request(Request &&) = delete;
Request &operator=(const Request &) = delete;
Request &operator=(Request &&) = delete;

virtual void SetMethod(Method method) noexcept = 0;

virtual void SetUri(nostd::string_view uri) noexcept = 0;
Expand All @@ -277,6 +284,13 @@ class Request
class Response
{
public:
Response() = default;

Response(const Response &) = delete;
Response(Response &&) = delete;
Response &operator=(const Response &) = delete;
Response &operator=(Response &&) = delete;

virtual const Body &GetBody() const noexcept = 0;

virtual bool ForEachHeader(
Expand Down Expand Up @@ -344,6 +358,13 @@ class Result
class EventHandler
{
public:
EventHandler() = default;

EventHandler(const EventHandler &) = delete;
EventHandler(EventHandler &&) = delete;
EventHandler &operator=(const EventHandler &) = delete;
EventHandler &operator=(EventHandler &&) = delete;

virtual void OnResponse(Response &) noexcept = 0;

virtual void OnEvent(SessionState, nostd::string_view) noexcept = 0;
Expand All @@ -354,6 +375,13 @@ class EventHandler
class Session
{
public:
Session() = default;

Session(const Session &) = delete;
Session(Session &&) = delete;
Session &operator=(const Session &) = delete;
Session &operator=(Session &&) = delete;

virtual std::shared_ptr<Request> CreateRequest() noexcept = 0;

virtual void SendRequest(std::shared_ptr<EventHandler>) noexcept = 0;
Expand All @@ -370,6 +398,13 @@ class Session
class HttpClient
{
public:
HttpClient() = default;

HttpClient(const HttpClient &) = delete;
HttpClient(HttpClient &&) = delete;
HttpClient &operator=(const HttpClient &) = delete;
HttpClient &operator=(HttpClient &&) = delete;

virtual std::shared_ptr<Session> CreateSession(nostd::string_view url) noexcept = 0;

virtual bool CancelAllSessions() noexcept = 0;
Expand All @@ -384,6 +419,13 @@ class HttpClient
class HttpClientSync
{
public:
HttpClientSync() = default;

HttpClientSync(const HttpClientSync &) = delete;
HttpClientSync(HttpClientSync &&) = delete;
HttpClientSync &operator=(const HttpClientSync &) = delete;
HttpClientSync &operator=(HttpClientSync &&) = delete;

Result GetNoSsl(const nostd::string_view &url,
const Headers &headers = {{}},
const Compression &compression = Compression::kNone) noexcept
Expand Down
11 changes: 11 additions & 0 deletions ext/include/opentelemetry/ext/http/server/http_server.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ class HttpRequestCallback

public:
HttpRequestCallback() {}

HttpRequestCallback(const HttpRequestCallback &) = delete;
HttpRequestCallback(HttpRequestCallback &&) = delete;
HttpRequestCallback &operator=(const HttpRequestCallback &) = delete;
HttpRequestCallback &operator=(HttpRequestCallback &&) = delete;

virtual ~HttpRequestCallback() = default;

HttpRequestCallback &operator=(HttpRequestCallback other)
Expand Down Expand Up @@ -176,6 +182,11 @@ class HttpServer : private SocketTools::Reactor::SocketCallback
addListeningPort(port);
}

HttpServer(const HttpServer &) = delete;
HttpServer(HttpServer &&) = delete;
HttpServer &operator=(const HttpServer &) = delete;
HttpServer &operator=(HttpServer &&) = delete;

~HttpServer() override
{
for (auto &sock : m_listeningSockets)
Expand Down
18 changes: 17 additions & 1 deletion ext/include/opentelemetry/ext/http/server/socket_tools.h
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,11 @@ struct Socket

Socket(int af, int type, int proto) : m_sock(::socket(af, type, proto)) {}

Socket(const Socket &) = default;
Socket(Socket &&) = default;
Socket &operator=(const Socket &) = default;
Socket &operator=(Socket &&) = default;

~Socket() {}

operator Socket::Type() const { return m_sock; }
Expand Down Expand Up @@ -447,7 +452,13 @@ struct Reactor : protected common::Thread
class SocketCallback
{
public:
SocketCallback() = default;
SocketCallback() = default;

SocketCallback(const SocketCallback &) = delete;
SocketCallback(SocketCallback &&) = delete;
SocketCallback &operator=(const SocketCallback &) = delete;
SocketCallback &operator=(SocketCallback &&) = delete;

virtual ~SocketCallback() = default;
virtual void onSocketReadable(Socket sock) = 0;
virtual void onSocketWritable(Socket sock) = 0;
Expand Down Expand Up @@ -504,6 +515,11 @@ struct Reactor : protected common::Thread
#endif
}

Reactor(const Reactor &) = delete;
Reactor(Reactor &&) = delete;
Reactor &operator=(const Reactor &) = delete;
Reactor &operator=(Reactor &&) = delete;

~Reactor() override
{
#ifdef __linux__
Expand Down
4 changes: 4 additions & 0 deletions sdk/include/opentelemetry/sdk/common/atomic_unique_ptr.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ class AtomicUniquePtr
{
public:
AtomicUniquePtr() noexcept {}
AtomicUniquePtr(const AtomicUniquePtr &) = delete;
AtomicUniquePtr(AtomicUniquePtr &&) = delete;
AtomicUniquePtr &operator=(const AtomicUniquePtr &) = delete;
AtomicUniquePtr &operator=(AtomicUniquePtr &&) = delete;

explicit AtomicUniquePtr(std::unique_ptr<T> &&other) noexcept : ptr_(other.release()) {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,13 @@ namespace common
class ThreadInstrumentation
{
public:
ThreadInstrumentation() = default;
ThreadInstrumentation() = default;

ThreadInstrumentation(const ThreadInstrumentation &) = delete;
ThreadInstrumentation(ThreadInstrumentation &&) = delete;
ThreadInstrumentation &operator=(const ThreadInstrumentation &) = delete;
ThreadInstrumentation &operator=(ThreadInstrumentation &&) = delete;

virtual ~ThreadInstrumentation() = default;

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ using InstrumentationScopeAttributes = opentelemetry::sdk::common::AttributeMap;
class InstrumentationScope
{
public:
InstrumentationScope(const InstrumentationScope &) = default;
InstrumentationScope(const InstrumentationScope &) = default;
InstrumentationScope(InstrumentationScope &&) = default;
InstrumentationScope &operator=(const InstrumentationScope &) = default;
InstrumentationScope &operator=(InstrumentationScope &&) = default;
~InstrumentationScope() = default;

/**
* Returns a newly created InstrumentationScope with the specified library name and version.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ class BatchLogRecordProcessor : public LogRecordProcessor
const BatchLogRecordProcessorOptions &options,
const BatchLogRecordProcessorRuntimeOptions &runtime_options);

BatchLogRecordProcessor(const BatchLogRecordProcessor &) = delete;
BatchLogRecordProcessor(BatchLogRecordProcessor &&) = delete;
BatchLogRecordProcessor &operator=(const BatchLogRecordProcessor &) = delete;
BatchLogRecordProcessor &operator=(BatchLogRecordProcessor &&) = delete;

/** Makes a new recordable **/
std::unique_ptr<Recordable> MakeRecordable() noexcept override;

Expand Down
5 changes: 5 additions & 0 deletions sdk/include/opentelemetry/sdk/logs/event_logger_provider.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ class OPENTELEMETRY_EXPORT OPENTELEMETRY_DEPRECATED EventLoggerProvider final
public:
EventLoggerProvider() noexcept;

EventLoggerProvider(const EventLoggerProvider &) = delete;
EventLoggerProvider(EventLoggerProvider &&) = delete;
EventLoggerProvider &operator=(const EventLoggerProvider &) = delete;
EventLoggerProvider &operator=(EventLoggerProvider &&) = delete;

~EventLoggerProvider() override;

nostd::shared_ptr<opentelemetry::logs::EventLogger> CreateEventLogger(
Expand Down
6 changes: 6 additions & 0 deletions sdk/include/opentelemetry/sdk/logs/exporter.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ class OPENTELEMETRY_EXPORT LogRecordExporter
{
public:
LogRecordExporter();

LogRecordExporter(const LogRecordExporter &) = delete;
LogRecordExporter(LogRecordExporter &&) = delete;
LogRecordExporter &operator=(const LogRecordExporter &) = delete;
LogRecordExporter &operator=(LogRecordExporter &&) = delete;

virtual ~LogRecordExporter();

/**
Expand Down
5 changes: 5 additions & 0 deletions sdk/include/opentelemetry/sdk/logs/logger_provider.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ class OPENTELEMETRY_EXPORT LoggerProvider final : public opentelemetry::logs::Lo
*/
explicit LoggerProvider(std::unique_ptr<LoggerContext> context) noexcept;

LoggerProvider(const LoggerProvider &) = delete;
LoggerProvider(LoggerProvider &&) = delete;
LoggerProvider &operator=(const LoggerProvider &) = delete;
LoggerProvider &operator=(LoggerProvider &&) = delete;

~LoggerProvider() override;

using opentelemetry::logs::LoggerProvider::GetLogger;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ class MultiLogRecordProcessor : public LogRecordProcessor
{
public:
MultiLogRecordProcessor(std::vector<std::unique_ptr<LogRecordProcessor>> &&processors);

MultiLogRecordProcessor(const MultiLogRecordProcessor &) = delete;
MultiLogRecordProcessor(MultiLogRecordProcessor &&) = delete;
MultiLogRecordProcessor &operator=(const MultiLogRecordProcessor &) = delete;
MultiLogRecordProcessor &operator=(MultiLogRecordProcessor &&) = delete;

~MultiLogRecordProcessor() override;

void AddProcessor(std::unique_ptr<LogRecordProcessor> &&processor);
Expand Down
7 changes: 7 additions & 0 deletions sdk/include/opentelemetry/sdk/logs/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ class Recordable;
class LogRecordProcessor
{
public:
LogRecordProcessor() = default;

LogRecordProcessor(const LogRecordProcessor &) = delete;
LogRecordProcessor(LogRecordProcessor &&) = delete;
LogRecordProcessor &operator=(const LogRecordProcessor &) = delete;
LogRecordProcessor &operator=(LogRecordProcessor &&) = delete;

virtual ~LogRecordProcessor() = default;

/**
Expand Down
6 changes: 6 additions & 0 deletions sdk/include/opentelemetry/sdk/logs/read_write_log_record.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ class ReadWriteLogRecord final : public ReadableLogRecord
{
public:
ReadWriteLogRecord();

ReadWriteLogRecord(const ReadWriteLogRecord &) = delete;
ReadWriteLogRecord(ReadWriteLogRecord &&) = delete;
ReadWriteLogRecord &operator=(const ReadWriteLogRecord &) = delete;
ReadWriteLogRecord &operator=(ReadWriteLogRecord &&) = delete;

~ReadWriteLogRecord() override;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ class SimpleLogRecordProcessor : public LogRecordProcessor

public:
explicit SimpleLogRecordProcessor(std::unique_ptr<LogRecordExporter> &&exporter);

SimpleLogRecordProcessor(const SimpleLogRecordProcessor &) = delete;
SimpleLogRecordProcessor(SimpleLogRecordProcessor &&) = delete;
SimpleLogRecordProcessor &operator=(const SimpleLogRecordProcessor &) = delete;
SimpleLogRecordProcessor &operator=(SimpleLogRecordProcessor &&) = delete;

~SimpleLogRecordProcessor() override;

std::unique_ptr<Recordable> MakeRecordable() noexcept override;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ class Aggregation

virtual PointType ToPoint() const noexcept = 0;

Aggregation() = default;

Aggregation(const Aggregation &) = delete;
Aggregation(Aggregation &&) = delete;
Aggregation &operator=(const Aggregation &) = delete;
Aggregation &operator=(Aggregation &&) = delete;

virtual ~Aggregation() = default;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ class AggregationConfig
: cardinality_limit_(cardinality_limit)
{}

AggregationConfig(const AggregationConfig &) = default;
AggregationConfig(AggregationConfig &&) = default;
AggregationConfig &operator=(const AggregationConfig &) = default;
AggregationConfig &operator=(AggregationConfig &&) = default;

virtual AggregationType GetType() const noexcept { return AggregationType::kDefault; }

static const AggregationConfig *GetOrDefault(const AggregationConfig *config)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,12 @@ class Base2ExponentialHistogramIndexer
* Construct a new indexer for a given scale.
*/
explicit Base2ExponentialHistogramIndexer(int32_t scale = 0);
Base2ExponentialHistogramIndexer(const Base2ExponentialHistogramIndexer &other) = default;
Base2ExponentialHistogramIndexer &operator=(const Base2ExponentialHistogramIndexer &other) =
default;

Base2ExponentialHistogramIndexer(const Base2ExponentialHistogramIndexer &) = default;
Base2ExponentialHistogramIndexer(Base2ExponentialHistogramIndexer &&) = default;
Base2ExponentialHistogramIndexer &operator=(const Base2ExponentialHistogramIndexer &) = default;
Base2ExponentialHistogramIndexer &operator=(Base2ExponentialHistogramIndexer &&) = default;
~Base2ExponentialHistogramIndexer() = default;

/**
* Compute the index for the given value.
Expand Down
Loading
Loading