Skip to content

Commit 4f5255a

Browse files
committed
Update all the doc comments and add WDocumention
1 parent d976876 commit 4f5255a

File tree

19 files changed

+60
-58
lines changed

19 files changed

+60
-58
lines changed

CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -603,6 +603,14 @@ if(OTELCPP_MAINTAINER_MODE)
603603
add_compile_options(-Werror)
604604
add_compile_options(-Wextra)
605605

606+
# Check if the compiler supports -Wdocumentation
607+
include(CheckCXXCompilerFlag)
608+
check_cxx_compiler_flag("-Wdocumentation" CLANG_SUPPORTS_DOCUMENTATION)
609+
if(CLANG_SUPPORTS_DOCUMENTATION)
610+
message(STATUS "Adding -Wdocumentation flag for Clang")
611+
add_compile_options(-Wdocumentation)
612+
endif()
613+
606614
# Tested with Clang 11.0 on github.
607615
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 11.0)
608616
message(STATUS "Building with additional warnings for clang.")

api/include/opentelemetry/common/attribute_value.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ namespace common
2323
/// (IEEE 754-1985) or signed 64 bit integer.
2424
/// - Homogenous arrays of primitive type values.
2525
///
26-
/// \warning
26+
/// \warning The OpenTelemetry C++ API does not support the following attribute
2727
/// \parblock The OpenTelemetry C++ API currently supports several attribute
2828
/// value types that are not covered by the OpenTelemetry specification:
2929
/// - \c uint64_t

api/include/opentelemetry/common/key_value_iterable.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@ class NoopKeyValueIterable : public KeyValueIterable
4444

4545
/**
4646
* Iterate over key-value pairs
47-
* @param callback a callback to invoke for each key-value. If the callback returns false,
47+
* A callback to invoke for each key-value. If the callback returns false,
4848
* the iteration is aborted.
4949
* @return true if every key-value pair was iterated over
5050
*/
5151
bool ForEachKeyValue(
52-
nostd::function_ref<bool(nostd::string_view, common::AttributeValue)>) const noexcept override
52+
nostd::function_ref<bool(nostd::string_view, common::AttributeValue)> /*callback*/) const noexcept override
5353
{
5454
return true;
5555
}

api/include/opentelemetry/common/key_value_iterable_view.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ KeyValueIterableView<T> MakeKeyValueIterableView(const T &container) noexcept
9191
/**
9292
* Utility function to help to make a attribute view from initializer_list
9393
*
94-
* @param attributes
94+
* @param attributes The initializer_list of key-value pairs
9595
* @return nostd::span<const std::pair<nostd::string_view, common::AttributeValue>>
9696
*/
9797
inline static nostd::span<const std::pair<nostd::string_view, common::AttributeValue>>
@@ -105,7 +105,7 @@ MakeAttributes(std::initializer_list<std::pair<nostd::string_view, common::Attri
105105
/**
106106
* Utility function to help to make a attribute view from a span
107107
*
108-
* @param attributes
108+
* @param attributes The span of key-value pairs
109109
* @return nostd::span<const std::pair<nostd::string_view, common::AttributeValue>>
110110
*/
111111
inline static nostd::span<const std::pair<nostd::string_view, common::AttributeValue>>
@@ -118,7 +118,7 @@ MakeAttributes(
118118
/**
119119
* Utility function to help to make a attribute view from a KeyValueIterable
120120
*
121-
* @param attributes
121+
* @param attributes The KeyValueIterable of key-value pairs
122122
* @return common::KeyValueIterable
123123
*/
124124
inline static const common::KeyValueIterable &MakeAttributes(
@@ -130,7 +130,7 @@ inline static const common::KeyValueIterable &MakeAttributes(
130130
/**
131131
* Utility function to help to make a attribute view from a key-value iterable object
132132
*
133-
* @param attributes
133+
* @param arg The key-value iterable object
134134
* @return nostd::span<const std::pair<nostd::string_view, common::AttributeValue>>
135135
*/
136136
template <

api/include/opentelemetry/context/runtime_context.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class OPENTELEMETRY_EXPORT RuntimeContextStorage
5656

5757
/**
5858
* Set the current context.
59-
* @param the new current context
59+
* @param context new current context
6060
* @return a token for the new current context. This never returns a nullptr.
6161
*/
6262
virtual nostd::unique_ptr<Token> Attach(const Context &context) noexcept = 0;

api/include/opentelemetry/logs/event_logger.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class OPENTELEMETRY_DEPRECATED EventLogger
4242
* Emit a event Log Record object with arguments
4343
*
4444
* @param event_name Event name
45-
* @tparam args Arguments which can be used to set data of log record by type.
45+
* @param args Arguments which can be used to set data of log record by type.
4646
* Severity -> severity, severity_text
4747
* string_view -> body
4848
* AttributeValue -> body

api/include/opentelemetry/semconv/incubating/process_attributes.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,7 @@ static constexpr const char *kProcessInteractive = "process.interactive";
133133
* <p>
134134
* Control groups (cgroups) are a kernel feature used to organize and manage process resources. This
135135
* attribute provides the path(s) to the cgroup(s) associated with the process, which should match
136-
* the contents of the <a
137-
* href="https://man7.org/linux/man-pages/man7/cgroups.7.html">/proc/[PID]/cgroup</a> file.
136+
* the contents of the <a href="https://man7.org/linux/man-pages/man7/cgroups.7.html">/proc/[PID]/cgroup</a> file.
138137
*/
139138
static constexpr const char *kProcessLinuxCgroup = "process.linux.cgroup";
140139

api/include/opentelemetry/semconv/incubating/system_metrics.h

Lines changed: 30 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -277,12 +277,13 @@ static inline nostd::shared_ptr<metrics::ObservableInstrument> CreateAsyncDouble
277277
* Time disk spent activated
278278
* <p>
279279
* The real elapsed time ("wall clock") used in the I/O path (time from operations running in
280-
* parallel are not counted). Measured as: <ul> <li>Linux: Field 13 from <a
281-
* href="https://www.kernel.org/doc/Documentation/ABI/testing/procfs-diskstats">procfs-diskstats</a></li>
282-
* <li>Windows: The complement of
283-
* <a
284-
* href="https://learn.microsoft.com/archive/blogs/askcore/windows-performance-monitor-disk-counters-explained#windows-performance-monitor-disk-counters-explained">"Disk%
285-
* Idle Time"</a> performance counter: @code uptime * (100 - "Disk\% Idle Time") / 100 @endcode</li>
280+
* parallel are not counted). Measured as: <ul>
281+
* <li>Linux: Field 13 from
282+
* <a href="https://www.kernel.org/doc/Documentation/ABI/testing/procfs-diskstats">procfs-diskstats</a>
283+
* </li>
284+
* <li>Windows: The complement of
285+
* <a href="https://learn.microsoft.com/archive/blogs/askcore/ windows-performance-monitor-disk-counters-explained#windows-performance-monitor-disk-counters-explained">"Disk% Idle Time"</a>
286+
* performance counter: @code uptime * (100 - "Disk\% Idle Time") / 100 @endcode</li>
286287
* </ul>
287288
* <p>
288289
* counter
@@ -395,8 +396,8 @@ CreateAsyncDoubleMetricSystemDiskMerged(metrics::Meter *meter)
395396
* Sum of the time each operation took to complete
396397
* <p>
397398
* Because it is the sum of time each request took, parallel-issued requests each contribute to make
398-
* the count grow. Measured as: <ul> <li>Linux: Fields 7 & 11 from <a
399-
* href="https://www.kernel.org/doc/Documentation/ABI/testing/procfs-diskstats">procfs-diskstats</a></li>
399+
* the count grow. Measured as: <ul> <li>Linux: Fields 7 & 11 from
400+
* <a href="https://www.kernel.org/doc/Documentation/ABI/testing/procfs-diskstats">procfs-diskstats</a></li>
400401
* <li>Windows: "Avg. Disk sec/Read" perf counter multiplied by "Disk Reads/sec" perf counter
401402
* (similar for Writes)</li>
402403
* </ul>
@@ -608,9 +609,9 @@ CreateAsyncDoubleMetricSystemFilesystemUtilization(metrics::Meter *meter)
608609
* swapping <p> This is an alternative to @code system.memory.usage @endcode metric with @code
609610
* state=free @endcode. Linux starting from 3.14 exports "available" memory. It takes "free" memory
610611
* as a baseline, and then factors in kernel-specific values. This is supposed to be more accurate
611-
* than just "free" memory. For reference, see the calculations <a
612-
* href="https://superuser.com/a/980821">here</a>. See also @code MemAvailable @endcode in <a
613-
* href="https://man7.org/linux/man-pages/man5/proc.5.html">/proc/meminfo</a>. <p> updowncounter
612+
* than just "free" memory. For reference, see the calculations
613+
* <a href="https://superuser.com/a/980821">here</a>. See also @code MemAvailable @endcode in
614+
* <a href="https://man7.org/linux/man-pages/man5/proc.5.html">/proc/meminfo</a>. <p> updowncounter
614615
*/
615616
static constexpr const char *kMetricSystemLinuxMemoryAvailable = "system.linux.memory.available";
616617
static constexpr const char *descrMetricSystemLinuxMemoryAvailable =
@@ -655,10 +656,10 @@ CreateAsyncDoubleMetricSystemLinuxMemoryAvailable(metrics::Meter *meter)
655656
* <p>
656657
* The sum over the @code reclaimable @endcode and @code unreclaimable @endcode state values in
657658
* @code linux.memory.slab.usage @endcode SHOULD be equal to the total slab memory available on the
658-
* system. Note that the total slab memory is not constant and may vary over time. See also the <a
659-
* href="https://blogs.oracle.com/linux/post/understanding-linux-kernel-memory-statistics">Slab
660-
* allocator</a> and @code Slab @endcode in <a
661-
* href="https://man7.org/linux/man-pages/man5/proc.5.html">/proc/meminfo</a>. <p> updowncounter
659+
* system. Note that the total slab memory is not constant and may vary over time. See also the
660+
* <a href="https://blogs.oracle.com/linux/post/understanding-linux-kernel-memory-statistics">Slab allocator</a>
661+
* and @code Slab @endcode in
662+
* <a href="https://man7.org/linux/man-pages/man5/proc.5.html">/proc/meminfo</a>. <p> updowncounter
662663
*/
663664
static constexpr const char *kMetricSystemLinuxMemorySlabUsage = "system.linux.memory.slab.usage";
664665
static constexpr const char *descrMetricSystemLinuxMemorySlabUsage =
@@ -739,10 +740,10 @@ CreateAsyncDoubleMetricSystemMemoryLimit(metrics::Meter *meter)
739740
/**
740741
* Shared memory used (mostly by tmpfs).
741742
* <p>
742-
* Equivalent of @code shared @endcode from <a
743-
* href="https://man7.org/linux/man-pages/man1/free.1.html">@code free @endcode command</a> or
744-
* @code Shmem @endcode from <a href="https://man7.org/linux/man-pages/man5/proc.5.html">@code
745-
* /proc/meminfo @endcode</a>" <p> updowncounter
743+
* Equivalent of @code shared @endcode from
744+
* <a href="https://man7.org/linux/man-pages/man1/free.1.html"> @code free @endcode command</a> or
745+
* @code Shmem @endcode from
746+
* <a href="https://man7.org/linux/man-pages/man5/proc.5.html"> @code /proc/meminfo @endcode</a>" <p> updowncounter
746747
*/
747748
static constexpr const char *kMetricSystemMemoryShared = "system.memory.shared";
748749
static constexpr const char *descrMetricSystemMemoryShared =
@@ -902,13 +903,11 @@ CreateAsyncDoubleMetricSystemNetworkConnections(metrics::Meter *meter)
902903
* <p>
903904
* Measured as:
904905
* <ul>
905-
* <li>Linux: the @code drop @endcode column in @code /proc/dev/net @endcode (<a
906-
* href="https://web.archive.org/web/20180321091318/http://www.onlamp.com/pub/a/linux/2000/11/16/LinuxAdmin.html">source</a>)</li>
907-
* <li>Windows: <a
908-
* href="https://docs.microsoft.com/windows/win32/api/netioapi/ns-netioapi-mib_if_row2">@code
909-
* InDiscards @endcode/@code OutDiscards @endcode</a> from <a
910-
* href="https://docs.microsoft.com/windows/win32/api/netioapi/nf-netioapi-getifentry2">@code
911-
* GetIfEntry2 @endcode</a></li>
906+
* <li>Linux: the @code drop @endcode column in @code /proc/dev/net @endcode (
907+
* <a href="https://web.archive.org/web/20180321091318/http://www.onlamp.com/pub/a/linux/2000/11/16/LinuxAdmin.html">source</a>)</li>
908+
* <li>Windows:
909+
* <a href="https://docs.microsoft.com/windows/win32/api/netioapi/ns-netioapi-mib_if_row2"> @code InDiscards @endcode/@code OutDiscards @endcode</a>
910+
* from <a href="https://docs.microsoft.com/windows/win32/api/netioapi/nf-netioapi-getifentry2"> @code GetIfEntry2 @endcode</a></li>
912911
* </ul>
913912
* <p>
914913
* counter
@@ -951,13 +950,11 @@ CreateAsyncDoubleMetricSystemNetworkDropped(metrics::Meter *meter)
951950
* <p>
952951
* Measured as:
953952
* <ul>
954-
* <li>Linux: the @code errs @endcode column in @code /proc/dev/net @endcode (<a
955-
* href="https://web.archive.org/web/20180321091318/http://www.onlamp.com/pub/a/linux/2000/11/16/LinuxAdmin.html">source</a>).</li>
956-
* <li>Windows: <a
957-
* href="https://docs.microsoft.com/windows/win32/api/netioapi/ns-netioapi-mib_if_row2">@code
958-
* InErrors @endcode/@code OutErrors @endcode</a> from <a
959-
* href="https://docs.microsoft.com/windows/win32/api/netioapi/nf-netioapi-getifentry2">@code
960-
* GetIfEntry2 @endcode</a>.</li>
953+
* <li>Linux: the @code errs @endcode column in @code /proc/dev/net @endcode (
954+
* <a href="https://web.archive.org/web/20180321091318/http://www.onlamp.com/pub/a/linux/2000/11/16/LinuxAdmin.html">source</a>).</li>
955+
* <li>Windows:
956+
* <a href="https://docs.microsoft.com/windows/win32/api/netioapi/ns-netioapi-mib_if_row2"> @code InErrors @endcode/@code OutErrors @endcode</a>
957+
* from <a href="https://docs.microsoft.com/windows/win32/api/netioapi/nf-netioapi-getifentry2"> @code GetIfEntry2 @endcode</a>.</li>
961958
* </ul>
962959
* <p>
963960
* counter

api/include/opentelemetry/semconv/service_attributes.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ namespace service
2323
* Logical name of the service.
2424
* <p>
2525
* MUST be the same for all instances of horizontally scaled services. If the value was not
26-
* specified, SDKs MUST fallback to @code unknown_service: @endcode concatenated with <a
27-
* href="process.md">@code process.executable.name @endcode</a>, e.g. @code unknown_service:bash
26+
* specified, SDKs MUST fallback to @code unknown_service: @endcode concatenated
27+
* with <a href="process.md">@code process.executable.name @endcode</a>, e.g. @code unknown_service:bash
2828
* @endcode. If @code process.executable.name @endcode is not available, the value MUST be set to
2929
* @code unknown_service @endcode.
3030
*/

exporters/memory/include/opentelemetry/exporters/memory/in_memory_metric_exporter_factory.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ class InMemoryMetricExporterFactory
2424
/// temporality selector.
2525
/// @param [out] data the InMemoryMetricData the exporter will write to,
2626
/// for the caller to inspect
27-
/// @param [in] buffer_size number of entries to save in the circular buffer
2827
/// @param [in] temporality output temporality as a function of instrument kind
2928
static std::unique_ptr<opentelemetry::sdk::metrics::PushMetricExporter> Create(
3029
const std::shared_ptr<InMemoryMetricData> &data,

0 commit comments

Comments
 (0)