From 4f5255ae4d7ac0bdff04f0c484f93dd5c1f394a8 Mon Sep 17 00:00:00 2001 From: Evan Date: Wed, 23 Apr 2025 14:55:39 +0000 Subject: [PATCH 01/17] Update all the doc comments and add WDocumention --- CMakeLists.txt | 8 +++ .../opentelemetry/common/attribute_value.h | 2 +- .../opentelemetry/common/key_value_iterable.h | 4 +- .../common/key_value_iterable_view.h | 8 +-- .../opentelemetry/context/runtime_context.h | 2 +- api/include/opentelemetry/logs/event_logger.h | 2 +- .../semconv/incubating/process_attributes.h | 3 +- .../semconv/incubating/system_metrics.h | 63 +++++++++---------- .../semconv/service_attributes.h | 4 +- .../in_memory_metric_exporter_factory.h | 1 - .../memory/in_memory_span_exporter.h | 2 +- .../src/in_memory_metric_exporter_factory.cc | 2 +- .../sdk/common/atomic_unique_ptr.h | 2 +- .../opentelemetry/sdk/logs/multi_recordable.h | 2 +- .../sdk/logs/read_write_log_record.h | 2 +- .../opentelemetry/sdk/logs/recordable.h | 2 +- .../opentelemetry/sdk/metrics/meter_context.h | 2 +- .../opentelemetry/sdk/trace/recordable.h | 5 +- sdk/include/opentelemetry/sdk/trace/sampler.h | 2 +- 19 files changed, 60 insertions(+), 58 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 98b70798c6..663013b181 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -603,6 +603,14 @@ if(OTELCPP_MAINTAINER_MODE) add_compile_options(-Werror) add_compile_options(-Wextra) + # Check if the compiler supports -Wdocumentation + include(CheckCXXCompilerFlag) + check_cxx_compiler_flag("-Wdocumentation" CLANG_SUPPORTS_DOCUMENTATION) + if(CLANG_SUPPORTS_DOCUMENTATION) + message(STATUS "Adding -Wdocumentation flag for Clang") + add_compile_options(-Wdocumentation) + endif() + # Tested with Clang 11.0 on github. if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 11.0) message(STATUS "Building with additional warnings for clang.") diff --git a/api/include/opentelemetry/common/attribute_value.h b/api/include/opentelemetry/common/attribute_value.h index af4cc83d42..1639d8bf74 100644 --- a/api/include/opentelemetry/common/attribute_value.h +++ b/api/include/opentelemetry/common/attribute_value.h @@ -23,7 +23,7 @@ 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 /// \parblock The OpenTelemetry C++ API currently supports several attribute /// value types that are not covered by the OpenTelemetry specification: /// - \c uint64_t diff --git a/api/include/opentelemetry/common/key_value_iterable.h b/api/include/opentelemetry/common/key_value_iterable.h index 9d43e1571b..c195b8e262 100644 --- a/api/include/opentelemetry/common/key_value_iterable.h +++ b/api/include/opentelemetry/common/key_value_iterable.h @@ -44,12 +44,12 @@ class NoopKeyValueIterable : public KeyValueIterable /** * Iterate over key-value pairs - * @param callback a callback to invoke for each key-value. If the callback returns false, + * 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 */ bool ForEachKeyValue( - nostd::function_ref) const noexcept override + nostd::function_ref /*callback*/) const noexcept override { return true; } diff --git a/api/include/opentelemetry/common/key_value_iterable_view.h b/api/include/opentelemetry/common/key_value_iterable_view.h index e22fb6f06f..01f281661f 100644 --- a/api/include/opentelemetry/common/key_value_iterable_view.h +++ b/api/include/opentelemetry/common/key_value_iterable_view.h @@ -91,7 +91,7 @@ KeyValueIterableView 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> */ inline static nostd::span> @@ -105,7 +105,7 @@ MakeAttributes(std::initializer_list> */ inline static nostd::span> @@ -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( @@ -130,7 +130,7 @@ inline static const common::KeyValueIterable &MakeAttributes( /** * Utility function to help to make a attribute view from a key-value iterable object * - * @param attributes + * @param arg The key-value iterable object * @return nostd::span> */ template < diff --git a/api/include/opentelemetry/context/runtime_context.h b/api/include/opentelemetry/context/runtime_context.h index e3f88254cb..5d502c7754 100644 --- a/api/include/opentelemetry/context/runtime_context.h +++ b/api/include/opentelemetry/context/runtime_context.h @@ -56,7 +56,7 @@ class OPENTELEMETRY_EXPORT RuntimeContextStorage /** * Set the current context. - * @param the new current context + * @param context new current context * @return a token for the new current context. This never returns a nullptr. */ virtual nostd::unique_ptr Attach(const Context &context) noexcept = 0; diff --git a/api/include/opentelemetry/logs/event_logger.h b/api/include/opentelemetry/logs/event_logger.h index bcc1035625..929e97cc2c 100644 --- a/api/include/opentelemetry/logs/event_logger.h +++ b/api/include/opentelemetry/logs/event_logger.h @@ -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 diff --git a/api/include/opentelemetry/semconv/incubating/process_attributes.h b/api/include/opentelemetry/semconv/incubating/process_attributes.h index 8cad737f78..a2449c1904 100644 --- a/api/include/opentelemetry/semconv/incubating/process_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/process_attributes.h @@ -133,8 +133,7 @@ static constexpr const char *kProcessInteractive = "process.interactive"; *

* Control groups (cgroups) are a kernel feature used to organize and manage process resources. This * attribute provides the path(s) to the cgroup(s) associated with the process, which should match - * the contents of the /proc/[PID]/cgroup file. + * the contents of the /proc/[PID]/cgroup file. */ static constexpr const char *kProcessLinuxCgroup = "process.linux.cgroup"; diff --git a/api/include/opentelemetry/semconv/incubating/system_metrics.h b/api/include/opentelemetry/semconv/incubating/system_metrics.h index a985dac901..9fba9881c6 100644 --- a/api/include/opentelemetry/semconv/incubating/system_metrics.h +++ b/api/include/opentelemetry/semconv/incubating/system_metrics.h @@ -277,12 +277,13 @@ static inline nostd::shared_ptr CreateAsyncDouble * Time disk spent activated *

* The real elapsed time ("wall clock") used in the I/O path (time from operations running in - * parallel are not counted). Measured as:

  • Linux: Field 13 from procfs-diskstats
  • - *
  • Windows: The complement of - * "Disk% - * Idle Time" performance counter: @code uptime * (100 - "Disk\% Idle Time") / 100 @endcode
  • + * parallel are not counted). Measured as:
      + *
    • Linux: Field 13 from + * procfs-diskstats + *
    • + *
    • Windows: The complement of + * "Disk% Idle Time" + * performance counter: @code uptime * (100 - "Disk\% Idle Time") / 100 @endcode
    • *
    *

    * counter @@ -395,8 +396,8 @@ CreateAsyncDoubleMetricSystemDiskMerged(metrics::Meter *meter) * Sum of the time each operation took to complete *

    * Because it is the sum of time each request took, parallel-issued requests each contribute to make - * the count grow. Measured as:

    • Linux: Fields 7 & 11 from procfs-diskstats
    • + * the count grow. Measured as:
      • Linux: Fields 7 & 11 from + * procfs-diskstats
      • *
      • Windows: "Avg. Disk sec/Read" perf counter multiplied by "Disk Reads/sec" perf counter * (similar for Writes)
      • *
      @@ -608,9 +609,9 @@ CreateAsyncDoubleMetricSystemFilesystemUtilization(metrics::Meter *meter) * swapping

      This is an alternative to @code system.memory.usage @endcode metric with @code * state=free @endcode. Linux starting from 3.14 exports "available" memory. It takes "free" memory * as a baseline, and then factors in kernel-specific values. This is supposed to be more accurate - * than just "free" memory. For reference, see the calculations here. See also @code MemAvailable @endcode in /proc/meminfo.

      updowncounter + * than just "free" memory. For reference, see the calculations + * here. See also @code MemAvailable @endcode in + * /proc/meminfo.

      updowncounter */ static constexpr const char *kMetricSystemLinuxMemoryAvailable = "system.linux.memory.available"; static constexpr const char *descrMetricSystemLinuxMemoryAvailable = @@ -655,10 +656,10 @@ CreateAsyncDoubleMetricSystemLinuxMemoryAvailable(metrics::Meter *meter) *

      * The sum over the @code reclaimable @endcode and @code unreclaimable @endcode state values in * @code linux.memory.slab.usage @endcode SHOULD be equal to the total slab memory available on the - * system. Note that the total slab memory is not constant and may vary over time. See also the Slab - * allocator and @code Slab @endcode in /proc/meminfo.

      updowncounter + * system. Note that the total slab memory is not constant and may vary over time. See also the + * Slab allocator + * and @code Slab @endcode in + * /proc/meminfo.

      updowncounter */ static constexpr const char *kMetricSystemLinuxMemorySlabUsage = "system.linux.memory.slab.usage"; static constexpr const char *descrMetricSystemLinuxMemorySlabUsage = @@ -739,10 +740,10 @@ CreateAsyncDoubleMetricSystemMemoryLimit(metrics::Meter *meter) /** * Shared memory used (mostly by tmpfs). *

      - * Equivalent of @code shared @endcode from @code free @endcode command or - * @code Shmem @endcode from @code - * /proc/meminfo @endcode"

      updowncounter + * Equivalent of @code shared @endcode from + * @code free @endcode command or + * @code Shmem @endcode from + * @code /proc/meminfo @endcode"

      updowncounter */ static constexpr const char *kMetricSystemMemoryShared = "system.memory.shared"; static constexpr const char *descrMetricSystemMemoryShared = @@ -902,13 +903,11 @@ CreateAsyncDoubleMetricSystemNetworkConnections(metrics::Meter *meter) *

      * Measured as: *

      *

      * counter @@ -951,13 +950,11 @@ CreateAsyncDoubleMetricSystemNetworkDropped(metrics::Meter *meter) *

      * Measured as: *

      *

      * counter diff --git a/api/include/opentelemetry/semconv/service_attributes.h b/api/include/opentelemetry/semconv/service_attributes.h index e4c0dda17a..7342ea0b6b 100644 --- a/api/include/opentelemetry/semconv/service_attributes.h +++ b/api/include/opentelemetry/semconv/service_attributes.h @@ -23,8 +23,8 @@ namespace service * Logical name of the service. *

      * MUST be the same for all instances of horizontally scaled services. If the value was not - * specified, SDKs MUST fallback to @code unknown_service: @endcode concatenated with @code process.executable.name @endcode, e.g. @code unknown_service:bash + * specified, SDKs MUST fallback to @code unknown_service: @endcode concatenated + * with @code process.executable.name @endcode, e.g. @code unknown_service:bash * @endcode. If @code process.executable.name @endcode is not available, the value MUST be set to * @code unknown_service @endcode. */ diff --git a/exporters/memory/include/opentelemetry/exporters/memory/in_memory_metric_exporter_factory.h b/exporters/memory/include/opentelemetry/exporters/memory/in_memory_metric_exporter_factory.h index ae1c2b8579..7207e03d7b 100644 --- a/exporters/memory/include/opentelemetry/exporters/memory/in_memory_metric_exporter_factory.h +++ b/exporters/memory/include/opentelemetry/exporters/memory/in_memory_metric_exporter_factory.h @@ -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 Create( const std::shared_ptr &data, diff --git a/exporters/memory/include/opentelemetry/exporters/memory/in_memory_span_exporter.h b/exporters/memory/include/opentelemetry/exporters/memory/in_memory_span_exporter.h index 8d3918f907..5ef89c5e52 100644 --- a/exporters/memory/include/opentelemetry/exporters/memory/in_memory_span_exporter.h +++ b/exporters/memory/include/opentelemetry/exporters/memory/in_memory_span_exporter.h @@ -81,7 +81,7 @@ class InMemorySpanExporter final : public opentelemetry::sdk::trace::SpanExporte } /** - * @param timeout an optional value containing the timeout of the exporter + * 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 */ diff --git a/exporters/memory/src/in_memory_metric_exporter_factory.cc b/exporters/memory/src/in_memory_metric_exporter_factory.cc index 227d846fbb..8a2ce63208 100644 --- a/exporters/memory/src/in_memory_metric_exporter_factory.cc +++ b/exporters/memory/src/in_memory_metric_exporter_factory.cc @@ -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 &data, const sdk::metrics::AggregationTemporalitySelector &temporality) diff --git a/sdk/include/opentelemetry/sdk/common/atomic_unique_ptr.h b/sdk/include/opentelemetry/sdk/common/atomic_unique_ptr.h index e554526666..523df0aa08 100644 --- a/sdk/include/opentelemetry/sdk/common/atomic_unique_ptr.h +++ b/sdk/include/opentelemetry/sdk/common/atomic_unique_ptr.h @@ -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 &other) noexcept { other.reset(ptr_.exchange(other.release())); } diff --git a/sdk/include/opentelemetry/sdk/logs/multi_recordable.h b/sdk/include/opentelemetry/sdk/logs/multi_recordable.h index 40a9c92e3b..ad19b231ab 100644 --- a/sdk/include/opentelemetry/sdk/logs/multi_recordable.h +++ b/sdk/include/opentelemetry/sdk/logs/multi_recordable.h @@ -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; diff --git a/sdk/include/opentelemetry/sdk/logs/read_write_log_record.h b/sdk/include/opentelemetry/sdk/logs/read_write_log_record.h index 9831eaa1c9..c51b0dd888 100644 --- a/sdk/include/opentelemetry/sdk/logs/read_write_log_record.h +++ b/sdk/include/opentelemetry/sdk/logs/read_write_log_record.h @@ -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; diff --git a/sdk/include/opentelemetry/sdk/logs/recordable.h b/sdk/include/opentelemetry/sdk/logs/recordable.h index 65f5f6ae94..ea203fb8a4 100644 --- a/sdk/include/opentelemetry/sdk/logs/recordable.h +++ b/sdk/include/opentelemetry/sdk/logs/recordable.h @@ -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; diff --git a/sdk/include/opentelemetry/sdk/metrics/meter_context.h b/sdk/include/opentelemetry/sdk/metrics/meter_context.h index 468f5cdab5..53f6298049 100644 --- a/sdk/include/opentelemetry/sdk/metrics/meter_context.h +++ b/sdk/include/opentelemetry/sdk/metrics/meter_context.h @@ -150,7 +150,7 @@ class MeterContext : public std::enable_shared_from_this * 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); diff --git a/sdk/include/opentelemetry/sdk/trace/recordable.h b/sdk/include/opentelemetry/sdk/trace/recordable.h index 5918b80133..69bac30949 100644 --- a/sdk/include/opentelemetry/sdk/trace/recordable.h +++ b/sdk/include/opentelemetry/sdk/trace/recordable.h @@ -59,7 +59,7 @@ class Recordable * @param name the name of the attribute * @param value the attribute value */ - virtual void SetAttribute(nostd::string_view key, + virtual void SetAttribute(nostd::string_view name, const opentelemetry::common::AttributeValue &value) noexcept = 0; /** @@ -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 {} @@ -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; diff --git a/sdk/include/opentelemetry/sdk/trace/sampler.h b/sdk/include/opentelemetry/sdk/trace/sampler.h index b90a2e66b2..c8339ea7b1 100644 --- a/sdk/include/opentelemetry/sdk/trace/sampler.h +++ b/sdk/include/opentelemetry/sdk/trace/sampler.h @@ -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. From 6402c14233528ee056654dadec69f0abee7168db Mon Sep 17 00:00:00 2001 From: Evan Date: Wed, 23 Apr 2025 16:51:51 +0000 Subject: [PATCH 02/17] Fix the doc comments in http_operation_curl.h --- .../http/client/curl/http_operation_curl.h | 36 ++++++++----------- 1 file changed, 14 insertions(+), 22 deletions(-) diff --git a/ext/include/opentelemetry/ext/http/client/curl/http_operation_curl.h b/ext/include/opentelemetry/ext/http/client/curl/http_operation_curl.h index 2c3565177c..6dcbaeedea 100644 --- a/ext/include/opentelemetry/ext/http/client/curl/http_operation_curl.h +++ b/ext/include/opentelemetry/ext/http/client/curl/http_operation_curl.h @@ -81,22 +81,22 @@ 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); @@ -138,11 +138,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 @@ -232,22 +230,16 @@ class HttpOperation /** * Return a copy of response headers - * - * @return */ Headers GetResponseHeaders(); /** * Return a copy of response body - * - * @return */ inline const std::vector &GetResponseBody() const noexcept { return response_body_; } /** * Return a raw copy of response headers+body - * - * @return */ inline const std::vector &GetRawResponse() const noexcept { return raw_response_; } @@ -265,7 +257,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 */ void PerformCurlMessage(CURLcode code); From e3c83f53476eadff44dc7ea44d833649cefd12c7 Mon Sep 17 00:00:00 2001 From: Evan Date: Thu, 24 Apr 2025 15:29:29 +0000 Subject: [PATCH 03/17] Fix the doc comment issues in semconv --- .../semconv/incubating/url_attributes.h | 50 ++++++++----------- 1 file changed, 22 insertions(+), 28 deletions(-) diff --git a/api/include/opentelemetry/semconv/incubating/url_attributes.h b/api/include/opentelemetry/semconv/incubating/url_attributes.h index 2646de430d..e2938d2575 100644 --- a/api/include/opentelemetry/semconv/incubating/url_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/url_attributes.h @@ -23,8 +23,8 @@ namespace url * Domain extracted from the @code url.full @endcode, such as "opentelemetry.io". *

      * In some cases a URL may refer to an IP and/or port directly, without a domain name. In this case, - * the IP address would go to the domain field. If the URL contains a literal IPv6 address enclosed by + * the IP address would go to the domain field. If the URL contains a + * literal IPv6 address enclosed by * @code [ @endcode and @code ] @endcode, the @code [ @endcode and @code ] @endcode characters * should also be captured in the domain field. */ @@ -45,8 +45,8 @@ static constexpr const char *kUrlExtension = "url.extension"; static constexpr const char *kUrlFragment = "url.fragment"; /** - * Absolute URL describing a network resource according to RFC3986

      For network calls, URL usually has + * Absolute URL describing a network resource according to + * RFC3986

      For network calls, URL usually has * @code scheme://host[:port][path][?query][#fragment] @endcode format, where the fragment is not * transmitted over HTTP, but if it is known, it SHOULD be included nevertheless.

      * @code url.full @endcode MUST NOT contain credentials passed via URL in form of @code @@ -60,15 +60,12 @@ static constexpr const char *kUrlFragment = "url.fragment"; * Query string values for the following keys SHOULD be redacted by default and replaced by the * value @code REDACTED @endcode: *

      *

      * This list is subject to change over time. @@ -110,15 +107,11 @@ static constexpr const char *kUrlPort = "url.port"; * can identify it.

      * * Query string values for the following keys SHOULD be redacted by default and replaced by the - * value @code REDACTED @endcode:

      • @code - * AWSAccessKeyId @endcode
      • @code - * Signature @endcode
      • @code sig - * @endcode
      • @code X-Goog-Signature - * @endcode
      • + * value @code REDACTED @endcode: *

        * This list is subject to change over time. @@ -131,8 +124,9 @@ static constexpr const char *kUrlQuery = "url.query"; /** * The highest registered url domain, stripped of the subdomain. *

        - * This value can be determined precisely with the public suffix - * list. For example, the registered domain for @code foo.example.com @endcode is @code + * This value can be determined precisely with the + * public suffix list. + * For example, the registered domain for @code foo.example.com @endcode is @code * example.com @endcode. Trying to approximate this by simply taking the last two labels will not * work well for TLDs such as @code co.uk @endcode. */ @@ -155,16 +149,16 @@ static constexpr const char *kUrlScheme = "url.scheme"; static constexpr const char *kUrlSubdomain = "url.subdomain"; /** - * The low-cardinality template of an absolute path reference. + * The low-cardinality template of an + * absolute path reference. */ static constexpr const char *kUrlTemplate = "url.template"; /** * The effective top level domain (eTLD), also known as the domain suffix, is the last part of the * domain name. For example, the top level domain for example.com is @code com @endcode.

        This - * value can be determined precisely with the public suffix - * list. + * value can be determined precisely with the + * public suffix list. */ static constexpr const char *kUrlTopLevelDomain = "url.top_level_domain"; From 7a210ec29a65a23329f27aeac7c50c374b100f44 Mon Sep 17 00:00:00 2001 From: Evan Date: Thu, 24 Apr 2025 15:31:20 +0000 Subject: [PATCH 04/17] Add more details for AttributeValue warnning --- api/include/opentelemetry/common/attribute_value.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/include/opentelemetry/common/attribute_value.h b/api/include/opentelemetry/common/attribute_value.h index 1639d8bf74..cf4105ea3b 100644 --- a/api/include/opentelemetry/common/attribute_value.h +++ b/api/include/opentelemetry/common/attribute_value.h @@ -23,7 +23,8 @@ namespace common /// (IEEE 754-1985) or signed 64 bit integer. /// - Homogenous arrays of primitive type values. /// -/// \warning The OpenTelemetry C++ API does not support the following attribute +/// \warning The OpenTelemetry C++ API does not support the following attribute: +/// uint64_t, nostd::span, and nostd::span types. /// \parblock The OpenTelemetry C++ API currently supports several attribute /// value types that are not covered by the OpenTelemetry specification: /// - \c uint64_t From 78d678785da31800fab58364ccfbac2235da039d Mon Sep 17 00:00:00 2001 From: Evan Date: Thu, 24 Apr 2025 16:30:30 +0000 Subject: [PATCH 05/17] Fix the doc issues in url_atteibutes.h --- .../opentelemetry/semconv/url_attributes.h | 38 +++++++++---------- 1 file changed, 17 insertions(+), 21 deletions(-) diff --git a/api/include/opentelemetry/semconv/url_attributes.h b/api/include/opentelemetry/semconv/url_attributes.h index 8d7310d590..127393bf8c 100644 --- a/api/include/opentelemetry/semconv/url_attributes.h +++ b/api/include/opentelemetry/semconv/url_attributes.h @@ -25,8 +25,8 @@ namespace url static constexpr const char *kUrlFragment = "url.fragment"; /** - * Absolute URL describing a network resource according to RFC3986

        For network calls, URL usually has + * Absolute URL describing a network resource according to + * RFC3986

        For network calls, URL usually has * @code scheme://host[:port][path][?query][#fragment] @endcode format, where the fragment is not * transmitted over HTTP, but if it is known, it SHOULD be included nevertheless.

        * @code url.full @endcode MUST NOT contain credentials passed via URL in form of @code @@ -40,15 +40,14 @@ static constexpr const char *kUrlFragment = "url.fragment"; * Query string values for the following keys SHOULD be redacted by default and replaced by the * value @code REDACTED @endcode: *

        *

        * This list is subject to change over time. @@ -67,21 +66,18 @@ static constexpr const char *kUrlFull = "url.full"; static constexpr const char *kUrlPath = "url.path"; /** - * The URI query component + * The URI query component @link https://learn.microsoft.com/azure/storage/common/storage-sas-overview#sas-token @code sig @endcode @endlink *

        * Sensitive content provided in @code url.query @endcode SHOULD be scrubbed when instrumentations * can identify it.

        * * Query string values for the following keys SHOULD be redacted by default and replaced by the - * value @code REDACTED @endcode:

        • @code - * AWSAccessKeyId @endcode
        • @code - * Signature @endcode
        • @code sig - * @endcode
        • @code X-Goog-Signature - * @endcode
        • + * value @code REDACTED @endcode: *

          * This list is subject to change over time. From e30863f1e30e4dda9afeba8d90dd11dc6fe90fe5 Mon Sep 17 00:00:00 2001 From: Evan Date: Tue, 6 May 2025 14:57:00 +0000 Subject: [PATCH 06/17] Fix the doc comments --- api/include/opentelemetry/common/key_value_iterable.h | 10 ++++------ .../opentelemetry/common/key_value_iterable_view.h | 7 ++++--- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/api/include/opentelemetry/common/key_value_iterable.h b/api/include/opentelemetry/common/key_value_iterable.h index c195b8e262..53ec1c39f2 100644 --- a/api/include/opentelemetry/common/key_value_iterable.h +++ b/api/include/opentelemetry/common/key_value_iterable.h @@ -42,12 +42,10 @@ class NoopKeyValueIterable : public KeyValueIterable public: ~NoopKeyValueIterable() override = default; - /** - * Iterate over key-value pairs - * 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. + * @return true without iterating or invoking the callback + */ bool ForEachKeyValue( nostd::function_ref /*callback*/) const noexcept override { diff --git a/api/include/opentelemetry/common/key_value_iterable_view.h b/api/include/opentelemetry/common/key_value_iterable_view.h index 01f281661f..a8fe310321 100644 --- a/api/include/opentelemetry/common/key_value_iterable_view.h +++ b/api/include/opentelemetry/common/key_value_iterable_view.h @@ -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 arg The key-value iterable object + * @tparam ArgumentType Expected to be ArgumentType + * @param attributes The key-value iterable object * @return nostd::span> */ template < class ArgumentType, nostd::enable_if_t::value> * = nullptr> inline static common::KeyValueIterableView MakeAttributes( - const ArgumentType &arg) noexcept + const ArgumentType &attributes) noexcept { - return common::KeyValueIterableView(arg); + return common::KeyValueIterableView(attributes); } } // namespace common From 531ae64e209a46bcbc2979f5bc3662e01f2582b8 Mon Sep 17 00:00:00 2001 From: Evan Date: Tue, 6 May 2025 15:14:07 +0000 Subject: [PATCH 07/17] Fix the comments under api --- api/include/opentelemetry/context/runtime_context.h | 2 +- api/include/opentelemetry/semconv/incubating/system_metrics.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/api/include/opentelemetry/context/runtime_context.h b/api/include/opentelemetry/context/runtime_context.h index 5d502c7754..606cd79690 100644 --- a/api/include/opentelemetry/context/runtime_context.h +++ b/api/include/opentelemetry/context/runtime_context.h @@ -56,7 +56,7 @@ class OPENTELEMETRY_EXPORT RuntimeContextStorage /** * Set the current context. - * @param context 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 Attach(const Context &context) noexcept = 0; diff --git a/api/include/opentelemetry/semconv/incubating/system_metrics.h b/api/include/opentelemetry/semconv/incubating/system_metrics.h index 9fba9881c6..55a7cf138f 100644 --- a/api/include/opentelemetry/semconv/incubating/system_metrics.h +++ b/api/include/opentelemetry/semconv/incubating/system_metrics.h @@ -277,7 +277,8 @@ static inline nostd::shared_ptr CreateAsyncDouble * Time disk spent activated *

          * The real elapsed time ("wall clock") used in the I/O path (time from operations running in - * parallel are not counted). Measured as:

            + * parallel are not counted). Measured as: + *
              *
            • Linux: Field 13 from * procfs-diskstats *
            • From 0c0f2f7916847590baf8d469ce7a8c639779e262 Mon Sep 17 00:00:00 2001 From: Evan Date: Tue, 6 May 2025 17:05:43 +0000 Subject: [PATCH 08/17] Fix the format issue --- .clang-format | 4 ++- .../opentelemetry/common/key_value_iterable.h | 11 +++--- .../semconv/incubating/system_metrics.h | 34 +++++++++---------- .../semconv/incubating/url_attributes.h | 18 +++++----- .../semconv/service_attributes.h | 2 +- .../opentelemetry/semconv/url_attributes.h | 2 +- .../http/client/curl/http_operation_curl.h | 6 ++-- 7 files changed, 41 insertions(+), 36 deletions(-) diff --git a/.clang-format b/.clang-format index 1b5d0d488f..85bca82b42 100644 --- a/.clang-format +++ b/.clang-format @@ -70,4 +70,6 @@ AttributeMacros: - OPENTELEMETRY_EXPORT - OPENTELEMETRY_SANITIZER_NO_MEMORY - OPENTELEMETRY_SANITIZER_NO_THREAD - - OPENTELEMETRY_SANITIZER_NO_ADDRESS \ No newline at end of file + - OPENTELEMETRY_SANITIZER_NO_ADDRESS + +CommentPragmas: | \ No newline at end of file diff --git a/api/include/opentelemetry/common/key_value_iterable.h b/api/include/opentelemetry/common/key_value_iterable.h index 53ec1c39f2..4d191b07b7 100644 --- a/api/include/opentelemetry/common/key_value_iterable.h +++ b/api/include/opentelemetry/common/key_value_iterable.h @@ -42,12 +42,13 @@ class NoopKeyValueIterable : public KeyValueIterable public: ~NoopKeyValueIterable() override = default; - /** - * No-op implementation: does not invoke the callback, even if key-value pairs are present. - * @return true without iterating or invoking the callback - */ + /** + * No-op implementation: does not invoke the callback, even if key-value pairs are present. + * @return true without iterating or invoking the callback + */ bool ForEachKeyValue( - nostd::function_ref /*callback*/) const noexcept override + nostd::function_ref /*callback*/) + const noexcept override { return true; } diff --git a/api/include/opentelemetry/semconv/incubating/system_metrics.h b/api/include/opentelemetry/semconv/incubating/system_metrics.h index 55a7cf138f..37d00d010b 100644 --- a/api/include/opentelemetry/semconv/incubating/system_metrics.h +++ b/api/include/opentelemetry/semconv/incubating/system_metrics.h @@ -277,13 +277,13 @@ static inline nostd::shared_ptr CreateAsyncDouble * Time disk spent activated *

              * The real elapsed time ("wall clock") used in the I/O path (time from operations running in - * parallel are not counted). Measured as: - *

                - *
              • Linux: Field 13 from + * parallel are not counted). Measured as: + * *

                @@ -397,7 +397,7 @@ CreateAsyncDoubleMetricSystemDiskMerged(metrics::Meter *meter) * Sum of the time each operation took to complete *

                * Because it is the sum of time each request took, parallel-issued requests each contribute to make - * the count grow. Measured as:

                • Linux: Fields 7 & 11 from + * the count grow. Measured as:
                  • Linux: Fields 7 & 11 from * procfs-diskstats
                  • *
                  • Windows: "Avg. Disk sec/Read" perf counter multiplied by "Disk Reads/sec" perf counter * (similar for Writes)
                  • @@ -610,8 +610,8 @@ CreateAsyncDoubleMetricSystemFilesystemUtilization(metrics::Meter *meter) * swapping

                    This is an alternative to @code system.memory.usage @endcode metric with @code * state=free @endcode. Linux starting from 3.14 exports "available" memory. It takes "free" memory * as a baseline, and then factors in kernel-specific values. This is supposed to be more accurate - * than just "free" memory. For reference, see the calculations - * here. See also @code MemAvailable @endcode in + * than just "free" memory. For reference, see the calculations + * here. See also @code MemAvailable @endcode in * /proc/meminfo.

                    updowncounter */ static constexpr const char *kMetricSystemLinuxMemoryAvailable = "system.linux.memory.available"; @@ -657,9 +657,9 @@ CreateAsyncDoubleMetricSystemLinuxMemoryAvailable(metrics::Meter *meter) *

                    * The sum over the @code reclaimable @endcode and @code unreclaimable @endcode state values in * @code linux.memory.slab.usage @endcode SHOULD be equal to the total slab memory available on the - * system. Note that the total slab memory is not constant and may vary over time. See also the - * Slab allocator - * and @code Slab @endcode in + * system. Note that the total slab memory is not constant and may vary over time. See also the + * Slab allocator + * and @code Slab @endcode in * /proc/meminfo.

                    updowncounter */ static constexpr const char *kMetricSystemLinuxMemorySlabUsage = "system.linux.memory.slab.usage"; @@ -741,9 +741,9 @@ CreateAsyncDoubleMetricSystemMemoryLimit(metrics::Meter *meter) /** * Shared memory used (mostly by tmpfs). *

                    - * Equivalent of @code shared @endcode from + * Equivalent of @code shared @endcode from * @code free @endcode command or - * @code Shmem @endcode from + * @code Shmem @endcode from * @code /proc/meminfo @endcode"

                    updowncounter */ static constexpr const char *kMetricSystemMemoryShared = "system.memory.shared"; @@ -906,8 +906,8 @@ CreateAsyncDoubleMetricSystemNetworkConnections(metrics::Meter *meter) *

                    *

                    @@ -953,8 +953,8 @@ CreateAsyncDoubleMetricSystemNetworkDropped(metrics::Meter *meter) *

                    *

                    diff --git a/api/include/opentelemetry/semconv/incubating/url_attributes.h b/api/include/opentelemetry/semconv/incubating/url_attributes.h index e2938d2575..c8aeae4e8d 100644 --- a/api/include/opentelemetry/semconv/incubating/url_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/url_attributes.h @@ -23,7 +23,7 @@ namespace url * Domain extracted from the @code url.full @endcode, such as "opentelemetry.io". *

                    * In some cases a URL may refer to an IP and/or port directly, without a domain name. In this case, - * the IP address would go to the domain field. If the URL contains a + * the IP address would go to the domain field. If the URL contains a * literal IPv6 address enclosed by * @code [ @endcode and @code ] @endcode, the @code [ @endcode and @code ] @endcode characters * should also be captured in the domain field. @@ -45,7 +45,7 @@ static constexpr const char *kUrlExtension = "url.extension"; static constexpr const char *kUrlFragment = "url.fragment"; /** - * Absolute URL describing a network resource according to + * Absolute URL describing a network resource according to * RFC3986

                    For network calls, URL usually has * @code scheme://host[:port][path][?query][#fragment] @endcode format, where the fragment is not * transmitted over HTTP, but if it is known, it SHOULD be included nevertheless.

                    @@ -108,9 +108,9 @@ static constexpr const char *kUrlPort = "url.port"; * * Query string values for the following keys SHOULD be redacted by default and replaced by the * value @code REDACTED @endcode:

                    *

                    @@ -124,8 +124,8 @@ static constexpr const char *kUrlQuery = "url.query"; /** * The highest registered url domain, stripped of the subdomain. *

                    - * This value can be determined precisely with the - * public suffix list. + * This value can be determined precisely with the + * public suffix list. * For example, the registered domain for @code foo.example.com @endcode is @code * example.com @endcode. Trying to approximate this by simply taking the last two labels will not * work well for TLDs such as @code co.uk @endcode. @@ -149,7 +149,7 @@ static constexpr const char *kUrlScheme = "url.scheme"; static constexpr const char *kUrlSubdomain = "url.subdomain"; /** - * The low-cardinality template of an + * The low-cardinality template of an * absolute path reference. */ static constexpr const char *kUrlTemplate = "url.template"; @@ -157,7 +157,7 @@ static constexpr const char *kUrlTemplate = "url.template"; /** * The effective top level domain (eTLD), also known as the domain suffix, is the last part of the * domain name. For example, the top level domain for example.com is @code com @endcode.

                    This - * value can be determined precisely with the + * value can be determined precisely with the * public suffix list. */ static constexpr const char *kUrlTopLevelDomain = "url.top_level_domain"; diff --git a/api/include/opentelemetry/semconv/service_attributes.h b/api/include/opentelemetry/semconv/service_attributes.h index 7342ea0b6b..6b12718b95 100644 --- a/api/include/opentelemetry/semconv/service_attributes.h +++ b/api/include/opentelemetry/semconv/service_attributes.h @@ -23,7 +23,7 @@ namespace service * Logical name of the service. *

                    * MUST be the same for all instances of horizontally scaled services. If the value was not - * specified, SDKs MUST fallback to @code unknown_service: @endcode concatenated + * specified, SDKs MUST fallback to @code unknown_service: @endcode concatenated * with @code process.executable.name @endcode, e.g. @code unknown_service:bash * @endcode. If @code process.executable.name @endcode is not available, the value MUST be set to * @code unknown_service @endcode. diff --git a/api/include/opentelemetry/semconv/url_attributes.h b/api/include/opentelemetry/semconv/url_attributes.h index 127393bf8c..5c39d7d5b7 100644 --- a/api/include/opentelemetry/semconv/url_attributes.h +++ b/api/include/opentelemetry/semconv/url_attributes.h @@ -25,7 +25,7 @@ namespace url static constexpr const char *kUrlFragment = "url.fragment"; /** - * Absolute URL describing a network resource according to + * Absolute URL describing a network resource according to * RFC3986

                    For network calls, URL usually has * @code scheme://host[:port][path][?query][#fragment] @endcode format, where the fragment is not * transmitted over HTTP, but if it is known, it SHOULD be included nevertheless.

                    diff --git a/ext/include/opentelemetry/ext/http/client/curl/http_operation_curl.h b/ext/include/opentelemetry/ext/http/client/curl/http_operation_curl.h index 6dcbaeedea..d180134cae 100644 --- a/ext/include/opentelemetry/ext/http/client/curl/http_operation_curl.h +++ b/ext/include/opentelemetry/ext/http/client/curl/http_operation_curl.h @@ -85,7 +85,8 @@ class HttpOperation * @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. + * @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); @@ -96,7 +97,8 @@ class HttpOperation * @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. + * @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); From 9296f1f5251a590dd15346f6639dd9b843a6fa23 Mon Sep 17 00:00:00 2001 From: Evan Date: Mon, 26 May 2025 15:12:02 +0000 Subject: [PATCH 09/17] Revert changes in semconv --- .../semconv/incubating/process_attributes.h | 559 ++-- .../semconv/incubating/system_metrics.h | 2540 ++++++++--------- .../semconv/incubating/url_attributes.h | 320 ++- .../semconv/service_attributes.h | 60 +- .../opentelemetry/semconv/url_attributes.h | 178 +- .../semantic-convention/semantic-conventions | 1 + 6 files changed, 1842 insertions(+), 1816 deletions(-) create mode 160000 buildscripts/semantic-convention/semantic-conventions diff --git a/api/include/opentelemetry/semconv/incubating/process_attributes.h b/api/include/opentelemetry/semconv/incubating/process_attributes.h index a2449c1904..688c268a52 100644 --- a/api/include/opentelemetry/semconv/incubating/process_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/process_attributes.h @@ -8,275 +8,290 @@ * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 */ -#pragma once - -#include "opentelemetry/common/macros.h" -#include "opentelemetry/version.h" - -OPENTELEMETRY_BEGIN_NAMESPACE -namespace semconv -{ -namespace process -{ - -/** - * Length of the process.command_args array - *

                    - * This field can be useful for querying or performing bucket analysis on how many arguments were - * provided to start a process. More arguments may be an indication of suspicious activity. - */ -static constexpr const char *kProcessArgsCount = "process.args_count"; - -/** - * The command used to launch the process (i.e. the command name). On Linux based systems, can be - * set to the zeroth string in @code proc/[pid]/cmdline @endcode. On Windows, can be set to the - * first parameter extracted from @code GetCommandLineW @endcode. - */ -static constexpr const char *kProcessCommand = "process.command"; - -/** - * All the command arguments (including the command/executable itself) as received by the process. - * On Linux-based systems (and some other Unixoid systems supporting procfs), can be set according - * to the list of null-delimited strings extracted from @code proc/[pid]/cmdline @endcode. For - * libc-based executables, this would be the full argv vector passed to @code main @endcode. - */ -static constexpr const char *kProcessCommandArgs = "process.command_args"; - -/** - * The full command used to launch the process as a single string representing the full command. On - * Windows, can be set to the result of @code GetCommandLineW @endcode. Do not set this if you have - * to assemble it just for monitoring; use @code process.command_args @endcode instead. - */ -static constexpr const char *kProcessCommandLine = "process.command_line"; - -/** - * Specifies whether the context switches for this data point were voluntary or involuntary. - */ -static constexpr const char *kProcessContextSwitchType = "process.context_switch_type"; - -/** - * Deprecated, use @code cpu.mode @endcode instead. - * - * @deprecated - * {"note": "Replaced by @code cpu.mode @endcode", "reason": "uncategorized"} - */ -OPENTELEMETRY_DEPRECATED static constexpr const char *kProcessCpuState = "process.cpu.state"; - -/** - * The date and time the process was created, in ISO 8601 format. - */ -static constexpr const char *kProcessCreationTime = "process.creation.time"; - -/** - * The GNU build ID as found in the @code .note.gnu.build-id @endcode ELF section (hex string). - */ -static constexpr const char *kProcessExecutableBuildIdGnu = "process.executable.build_id.gnu"; - -/** - * The Go build ID as retrieved by @code go tool buildid @endcode. - */ -static constexpr const char *kProcessExecutableBuildIdGo = "process.executable.build_id.go"; - -/** - * Profiling specific build ID for executables. See the OTel specification for Profiles for more - * information. - */ -static constexpr const char *kProcessExecutableBuildIdHtlhash = - "process.executable.build_id.htlhash"; - -/** - * "Deprecated, use @code process.executable.build_id.htlhash @endcode instead." - * - * @deprecated - * {"note": "Replaced by @code process.executable.build_id.htlhash @endcode", "reason": - * "uncategorized"} - */ -OPENTELEMETRY_DEPRECATED static constexpr const char *kProcessExecutableBuildIdProfiling = - "process.executable.build_id.profiling"; - -/** - * The name of the process executable. On Linux based systems, this SHOULD be set to the base name - * of the target of @code /proc/[pid]/exe @endcode. On Windows, this SHOULD be set to the base name - * of @code GetProcessImageFileNameW @endcode. - */ -static constexpr const char *kProcessExecutableName = "process.executable.name"; - -/** - * The full path to the process executable. On Linux based systems, can be set to the target of - * @code proc/[pid]/exe @endcode. On Windows, can be set to the result of @code - * GetProcessImageFileNameW @endcode. - */ -static constexpr const char *kProcessExecutablePath = "process.executable.path"; - -/** - * The exit code of the process. - */ -static constexpr const char *kProcessExitCode = "process.exit.code"; - -/** - * The date and time the process exited, in ISO 8601 format. - */ -static constexpr const char *kProcessExitTime = "process.exit.time"; - -/** - * The PID of the process's group leader. This is also the process group ID (PGID) of the process. - */ -static constexpr const char *kProcessGroupLeaderPid = "process.group_leader.pid"; - -/** - * Whether the process is connected to an interactive shell. - */ -static constexpr const char *kProcessInteractive = "process.interactive"; - -/** - * The control group associated with the process. - *

                    - * Control groups (cgroups) are a kernel feature used to organize and manage process resources. This - * attribute provides the path(s) to the cgroup(s) associated with the process, which should match - * the contents of the /proc/[PID]/cgroup file. - */ -static constexpr const char *kProcessLinuxCgroup = "process.linux.cgroup"; - -/** - * The username of the user that owns the process. - */ -static constexpr const char *kProcessOwner = "process.owner"; - -/** - * The type of page fault for this data point. Type @code major @endcode is for major/hard page - * faults, and @code minor @endcode is for minor/soft page faults. - */ -static constexpr const char *kProcessPagingFaultType = "process.paging.fault_type"; - -/** - * Parent Process identifier (PPID). - */ -static constexpr const char *kProcessParentPid = "process.parent_pid"; - -/** - * Process identifier (PID). - */ -static constexpr const char *kProcessPid = "process.pid"; - -/** - * The real user ID (RUID) of the process. - */ -static constexpr const char *kProcessRealUserId = "process.real_user.id"; - -/** - * The username of the real user of the process. - */ -static constexpr const char *kProcessRealUserName = "process.real_user.name"; - -/** - * An additional description about the runtime of the process, for example a specific vendor - * customization of the runtime environment. - */ -static constexpr const char *kProcessRuntimeDescription = "process.runtime.description"; - -/** - * The name of the runtime of this process. - */ -static constexpr const char *kProcessRuntimeName = "process.runtime.name"; - -/** - * The version of the runtime of this process, as returned by the runtime without modification. - */ -static constexpr const char *kProcessRuntimeVersion = "process.runtime.version"; - -/** - * The saved user ID (SUID) of the process. - */ -static constexpr const char *kProcessSavedUserId = "process.saved_user.id"; - -/** - * The username of the saved user. - */ -static constexpr const char *kProcessSavedUserName = "process.saved_user.name"; - -/** - * The PID of the process's session leader. This is also the session ID (SID) of the process. - */ -static constexpr const char *kProcessSessionLeaderPid = "process.session_leader.pid"; - -/** - * Process title (proctitle) - *

                    - * In many Unix-like systems, process title (proctitle), is the string that represents the name or - * command line of a running process, displayed by system monitoring tools like ps, top, and htop. - */ -static constexpr const char *kProcessTitle = "process.title"; - -/** - * The effective user ID (EUID) of the process. - */ -static constexpr const char *kProcessUserId = "process.user.id"; - -/** - * The username of the effective user of the process. - */ -static constexpr const char *kProcessUserName = "process.user.name"; - -/** - * Virtual process identifier. - *

                    - * The process ID within a PID namespace. This is not necessarily unique across all processes on the - * host but it is unique within the process namespace that the process exists within. - */ -static constexpr const char *kProcessVpid = "process.vpid"; - -/** - * The working directory of the process. - */ -static constexpr const char *kProcessWorkingDirectory = "process.working_directory"; - -namespace ProcessContextSwitchTypeValues -{ -/** - * none - */ -static constexpr const char *kVoluntary = "voluntary"; - -/** - * none - */ -static constexpr const char *kInvoluntary = "involuntary"; - -} // namespace ProcessContextSwitchTypeValues - -namespace ProcessCpuStateValues -{ -/** - * none - */ -static constexpr const char *kSystem = "system"; - -/** - * none - */ -static constexpr const char *kUser = "user"; - -/** - * none - */ -static constexpr const char *kWait = "wait"; - -} // namespace ProcessCpuStateValues - -namespace ProcessPagingFaultTypeValues -{ -/** - * none - */ -static constexpr const char *kMajor = "major"; - -/** - * none - */ -static constexpr const char *kMinor = "minor"; - -} // namespace ProcessPagingFaultTypeValues - -} // namespace process -} // namespace semconv -OPENTELEMETRY_END_NAMESPACE + #pragma once + + #include "opentelemetry/common/macros.h" + #include "opentelemetry/version.h" + + OPENTELEMETRY_BEGIN_NAMESPACE + namespace semconv + { + namespace process + { + + /** + * Length of the process.command_args array + *

                    + * This field can be useful for querying or performing bucket analysis on how many arguments were + * provided to start a process. More arguments may be an indication of suspicious activity. + */ + static constexpr const char *kProcessArgsCount = "process.args_count"; + + /** + * The command used to launch the process (i.e. the command name). On Linux based systems, can be + * set to the zeroth string in @code proc/[pid]/cmdline @endcode. On Windows, can be set to the + * first parameter extracted from @code GetCommandLineW @endcode. + */ + static constexpr const char *kProcessCommand = "process.command"; + + /** + * All the command arguments (including the command/executable itself) as received by the process. + * On Linux-based systems (and some other Unixoid systems supporting procfs), can be set according + * to the list of null-delimited strings extracted from @code proc/[pid]/cmdline @endcode. For + * libc-based executables, this would be the full argv vector passed to @code main @endcode. SHOULD + * NOT be collected by default unless there is sanitization that excludes sensitive data. + */ + static constexpr const char *kProcessCommandArgs = "process.command_args"; + + /** + * The full command used to launch the process as a single string representing the full command. On + * Windows, can be set to the result of @code GetCommandLineW @endcode. Do not set this if you have + * to assemble it just for monitoring; use @code process.command_args @endcode instead. SHOULD NOT + * be collected by default unless there is sanitization that excludes sensitive data. + */ + static constexpr const char *kProcessCommandLine = "process.command_line"; + + /** + * Specifies whether the context switches for this data point were voluntary or involuntary. + */ + static constexpr const char *kProcessContextSwitchType = "process.context_switch_type"; + + /** + * Deprecated, use @code cpu.mode @endcode instead. + * + * @deprecated + * {"note": "Replaced by @code cpu.mode @endcode.", "reason": "renamed", "renamed_to": "cpu.mode"} + */ + OPENTELEMETRY_DEPRECATED static constexpr const char *kProcessCpuState = "process.cpu.state"; + + /** + * The date and time the process was created, in ISO 8601 format. + */ + static constexpr const char *kProcessCreationTime = "process.creation.time"; + + /** + * Process environment variables, being the environment variable name, the value being the + * environment variable value.

                    Examples:

                    • an environment variable @code USER @endcode + * with value @code "ubuntu" @endcode SHOULD be recorded as the @code + * process.environment_variable.USER @endcode attribute with value @code "ubuntu" @endcode.
                    • + *
                    • an environment variable @code PATH @endcode with value @code "/usr/local/bin:/usr/bin" + * @endcode SHOULD be recorded as the @code process.environment_variable.PATH @endcode attribute + * with value @code "/usr/local/bin:/usr/bin" @endcode.
                    • + *
                    + */ + static constexpr const char *kProcessEnvironmentVariable = "process.environment_variable"; + + /** + * The GNU build ID as found in the @code .note.gnu.build-id @endcode ELF section (hex string). + */ + static constexpr const char *kProcessExecutableBuildIdGnu = "process.executable.build_id.gnu"; + + /** + * The Go build ID as retrieved by @code go tool buildid @endcode. + */ + static constexpr const char *kProcessExecutableBuildIdGo = "process.executable.build_id.go"; + + /** + * Profiling specific build ID for executables. See the OTel specification for Profiles for more + * information. + */ + static constexpr const char *kProcessExecutableBuildIdHtlhash = + "process.executable.build_id.htlhash"; + + /** + * "Deprecated, use @code process.executable.build_id.htlhash @endcode instead." + * + * @deprecated + * {"note": "Replaced by @code process.executable.build_id.htlhash @endcode.", "reason": "renamed", + * "renamed_to": "process.executable.build_id.htlhash"} + */ + OPENTELEMETRY_DEPRECATED static constexpr const char *kProcessExecutableBuildIdProfiling = + "process.executable.build_id.profiling"; + + /** + * The name of the process executable. On Linux based systems, this SHOULD be set to the base name + * of the target of @code /proc/[pid]/exe @endcode. On Windows, this SHOULD be set to the base name + * of @code GetProcessImageFileNameW @endcode. + */ + static constexpr const char *kProcessExecutableName = "process.executable.name"; + + /** + * The full path to the process executable. On Linux based systems, can be set to the target of + * @code proc/[pid]/exe @endcode. On Windows, can be set to the result of @code + * GetProcessImageFileNameW @endcode. + */ + static constexpr const char *kProcessExecutablePath = "process.executable.path"; + + /** + * The exit code of the process. + */ + static constexpr const char *kProcessExitCode = "process.exit.code"; + + /** + * The date and time the process exited, in ISO 8601 format. + */ + static constexpr const char *kProcessExitTime = "process.exit.time"; + + /** + * The PID of the process's group leader. This is also the process group ID (PGID) of the process. + */ + static constexpr const char *kProcessGroupLeaderPid = "process.group_leader.pid"; + + /** + * Whether the process is connected to an interactive shell. + */ + static constexpr const char *kProcessInteractive = "process.interactive"; + + /** + * The control group associated with the process. + *

                    + * Control groups (cgroups) are a kernel feature used to organize and manage process resources. This + * attribute provides the path(s) to the cgroup(s) associated with the process, which should match + * the contents of the /proc/[PID]/cgroup file. + */ + static constexpr const char *kProcessLinuxCgroup = "process.linux.cgroup"; + + /** + * The username of the user that owns the process. + */ + static constexpr const char *kProcessOwner = "process.owner"; + + /** + * The type of page fault for this data point. Type @code major @endcode is for major/hard page + * faults, and @code minor @endcode is for minor/soft page faults. + */ + static constexpr const char *kProcessPagingFaultType = "process.paging.fault_type"; + + /** + * Parent Process identifier (PPID). + */ + static constexpr const char *kProcessParentPid = "process.parent_pid"; + + /** + * Process identifier (PID). + */ + static constexpr const char *kProcessPid = "process.pid"; + + /** + * The real user ID (RUID) of the process. + */ + static constexpr const char *kProcessRealUserId = "process.real_user.id"; + + /** + * The username of the real user of the process. + */ + static constexpr const char *kProcessRealUserName = "process.real_user.name"; + + /** + * An additional description about the runtime of the process, for example a specific vendor + * customization of the runtime environment. + */ + static constexpr const char *kProcessRuntimeDescription = "process.runtime.description"; + + /** + * The name of the runtime of this process. + */ + static constexpr const char *kProcessRuntimeName = "process.runtime.name"; + + /** + * The version of the runtime of this process, as returned by the runtime without modification. + */ + static constexpr const char *kProcessRuntimeVersion = "process.runtime.version"; + + /** + * The saved user ID (SUID) of the process. + */ + static constexpr const char *kProcessSavedUserId = "process.saved_user.id"; + + /** + * The username of the saved user. + */ + static constexpr const char *kProcessSavedUserName = "process.saved_user.name"; + + /** + * The PID of the process's session leader. This is also the session ID (SID) of the process. + */ + static constexpr const char *kProcessSessionLeaderPid = "process.session_leader.pid"; + + /** + * Process title (proctitle) + *

                    + * In many Unix-like systems, process title (proctitle), is the string that represents the name or + * command line of a running process, displayed by system monitoring tools like ps, top, and htop. + */ + static constexpr const char *kProcessTitle = "process.title"; + + /** + * The effective user ID (EUID) of the process. + */ + static constexpr const char *kProcessUserId = "process.user.id"; + + /** + * The username of the effective user of the process. + */ + static constexpr const char *kProcessUserName = "process.user.name"; + + /** + * Virtual process identifier. + *

                    + * The process ID within a PID namespace. This is not necessarily unique across all processes on the + * host but it is unique within the process namespace that the process exists within. + */ + static constexpr const char *kProcessVpid = "process.vpid"; + + /** + * The working directory of the process. + */ + static constexpr const char *kProcessWorkingDirectory = "process.working_directory"; + + namespace ProcessContextSwitchTypeValues + { + /** + * none + */ + static constexpr const char *kVoluntary = "voluntary"; + + /** + * none + */ + static constexpr const char *kInvoluntary = "involuntary"; + + } // namespace ProcessContextSwitchTypeValues + + namespace ProcessCpuStateValues + { + /** + * none + */ + static constexpr const char *kSystem = "system"; + + /** + * none + */ + static constexpr const char *kUser = "user"; + + /** + * none + */ + static constexpr const char *kWait = "wait"; + + } // namespace ProcessCpuStateValues + + namespace ProcessPagingFaultTypeValues + { + /** + * none + */ + static constexpr const char *kMajor = "major"; + + /** + * none + */ + static constexpr const char *kMinor = "minor"; + + } // namespace ProcessPagingFaultTypeValues + + } // namespace process + } // namespace semconv + OPENTELEMETRY_END_NAMESPACE \ No newline at end of file diff --git a/api/include/opentelemetry/semconv/incubating/system_metrics.h b/api/include/opentelemetry/semconv/incubating/system_metrics.h index 37d00d010b..107a0e1fc6 100644 --- a/api/include/opentelemetry/semconv/incubating/system_metrics.h +++ b/api/include/opentelemetry/semconv/incubating/system_metrics.h @@ -8,1330 +8,1330 @@ * buildscripts/semantic-convention/templates/registry/semantic_metrics-h.j2 */ -#pragma once - -#include "opentelemetry/common/macros.h" -#include "opentelemetry/metrics/meter.h" -#include "opentelemetry/version.h" - -OPENTELEMETRY_BEGIN_NAMESPACE -namespace semconv -{ -namespace system -{ - -/** - * Deprecated. Use @code cpu.frequency @endcode instead. - * - * @deprecated - * {"note": "Replaced by @code cpu.frequency @endcode.", "reason": "uncategorized"} - *

                    - * gauge - */ -OPENTELEMETRY_DEPRECATED static constexpr const char *kMetricSystemCpuFrequency = - "system.cpu.frequency"; -OPENTELEMETRY_DEPRECATED static constexpr const char *descrMetricSystemCpuFrequency = - "Deprecated. Use `cpu.frequency` instead."; -OPENTELEMETRY_DEPRECATED static constexpr const char *unitMetricSystemCpuFrequency = "{Hz}"; - -#if OPENTELEMETRY_ABI_VERSION_NO >= 2 - -OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> -CreateSyncInt64MetricSystemCpuFrequency(metrics::Meter *meter) -{ - return meter->CreateInt64Gauge(kMetricSystemCpuFrequency, descrMetricSystemCpuFrequency, - unitMetricSystemCpuFrequency); -} - -OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> -CreateSyncDoubleMetricSystemCpuFrequency(metrics::Meter *meter) -{ - return meter->CreateDoubleGauge(kMetricSystemCpuFrequency, descrMetricSystemCpuFrequency, + #pragma once + + #include "opentelemetry/common/macros.h" + #include "opentelemetry/metrics/meter.h" + #include "opentelemetry/version.h" + + OPENTELEMETRY_BEGIN_NAMESPACE + namespace semconv + { + namespace system + { + + /** + * Deprecated. Use @code cpu.frequency @endcode instead. + * + * @deprecated + * {"note": "Replaced by @code cpu.frequency @endcode.", "reason": "renamed", "renamed_to": + * "cpu.frequency"}

                    gauge + */ + OPENTELEMETRY_DEPRECATED static constexpr const char *kMetricSystemCpuFrequency = + "system.cpu.frequency"; + OPENTELEMETRY_DEPRECATED static constexpr const char *descrMetricSystemCpuFrequency = + "Deprecated. Use `cpu.frequency` instead."; + OPENTELEMETRY_DEPRECATED static constexpr const char *unitMetricSystemCpuFrequency = "{Hz}"; + + #if OPENTELEMETRY_ABI_VERSION_NO >= 2 + + OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> + CreateSyncInt64MetricSystemCpuFrequency(metrics::Meter *meter) + { + return meter->CreateInt64Gauge(kMetricSystemCpuFrequency, descrMetricSystemCpuFrequency, unitMetricSystemCpuFrequency); -} -#endif /* OPENTELEMETRY_ABI_VERSION_NO */ - -OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr -CreateAsyncInt64MetricSystemCpuFrequency(metrics::Meter *meter) -{ - return meter->CreateInt64ObservableGauge(kMetricSystemCpuFrequency, descrMetricSystemCpuFrequency, - unitMetricSystemCpuFrequency); -} - -OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr -CreateAsyncDoubleMetricSystemCpuFrequency(metrics::Meter *meter) -{ - return meter->CreateDoubleObservableGauge( - kMetricSystemCpuFrequency, descrMetricSystemCpuFrequency, unitMetricSystemCpuFrequency); -} - -/** - * Reports the number of logical (virtual) processor cores created by the operating system to manage - * multitasking

                    Calculated by multiplying the number of sockets by the number of cores per - * socket, and then by the number of threads per core

                    updowncounter - */ -static constexpr const char *kMetricSystemCpuLogicalCount = "system.cpu.logical.count"; -static constexpr const char *descrMetricSystemCpuLogicalCount = - "Reports the number of logical (virtual) processor cores created by the operating system to " - "manage multitasking"; -static constexpr const char *unitMetricSystemCpuLogicalCount = "{cpu}"; - -static inline nostd::unique_ptr> -CreateSyncInt64MetricSystemCpuLogicalCount(metrics::Meter *meter) -{ - return meter->CreateInt64UpDownCounter(kMetricSystemCpuLogicalCount, - descrMetricSystemCpuLogicalCount, - unitMetricSystemCpuLogicalCount); -} - -static inline nostd::unique_ptr> -CreateSyncDoubleMetricSystemCpuLogicalCount(metrics::Meter *meter) -{ - return meter->CreateDoubleUpDownCounter(kMetricSystemCpuLogicalCount, + } + + OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> + CreateSyncDoubleMetricSystemCpuFrequency(metrics::Meter *meter) + { + return meter->CreateDoubleGauge(kMetricSystemCpuFrequency, descrMetricSystemCpuFrequency, + unitMetricSystemCpuFrequency); + } + #endif /* OPENTELEMETRY_ABI_VERSION_NO */ + + OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr + CreateAsyncInt64MetricSystemCpuFrequency(metrics::Meter *meter) + { + return meter->CreateInt64ObservableGauge(kMetricSystemCpuFrequency, descrMetricSystemCpuFrequency, + unitMetricSystemCpuFrequency); + } + + OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr + CreateAsyncDoubleMetricSystemCpuFrequency(metrics::Meter *meter) + { + return meter->CreateDoubleObservableGauge( + kMetricSystemCpuFrequency, descrMetricSystemCpuFrequency, unitMetricSystemCpuFrequency); + } + + /** + * Reports the number of logical (virtual) processor cores created by the operating system to manage + * multitasking

                    Calculated by multiplying the number of sockets by the number of cores per + * socket, and then by the number of threads per core

                    updowncounter + */ + static constexpr const char *kMetricSystemCpuLogicalCount = "system.cpu.logical.count"; + static constexpr const char *descrMetricSystemCpuLogicalCount = + "Reports the number of logical (virtual) processor cores created by the operating system to " + "manage multitasking"; + static constexpr const char *unitMetricSystemCpuLogicalCount = "{cpu}"; + + static inline nostd::unique_ptr> + CreateSyncInt64MetricSystemCpuLogicalCount(metrics::Meter *meter) + { + return meter->CreateInt64UpDownCounter(kMetricSystemCpuLogicalCount, descrMetricSystemCpuLogicalCount, unitMetricSystemCpuLogicalCount); -} - -static inline nostd::shared_ptr -CreateAsyncInt64MetricSystemCpuLogicalCount(metrics::Meter *meter) -{ - return meter->CreateInt64ObservableUpDownCounter(kMetricSystemCpuLogicalCount, - descrMetricSystemCpuLogicalCount, - unitMetricSystemCpuLogicalCount); -} - -static inline nostd::shared_ptr -CreateAsyncDoubleMetricSystemCpuLogicalCount(metrics::Meter *meter) -{ - return meter->CreateDoubleObservableUpDownCounter(kMetricSystemCpuLogicalCount, + } + + static inline nostd::unique_ptr> + CreateSyncDoubleMetricSystemCpuLogicalCount(metrics::Meter *meter) + { + return meter->CreateDoubleUpDownCounter(kMetricSystemCpuLogicalCount, + descrMetricSystemCpuLogicalCount, + unitMetricSystemCpuLogicalCount); + } + + static inline nostd::shared_ptr + CreateAsyncInt64MetricSystemCpuLogicalCount(metrics::Meter *meter) + { + return meter->CreateInt64ObservableUpDownCounter(kMetricSystemCpuLogicalCount, descrMetricSystemCpuLogicalCount, unitMetricSystemCpuLogicalCount); -} - -/** - * Reports the number of actual physical processor cores on the hardware - *

                    - * Calculated by multiplying the number of sockets by the number of cores per socket - *

                    - * updowncounter - */ -static constexpr const char *kMetricSystemCpuPhysicalCount = "system.cpu.physical.count"; -static constexpr const char *descrMetricSystemCpuPhysicalCount = - "Reports the number of actual physical processor cores on the hardware"; -static constexpr const char *unitMetricSystemCpuPhysicalCount = "{cpu}"; - -static inline nostd::unique_ptr> -CreateSyncInt64MetricSystemCpuPhysicalCount(metrics::Meter *meter) -{ - return meter->CreateInt64UpDownCounter(kMetricSystemCpuPhysicalCount, - descrMetricSystemCpuPhysicalCount, - unitMetricSystemCpuPhysicalCount); -} - -static inline nostd::unique_ptr> -CreateSyncDoubleMetricSystemCpuPhysicalCount(metrics::Meter *meter) -{ - return meter->CreateDoubleUpDownCounter(kMetricSystemCpuPhysicalCount, + } + + static inline nostd::shared_ptr + CreateAsyncDoubleMetricSystemCpuLogicalCount(metrics::Meter *meter) + { + return meter->CreateDoubleObservableUpDownCounter(kMetricSystemCpuLogicalCount, + descrMetricSystemCpuLogicalCount, + unitMetricSystemCpuLogicalCount); + } + + /** + * Reports the number of actual physical processor cores on the hardware + *

                    + * Calculated by multiplying the number of sockets by the number of cores per socket + *

                    + * updowncounter + */ + static constexpr const char *kMetricSystemCpuPhysicalCount = "system.cpu.physical.count"; + static constexpr const char *descrMetricSystemCpuPhysicalCount = + "Reports the number of actual physical processor cores on the hardware"; + static constexpr const char *unitMetricSystemCpuPhysicalCount = "{cpu}"; + + static inline nostd::unique_ptr> + CreateSyncInt64MetricSystemCpuPhysicalCount(metrics::Meter *meter) + { + return meter->CreateInt64UpDownCounter(kMetricSystemCpuPhysicalCount, descrMetricSystemCpuPhysicalCount, unitMetricSystemCpuPhysicalCount); -} - -static inline nostd::shared_ptr -CreateAsyncInt64MetricSystemCpuPhysicalCount(metrics::Meter *meter) -{ - return meter->CreateInt64ObservableUpDownCounter(kMetricSystemCpuPhysicalCount, - descrMetricSystemCpuPhysicalCount, - unitMetricSystemCpuPhysicalCount); -} - -static inline nostd::shared_ptr -CreateAsyncDoubleMetricSystemCpuPhysicalCount(metrics::Meter *meter) -{ - return meter->CreateDoubleObservableUpDownCounter(kMetricSystemCpuPhysicalCount, + } + + static inline nostd::unique_ptr> + CreateSyncDoubleMetricSystemCpuPhysicalCount(metrics::Meter *meter) + { + return meter->CreateDoubleUpDownCounter(kMetricSystemCpuPhysicalCount, + descrMetricSystemCpuPhysicalCount, + unitMetricSystemCpuPhysicalCount); + } + + static inline nostd::shared_ptr + CreateAsyncInt64MetricSystemCpuPhysicalCount(metrics::Meter *meter) + { + return meter->CreateInt64ObservableUpDownCounter(kMetricSystemCpuPhysicalCount, descrMetricSystemCpuPhysicalCount, unitMetricSystemCpuPhysicalCount); -} - -/** - * Deprecated. Use @code cpu.time @endcode instead. - * - * @deprecated - * {"note": "Replaced by @code cpu.time @endcode.", "reason": "uncategorized"} - *

                    - * counter - */ -OPENTELEMETRY_DEPRECATED static constexpr const char *kMetricSystemCpuTime = "system.cpu.time"; -OPENTELEMETRY_DEPRECATED static constexpr const char *descrMetricSystemCpuTime = - "Deprecated. Use `cpu.time` instead."; -OPENTELEMETRY_DEPRECATED static constexpr const char *unitMetricSystemCpuTime = "s"; - -OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> -CreateSyncInt64MetricSystemCpuTime(metrics::Meter *meter) -{ - return meter->CreateUInt64Counter(kMetricSystemCpuTime, descrMetricSystemCpuTime, - unitMetricSystemCpuTime); -} - -OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> -CreateSyncDoubleMetricSystemCpuTime(metrics::Meter *meter) -{ - return meter->CreateDoubleCounter(kMetricSystemCpuTime, descrMetricSystemCpuTime, - unitMetricSystemCpuTime); -} - -OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr -CreateAsyncInt64MetricSystemCpuTime(metrics::Meter *meter) -{ - return meter->CreateInt64ObservableCounter(kMetricSystemCpuTime, descrMetricSystemCpuTime, - unitMetricSystemCpuTime); -} - -OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr -CreateAsyncDoubleMetricSystemCpuTime(metrics::Meter *meter) -{ - return meter->CreateDoubleObservableCounter(kMetricSystemCpuTime, descrMetricSystemCpuTime, + } + + static inline nostd::shared_ptr + CreateAsyncDoubleMetricSystemCpuPhysicalCount(metrics::Meter *meter) + { + return meter->CreateDoubleObservableUpDownCounter(kMetricSystemCpuPhysicalCount, + descrMetricSystemCpuPhysicalCount, + unitMetricSystemCpuPhysicalCount); + } + + /** + * Deprecated. Use @code cpu.time @endcode instead. + * + * @deprecated + * {"note": "Replaced by @code cpu.time @endcode.", "reason": "renamed", "renamed_to": "cpu.time"} + *

                    + * counter + */ + OPENTELEMETRY_DEPRECATED static constexpr const char *kMetricSystemCpuTime = "system.cpu.time"; + OPENTELEMETRY_DEPRECATED static constexpr const char *descrMetricSystemCpuTime = + "Deprecated. Use `cpu.time` instead."; + OPENTELEMETRY_DEPRECATED static constexpr const char *unitMetricSystemCpuTime = "s"; + + OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> + CreateSyncInt64MetricSystemCpuTime(metrics::Meter *meter) + { + return meter->CreateUInt64Counter(kMetricSystemCpuTime, descrMetricSystemCpuTime, + unitMetricSystemCpuTime); + } + + OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> + CreateSyncDoubleMetricSystemCpuTime(metrics::Meter *meter) + { + return meter->CreateDoubleCounter(kMetricSystemCpuTime, descrMetricSystemCpuTime, + unitMetricSystemCpuTime); + } + + OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr + CreateAsyncInt64MetricSystemCpuTime(metrics::Meter *meter) + { + return meter->CreateInt64ObservableCounter(kMetricSystemCpuTime, descrMetricSystemCpuTime, unitMetricSystemCpuTime); -} - -/** - * Deprecated. Use @code cpu.utilization @endcode instead. - * - * @deprecated - * {"note": "Replaced by @code cpu.utilization @endcode.", "reason": "uncategorized"} - *

                    - * gauge - */ -OPENTELEMETRY_DEPRECATED static constexpr const char *kMetricSystemCpuUtilization = - "system.cpu.utilization"; -OPENTELEMETRY_DEPRECATED static constexpr const char *descrMetricSystemCpuUtilization = - "Deprecated. Use `cpu.utilization` instead."; -OPENTELEMETRY_DEPRECATED static constexpr const char *unitMetricSystemCpuUtilization = "1"; - -#if OPENTELEMETRY_ABI_VERSION_NO >= 2 - -OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> -CreateSyncInt64MetricSystemCpuUtilization(metrics::Meter *meter) -{ - return meter->CreateInt64Gauge(kMetricSystemCpuUtilization, descrMetricSystemCpuUtilization, - unitMetricSystemCpuUtilization); -} - -OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> -CreateSyncDoubleMetricSystemCpuUtilization(metrics::Meter *meter) -{ - return meter->CreateDoubleGauge(kMetricSystemCpuUtilization, descrMetricSystemCpuUtilization, + } + + OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr + CreateAsyncDoubleMetricSystemCpuTime(metrics::Meter *meter) + { + return meter->CreateDoubleObservableCounter(kMetricSystemCpuTime, descrMetricSystemCpuTime, + unitMetricSystemCpuTime); + } + + /** + * Deprecated. Use @code cpu.utilization @endcode instead. + * + * @deprecated + * {"note": "Replaced by @code cpu.utilization @endcode.", "reason": "renamed", "renamed_to": + * "cpu.utilization"}

                    gauge + */ + OPENTELEMETRY_DEPRECATED static constexpr const char *kMetricSystemCpuUtilization = + "system.cpu.utilization"; + OPENTELEMETRY_DEPRECATED static constexpr const char *descrMetricSystemCpuUtilization = + "Deprecated. Use `cpu.utilization` instead."; + OPENTELEMETRY_DEPRECATED static constexpr const char *unitMetricSystemCpuUtilization = "1"; + + #if OPENTELEMETRY_ABI_VERSION_NO >= 2 + + OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> + CreateSyncInt64MetricSystemCpuUtilization(metrics::Meter *meter) + { + return meter->CreateInt64Gauge(kMetricSystemCpuUtilization, descrMetricSystemCpuUtilization, unitMetricSystemCpuUtilization); -} -#endif /* OPENTELEMETRY_ABI_VERSION_NO */ - -OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr -CreateAsyncInt64MetricSystemCpuUtilization(metrics::Meter *meter) -{ - return meter->CreateInt64ObservableGauge( - kMetricSystemCpuUtilization, descrMetricSystemCpuUtilization, unitMetricSystemCpuUtilization); -} - -OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr -CreateAsyncDoubleMetricSystemCpuUtilization(metrics::Meter *meter) -{ - return meter->CreateDoubleObservableGauge( - kMetricSystemCpuUtilization, descrMetricSystemCpuUtilization, unitMetricSystemCpuUtilization); -} - -/** - * counter - */ -static constexpr const char *kMetricSystemDiskIo = "system.disk.io"; -static constexpr const char *descrMetricSystemDiskIo = ""; -static constexpr const char *unitMetricSystemDiskIo = "By"; - -static inline nostd::unique_ptr> CreateSyncInt64MetricSystemDiskIo( - metrics::Meter *meter) -{ - return meter->CreateUInt64Counter(kMetricSystemDiskIo, descrMetricSystemDiskIo, - unitMetricSystemDiskIo); -} - -static inline nostd::unique_ptr> CreateSyncDoubleMetricSystemDiskIo( - metrics::Meter *meter) -{ - return meter->CreateDoubleCounter(kMetricSystemDiskIo, descrMetricSystemDiskIo, - unitMetricSystemDiskIo); -} - -static inline nostd::shared_ptr CreateAsyncInt64MetricSystemDiskIo( - metrics::Meter *meter) -{ - return meter->CreateInt64ObservableCounter(kMetricSystemDiskIo, descrMetricSystemDiskIo, - unitMetricSystemDiskIo); -} - -static inline nostd::shared_ptr CreateAsyncDoubleMetricSystemDiskIo( - metrics::Meter *meter) -{ - return meter->CreateDoubleObservableCounter(kMetricSystemDiskIo, descrMetricSystemDiskIo, + } + + OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> + CreateSyncDoubleMetricSystemCpuUtilization(metrics::Meter *meter) + { + return meter->CreateDoubleGauge(kMetricSystemCpuUtilization, descrMetricSystemCpuUtilization, + unitMetricSystemCpuUtilization); + } + #endif /* OPENTELEMETRY_ABI_VERSION_NO */ + + OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr + CreateAsyncInt64MetricSystemCpuUtilization(metrics::Meter *meter) + { + return meter->CreateInt64ObservableGauge( + kMetricSystemCpuUtilization, descrMetricSystemCpuUtilization, unitMetricSystemCpuUtilization); + } + + OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr + CreateAsyncDoubleMetricSystemCpuUtilization(metrics::Meter *meter) + { + return meter->CreateDoubleObservableGauge( + kMetricSystemCpuUtilization, descrMetricSystemCpuUtilization, unitMetricSystemCpuUtilization); + } + + /** + * counter + */ + static constexpr const char *kMetricSystemDiskIo = "system.disk.io"; + static constexpr const char *descrMetricSystemDiskIo = ""; + static constexpr const char *unitMetricSystemDiskIo = "By"; + + static inline nostd::unique_ptr> CreateSyncInt64MetricSystemDiskIo( + metrics::Meter *meter) + { + return meter->CreateUInt64Counter(kMetricSystemDiskIo, descrMetricSystemDiskIo, + unitMetricSystemDiskIo); + } + + static inline nostd::unique_ptr> CreateSyncDoubleMetricSystemDiskIo( + metrics::Meter *meter) + { + return meter->CreateDoubleCounter(kMetricSystemDiskIo, descrMetricSystemDiskIo, + unitMetricSystemDiskIo); + } + + static inline nostd::shared_ptr CreateAsyncInt64MetricSystemDiskIo( + metrics::Meter *meter) + { + return meter->CreateInt64ObservableCounter(kMetricSystemDiskIo, descrMetricSystemDiskIo, unitMetricSystemDiskIo); -} - -/** - * Time disk spent activated - *

                    - * The real elapsed time ("wall clock") used in the I/O path (time from operations running in - * parallel are not counted). Measured as: - *

                      - *
                    • Linux: Field 13 from - * procfs-diskstats - *
                    • - *
                    • Windows: The complement of - * "Disk% Idle Time" - * performance counter: @code uptime * (100 - "Disk\% Idle Time") / 100 @endcode
                    • - *
                    - *

                    - * counter - */ -static constexpr const char *kMetricSystemDiskIoTime = "system.disk.io_time"; -static constexpr const char *descrMetricSystemDiskIoTime = "Time disk spent activated"; -static constexpr const char *unitMetricSystemDiskIoTime = "s"; - -static inline nostd::unique_ptr> CreateSyncInt64MetricSystemDiskIoTime( - metrics::Meter *meter) -{ - return meter->CreateUInt64Counter(kMetricSystemDiskIoTime, descrMetricSystemDiskIoTime, - unitMetricSystemDiskIoTime); -} - -static inline nostd::unique_ptr> CreateSyncDoubleMetricSystemDiskIoTime( - metrics::Meter *meter) -{ - return meter->CreateDoubleCounter(kMetricSystemDiskIoTime, descrMetricSystemDiskIoTime, - unitMetricSystemDiskIoTime); -} - -static inline nostd::shared_ptr -CreateAsyncInt64MetricSystemDiskIoTime(metrics::Meter *meter) -{ - return meter->CreateInt64ObservableCounter(kMetricSystemDiskIoTime, descrMetricSystemDiskIoTime, - unitMetricSystemDiskIoTime); -} - -static inline nostd::shared_ptr -CreateAsyncDoubleMetricSystemDiskIoTime(metrics::Meter *meter) -{ - return meter->CreateDoubleObservableCounter(kMetricSystemDiskIoTime, descrMetricSystemDiskIoTime, + } + + static inline nostd::shared_ptr CreateAsyncDoubleMetricSystemDiskIo( + metrics::Meter *meter) + { + return meter->CreateDoubleObservableCounter(kMetricSystemDiskIo, descrMetricSystemDiskIo, + unitMetricSystemDiskIo); + } + + /** + * Time disk spent activated + *

                    + * The real elapsed time ("wall clock") used in the I/O path (time from operations running in + * parallel are not counted). Measured as:

                    + *

                    + * counter + */ + static constexpr const char *kMetricSystemDiskIoTime = "system.disk.io_time"; + static constexpr const char *descrMetricSystemDiskIoTime = "Time disk spent activated"; + static constexpr const char *unitMetricSystemDiskIoTime = "s"; + + static inline nostd::unique_ptr> CreateSyncInt64MetricSystemDiskIoTime( + metrics::Meter *meter) + { + return meter->CreateUInt64Counter(kMetricSystemDiskIoTime, descrMetricSystemDiskIoTime, + unitMetricSystemDiskIoTime); + } + + static inline nostd::unique_ptr> CreateSyncDoubleMetricSystemDiskIoTime( + metrics::Meter *meter) + { + return meter->CreateDoubleCounter(kMetricSystemDiskIoTime, descrMetricSystemDiskIoTime, + unitMetricSystemDiskIoTime); + } + + static inline nostd::shared_ptr + CreateAsyncInt64MetricSystemDiskIoTime(metrics::Meter *meter) + { + return meter->CreateInt64ObservableCounter(kMetricSystemDiskIoTime, descrMetricSystemDiskIoTime, unitMetricSystemDiskIoTime); -} - -/** - * The total storage capacity of the disk - *

                    - * updowncounter - */ -static constexpr const char *kMetricSystemDiskLimit = "system.disk.limit"; -static constexpr const char *descrMetricSystemDiskLimit = "The total storage capacity of the disk"; -static constexpr const char *unitMetricSystemDiskLimit = "By"; - -static inline nostd::unique_ptr> -CreateSyncInt64MetricSystemDiskLimit(metrics::Meter *meter) -{ - return meter->CreateInt64UpDownCounter(kMetricSystemDiskLimit, descrMetricSystemDiskLimit, - unitMetricSystemDiskLimit); -} - -static inline nostd::unique_ptr> -CreateSyncDoubleMetricSystemDiskLimit(metrics::Meter *meter) -{ - return meter->CreateDoubleUpDownCounter(kMetricSystemDiskLimit, descrMetricSystemDiskLimit, + } + + static inline nostd::shared_ptr + CreateAsyncDoubleMetricSystemDiskIoTime(metrics::Meter *meter) + { + return meter->CreateDoubleObservableCounter(kMetricSystemDiskIoTime, descrMetricSystemDiskIoTime, + unitMetricSystemDiskIoTime); + } + + /** + * The total storage capacity of the disk + *

                    + * updowncounter + */ + static constexpr const char *kMetricSystemDiskLimit = "system.disk.limit"; + static constexpr const char *descrMetricSystemDiskLimit = "The total storage capacity of the disk"; + static constexpr const char *unitMetricSystemDiskLimit = "By"; + + static inline nostd::unique_ptr> + CreateSyncInt64MetricSystemDiskLimit(metrics::Meter *meter) + { + return meter->CreateInt64UpDownCounter(kMetricSystemDiskLimit, descrMetricSystemDiskLimit, unitMetricSystemDiskLimit); -} - -static inline nostd::shared_ptr -CreateAsyncInt64MetricSystemDiskLimit(metrics::Meter *meter) -{ - return meter->CreateInt64ObservableUpDownCounter( - kMetricSystemDiskLimit, descrMetricSystemDiskLimit, unitMetricSystemDiskLimit); -} - -static inline nostd::shared_ptr -CreateAsyncDoubleMetricSystemDiskLimit(metrics::Meter *meter) -{ - return meter->CreateDoubleObservableUpDownCounter( - kMetricSystemDiskLimit, descrMetricSystemDiskLimit, unitMetricSystemDiskLimit); -} - -/** - * counter - */ -static constexpr const char *kMetricSystemDiskMerged = "system.disk.merged"; -static constexpr const char *descrMetricSystemDiskMerged = ""; -static constexpr const char *unitMetricSystemDiskMerged = "{operation}"; - -static inline nostd::unique_ptr> CreateSyncInt64MetricSystemDiskMerged( - metrics::Meter *meter) -{ - return meter->CreateUInt64Counter(kMetricSystemDiskMerged, descrMetricSystemDiskMerged, - unitMetricSystemDiskMerged); -} - -static inline nostd::unique_ptr> CreateSyncDoubleMetricSystemDiskMerged( - metrics::Meter *meter) -{ - return meter->CreateDoubleCounter(kMetricSystemDiskMerged, descrMetricSystemDiskMerged, - unitMetricSystemDiskMerged); -} - -static inline nostd::shared_ptr -CreateAsyncInt64MetricSystemDiskMerged(metrics::Meter *meter) -{ - return meter->CreateInt64ObservableCounter(kMetricSystemDiskMerged, descrMetricSystemDiskMerged, - unitMetricSystemDiskMerged); -} - -static inline nostd::shared_ptr -CreateAsyncDoubleMetricSystemDiskMerged(metrics::Meter *meter) -{ - return meter->CreateDoubleObservableCounter(kMetricSystemDiskMerged, descrMetricSystemDiskMerged, + } + + static inline nostd::unique_ptr> + CreateSyncDoubleMetricSystemDiskLimit(metrics::Meter *meter) + { + return meter->CreateDoubleUpDownCounter(kMetricSystemDiskLimit, descrMetricSystemDiskLimit, + unitMetricSystemDiskLimit); + } + + static inline nostd::shared_ptr + CreateAsyncInt64MetricSystemDiskLimit(metrics::Meter *meter) + { + return meter->CreateInt64ObservableUpDownCounter( + kMetricSystemDiskLimit, descrMetricSystemDiskLimit, unitMetricSystemDiskLimit); + } + + static inline nostd::shared_ptr + CreateAsyncDoubleMetricSystemDiskLimit(metrics::Meter *meter) + { + return meter->CreateDoubleObservableUpDownCounter( + kMetricSystemDiskLimit, descrMetricSystemDiskLimit, unitMetricSystemDiskLimit); + } + + /** + * counter + */ + static constexpr const char *kMetricSystemDiskMerged = "system.disk.merged"; + static constexpr const char *descrMetricSystemDiskMerged = ""; + static constexpr const char *unitMetricSystemDiskMerged = "{operation}"; + + static inline nostd::unique_ptr> CreateSyncInt64MetricSystemDiskMerged( + metrics::Meter *meter) + { + return meter->CreateUInt64Counter(kMetricSystemDiskMerged, descrMetricSystemDiskMerged, + unitMetricSystemDiskMerged); + } + + static inline nostd::unique_ptr> CreateSyncDoubleMetricSystemDiskMerged( + metrics::Meter *meter) + { + return meter->CreateDoubleCounter(kMetricSystemDiskMerged, descrMetricSystemDiskMerged, + unitMetricSystemDiskMerged); + } + + static inline nostd::shared_ptr + CreateAsyncInt64MetricSystemDiskMerged(metrics::Meter *meter) + { + return meter->CreateInt64ObservableCounter(kMetricSystemDiskMerged, descrMetricSystemDiskMerged, unitMetricSystemDiskMerged); -} - -/** - * Sum of the time each operation took to complete - *

                    - * Because it is the sum of time each request took, parallel-issued requests each contribute to make - * the count grow. Measured as:

                    • Linux: Fields 7 & 11 from - * procfs-diskstats
                    • - *
                    • Windows: "Avg. Disk sec/Read" perf counter multiplied by "Disk Reads/sec" perf counter - * (similar for Writes)
                    • - *
                    - *

                    - * counter - */ -static constexpr const char *kMetricSystemDiskOperationTime = "system.disk.operation_time"; -static constexpr const char *descrMetricSystemDiskOperationTime = - "Sum of the time each operation took to complete"; -static constexpr const char *unitMetricSystemDiskOperationTime = "s"; - -static inline nostd::unique_ptr> -CreateSyncInt64MetricSystemDiskOperationTime(metrics::Meter *meter) -{ - return meter->CreateUInt64Counter(kMetricSystemDiskOperationTime, - descrMetricSystemDiskOperationTime, - unitMetricSystemDiskOperationTime); -} - -static inline nostd::unique_ptr> -CreateSyncDoubleMetricSystemDiskOperationTime(metrics::Meter *meter) -{ - return meter->CreateDoubleCounter(kMetricSystemDiskOperationTime, - descrMetricSystemDiskOperationTime, - unitMetricSystemDiskOperationTime); -} - -static inline nostd::shared_ptr -CreateAsyncInt64MetricSystemDiskOperationTime(metrics::Meter *meter) -{ - return meter->CreateInt64ObservableCounter(kMetricSystemDiskOperationTime, - descrMetricSystemDiskOperationTime, - unitMetricSystemDiskOperationTime); -} - -static inline nostd::shared_ptr -CreateAsyncDoubleMetricSystemDiskOperationTime(metrics::Meter *meter) -{ - return meter->CreateDoubleObservableCounter(kMetricSystemDiskOperationTime, + } + + static inline nostd::shared_ptr + CreateAsyncDoubleMetricSystemDiskMerged(metrics::Meter *meter) + { + return meter->CreateDoubleObservableCounter(kMetricSystemDiskMerged, descrMetricSystemDiskMerged, + unitMetricSystemDiskMerged); + } + + /** + * Sum of the time each operation took to complete + *

                    + * Because it is the sum of time each request took, parallel-issued requests each contribute to make + * the count grow. Measured as:

                    • Linux: Fields 7 & 11 from procfs-diskstats
                    • + *
                    • Windows: "Avg. Disk sec/Read" perf counter multiplied by "Disk Reads/sec" perf counter + * (similar for Writes)
                    • + *
                    + *

                    + * counter + */ + static constexpr const char *kMetricSystemDiskOperationTime = "system.disk.operation_time"; + static constexpr const char *descrMetricSystemDiskOperationTime = + "Sum of the time each operation took to complete"; + static constexpr const char *unitMetricSystemDiskOperationTime = "s"; + + static inline nostd::unique_ptr> + CreateSyncInt64MetricSystemDiskOperationTime(metrics::Meter *meter) + { + return meter->CreateUInt64Counter(kMetricSystemDiskOperationTime, + descrMetricSystemDiskOperationTime, + unitMetricSystemDiskOperationTime); + } + + static inline nostd::unique_ptr> + CreateSyncDoubleMetricSystemDiskOperationTime(metrics::Meter *meter) + { + return meter->CreateDoubleCounter(kMetricSystemDiskOperationTime, + descrMetricSystemDiskOperationTime, + unitMetricSystemDiskOperationTime); + } + + static inline nostd::shared_ptr + CreateAsyncInt64MetricSystemDiskOperationTime(metrics::Meter *meter) + { + return meter->CreateInt64ObservableCounter(kMetricSystemDiskOperationTime, descrMetricSystemDiskOperationTime, unitMetricSystemDiskOperationTime); -} - -/** - * counter - */ -static constexpr const char *kMetricSystemDiskOperations = "system.disk.operations"; -static constexpr const char *descrMetricSystemDiskOperations = ""; -static constexpr const char *unitMetricSystemDiskOperations = "{operation}"; - -static inline nostd::unique_ptr> -CreateSyncInt64MetricSystemDiskOperations(metrics::Meter *meter) -{ - return meter->CreateUInt64Counter(kMetricSystemDiskOperations, descrMetricSystemDiskOperations, - unitMetricSystemDiskOperations); -} - -static inline nostd::unique_ptr> -CreateSyncDoubleMetricSystemDiskOperations(metrics::Meter *meter) -{ - return meter->CreateDoubleCounter(kMetricSystemDiskOperations, descrMetricSystemDiskOperations, - unitMetricSystemDiskOperations); -} - -static inline nostd::shared_ptr -CreateAsyncInt64MetricSystemDiskOperations(metrics::Meter *meter) -{ - return meter->CreateInt64ObservableCounter( - kMetricSystemDiskOperations, descrMetricSystemDiskOperations, unitMetricSystemDiskOperations); -} - -static inline nostd::shared_ptr -CreateAsyncDoubleMetricSystemDiskOperations(metrics::Meter *meter) -{ - return meter->CreateDoubleObservableCounter( - kMetricSystemDiskOperations, descrMetricSystemDiskOperations, unitMetricSystemDiskOperations); -} - -/** - * The total storage capacity of the filesystem - *

                    - * updowncounter - */ -static constexpr const char *kMetricSystemFilesystemLimit = "system.filesystem.limit"; -static constexpr const char *descrMetricSystemFilesystemLimit = - "The total storage capacity of the filesystem"; -static constexpr const char *unitMetricSystemFilesystemLimit = "By"; - -static inline nostd::unique_ptr> -CreateSyncInt64MetricSystemFilesystemLimit(metrics::Meter *meter) -{ - return meter->CreateInt64UpDownCounter(kMetricSystemFilesystemLimit, - descrMetricSystemFilesystemLimit, - unitMetricSystemFilesystemLimit); -} - -static inline nostd::unique_ptr> -CreateSyncDoubleMetricSystemFilesystemLimit(metrics::Meter *meter) -{ - return meter->CreateDoubleUpDownCounter(kMetricSystemFilesystemLimit, + } + + static inline nostd::shared_ptr + CreateAsyncDoubleMetricSystemDiskOperationTime(metrics::Meter *meter) + { + return meter->CreateDoubleObservableCounter(kMetricSystemDiskOperationTime, + descrMetricSystemDiskOperationTime, + unitMetricSystemDiskOperationTime); + } + + /** + * counter + */ + static constexpr const char *kMetricSystemDiskOperations = "system.disk.operations"; + static constexpr const char *descrMetricSystemDiskOperations = ""; + static constexpr const char *unitMetricSystemDiskOperations = "{operation}"; + + static inline nostd::unique_ptr> + CreateSyncInt64MetricSystemDiskOperations(metrics::Meter *meter) + { + return meter->CreateUInt64Counter(kMetricSystemDiskOperations, descrMetricSystemDiskOperations, + unitMetricSystemDiskOperations); + } + + static inline nostd::unique_ptr> + CreateSyncDoubleMetricSystemDiskOperations(metrics::Meter *meter) + { + return meter->CreateDoubleCounter(kMetricSystemDiskOperations, descrMetricSystemDiskOperations, + unitMetricSystemDiskOperations); + } + + static inline nostd::shared_ptr + CreateAsyncInt64MetricSystemDiskOperations(metrics::Meter *meter) + { + return meter->CreateInt64ObservableCounter( + kMetricSystemDiskOperations, descrMetricSystemDiskOperations, unitMetricSystemDiskOperations); + } + + static inline nostd::shared_ptr + CreateAsyncDoubleMetricSystemDiskOperations(metrics::Meter *meter) + { + return meter->CreateDoubleObservableCounter( + kMetricSystemDiskOperations, descrMetricSystemDiskOperations, unitMetricSystemDiskOperations); + } + + /** + * The total storage capacity of the filesystem + *

                    + * updowncounter + */ + static constexpr const char *kMetricSystemFilesystemLimit = "system.filesystem.limit"; + static constexpr const char *descrMetricSystemFilesystemLimit = + "The total storage capacity of the filesystem"; + static constexpr const char *unitMetricSystemFilesystemLimit = "By"; + + static inline nostd::unique_ptr> + CreateSyncInt64MetricSystemFilesystemLimit(metrics::Meter *meter) + { + return meter->CreateInt64UpDownCounter(kMetricSystemFilesystemLimit, descrMetricSystemFilesystemLimit, unitMetricSystemFilesystemLimit); -} - -static inline nostd::shared_ptr -CreateAsyncInt64MetricSystemFilesystemLimit(metrics::Meter *meter) -{ - return meter->CreateInt64ObservableUpDownCounter(kMetricSystemFilesystemLimit, - descrMetricSystemFilesystemLimit, - unitMetricSystemFilesystemLimit); -} - -static inline nostd::shared_ptr -CreateAsyncDoubleMetricSystemFilesystemLimit(metrics::Meter *meter) -{ - return meter->CreateDoubleObservableUpDownCounter(kMetricSystemFilesystemLimit, + } + + static inline nostd::unique_ptr> + CreateSyncDoubleMetricSystemFilesystemLimit(metrics::Meter *meter) + { + return meter->CreateDoubleUpDownCounter(kMetricSystemFilesystemLimit, + descrMetricSystemFilesystemLimit, + unitMetricSystemFilesystemLimit); + } + + static inline nostd::shared_ptr + CreateAsyncInt64MetricSystemFilesystemLimit(metrics::Meter *meter) + { + return meter->CreateInt64ObservableUpDownCounter(kMetricSystemFilesystemLimit, descrMetricSystemFilesystemLimit, unitMetricSystemFilesystemLimit); -} - -/** - * Reports a filesystem's space usage across different states. - *

                    - * The sum of all @code system.filesystem.usage @endcode values over the different @code - * system.filesystem.state @endcode attributes SHOULD equal the total storage capacity of the - * filesystem, that is @code system.filesystem.limit @endcode.

                    updowncounter - */ -static constexpr const char *kMetricSystemFilesystemUsage = "system.filesystem.usage"; -static constexpr const char *descrMetricSystemFilesystemUsage = - "Reports a filesystem's space usage across different states."; -static constexpr const char *unitMetricSystemFilesystemUsage = "By"; - -static inline nostd::unique_ptr> -CreateSyncInt64MetricSystemFilesystemUsage(metrics::Meter *meter) -{ - return meter->CreateInt64UpDownCounter(kMetricSystemFilesystemUsage, - descrMetricSystemFilesystemUsage, - unitMetricSystemFilesystemUsage); -} - -static inline nostd::unique_ptr> -CreateSyncDoubleMetricSystemFilesystemUsage(metrics::Meter *meter) -{ - return meter->CreateDoubleUpDownCounter(kMetricSystemFilesystemUsage, + } + + static inline nostd::shared_ptr + CreateAsyncDoubleMetricSystemFilesystemLimit(metrics::Meter *meter) + { + return meter->CreateDoubleObservableUpDownCounter(kMetricSystemFilesystemLimit, + descrMetricSystemFilesystemLimit, + unitMetricSystemFilesystemLimit); + } + + /** + * Reports a filesystem's space usage across different states. + *

                    + * The sum of all @code system.filesystem.usage @endcode values over the different @code + * system.filesystem.state @endcode attributes SHOULD equal the total storage capacity of the + * filesystem, that is @code system.filesystem.limit @endcode.

                    updowncounter + */ + static constexpr const char *kMetricSystemFilesystemUsage = "system.filesystem.usage"; + static constexpr const char *descrMetricSystemFilesystemUsage = + "Reports a filesystem's space usage across different states."; + static constexpr const char *unitMetricSystemFilesystemUsage = "By"; + + static inline nostd::unique_ptr> + CreateSyncInt64MetricSystemFilesystemUsage(metrics::Meter *meter) + { + return meter->CreateInt64UpDownCounter(kMetricSystemFilesystemUsage, descrMetricSystemFilesystemUsage, unitMetricSystemFilesystemUsage); -} - -static inline nostd::shared_ptr -CreateAsyncInt64MetricSystemFilesystemUsage(metrics::Meter *meter) -{ - return meter->CreateInt64ObservableUpDownCounter(kMetricSystemFilesystemUsage, - descrMetricSystemFilesystemUsage, - unitMetricSystemFilesystemUsage); -} - -static inline nostd::shared_ptr -CreateAsyncDoubleMetricSystemFilesystemUsage(metrics::Meter *meter) -{ - return meter->CreateDoubleObservableUpDownCounter(kMetricSystemFilesystemUsage, + } + + static inline nostd::unique_ptr> + CreateSyncDoubleMetricSystemFilesystemUsage(metrics::Meter *meter) + { + return meter->CreateDoubleUpDownCounter(kMetricSystemFilesystemUsage, + descrMetricSystemFilesystemUsage, + unitMetricSystemFilesystemUsage); + } + + static inline nostd::shared_ptr + CreateAsyncInt64MetricSystemFilesystemUsage(metrics::Meter *meter) + { + return meter->CreateInt64ObservableUpDownCounter(kMetricSystemFilesystemUsage, descrMetricSystemFilesystemUsage, unitMetricSystemFilesystemUsage); -} - -/** - * gauge - */ -static constexpr const char *kMetricSystemFilesystemUtilization = "system.filesystem.utilization"; -static constexpr const char *descrMetricSystemFilesystemUtilization = ""; -static constexpr const char *unitMetricSystemFilesystemUtilization = "1"; - -#if OPENTELEMETRY_ABI_VERSION_NO >= 2 - -static inline nostd::unique_ptr> -CreateSyncInt64MetricSystemFilesystemUtilization(metrics::Meter *meter) -{ - return meter->CreateInt64Gauge(kMetricSystemFilesystemUtilization, - descrMetricSystemFilesystemUtilization, - unitMetricSystemFilesystemUtilization); -} - -static inline nostd::unique_ptr> -CreateSyncDoubleMetricSystemFilesystemUtilization(metrics::Meter *meter) -{ - return meter->CreateDoubleGauge(kMetricSystemFilesystemUtilization, + } + + static inline nostd::shared_ptr + CreateAsyncDoubleMetricSystemFilesystemUsage(metrics::Meter *meter) + { + return meter->CreateDoubleObservableUpDownCounter(kMetricSystemFilesystemUsage, + descrMetricSystemFilesystemUsage, + unitMetricSystemFilesystemUsage); + } + + /** + * gauge + */ + static constexpr const char *kMetricSystemFilesystemUtilization = "system.filesystem.utilization"; + static constexpr const char *descrMetricSystemFilesystemUtilization = ""; + static constexpr const char *unitMetricSystemFilesystemUtilization = "1"; + + #if OPENTELEMETRY_ABI_VERSION_NO >= 2 + + static inline nostd::unique_ptr> + CreateSyncInt64MetricSystemFilesystemUtilization(metrics::Meter *meter) + { + return meter->CreateInt64Gauge(kMetricSystemFilesystemUtilization, descrMetricSystemFilesystemUtilization, unitMetricSystemFilesystemUtilization); -} -#endif /* OPENTELEMETRY_ABI_VERSION_NO */ - -static inline nostd::shared_ptr -CreateAsyncInt64MetricSystemFilesystemUtilization(metrics::Meter *meter) -{ - return meter->CreateInt64ObservableGauge(kMetricSystemFilesystemUtilization, - descrMetricSystemFilesystemUtilization, - unitMetricSystemFilesystemUtilization); -} - -static inline nostd::shared_ptr -CreateAsyncDoubleMetricSystemFilesystemUtilization(metrics::Meter *meter) -{ - return meter->CreateDoubleObservableGauge(kMetricSystemFilesystemUtilization, + } + + static inline nostd::unique_ptr> + CreateSyncDoubleMetricSystemFilesystemUtilization(metrics::Meter *meter) + { + return meter->CreateDoubleGauge(kMetricSystemFilesystemUtilization, + descrMetricSystemFilesystemUtilization, + unitMetricSystemFilesystemUtilization); + } + #endif /* OPENTELEMETRY_ABI_VERSION_NO */ + + static inline nostd::shared_ptr + CreateAsyncInt64MetricSystemFilesystemUtilization(metrics::Meter *meter) + { + return meter->CreateInt64ObservableGauge(kMetricSystemFilesystemUtilization, descrMetricSystemFilesystemUtilization, unitMetricSystemFilesystemUtilization); -} - -/** - * An estimate of how much memory is available for starting new applications, without causing - * swapping

                    This is an alternative to @code system.memory.usage @endcode metric with @code - * state=free @endcode. Linux starting from 3.14 exports "available" memory. It takes "free" memory - * as a baseline, and then factors in kernel-specific values. This is supposed to be more accurate - * than just "free" memory. For reference, see the calculations - * here. See also @code MemAvailable @endcode in - * /proc/meminfo.

                    updowncounter - */ -static constexpr const char *kMetricSystemLinuxMemoryAvailable = "system.linux.memory.available"; -static constexpr const char *descrMetricSystemLinuxMemoryAvailable = - "An estimate of how much memory is available for starting new applications, without causing " - "swapping"; -static constexpr const char *unitMetricSystemLinuxMemoryAvailable = "By"; - -static inline nostd::unique_ptr> -CreateSyncInt64MetricSystemLinuxMemoryAvailable(metrics::Meter *meter) -{ - return meter->CreateInt64UpDownCounter(kMetricSystemLinuxMemoryAvailable, - descrMetricSystemLinuxMemoryAvailable, - unitMetricSystemLinuxMemoryAvailable); -} - -static inline nostd::unique_ptr> -CreateSyncDoubleMetricSystemLinuxMemoryAvailable(metrics::Meter *meter) -{ - return meter->CreateDoubleUpDownCounter(kMetricSystemLinuxMemoryAvailable, + } + + static inline nostd::shared_ptr + CreateAsyncDoubleMetricSystemFilesystemUtilization(metrics::Meter *meter) + { + return meter->CreateDoubleObservableGauge(kMetricSystemFilesystemUtilization, + descrMetricSystemFilesystemUtilization, + unitMetricSystemFilesystemUtilization); + } + + /** + * An estimate of how much memory is available for starting new applications, without causing + * swapping

                    This is an alternative to @code system.memory.usage @endcode metric with @code + * state=free @endcode. Linux starting from 3.14 exports "available" memory. It takes "free" memory + * as a baseline, and then factors in kernel-specific values. This is supposed to be more accurate + * than just "free" memory. For reference, see the calculations here. See also @code MemAvailable @endcode in /proc/meminfo.

                    updowncounter + */ + static constexpr const char *kMetricSystemLinuxMemoryAvailable = "system.linux.memory.available"; + static constexpr const char *descrMetricSystemLinuxMemoryAvailable = + "An estimate of how much memory is available for starting new applications, without causing " + "swapping"; + static constexpr const char *unitMetricSystemLinuxMemoryAvailable = "By"; + + static inline nostd::unique_ptr> + CreateSyncInt64MetricSystemLinuxMemoryAvailable(metrics::Meter *meter) + { + return meter->CreateInt64UpDownCounter(kMetricSystemLinuxMemoryAvailable, descrMetricSystemLinuxMemoryAvailable, unitMetricSystemLinuxMemoryAvailable); -} - -static inline nostd::shared_ptr -CreateAsyncInt64MetricSystemLinuxMemoryAvailable(metrics::Meter *meter) -{ - return meter->CreateInt64ObservableUpDownCounter(kMetricSystemLinuxMemoryAvailable, - descrMetricSystemLinuxMemoryAvailable, - unitMetricSystemLinuxMemoryAvailable); -} - -static inline nostd::shared_ptr -CreateAsyncDoubleMetricSystemLinuxMemoryAvailable(metrics::Meter *meter) -{ - return meter->CreateDoubleObservableUpDownCounter(kMetricSystemLinuxMemoryAvailable, + } + + static inline nostd::unique_ptr> + CreateSyncDoubleMetricSystemLinuxMemoryAvailable(metrics::Meter *meter) + { + return meter->CreateDoubleUpDownCounter(kMetricSystemLinuxMemoryAvailable, + descrMetricSystemLinuxMemoryAvailable, + unitMetricSystemLinuxMemoryAvailable); + } + + static inline nostd::shared_ptr + CreateAsyncInt64MetricSystemLinuxMemoryAvailable(metrics::Meter *meter) + { + return meter->CreateInt64ObservableUpDownCounter(kMetricSystemLinuxMemoryAvailable, descrMetricSystemLinuxMemoryAvailable, unitMetricSystemLinuxMemoryAvailable); -} - -/** - * Reports the memory used by the Linux kernel for managing caches of frequently used objects. - *

                    - * The sum over the @code reclaimable @endcode and @code unreclaimable @endcode state values in - * @code linux.memory.slab.usage @endcode SHOULD be equal to the total slab memory available on the - * system. Note that the total slab memory is not constant and may vary over time. See also the - * Slab allocator - * and @code Slab @endcode in - * /proc/meminfo.

                    updowncounter - */ -static constexpr const char *kMetricSystemLinuxMemorySlabUsage = "system.linux.memory.slab.usage"; -static constexpr const char *descrMetricSystemLinuxMemorySlabUsage = - "Reports the memory used by the Linux kernel for managing caches of frequently used objects."; -static constexpr const char *unitMetricSystemLinuxMemorySlabUsage = "By"; - -static inline nostd::unique_ptr> -CreateSyncInt64MetricSystemLinuxMemorySlabUsage(metrics::Meter *meter) -{ - return meter->CreateInt64UpDownCounter(kMetricSystemLinuxMemorySlabUsage, - descrMetricSystemLinuxMemorySlabUsage, - unitMetricSystemLinuxMemorySlabUsage); -} - -static inline nostd::unique_ptr> -CreateSyncDoubleMetricSystemLinuxMemorySlabUsage(metrics::Meter *meter) -{ - return meter->CreateDoubleUpDownCounter(kMetricSystemLinuxMemorySlabUsage, + } + + static inline nostd::shared_ptr + CreateAsyncDoubleMetricSystemLinuxMemoryAvailable(metrics::Meter *meter) + { + return meter->CreateDoubleObservableUpDownCounter(kMetricSystemLinuxMemoryAvailable, + descrMetricSystemLinuxMemoryAvailable, + unitMetricSystemLinuxMemoryAvailable); + } + + /** + * Reports the memory used by the Linux kernel for managing caches of frequently used objects. + *

                    + * The sum over the @code reclaimable @endcode and @code unreclaimable @endcode state values in + * @code linux.memory.slab.usage @endcode SHOULD be equal to the total slab memory available on the + * system. Note that the total slab memory is not constant and may vary over time. See also the Slab + * allocator and @code Slab @endcode in /proc/meminfo.

                    updowncounter + */ + static constexpr const char *kMetricSystemLinuxMemorySlabUsage = "system.linux.memory.slab.usage"; + static constexpr const char *descrMetricSystemLinuxMemorySlabUsage = + "Reports the memory used by the Linux kernel for managing caches of frequently used objects."; + static constexpr const char *unitMetricSystemLinuxMemorySlabUsage = "By"; + + static inline nostd::unique_ptr> + CreateSyncInt64MetricSystemLinuxMemorySlabUsage(metrics::Meter *meter) + { + return meter->CreateInt64UpDownCounter(kMetricSystemLinuxMemorySlabUsage, descrMetricSystemLinuxMemorySlabUsage, unitMetricSystemLinuxMemorySlabUsage); -} - -static inline nostd::shared_ptr -CreateAsyncInt64MetricSystemLinuxMemorySlabUsage(metrics::Meter *meter) -{ - return meter->CreateInt64ObservableUpDownCounter(kMetricSystemLinuxMemorySlabUsage, - descrMetricSystemLinuxMemorySlabUsage, - unitMetricSystemLinuxMemorySlabUsage); -} - -static inline nostd::shared_ptr -CreateAsyncDoubleMetricSystemLinuxMemorySlabUsage(metrics::Meter *meter) -{ - return meter->CreateDoubleObservableUpDownCounter(kMetricSystemLinuxMemorySlabUsage, + } + + static inline nostd::unique_ptr> + CreateSyncDoubleMetricSystemLinuxMemorySlabUsage(metrics::Meter *meter) + { + return meter->CreateDoubleUpDownCounter(kMetricSystemLinuxMemorySlabUsage, + descrMetricSystemLinuxMemorySlabUsage, + unitMetricSystemLinuxMemorySlabUsage); + } + + static inline nostd::shared_ptr + CreateAsyncInt64MetricSystemLinuxMemorySlabUsage(metrics::Meter *meter) + { + return meter->CreateInt64ObservableUpDownCounter(kMetricSystemLinuxMemorySlabUsage, descrMetricSystemLinuxMemorySlabUsage, unitMetricSystemLinuxMemorySlabUsage); -} - -/** - * Total memory available in the system. - *

                    - * Its value SHOULD equal the sum of @code system.memory.state @endcode over all states. - *

                    - * updowncounter - */ -static constexpr const char *kMetricSystemMemoryLimit = "system.memory.limit"; -static constexpr const char *descrMetricSystemMemoryLimit = "Total memory available in the system."; -static constexpr const char *unitMetricSystemMemoryLimit = "By"; - -static inline nostd::unique_ptr> -CreateSyncInt64MetricSystemMemoryLimit(metrics::Meter *meter) -{ - return meter->CreateInt64UpDownCounter(kMetricSystemMemoryLimit, descrMetricSystemMemoryLimit, - unitMetricSystemMemoryLimit); -} - -static inline nostd::unique_ptr> -CreateSyncDoubleMetricSystemMemoryLimit(metrics::Meter *meter) -{ - return meter->CreateDoubleUpDownCounter(kMetricSystemMemoryLimit, descrMetricSystemMemoryLimit, + } + + static inline nostd::shared_ptr + CreateAsyncDoubleMetricSystemLinuxMemorySlabUsage(metrics::Meter *meter) + { + return meter->CreateDoubleObservableUpDownCounter(kMetricSystemLinuxMemorySlabUsage, + descrMetricSystemLinuxMemorySlabUsage, + unitMetricSystemLinuxMemorySlabUsage); + } + + /** + * Total memory available in the system. + *

                    + * Its value SHOULD equal the sum of @code system.memory.state @endcode over all states. + *

                    + * updowncounter + */ + static constexpr const char *kMetricSystemMemoryLimit = "system.memory.limit"; + static constexpr const char *descrMetricSystemMemoryLimit = "Total memory available in the system."; + static constexpr const char *unitMetricSystemMemoryLimit = "By"; + + static inline nostd::unique_ptr> + CreateSyncInt64MetricSystemMemoryLimit(metrics::Meter *meter) + { + return meter->CreateInt64UpDownCounter(kMetricSystemMemoryLimit, descrMetricSystemMemoryLimit, unitMetricSystemMemoryLimit); -} - -static inline nostd::shared_ptr -CreateAsyncInt64MetricSystemMemoryLimit(metrics::Meter *meter) -{ - return meter->CreateInt64ObservableUpDownCounter( - kMetricSystemMemoryLimit, descrMetricSystemMemoryLimit, unitMetricSystemMemoryLimit); -} - -static inline nostd::shared_ptr -CreateAsyncDoubleMetricSystemMemoryLimit(metrics::Meter *meter) -{ - return meter->CreateDoubleObservableUpDownCounter( - kMetricSystemMemoryLimit, descrMetricSystemMemoryLimit, unitMetricSystemMemoryLimit); -} - -/** - * Shared memory used (mostly by tmpfs). - *

                    - * Equivalent of @code shared @endcode from - * @code free @endcode command or - * @code Shmem @endcode from - * @code /proc/meminfo @endcode"

                    updowncounter - */ -static constexpr const char *kMetricSystemMemoryShared = "system.memory.shared"; -static constexpr const char *descrMetricSystemMemoryShared = - "Shared memory used (mostly by tmpfs)."; -static constexpr const char *unitMetricSystemMemoryShared = "By"; - -static inline nostd::unique_ptr> -CreateSyncInt64MetricSystemMemoryShared(metrics::Meter *meter) -{ - return meter->CreateInt64UpDownCounter(kMetricSystemMemoryShared, descrMetricSystemMemoryShared, - unitMetricSystemMemoryShared); -} - -static inline nostd::unique_ptr> -CreateSyncDoubleMetricSystemMemoryShared(metrics::Meter *meter) -{ - return meter->CreateDoubleUpDownCounter(kMetricSystemMemoryShared, descrMetricSystemMemoryShared, + } + + static inline nostd::unique_ptr> + CreateSyncDoubleMetricSystemMemoryLimit(metrics::Meter *meter) + { + return meter->CreateDoubleUpDownCounter(kMetricSystemMemoryLimit, descrMetricSystemMemoryLimit, + unitMetricSystemMemoryLimit); + } + + static inline nostd::shared_ptr + CreateAsyncInt64MetricSystemMemoryLimit(metrics::Meter *meter) + { + return meter->CreateInt64ObservableUpDownCounter( + kMetricSystemMemoryLimit, descrMetricSystemMemoryLimit, unitMetricSystemMemoryLimit); + } + + static inline nostd::shared_ptr + CreateAsyncDoubleMetricSystemMemoryLimit(metrics::Meter *meter) + { + return meter->CreateDoubleObservableUpDownCounter( + kMetricSystemMemoryLimit, descrMetricSystemMemoryLimit, unitMetricSystemMemoryLimit); + } + + /** + * Shared memory used (mostly by tmpfs). + *

                    + * Equivalent of @code shared @endcode from @code free @endcode command or + * @code Shmem @endcode from @code + * /proc/meminfo @endcode"

                    updowncounter + */ + static constexpr const char *kMetricSystemMemoryShared = "system.memory.shared"; + static constexpr const char *descrMetricSystemMemoryShared = + "Shared memory used (mostly by tmpfs)."; + static constexpr const char *unitMetricSystemMemoryShared = "By"; + + static inline nostd::unique_ptr> + CreateSyncInt64MetricSystemMemoryShared(metrics::Meter *meter) + { + return meter->CreateInt64UpDownCounter(kMetricSystemMemoryShared, descrMetricSystemMemoryShared, unitMetricSystemMemoryShared); -} - -static inline nostd::shared_ptr -CreateAsyncInt64MetricSystemMemoryShared(metrics::Meter *meter) -{ - return meter->CreateInt64ObservableUpDownCounter( - kMetricSystemMemoryShared, descrMetricSystemMemoryShared, unitMetricSystemMemoryShared); -} - -static inline nostd::shared_ptr -CreateAsyncDoubleMetricSystemMemoryShared(metrics::Meter *meter) -{ - return meter->CreateDoubleObservableUpDownCounter( - kMetricSystemMemoryShared, descrMetricSystemMemoryShared, unitMetricSystemMemoryShared); -} - -/** - * Reports memory in use by state. - *

                    - * The sum over all @code system.memory.state @endcode values SHOULD equal the total memory - * available on the system, that is @code system.memory.limit @endcode. - *

                    - * updowncounter - */ -static constexpr const char *kMetricSystemMemoryUsage = "system.memory.usage"; -static constexpr const char *descrMetricSystemMemoryUsage = "Reports memory in use by state."; -static constexpr const char *unitMetricSystemMemoryUsage = "By"; - -static inline nostd::unique_ptr> -CreateSyncInt64MetricSystemMemoryUsage(metrics::Meter *meter) -{ - return meter->CreateInt64UpDownCounter(kMetricSystemMemoryUsage, descrMetricSystemMemoryUsage, - unitMetricSystemMemoryUsage); -} - -static inline nostd::unique_ptr> -CreateSyncDoubleMetricSystemMemoryUsage(metrics::Meter *meter) -{ - return meter->CreateDoubleUpDownCounter(kMetricSystemMemoryUsage, descrMetricSystemMemoryUsage, + } + + static inline nostd::unique_ptr> + CreateSyncDoubleMetricSystemMemoryShared(metrics::Meter *meter) + { + return meter->CreateDoubleUpDownCounter(kMetricSystemMemoryShared, descrMetricSystemMemoryShared, + unitMetricSystemMemoryShared); + } + + static inline nostd::shared_ptr + CreateAsyncInt64MetricSystemMemoryShared(metrics::Meter *meter) + { + return meter->CreateInt64ObservableUpDownCounter( + kMetricSystemMemoryShared, descrMetricSystemMemoryShared, unitMetricSystemMemoryShared); + } + + static inline nostd::shared_ptr + CreateAsyncDoubleMetricSystemMemoryShared(metrics::Meter *meter) + { + return meter->CreateDoubleObservableUpDownCounter( + kMetricSystemMemoryShared, descrMetricSystemMemoryShared, unitMetricSystemMemoryShared); + } + + /** + * Reports memory in use by state. + *

                    + * The sum over all @code system.memory.state @endcode values SHOULD equal the total memory + * available on the system, that is @code system.memory.limit @endcode. + *

                    + * updowncounter + */ + static constexpr const char *kMetricSystemMemoryUsage = "system.memory.usage"; + static constexpr const char *descrMetricSystemMemoryUsage = "Reports memory in use by state."; + static constexpr const char *unitMetricSystemMemoryUsage = "By"; + + static inline nostd::unique_ptr> + CreateSyncInt64MetricSystemMemoryUsage(metrics::Meter *meter) + { + return meter->CreateInt64UpDownCounter(kMetricSystemMemoryUsage, descrMetricSystemMemoryUsage, unitMetricSystemMemoryUsage); -} - -static inline nostd::shared_ptr -CreateAsyncInt64MetricSystemMemoryUsage(metrics::Meter *meter) -{ - return meter->CreateInt64ObservableUpDownCounter( - kMetricSystemMemoryUsage, descrMetricSystemMemoryUsage, unitMetricSystemMemoryUsage); -} - -static inline nostd::shared_ptr -CreateAsyncDoubleMetricSystemMemoryUsage(metrics::Meter *meter) -{ - return meter->CreateDoubleObservableUpDownCounter( - kMetricSystemMemoryUsage, descrMetricSystemMemoryUsage, unitMetricSystemMemoryUsage); -} - -/** - * gauge - */ -static constexpr const char *kMetricSystemMemoryUtilization = "system.memory.utilization"; -static constexpr const char *descrMetricSystemMemoryUtilization = ""; -static constexpr const char *unitMetricSystemMemoryUtilization = "1"; - -#if OPENTELEMETRY_ABI_VERSION_NO >= 2 - -static inline nostd::unique_ptr> -CreateSyncInt64MetricSystemMemoryUtilization(metrics::Meter *meter) -{ - return meter->CreateInt64Gauge(kMetricSystemMemoryUtilization, descrMetricSystemMemoryUtilization, - unitMetricSystemMemoryUtilization); -} - -static inline nostd::unique_ptr> -CreateSyncDoubleMetricSystemMemoryUtilization(metrics::Meter *meter) -{ - return meter->CreateDoubleGauge(kMetricSystemMemoryUtilization, - descrMetricSystemMemoryUtilization, + } + + static inline nostd::unique_ptr> + CreateSyncDoubleMetricSystemMemoryUsage(metrics::Meter *meter) + { + return meter->CreateDoubleUpDownCounter(kMetricSystemMemoryUsage, descrMetricSystemMemoryUsage, + unitMetricSystemMemoryUsage); + } + + static inline nostd::shared_ptr + CreateAsyncInt64MetricSystemMemoryUsage(metrics::Meter *meter) + { + return meter->CreateInt64ObservableUpDownCounter( + kMetricSystemMemoryUsage, descrMetricSystemMemoryUsage, unitMetricSystemMemoryUsage); + } + + static inline nostd::shared_ptr + CreateAsyncDoubleMetricSystemMemoryUsage(metrics::Meter *meter) + { + return meter->CreateDoubleObservableUpDownCounter( + kMetricSystemMemoryUsage, descrMetricSystemMemoryUsage, unitMetricSystemMemoryUsage); + } + + /** + * gauge + */ + static constexpr const char *kMetricSystemMemoryUtilization = "system.memory.utilization"; + static constexpr const char *descrMetricSystemMemoryUtilization = ""; + static constexpr const char *unitMetricSystemMemoryUtilization = "1"; + + #if OPENTELEMETRY_ABI_VERSION_NO >= 2 + + static inline nostd::unique_ptr> + CreateSyncInt64MetricSystemMemoryUtilization(metrics::Meter *meter) + { + return meter->CreateInt64Gauge(kMetricSystemMemoryUtilization, descrMetricSystemMemoryUtilization, unitMetricSystemMemoryUtilization); -} -#endif /* OPENTELEMETRY_ABI_VERSION_NO */ - -static inline nostd::shared_ptr -CreateAsyncInt64MetricSystemMemoryUtilization(metrics::Meter *meter) -{ - return meter->CreateInt64ObservableGauge(kMetricSystemMemoryUtilization, - descrMetricSystemMemoryUtilization, - unitMetricSystemMemoryUtilization); -} - -static inline nostd::shared_ptr -CreateAsyncDoubleMetricSystemMemoryUtilization(metrics::Meter *meter) -{ - return meter->CreateDoubleObservableGauge(kMetricSystemMemoryUtilization, + } + + static inline nostd::unique_ptr> + CreateSyncDoubleMetricSystemMemoryUtilization(metrics::Meter *meter) + { + return meter->CreateDoubleGauge(kMetricSystemMemoryUtilization, + descrMetricSystemMemoryUtilization, + unitMetricSystemMemoryUtilization); + } + #endif /* OPENTELEMETRY_ABI_VERSION_NO */ + + static inline nostd::shared_ptr + CreateAsyncInt64MetricSystemMemoryUtilization(metrics::Meter *meter) + { + return meter->CreateInt64ObservableGauge(kMetricSystemMemoryUtilization, descrMetricSystemMemoryUtilization, unitMetricSystemMemoryUtilization); -} - -/** - * updowncounter - */ -static constexpr const char *kMetricSystemNetworkConnections = "system.network.connections"; -static constexpr const char *descrMetricSystemNetworkConnections = ""; -static constexpr const char *unitMetricSystemNetworkConnections = "{connection}"; - -static inline nostd::unique_ptr> -CreateSyncInt64MetricSystemNetworkConnections(metrics::Meter *meter) -{ - return meter->CreateInt64UpDownCounter(kMetricSystemNetworkConnections, - descrMetricSystemNetworkConnections, - unitMetricSystemNetworkConnections); -} - -static inline nostd::unique_ptr> -CreateSyncDoubleMetricSystemNetworkConnections(metrics::Meter *meter) -{ - return meter->CreateDoubleUpDownCounter(kMetricSystemNetworkConnections, + } + + static inline nostd::shared_ptr + CreateAsyncDoubleMetricSystemMemoryUtilization(metrics::Meter *meter) + { + return meter->CreateDoubleObservableGauge(kMetricSystemMemoryUtilization, + descrMetricSystemMemoryUtilization, + unitMetricSystemMemoryUtilization); + } + + /** + * updowncounter + */ + static constexpr const char *kMetricSystemNetworkConnections = "system.network.connections"; + static constexpr const char *descrMetricSystemNetworkConnections = ""; + static constexpr const char *unitMetricSystemNetworkConnections = "{connection}"; + + static inline nostd::unique_ptr> + CreateSyncInt64MetricSystemNetworkConnections(metrics::Meter *meter) + { + return meter->CreateInt64UpDownCounter(kMetricSystemNetworkConnections, descrMetricSystemNetworkConnections, unitMetricSystemNetworkConnections); -} - -static inline nostd::shared_ptr -CreateAsyncInt64MetricSystemNetworkConnections(metrics::Meter *meter) -{ - return meter->CreateInt64ObservableUpDownCounter(kMetricSystemNetworkConnections, - descrMetricSystemNetworkConnections, - unitMetricSystemNetworkConnections); -} - -static inline nostd::shared_ptr -CreateAsyncDoubleMetricSystemNetworkConnections(metrics::Meter *meter) -{ - return meter->CreateDoubleObservableUpDownCounter(kMetricSystemNetworkConnections, + } + + static inline nostd::unique_ptr> + CreateSyncDoubleMetricSystemNetworkConnections(metrics::Meter *meter) + { + return meter->CreateDoubleUpDownCounter(kMetricSystemNetworkConnections, + descrMetricSystemNetworkConnections, + unitMetricSystemNetworkConnections); + } + + static inline nostd::shared_ptr + CreateAsyncInt64MetricSystemNetworkConnections(metrics::Meter *meter) + { + return meter->CreateInt64ObservableUpDownCounter(kMetricSystemNetworkConnections, descrMetricSystemNetworkConnections, unitMetricSystemNetworkConnections); -} - -/** - * Count of packets that are dropped or discarded even though there was no error - *

                    - * Measured as: - *

                    - *

                    - * counter - */ -static constexpr const char *kMetricSystemNetworkDropped = "system.network.dropped"; -static constexpr const char *descrMetricSystemNetworkDropped = - "Count of packets that are dropped or discarded even though there was no error"; -static constexpr const char *unitMetricSystemNetworkDropped = "{packet}"; - -static inline nostd::unique_ptr> -CreateSyncInt64MetricSystemNetworkDropped(metrics::Meter *meter) -{ - return meter->CreateUInt64Counter(kMetricSystemNetworkDropped, descrMetricSystemNetworkDropped, - unitMetricSystemNetworkDropped); -} - -static inline nostd::unique_ptr> -CreateSyncDoubleMetricSystemNetworkDropped(metrics::Meter *meter) -{ - return meter->CreateDoubleCounter(kMetricSystemNetworkDropped, descrMetricSystemNetworkDropped, - unitMetricSystemNetworkDropped); -} - -static inline nostd::shared_ptr -CreateAsyncInt64MetricSystemNetworkDropped(metrics::Meter *meter) -{ - return meter->CreateInt64ObservableCounter( - kMetricSystemNetworkDropped, descrMetricSystemNetworkDropped, unitMetricSystemNetworkDropped); -} - -static inline nostd::shared_ptr -CreateAsyncDoubleMetricSystemNetworkDropped(metrics::Meter *meter) -{ - return meter->CreateDoubleObservableCounter( - kMetricSystemNetworkDropped, descrMetricSystemNetworkDropped, unitMetricSystemNetworkDropped); -} - -/** - * Count of network errors detected - *

                    - * Measured as: - *

                    - *

                    - * counter - */ -static constexpr const char *kMetricSystemNetworkErrors = "system.network.errors"; -static constexpr const char *descrMetricSystemNetworkErrors = "Count of network errors detected"; -static constexpr const char *unitMetricSystemNetworkErrors = "{error}"; - -static inline nostd::unique_ptr> -CreateSyncInt64MetricSystemNetworkErrors(metrics::Meter *meter) -{ - return meter->CreateUInt64Counter(kMetricSystemNetworkErrors, descrMetricSystemNetworkErrors, - unitMetricSystemNetworkErrors); -} - -static inline nostd::unique_ptr> CreateSyncDoubleMetricSystemNetworkErrors( - metrics::Meter *meter) -{ - return meter->CreateDoubleCounter(kMetricSystemNetworkErrors, descrMetricSystemNetworkErrors, - unitMetricSystemNetworkErrors); -} - -static inline nostd::shared_ptr -CreateAsyncInt64MetricSystemNetworkErrors(metrics::Meter *meter) -{ - return meter->CreateInt64ObservableCounter( - kMetricSystemNetworkErrors, descrMetricSystemNetworkErrors, unitMetricSystemNetworkErrors); -} - -static inline nostd::shared_ptr -CreateAsyncDoubleMetricSystemNetworkErrors(metrics::Meter *meter) -{ - return meter->CreateDoubleObservableCounter( - kMetricSystemNetworkErrors, descrMetricSystemNetworkErrors, unitMetricSystemNetworkErrors); -} - -/** - * counter - */ -static constexpr const char *kMetricSystemNetworkIo = "system.network.io"; -static constexpr const char *descrMetricSystemNetworkIo = ""; -static constexpr const char *unitMetricSystemNetworkIo = "By"; - -static inline nostd::unique_ptr> CreateSyncInt64MetricSystemNetworkIo( - metrics::Meter *meter) -{ - return meter->CreateUInt64Counter(kMetricSystemNetworkIo, descrMetricSystemNetworkIo, - unitMetricSystemNetworkIo); -} - -static inline nostd::unique_ptr> CreateSyncDoubleMetricSystemNetworkIo( - metrics::Meter *meter) -{ - return meter->CreateDoubleCounter(kMetricSystemNetworkIo, descrMetricSystemNetworkIo, - unitMetricSystemNetworkIo); -} - -static inline nostd::shared_ptr -CreateAsyncInt64MetricSystemNetworkIo(metrics::Meter *meter) -{ - return meter->CreateInt64ObservableCounter(kMetricSystemNetworkIo, descrMetricSystemNetworkIo, - unitMetricSystemNetworkIo); -} - -static inline nostd::shared_ptr -CreateAsyncDoubleMetricSystemNetworkIo(metrics::Meter *meter) -{ - return meter->CreateDoubleObservableCounter(kMetricSystemNetworkIo, descrMetricSystemNetworkIo, + } + + static inline nostd::shared_ptr + CreateAsyncDoubleMetricSystemNetworkConnections(metrics::Meter *meter) + { + return meter->CreateDoubleObservableUpDownCounter(kMetricSystemNetworkConnections, + descrMetricSystemNetworkConnections, + unitMetricSystemNetworkConnections); + } + + /** + * Count of packets that are dropped or discarded even though there was no error + *

                    + * Measured as: + *

                    + *

                    + * counter + */ + static constexpr const char *kMetricSystemNetworkDropped = "system.network.dropped"; + static constexpr const char *descrMetricSystemNetworkDropped = + "Count of packets that are dropped or discarded even though there was no error"; + static constexpr const char *unitMetricSystemNetworkDropped = "{packet}"; + + static inline nostd::unique_ptr> + CreateSyncInt64MetricSystemNetworkDropped(metrics::Meter *meter) + { + return meter->CreateUInt64Counter(kMetricSystemNetworkDropped, descrMetricSystemNetworkDropped, + unitMetricSystemNetworkDropped); + } + + static inline nostd::unique_ptr> + CreateSyncDoubleMetricSystemNetworkDropped(metrics::Meter *meter) + { + return meter->CreateDoubleCounter(kMetricSystemNetworkDropped, descrMetricSystemNetworkDropped, + unitMetricSystemNetworkDropped); + } + + static inline nostd::shared_ptr + CreateAsyncInt64MetricSystemNetworkDropped(metrics::Meter *meter) + { + return meter->CreateInt64ObservableCounter( + kMetricSystemNetworkDropped, descrMetricSystemNetworkDropped, unitMetricSystemNetworkDropped); + } + + static inline nostd::shared_ptr + CreateAsyncDoubleMetricSystemNetworkDropped(metrics::Meter *meter) + { + return meter->CreateDoubleObservableCounter( + kMetricSystemNetworkDropped, descrMetricSystemNetworkDropped, unitMetricSystemNetworkDropped); + } + + /** + * Count of network errors detected + *

                    + * Measured as: + *

                    + *

                    + * counter + */ + static constexpr const char *kMetricSystemNetworkErrors = "system.network.errors"; + static constexpr const char *descrMetricSystemNetworkErrors = "Count of network errors detected"; + static constexpr const char *unitMetricSystemNetworkErrors = "{error}"; + + static inline nostd::unique_ptr> + CreateSyncInt64MetricSystemNetworkErrors(metrics::Meter *meter) + { + return meter->CreateUInt64Counter(kMetricSystemNetworkErrors, descrMetricSystemNetworkErrors, + unitMetricSystemNetworkErrors); + } + + static inline nostd::unique_ptr> CreateSyncDoubleMetricSystemNetworkErrors( + metrics::Meter *meter) + { + return meter->CreateDoubleCounter(kMetricSystemNetworkErrors, descrMetricSystemNetworkErrors, + unitMetricSystemNetworkErrors); + } + + static inline nostd::shared_ptr + CreateAsyncInt64MetricSystemNetworkErrors(metrics::Meter *meter) + { + return meter->CreateInt64ObservableCounter( + kMetricSystemNetworkErrors, descrMetricSystemNetworkErrors, unitMetricSystemNetworkErrors); + } + + static inline nostd::shared_ptr + CreateAsyncDoubleMetricSystemNetworkErrors(metrics::Meter *meter) + { + return meter->CreateDoubleObservableCounter( + kMetricSystemNetworkErrors, descrMetricSystemNetworkErrors, unitMetricSystemNetworkErrors); + } + + /** + * counter + */ + static constexpr const char *kMetricSystemNetworkIo = "system.network.io"; + static constexpr const char *descrMetricSystemNetworkIo = ""; + static constexpr const char *unitMetricSystemNetworkIo = "By"; + + static inline nostd::unique_ptr> CreateSyncInt64MetricSystemNetworkIo( + metrics::Meter *meter) + { + return meter->CreateUInt64Counter(kMetricSystemNetworkIo, descrMetricSystemNetworkIo, + unitMetricSystemNetworkIo); + } + + static inline nostd::unique_ptr> CreateSyncDoubleMetricSystemNetworkIo( + metrics::Meter *meter) + { + return meter->CreateDoubleCounter(kMetricSystemNetworkIo, descrMetricSystemNetworkIo, + unitMetricSystemNetworkIo); + } + + static inline nostd::shared_ptr + CreateAsyncInt64MetricSystemNetworkIo(metrics::Meter *meter) + { + return meter->CreateInt64ObservableCounter(kMetricSystemNetworkIo, descrMetricSystemNetworkIo, unitMetricSystemNetworkIo); -} - -/** - * counter - */ -static constexpr const char *kMetricSystemNetworkPackets = "system.network.packets"; -static constexpr const char *descrMetricSystemNetworkPackets = ""; -static constexpr const char *unitMetricSystemNetworkPackets = "{packet}"; - -static inline nostd::unique_ptr> -CreateSyncInt64MetricSystemNetworkPackets(metrics::Meter *meter) -{ - return meter->CreateUInt64Counter(kMetricSystemNetworkPackets, descrMetricSystemNetworkPackets, - unitMetricSystemNetworkPackets); -} - -static inline nostd::unique_ptr> -CreateSyncDoubleMetricSystemNetworkPackets(metrics::Meter *meter) -{ - return meter->CreateDoubleCounter(kMetricSystemNetworkPackets, descrMetricSystemNetworkPackets, - unitMetricSystemNetworkPackets); -} - -static inline nostd::shared_ptr -CreateAsyncInt64MetricSystemNetworkPackets(metrics::Meter *meter) -{ - return meter->CreateInt64ObservableCounter( - kMetricSystemNetworkPackets, descrMetricSystemNetworkPackets, unitMetricSystemNetworkPackets); -} - -static inline nostd::shared_ptr -CreateAsyncDoubleMetricSystemNetworkPackets(metrics::Meter *meter) -{ - return meter->CreateDoubleObservableCounter( - kMetricSystemNetworkPackets, descrMetricSystemNetworkPackets, unitMetricSystemNetworkPackets); -} - -/** - * counter - */ -static constexpr const char *kMetricSystemPagingFaults = "system.paging.faults"; -static constexpr const char *descrMetricSystemPagingFaults = ""; -static constexpr const char *unitMetricSystemPagingFaults = "{fault}"; - -static inline nostd::unique_ptr> CreateSyncInt64MetricSystemPagingFaults( - metrics::Meter *meter) -{ - return meter->CreateUInt64Counter(kMetricSystemPagingFaults, descrMetricSystemPagingFaults, - unitMetricSystemPagingFaults); -} - -static inline nostd::unique_ptr> CreateSyncDoubleMetricSystemPagingFaults( - metrics::Meter *meter) -{ - return meter->CreateDoubleCounter(kMetricSystemPagingFaults, descrMetricSystemPagingFaults, - unitMetricSystemPagingFaults); -} - -static inline nostd::shared_ptr -CreateAsyncInt64MetricSystemPagingFaults(metrics::Meter *meter) -{ - return meter->CreateInt64ObservableCounter( - kMetricSystemPagingFaults, descrMetricSystemPagingFaults, unitMetricSystemPagingFaults); -} - -static inline nostd::shared_ptr -CreateAsyncDoubleMetricSystemPagingFaults(metrics::Meter *meter) -{ - return meter->CreateDoubleObservableCounter( - kMetricSystemPagingFaults, descrMetricSystemPagingFaults, unitMetricSystemPagingFaults); -} - -/** - * counter - */ -static constexpr const char *kMetricSystemPagingOperations = "system.paging.operations"; -static constexpr const char *descrMetricSystemPagingOperations = ""; -static constexpr const char *unitMetricSystemPagingOperations = "{operation}"; - -static inline nostd::unique_ptr> -CreateSyncInt64MetricSystemPagingOperations(metrics::Meter *meter) -{ - return meter->CreateUInt64Counter(kMetricSystemPagingOperations, - descrMetricSystemPagingOperations, - unitMetricSystemPagingOperations); -} - -static inline nostd::unique_ptr> -CreateSyncDoubleMetricSystemPagingOperations(metrics::Meter *meter) -{ - return meter->CreateDoubleCounter(kMetricSystemPagingOperations, - descrMetricSystemPagingOperations, - unitMetricSystemPagingOperations); -} - -static inline nostd::shared_ptr -CreateAsyncInt64MetricSystemPagingOperations(metrics::Meter *meter) -{ - return meter->CreateInt64ObservableCounter(kMetricSystemPagingOperations, - descrMetricSystemPagingOperations, - unitMetricSystemPagingOperations); -} - -static inline nostd::shared_ptr -CreateAsyncDoubleMetricSystemPagingOperations(metrics::Meter *meter) -{ - return meter->CreateDoubleObservableCounter(kMetricSystemPagingOperations, + } + + static inline nostd::shared_ptr + CreateAsyncDoubleMetricSystemNetworkIo(metrics::Meter *meter) + { + return meter->CreateDoubleObservableCounter(kMetricSystemNetworkIo, descrMetricSystemNetworkIo, + unitMetricSystemNetworkIo); + } + + /** + * counter + */ + static constexpr const char *kMetricSystemNetworkPackets = "system.network.packets"; + static constexpr const char *descrMetricSystemNetworkPackets = ""; + static constexpr const char *unitMetricSystemNetworkPackets = "{packet}"; + + static inline nostd::unique_ptr> + CreateSyncInt64MetricSystemNetworkPackets(metrics::Meter *meter) + { + return meter->CreateUInt64Counter(kMetricSystemNetworkPackets, descrMetricSystemNetworkPackets, + unitMetricSystemNetworkPackets); + } + + static inline nostd::unique_ptr> + CreateSyncDoubleMetricSystemNetworkPackets(metrics::Meter *meter) + { + return meter->CreateDoubleCounter(kMetricSystemNetworkPackets, descrMetricSystemNetworkPackets, + unitMetricSystemNetworkPackets); + } + + static inline nostd::shared_ptr + CreateAsyncInt64MetricSystemNetworkPackets(metrics::Meter *meter) + { + return meter->CreateInt64ObservableCounter( + kMetricSystemNetworkPackets, descrMetricSystemNetworkPackets, unitMetricSystemNetworkPackets); + } + + static inline nostd::shared_ptr + CreateAsyncDoubleMetricSystemNetworkPackets(metrics::Meter *meter) + { + return meter->CreateDoubleObservableCounter( + kMetricSystemNetworkPackets, descrMetricSystemNetworkPackets, unitMetricSystemNetworkPackets); + } + + /** + * counter + */ + static constexpr const char *kMetricSystemPagingFaults = "system.paging.faults"; + static constexpr const char *descrMetricSystemPagingFaults = ""; + static constexpr const char *unitMetricSystemPagingFaults = "{fault}"; + + static inline nostd::unique_ptr> CreateSyncInt64MetricSystemPagingFaults( + metrics::Meter *meter) + { + return meter->CreateUInt64Counter(kMetricSystemPagingFaults, descrMetricSystemPagingFaults, + unitMetricSystemPagingFaults); + } + + static inline nostd::unique_ptr> CreateSyncDoubleMetricSystemPagingFaults( + metrics::Meter *meter) + { + return meter->CreateDoubleCounter(kMetricSystemPagingFaults, descrMetricSystemPagingFaults, + unitMetricSystemPagingFaults); + } + + static inline nostd::shared_ptr + CreateAsyncInt64MetricSystemPagingFaults(metrics::Meter *meter) + { + return meter->CreateInt64ObservableCounter( + kMetricSystemPagingFaults, descrMetricSystemPagingFaults, unitMetricSystemPagingFaults); + } + + static inline nostd::shared_ptr + CreateAsyncDoubleMetricSystemPagingFaults(metrics::Meter *meter) + { + return meter->CreateDoubleObservableCounter( + kMetricSystemPagingFaults, descrMetricSystemPagingFaults, unitMetricSystemPagingFaults); + } + + /** + * counter + */ + static constexpr const char *kMetricSystemPagingOperations = "system.paging.operations"; + static constexpr const char *descrMetricSystemPagingOperations = ""; + static constexpr const char *unitMetricSystemPagingOperations = "{operation}"; + + static inline nostd::unique_ptr> + CreateSyncInt64MetricSystemPagingOperations(metrics::Meter *meter) + { + return meter->CreateUInt64Counter(kMetricSystemPagingOperations, + descrMetricSystemPagingOperations, + unitMetricSystemPagingOperations); + } + + static inline nostd::unique_ptr> + CreateSyncDoubleMetricSystemPagingOperations(metrics::Meter *meter) + { + return meter->CreateDoubleCounter(kMetricSystemPagingOperations, + descrMetricSystemPagingOperations, + unitMetricSystemPagingOperations); + } + + static inline nostd::shared_ptr + CreateAsyncInt64MetricSystemPagingOperations(metrics::Meter *meter) + { + return meter->CreateInt64ObservableCounter(kMetricSystemPagingOperations, descrMetricSystemPagingOperations, unitMetricSystemPagingOperations); -} - -/** - * Unix swap or windows pagefile usage - *

                    - * updowncounter - */ -static constexpr const char *kMetricSystemPagingUsage = "system.paging.usage"; -static constexpr const char *descrMetricSystemPagingUsage = "Unix swap or windows pagefile usage"; -static constexpr const char *unitMetricSystemPagingUsage = "By"; - -static inline nostd::unique_ptr> -CreateSyncInt64MetricSystemPagingUsage(metrics::Meter *meter) -{ - return meter->CreateInt64UpDownCounter(kMetricSystemPagingUsage, descrMetricSystemPagingUsage, - unitMetricSystemPagingUsage); -} - -static inline nostd::unique_ptr> -CreateSyncDoubleMetricSystemPagingUsage(metrics::Meter *meter) -{ - return meter->CreateDoubleUpDownCounter(kMetricSystemPagingUsage, descrMetricSystemPagingUsage, + } + + static inline nostd::shared_ptr + CreateAsyncDoubleMetricSystemPagingOperations(metrics::Meter *meter) + { + return meter->CreateDoubleObservableCounter(kMetricSystemPagingOperations, + descrMetricSystemPagingOperations, + unitMetricSystemPagingOperations); + } + + /** + * Unix swap or windows pagefile usage + *

                    + * updowncounter + */ + static constexpr const char *kMetricSystemPagingUsage = "system.paging.usage"; + static constexpr const char *descrMetricSystemPagingUsage = "Unix swap or windows pagefile usage"; + static constexpr const char *unitMetricSystemPagingUsage = "By"; + + static inline nostd::unique_ptr> + CreateSyncInt64MetricSystemPagingUsage(metrics::Meter *meter) + { + return meter->CreateInt64UpDownCounter(kMetricSystemPagingUsage, descrMetricSystemPagingUsage, unitMetricSystemPagingUsage); -} - -static inline nostd::shared_ptr -CreateAsyncInt64MetricSystemPagingUsage(metrics::Meter *meter) -{ - return meter->CreateInt64ObservableUpDownCounter( - kMetricSystemPagingUsage, descrMetricSystemPagingUsage, unitMetricSystemPagingUsage); -} - -static inline nostd::shared_ptr -CreateAsyncDoubleMetricSystemPagingUsage(metrics::Meter *meter) -{ - return meter->CreateDoubleObservableUpDownCounter( - kMetricSystemPagingUsage, descrMetricSystemPagingUsage, unitMetricSystemPagingUsage); -} - -/** - * gauge - */ -static constexpr const char *kMetricSystemPagingUtilization = "system.paging.utilization"; -static constexpr const char *descrMetricSystemPagingUtilization = ""; -static constexpr const char *unitMetricSystemPagingUtilization = "1"; - -#if OPENTELEMETRY_ABI_VERSION_NO >= 2 - -static inline nostd::unique_ptr> -CreateSyncInt64MetricSystemPagingUtilization(metrics::Meter *meter) -{ - return meter->CreateInt64Gauge(kMetricSystemPagingUtilization, descrMetricSystemPagingUtilization, - unitMetricSystemPagingUtilization); -} - -static inline nostd::unique_ptr> -CreateSyncDoubleMetricSystemPagingUtilization(metrics::Meter *meter) -{ - return meter->CreateDoubleGauge(kMetricSystemPagingUtilization, - descrMetricSystemPagingUtilization, + } + + static inline nostd::unique_ptr> + CreateSyncDoubleMetricSystemPagingUsage(metrics::Meter *meter) + { + return meter->CreateDoubleUpDownCounter(kMetricSystemPagingUsage, descrMetricSystemPagingUsage, + unitMetricSystemPagingUsage); + } + + static inline nostd::shared_ptr + CreateAsyncInt64MetricSystemPagingUsage(metrics::Meter *meter) + { + return meter->CreateInt64ObservableUpDownCounter( + kMetricSystemPagingUsage, descrMetricSystemPagingUsage, unitMetricSystemPagingUsage); + } + + static inline nostd::shared_ptr + CreateAsyncDoubleMetricSystemPagingUsage(metrics::Meter *meter) + { + return meter->CreateDoubleObservableUpDownCounter( + kMetricSystemPagingUsage, descrMetricSystemPagingUsage, unitMetricSystemPagingUsage); + } + + /** + * gauge + */ + static constexpr const char *kMetricSystemPagingUtilization = "system.paging.utilization"; + static constexpr const char *descrMetricSystemPagingUtilization = ""; + static constexpr const char *unitMetricSystemPagingUtilization = "1"; + + #if OPENTELEMETRY_ABI_VERSION_NO >= 2 + + static inline nostd::unique_ptr> + CreateSyncInt64MetricSystemPagingUtilization(metrics::Meter *meter) + { + return meter->CreateInt64Gauge(kMetricSystemPagingUtilization, descrMetricSystemPagingUtilization, unitMetricSystemPagingUtilization); -} -#endif /* OPENTELEMETRY_ABI_VERSION_NO */ - -static inline nostd::shared_ptr -CreateAsyncInt64MetricSystemPagingUtilization(metrics::Meter *meter) -{ - return meter->CreateInt64ObservableGauge(kMetricSystemPagingUtilization, - descrMetricSystemPagingUtilization, - unitMetricSystemPagingUtilization); -} - -static inline nostd::shared_ptr -CreateAsyncDoubleMetricSystemPagingUtilization(metrics::Meter *meter) -{ - return meter->CreateDoubleObservableGauge(kMetricSystemPagingUtilization, + } + + static inline nostd::unique_ptr> + CreateSyncDoubleMetricSystemPagingUtilization(metrics::Meter *meter) + { + return meter->CreateDoubleGauge(kMetricSystemPagingUtilization, + descrMetricSystemPagingUtilization, + unitMetricSystemPagingUtilization); + } + #endif /* OPENTELEMETRY_ABI_VERSION_NO */ + + static inline nostd::shared_ptr + CreateAsyncInt64MetricSystemPagingUtilization(metrics::Meter *meter) + { + return meter->CreateInt64ObservableGauge(kMetricSystemPagingUtilization, descrMetricSystemPagingUtilization, unitMetricSystemPagingUtilization); -} - -/** - * Total number of processes in each state - *

                    - * updowncounter - */ -static constexpr const char *kMetricSystemProcessCount = "system.process.count"; -static constexpr const char *descrMetricSystemProcessCount = - "Total number of processes in each state"; -static constexpr const char *unitMetricSystemProcessCount = "{process}"; - -static inline nostd::unique_ptr> -CreateSyncInt64MetricSystemProcessCount(metrics::Meter *meter) -{ - return meter->CreateInt64UpDownCounter(kMetricSystemProcessCount, descrMetricSystemProcessCount, - unitMetricSystemProcessCount); -} - -static inline nostd::unique_ptr> -CreateSyncDoubleMetricSystemProcessCount(metrics::Meter *meter) -{ - return meter->CreateDoubleUpDownCounter(kMetricSystemProcessCount, descrMetricSystemProcessCount, + } + + static inline nostd::shared_ptr + CreateAsyncDoubleMetricSystemPagingUtilization(metrics::Meter *meter) + { + return meter->CreateDoubleObservableGauge(kMetricSystemPagingUtilization, + descrMetricSystemPagingUtilization, + unitMetricSystemPagingUtilization); + } + + /** + * Total number of processes in each state + *

                    + * updowncounter + */ + static constexpr const char *kMetricSystemProcessCount = "system.process.count"; + static constexpr const char *descrMetricSystemProcessCount = + "Total number of processes in each state"; + static constexpr const char *unitMetricSystemProcessCount = "{process}"; + + static inline nostd::unique_ptr> + CreateSyncInt64MetricSystemProcessCount(metrics::Meter *meter) + { + return meter->CreateInt64UpDownCounter(kMetricSystemProcessCount, descrMetricSystemProcessCount, unitMetricSystemProcessCount); -} - -static inline nostd::shared_ptr -CreateAsyncInt64MetricSystemProcessCount(metrics::Meter *meter) -{ - return meter->CreateInt64ObservableUpDownCounter( - kMetricSystemProcessCount, descrMetricSystemProcessCount, unitMetricSystemProcessCount); -} - -static inline nostd::shared_ptr -CreateAsyncDoubleMetricSystemProcessCount(metrics::Meter *meter) -{ - return meter->CreateDoubleObservableUpDownCounter( - kMetricSystemProcessCount, descrMetricSystemProcessCount, unitMetricSystemProcessCount); -} - -/** - * Total number of processes created over uptime of the host - *

                    - * counter - */ -static constexpr const char *kMetricSystemProcessCreated = "system.process.created"; -static constexpr const char *descrMetricSystemProcessCreated = - "Total number of processes created over uptime of the host"; -static constexpr const char *unitMetricSystemProcessCreated = "{process}"; - -static inline nostd::unique_ptr> -CreateSyncInt64MetricSystemProcessCreated(metrics::Meter *meter) -{ - return meter->CreateUInt64Counter(kMetricSystemProcessCreated, descrMetricSystemProcessCreated, - unitMetricSystemProcessCreated); -} - -static inline nostd::unique_ptr> -CreateSyncDoubleMetricSystemProcessCreated(metrics::Meter *meter) -{ - return meter->CreateDoubleCounter(kMetricSystemProcessCreated, descrMetricSystemProcessCreated, - unitMetricSystemProcessCreated); -} - -static inline nostd::shared_ptr -CreateAsyncInt64MetricSystemProcessCreated(metrics::Meter *meter) -{ - return meter->CreateInt64ObservableCounter( - kMetricSystemProcessCreated, descrMetricSystemProcessCreated, unitMetricSystemProcessCreated); -} - -static inline nostd::shared_ptr -CreateAsyncDoubleMetricSystemProcessCreated(metrics::Meter *meter) -{ - return meter->CreateDoubleObservableCounter( - kMetricSystemProcessCreated, descrMetricSystemProcessCreated, unitMetricSystemProcessCreated); -} - -/** - * The time the system has been running - *

                    - * Instrumentations SHOULD use a gauge with type @code double @endcode and measure uptime in seconds - * as a floating point number with the highest precision available. The actual accuracy would depend - * on the instrumentation and operating system.

                    gauge - */ -static constexpr const char *kMetricSystemUptime = "system.uptime"; -static constexpr const char *descrMetricSystemUptime = "The time the system has been running"; -static constexpr const char *unitMetricSystemUptime = "s"; - -#if OPENTELEMETRY_ABI_VERSION_NO >= 2 - -static inline nostd::unique_ptr> CreateSyncInt64MetricSystemUptime( - metrics::Meter *meter) -{ - return meter->CreateInt64Gauge(kMetricSystemUptime, descrMetricSystemUptime, - unitMetricSystemUptime); -} - -static inline nostd::unique_ptr> CreateSyncDoubleMetricSystemUptime( - metrics::Meter *meter) -{ - return meter->CreateDoubleGauge(kMetricSystemUptime, descrMetricSystemUptime, + } + + static inline nostd::unique_ptr> + CreateSyncDoubleMetricSystemProcessCount(metrics::Meter *meter) + { + return meter->CreateDoubleUpDownCounter(kMetricSystemProcessCount, descrMetricSystemProcessCount, + unitMetricSystemProcessCount); + } + + static inline nostd::shared_ptr + CreateAsyncInt64MetricSystemProcessCount(metrics::Meter *meter) + { + return meter->CreateInt64ObservableUpDownCounter( + kMetricSystemProcessCount, descrMetricSystemProcessCount, unitMetricSystemProcessCount); + } + + static inline nostd::shared_ptr + CreateAsyncDoubleMetricSystemProcessCount(metrics::Meter *meter) + { + return meter->CreateDoubleObservableUpDownCounter( + kMetricSystemProcessCount, descrMetricSystemProcessCount, unitMetricSystemProcessCount); + } + + /** + * Total number of processes created over uptime of the host + *

                    + * counter + */ + static constexpr const char *kMetricSystemProcessCreated = "system.process.created"; + static constexpr const char *descrMetricSystemProcessCreated = + "Total number of processes created over uptime of the host"; + static constexpr const char *unitMetricSystemProcessCreated = "{process}"; + + static inline nostd::unique_ptr> + CreateSyncInt64MetricSystemProcessCreated(metrics::Meter *meter) + { + return meter->CreateUInt64Counter(kMetricSystemProcessCreated, descrMetricSystemProcessCreated, + unitMetricSystemProcessCreated); + } + + static inline nostd::unique_ptr> + CreateSyncDoubleMetricSystemProcessCreated(metrics::Meter *meter) + { + return meter->CreateDoubleCounter(kMetricSystemProcessCreated, descrMetricSystemProcessCreated, + unitMetricSystemProcessCreated); + } + + static inline nostd::shared_ptr + CreateAsyncInt64MetricSystemProcessCreated(metrics::Meter *meter) + { + return meter->CreateInt64ObservableCounter( + kMetricSystemProcessCreated, descrMetricSystemProcessCreated, unitMetricSystemProcessCreated); + } + + static inline nostd::shared_ptr + CreateAsyncDoubleMetricSystemProcessCreated(metrics::Meter *meter) + { + return meter->CreateDoubleObservableCounter( + kMetricSystemProcessCreated, descrMetricSystemProcessCreated, unitMetricSystemProcessCreated); + } + + /** + * The time the system has been running + *

                    + * Instrumentations SHOULD use a gauge with type @code double @endcode and measure uptime in seconds + * as a floating point number with the highest precision available. The actual accuracy would depend + * on the instrumentation and operating system.

                    gauge + */ + static constexpr const char *kMetricSystemUptime = "system.uptime"; + static constexpr const char *descrMetricSystemUptime = "The time the system has been running"; + static constexpr const char *unitMetricSystemUptime = "s"; + + #if OPENTELEMETRY_ABI_VERSION_NO >= 2 + + static inline nostd::unique_ptr> CreateSyncInt64MetricSystemUptime( + metrics::Meter *meter) + { + return meter->CreateInt64Gauge(kMetricSystemUptime, descrMetricSystemUptime, unitMetricSystemUptime); -} -#endif /* OPENTELEMETRY_ABI_VERSION_NO */ - -static inline nostd::shared_ptr CreateAsyncInt64MetricSystemUptime( - metrics::Meter *meter) -{ - return meter->CreateInt64ObservableGauge(kMetricSystemUptime, descrMetricSystemUptime, - unitMetricSystemUptime); -} - -static inline nostd::shared_ptr CreateAsyncDoubleMetricSystemUptime( - metrics::Meter *meter) -{ - return meter->CreateDoubleObservableGauge(kMetricSystemUptime, descrMetricSystemUptime, + } + + static inline nostd::unique_ptr> CreateSyncDoubleMetricSystemUptime( + metrics::Meter *meter) + { + return meter->CreateDoubleGauge(kMetricSystemUptime, descrMetricSystemUptime, + unitMetricSystemUptime); + } + #endif /* OPENTELEMETRY_ABI_VERSION_NO */ + + static inline nostd::shared_ptr CreateAsyncInt64MetricSystemUptime( + metrics::Meter *meter) + { + return meter->CreateInt64ObservableGauge(kMetricSystemUptime, descrMetricSystemUptime, unitMetricSystemUptime); -} - -} // namespace system -} // namespace semconv -OPENTELEMETRY_END_NAMESPACE + } + + static inline nostd::shared_ptr CreateAsyncDoubleMetricSystemUptime( + metrics::Meter *meter) + { + return meter->CreateDoubleObservableGauge(kMetricSystemUptime, descrMetricSystemUptime, + unitMetricSystemUptime); + } + + } // namespace system + } // namespace semconv + OPENTELEMETRY_END_NAMESPACE \ No newline at end of file diff --git a/api/include/opentelemetry/semconv/incubating/url_attributes.h b/api/include/opentelemetry/semconv/incubating/url_attributes.h index c8aeae4e8d..c6584d50fd 100644 --- a/api/include/opentelemetry/semconv/incubating/url_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/url_attributes.h @@ -8,160 +8,166 @@ * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 */ -#pragma once - -#include "opentelemetry/common/macros.h" -#include "opentelemetry/version.h" - -OPENTELEMETRY_BEGIN_NAMESPACE -namespace semconv -{ -namespace url -{ - -/** - * Domain extracted from the @code url.full @endcode, such as "opentelemetry.io". - *

                    - * In some cases a URL may refer to an IP and/or port directly, without a domain name. In this case, - * the IP address would go to the domain field. If the URL contains a - * literal IPv6 address enclosed by - * @code [ @endcode and @code ] @endcode, the @code [ @endcode and @code ] @endcode characters - * should also be captured in the domain field. - */ -static constexpr const char *kUrlDomain = "url.domain"; - -/** - * The file extension extracted from the @code url.full @endcode, excluding the leading dot. - *

                    - * The file extension is only set if it exists, as not every url has a file extension. When the file - * name has multiple extensions @code example.tar.gz @endcode, only the last one should be captured - * @code gz @endcode, not @code tar.gz @endcode. - */ -static constexpr const char *kUrlExtension = "url.extension"; - -/** - * The URI fragment component - */ -static constexpr const char *kUrlFragment = "url.fragment"; - -/** - * Absolute URL describing a network resource according to - * RFC3986

                    For network calls, URL usually has - * @code scheme://host[:port][path][?query][#fragment] @endcode format, where the fragment is not - * transmitted over HTTP, but if it is known, it SHOULD be included nevertheless.

                    - * @code url.full @endcode MUST NOT contain credentials passed via URL in form of @code - * https://username:password@www.example.com/ @endcode. In such case username and password SHOULD be - * redacted and attribute's value SHOULD be @code https://REDACTED:REDACTED@www.example.com/ - * @endcode.

                    - * @code url.full @endcode SHOULD capture the absolute URL when it is available (or can be - * reconstructed).

                    Sensitive content provided in @code url.full @endcode SHOULD be scrubbed when - * instrumentations can identify it.

                    - * - * Query string values for the following keys SHOULD be redacted by default and replaced by the - * value @code REDACTED @endcode: - *

                    - *

                    - * This list is subject to change over time. - *

                    - * When a query string value is redacted, the query string key SHOULD still be preserved, e.g. - * @code https://www.example.com/path?color=blue&sig=REDACTED @endcode. - */ -static constexpr const char *kUrlFull = "url.full"; - -/** - * Unmodified original URL as seen in the event source. - *

                    - * In network monitoring, the observed URL may be a full URL, whereas in access logs, the URL is - * often just represented as a path. This field is meant to represent the URL as it was observed, - * complete or not. - * @code url.original @endcode might contain credentials passed via URL in form of @code - * https://username:password@www.example.com/ @endcode. In such case password and username SHOULD - * NOT be redacted and attribute's value SHOULD remain the same. - */ -static constexpr const char *kUrlOriginal = "url.original"; - -/** - * The URI path component - *

                    - * Sensitive content provided in @code url.path @endcode SHOULD be scrubbed when instrumentations - * can identify it. - */ -static constexpr const char *kUrlPath = "url.path"; - -/** - * Port extracted from the @code url.full @endcode - */ -static constexpr const char *kUrlPort = "url.port"; - -/** - * The URI query component - *

                    - * Sensitive content provided in @code url.query @endcode SHOULD be scrubbed when instrumentations - * can identify it.

                    - * - * Query string values for the following keys SHOULD be redacted by default and replaced by the - * value @code REDACTED @endcode:

                    - *

                    - * This list is subject to change over time. - *

                    - * When a query string value is redacted, the query string key SHOULD still be preserved, e.g. - * @code q=OpenTelemetry&sig=REDACTED @endcode. - */ -static constexpr const char *kUrlQuery = "url.query"; - -/** - * The highest registered url domain, stripped of the subdomain. - *

                    - * This value can be determined precisely with the - * public suffix list. - * For example, the registered domain for @code foo.example.com @endcode is @code - * example.com @endcode. Trying to approximate this by simply taking the last two labels will not - * work well for TLDs such as @code co.uk @endcode. - */ -static constexpr const char *kUrlRegisteredDomain = "url.registered_domain"; - -/** - * The URI scheme component - * identifying the used protocol. - */ -static constexpr const char *kUrlScheme = "url.scheme"; - -/** - * The subdomain portion of a fully qualified domain name includes all of the names except the host - * name under the registered_domain. In a partially qualified domain, or if the qualification level - * of the full name cannot be determined, subdomain contains all of the names below the registered - * domain.

                    The subdomain portion of @code www.east.mydomain.co.uk @endcode is @code east - * @endcode. If the domain has multiple levels of subdomain, such as @code sub2.sub1.example.com - * @endcode, the subdomain field should contain @code sub2.sub1 @endcode, with no trailing period. - */ -static constexpr const char *kUrlSubdomain = "url.subdomain"; - -/** - * The low-cardinality template of an - * absolute path reference. - */ -static constexpr const char *kUrlTemplate = "url.template"; - -/** - * The effective top level domain (eTLD), also known as the domain suffix, is the last part of the - * domain name. For example, the top level domain for example.com is @code com @endcode.

                    This - * value can be determined precisely with the - * public suffix list. - */ -static constexpr const char *kUrlTopLevelDomain = "url.top_level_domain"; - -} // namespace url -} // namespace semconv -OPENTELEMETRY_END_NAMESPACE + #pragma once + + #include "opentelemetry/common/macros.h" + #include "opentelemetry/version.h" + + OPENTELEMETRY_BEGIN_NAMESPACE + namespace semconv + { + namespace url + { + + /** + * Domain extracted from the @code url.full @endcode, such as "opentelemetry.io". + *

                    + * In some cases a URL may refer to an IP and/or port directly, without a domain name. In this case, + * the IP address would go to the domain field. If the URL contains a literal IPv6 address enclosed by + * @code [ @endcode and @code ] @endcode, the @code [ @endcode and @code ] @endcode characters + * should also be captured in the domain field. + */ + static constexpr const char *kUrlDomain = "url.domain"; + + /** + * The file extension extracted from the @code url.full @endcode, excluding the leading dot. + *

                    + * The file extension is only set if it exists, as not every url has a file extension. When the file + * name has multiple extensions @code example.tar.gz @endcode, only the last one should be captured + * @code gz @endcode, not @code tar.gz @endcode. + */ + static constexpr const char *kUrlExtension = "url.extension"; + + /** + * The URI fragment component + */ + static constexpr const char *kUrlFragment = "url.fragment"; + + /** + * Absolute URL describing a network resource according to RFC3986

                    For network calls, URL usually has + * @code scheme://host[:port][path][?query][#fragment] @endcode format, where the fragment is not + * transmitted over HTTP, but if it is known, it SHOULD be included nevertheless.

                    + * @code url.full @endcode MUST NOT contain credentials passed via URL in form of @code + * https://username:password@www.example.com/ @endcode. In such case username and password SHOULD be + * redacted and attribute's value SHOULD be @code https://REDACTED:REDACTED@www.example.com/ + * @endcode.

                    + * @code url.full @endcode SHOULD capture the absolute URL when it is available (or can be + * reconstructed).

                    Sensitive content provided in @code url.full @endcode SHOULD be scrubbed when + * instrumentations can identify it.

                    + * + * Query string values for the following keys SHOULD be redacted by default and replaced by the + * value @code REDACTED @endcode: + *

                    + *

                    + * This list is subject to change over time. + *

                    + * When a query string value is redacted, the query string key SHOULD still be preserved, e.g. + * @code https://www.example.com/path?color=blue&sig=REDACTED @endcode. + */ + static constexpr const char *kUrlFull = "url.full"; + + /** + * Unmodified original URL as seen in the event source. + *

                    + * In network monitoring, the observed URL may be a full URL, whereas in access logs, the URL is + * often just represented as a path. This field is meant to represent the URL as it was observed, + * complete or not. + * @code url.original @endcode might contain credentials passed via URL in form of @code + * https://username:password@www.example.com/ @endcode. In such case password and username SHOULD + * NOT be redacted and attribute's value SHOULD remain the same. + */ + static constexpr const char *kUrlOriginal = "url.original"; + + /** + * The URI path component + *

                    + * Sensitive content provided in @code url.path @endcode SHOULD be scrubbed when instrumentations + * can identify it. + */ + static constexpr const char *kUrlPath = "url.path"; + + /** + * Port extracted from the @code url.full @endcode + */ + static constexpr const char *kUrlPort = "url.port"; + + /** + * The URI query component + *

                    + * Sensitive content provided in @code url.query @endcode SHOULD be scrubbed when instrumentations + * can identify it.

                    + * + * Query string values for the following keys SHOULD be redacted by default and replaced by the + * value @code REDACTED @endcode:

                    + *

                    + * This list is subject to change over time. + *

                    + * When a query string value is redacted, the query string key SHOULD still be preserved, e.g. + * @code q=OpenTelemetry&sig=REDACTED @endcode. + */ + static constexpr const char *kUrlQuery = "url.query"; + + /** + * The highest registered url domain, stripped of the subdomain. + *

                    + * This value can be determined precisely with the public suffix + * list. For example, the registered domain for @code foo.example.com @endcode is @code + * example.com @endcode. Trying to approximate this by simply taking the last two labels will not + * work well for TLDs such as @code co.uk @endcode. + */ + static constexpr const char *kUrlRegisteredDomain = "url.registered_domain"; + + /** + * The URI scheme component + * identifying the used protocol. + */ + static constexpr const char *kUrlScheme = "url.scheme"; + + /** + * The subdomain portion of a fully qualified domain name includes all of the names except the host + * name under the registered_domain. In a partially qualified domain, or if the qualification level + * of the full name cannot be determined, subdomain contains all of the names below the registered + * domain.

                    The subdomain portion of @code www.east.mydomain.co.uk @endcode is @code east + * @endcode. If the domain has multiple levels of subdomain, such as @code sub2.sub1.example.com + * @endcode, the subdomain field should contain @code sub2.sub1 @endcode, with no trailing period. + */ + static constexpr const char *kUrlSubdomain = "url.subdomain"; + + /** + * The low-cardinality template of an absolute path reference. + */ + static constexpr const char *kUrlTemplate = "url.template"; + + /** + * The effective top level domain (eTLD), also known as the domain suffix, is the last part of the + * domain name. For example, the top level domain for example.com is @code com @endcode.

                    This + * value can be determined precisely with the public suffix + * list. + */ + static constexpr const char *kUrlTopLevelDomain = "url.top_level_domain"; + + } // namespace url + } // namespace semconv + OPENTELEMETRY_END_NAMESPACE \ No newline at end of file diff --git a/api/include/opentelemetry/semconv/service_attributes.h b/api/include/opentelemetry/semconv/service_attributes.h index 6b12718b95..6e3f616a85 100644 --- a/api/include/opentelemetry/semconv/service_attributes.h +++ b/api/include/opentelemetry/semconv/service_attributes.h @@ -8,34 +8,34 @@ * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 */ -#pragma once + #pragma once -#include "opentelemetry/common/macros.h" -#include "opentelemetry/version.h" - -OPENTELEMETRY_BEGIN_NAMESPACE -namespace semconv -{ -namespace service -{ - -/** - * Logical name of the service. - *

                    - * MUST be the same for all instances of horizontally scaled services. If the value was not - * specified, SDKs MUST fallback to @code unknown_service: @endcode concatenated - * with @code process.executable.name @endcode, e.g. @code unknown_service:bash - * @endcode. If @code process.executable.name @endcode is not available, the value MUST be set to - * @code unknown_service @endcode. - */ -static constexpr const char *kServiceName = "service.name"; - -/** - * The version string of the service API or implementation. The format is not defined by these - * conventions. - */ -static constexpr const char *kServiceVersion = "service.version"; - -} // namespace service -} // namespace semconv -OPENTELEMETRY_END_NAMESPACE + #include "opentelemetry/common/macros.h" + #include "opentelemetry/version.h" + + OPENTELEMETRY_BEGIN_NAMESPACE + namespace semconv + { + namespace service + { + + /** + * Logical name of the service. + *

                    + * MUST be the same for all instances of horizontally scaled services. If the value was not + * specified, SDKs MUST fallback to @code unknown_service: @endcode concatenated with @code process.executable.name @endcode, e.g. @code unknown_service:bash + * @endcode. If @code process.executable.name @endcode is not available, the value MUST be set to + * @code unknown_service @endcode. + */ + static constexpr const char *kServiceName = "service.name"; + + /** + * The version string of the service API or implementation. The format is not defined by these + * conventions. + */ + static constexpr const char *kServiceVersion = "service.version"; + + } // namespace service + } // namespace semconv + OPENTELEMETRY_END_NAMESPACE \ No newline at end of file diff --git a/api/include/opentelemetry/semconv/url_attributes.h b/api/include/opentelemetry/semconv/url_attributes.h index 5c39d7d5b7..b3f85afdd4 100644 --- a/api/include/opentelemetry/semconv/url_attributes.h +++ b/api/include/opentelemetry/semconv/url_attributes.h @@ -8,91 +8,95 @@ * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 */ -#pragma once + #pragma once -#include "opentelemetry/common/macros.h" -#include "opentelemetry/version.h" - -OPENTELEMETRY_BEGIN_NAMESPACE -namespace semconv -{ -namespace url -{ - -/** - * The URI fragment component - */ -static constexpr const char *kUrlFragment = "url.fragment"; - -/** - * Absolute URL describing a network resource according to - * RFC3986

                    For network calls, URL usually has - * @code scheme://host[:port][path][?query][#fragment] @endcode format, where the fragment is not - * transmitted over HTTP, but if it is known, it SHOULD be included nevertheless.

                    - * @code url.full @endcode MUST NOT contain credentials passed via URL in form of @code - * https://username:password@www.example.com/ @endcode. In such case username and password SHOULD be - * redacted and attribute's value SHOULD be @code https://REDACTED:REDACTED@www.example.com/ - * @endcode.

                    - * @code url.full @endcode SHOULD capture the absolute URL when it is available (or can be - * reconstructed).

                    Sensitive content provided in @code url.full @endcode SHOULD be scrubbed when - * instrumentations can identify it.

                    - * - * Query string values for the following keys SHOULD be redacted by default and replaced by the - * value @code REDACTED @endcode: - *

                    - *

                    - * This list is subject to change over time. - *

                    - * When a query string value is redacted, the query string key SHOULD still be preserved, e.g. - * @code https://www.example.com/path?color=blue&sig=REDACTED @endcode. - */ -static constexpr const char *kUrlFull = "url.full"; - -/** - * The URI path component - *

                    - * Sensitive content provided in @code url.path @endcode SHOULD be scrubbed when instrumentations - * can identify it. - */ -static constexpr const char *kUrlPath = "url.path"; - -/** - * The URI query component @link https://learn.microsoft.com/azure/storage/common/storage-sas-overview#sas-token @code sig @endcode @endlink - *

                    - * Sensitive content provided in @code url.query @endcode SHOULD be scrubbed when instrumentations - * can identify it.

                    - * - * Query string values for the following keys SHOULD be redacted by default and replaced by the - * value @code REDACTED @endcode:

                    - *

                    - * This list is subject to change over time. - *

                    - * When a query string value is redacted, the query string key SHOULD still be preserved, e.g. - * @code q=OpenTelemetry&sig=REDACTED @endcode. - */ -static constexpr const char *kUrlQuery = "url.query"; - -/** - * The URI scheme component - * identifying the used protocol. - */ -static constexpr const char *kUrlScheme = "url.scheme"; - -} // namespace url -} // namespace semconv -OPENTELEMETRY_END_NAMESPACE + #include "opentelemetry/common/macros.h" + #include "opentelemetry/version.h" + + OPENTELEMETRY_BEGIN_NAMESPACE + namespace semconv + { + namespace url + { + + /** + * The URI fragment component + */ + static constexpr const char *kUrlFragment = "url.fragment"; + + /** + * Absolute URL describing a network resource according to RFC3986

                    For network calls, URL usually has + * @code scheme://host[:port][path][?query][#fragment] @endcode format, where the fragment is not + * transmitted over HTTP, but if it is known, it SHOULD be included nevertheless.

                    + * @code url.full @endcode MUST NOT contain credentials passed via URL in form of @code + * https://username:password@www.example.com/ @endcode. In such case username and password SHOULD be + * redacted and attribute's value SHOULD be @code https://REDACTED:REDACTED@www.example.com/ + * @endcode.

                    + * @code url.full @endcode SHOULD capture the absolute URL when it is available (or can be + * reconstructed).

                    Sensitive content provided in @code url.full @endcode SHOULD be scrubbed when + * instrumentations can identify it.

                    + * + * Query string values for the following keys SHOULD be redacted by default and replaced by the + * value @code REDACTED @endcode: + *

                    + *

                    + * This list is subject to change over time. + *

                    + * When a query string value is redacted, the query string key SHOULD still be preserved, e.g. + * @code https://www.example.com/path?color=blue&sig=REDACTED @endcode. + */ + static constexpr const char *kUrlFull = "url.full"; + + /** + * The URI path component + *

                    + * Sensitive content provided in @code url.path @endcode SHOULD be scrubbed when instrumentations + * can identify it. + */ + static constexpr const char *kUrlPath = "url.path"; + + /** + * The URI query component + *

                    + * Sensitive content provided in @code url.query @endcode SHOULD be scrubbed when instrumentations + * can identify it.

                    + * + * Query string values for the following keys SHOULD be redacted by default and replaced by the + * value @code REDACTED @endcode:

                    + *

                    + * This list is subject to change over time. + *

                    + * When a query string value is redacted, the query string key SHOULD still be preserved, e.g. + * @code q=OpenTelemetry&sig=REDACTED @endcode. + */ + static constexpr const char *kUrlQuery = "url.query"; + + /** + * The URI scheme component + * identifying the used protocol. + */ + static constexpr const char *kUrlScheme = "url.scheme"; + + } // namespace url + } // namespace semconv + OPENTELEMETRY_END_NAMESPACE \ No newline at end of file diff --git a/buildscripts/semantic-convention/semantic-conventions b/buildscripts/semantic-convention/semantic-conventions new file mode 160000 index 0000000000..6814d83dac --- /dev/null +++ b/buildscripts/semantic-convention/semantic-conventions @@ -0,0 +1 @@ +Subproject commit 6814d83dac7ebd6b29dada91c669a99275f674c8 From 32a7861076b02828f19e0ea0a6f272ce1a2bab79 Mon Sep 17 00:00:00 2001 From: Evan Date: Mon, 26 May 2025 15:20:03 +0000 Subject: [PATCH 10/17] Remove bad checkin --- buildscripts/semantic-convention/semantic-conventions | 1 - 1 file changed, 1 deletion(-) delete mode 160000 buildscripts/semantic-convention/semantic-conventions diff --git a/buildscripts/semantic-convention/semantic-conventions b/buildscripts/semantic-convention/semantic-conventions deleted file mode 160000 index 6814d83dac..0000000000 --- a/buildscripts/semantic-convention/semantic-conventions +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 6814d83dac7ebd6b29dada91c669a99275f674c8 From c682d1afed8956915f7e306d405931c1aedc9923 Mon Sep 17 00:00:00 2001 From: Evan Date: Mon, 26 May 2025 15:28:28 +0000 Subject: [PATCH 11/17] Fix the format --- .../semconv/incubating/process_attributes.h | 574 ++-- .../semconv/incubating/system_metrics.h | 2540 ++++++++--------- .../semconv/incubating/url_attributes.h | 326 +-- .../semconv/service_attributes.h | 60 +- .../opentelemetry/semconv/url_attributes.h | 182 +- 5 files changed, 1841 insertions(+), 1841 deletions(-) diff --git a/api/include/opentelemetry/semconv/incubating/process_attributes.h b/api/include/opentelemetry/semconv/incubating/process_attributes.h index 688c268a52..f23904dceb 100644 --- a/api/include/opentelemetry/semconv/incubating/process_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/process_attributes.h @@ -8,290 +8,290 @@ * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 */ - #pragma once - - #include "opentelemetry/common/macros.h" - #include "opentelemetry/version.h" - - OPENTELEMETRY_BEGIN_NAMESPACE - namespace semconv - { - namespace process - { - - /** - * Length of the process.command_args array - *

                    - * This field can be useful for querying or performing bucket analysis on how many arguments were - * provided to start a process. More arguments may be an indication of suspicious activity. - */ - static constexpr const char *kProcessArgsCount = "process.args_count"; - - /** - * The command used to launch the process (i.e. the command name). On Linux based systems, can be - * set to the zeroth string in @code proc/[pid]/cmdline @endcode. On Windows, can be set to the - * first parameter extracted from @code GetCommandLineW @endcode. - */ - static constexpr const char *kProcessCommand = "process.command"; - - /** - * All the command arguments (including the command/executable itself) as received by the process. - * On Linux-based systems (and some other Unixoid systems supporting procfs), can be set according - * to the list of null-delimited strings extracted from @code proc/[pid]/cmdline @endcode. For - * libc-based executables, this would be the full argv vector passed to @code main @endcode. SHOULD - * NOT be collected by default unless there is sanitization that excludes sensitive data. - */ - static constexpr const char *kProcessCommandArgs = "process.command_args"; - - /** - * The full command used to launch the process as a single string representing the full command. On - * Windows, can be set to the result of @code GetCommandLineW @endcode. Do not set this if you have - * to assemble it just for monitoring; use @code process.command_args @endcode instead. SHOULD NOT - * be collected by default unless there is sanitization that excludes sensitive data. - */ - static constexpr const char *kProcessCommandLine = "process.command_line"; - - /** - * Specifies whether the context switches for this data point were voluntary or involuntary. - */ - static constexpr const char *kProcessContextSwitchType = "process.context_switch_type"; - - /** - * Deprecated, use @code cpu.mode @endcode instead. - * - * @deprecated - * {"note": "Replaced by @code cpu.mode @endcode.", "reason": "renamed", "renamed_to": "cpu.mode"} - */ - OPENTELEMETRY_DEPRECATED static constexpr const char *kProcessCpuState = "process.cpu.state"; - - /** - * The date and time the process was created, in ISO 8601 format. - */ - static constexpr const char *kProcessCreationTime = "process.creation.time"; - - /** - * Process environment variables, being the environment variable name, the value being the - * environment variable value.

                    Examples:

                    • an environment variable @code USER @endcode - * with value @code "ubuntu" @endcode SHOULD be recorded as the @code - * process.environment_variable.USER @endcode attribute with value @code "ubuntu" @endcode.
                    • - *
                    • an environment variable @code PATH @endcode with value @code "/usr/local/bin:/usr/bin" - * @endcode SHOULD be recorded as the @code process.environment_variable.PATH @endcode attribute - * with value @code "/usr/local/bin:/usr/bin" @endcode.
                    • - *
                    - */ - static constexpr const char *kProcessEnvironmentVariable = "process.environment_variable"; - - /** - * The GNU build ID as found in the @code .note.gnu.build-id @endcode ELF section (hex string). - */ - static constexpr const char *kProcessExecutableBuildIdGnu = "process.executable.build_id.gnu"; - - /** - * The Go build ID as retrieved by @code go tool buildid @endcode. - */ - static constexpr const char *kProcessExecutableBuildIdGo = "process.executable.build_id.go"; - - /** - * Profiling specific build ID for executables. See the OTel specification for Profiles for more - * information. - */ - static constexpr const char *kProcessExecutableBuildIdHtlhash = - "process.executable.build_id.htlhash"; - - /** - * "Deprecated, use @code process.executable.build_id.htlhash @endcode instead." - * - * @deprecated - * {"note": "Replaced by @code process.executable.build_id.htlhash @endcode.", "reason": "renamed", - * "renamed_to": "process.executable.build_id.htlhash"} - */ - OPENTELEMETRY_DEPRECATED static constexpr const char *kProcessExecutableBuildIdProfiling = - "process.executable.build_id.profiling"; - - /** - * The name of the process executable. On Linux based systems, this SHOULD be set to the base name - * of the target of @code /proc/[pid]/exe @endcode. On Windows, this SHOULD be set to the base name - * of @code GetProcessImageFileNameW @endcode. - */ - static constexpr const char *kProcessExecutableName = "process.executable.name"; - - /** - * The full path to the process executable. On Linux based systems, can be set to the target of - * @code proc/[pid]/exe @endcode. On Windows, can be set to the result of @code - * GetProcessImageFileNameW @endcode. - */ - static constexpr const char *kProcessExecutablePath = "process.executable.path"; - - /** - * The exit code of the process. - */ - static constexpr const char *kProcessExitCode = "process.exit.code"; - - /** - * The date and time the process exited, in ISO 8601 format. - */ - static constexpr const char *kProcessExitTime = "process.exit.time"; - - /** - * The PID of the process's group leader. This is also the process group ID (PGID) of the process. - */ - static constexpr const char *kProcessGroupLeaderPid = "process.group_leader.pid"; - - /** - * Whether the process is connected to an interactive shell. - */ - static constexpr const char *kProcessInteractive = "process.interactive"; - - /** - * The control group associated with the process. - *

                    - * Control groups (cgroups) are a kernel feature used to organize and manage process resources. This - * attribute provides the path(s) to the cgroup(s) associated with the process, which should match - * the contents of the /proc/[PID]/cgroup file. - */ - static constexpr const char *kProcessLinuxCgroup = "process.linux.cgroup"; - - /** - * The username of the user that owns the process. - */ - static constexpr const char *kProcessOwner = "process.owner"; - - /** - * The type of page fault for this data point. Type @code major @endcode is for major/hard page - * faults, and @code minor @endcode is for minor/soft page faults. - */ - static constexpr const char *kProcessPagingFaultType = "process.paging.fault_type"; - - /** - * Parent Process identifier (PPID). - */ - static constexpr const char *kProcessParentPid = "process.parent_pid"; - - /** - * Process identifier (PID). - */ - static constexpr const char *kProcessPid = "process.pid"; - - /** - * The real user ID (RUID) of the process. - */ - static constexpr const char *kProcessRealUserId = "process.real_user.id"; - - /** - * The username of the real user of the process. - */ - static constexpr const char *kProcessRealUserName = "process.real_user.name"; - - /** - * An additional description about the runtime of the process, for example a specific vendor - * customization of the runtime environment. - */ - static constexpr const char *kProcessRuntimeDescription = "process.runtime.description"; - - /** - * The name of the runtime of this process. - */ - static constexpr const char *kProcessRuntimeName = "process.runtime.name"; - - /** - * The version of the runtime of this process, as returned by the runtime without modification. - */ - static constexpr const char *kProcessRuntimeVersion = "process.runtime.version"; - - /** - * The saved user ID (SUID) of the process. - */ - static constexpr const char *kProcessSavedUserId = "process.saved_user.id"; - - /** - * The username of the saved user. - */ - static constexpr const char *kProcessSavedUserName = "process.saved_user.name"; - - /** - * The PID of the process's session leader. This is also the session ID (SID) of the process. - */ - static constexpr const char *kProcessSessionLeaderPid = "process.session_leader.pid"; - - /** - * Process title (proctitle) - *

                    - * In many Unix-like systems, process title (proctitle), is the string that represents the name or - * command line of a running process, displayed by system monitoring tools like ps, top, and htop. - */ - static constexpr const char *kProcessTitle = "process.title"; - - /** - * The effective user ID (EUID) of the process. - */ - static constexpr const char *kProcessUserId = "process.user.id"; - - /** - * The username of the effective user of the process. - */ - static constexpr const char *kProcessUserName = "process.user.name"; - - /** - * Virtual process identifier. - *

                    - * The process ID within a PID namespace. This is not necessarily unique across all processes on the - * host but it is unique within the process namespace that the process exists within. - */ - static constexpr const char *kProcessVpid = "process.vpid"; - - /** - * The working directory of the process. - */ - static constexpr const char *kProcessWorkingDirectory = "process.working_directory"; - - namespace ProcessContextSwitchTypeValues - { - /** - * none - */ - static constexpr const char *kVoluntary = "voluntary"; - - /** - * none - */ - static constexpr const char *kInvoluntary = "involuntary"; - - } // namespace ProcessContextSwitchTypeValues - - namespace ProcessCpuStateValues - { - /** - * none - */ - static constexpr const char *kSystem = "system"; - - /** - * none - */ - static constexpr const char *kUser = "user"; - - /** - * none - */ - static constexpr const char *kWait = "wait"; - - } // namespace ProcessCpuStateValues - - namespace ProcessPagingFaultTypeValues - { - /** - * none - */ - static constexpr const char *kMajor = "major"; - - /** - * none - */ - static constexpr const char *kMinor = "minor"; - - } // namespace ProcessPagingFaultTypeValues - - } // namespace process - } // namespace semconv - OPENTELEMETRY_END_NAMESPACE \ No newline at end of file +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace process +{ + +/** + * Length of the process.command_args array + *

                    + * This field can be useful for querying or performing bucket analysis on how many arguments were + * provided to start a process. More arguments may be an indication of suspicious activity. + */ +static constexpr const char *kProcessArgsCount = "process.args_count"; + +/** + * The command used to launch the process (i.e. the command name). On Linux based systems, can be + * set to the zeroth string in @code proc/[pid]/cmdline @endcode. On Windows, can be set to the + * first parameter extracted from @code GetCommandLineW @endcode. + */ +static constexpr const char *kProcessCommand = "process.command"; + +/** + * All the command arguments (including the command/executable itself) as received by the process. + * On Linux-based systems (and some other Unixoid systems supporting procfs), can be set according + * to the list of null-delimited strings extracted from @code proc/[pid]/cmdline @endcode. For + * libc-based executables, this would be the full argv vector passed to @code main @endcode. SHOULD + * NOT be collected by default unless there is sanitization that excludes sensitive data. + */ +static constexpr const char *kProcessCommandArgs = "process.command_args"; + +/** + * The full command used to launch the process as a single string representing the full command. On + * Windows, can be set to the result of @code GetCommandLineW @endcode. Do not set this if you have + * to assemble it just for monitoring; use @code process.command_args @endcode instead. SHOULD NOT + * be collected by default unless there is sanitization that excludes sensitive data. + */ +static constexpr const char *kProcessCommandLine = "process.command_line"; + +/** + * Specifies whether the context switches for this data point were voluntary or involuntary. + */ +static constexpr const char *kProcessContextSwitchType = "process.context_switch_type"; + +/** + * Deprecated, use @code cpu.mode @endcode instead. + * + * @deprecated + * {"note": "Replaced by @code cpu.mode @endcode.", "reason": "renamed", "renamed_to": "cpu.mode"} + */ +OPENTELEMETRY_DEPRECATED static constexpr const char *kProcessCpuState = "process.cpu.state"; + +/** + * The date and time the process was created, in ISO 8601 format. + */ +static constexpr const char *kProcessCreationTime = "process.creation.time"; + +/** + * Process environment variables, being the environment variable name, the value being the + * environment variable value.

                    Examples:

                    • an environment variable @code USER @endcode + * with value @code "ubuntu" @endcode SHOULD be recorded as the @code + * process.environment_variable.USER @endcode attribute with value @code "ubuntu" @endcode.
                    • + *
                    • an environment variable @code PATH @endcode with value @code "/usr/local/bin:/usr/bin" + * @endcode SHOULD be recorded as the @code process.environment_variable.PATH @endcode attribute + * with value @code "/usr/local/bin:/usr/bin" @endcode.
                    • + *
                    + */ +static constexpr const char *kProcessEnvironmentVariable = "process.environment_variable"; + +/** + * The GNU build ID as found in the @code .note.gnu.build-id @endcode ELF section (hex string). + */ +static constexpr const char *kProcessExecutableBuildIdGnu = "process.executable.build_id.gnu"; + +/** + * The Go build ID as retrieved by @code go tool buildid @endcode. + */ +static constexpr const char *kProcessExecutableBuildIdGo = "process.executable.build_id.go"; + +/** + * Profiling specific build ID for executables. See the OTel specification for Profiles for more + * information. + */ +static constexpr const char *kProcessExecutableBuildIdHtlhash = + "process.executable.build_id.htlhash"; + +/** + * "Deprecated, use @code process.executable.build_id.htlhash @endcode instead." + * + * @deprecated + * {"note": "Replaced by @code process.executable.build_id.htlhash @endcode.", "reason": "renamed", + * "renamed_to": "process.executable.build_id.htlhash"} + */ +OPENTELEMETRY_DEPRECATED static constexpr const char *kProcessExecutableBuildIdProfiling = + "process.executable.build_id.profiling"; + +/** + * The name of the process executable. On Linux based systems, this SHOULD be set to the base name + * of the target of @code /proc/[pid]/exe @endcode. On Windows, this SHOULD be set to the base name + * of @code GetProcessImageFileNameW @endcode. + */ +static constexpr const char *kProcessExecutableName = "process.executable.name"; + +/** + * The full path to the process executable. On Linux based systems, can be set to the target of + * @code proc/[pid]/exe @endcode. On Windows, can be set to the result of @code + * GetProcessImageFileNameW @endcode. + */ +static constexpr const char *kProcessExecutablePath = "process.executable.path"; + +/** + * The exit code of the process. + */ +static constexpr const char *kProcessExitCode = "process.exit.code"; + +/** + * The date and time the process exited, in ISO 8601 format. + */ +static constexpr const char *kProcessExitTime = "process.exit.time"; + +/** + * The PID of the process's group leader. This is also the process group ID (PGID) of the process. + */ +static constexpr const char *kProcessGroupLeaderPid = "process.group_leader.pid"; + +/** + * Whether the process is connected to an interactive shell. + */ +static constexpr const char *kProcessInteractive = "process.interactive"; + +/** + * The control group associated with the process. + *

                    + * Control groups (cgroups) are a kernel feature used to organize and manage process resources. This + * attribute provides the path(s) to the cgroup(s) associated with the process, which should match + * the contents of the /proc/[PID]/cgroup file. + */ +static constexpr const char *kProcessLinuxCgroup = "process.linux.cgroup"; + +/** + * The username of the user that owns the process. + */ +static constexpr const char *kProcessOwner = "process.owner"; + +/** + * The type of page fault for this data point. Type @code major @endcode is for major/hard page + * faults, and @code minor @endcode is for minor/soft page faults. + */ +static constexpr const char *kProcessPagingFaultType = "process.paging.fault_type"; + +/** + * Parent Process identifier (PPID). + */ +static constexpr const char *kProcessParentPid = "process.parent_pid"; + +/** + * Process identifier (PID). + */ +static constexpr const char *kProcessPid = "process.pid"; + +/** + * The real user ID (RUID) of the process. + */ +static constexpr const char *kProcessRealUserId = "process.real_user.id"; + +/** + * The username of the real user of the process. + */ +static constexpr const char *kProcessRealUserName = "process.real_user.name"; + +/** + * An additional description about the runtime of the process, for example a specific vendor + * customization of the runtime environment. + */ +static constexpr const char *kProcessRuntimeDescription = "process.runtime.description"; + +/** + * The name of the runtime of this process. + */ +static constexpr const char *kProcessRuntimeName = "process.runtime.name"; + +/** + * The version of the runtime of this process, as returned by the runtime without modification. + */ +static constexpr const char *kProcessRuntimeVersion = "process.runtime.version"; + +/** + * The saved user ID (SUID) of the process. + */ +static constexpr const char *kProcessSavedUserId = "process.saved_user.id"; + +/** + * The username of the saved user. + */ +static constexpr const char *kProcessSavedUserName = "process.saved_user.name"; + +/** + * The PID of the process's session leader. This is also the session ID (SID) of the process. + */ +static constexpr const char *kProcessSessionLeaderPid = "process.session_leader.pid"; + +/** + * Process title (proctitle) + *

                    + * In many Unix-like systems, process title (proctitle), is the string that represents the name or + * command line of a running process, displayed by system monitoring tools like ps, top, and htop. + */ +static constexpr const char *kProcessTitle = "process.title"; + +/** + * The effective user ID (EUID) of the process. + */ +static constexpr const char *kProcessUserId = "process.user.id"; + +/** + * The username of the effective user of the process. + */ +static constexpr const char *kProcessUserName = "process.user.name"; + +/** + * Virtual process identifier. + *

                    + * The process ID within a PID namespace. This is not necessarily unique across all processes on the + * host but it is unique within the process namespace that the process exists within. + */ +static constexpr const char *kProcessVpid = "process.vpid"; + +/** + * The working directory of the process. + */ +static constexpr const char *kProcessWorkingDirectory = "process.working_directory"; + +namespace ProcessContextSwitchTypeValues +{ +/** + * none + */ +static constexpr const char *kVoluntary = "voluntary"; + +/** + * none + */ +static constexpr const char *kInvoluntary = "involuntary"; + +} // namespace ProcessContextSwitchTypeValues + +namespace ProcessCpuStateValues +{ +/** + * none + */ +static constexpr const char *kSystem = "system"; + +/** + * none + */ +static constexpr const char *kUser = "user"; + +/** + * none + */ +static constexpr const char *kWait = "wait"; + +} // namespace ProcessCpuStateValues + +namespace ProcessPagingFaultTypeValues +{ +/** + * none + */ +static constexpr const char *kMajor = "major"; + +/** + * none + */ +static constexpr const char *kMinor = "minor"; + +} // namespace ProcessPagingFaultTypeValues + +} // namespace process +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE \ No newline at end of file diff --git a/api/include/opentelemetry/semconv/incubating/system_metrics.h b/api/include/opentelemetry/semconv/incubating/system_metrics.h index 107a0e1fc6..45d96cb909 100644 --- a/api/include/opentelemetry/semconv/incubating/system_metrics.h +++ b/api/include/opentelemetry/semconv/incubating/system_metrics.h @@ -8,1330 +8,1330 @@ * buildscripts/semantic-convention/templates/registry/semantic_metrics-h.j2 */ - #pragma once - - #include "opentelemetry/common/macros.h" - #include "opentelemetry/metrics/meter.h" - #include "opentelemetry/version.h" - - OPENTELEMETRY_BEGIN_NAMESPACE - namespace semconv - { - namespace system - { - - /** - * Deprecated. Use @code cpu.frequency @endcode instead. - * - * @deprecated - * {"note": "Replaced by @code cpu.frequency @endcode.", "reason": "renamed", "renamed_to": - * "cpu.frequency"}

                    gauge - */ - OPENTELEMETRY_DEPRECATED static constexpr const char *kMetricSystemCpuFrequency = - "system.cpu.frequency"; - OPENTELEMETRY_DEPRECATED static constexpr const char *descrMetricSystemCpuFrequency = - "Deprecated. Use `cpu.frequency` instead."; - OPENTELEMETRY_DEPRECATED static constexpr const char *unitMetricSystemCpuFrequency = "{Hz}"; - - #if OPENTELEMETRY_ABI_VERSION_NO >= 2 - - OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> - CreateSyncInt64MetricSystemCpuFrequency(metrics::Meter *meter) - { - return meter->CreateInt64Gauge(kMetricSystemCpuFrequency, descrMetricSystemCpuFrequency, +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/metrics/meter.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace system +{ + +/** + * Deprecated. Use @code cpu.frequency @endcode instead. + * + * @deprecated + * {"note": "Replaced by @code cpu.frequency @endcode.", "reason": "renamed", "renamed_to": + * "cpu.frequency"}

                    gauge + */ +OPENTELEMETRY_DEPRECATED static constexpr const char *kMetricSystemCpuFrequency = + "system.cpu.frequency"; +OPENTELEMETRY_DEPRECATED static constexpr const char *descrMetricSystemCpuFrequency = + "Deprecated. Use `cpu.frequency` instead."; +OPENTELEMETRY_DEPRECATED static constexpr const char *unitMetricSystemCpuFrequency = "{Hz}"; + +#if OPENTELEMETRY_ABI_VERSION_NO >= 2 + +OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> +CreateSyncInt64MetricSystemCpuFrequency(metrics::Meter *meter) +{ + return meter->CreateInt64Gauge(kMetricSystemCpuFrequency, descrMetricSystemCpuFrequency, + unitMetricSystemCpuFrequency); +} + +OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> +CreateSyncDoubleMetricSystemCpuFrequency(metrics::Meter *meter) +{ + return meter->CreateDoubleGauge(kMetricSystemCpuFrequency, descrMetricSystemCpuFrequency, unitMetricSystemCpuFrequency); - } - - OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> - CreateSyncDoubleMetricSystemCpuFrequency(metrics::Meter *meter) - { - return meter->CreateDoubleGauge(kMetricSystemCpuFrequency, descrMetricSystemCpuFrequency, - unitMetricSystemCpuFrequency); - } - #endif /* OPENTELEMETRY_ABI_VERSION_NO */ - - OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr - CreateAsyncInt64MetricSystemCpuFrequency(metrics::Meter *meter) - { - return meter->CreateInt64ObservableGauge(kMetricSystemCpuFrequency, descrMetricSystemCpuFrequency, - unitMetricSystemCpuFrequency); - } - - OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr - CreateAsyncDoubleMetricSystemCpuFrequency(metrics::Meter *meter) - { - return meter->CreateDoubleObservableGauge( - kMetricSystemCpuFrequency, descrMetricSystemCpuFrequency, unitMetricSystemCpuFrequency); - } - - /** - * Reports the number of logical (virtual) processor cores created by the operating system to manage - * multitasking

                    Calculated by multiplying the number of sockets by the number of cores per - * socket, and then by the number of threads per core

                    updowncounter - */ - static constexpr const char *kMetricSystemCpuLogicalCount = "system.cpu.logical.count"; - static constexpr const char *descrMetricSystemCpuLogicalCount = - "Reports the number of logical (virtual) processor cores created by the operating system to " - "manage multitasking"; - static constexpr const char *unitMetricSystemCpuLogicalCount = "{cpu}"; - - static inline nostd::unique_ptr> - CreateSyncInt64MetricSystemCpuLogicalCount(metrics::Meter *meter) - { - return meter->CreateInt64UpDownCounter(kMetricSystemCpuLogicalCount, +} +#endif /* OPENTELEMETRY_ABI_VERSION_NO */ + +OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr +CreateAsyncInt64MetricSystemCpuFrequency(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableGauge(kMetricSystemCpuFrequency, descrMetricSystemCpuFrequency, + unitMetricSystemCpuFrequency); +} + +OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr +CreateAsyncDoubleMetricSystemCpuFrequency(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableGauge( + kMetricSystemCpuFrequency, descrMetricSystemCpuFrequency, unitMetricSystemCpuFrequency); +} + +/** + * Reports the number of logical (virtual) processor cores created by the operating system to manage + * multitasking

                    Calculated by multiplying the number of sockets by the number of cores per + * socket, and then by the number of threads per core

                    updowncounter + */ +static constexpr const char *kMetricSystemCpuLogicalCount = "system.cpu.logical.count"; +static constexpr const char *descrMetricSystemCpuLogicalCount = + "Reports the number of logical (virtual) processor cores created by the operating system to " + "manage multitasking"; +static constexpr const char *unitMetricSystemCpuLogicalCount = "{cpu}"; + +static inline nostd::unique_ptr> +CreateSyncInt64MetricSystemCpuLogicalCount(metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricSystemCpuLogicalCount, + descrMetricSystemCpuLogicalCount, + unitMetricSystemCpuLogicalCount); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricSystemCpuLogicalCount(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricSystemCpuLogicalCount, descrMetricSystemCpuLogicalCount, unitMetricSystemCpuLogicalCount); - } - - static inline nostd::unique_ptr> - CreateSyncDoubleMetricSystemCpuLogicalCount(metrics::Meter *meter) - { - return meter->CreateDoubleUpDownCounter(kMetricSystemCpuLogicalCount, - descrMetricSystemCpuLogicalCount, - unitMetricSystemCpuLogicalCount); - } - - static inline nostd::shared_ptr - CreateAsyncInt64MetricSystemCpuLogicalCount(metrics::Meter *meter) - { - return meter->CreateInt64ObservableUpDownCounter(kMetricSystemCpuLogicalCount, +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricSystemCpuLogicalCount(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter(kMetricSystemCpuLogicalCount, + descrMetricSystemCpuLogicalCount, + unitMetricSystemCpuLogicalCount); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricSystemCpuLogicalCount(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter(kMetricSystemCpuLogicalCount, descrMetricSystemCpuLogicalCount, unitMetricSystemCpuLogicalCount); - } - - static inline nostd::shared_ptr - CreateAsyncDoubleMetricSystemCpuLogicalCount(metrics::Meter *meter) - { - return meter->CreateDoubleObservableUpDownCounter(kMetricSystemCpuLogicalCount, - descrMetricSystemCpuLogicalCount, - unitMetricSystemCpuLogicalCount); - } - - /** - * Reports the number of actual physical processor cores on the hardware - *

                    - * Calculated by multiplying the number of sockets by the number of cores per socket - *

                    - * updowncounter - */ - static constexpr const char *kMetricSystemCpuPhysicalCount = "system.cpu.physical.count"; - static constexpr const char *descrMetricSystemCpuPhysicalCount = - "Reports the number of actual physical processor cores on the hardware"; - static constexpr const char *unitMetricSystemCpuPhysicalCount = "{cpu}"; - - static inline nostd::unique_ptr> - CreateSyncInt64MetricSystemCpuPhysicalCount(metrics::Meter *meter) - { - return meter->CreateInt64UpDownCounter(kMetricSystemCpuPhysicalCount, +} + +/** + * Reports the number of actual physical processor cores on the hardware + *

                    + * Calculated by multiplying the number of sockets by the number of cores per socket + *

                    + * updowncounter + */ +static constexpr const char *kMetricSystemCpuPhysicalCount = "system.cpu.physical.count"; +static constexpr const char *descrMetricSystemCpuPhysicalCount = + "Reports the number of actual physical processor cores on the hardware"; +static constexpr const char *unitMetricSystemCpuPhysicalCount = "{cpu}"; + +static inline nostd::unique_ptr> +CreateSyncInt64MetricSystemCpuPhysicalCount(metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricSystemCpuPhysicalCount, + descrMetricSystemCpuPhysicalCount, + unitMetricSystemCpuPhysicalCount); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricSystemCpuPhysicalCount(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricSystemCpuPhysicalCount, descrMetricSystemCpuPhysicalCount, unitMetricSystemCpuPhysicalCount); - } - - static inline nostd::unique_ptr> - CreateSyncDoubleMetricSystemCpuPhysicalCount(metrics::Meter *meter) - { - return meter->CreateDoubleUpDownCounter(kMetricSystemCpuPhysicalCount, - descrMetricSystemCpuPhysicalCount, - unitMetricSystemCpuPhysicalCount); - } - - static inline nostd::shared_ptr - CreateAsyncInt64MetricSystemCpuPhysicalCount(metrics::Meter *meter) - { - return meter->CreateInt64ObservableUpDownCounter(kMetricSystemCpuPhysicalCount, +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricSystemCpuPhysicalCount(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter(kMetricSystemCpuPhysicalCount, + descrMetricSystemCpuPhysicalCount, + unitMetricSystemCpuPhysicalCount); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricSystemCpuPhysicalCount(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter(kMetricSystemCpuPhysicalCount, descrMetricSystemCpuPhysicalCount, unitMetricSystemCpuPhysicalCount); - } - - static inline nostd::shared_ptr - CreateAsyncDoubleMetricSystemCpuPhysicalCount(metrics::Meter *meter) - { - return meter->CreateDoubleObservableUpDownCounter(kMetricSystemCpuPhysicalCount, - descrMetricSystemCpuPhysicalCount, - unitMetricSystemCpuPhysicalCount); - } - - /** - * Deprecated. Use @code cpu.time @endcode instead. - * - * @deprecated - * {"note": "Replaced by @code cpu.time @endcode.", "reason": "renamed", "renamed_to": "cpu.time"} - *

                    - * counter - */ - OPENTELEMETRY_DEPRECATED static constexpr const char *kMetricSystemCpuTime = "system.cpu.time"; - OPENTELEMETRY_DEPRECATED static constexpr const char *descrMetricSystemCpuTime = - "Deprecated. Use `cpu.time` instead."; - OPENTELEMETRY_DEPRECATED static constexpr const char *unitMetricSystemCpuTime = "s"; - - OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> - CreateSyncInt64MetricSystemCpuTime(metrics::Meter *meter) - { - return meter->CreateUInt64Counter(kMetricSystemCpuTime, descrMetricSystemCpuTime, - unitMetricSystemCpuTime); - } - - OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> - CreateSyncDoubleMetricSystemCpuTime(metrics::Meter *meter) - { - return meter->CreateDoubleCounter(kMetricSystemCpuTime, descrMetricSystemCpuTime, - unitMetricSystemCpuTime); - } - - OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr - CreateAsyncInt64MetricSystemCpuTime(metrics::Meter *meter) - { - return meter->CreateInt64ObservableCounter(kMetricSystemCpuTime, descrMetricSystemCpuTime, +} + +/** + * Deprecated. Use @code cpu.time @endcode instead. + * + * @deprecated + * {"note": "Replaced by @code cpu.time @endcode.", "reason": "renamed", "renamed_to": "cpu.time"} + *

                    + * counter + */ +OPENTELEMETRY_DEPRECATED static constexpr const char *kMetricSystemCpuTime = "system.cpu.time"; +OPENTELEMETRY_DEPRECATED static constexpr const char *descrMetricSystemCpuTime = + "Deprecated. Use `cpu.time` instead."; +OPENTELEMETRY_DEPRECATED static constexpr const char *unitMetricSystemCpuTime = "s"; + +OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> +CreateSyncInt64MetricSystemCpuTime(metrics::Meter *meter) +{ + return meter->CreateUInt64Counter(kMetricSystemCpuTime, descrMetricSystemCpuTime, + unitMetricSystemCpuTime); +} + +OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> +CreateSyncDoubleMetricSystemCpuTime(metrics::Meter *meter) +{ + return meter->CreateDoubleCounter(kMetricSystemCpuTime, descrMetricSystemCpuTime, + unitMetricSystemCpuTime); +} + +OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr +CreateAsyncInt64MetricSystemCpuTime(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableCounter(kMetricSystemCpuTime, descrMetricSystemCpuTime, + unitMetricSystemCpuTime); +} + +OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr +CreateAsyncDoubleMetricSystemCpuTime(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableCounter(kMetricSystemCpuTime, descrMetricSystemCpuTime, unitMetricSystemCpuTime); - } - - OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr - CreateAsyncDoubleMetricSystemCpuTime(metrics::Meter *meter) - { - return meter->CreateDoubleObservableCounter(kMetricSystemCpuTime, descrMetricSystemCpuTime, - unitMetricSystemCpuTime); - } - - /** - * Deprecated. Use @code cpu.utilization @endcode instead. - * - * @deprecated - * {"note": "Replaced by @code cpu.utilization @endcode.", "reason": "renamed", "renamed_to": - * "cpu.utilization"}

                    gauge - */ - OPENTELEMETRY_DEPRECATED static constexpr const char *kMetricSystemCpuUtilization = - "system.cpu.utilization"; - OPENTELEMETRY_DEPRECATED static constexpr const char *descrMetricSystemCpuUtilization = - "Deprecated. Use `cpu.utilization` instead."; - OPENTELEMETRY_DEPRECATED static constexpr const char *unitMetricSystemCpuUtilization = "1"; - - #if OPENTELEMETRY_ABI_VERSION_NO >= 2 - - OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> - CreateSyncInt64MetricSystemCpuUtilization(metrics::Meter *meter) - { - return meter->CreateInt64Gauge(kMetricSystemCpuUtilization, descrMetricSystemCpuUtilization, +} + +/** + * Deprecated. Use @code cpu.utilization @endcode instead. + * + * @deprecated + * {"note": "Replaced by @code cpu.utilization @endcode.", "reason": "renamed", "renamed_to": + * "cpu.utilization"}

                    gauge + */ +OPENTELEMETRY_DEPRECATED static constexpr const char *kMetricSystemCpuUtilization = + "system.cpu.utilization"; +OPENTELEMETRY_DEPRECATED static constexpr const char *descrMetricSystemCpuUtilization = + "Deprecated. Use `cpu.utilization` instead."; +OPENTELEMETRY_DEPRECATED static constexpr const char *unitMetricSystemCpuUtilization = "1"; + +#if OPENTELEMETRY_ABI_VERSION_NO >= 2 + +OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> +CreateSyncInt64MetricSystemCpuUtilization(metrics::Meter *meter) +{ + return meter->CreateInt64Gauge(kMetricSystemCpuUtilization, descrMetricSystemCpuUtilization, + unitMetricSystemCpuUtilization); +} + +OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> +CreateSyncDoubleMetricSystemCpuUtilization(metrics::Meter *meter) +{ + return meter->CreateDoubleGauge(kMetricSystemCpuUtilization, descrMetricSystemCpuUtilization, unitMetricSystemCpuUtilization); - } - - OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> - CreateSyncDoubleMetricSystemCpuUtilization(metrics::Meter *meter) - { - return meter->CreateDoubleGauge(kMetricSystemCpuUtilization, descrMetricSystemCpuUtilization, - unitMetricSystemCpuUtilization); - } - #endif /* OPENTELEMETRY_ABI_VERSION_NO */ - - OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr - CreateAsyncInt64MetricSystemCpuUtilization(metrics::Meter *meter) - { - return meter->CreateInt64ObservableGauge( - kMetricSystemCpuUtilization, descrMetricSystemCpuUtilization, unitMetricSystemCpuUtilization); - } - - OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr - CreateAsyncDoubleMetricSystemCpuUtilization(metrics::Meter *meter) - { - return meter->CreateDoubleObservableGauge( - kMetricSystemCpuUtilization, descrMetricSystemCpuUtilization, unitMetricSystemCpuUtilization); - } - - /** - * counter - */ - static constexpr const char *kMetricSystemDiskIo = "system.disk.io"; - static constexpr const char *descrMetricSystemDiskIo = ""; - static constexpr const char *unitMetricSystemDiskIo = "By"; - - static inline nostd::unique_ptr> CreateSyncInt64MetricSystemDiskIo( - metrics::Meter *meter) - { - return meter->CreateUInt64Counter(kMetricSystemDiskIo, descrMetricSystemDiskIo, - unitMetricSystemDiskIo); - } - - static inline nostd::unique_ptr> CreateSyncDoubleMetricSystemDiskIo( - metrics::Meter *meter) - { - return meter->CreateDoubleCounter(kMetricSystemDiskIo, descrMetricSystemDiskIo, - unitMetricSystemDiskIo); - } - - static inline nostd::shared_ptr CreateAsyncInt64MetricSystemDiskIo( - metrics::Meter *meter) - { - return meter->CreateInt64ObservableCounter(kMetricSystemDiskIo, descrMetricSystemDiskIo, +} +#endif /* OPENTELEMETRY_ABI_VERSION_NO */ + +OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr +CreateAsyncInt64MetricSystemCpuUtilization(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableGauge( + kMetricSystemCpuUtilization, descrMetricSystemCpuUtilization, unitMetricSystemCpuUtilization); +} + +OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr +CreateAsyncDoubleMetricSystemCpuUtilization(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableGauge( + kMetricSystemCpuUtilization, descrMetricSystemCpuUtilization, unitMetricSystemCpuUtilization); +} + +/** + * counter + */ +static constexpr const char *kMetricSystemDiskIo = "system.disk.io"; +static constexpr const char *descrMetricSystemDiskIo = ""; +static constexpr const char *unitMetricSystemDiskIo = "By"; + +static inline nostd::unique_ptr> CreateSyncInt64MetricSystemDiskIo( + metrics::Meter *meter) +{ + return meter->CreateUInt64Counter(kMetricSystemDiskIo, descrMetricSystemDiskIo, + unitMetricSystemDiskIo); +} + +static inline nostd::unique_ptr> CreateSyncDoubleMetricSystemDiskIo( + metrics::Meter *meter) +{ + return meter->CreateDoubleCounter(kMetricSystemDiskIo, descrMetricSystemDiskIo, + unitMetricSystemDiskIo); +} + +static inline nostd::shared_ptr CreateAsyncInt64MetricSystemDiskIo( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableCounter(kMetricSystemDiskIo, descrMetricSystemDiskIo, + unitMetricSystemDiskIo); +} + +static inline nostd::shared_ptr CreateAsyncDoubleMetricSystemDiskIo( + metrics::Meter *meter) +{ + return meter->CreateDoubleObservableCounter(kMetricSystemDiskIo, descrMetricSystemDiskIo, unitMetricSystemDiskIo); - } - - static inline nostd::shared_ptr CreateAsyncDoubleMetricSystemDiskIo( - metrics::Meter *meter) - { - return meter->CreateDoubleObservableCounter(kMetricSystemDiskIo, descrMetricSystemDiskIo, - unitMetricSystemDiskIo); - } - - /** - * Time disk spent activated - *

                    - * The real elapsed time ("wall clock") used in the I/O path (time from operations running in - * parallel are not counted). Measured as:

                    - *

                    - * counter - */ - static constexpr const char *kMetricSystemDiskIoTime = "system.disk.io_time"; - static constexpr const char *descrMetricSystemDiskIoTime = "Time disk spent activated"; - static constexpr const char *unitMetricSystemDiskIoTime = "s"; - - static inline nostd::unique_ptr> CreateSyncInt64MetricSystemDiskIoTime( - metrics::Meter *meter) - { - return meter->CreateUInt64Counter(kMetricSystemDiskIoTime, descrMetricSystemDiskIoTime, - unitMetricSystemDiskIoTime); - } - - static inline nostd::unique_ptr> CreateSyncDoubleMetricSystemDiskIoTime( - metrics::Meter *meter) - { - return meter->CreateDoubleCounter(kMetricSystemDiskIoTime, descrMetricSystemDiskIoTime, - unitMetricSystemDiskIoTime); - } - - static inline nostd::shared_ptr - CreateAsyncInt64MetricSystemDiskIoTime(metrics::Meter *meter) - { - return meter->CreateInt64ObservableCounter(kMetricSystemDiskIoTime, descrMetricSystemDiskIoTime, +} + +/** + * Time disk spent activated + *

                    + * The real elapsed time ("wall clock") used in the I/O path (time from operations running in + * parallel are not counted). Measured as:

                    + *

                    + * counter + */ +static constexpr const char *kMetricSystemDiskIoTime = "system.disk.io_time"; +static constexpr const char *descrMetricSystemDiskIoTime = "Time disk spent activated"; +static constexpr const char *unitMetricSystemDiskIoTime = "s"; + +static inline nostd::unique_ptr> CreateSyncInt64MetricSystemDiskIoTime( + metrics::Meter *meter) +{ + return meter->CreateUInt64Counter(kMetricSystemDiskIoTime, descrMetricSystemDiskIoTime, + unitMetricSystemDiskIoTime); +} + +static inline nostd::unique_ptr> CreateSyncDoubleMetricSystemDiskIoTime( + metrics::Meter *meter) +{ + return meter->CreateDoubleCounter(kMetricSystemDiskIoTime, descrMetricSystemDiskIoTime, + unitMetricSystemDiskIoTime); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricSystemDiskIoTime(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableCounter(kMetricSystemDiskIoTime, descrMetricSystemDiskIoTime, + unitMetricSystemDiskIoTime); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricSystemDiskIoTime(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableCounter(kMetricSystemDiskIoTime, descrMetricSystemDiskIoTime, unitMetricSystemDiskIoTime); - } - - static inline nostd::shared_ptr - CreateAsyncDoubleMetricSystemDiskIoTime(metrics::Meter *meter) - { - return meter->CreateDoubleObservableCounter(kMetricSystemDiskIoTime, descrMetricSystemDiskIoTime, - unitMetricSystemDiskIoTime); - } - - /** - * The total storage capacity of the disk - *

                    - * updowncounter - */ - static constexpr const char *kMetricSystemDiskLimit = "system.disk.limit"; - static constexpr const char *descrMetricSystemDiskLimit = "The total storage capacity of the disk"; - static constexpr const char *unitMetricSystemDiskLimit = "By"; - - static inline nostd::unique_ptr> - CreateSyncInt64MetricSystemDiskLimit(metrics::Meter *meter) - { - return meter->CreateInt64UpDownCounter(kMetricSystemDiskLimit, descrMetricSystemDiskLimit, +} + +/** + * The total storage capacity of the disk + *

                    + * updowncounter + */ +static constexpr const char *kMetricSystemDiskLimit = "system.disk.limit"; +static constexpr const char *descrMetricSystemDiskLimit = "The total storage capacity of the disk"; +static constexpr const char *unitMetricSystemDiskLimit = "By"; + +static inline nostd::unique_ptr> +CreateSyncInt64MetricSystemDiskLimit(metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricSystemDiskLimit, descrMetricSystemDiskLimit, + unitMetricSystemDiskLimit); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricSystemDiskLimit(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricSystemDiskLimit, descrMetricSystemDiskLimit, unitMetricSystemDiskLimit); - } - - static inline nostd::unique_ptr> - CreateSyncDoubleMetricSystemDiskLimit(metrics::Meter *meter) - { - return meter->CreateDoubleUpDownCounter(kMetricSystemDiskLimit, descrMetricSystemDiskLimit, - unitMetricSystemDiskLimit); - } - - static inline nostd::shared_ptr - CreateAsyncInt64MetricSystemDiskLimit(metrics::Meter *meter) - { - return meter->CreateInt64ObservableUpDownCounter( - kMetricSystemDiskLimit, descrMetricSystemDiskLimit, unitMetricSystemDiskLimit); - } - - static inline nostd::shared_ptr - CreateAsyncDoubleMetricSystemDiskLimit(metrics::Meter *meter) - { - return meter->CreateDoubleObservableUpDownCounter( - kMetricSystemDiskLimit, descrMetricSystemDiskLimit, unitMetricSystemDiskLimit); - } - - /** - * counter - */ - static constexpr const char *kMetricSystemDiskMerged = "system.disk.merged"; - static constexpr const char *descrMetricSystemDiskMerged = ""; - static constexpr const char *unitMetricSystemDiskMerged = "{operation}"; - - static inline nostd::unique_ptr> CreateSyncInt64MetricSystemDiskMerged( - metrics::Meter *meter) - { - return meter->CreateUInt64Counter(kMetricSystemDiskMerged, descrMetricSystemDiskMerged, - unitMetricSystemDiskMerged); - } - - static inline nostd::unique_ptr> CreateSyncDoubleMetricSystemDiskMerged( - metrics::Meter *meter) - { - return meter->CreateDoubleCounter(kMetricSystemDiskMerged, descrMetricSystemDiskMerged, - unitMetricSystemDiskMerged); - } - - static inline nostd::shared_ptr - CreateAsyncInt64MetricSystemDiskMerged(metrics::Meter *meter) - { - return meter->CreateInt64ObservableCounter(kMetricSystemDiskMerged, descrMetricSystemDiskMerged, +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricSystemDiskLimit(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter( + kMetricSystemDiskLimit, descrMetricSystemDiskLimit, unitMetricSystemDiskLimit); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricSystemDiskLimit(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter( + kMetricSystemDiskLimit, descrMetricSystemDiskLimit, unitMetricSystemDiskLimit); +} + +/** + * counter + */ +static constexpr const char *kMetricSystemDiskMerged = "system.disk.merged"; +static constexpr const char *descrMetricSystemDiskMerged = ""; +static constexpr const char *unitMetricSystemDiskMerged = "{operation}"; + +static inline nostd::unique_ptr> CreateSyncInt64MetricSystemDiskMerged( + metrics::Meter *meter) +{ + return meter->CreateUInt64Counter(kMetricSystemDiskMerged, descrMetricSystemDiskMerged, + unitMetricSystemDiskMerged); +} + +static inline nostd::unique_ptr> CreateSyncDoubleMetricSystemDiskMerged( + metrics::Meter *meter) +{ + return meter->CreateDoubleCounter(kMetricSystemDiskMerged, descrMetricSystemDiskMerged, + unitMetricSystemDiskMerged); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricSystemDiskMerged(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableCounter(kMetricSystemDiskMerged, descrMetricSystemDiskMerged, + unitMetricSystemDiskMerged); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricSystemDiskMerged(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableCounter(kMetricSystemDiskMerged, descrMetricSystemDiskMerged, unitMetricSystemDiskMerged); - } - - static inline nostd::shared_ptr - CreateAsyncDoubleMetricSystemDiskMerged(metrics::Meter *meter) - { - return meter->CreateDoubleObservableCounter(kMetricSystemDiskMerged, descrMetricSystemDiskMerged, - unitMetricSystemDiskMerged); - } - - /** - * Sum of the time each operation took to complete - *

                    - * Because it is the sum of time each request took, parallel-issued requests each contribute to make - * the count grow. Measured as:

                    • Linux: Fields 7 & 11 from procfs-diskstats
                    • - *
                    • Windows: "Avg. Disk sec/Read" perf counter multiplied by "Disk Reads/sec" perf counter - * (similar for Writes)
                    • - *
                    - *

                    - * counter - */ - static constexpr const char *kMetricSystemDiskOperationTime = "system.disk.operation_time"; - static constexpr const char *descrMetricSystemDiskOperationTime = - "Sum of the time each operation took to complete"; - static constexpr const char *unitMetricSystemDiskOperationTime = "s"; - - static inline nostd::unique_ptr> - CreateSyncInt64MetricSystemDiskOperationTime(metrics::Meter *meter) - { - return meter->CreateUInt64Counter(kMetricSystemDiskOperationTime, - descrMetricSystemDiskOperationTime, - unitMetricSystemDiskOperationTime); - } - - static inline nostd::unique_ptr> - CreateSyncDoubleMetricSystemDiskOperationTime(metrics::Meter *meter) - { - return meter->CreateDoubleCounter(kMetricSystemDiskOperationTime, - descrMetricSystemDiskOperationTime, - unitMetricSystemDiskOperationTime); - } - - static inline nostd::shared_ptr - CreateAsyncInt64MetricSystemDiskOperationTime(metrics::Meter *meter) - { - return meter->CreateInt64ObservableCounter(kMetricSystemDiskOperationTime, +} + +/** + * Sum of the time each operation took to complete + *

                    + * Because it is the sum of time each request took, parallel-issued requests each contribute to make + * the count grow. Measured as:

                    • Linux: Fields 7 & 11 from procfs-diskstats
                    • + *
                    • Windows: "Avg. Disk sec/Read" perf counter multiplied by "Disk Reads/sec" perf counter + * (similar for Writes)
                    • + *
                    + *

                    + * counter + */ +static constexpr const char *kMetricSystemDiskOperationTime = "system.disk.operation_time"; +static constexpr const char *descrMetricSystemDiskOperationTime = + "Sum of the time each operation took to complete"; +static constexpr const char *unitMetricSystemDiskOperationTime = "s"; + +static inline nostd::unique_ptr> +CreateSyncInt64MetricSystemDiskOperationTime(metrics::Meter *meter) +{ + return meter->CreateUInt64Counter(kMetricSystemDiskOperationTime, + descrMetricSystemDiskOperationTime, + unitMetricSystemDiskOperationTime); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricSystemDiskOperationTime(metrics::Meter *meter) +{ + return meter->CreateDoubleCounter(kMetricSystemDiskOperationTime, + descrMetricSystemDiskOperationTime, + unitMetricSystemDiskOperationTime); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricSystemDiskOperationTime(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableCounter(kMetricSystemDiskOperationTime, + descrMetricSystemDiskOperationTime, + unitMetricSystemDiskOperationTime); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricSystemDiskOperationTime(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableCounter(kMetricSystemDiskOperationTime, descrMetricSystemDiskOperationTime, unitMetricSystemDiskOperationTime); - } - - static inline nostd::shared_ptr - CreateAsyncDoubleMetricSystemDiskOperationTime(metrics::Meter *meter) - { - return meter->CreateDoubleObservableCounter(kMetricSystemDiskOperationTime, - descrMetricSystemDiskOperationTime, - unitMetricSystemDiskOperationTime); - } - - /** - * counter - */ - static constexpr const char *kMetricSystemDiskOperations = "system.disk.operations"; - static constexpr const char *descrMetricSystemDiskOperations = ""; - static constexpr const char *unitMetricSystemDiskOperations = "{operation}"; - - static inline nostd::unique_ptr> - CreateSyncInt64MetricSystemDiskOperations(metrics::Meter *meter) - { - return meter->CreateUInt64Counter(kMetricSystemDiskOperations, descrMetricSystemDiskOperations, - unitMetricSystemDiskOperations); - } - - static inline nostd::unique_ptr> - CreateSyncDoubleMetricSystemDiskOperations(metrics::Meter *meter) - { - return meter->CreateDoubleCounter(kMetricSystemDiskOperations, descrMetricSystemDiskOperations, - unitMetricSystemDiskOperations); - } - - static inline nostd::shared_ptr - CreateAsyncInt64MetricSystemDiskOperations(metrics::Meter *meter) - { - return meter->CreateInt64ObservableCounter( - kMetricSystemDiskOperations, descrMetricSystemDiskOperations, unitMetricSystemDiskOperations); - } - - static inline nostd::shared_ptr - CreateAsyncDoubleMetricSystemDiskOperations(metrics::Meter *meter) - { - return meter->CreateDoubleObservableCounter( - kMetricSystemDiskOperations, descrMetricSystemDiskOperations, unitMetricSystemDiskOperations); - } - - /** - * The total storage capacity of the filesystem - *

                    - * updowncounter - */ - static constexpr const char *kMetricSystemFilesystemLimit = "system.filesystem.limit"; - static constexpr const char *descrMetricSystemFilesystemLimit = - "The total storage capacity of the filesystem"; - static constexpr const char *unitMetricSystemFilesystemLimit = "By"; - - static inline nostd::unique_ptr> - CreateSyncInt64MetricSystemFilesystemLimit(metrics::Meter *meter) - { - return meter->CreateInt64UpDownCounter(kMetricSystemFilesystemLimit, +} + +/** + * counter + */ +static constexpr const char *kMetricSystemDiskOperations = "system.disk.operations"; +static constexpr const char *descrMetricSystemDiskOperations = ""; +static constexpr const char *unitMetricSystemDiskOperations = "{operation}"; + +static inline nostd::unique_ptr> +CreateSyncInt64MetricSystemDiskOperations(metrics::Meter *meter) +{ + return meter->CreateUInt64Counter(kMetricSystemDiskOperations, descrMetricSystemDiskOperations, + unitMetricSystemDiskOperations); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricSystemDiskOperations(metrics::Meter *meter) +{ + return meter->CreateDoubleCounter(kMetricSystemDiskOperations, descrMetricSystemDiskOperations, + unitMetricSystemDiskOperations); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricSystemDiskOperations(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableCounter( + kMetricSystemDiskOperations, descrMetricSystemDiskOperations, unitMetricSystemDiskOperations); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricSystemDiskOperations(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableCounter( + kMetricSystemDiskOperations, descrMetricSystemDiskOperations, unitMetricSystemDiskOperations); +} + +/** + * The total storage capacity of the filesystem + *

                    + * updowncounter + */ +static constexpr const char *kMetricSystemFilesystemLimit = "system.filesystem.limit"; +static constexpr const char *descrMetricSystemFilesystemLimit = + "The total storage capacity of the filesystem"; +static constexpr const char *unitMetricSystemFilesystemLimit = "By"; + +static inline nostd::unique_ptr> +CreateSyncInt64MetricSystemFilesystemLimit(metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricSystemFilesystemLimit, + descrMetricSystemFilesystemLimit, + unitMetricSystemFilesystemLimit); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricSystemFilesystemLimit(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricSystemFilesystemLimit, descrMetricSystemFilesystemLimit, unitMetricSystemFilesystemLimit); - } - - static inline nostd::unique_ptr> - CreateSyncDoubleMetricSystemFilesystemLimit(metrics::Meter *meter) - { - return meter->CreateDoubleUpDownCounter(kMetricSystemFilesystemLimit, - descrMetricSystemFilesystemLimit, - unitMetricSystemFilesystemLimit); - } - - static inline nostd::shared_ptr - CreateAsyncInt64MetricSystemFilesystemLimit(metrics::Meter *meter) - { - return meter->CreateInt64ObservableUpDownCounter(kMetricSystemFilesystemLimit, +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricSystemFilesystemLimit(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter(kMetricSystemFilesystemLimit, + descrMetricSystemFilesystemLimit, + unitMetricSystemFilesystemLimit); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricSystemFilesystemLimit(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter(kMetricSystemFilesystemLimit, descrMetricSystemFilesystemLimit, unitMetricSystemFilesystemLimit); - } - - static inline nostd::shared_ptr - CreateAsyncDoubleMetricSystemFilesystemLimit(metrics::Meter *meter) - { - return meter->CreateDoubleObservableUpDownCounter(kMetricSystemFilesystemLimit, - descrMetricSystemFilesystemLimit, - unitMetricSystemFilesystemLimit); - } - - /** - * Reports a filesystem's space usage across different states. - *

                    - * The sum of all @code system.filesystem.usage @endcode values over the different @code - * system.filesystem.state @endcode attributes SHOULD equal the total storage capacity of the - * filesystem, that is @code system.filesystem.limit @endcode.

                    updowncounter - */ - static constexpr const char *kMetricSystemFilesystemUsage = "system.filesystem.usage"; - static constexpr const char *descrMetricSystemFilesystemUsage = - "Reports a filesystem's space usage across different states."; - static constexpr const char *unitMetricSystemFilesystemUsage = "By"; - - static inline nostd::unique_ptr> - CreateSyncInt64MetricSystemFilesystemUsage(metrics::Meter *meter) - { - return meter->CreateInt64UpDownCounter(kMetricSystemFilesystemUsage, +} + +/** + * Reports a filesystem's space usage across different states. + *

                    + * The sum of all @code system.filesystem.usage @endcode values over the different @code + * system.filesystem.state @endcode attributes SHOULD equal the total storage capacity of the + * filesystem, that is @code system.filesystem.limit @endcode.

                    updowncounter + */ +static constexpr const char *kMetricSystemFilesystemUsage = "system.filesystem.usage"; +static constexpr const char *descrMetricSystemFilesystemUsage = + "Reports a filesystem's space usage across different states."; +static constexpr const char *unitMetricSystemFilesystemUsage = "By"; + +static inline nostd::unique_ptr> +CreateSyncInt64MetricSystemFilesystemUsage(metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricSystemFilesystemUsage, + descrMetricSystemFilesystemUsage, + unitMetricSystemFilesystemUsage); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricSystemFilesystemUsage(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricSystemFilesystemUsage, descrMetricSystemFilesystemUsage, unitMetricSystemFilesystemUsage); - } - - static inline nostd::unique_ptr> - CreateSyncDoubleMetricSystemFilesystemUsage(metrics::Meter *meter) - { - return meter->CreateDoubleUpDownCounter(kMetricSystemFilesystemUsage, - descrMetricSystemFilesystemUsage, - unitMetricSystemFilesystemUsage); - } - - static inline nostd::shared_ptr - CreateAsyncInt64MetricSystemFilesystemUsage(metrics::Meter *meter) - { - return meter->CreateInt64ObservableUpDownCounter(kMetricSystemFilesystemUsage, +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricSystemFilesystemUsage(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter(kMetricSystemFilesystemUsage, + descrMetricSystemFilesystemUsage, + unitMetricSystemFilesystemUsage); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricSystemFilesystemUsage(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter(kMetricSystemFilesystemUsage, descrMetricSystemFilesystemUsage, unitMetricSystemFilesystemUsage); - } - - static inline nostd::shared_ptr - CreateAsyncDoubleMetricSystemFilesystemUsage(metrics::Meter *meter) - { - return meter->CreateDoubleObservableUpDownCounter(kMetricSystemFilesystemUsage, - descrMetricSystemFilesystemUsage, - unitMetricSystemFilesystemUsage); - } - - /** - * gauge - */ - static constexpr const char *kMetricSystemFilesystemUtilization = "system.filesystem.utilization"; - static constexpr const char *descrMetricSystemFilesystemUtilization = ""; - static constexpr const char *unitMetricSystemFilesystemUtilization = "1"; - - #if OPENTELEMETRY_ABI_VERSION_NO >= 2 - - static inline nostd::unique_ptr> - CreateSyncInt64MetricSystemFilesystemUtilization(metrics::Meter *meter) - { - return meter->CreateInt64Gauge(kMetricSystemFilesystemUtilization, +} + +/** + * gauge + */ +static constexpr const char *kMetricSystemFilesystemUtilization = "system.filesystem.utilization"; +static constexpr const char *descrMetricSystemFilesystemUtilization = ""; +static constexpr const char *unitMetricSystemFilesystemUtilization = "1"; + +#if OPENTELEMETRY_ABI_VERSION_NO >= 2 + +static inline nostd::unique_ptr> +CreateSyncInt64MetricSystemFilesystemUtilization(metrics::Meter *meter) +{ + return meter->CreateInt64Gauge(kMetricSystemFilesystemUtilization, + descrMetricSystemFilesystemUtilization, + unitMetricSystemFilesystemUtilization); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricSystemFilesystemUtilization(metrics::Meter *meter) +{ + return meter->CreateDoubleGauge(kMetricSystemFilesystemUtilization, descrMetricSystemFilesystemUtilization, unitMetricSystemFilesystemUtilization); - } - - static inline nostd::unique_ptr> - CreateSyncDoubleMetricSystemFilesystemUtilization(metrics::Meter *meter) - { - return meter->CreateDoubleGauge(kMetricSystemFilesystemUtilization, - descrMetricSystemFilesystemUtilization, - unitMetricSystemFilesystemUtilization); - } - #endif /* OPENTELEMETRY_ABI_VERSION_NO */ - - static inline nostd::shared_ptr - CreateAsyncInt64MetricSystemFilesystemUtilization(metrics::Meter *meter) - { - return meter->CreateInt64ObservableGauge(kMetricSystemFilesystemUtilization, +} +#endif /* OPENTELEMETRY_ABI_VERSION_NO */ + +static inline nostd::shared_ptr +CreateAsyncInt64MetricSystemFilesystemUtilization(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableGauge(kMetricSystemFilesystemUtilization, + descrMetricSystemFilesystemUtilization, + unitMetricSystemFilesystemUtilization); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricSystemFilesystemUtilization(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableGauge(kMetricSystemFilesystemUtilization, descrMetricSystemFilesystemUtilization, unitMetricSystemFilesystemUtilization); - } - - static inline nostd::shared_ptr - CreateAsyncDoubleMetricSystemFilesystemUtilization(metrics::Meter *meter) - { - return meter->CreateDoubleObservableGauge(kMetricSystemFilesystemUtilization, - descrMetricSystemFilesystemUtilization, - unitMetricSystemFilesystemUtilization); - } - - /** - * An estimate of how much memory is available for starting new applications, without causing - * swapping

                    This is an alternative to @code system.memory.usage @endcode metric with @code - * state=free @endcode. Linux starting from 3.14 exports "available" memory. It takes "free" memory - * as a baseline, and then factors in kernel-specific values. This is supposed to be more accurate - * than just "free" memory. For reference, see the calculations here. See also @code MemAvailable @endcode in /proc/meminfo.

                    updowncounter - */ - static constexpr const char *kMetricSystemLinuxMemoryAvailable = "system.linux.memory.available"; - static constexpr const char *descrMetricSystemLinuxMemoryAvailable = - "An estimate of how much memory is available for starting new applications, without causing " - "swapping"; - static constexpr const char *unitMetricSystemLinuxMemoryAvailable = "By"; - - static inline nostd::unique_ptr> - CreateSyncInt64MetricSystemLinuxMemoryAvailable(metrics::Meter *meter) - { - return meter->CreateInt64UpDownCounter(kMetricSystemLinuxMemoryAvailable, +} + +/** + * An estimate of how much memory is available for starting new applications, without causing + * swapping

                    This is an alternative to @code system.memory.usage @endcode metric with @code + * state=free @endcode. Linux starting from 3.14 exports "available" memory. It takes "free" memory + * as a baseline, and then factors in kernel-specific values. This is supposed to be more accurate + * than just "free" memory. For reference, see the calculations here. See also @code MemAvailable @endcode in /proc/meminfo.

                    updowncounter + */ +static constexpr const char *kMetricSystemLinuxMemoryAvailable = "system.linux.memory.available"; +static constexpr const char *descrMetricSystemLinuxMemoryAvailable = + "An estimate of how much memory is available for starting new applications, without causing " + "swapping"; +static constexpr const char *unitMetricSystemLinuxMemoryAvailable = "By"; + +static inline nostd::unique_ptr> +CreateSyncInt64MetricSystemLinuxMemoryAvailable(metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricSystemLinuxMemoryAvailable, + descrMetricSystemLinuxMemoryAvailable, + unitMetricSystemLinuxMemoryAvailable); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricSystemLinuxMemoryAvailable(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricSystemLinuxMemoryAvailable, descrMetricSystemLinuxMemoryAvailable, unitMetricSystemLinuxMemoryAvailable); - } - - static inline nostd::unique_ptr> - CreateSyncDoubleMetricSystemLinuxMemoryAvailable(metrics::Meter *meter) - { - return meter->CreateDoubleUpDownCounter(kMetricSystemLinuxMemoryAvailable, - descrMetricSystemLinuxMemoryAvailable, - unitMetricSystemLinuxMemoryAvailable); - } - - static inline nostd::shared_ptr - CreateAsyncInt64MetricSystemLinuxMemoryAvailable(metrics::Meter *meter) - { - return meter->CreateInt64ObservableUpDownCounter(kMetricSystemLinuxMemoryAvailable, +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricSystemLinuxMemoryAvailable(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter(kMetricSystemLinuxMemoryAvailable, + descrMetricSystemLinuxMemoryAvailable, + unitMetricSystemLinuxMemoryAvailable); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricSystemLinuxMemoryAvailable(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter(kMetricSystemLinuxMemoryAvailable, descrMetricSystemLinuxMemoryAvailable, unitMetricSystemLinuxMemoryAvailable); - } - - static inline nostd::shared_ptr - CreateAsyncDoubleMetricSystemLinuxMemoryAvailable(metrics::Meter *meter) - { - return meter->CreateDoubleObservableUpDownCounter(kMetricSystemLinuxMemoryAvailable, - descrMetricSystemLinuxMemoryAvailable, - unitMetricSystemLinuxMemoryAvailable); - } - - /** - * Reports the memory used by the Linux kernel for managing caches of frequently used objects. - *

                    - * The sum over the @code reclaimable @endcode and @code unreclaimable @endcode state values in - * @code linux.memory.slab.usage @endcode SHOULD be equal to the total slab memory available on the - * system. Note that the total slab memory is not constant and may vary over time. See also the Slab - * allocator and @code Slab @endcode in /proc/meminfo.

                    updowncounter - */ - static constexpr const char *kMetricSystemLinuxMemorySlabUsage = "system.linux.memory.slab.usage"; - static constexpr const char *descrMetricSystemLinuxMemorySlabUsage = - "Reports the memory used by the Linux kernel for managing caches of frequently used objects."; - static constexpr const char *unitMetricSystemLinuxMemorySlabUsage = "By"; - - static inline nostd::unique_ptr> - CreateSyncInt64MetricSystemLinuxMemorySlabUsage(metrics::Meter *meter) - { - return meter->CreateInt64UpDownCounter(kMetricSystemLinuxMemorySlabUsage, +} + +/** + * Reports the memory used by the Linux kernel for managing caches of frequently used objects. + *

                    + * The sum over the @code reclaimable @endcode and @code unreclaimable @endcode state values in + * @code linux.memory.slab.usage @endcode SHOULD be equal to the total slab memory available on the + * system. Note that the total slab memory is not constant and may vary over time. See also the Slab + * allocator and @code Slab @endcode in /proc/meminfo.

                    updowncounter + */ +static constexpr const char *kMetricSystemLinuxMemorySlabUsage = "system.linux.memory.slab.usage"; +static constexpr const char *descrMetricSystemLinuxMemorySlabUsage = + "Reports the memory used by the Linux kernel for managing caches of frequently used objects."; +static constexpr const char *unitMetricSystemLinuxMemorySlabUsage = "By"; + +static inline nostd::unique_ptr> +CreateSyncInt64MetricSystemLinuxMemorySlabUsage(metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricSystemLinuxMemorySlabUsage, + descrMetricSystemLinuxMemorySlabUsage, + unitMetricSystemLinuxMemorySlabUsage); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricSystemLinuxMemorySlabUsage(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricSystemLinuxMemorySlabUsage, descrMetricSystemLinuxMemorySlabUsage, unitMetricSystemLinuxMemorySlabUsage); - } - - static inline nostd::unique_ptr> - CreateSyncDoubleMetricSystemLinuxMemorySlabUsage(metrics::Meter *meter) - { - return meter->CreateDoubleUpDownCounter(kMetricSystemLinuxMemorySlabUsage, - descrMetricSystemLinuxMemorySlabUsage, - unitMetricSystemLinuxMemorySlabUsage); - } - - static inline nostd::shared_ptr - CreateAsyncInt64MetricSystemLinuxMemorySlabUsage(metrics::Meter *meter) - { - return meter->CreateInt64ObservableUpDownCounter(kMetricSystemLinuxMemorySlabUsage, +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricSystemLinuxMemorySlabUsage(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter(kMetricSystemLinuxMemorySlabUsage, + descrMetricSystemLinuxMemorySlabUsage, + unitMetricSystemLinuxMemorySlabUsage); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricSystemLinuxMemorySlabUsage(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter(kMetricSystemLinuxMemorySlabUsage, descrMetricSystemLinuxMemorySlabUsage, unitMetricSystemLinuxMemorySlabUsage); - } - - static inline nostd::shared_ptr - CreateAsyncDoubleMetricSystemLinuxMemorySlabUsage(metrics::Meter *meter) - { - return meter->CreateDoubleObservableUpDownCounter(kMetricSystemLinuxMemorySlabUsage, - descrMetricSystemLinuxMemorySlabUsage, - unitMetricSystemLinuxMemorySlabUsage); - } - - /** - * Total memory available in the system. - *

                    - * Its value SHOULD equal the sum of @code system.memory.state @endcode over all states. - *

                    - * updowncounter - */ - static constexpr const char *kMetricSystemMemoryLimit = "system.memory.limit"; - static constexpr const char *descrMetricSystemMemoryLimit = "Total memory available in the system."; - static constexpr const char *unitMetricSystemMemoryLimit = "By"; - - static inline nostd::unique_ptr> - CreateSyncInt64MetricSystemMemoryLimit(metrics::Meter *meter) - { - return meter->CreateInt64UpDownCounter(kMetricSystemMemoryLimit, descrMetricSystemMemoryLimit, +} + +/** + * Total memory available in the system. + *

                    + * Its value SHOULD equal the sum of @code system.memory.state @endcode over all states. + *

                    + * updowncounter + */ +static constexpr const char *kMetricSystemMemoryLimit = "system.memory.limit"; +static constexpr const char *descrMetricSystemMemoryLimit = "Total memory available in the system."; +static constexpr const char *unitMetricSystemMemoryLimit = "By"; + +static inline nostd::unique_ptr> +CreateSyncInt64MetricSystemMemoryLimit(metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricSystemMemoryLimit, descrMetricSystemMemoryLimit, + unitMetricSystemMemoryLimit); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricSystemMemoryLimit(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricSystemMemoryLimit, descrMetricSystemMemoryLimit, unitMetricSystemMemoryLimit); - } - - static inline nostd::unique_ptr> - CreateSyncDoubleMetricSystemMemoryLimit(metrics::Meter *meter) - { - return meter->CreateDoubleUpDownCounter(kMetricSystemMemoryLimit, descrMetricSystemMemoryLimit, - unitMetricSystemMemoryLimit); - } - - static inline nostd::shared_ptr - CreateAsyncInt64MetricSystemMemoryLimit(metrics::Meter *meter) - { - return meter->CreateInt64ObservableUpDownCounter( - kMetricSystemMemoryLimit, descrMetricSystemMemoryLimit, unitMetricSystemMemoryLimit); - } - - static inline nostd::shared_ptr - CreateAsyncDoubleMetricSystemMemoryLimit(metrics::Meter *meter) - { - return meter->CreateDoubleObservableUpDownCounter( - kMetricSystemMemoryLimit, descrMetricSystemMemoryLimit, unitMetricSystemMemoryLimit); - } - - /** - * Shared memory used (mostly by tmpfs). - *

                    - * Equivalent of @code shared @endcode from @code free @endcode command or - * @code Shmem @endcode from @code - * /proc/meminfo @endcode"

                    updowncounter - */ - static constexpr const char *kMetricSystemMemoryShared = "system.memory.shared"; - static constexpr const char *descrMetricSystemMemoryShared = - "Shared memory used (mostly by tmpfs)."; - static constexpr const char *unitMetricSystemMemoryShared = "By"; - - static inline nostd::unique_ptr> - CreateSyncInt64MetricSystemMemoryShared(metrics::Meter *meter) - { - return meter->CreateInt64UpDownCounter(kMetricSystemMemoryShared, descrMetricSystemMemoryShared, +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricSystemMemoryLimit(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter( + kMetricSystemMemoryLimit, descrMetricSystemMemoryLimit, unitMetricSystemMemoryLimit); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricSystemMemoryLimit(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter( + kMetricSystemMemoryLimit, descrMetricSystemMemoryLimit, unitMetricSystemMemoryLimit); +} + +/** + * Shared memory used (mostly by tmpfs). + *

                    + * Equivalent of @code shared @endcode from @code free @endcode command or + * @code Shmem @endcode from @code + * /proc/meminfo @endcode"

                    updowncounter + */ +static constexpr const char *kMetricSystemMemoryShared = "system.memory.shared"; +static constexpr const char *descrMetricSystemMemoryShared = + "Shared memory used (mostly by tmpfs)."; +static constexpr const char *unitMetricSystemMemoryShared = "By"; + +static inline nostd::unique_ptr> +CreateSyncInt64MetricSystemMemoryShared(metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricSystemMemoryShared, descrMetricSystemMemoryShared, + unitMetricSystemMemoryShared); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricSystemMemoryShared(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricSystemMemoryShared, descrMetricSystemMemoryShared, unitMetricSystemMemoryShared); - } - - static inline nostd::unique_ptr> - CreateSyncDoubleMetricSystemMemoryShared(metrics::Meter *meter) - { - return meter->CreateDoubleUpDownCounter(kMetricSystemMemoryShared, descrMetricSystemMemoryShared, - unitMetricSystemMemoryShared); - } - - static inline nostd::shared_ptr - CreateAsyncInt64MetricSystemMemoryShared(metrics::Meter *meter) - { - return meter->CreateInt64ObservableUpDownCounter( - kMetricSystemMemoryShared, descrMetricSystemMemoryShared, unitMetricSystemMemoryShared); - } - - static inline nostd::shared_ptr - CreateAsyncDoubleMetricSystemMemoryShared(metrics::Meter *meter) - { - return meter->CreateDoubleObservableUpDownCounter( - kMetricSystemMemoryShared, descrMetricSystemMemoryShared, unitMetricSystemMemoryShared); - } - - /** - * Reports memory in use by state. - *

                    - * The sum over all @code system.memory.state @endcode values SHOULD equal the total memory - * available on the system, that is @code system.memory.limit @endcode. - *

                    - * updowncounter - */ - static constexpr const char *kMetricSystemMemoryUsage = "system.memory.usage"; - static constexpr const char *descrMetricSystemMemoryUsage = "Reports memory in use by state."; - static constexpr const char *unitMetricSystemMemoryUsage = "By"; - - static inline nostd::unique_ptr> - CreateSyncInt64MetricSystemMemoryUsage(metrics::Meter *meter) - { - return meter->CreateInt64UpDownCounter(kMetricSystemMemoryUsage, descrMetricSystemMemoryUsage, +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricSystemMemoryShared(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter( + kMetricSystemMemoryShared, descrMetricSystemMemoryShared, unitMetricSystemMemoryShared); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricSystemMemoryShared(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter( + kMetricSystemMemoryShared, descrMetricSystemMemoryShared, unitMetricSystemMemoryShared); +} + +/** + * Reports memory in use by state. + *

                    + * The sum over all @code system.memory.state @endcode values SHOULD equal the total memory + * available on the system, that is @code system.memory.limit @endcode. + *

                    + * updowncounter + */ +static constexpr const char *kMetricSystemMemoryUsage = "system.memory.usage"; +static constexpr const char *descrMetricSystemMemoryUsage = "Reports memory in use by state."; +static constexpr const char *unitMetricSystemMemoryUsage = "By"; + +static inline nostd::unique_ptr> +CreateSyncInt64MetricSystemMemoryUsage(metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricSystemMemoryUsage, descrMetricSystemMemoryUsage, + unitMetricSystemMemoryUsage); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricSystemMemoryUsage(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricSystemMemoryUsage, descrMetricSystemMemoryUsage, unitMetricSystemMemoryUsage); - } - - static inline nostd::unique_ptr> - CreateSyncDoubleMetricSystemMemoryUsage(metrics::Meter *meter) - { - return meter->CreateDoubleUpDownCounter(kMetricSystemMemoryUsage, descrMetricSystemMemoryUsage, - unitMetricSystemMemoryUsage); - } - - static inline nostd::shared_ptr - CreateAsyncInt64MetricSystemMemoryUsage(metrics::Meter *meter) - { - return meter->CreateInt64ObservableUpDownCounter( - kMetricSystemMemoryUsage, descrMetricSystemMemoryUsage, unitMetricSystemMemoryUsage); - } - - static inline nostd::shared_ptr - CreateAsyncDoubleMetricSystemMemoryUsage(metrics::Meter *meter) - { - return meter->CreateDoubleObservableUpDownCounter( - kMetricSystemMemoryUsage, descrMetricSystemMemoryUsage, unitMetricSystemMemoryUsage); - } - - /** - * gauge - */ - static constexpr const char *kMetricSystemMemoryUtilization = "system.memory.utilization"; - static constexpr const char *descrMetricSystemMemoryUtilization = ""; - static constexpr const char *unitMetricSystemMemoryUtilization = "1"; - - #if OPENTELEMETRY_ABI_VERSION_NO >= 2 - - static inline nostd::unique_ptr> - CreateSyncInt64MetricSystemMemoryUtilization(metrics::Meter *meter) - { - return meter->CreateInt64Gauge(kMetricSystemMemoryUtilization, descrMetricSystemMemoryUtilization, +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricSystemMemoryUsage(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter( + kMetricSystemMemoryUsage, descrMetricSystemMemoryUsage, unitMetricSystemMemoryUsage); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricSystemMemoryUsage(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter( + kMetricSystemMemoryUsage, descrMetricSystemMemoryUsage, unitMetricSystemMemoryUsage); +} + +/** + * gauge + */ +static constexpr const char *kMetricSystemMemoryUtilization = "system.memory.utilization"; +static constexpr const char *descrMetricSystemMemoryUtilization = ""; +static constexpr const char *unitMetricSystemMemoryUtilization = "1"; + +#if OPENTELEMETRY_ABI_VERSION_NO >= 2 + +static inline nostd::unique_ptr> +CreateSyncInt64MetricSystemMemoryUtilization(metrics::Meter *meter) +{ + return meter->CreateInt64Gauge(kMetricSystemMemoryUtilization, descrMetricSystemMemoryUtilization, + unitMetricSystemMemoryUtilization); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricSystemMemoryUtilization(metrics::Meter *meter) +{ + return meter->CreateDoubleGauge(kMetricSystemMemoryUtilization, + descrMetricSystemMemoryUtilization, unitMetricSystemMemoryUtilization); - } - - static inline nostd::unique_ptr> - CreateSyncDoubleMetricSystemMemoryUtilization(metrics::Meter *meter) - { - return meter->CreateDoubleGauge(kMetricSystemMemoryUtilization, - descrMetricSystemMemoryUtilization, - unitMetricSystemMemoryUtilization); - } - #endif /* OPENTELEMETRY_ABI_VERSION_NO */ - - static inline nostd::shared_ptr - CreateAsyncInt64MetricSystemMemoryUtilization(metrics::Meter *meter) - { - return meter->CreateInt64ObservableGauge(kMetricSystemMemoryUtilization, +} +#endif /* OPENTELEMETRY_ABI_VERSION_NO */ + +static inline nostd::shared_ptr +CreateAsyncInt64MetricSystemMemoryUtilization(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableGauge(kMetricSystemMemoryUtilization, + descrMetricSystemMemoryUtilization, + unitMetricSystemMemoryUtilization); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricSystemMemoryUtilization(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableGauge(kMetricSystemMemoryUtilization, descrMetricSystemMemoryUtilization, unitMetricSystemMemoryUtilization); - } - - static inline nostd::shared_ptr - CreateAsyncDoubleMetricSystemMemoryUtilization(metrics::Meter *meter) - { - return meter->CreateDoubleObservableGauge(kMetricSystemMemoryUtilization, - descrMetricSystemMemoryUtilization, - unitMetricSystemMemoryUtilization); - } - - /** - * updowncounter - */ - static constexpr const char *kMetricSystemNetworkConnections = "system.network.connections"; - static constexpr const char *descrMetricSystemNetworkConnections = ""; - static constexpr const char *unitMetricSystemNetworkConnections = "{connection}"; - - static inline nostd::unique_ptr> - CreateSyncInt64MetricSystemNetworkConnections(metrics::Meter *meter) - { - return meter->CreateInt64UpDownCounter(kMetricSystemNetworkConnections, +} + +/** + * updowncounter + */ +static constexpr const char *kMetricSystemNetworkConnections = "system.network.connections"; +static constexpr const char *descrMetricSystemNetworkConnections = ""; +static constexpr const char *unitMetricSystemNetworkConnections = "{connection}"; + +static inline nostd::unique_ptr> +CreateSyncInt64MetricSystemNetworkConnections(metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricSystemNetworkConnections, + descrMetricSystemNetworkConnections, + unitMetricSystemNetworkConnections); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricSystemNetworkConnections(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricSystemNetworkConnections, descrMetricSystemNetworkConnections, unitMetricSystemNetworkConnections); - } - - static inline nostd::unique_ptr> - CreateSyncDoubleMetricSystemNetworkConnections(metrics::Meter *meter) - { - return meter->CreateDoubleUpDownCounter(kMetricSystemNetworkConnections, - descrMetricSystemNetworkConnections, - unitMetricSystemNetworkConnections); - } - - static inline nostd::shared_ptr - CreateAsyncInt64MetricSystemNetworkConnections(metrics::Meter *meter) - { - return meter->CreateInt64ObservableUpDownCounter(kMetricSystemNetworkConnections, +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricSystemNetworkConnections(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter(kMetricSystemNetworkConnections, + descrMetricSystemNetworkConnections, + unitMetricSystemNetworkConnections); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricSystemNetworkConnections(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter(kMetricSystemNetworkConnections, descrMetricSystemNetworkConnections, unitMetricSystemNetworkConnections); - } - - static inline nostd::shared_ptr - CreateAsyncDoubleMetricSystemNetworkConnections(metrics::Meter *meter) - { - return meter->CreateDoubleObservableUpDownCounter(kMetricSystemNetworkConnections, - descrMetricSystemNetworkConnections, - unitMetricSystemNetworkConnections); - } - - /** - * Count of packets that are dropped or discarded even though there was no error - *

                    - * Measured as: - *

                    - *

                    - * counter - */ - static constexpr const char *kMetricSystemNetworkDropped = "system.network.dropped"; - static constexpr const char *descrMetricSystemNetworkDropped = - "Count of packets that are dropped or discarded even though there was no error"; - static constexpr const char *unitMetricSystemNetworkDropped = "{packet}"; - - static inline nostd::unique_ptr> - CreateSyncInt64MetricSystemNetworkDropped(metrics::Meter *meter) - { - return meter->CreateUInt64Counter(kMetricSystemNetworkDropped, descrMetricSystemNetworkDropped, - unitMetricSystemNetworkDropped); - } - - static inline nostd::unique_ptr> - CreateSyncDoubleMetricSystemNetworkDropped(metrics::Meter *meter) - { - return meter->CreateDoubleCounter(kMetricSystemNetworkDropped, descrMetricSystemNetworkDropped, - unitMetricSystemNetworkDropped); - } - - static inline nostd::shared_ptr - CreateAsyncInt64MetricSystemNetworkDropped(metrics::Meter *meter) - { - return meter->CreateInt64ObservableCounter( - kMetricSystemNetworkDropped, descrMetricSystemNetworkDropped, unitMetricSystemNetworkDropped); - } - - static inline nostd::shared_ptr - CreateAsyncDoubleMetricSystemNetworkDropped(metrics::Meter *meter) - { - return meter->CreateDoubleObservableCounter( - kMetricSystemNetworkDropped, descrMetricSystemNetworkDropped, unitMetricSystemNetworkDropped); - } - - /** - * Count of network errors detected - *

                    - * Measured as: - *

                    - *

                    - * counter - */ - static constexpr const char *kMetricSystemNetworkErrors = "system.network.errors"; - static constexpr const char *descrMetricSystemNetworkErrors = "Count of network errors detected"; - static constexpr const char *unitMetricSystemNetworkErrors = "{error}"; - - static inline nostd::unique_ptr> - CreateSyncInt64MetricSystemNetworkErrors(metrics::Meter *meter) - { - return meter->CreateUInt64Counter(kMetricSystemNetworkErrors, descrMetricSystemNetworkErrors, - unitMetricSystemNetworkErrors); - } - - static inline nostd::unique_ptr> CreateSyncDoubleMetricSystemNetworkErrors( - metrics::Meter *meter) - { - return meter->CreateDoubleCounter(kMetricSystemNetworkErrors, descrMetricSystemNetworkErrors, - unitMetricSystemNetworkErrors); - } - - static inline nostd::shared_ptr - CreateAsyncInt64MetricSystemNetworkErrors(metrics::Meter *meter) - { - return meter->CreateInt64ObservableCounter( - kMetricSystemNetworkErrors, descrMetricSystemNetworkErrors, unitMetricSystemNetworkErrors); - } - - static inline nostd::shared_ptr - CreateAsyncDoubleMetricSystemNetworkErrors(metrics::Meter *meter) - { - return meter->CreateDoubleObservableCounter( - kMetricSystemNetworkErrors, descrMetricSystemNetworkErrors, unitMetricSystemNetworkErrors); - } - - /** - * counter - */ - static constexpr const char *kMetricSystemNetworkIo = "system.network.io"; - static constexpr const char *descrMetricSystemNetworkIo = ""; - static constexpr const char *unitMetricSystemNetworkIo = "By"; - - static inline nostd::unique_ptr> CreateSyncInt64MetricSystemNetworkIo( - metrics::Meter *meter) - { - return meter->CreateUInt64Counter(kMetricSystemNetworkIo, descrMetricSystemNetworkIo, - unitMetricSystemNetworkIo); - } - - static inline nostd::unique_ptr> CreateSyncDoubleMetricSystemNetworkIo( - metrics::Meter *meter) - { - return meter->CreateDoubleCounter(kMetricSystemNetworkIo, descrMetricSystemNetworkIo, - unitMetricSystemNetworkIo); - } - - static inline nostd::shared_ptr - CreateAsyncInt64MetricSystemNetworkIo(metrics::Meter *meter) - { - return meter->CreateInt64ObservableCounter(kMetricSystemNetworkIo, descrMetricSystemNetworkIo, +} + +/** + * Count of packets that are dropped or discarded even though there was no error + *

                    + * Measured as: + *

                    + *

                    + * counter + */ +static constexpr const char *kMetricSystemNetworkDropped = "system.network.dropped"; +static constexpr const char *descrMetricSystemNetworkDropped = + "Count of packets that are dropped or discarded even though there was no error"; +static constexpr const char *unitMetricSystemNetworkDropped = "{packet}"; + +static inline nostd::unique_ptr> +CreateSyncInt64MetricSystemNetworkDropped(metrics::Meter *meter) +{ + return meter->CreateUInt64Counter(kMetricSystemNetworkDropped, descrMetricSystemNetworkDropped, + unitMetricSystemNetworkDropped); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricSystemNetworkDropped(metrics::Meter *meter) +{ + return meter->CreateDoubleCounter(kMetricSystemNetworkDropped, descrMetricSystemNetworkDropped, + unitMetricSystemNetworkDropped); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricSystemNetworkDropped(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableCounter( + kMetricSystemNetworkDropped, descrMetricSystemNetworkDropped, unitMetricSystemNetworkDropped); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricSystemNetworkDropped(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableCounter( + kMetricSystemNetworkDropped, descrMetricSystemNetworkDropped, unitMetricSystemNetworkDropped); +} + +/** + * Count of network errors detected + *

                    + * Measured as: + *

                    + *

                    + * counter + */ +static constexpr const char *kMetricSystemNetworkErrors = "system.network.errors"; +static constexpr const char *descrMetricSystemNetworkErrors = "Count of network errors detected"; +static constexpr const char *unitMetricSystemNetworkErrors = "{error}"; + +static inline nostd::unique_ptr> +CreateSyncInt64MetricSystemNetworkErrors(metrics::Meter *meter) +{ + return meter->CreateUInt64Counter(kMetricSystemNetworkErrors, descrMetricSystemNetworkErrors, + unitMetricSystemNetworkErrors); +} + +static inline nostd::unique_ptr> CreateSyncDoubleMetricSystemNetworkErrors( + metrics::Meter *meter) +{ + return meter->CreateDoubleCounter(kMetricSystemNetworkErrors, descrMetricSystemNetworkErrors, + unitMetricSystemNetworkErrors); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricSystemNetworkErrors(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableCounter( + kMetricSystemNetworkErrors, descrMetricSystemNetworkErrors, unitMetricSystemNetworkErrors); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricSystemNetworkErrors(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableCounter( + kMetricSystemNetworkErrors, descrMetricSystemNetworkErrors, unitMetricSystemNetworkErrors); +} + +/** + * counter + */ +static constexpr const char *kMetricSystemNetworkIo = "system.network.io"; +static constexpr const char *descrMetricSystemNetworkIo = ""; +static constexpr const char *unitMetricSystemNetworkIo = "By"; + +static inline nostd::unique_ptr> CreateSyncInt64MetricSystemNetworkIo( + metrics::Meter *meter) +{ + return meter->CreateUInt64Counter(kMetricSystemNetworkIo, descrMetricSystemNetworkIo, + unitMetricSystemNetworkIo); +} + +static inline nostd::unique_ptr> CreateSyncDoubleMetricSystemNetworkIo( + metrics::Meter *meter) +{ + return meter->CreateDoubleCounter(kMetricSystemNetworkIo, descrMetricSystemNetworkIo, + unitMetricSystemNetworkIo); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricSystemNetworkIo(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableCounter(kMetricSystemNetworkIo, descrMetricSystemNetworkIo, + unitMetricSystemNetworkIo); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricSystemNetworkIo(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableCounter(kMetricSystemNetworkIo, descrMetricSystemNetworkIo, unitMetricSystemNetworkIo); - } - - static inline nostd::shared_ptr - CreateAsyncDoubleMetricSystemNetworkIo(metrics::Meter *meter) - { - return meter->CreateDoubleObservableCounter(kMetricSystemNetworkIo, descrMetricSystemNetworkIo, - unitMetricSystemNetworkIo); - } - - /** - * counter - */ - static constexpr const char *kMetricSystemNetworkPackets = "system.network.packets"; - static constexpr const char *descrMetricSystemNetworkPackets = ""; - static constexpr const char *unitMetricSystemNetworkPackets = "{packet}"; - - static inline nostd::unique_ptr> - CreateSyncInt64MetricSystemNetworkPackets(metrics::Meter *meter) - { - return meter->CreateUInt64Counter(kMetricSystemNetworkPackets, descrMetricSystemNetworkPackets, - unitMetricSystemNetworkPackets); - } - - static inline nostd::unique_ptr> - CreateSyncDoubleMetricSystemNetworkPackets(metrics::Meter *meter) - { - return meter->CreateDoubleCounter(kMetricSystemNetworkPackets, descrMetricSystemNetworkPackets, - unitMetricSystemNetworkPackets); - } - - static inline nostd::shared_ptr - CreateAsyncInt64MetricSystemNetworkPackets(metrics::Meter *meter) - { - return meter->CreateInt64ObservableCounter( - kMetricSystemNetworkPackets, descrMetricSystemNetworkPackets, unitMetricSystemNetworkPackets); - } - - static inline nostd::shared_ptr - CreateAsyncDoubleMetricSystemNetworkPackets(metrics::Meter *meter) - { - return meter->CreateDoubleObservableCounter( - kMetricSystemNetworkPackets, descrMetricSystemNetworkPackets, unitMetricSystemNetworkPackets); - } - - /** - * counter - */ - static constexpr const char *kMetricSystemPagingFaults = "system.paging.faults"; - static constexpr const char *descrMetricSystemPagingFaults = ""; - static constexpr const char *unitMetricSystemPagingFaults = "{fault}"; - - static inline nostd::unique_ptr> CreateSyncInt64MetricSystemPagingFaults( - metrics::Meter *meter) - { - return meter->CreateUInt64Counter(kMetricSystemPagingFaults, descrMetricSystemPagingFaults, - unitMetricSystemPagingFaults); - } - - static inline nostd::unique_ptr> CreateSyncDoubleMetricSystemPagingFaults( - metrics::Meter *meter) - { - return meter->CreateDoubleCounter(kMetricSystemPagingFaults, descrMetricSystemPagingFaults, - unitMetricSystemPagingFaults); - } - - static inline nostd::shared_ptr - CreateAsyncInt64MetricSystemPagingFaults(metrics::Meter *meter) - { - return meter->CreateInt64ObservableCounter( - kMetricSystemPagingFaults, descrMetricSystemPagingFaults, unitMetricSystemPagingFaults); - } - - static inline nostd::shared_ptr - CreateAsyncDoubleMetricSystemPagingFaults(metrics::Meter *meter) - { - return meter->CreateDoubleObservableCounter( - kMetricSystemPagingFaults, descrMetricSystemPagingFaults, unitMetricSystemPagingFaults); - } - - /** - * counter - */ - static constexpr const char *kMetricSystemPagingOperations = "system.paging.operations"; - static constexpr const char *descrMetricSystemPagingOperations = ""; - static constexpr const char *unitMetricSystemPagingOperations = "{operation}"; - - static inline nostd::unique_ptr> - CreateSyncInt64MetricSystemPagingOperations(metrics::Meter *meter) - { - return meter->CreateUInt64Counter(kMetricSystemPagingOperations, - descrMetricSystemPagingOperations, - unitMetricSystemPagingOperations); - } - - static inline nostd::unique_ptr> - CreateSyncDoubleMetricSystemPagingOperations(metrics::Meter *meter) - { - return meter->CreateDoubleCounter(kMetricSystemPagingOperations, - descrMetricSystemPagingOperations, - unitMetricSystemPagingOperations); - } - - static inline nostd::shared_ptr - CreateAsyncInt64MetricSystemPagingOperations(metrics::Meter *meter) - { - return meter->CreateInt64ObservableCounter(kMetricSystemPagingOperations, +} + +/** + * counter + */ +static constexpr const char *kMetricSystemNetworkPackets = "system.network.packets"; +static constexpr const char *descrMetricSystemNetworkPackets = ""; +static constexpr const char *unitMetricSystemNetworkPackets = "{packet}"; + +static inline nostd::unique_ptr> +CreateSyncInt64MetricSystemNetworkPackets(metrics::Meter *meter) +{ + return meter->CreateUInt64Counter(kMetricSystemNetworkPackets, descrMetricSystemNetworkPackets, + unitMetricSystemNetworkPackets); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricSystemNetworkPackets(metrics::Meter *meter) +{ + return meter->CreateDoubleCounter(kMetricSystemNetworkPackets, descrMetricSystemNetworkPackets, + unitMetricSystemNetworkPackets); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricSystemNetworkPackets(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableCounter( + kMetricSystemNetworkPackets, descrMetricSystemNetworkPackets, unitMetricSystemNetworkPackets); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricSystemNetworkPackets(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableCounter( + kMetricSystemNetworkPackets, descrMetricSystemNetworkPackets, unitMetricSystemNetworkPackets); +} + +/** + * counter + */ +static constexpr const char *kMetricSystemPagingFaults = "system.paging.faults"; +static constexpr const char *descrMetricSystemPagingFaults = ""; +static constexpr const char *unitMetricSystemPagingFaults = "{fault}"; + +static inline nostd::unique_ptr> CreateSyncInt64MetricSystemPagingFaults( + metrics::Meter *meter) +{ + return meter->CreateUInt64Counter(kMetricSystemPagingFaults, descrMetricSystemPagingFaults, + unitMetricSystemPagingFaults); +} + +static inline nostd::unique_ptr> CreateSyncDoubleMetricSystemPagingFaults( + metrics::Meter *meter) +{ + return meter->CreateDoubleCounter(kMetricSystemPagingFaults, descrMetricSystemPagingFaults, + unitMetricSystemPagingFaults); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricSystemPagingFaults(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableCounter( + kMetricSystemPagingFaults, descrMetricSystemPagingFaults, unitMetricSystemPagingFaults); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricSystemPagingFaults(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableCounter( + kMetricSystemPagingFaults, descrMetricSystemPagingFaults, unitMetricSystemPagingFaults); +} + +/** + * counter + */ +static constexpr const char *kMetricSystemPagingOperations = "system.paging.operations"; +static constexpr const char *descrMetricSystemPagingOperations = ""; +static constexpr const char *unitMetricSystemPagingOperations = "{operation}"; + +static inline nostd::unique_ptr> +CreateSyncInt64MetricSystemPagingOperations(metrics::Meter *meter) +{ + return meter->CreateUInt64Counter(kMetricSystemPagingOperations, + descrMetricSystemPagingOperations, + unitMetricSystemPagingOperations); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricSystemPagingOperations(metrics::Meter *meter) +{ + return meter->CreateDoubleCounter(kMetricSystemPagingOperations, + descrMetricSystemPagingOperations, + unitMetricSystemPagingOperations); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricSystemPagingOperations(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableCounter(kMetricSystemPagingOperations, + descrMetricSystemPagingOperations, + unitMetricSystemPagingOperations); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricSystemPagingOperations(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableCounter(kMetricSystemPagingOperations, descrMetricSystemPagingOperations, unitMetricSystemPagingOperations); - } - - static inline nostd::shared_ptr - CreateAsyncDoubleMetricSystemPagingOperations(metrics::Meter *meter) - { - return meter->CreateDoubleObservableCounter(kMetricSystemPagingOperations, - descrMetricSystemPagingOperations, - unitMetricSystemPagingOperations); - } - - /** - * Unix swap or windows pagefile usage - *

                    - * updowncounter - */ - static constexpr const char *kMetricSystemPagingUsage = "system.paging.usage"; - static constexpr const char *descrMetricSystemPagingUsage = "Unix swap or windows pagefile usage"; - static constexpr const char *unitMetricSystemPagingUsage = "By"; - - static inline nostd::unique_ptr> - CreateSyncInt64MetricSystemPagingUsage(metrics::Meter *meter) - { - return meter->CreateInt64UpDownCounter(kMetricSystemPagingUsage, descrMetricSystemPagingUsage, +} + +/** + * Unix swap or windows pagefile usage + *

                    + * updowncounter + */ +static constexpr const char *kMetricSystemPagingUsage = "system.paging.usage"; +static constexpr const char *descrMetricSystemPagingUsage = "Unix swap or windows pagefile usage"; +static constexpr const char *unitMetricSystemPagingUsage = "By"; + +static inline nostd::unique_ptr> +CreateSyncInt64MetricSystemPagingUsage(metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricSystemPagingUsage, descrMetricSystemPagingUsage, + unitMetricSystemPagingUsage); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricSystemPagingUsage(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricSystemPagingUsage, descrMetricSystemPagingUsage, unitMetricSystemPagingUsage); - } - - static inline nostd::unique_ptr> - CreateSyncDoubleMetricSystemPagingUsage(metrics::Meter *meter) - { - return meter->CreateDoubleUpDownCounter(kMetricSystemPagingUsage, descrMetricSystemPagingUsage, - unitMetricSystemPagingUsage); - } - - static inline nostd::shared_ptr - CreateAsyncInt64MetricSystemPagingUsage(metrics::Meter *meter) - { - return meter->CreateInt64ObservableUpDownCounter( - kMetricSystemPagingUsage, descrMetricSystemPagingUsage, unitMetricSystemPagingUsage); - } - - static inline nostd::shared_ptr - CreateAsyncDoubleMetricSystemPagingUsage(metrics::Meter *meter) - { - return meter->CreateDoubleObservableUpDownCounter( - kMetricSystemPagingUsage, descrMetricSystemPagingUsage, unitMetricSystemPagingUsage); - } - - /** - * gauge - */ - static constexpr const char *kMetricSystemPagingUtilization = "system.paging.utilization"; - static constexpr const char *descrMetricSystemPagingUtilization = ""; - static constexpr const char *unitMetricSystemPagingUtilization = "1"; - - #if OPENTELEMETRY_ABI_VERSION_NO >= 2 - - static inline nostd::unique_ptr> - CreateSyncInt64MetricSystemPagingUtilization(metrics::Meter *meter) - { - return meter->CreateInt64Gauge(kMetricSystemPagingUtilization, descrMetricSystemPagingUtilization, +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricSystemPagingUsage(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter( + kMetricSystemPagingUsage, descrMetricSystemPagingUsage, unitMetricSystemPagingUsage); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricSystemPagingUsage(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter( + kMetricSystemPagingUsage, descrMetricSystemPagingUsage, unitMetricSystemPagingUsage); +} + +/** + * gauge + */ +static constexpr const char *kMetricSystemPagingUtilization = "system.paging.utilization"; +static constexpr const char *descrMetricSystemPagingUtilization = ""; +static constexpr const char *unitMetricSystemPagingUtilization = "1"; + +#if OPENTELEMETRY_ABI_VERSION_NO >= 2 + +static inline nostd::unique_ptr> +CreateSyncInt64MetricSystemPagingUtilization(metrics::Meter *meter) +{ + return meter->CreateInt64Gauge(kMetricSystemPagingUtilization, descrMetricSystemPagingUtilization, + unitMetricSystemPagingUtilization); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricSystemPagingUtilization(metrics::Meter *meter) +{ + return meter->CreateDoubleGauge(kMetricSystemPagingUtilization, + descrMetricSystemPagingUtilization, unitMetricSystemPagingUtilization); - } - - static inline nostd::unique_ptr> - CreateSyncDoubleMetricSystemPagingUtilization(metrics::Meter *meter) - { - return meter->CreateDoubleGauge(kMetricSystemPagingUtilization, - descrMetricSystemPagingUtilization, - unitMetricSystemPagingUtilization); - } - #endif /* OPENTELEMETRY_ABI_VERSION_NO */ - - static inline nostd::shared_ptr - CreateAsyncInt64MetricSystemPagingUtilization(metrics::Meter *meter) - { - return meter->CreateInt64ObservableGauge(kMetricSystemPagingUtilization, +} +#endif /* OPENTELEMETRY_ABI_VERSION_NO */ + +static inline nostd::shared_ptr +CreateAsyncInt64MetricSystemPagingUtilization(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableGauge(kMetricSystemPagingUtilization, + descrMetricSystemPagingUtilization, + unitMetricSystemPagingUtilization); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricSystemPagingUtilization(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableGauge(kMetricSystemPagingUtilization, descrMetricSystemPagingUtilization, unitMetricSystemPagingUtilization); - } - - static inline nostd::shared_ptr - CreateAsyncDoubleMetricSystemPagingUtilization(metrics::Meter *meter) - { - return meter->CreateDoubleObservableGauge(kMetricSystemPagingUtilization, - descrMetricSystemPagingUtilization, - unitMetricSystemPagingUtilization); - } - - /** - * Total number of processes in each state - *

                    - * updowncounter - */ - static constexpr const char *kMetricSystemProcessCount = "system.process.count"; - static constexpr const char *descrMetricSystemProcessCount = - "Total number of processes in each state"; - static constexpr const char *unitMetricSystemProcessCount = "{process}"; - - static inline nostd::unique_ptr> - CreateSyncInt64MetricSystemProcessCount(metrics::Meter *meter) - { - return meter->CreateInt64UpDownCounter(kMetricSystemProcessCount, descrMetricSystemProcessCount, +} + +/** + * Total number of processes in each state + *

                    + * updowncounter + */ +static constexpr const char *kMetricSystemProcessCount = "system.process.count"; +static constexpr const char *descrMetricSystemProcessCount = + "Total number of processes in each state"; +static constexpr const char *unitMetricSystemProcessCount = "{process}"; + +static inline nostd::unique_ptr> +CreateSyncInt64MetricSystemProcessCount(metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricSystemProcessCount, descrMetricSystemProcessCount, + unitMetricSystemProcessCount); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricSystemProcessCount(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricSystemProcessCount, descrMetricSystemProcessCount, unitMetricSystemProcessCount); - } - - static inline nostd::unique_ptr> - CreateSyncDoubleMetricSystemProcessCount(metrics::Meter *meter) - { - return meter->CreateDoubleUpDownCounter(kMetricSystemProcessCount, descrMetricSystemProcessCount, - unitMetricSystemProcessCount); - } - - static inline nostd::shared_ptr - CreateAsyncInt64MetricSystemProcessCount(metrics::Meter *meter) - { - return meter->CreateInt64ObservableUpDownCounter( - kMetricSystemProcessCount, descrMetricSystemProcessCount, unitMetricSystemProcessCount); - } - - static inline nostd::shared_ptr - CreateAsyncDoubleMetricSystemProcessCount(metrics::Meter *meter) - { - return meter->CreateDoubleObservableUpDownCounter( - kMetricSystemProcessCount, descrMetricSystemProcessCount, unitMetricSystemProcessCount); - } - - /** - * Total number of processes created over uptime of the host - *

                    - * counter - */ - static constexpr const char *kMetricSystemProcessCreated = "system.process.created"; - static constexpr const char *descrMetricSystemProcessCreated = - "Total number of processes created over uptime of the host"; - static constexpr const char *unitMetricSystemProcessCreated = "{process}"; - - static inline nostd::unique_ptr> - CreateSyncInt64MetricSystemProcessCreated(metrics::Meter *meter) - { - return meter->CreateUInt64Counter(kMetricSystemProcessCreated, descrMetricSystemProcessCreated, - unitMetricSystemProcessCreated); - } - - static inline nostd::unique_ptr> - CreateSyncDoubleMetricSystemProcessCreated(metrics::Meter *meter) - { - return meter->CreateDoubleCounter(kMetricSystemProcessCreated, descrMetricSystemProcessCreated, - unitMetricSystemProcessCreated); - } - - static inline nostd::shared_ptr - CreateAsyncInt64MetricSystemProcessCreated(metrics::Meter *meter) - { - return meter->CreateInt64ObservableCounter( - kMetricSystemProcessCreated, descrMetricSystemProcessCreated, unitMetricSystemProcessCreated); - } - - static inline nostd::shared_ptr - CreateAsyncDoubleMetricSystemProcessCreated(metrics::Meter *meter) - { - return meter->CreateDoubleObservableCounter( - kMetricSystemProcessCreated, descrMetricSystemProcessCreated, unitMetricSystemProcessCreated); - } - - /** - * The time the system has been running - *

                    - * Instrumentations SHOULD use a gauge with type @code double @endcode and measure uptime in seconds - * as a floating point number with the highest precision available. The actual accuracy would depend - * on the instrumentation and operating system.

                    gauge - */ - static constexpr const char *kMetricSystemUptime = "system.uptime"; - static constexpr const char *descrMetricSystemUptime = "The time the system has been running"; - static constexpr const char *unitMetricSystemUptime = "s"; - - #if OPENTELEMETRY_ABI_VERSION_NO >= 2 - - static inline nostd::unique_ptr> CreateSyncInt64MetricSystemUptime( - metrics::Meter *meter) - { - return meter->CreateInt64Gauge(kMetricSystemUptime, descrMetricSystemUptime, +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricSystemProcessCount(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter( + kMetricSystemProcessCount, descrMetricSystemProcessCount, unitMetricSystemProcessCount); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricSystemProcessCount(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter( + kMetricSystemProcessCount, descrMetricSystemProcessCount, unitMetricSystemProcessCount); +} + +/** + * Total number of processes created over uptime of the host + *

                    + * counter + */ +static constexpr const char *kMetricSystemProcessCreated = "system.process.created"; +static constexpr const char *descrMetricSystemProcessCreated = + "Total number of processes created over uptime of the host"; +static constexpr const char *unitMetricSystemProcessCreated = "{process}"; + +static inline nostd::unique_ptr> +CreateSyncInt64MetricSystemProcessCreated(metrics::Meter *meter) +{ + return meter->CreateUInt64Counter(kMetricSystemProcessCreated, descrMetricSystemProcessCreated, + unitMetricSystemProcessCreated); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricSystemProcessCreated(metrics::Meter *meter) +{ + return meter->CreateDoubleCounter(kMetricSystemProcessCreated, descrMetricSystemProcessCreated, + unitMetricSystemProcessCreated); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricSystemProcessCreated(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableCounter( + kMetricSystemProcessCreated, descrMetricSystemProcessCreated, unitMetricSystemProcessCreated); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricSystemProcessCreated(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableCounter( + kMetricSystemProcessCreated, descrMetricSystemProcessCreated, unitMetricSystemProcessCreated); +} + +/** + * The time the system has been running + *

                    + * Instrumentations SHOULD use a gauge with type @code double @endcode and measure uptime in seconds + * as a floating point number with the highest precision available. The actual accuracy would depend + * on the instrumentation and operating system.

                    gauge + */ +static constexpr const char *kMetricSystemUptime = "system.uptime"; +static constexpr const char *descrMetricSystemUptime = "The time the system has been running"; +static constexpr const char *unitMetricSystemUptime = "s"; + +#if OPENTELEMETRY_ABI_VERSION_NO >= 2 + +static inline nostd::unique_ptr> CreateSyncInt64MetricSystemUptime( + metrics::Meter *meter) +{ + return meter->CreateInt64Gauge(kMetricSystemUptime, descrMetricSystemUptime, + unitMetricSystemUptime); +} + +static inline nostd::unique_ptr> CreateSyncDoubleMetricSystemUptime( + metrics::Meter *meter) +{ + return meter->CreateDoubleGauge(kMetricSystemUptime, descrMetricSystemUptime, unitMetricSystemUptime); - } - - static inline nostd::unique_ptr> CreateSyncDoubleMetricSystemUptime( - metrics::Meter *meter) - { - return meter->CreateDoubleGauge(kMetricSystemUptime, descrMetricSystemUptime, - unitMetricSystemUptime); - } - #endif /* OPENTELEMETRY_ABI_VERSION_NO */ - - static inline nostd::shared_ptr CreateAsyncInt64MetricSystemUptime( - metrics::Meter *meter) - { - return meter->CreateInt64ObservableGauge(kMetricSystemUptime, descrMetricSystemUptime, +} +#endif /* OPENTELEMETRY_ABI_VERSION_NO */ + +static inline nostd::shared_ptr CreateAsyncInt64MetricSystemUptime( + metrics::Meter *meter) +{ + return meter->CreateInt64ObservableGauge(kMetricSystemUptime, descrMetricSystemUptime, + unitMetricSystemUptime); +} + +static inline nostd::shared_ptr CreateAsyncDoubleMetricSystemUptime( + metrics::Meter *meter) +{ + return meter->CreateDoubleObservableGauge(kMetricSystemUptime, descrMetricSystemUptime, unitMetricSystemUptime); - } - - static inline nostd::shared_ptr CreateAsyncDoubleMetricSystemUptime( - metrics::Meter *meter) - { - return meter->CreateDoubleObservableGauge(kMetricSystemUptime, descrMetricSystemUptime, - unitMetricSystemUptime); - } - - } // namespace system - } // namespace semconv - OPENTELEMETRY_END_NAMESPACE \ No newline at end of file +} + +} // namespace system +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE \ No newline at end of file diff --git a/api/include/opentelemetry/semconv/incubating/url_attributes.h b/api/include/opentelemetry/semconv/incubating/url_attributes.h index c6584d50fd..547136ea3f 100644 --- a/api/include/opentelemetry/semconv/incubating/url_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/url_attributes.h @@ -8,166 +8,166 @@ * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 */ - #pragma once - - #include "opentelemetry/common/macros.h" - #include "opentelemetry/version.h" - - OPENTELEMETRY_BEGIN_NAMESPACE - namespace semconv - { - namespace url - { - - /** - * Domain extracted from the @code url.full @endcode, such as "opentelemetry.io". - *

                    - * In some cases a URL may refer to an IP and/or port directly, without a domain name. In this case, - * the IP address would go to the domain field. If the URL contains a literal IPv6 address enclosed by - * @code [ @endcode and @code ] @endcode, the @code [ @endcode and @code ] @endcode characters - * should also be captured in the domain field. - */ - static constexpr const char *kUrlDomain = "url.domain"; - - /** - * The file extension extracted from the @code url.full @endcode, excluding the leading dot. - *

                    - * The file extension is only set if it exists, as not every url has a file extension. When the file - * name has multiple extensions @code example.tar.gz @endcode, only the last one should be captured - * @code gz @endcode, not @code tar.gz @endcode. - */ - static constexpr const char *kUrlExtension = "url.extension"; - - /** - * The URI fragment component - */ - static constexpr const char *kUrlFragment = "url.fragment"; - - /** - * Absolute URL describing a network resource according to RFC3986

                    For network calls, URL usually has - * @code scheme://host[:port][path][?query][#fragment] @endcode format, where the fragment is not - * transmitted over HTTP, but if it is known, it SHOULD be included nevertheless.

                    - * @code url.full @endcode MUST NOT contain credentials passed via URL in form of @code - * https://username:password@www.example.com/ @endcode. In such case username and password SHOULD be - * redacted and attribute's value SHOULD be @code https://REDACTED:REDACTED@www.example.com/ - * @endcode.

                    - * @code url.full @endcode SHOULD capture the absolute URL when it is available (or can be - * reconstructed).

                    Sensitive content provided in @code url.full @endcode SHOULD be scrubbed when - * instrumentations can identify it.

                    - * - * Query string values for the following keys SHOULD be redacted by default and replaced by the - * value @code REDACTED @endcode: - *

                    - *

                    - * This list is subject to change over time. - *

                    - * When a query string value is redacted, the query string key SHOULD still be preserved, e.g. - * @code https://www.example.com/path?color=blue&sig=REDACTED @endcode. - */ - static constexpr const char *kUrlFull = "url.full"; - - /** - * Unmodified original URL as seen in the event source. - *

                    - * In network monitoring, the observed URL may be a full URL, whereas in access logs, the URL is - * often just represented as a path. This field is meant to represent the URL as it was observed, - * complete or not. - * @code url.original @endcode might contain credentials passed via URL in form of @code - * https://username:password@www.example.com/ @endcode. In such case password and username SHOULD - * NOT be redacted and attribute's value SHOULD remain the same. - */ - static constexpr const char *kUrlOriginal = "url.original"; - - /** - * The URI path component - *

                    - * Sensitive content provided in @code url.path @endcode SHOULD be scrubbed when instrumentations - * can identify it. - */ - static constexpr const char *kUrlPath = "url.path"; - - /** - * Port extracted from the @code url.full @endcode - */ - static constexpr const char *kUrlPort = "url.port"; - - /** - * The URI query component - *

                    - * Sensitive content provided in @code url.query @endcode SHOULD be scrubbed when instrumentations - * can identify it.

                    - * - * Query string values for the following keys SHOULD be redacted by default and replaced by the - * value @code REDACTED @endcode:

                    - *

                    - * This list is subject to change over time. - *

                    - * When a query string value is redacted, the query string key SHOULD still be preserved, e.g. - * @code q=OpenTelemetry&sig=REDACTED @endcode. - */ - static constexpr const char *kUrlQuery = "url.query"; - - /** - * The highest registered url domain, stripped of the subdomain. - *

                    - * This value can be determined precisely with the public suffix - * list. For example, the registered domain for @code foo.example.com @endcode is @code - * example.com @endcode. Trying to approximate this by simply taking the last two labels will not - * work well for TLDs such as @code co.uk @endcode. - */ - static constexpr const char *kUrlRegisteredDomain = "url.registered_domain"; - - /** - * The URI scheme component - * identifying the used protocol. - */ - static constexpr const char *kUrlScheme = "url.scheme"; - - /** - * The subdomain portion of a fully qualified domain name includes all of the names except the host - * name under the registered_domain. In a partially qualified domain, or if the qualification level - * of the full name cannot be determined, subdomain contains all of the names below the registered - * domain.

                    The subdomain portion of @code www.east.mydomain.co.uk @endcode is @code east - * @endcode. If the domain has multiple levels of subdomain, such as @code sub2.sub1.example.com - * @endcode, the subdomain field should contain @code sub2.sub1 @endcode, with no trailing period. - */ - static constexpr const char *kUrlSubdomain = "url.subdomain"; - - /** - * The low-cardinality template of an absolute path reference. - */ - static constexpr const char *kUrlTemplate = "url.template"; - - /** - * The effective top level domain (eTLD), also known as the domain suffix, is the last part of the - * domain name. For example, the top level domain for example.com is @code com @endcode.

                    This - * value can be determined precisely with the public suffix - * list. - */ - static constexpr const char *kUrlTopLevelDomain = "url.top_level_domain"; - - } // namespace url - } // namespace semconv - OPENTELEMETRY_END_NAMESPACE \ No newline at end of file +#pragma once + +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace url +{ + +/** + * Domain extracted from the @code url.full @endcode, such as "opentelemetry.io". + *

                    + * In some cases a URL may refer to an IP and/or port directly, without a domain name. In this case, + * the IP address would go to the domain field. If the URL contains a literal IPv6 address enclosed by + * @code [ @endcode and @code ] @endcode, the @code [ @endcode and @code ] @endcode characters + * should also be captured in the domain field. + */ +static constexpr const char *kUrlDomain = "url.domain"; + +/** + * The file extension extracted from the @code url.full @endcode, excluding the leading dot. + *

                    + * The file extension is only set if it exists, as not every url has a file extension. When the file + * name has multiple extensions @code example.tar.gz @endcode, only the last one should be captured + * @code gz @endcode, not @code tar.gz @endcode. + */ +static constexpr const char *kUrlExtension = "url.extension"; + +/** + * The URI fragment component + */ +static constexpr const char *kUrlFragment = "url.fragment"; + +/** + * Absolute URL describing a network resource according to RFC3986

                    For network calls, URL usually has + * @code scheme://host[:port][path][?query][#fragment] @endcode format, where the fragment is not + * transmitted over HTTP, but if it is known, it SHOULD be included nevertheless.

                    + * @code url.full @endcode MUST NOT contain credentials passed via URL in form of @code + * https://username:password@www.example.com/ @endcode. In such case username and password SHOULD be + * redacted and attribute's value SHOULD be @code https://REDACTED:REDACTED@www.example.com/ + * @endcode.

                    + * @code url.full @endcode SHOULD capture the absolute URL when it is available (or can be + * reconstructed).

                    Sensitive content provided in @code url.full @endcode SHOULD be scrubbed when + * instrumentations can identify it.

                    + * + * Query string values for the following keys SHOULD be redacted by default and replaced by the + * value @code REDACTED @endcode: + *

                    + *

                    + * This list is subject to change over time. + *

                    + * When a query string value is redacted, the query string key SHOULD still be preserved, e.g. + * @code https://www.example.com/path?color=blue&sig=REDACTED @endcode. + */ +static constexpr const char *kUrlFull = "url.full"; + +/** + * Unmodified original URL as seen in the event source. + *

                    + * In network monitoring, the observed URL may be a full URL, whereas in access logs, the URL is + * often just represented as a path. This field is meant to represent the URL as it was observed, + * complete or not. + * @code url.original @endcode might contain credentials passed via URL in form of @code + * https://username:password@www.example.com/ @endcode. In such case password and username SHOULD + * NOT be redacted and attribute's value SHOULD remain the same. + */ +static constexpr const char *kUrlOriginal = "url.original"; + +/** + * The URI path component + *

                    + * Sensitive content provided in @code url.path @endcode SHOULD be scrubbed when instrumentations + * can identify it. + */ +static constexpr const char *kUrlPath = "url.path"; + +/** + * Port extracted from the @code url.full @endcode + */ +static constexpr const char *kUrlPort = "url.port"; + +/** + * The URI query component + *

                    + * Sensitive content provided in @code url.query @endcode SHOULD be scrubbed when instrumentations + * can identify it.

                    + * + * Query string values for the following keys SHOULD be redacted by default and replaced by the + * value @code REDACTED @endcode:

                    + *

                    + * This list is subject to change over time. + *

                    + * When a query string value is redacted, the query string key SHOULD still be preserved, e.g. + * @code q=OpenTelemetry&sig=REDACTED @endcode. + */ +static constexpr const char *kUrlQuery = "url.query"; + +/** + * The highest registered url domain, stripped of the subdomain. + *

                    + * This value can be determined precisely with the public suffix + * list. For example, the registered domain for @code foo.example.com @endcode is @code + * example.com @endcode. Trying to approximate this by simply taking the last two labels will not + * work well for TLDs such as @code co.uk @endcode. + */ +static constexpr const char *kUrlRegisteredDomain = "url.registered_domain"; + +/** + * The URI scheme component + * identifying the used protocol. + */ +static constexpr const char *kUrlScheme = "url.scheme"; + +/** + * The subdomain portion of a fully qualified domain name includes all of the names except the host + * name under the registered_domain. In a partially qualified domain, or if the qualification level + * of the full name cannot be determined, subdomain contains all of the names below the registered + * domain.

                    The subdomain portion of @code www.east.mydomain.co.uk @endcode is @code east + * @endcode. If the domain has multiple levels of subdomain, such as @code sub2.sub1.example.com + * @endcode, the subdomain field should contain @code sub2.sub1 @endcode, with no trailing period. + */ +static constexpr const char *kUrlSubdomain = "url.subdomain"; + +/** + * The low-cardinality template of an absolute path reference. + */ +static constexpr const char *kUrlTemplate = "url.template"; + +/** + * The effective top level domain (eTLD), also known as the domain suffix, is the last part of the + * domain name. For example, the top level domain for example.com is @code com @endcode.

                    This + * value can be determined precisely with the public suffix + * list. + */ +static constexpr const char *kUrlTopLevelDomain = "url.top_level_domain"; + +} // namespace url +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE \ No newline at end of file diff --git a/api/include/opentelemetry/semconv/service_attributes.h b/api/include/opentelemetry/semconv/service_attributes.h index 6e3f616a85..05c3c1febb 100644 --- a/api/include/opentelemetry/semconv/service_attributes.h +++ b/api/include/opentelemetry/semconv/service_attributes.h @@ -8,34 +8,34 @@ * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 */ - #pragma once +#pragma once - #include "opentelemetry/common/macros.h" - #include "opentelemetry/version.h" - - OPENTELEMETRY_BEGIN_NAMESPACE - namespace semconv - { - namespace service - { - - /** - * Logical name of the service. - *

                    - * MUST be the same for all instances of horizontally scaled services. If the value was not - * specified, SDKs MUST fallback to @code unknown_service: @endcode concatenated with @code process.executable.name @endcode, e.g. @code unknown_service:bash - * @endcode. If @code process.executable.name @endcode is not available, the value MUST be set to - * @code unknown_service @endcode. - */ - static constexpr const char *kServiceName = "service.name"; - - /** - * The version string of the service API or implementation. The format is not defined by these - * conventions. - */ - static constexpr const char *kServiceVersion = "service.version"; - - } // namespace service - } // namespace semconv - OPENTELEMETRY_END_NAMESPACE \ No newline at end of file +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace service +{ + +/** + * Logical name of the service. + *

                    + * MUST be the same for all instances of horizontally scaled services. If the value was not + * specified, SDKs MUST fallback to @code unknown_service: @endcode concatenated with @code process.executable.name @endcode, e.g. @code unknown_service:bash + * @endcode. If @code process.executable.name @endcode is not available, the value MUST be set to + * @code unknown_service @endcode. + */ +static constexpr const char *kServiceName = "service.name"; + +/** + * The version string of the service API or implementation. The format is not defined by these + * conventions. + */ +static constexpr const char *kServiceVersion = "service.version"; + +} // namespace service +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE \ No newline at end of file diff --git a/api/include/opentelemetry/semconv/url_attributes.h b/api/include/opentelemetry/semconv/url_attributes.h index b3f85afdd4..e9dd443f78 100644 --- a/api/include/opentelemetry/semconv/url_attributes.h +++ b/api/include/opentelemetry/semconv/url_attributes.h @@ -8,95 +8,95 @@ * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2 */ - #pragma once +#pragma once - #include "opentelemetry/common/macros.h" - #include "opentelemetry/version.h" - - OPENTELEMETRY_BEGIN_NAMESPACE - namespace semconv - { - namespace url - { - - /** - * The URI fragment component - */ - static constexpr const char *kUrlFragment = "url.fragment"; - - /** - * Absolute URL describing a network resource according to RFC3986

                    For network calls, URL usually has - * @code scheme://host[:port][path][?query][#fragment] @endcode format, where the fragment is not - * transmitted over HTTP, but if it is known, it SHOULD be included nevertheless.

                    - * @code url.full @endcode MUST NOT contain credentials passed via URL in form of @code - * https://username:password@www.example.com/ @endcode. In such case username and password SHOULD be - * redacted and attribute's value SHOULD be @code https://REDACTED:REDACTED@www.example.com/ - * @endcode.

                    - * @code url.full @endcode SHOULD capture the absolute URL when it is available (or can be - * reconstructed).

                    Sensitive content provided in @code url.full @endcode SHOULD be scrubbed when - * instrumentations can identify it.

                    - * - * Query string values for the following keys SHOULD be redacted by default and replaced by the - * value @code REDACTED @endcode: - *

                    - *

                    - * This list is subject to change over time. - *

                    - * When a query string value is redacted, the query string key SHOULD still be preserved, e.g. - * @code https://www.example.com/path?color=blue&sig=REDACTED @endcode. - */ - static constexpr const char *kUrlFull = "url.full"; - - /** - * The URI path component - *

                    - * Sensitive content provided in @code url.path @endcode SHOULD be scrubbed when instrumentations - * can identify it. - */ - static constexpr const char *kUrlPath = "url.path"; - - /** - * The URI query component - *

                    - * Sensitive content provided in @code url.query @endcode SHOULD be scrubbed when instrumentations - * can identify it.

                    - * - * Query string values for the following keys SHOULD be redacted by default and replaced by the - * value @code REDACTED @endcode:

                    - *

                    - * This list is subject to change over time. - *

                    - * When a query string value is redacted, the query string key SHOULD still be preserved, e.g. - * @code q=OpenTelemetry&sig=REDACTED @endcode. - */ - static constexpr const char *kUrlQuery = "url.query"; - - /** - * The URI scheme component - * identifying the used protocol. - */ - static constexpr const char *kUrlScheme = "url.scheme"; - - } // namespace url - } // namespace semconv - OPENTELEMETRY_END_NAMESPACE \ No newline at end of file +#include "opentelemetry/common/macros.h" +#include "opentelemetry/version.h" + +OPENTELEMETRY_BEGIN_NAMESPACE +namespace semconv +{ +namespace url +{ + +/** + * The URI fragment component + */ +static constexpr const char *kUrlFragment = "url.fragment"; + +/** + * Absolute URL describing a network resource according to RFC3986

                    For network calls, URL usually has + * @code scheme://host[:port][path][?query][#fragment] @endcode format, where the fragment is not + * transmitted over HTTP, but if it is known, it SHOULD be included nevertheless.

                    + * @code url.full @endcode MUST NOT contain credentials passed via URL in form of @code + * https://username:password@www.example.com/ @endcode. In such case username and password SHOULD be + * redacted and attribute's value SHOULD be @code https://REDACTED:REDACTED@www.example.com/ + * @endcode.

                    + * @code url.full @endcode SHOULD capture the absolute URL when it is available (or can be + * reconstructed).

                    Sensitive content provided in @code url.full @endcode SHOULD be scrubbed when + * instrumentations can identify it.

                    + * + * Query string values for the following keys SHOULD be redacted by default and replaced by the + * value @code REDACTED @endcode: + *

                    + *

                    + * This list is subject to change over time. + *

                    + * When a query string value is redacted, the query string key SHOULD still be preserved, e.g. + * @code https://www.example.com/path?color=blue&sig=REDACTED @endcode. + */ +static constexpr const char *kUrlFull = "url.full"; + +/** + * The URI path component + *

                    + * Sensitive content provided in @code url.path @endcode SHOULD be scrubbed when instrumentations + * can identify it. + */ +static constexpr const char *kUrlPath = "url.path"; + +/** + * The URI query component + *

                    + * Sensitive content provided in @code url.query @endcode SHOULD be scrubbed when instrumentations + * can identify it.

                    + * + * Query string values for the following keys SHOULD be redacted by default and replaced by the + * value @code REDACTED @endcode:

                    + *

                    + * This list is subject to change over time. + *

                    + * When a query string value is redacted, the query string key SHOULD still be preserved, e.g. + * @code q=OpenTelemetry&sig=REDACTED @endcode. + */ +static constexpr const char *kUrlQuery = "url.query"; + +/** + * The URI scheme component + * identifying the used protocol. + */ +static constexpr const char *kUrlScheme = "url.scheme"; + +} // namespace url +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE \ No newline at end of file From 7c5e5c3b372f857a08295aef7112af149832d7da Mon Sep 17 00:00:00 2001 From: Evan Date: Mon, 26 May 2025 16:36:04 +0000 Subject: [PATCH 12/17] Remove doc check under maintainer mode --- CMakeLists.txt | 8 -------- 1 file changed, 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index dc4166c5a0..4e65f0493a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -603,14 +603,6 @@ if(OTELCPP_MAINTAINER_MODE) add_compile_options(-Werror) add_compile_options(-Wextra) - # Check if the compiler supports -Wdocumentation - include(CheckCXXCompilerFlag) - check_cxx_compiler_flag("-Wdocumentation" CLANG_SUPPORTS_DOCUMENTATION) - if(CLANG_SUPPORTS_DOCUMENTATION) - message(STATUS "Adding -Wdocumentation flag for Clang") - add_compile_options(-Wdocumentation) - endif() - # Tested with Clang 11.0 on github. if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 11.0) message(STATUS "Building with additional warnings for clang.") From 9ef149a8d0495fd851c2393b9bff993ebf2cbe30 Mon Sep 17 00:00:00 2001 From: Evan Date: Tue, 27 May 2025 01:47:04 +0000 Subject: [PATCH 13/17] Fix eof --- .../opentelemetry/semconv/incubating/process_attributes.h | 2 +- api/include/opentelemetry/semconv/incubating/system_metrics.h | 2 +- api/include/opentelemetry/semconv/incubating/url_attributes.h | 2 +- api/include/opentelemetry/semconv/service_attributes.h | 2 +- api/include/opentelemetry/semconv/url_attributes.h | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/api/include/opentelemetry/semconv/incubating/process_attributes.h b/api/include/opentelemetry/semconv/incubating/process_attributes.h index f23904dceb..754eaf2ee9 100644 --- a/api/include/opentelemetry/semconv/incubating/process_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/process_attributes.h @@ -294,4 +294,4 @@ static constexpr const char *kMinor = "minor"; } // namespace process } // namespace semconv -OPENTELEMETRY_END_NAMESPACE \ No newline at end of file +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/system_metrics.h b/api/include/opentelemetry/semconv/incubating/system_metrics.h index 45d96cb909..a72e7a7803 100644 --- a/api/include/opentelemetry/semconv/incubating/system_metrics.h +++ b/api/include/opentelemetry/semconv/incubating/system_metrics.h @@ -1334,4 +1334,4 @@ static inline nostd::shared_ptr CreateAsyncDouble } // namespace system } // namespace semconv -OPENTELEMETRY_END_NAMESPACE \ No newline at end of file +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/url_attributes.h b/api/include/opentelemetry/semconv/incubating/url_attributes.h index 547136ea3f..2646de430d 100644 --- a/api/include/opentelemetry/semconv/incubating/url_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/url_attributes.h @@ -170,4 +170,4 @@ static constexpr const char *kUrlTopLevelDomain = "url.top_level_domain"; } // namespace url } // namespace semconv -OPENTELEMETRY_END_NAMESPACE \ No newline at end of file +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/service_attributes.h b/api/include/opentelemetry/semconv/service_attributes.h index 05c3c1febb..e4c0dda17a 100644 --- a/api/include/opentelemetry/semconv/service_attributes.h +++ b/api/include/opentelemetry/semconv/service_attributes.h @@ -38,4 +38,4 @@ static constexpr const char *kServiceVersion = "service.version"; } // namespace service } // namespace semconv -OPENTELEMETRY_END_NAMESPACE \ No newline at end of file +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/url_attributes.h b/api/include/opentelemetry/semconv/url_attributes.h index e9dd443f78..8d7310d590 100644 --- a/api/include/opentelemetry/semconv/url_attributes.h +++ b/api/include/opentelemetry/semconv/url_attributes.h @@ -99,4 +99,4 @@ static constexpr const char *kUrlScheme = "url.scheme"; } // namespace url } // namespace semconv -OPENTELEMETRY_END_NAMESPACE \ No newline at end of file +OPENTELEMETRY_END_NAMESPACE From 37c8ff8cf13eb25bbd861fe41388e7b22fdd3bba Mon Sep 17 00:00:00 2001 From: Evan Date: Wed, 28 May 2025 16:20:47 +0000 Subject: [PATCH 14/17] Revert clang-format --- .clang-format | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.clang-format b/.clang-format index 85bca82b42..1b5d0d488f 100644 --- a/.clang-format +++ b/.clang-format @@ -70,6 +70,4 @@ AttributeMacros: - OPENTELEMETRY_EXPORT - OPENTELEMETRY_SANITIZER_NO_MEMORY - OPENTELEMETRY_SANITIZER_NO_THREAD - - OPENTELEMETRY_SANITIZER_NO_ADDRESS - -CommentPragmas: | \ No newline at end of file + - OPENTELEMETRY_SANITIZER_NO_ADDRESS \ No newline at end of file From ae8ed3a83eec2383b1b9cf535896c286d671e005 Mon Sep 17 00:00:00 2001 From: Evan Date: Wed, 28 May 2025 16:33:20 +0000 Subject: [PATCH 15/17] Address the review comments --- .../exporters/memory/in_memory_span_exporter.h | 6 ++++-- sdk/include/opentelemetry/sdk/trace/recordable.h | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/exporters/memory/include/opentelemetry/exporters/memory/in_memory_span_exporter.h b/exporters/memory/include/opentelemetry/exporters/memory/in_memory_span_exporter.h index 5ef89c5e52..5bb7abd4e2 100644 --- a/exporters/memory/include/opentelemetry/exporters/memory/in_memory_span_exporter.h +++ b/exporters/memory/include/opentelemetry/exporters/memory/in_memory_span_exporter.h @@ -81,12 +81,14 @@ class InMemorySpanExporter final : public opentelemetry::sdk::trace::SpanExporte } /** - * Timeout is 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) noexcept override { + (void)timeout; is_shutdown_ = true; return true; } diff --git a/sdk/include/opentelemetry/sdk/trace/recordable.h b/sdk/include/opentelemetry/sdk/trace/recordable.h index 69bac30949..b85e007e85 100644 --- a/sdk/include/opentelemetry/sdk/trace/recordable.h +++ b/sdk/include/opentelemetry/sdk/trace/recordable.h @@ -56,10 +56,10 @@ 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 name, + virtual void SetAttribute(nostd::string_view key, const opentelemetry::common::AttributeValue &value) noexcept = 0; /** From 54787c14d667515485ee711d18a15f548e27f099 Mon Sep 17 00:00:00 2001 From: Evan Date: Thu, 29 May 2025 10:09:53 +0800 Subject: [PATCH 16/17] Update exporters/memory/include/opentelemetry/exporters/memory/in_memory_span_exporter.h Co-authored-by: Marc Alff --- .../opentelemetry/exporters/memory/in_memory_span_exporter.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/exporters/memory/include/opentelemetry/exporters/memory/in_memory_span_exporter.h b/exporters/memory/include/opentelemetry/exporters/memory/in_memory_span_exporter.h index 5bb7abd4e2..dd4fc11d05 100644 --- a/exporters/memory/include/opentelemetry/exporters/memory/in_memory_span_exporter.h +++ b/exporters/memory/include/opentelemetry/exporters/memory/in_memory_span_exporter.h @@ -86,9 +86,8 @@ class InMemorySpanExporter final : public opentelemetry::sdk::trace::SpanExporte * 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 { - (void)timeout; is_shutdown_ = true; return true; } From 09797236aa07ec5cfdf67f3fd69cf0dc12ef7f8f Mon Sep 17 00:00:00 2001 From: Evan Date: Thu, 29 May 2025 10:10:14 +0800 Subject: [PATCH 17/17] Update sdk/include/opentelemetry/sdk/common/atomic_unique_ptr.h Co-authored-by: Marc Alff --- sdk/include/opentelemetry/sdk/common/atomic_unique_ptr.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/include/opentelemetry/sdk/common/atomic_unique_ptr.h b/sdk/include/opentelemetry/sdk/common/atomic_unique_ptr.h index 523df0aa08..7190c0173b 100644 --- a/sdk/include/opentelemetry/sdk/common/atomic_unique_ptr.h +++ b/sdk/include/opentelemetry/sdk/common/atomic_unique_ptr.h @@ -61,7 +61,7 @@ class AtomicUniquePtr /** * Atomically swap the pointer with another. - * @param other the pointer to swap with + * @param other The pointer to swap with */ void Swap(std::unique_ptr &other) noexcept { other.reset(ptr_.exchange(other.release())); }