Skip to content

[DOC] Update doc comments to pass -WDocumention check #3375

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 31 commits into from
Jun 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
4f5255a
Update all the doc comments and add WDocumention
zurex Apr 23, 2025
5610dbc
Merge branch 'main' into fix/doc_comment_api
zurex Apr 23, 2025
6402c14
Fix the doc comments in http_operation_curl.h
zurex Apr 23, 2025
a45b644
Merge remote changes
zurex Apr 23, 2025
15c3fd6
Merge branch 'main' into fix/doc_comment_api
lalitb Apr 24, 2025
e3c83f5
Fix the doc comment issues in semconv
zurex Apr 24, 2025
7a210ec
Add more details for AttributeValue warnning
zurex Apr 24, 2025
78d6787
Fix the doc issues in url_atteibutes.h
zurex Apr 24, 2025
6a91bc4
Merge branch 'main' into fix/doc_comment_api
ThomsonTan Apr 24, 2025
dad87ba
Merge branch 'main' into fix/doc_comment_api
zurex Apr 26, 2025
210c863
Merge branch 'main' into fix/doc_comment_api
ThomsonTan Apr 29, 2025
e30863f
Fix the doc comments
zurex May 6, 2025
531ae64
Fix the comments under api
zurex May 6, 2025
0c0f2f7
Fix the format issue
zurex May 6, 2025
00a4b13
Merge branch 'main' into fix/doc_comment_api
ThomsonTan May 6, 2025
2e07267
Merge branch 'main' into fix/doc_comment_api
ThomsonTan May 20, 2025
79cc519
Merge branch 'main' into fix/doc_comment_api
marcalff May 26, 2025
9296f1f
Revert changes in semconv
zurex May 26, 2025
6f41459
Merge branch 'fix/doc_comment_api' of https://github.com/zurex/opente…
zurex May 26, 2025
32a7861
Remove bad checkin
zurex May 26, 2025
c682d1a
Fix the format
zurex May 26, 2025
7c5e5c3
Remove doc check under maintainer mode
zurex May 26, 2025
9ef149a
Fix eof
zurex May 27, 2025
37c8ff8
Revert clang-format
zurex May 28, 2025
fbba434
Merge branch 'open-telemetry:main' into fix/doc_comment_api
zurex May 28, 2025
ae8ed3a
Address the review comments
zurex May 28, 2025
54787c1
Update exporters/memory/include/opentelemetry/exporters/memory/in_mem…
zurex May 29, 2025
0979723
Update sdk/include/opentelemetry/sdk/common/atomic_unique_ptr.h
zurex May 29, 2025
b4fcb74
Merge branch 'main' into fix/doc_comment_api
zurex May 30, 2025
d56e527
Merge branch 'main' into fix/doc_comment_api
zurex Jun 1, 2025
5f26a2d
Merge branch 'main' into fix/doc_comment_api
ThomsonTan Jun 4, 2025
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
3 changes: 2 additions & 1 deletion api/include/opentelemetry/common/attribute_value.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ namespace common
/// (IEEE 754-1985) or signed 64 bit integer.
/// - Homogenous arrays of primitive type values.
///
/// \warning
/// \warning The OpenTelemetry C++ API does not support the following attribute:
/// uint64_t, nostd::span<const uint64_t>, and nostd::span<uint8_t> types.
/// \parblock The OpenTelemetry C++ API currently supports several attribute
/// value types that are not covered by the OpenTelemetry specification:
/// - \c uint64_t
Expand Down
9 changes: 4 additions & 5 deletions api/include/opentelemetry/common/key_value_iterable.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,12 @@ class NoopKeyValueIterable : public KeyValueIterable
~NoopKeyValueIterable() override = default;

/**
* Iterate over key-value pairs
* @param callback a callback to invoke for each key-value. If the callback returns false,
* the iteration is aborted.
* @return true if every key-value pair was iterated over
* No-op implementation: does not invoke the callback, even if key-value pairs are present.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Technically, the @param should still be there.

* @return true without iterating or invoking the callback
*/
bool ForEachKeyValue(
nostd::function_ref<bool(nostd::string_view, common::AttributeValue)>) const noexcept override
nostd::function_ref<bool(nostd::string_view, common::AttributeValue)> /*callback*/)
const noexcept override
{
return true;
}
Expand Down
13 changes: 7 additions & 6 deletions api/include/opentelemetry/common/key_value_iterable_view.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ KeyValueIterableView<T> MakeKeyValueIterableView(const T &container) noexcept
/**
* Utility function to help to make a attribute view from initializer_list
*
* @param attributes
* @param attributes The initializer_list of key-value pairs
* @return nostd::span<const std::pair<nostd::string_view, common::AttributeValue>>
*/
inline static nostd::span<const std::pair<nostd::string_view, common::AttributeValue>>
Expand All @@ -105,7 +105,7 @@ MakeAttributes(std::initializer_list<std::pair<nostd::string_view, common::Attri
/**
* Utility function to help to make a attribute view from a span
*
* @param attributes
* @param attributes The span of key-value pairs
* @return nostd::span<const std::pair<nostd::string_view, common::AttributeValue>>
*/
inline static nostd::span<const std::pair<nostd::string_view, common::AttributeValue>>
Expand All @@ -118,7 +118,7 @@ MakeAttributes(
/**
* Utility function to help to make a attribute view from a KeyValueIterable
*
* @param attributes
* @param attributes The KeyValueIterable of key-value pairs
* @return common::KeyValueIterable
*/
inline static const common::KeyValueIterable &MakeAttributes(
Expand All @@ -130,16 +130,17 @@ inline static const common::KeyValueIterable &MakeAttributes(
/**
* Utility function to help to make a attribute view from a key-value iterable object
*
* @param attributes
* @tparam ArgumentType Expected to be ArgumentType
* @param attributes The key-value iterable object
* @return nostd::span<const std::pair<nostd::string_view, common::AttributeValue>>
*/
template <
class ArgumentType,
nostd::enable_if_t<common::detail::is_key_value_iterable<ArgumentType>::value> * = nullptr>
inline static common::KeyValueIterableView<ArgumentType> MakeAttributes(
const ArgumentType &arg) noexcept
const ArgumentType &attributes) noexcept
{
return common::KeyValueIterableView<ArgumentType>(arg);
return common::KeyValueIterableView<ArgumentType>(attributes);
}

} // namespace common
Expand Down
2 changes: 1 addition & 1 deletion api/include/opentelemetry/context/runtime_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class OPENTELEMETRY_EXPORT RuntimeContextStorage

/**
* Set the current context.
* @param the new current context
* @param context The new current context
* @return a token for the new current context. This never returns a nullptr.
*/
virtual nostd::unique_ptr<Token> Attach(const Context &context) noexcept = 0;
Expand Down
2 changes: 1 addition & 1 deletion api/include/opentelemetry/logs/event_logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class OPENTELEMETRY_DEPRECATED EventLogger
* Emit a event Log Record object with arguments
*
* @param event_name Event name
* @tparam args Arguments which can be used to set data of log record by type.
* @param args Arguments which can be used to set data of log record by type.
* Severity -> severity, severity_text
* string_view -> body
* AttributeValue -> body
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ class InMemoryMetricExporterFactory
/// temporality selector.
/// @param [out] data the InMemoryMetricData the exporter will write to,
/// for the caller to inspect
/// @param [in] buffer_size number of entries to save in the circular buffer
/// @param [in] temporality output temporality as a function of instrument kind
static std::unique_ptr<opentelemetry::sdk::metrics::PushMetricExporter> Create(
const std::shared_ptr<InMemoryMetricData> &data,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,12 @@ class InMemorySpanExporter final : public opentelemetry::sdk::trace::SpanExporte
}

/**
* @param timeout an optional value containing the timeout of the exporter
* Attempt to shut down the in-memory span exporter.
* @param timeout Timeout is an optional value containing the timeout of the exporter
* note: passing custom timeout values is not currently supported for this exporter
* @return Returns the status of the operation
*/
bool Shutdown(std::chrono::microseconds /* timeout */) noexcept override
bool Shutdown(std::chrono::microseconds timeout OPENTELEMETRY_MAYBE_UNUSED) noexcept override
{
is_shutdown_ = true;
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ namespace
class InMemoryMetricExporter final : public sdk::metrics::PushMetricExporter
{
public:
/// @param buffer_size a required value that sets the size of the CircularBuffer
/// @param data The in-memory data to export to.
/// @param temporality Output temporality as a function of instrument kind.
InMemoryMetricExporter(const std::shared_ptr<InMemoryMetricData> &data,
const sdk::metrics::AggregationTemporalitySelector &temporality)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,22 +81,24 @@ class HttpOperation
/**
* Old-school memory allocator
*
* @param contents
* @param size
* @param nmemb
* @param userp
* @return
* @param contents Pointer to the data received from the server.
* @param size Size of each data element.
* @param nmemb Number of data elements.
* @param userp Pointer to the user-defined data structure for storing the received data.
* @return The number of bytes actually taken care of. If this differs from size * nmemb, it
* signals an error to libcurl.
*/
static size_t WriteMemoryCallback(void *contents, size_t size, size_t nmemb, void *userp);

/**
* C++ STL std::vector allocator
*
* @param ptr
* @param size
* @param nmemb
* @param data
* @return
* @param ptr Pointer to the data received from the server.
* @param size Size of each data element.
* @param nmemb Number of data elements.
* @param userp Pointer to the user-defined data structure for storing the received data.
* @return The number of bytes actually taken care of. If this differs from size * nmemb, it
* signals an error to libcurl.
*/
static size_t WriteVectorHeaderCallback(void *ptr, size_t size, size_t nmemb, void *userp);
static size_t WriteVectorBodyCallback(void *ptr, size_t size, size_t nmemb, void *userp);
Expand Down Expand Up @@ -138,11 +140,9 @@ class HttpOperation
* Create local CURL instance for url and body
* @param method HTTP Method
* @param url HTTP URL
* @param callback
* @param request_mode Sync or async
* @param request Request Headers
* @param body Request Body
* @param raw_response Whether to parse the response
* @param request_headers Request Headers
* @param request_body Request Body
* @param is_raw_response Whether to parse the response
* @param http_conn_timeout HTTP connection timeout in seconds
* @param reuse_connection Whether connection should be reused or closed
* @param is_log_enabled To intercept some information from cURL request
Expand Down Expand Up @@ -232,22 +232,16 @@ class HttpOperation

/**
* Return a copy of response headers
*
* @return
*/
Headers GetResponseHeaders();

/**
* Return a copy of response body
*
* @return
*/
inline const std::vector<uint8_t> &GetResponseBody() const noexcept { return response_body_; }

/**
* Return a raw copy of response headers+body
*
* @return
*/
inline const std::vector<uint8_t> &GetRawResponse() const noexcept { return raw_response_; }

Expand All @@ -265,7 +259,7 @@ class HttpOperation
* Perform curl message, this function only can be called in the polling thread and it can only
* be called when got a CURLMSG_DONE.
*
* @param code
* @param code CURLcode
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks incomplete ?

*/
void PerformCurlMessage(CURLcode code);

Expand Down
2 changes: 1 addition & 1 deletion sdk/include/opentelemetry/sdk/common/atomic_unique_ptr.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class AtomicUniquePtr

/**
* Atomically swap the pointer with another.
* @param ptr the pointer to swap with
* @param other The pointer to swap with
*/
void Swap(std::unique_ptr<T> &other) noexcept { other.reset(ptr_.exchange(other.release())); }

Expand Down
2 changes: 1 addition & 1 deletion sdk/include/opentelemetry/sdk/logs/multi_recordable.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class MultiRecordable final : public Recordable

/**
* Set Resource of this log
* @param Resource the resource to set
* @param resource the resource to set
*/
void SetResource(const opentelemetry::sdk::resource::Resource &resource) noexcept override;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ class ReadWriteLogRecord final : public ReadableLogRecord

/**
* Set Resource of this log
* @param Resource the resource to set
* @param resource the resource to set
*/
void SetResource(const opentelemetry::sdk::resource::Resource &resource) noexcept override;

Expand Down
2 changes: 1 addition & 1 deletion sdk/include/opentelemetry/sdk/logs/recordable.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class Recordable : public opentelemetry::logs::LogRecord
public:
/**
* Set Resource of this log
* @param Resource the resource to set
* @param resource the resource to set
*/
virtual void SetResource(const opentelemetry::sdk::resource::Resource &resource) noexcept = 0;

Expand Down
2 changes: 1 addition & 1 deletion sdk/include/opentelemetry/sdk/metrics/meter_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ class MeterContext : public std::enable_shared_from_this<MeterContext>
* NOTE - INTERNAL method, can change in future.
* Adds a meter to the list of configured meters in thread safe manner.
*
* @param meter
* @param meter The meter to be added.
*/
void AddMeter(const std::shared_ptr<Meter> &meter);

Expand Down
5 changes: 2 additions & 3 deletions sdk/include/opentelemetry/sdk/trace/recordable.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class Recordable

/**
* Set an attribute of a span.
* @param name the name of the attribute
* @param key the name of the attribute
* @param value the attribute value
*/
virtual void SetAttribute(nostd::string_view key,
Expand Down Expand Up @@ -137,7 +137,6 @@ class Recordable

/**
* Set the trace flags of the span.
* @param flags the flags to set
*/
virtual void SetTraceFlags(opentelemetry::trace::TraceFlags /* flags */) noexcept {}

Expand All @@ -149,7 +148,7 @@ class Recordable

/**
* Set Resource of the span
* @param Resource the resource to set
* @param resource the resource to set
*/
virtual void SetResource(const opentelemetry::sdk::resource::Resource &resource) noexcept = 0;

Expand Down
2 changes: 1 addition & 1 deletion sdk/include/opentelemetry/sdk/trace/sampler.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class Sampler
* @param trace_id the TraceId for the new Span. This will be identical to that in
* the parentContext, unless this is a root span.
* @param name the name of the new Span.
* @param spanKind the opentelemetry::trace::SpanKind of the Span.
* @param span_kind the opentelemetry::trace::SpanKind of the Span.
* @param attributes list of AttributeValue with their keys.
* @param links Collection of links that will be associated with the Span to be created.
* @return sampling result whether span should be sampled or not.
Expand Down
Loading