diff --git a/CMakeLists.txt b/CMakeLists.txt index d7f6049ef9..bfe0071498 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -275,6 +275,10 @@ if(WITH_EXAMPLES_HTTP AND NOT WITH_EXAMPLES) message(FATAL_ERROR "WITH_EXAMPLES_HTTP=ON requires WITH_EXAMPLES=ON") endif() +if(WITH_GSL) + include("${opentelemetry-cpp_SOURCE_DIR}/cmake/ms-gsl.cmake") +endif() + find_package(Threads) function(set_target_version target_name) @@ -635,7 +639,9 @@ message(STATUS "CMake: ${CMAKE_VERSION}") message(STATUS "GTest: ${GTest_VERSION} (${GTest_PROVIDER})") message(STATUS "benchmark: ${benchmark_VERSION} (${benchmark_PROVIDER})") if(WITH_GSL) - message(STATUS "GSL: ${GSL_VERSION}") + message( + STATUS "Microsoft.GSL: ${Microsoft.GSL_VERSION} (${Microsoft.GSL_PROVIDER})" + ) endif() if(absl_FOUND) message(STATUS "Abseil: ${absl_VERSION}") diff --git a/api/CMakeLists.txt b/api/CMakeLists.txt index 8430a52250..48c9098eaa 100644 --- a/api/CMakeLists.txt +++ b/api/CMakeLists.txt @@ -9,22 +9,7 @@ target_include_directories( set_target_properties(opentelemetry_api PROPERTIES EXPORT_NAME api) -otel_add_component( - COMPONENT - api - TARGETS - opentelemetry_api - FILES_DIRECTORY - "include/opentelemetry" - FILES_DESTINATION - "include" - FILES_MATCHING - PATTERN - "*.h") - -if(OPENTELEMETRY_INSTALL) - unset(TARGET_DEPS) -endif() +unset(TARGET_DEPS) if(BUILD_TESTING) add_subdirectory(test) @@ -74,18 +59,8 @@ endif() if(WITH_GSL) target_compile_definitions(opentelemetry_api INTERFACE HAVE_GSL) - - # Guidelines Support Library path. Used if we are not on not get C++20. - # - find_package(Microsoft.GSL QUIET) - if(TARGET Microsoft.GSL::GSL) - target_link_libraries(opentelemetry_api INTERFACE Microsoft.GSL::GSL) - list(APPEND TARGET_DEPS "gsl") - else() - set(GSL_DIR third_party/ms-gsl) - target_include_directories( - opentelemetry_api INTERFACE "$") - endif() + target_link_libraries(opentelemetry_api INTERFACE Microsoft.GSL::GSL) + list(APPEND TARGET_DEPS "gsl") endif() if(WITH_NO_GETENV) @@ -140,6 +115,19 @@ if(APPLE) target_link_libraries(opentelemetry_api INTERFACE "-framework CoreFoundation") endif() +otel_add_component( + COMPONENT + api + TARGETS + opentelemetry_api + FILES_DIRECTORY + "include/opentelemetry" + FILES_DESTINATION + "include" + FILES_MATCHING + PATTERN + "*.h") + include(${PROJECT_SOURCE_DIR}/cmake/pkgconfig.cmake) if(OPENTELEMETRY_INSTALL) diff --git a/api/include/opentelemetry/semconv/db_attributes.h b/api/include/opentelemetry/semconv/db_attributes.h index 0e6e51c518..fa77366619 100644 --- a/api/include/opentelemetry/semconv/db_attributes.h +++ b/api/include/opentelemetry/semconv/db_attributes.h @@ -137,151 +137,11 @@ static constexpr const char *kDbSystemName = "db.system.name"; namespace DbSystemNameValues { -/** - Some other SQL database. Fallback only. - */ -static constexpr const char *kOtherSql = "other_sql"; - -/** - Adabas (Adaptable Database System) - */ -static constexpr const char *kSoftwareagAdabas = "softwareag.adabas"; - -/** - Actian Ingres - */ -static constexpr const char *kActianIngres = "actian.ingres"; - -/** - Amazon DynamoDB - */ -static constexpr const char *kAwsDynamodb = "aws.dynamodb"; - -/** - Amazon Redshift - */ -static constexpr const char *kAwsRedshift = "aws.redshift"; - -/** - Azure Cosmos DB - */ -static constexpr const char *kAzureCosmosdb = "azure.cosmosdb"; - -/** - InterSystems Caché - */ -static constexpr const char *kIntersystemsCache = "intersystems.cache"; - -/** - Apache Cassandra - */ -static constexpr const char *kCassandra = "cassandra"; - -/** - ClickHouse - */ -static constexpr const char *kClickhouse = "clickhouse"; - -/** - CockroachDB - */ -static constexpr const char *kCockroachdb = "cockroachdb"; - -/** - Couchbase - */ -static constexpr const char *kCouchbase = "couchbase"; - -/** - Apache CouchDB - */ -static constexpr const char *kCouchdb = "couchdb"; - -/** - Apache Derby - */ -static constexpr const char *kDerby = "derby"; - -/** - Elasticsearch - */ -static constexpr const char *kElasticsearch = "elasticsearch"; - -/** - Firebird - */ -static constexpr const char *kFirebirdsql = "firebirdsql"; - -/** - Google Cloud Spanner - */ -static constexpr const char *kGcpSpanner = "gcp.spanner"; - -/** - Apache Geode - */ -static constexpr const char *kGeode = "geode"; - -/** - H2 Database - */ -static constexpr const char *kH2database = "h2database"; - -/** - Apache HBase - */ -static constexpr const char *kHbase = "hbase"; - -/** - Apache Hive - */ -static constexpr const char *kHive = "hive"; - -/** - HyperSQL Database - */ -static constexpr const char *kHsqldb = "hsqldb"; - -/** - IBM Db2 - */ -static constexpr const char *kIbmDb2 = "ibm.db2"; - -/** - IBM Informix - */ -static constexpr const char *kIbmInformix = "ibm.informix"; - -/** - IBM Netezza - */ -static constexpr const char *kIbmNetezza = "ibm.netezza"; - -/** - InfluxDB - */ -static constexpr const char *kInfluxdb = "influxdb"; - -/** - Instant - */ -static constexpr const char *kInstantdb = "instantdb"; - /** MariaDB */ static constexpr const char *kMariadb = "mariadb"; -/** - Memcached - */ -static constexpr const char *kMemcached = "memcached"; - -/** - MongoDB - */ -static constexpr const char *kMongodb = "mongodb"; - /** Microsoft SQL Server */ @@ -292,56 +152,11 @@ static constexpr const char *kMicrosoftSqlServer = "microsoft.sql_server"; */ static constexpr const char *kMysql = "mysql"; -/** - Neo4j - */ -static constexpr const char *kNeo4j = "neo4j"; - -/** - OpenSearch - */ -static constexpr const char *kOpensearch = "opensearch"; - -/** - Oracle Database - */ -static constexpr const char *kOracleDb = "oracle.db"; - /** PostgreSQL */ static constexpr const char *kPostgresql = "postgresql"; -/** - Redis - */ -static constexpr const char *kRedis = "redis"; - -/** - SAP HANA - */ -static constexpr const char *kSapHana = "sap.hana"; - -/** - SAP MaxDB - */ -static constexpr const char *kSapMaxdb = "sap.maxdb"; - -/** - SQLite - */ -static constexpr const char *kSqlite = "sqlite"; - -/** - Teradata - */ -static constexpr const char *kTeradata = "teradata"; - -/** - Trino - */ -static constexpr const char *kTrino = "trino"; - } // namespace DbSystemNameValues } // namespace db diff --git a/api/include/opentelemetry/semconv/incubating/az_attributes.h b/api/include/opentelemetry/semconv/incubating/az_attributes.h index e396476f95..e406acda09 100644 --- a/api/include/opentelemetry/semconv/incubating/az_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/az_attributes.h @@ -20,17 +20,22 @@ namespace az { /** - Azure - Resource Provider Namespace as recognized by the client. + Deprecated, use @code azure.resource_provider.namespace @endcode instead. + + @deprecated + {"note": "Replaced by @code azure.resource_provider.namespace @endcode.", "reason": "renamed", + "renamed_to": "azure.resource_provider.namespace"} */ -static constexpr const char *kAzNamespace = "az.namespace"; +OPENTELEMETRY_DEPRECATED static constexpr const char *kAzNamespace = "az.namespace"; /** - The unique identifier of the service request. It's generated by the Azure service and returned - with the response. + Deprecated, use @code azure.service.request.id @endcode instead. + + @deprecated + {"note": "Replaced by @code azure.service.request.id @endcode.", "reason": "renamed", + "renamed_to": "azure.service.request.id"} */ -static constexpr const char *kAzServiceRequestId = "az.service_request_id"; +OPENTELEMETRY_DEPRECATED static constexpr const char *kAzServiceRequestId = "az.service_request_id"; } // namespace az } // namespace semconv diff --git a/api/include/opentelemetry/semconv/incubating/azure_attributes.h b/api/include/opentelemetry/semconv/incubating/azure_attributes.h index 421f3e65db..0c62bad288 100644 --- a/api/include/opentelemetry/semconv/incubating/azure_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/azure_attributes.h @@ -62,6 +62,19 @@ static constexpr const char *kAzureCosmosdbRequestBodySize = "azure.cosmosdb.req static constexpr const char *kAzureCosmosdbResponseSubStatusCode = "azure.cosmosdb.response.sub_status_code"; +/** + Azure + Resource Provider Namespace as recognized by the client. + */ +static constexpr const char *kAzureResourceProviderNamespace = "azure.resource_provider.namespace"; + +/** + The unique identifier of the service request. It's generated by the Azure service and returned + with the response. + */ +static constexpr const char *kAzureServiceRequestId = "azure.service.request.id"; + namespace AzureCosmosdbConnectionModeValues { /** diff --git a/api/include/opentelemetry/semconv/incubating/cloud_attributes.h b/api/include/opentelemetry/semconv/incubating/cloud_attributes.h index f00c204a5f..236928cf82 100644 --- a/api/include/opentelemetry/semconv/incubating/cloud_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/cloud_attributes.h @@ -74,7 +74,7 @@ static constexpr const char *kCloudRegion = "cloud.region";
  • GCP: The URI of the resource
  • Azure: The Fully Qualified Resource + href="https://learn.microsoft.com/rest/api/resources/resources/get-by-id">Fully Qualified Resource ID of the invoked function, not the function app, having the form @code /subscriptions//resourceGroups//providers/Microsoft.Web/sites//functions/ @@ -139,37 +139,37 @@ static constexpr const char *kAwsOpenshift = "aws_openshift"; /** Azure Virtual Machines */ -static constexpr const char *kAzureVm = "azure_vm"; +static constexpr const char *kAzureVm = "azure.vm"; /** Azure Container Apps */ -static constexpr const char *kAzureContainerApps = "azure_container_apps"; +static constexpr const char *kAzureContainerApps = "azure.container_apps"; /** Azure Container Instances */ -static constexpr const char *kAzureContainerInstances = "azure_container_instances"; +static constexpr const char *kAzureContainerInstances = "azure.container_instances"; /** Azure Kubernetes Service */ -static constexpr const char *kAzureAks = "azure_aks"; +static constexpr const char *kAzureAks = "azure.aks"; /** Azure Functions */ -static constexpr const char *kAzureFunctions = "azure_functions"; +static constexpr const char *kAzureFunctions = "azure.functions"; /** Azure App Service */ -static constexpr const char *kAzureAppService = "azure_app_service"; +static constexpr const char *kAzureAppService = "azure.app_service"; /** Azure Red Hat OpenShift */ -static constexpr const char *kAzureOpenshift = "azure_openshift"; +static constexpr const char *kAzureOpenshift = "azure.openshift"; /** Google Bare Metal Solution (BMS) diff --git a/api/include/opentelemetry/semconv/incubating/cpu_metrics.h b/api/include/opentelemetry/semconv/incubating/cpu_metrics.h index e82f7e2fc4..f9b16adfa6 100644 --- a/api/include/opentelemetry/semconv/incubating/cpu_metrics.h +++ b/api/include/opentelemetry/semconv/incubating/cpu_metrics.h @@ -21,115 +21,122 @@ namespace cpu { /** - Operating frequency of the logical CPU in Hertz. -

    - gauge + Deprecated. Use @code system.cpu.frequency @endcode instead. + + @deprecated + {"note": "Replaced by @code system.cpu.frequency @endcode.", "reason": "renamed", "renamed_to": + "system.cpu.frequency"}

    gauge */ -static constexpr const char *kMetricCpuFrequency = "cpu.frequency"; -static constexpr const char *descrMetricCpuFrequency = - "Operating frequency of the logical CPU in Hertz."; -static constexpr const char *unitMetricCpuFrequency = "Hz"; +OPENTELEMETRY_DEPRECATED static constexpr const char *kMetricCpuFrequency = "cpu.frequency"; +OPENTELEMETRY_DEPRECATED static constexpr const char *descrMetricCpuFrequency = + "Deprecated. Use `system.cpu.frequency` instead."; +OPENTELEMETRY_DEPRECATED static constexpr const char *unitMetricCpuFrequency = "{Hz}"; #if OPENTELEMETRY_ABI_VERSION_NO >= 2 -static inline nostd::unique_ptr> CreateSyncInt64MetricCpuFrequency( - metrics::Meter *meter) +OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> +CreateSyncInt64MetricCpuFrequency(metrics::Meter *meter) { return meter->CreateInt64Gauge(kMetricCpuFrequency, descrMetricCpuFrequency, unitMetricCpuFrequency); } -static inline nostd::unique_ptr> CreateSyncDoubleMetricCpuFrequency( - metrics::Meter *meter) +OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> +CreateSyncDoubleMetricCpuFrequency(metrics::Meter *meter) { return meter->CreateDoubleGauge(kMetricCpuFrequency, descrMetricCpuFrequency, unitMetricCpuFrequency); } #endif /* OPENTELEMETRY_ABI_VERSION_NO */ -static inline nostd::shared_ptr CreateAsyncInt64MetricCpuFrequency( - metrics::Meter *meter) +OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr +CreateAsyncInt64MetricCpuFrequency(metrics::Meter *meter) { return meter->CreateInt64ObservableGauge(kMetricCpuFrequency, descrMetricCpuFrequency, unitMetricCpuFrequency); } -static inline nostd::shared_ptr CreateAsyncDoubleMetricCpuFrequency( - metrics::Meter *meter) +OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr +CreateAsyncDoubleMetricCpuFrequency(metrics::Meter *meter) { return meter->CreateDoubleObservableGauge(kMetricCpuFrequency, descrMetricCpuFrequency, unitMetricCpuFrequency); } /** - Seconds each logical CPU spent on each mode -

    - counter + Deprecated. Use @code system.cpu.time @endcode instead. + + @deprecated + {"note": "Replaced by @code system.cpu.time @endcode.", "reason": "renamed", "renamed_to": + "system.cpu.time"}

    counter */ -static constexpr const char *kMetricCpuTime = "cpu.time"; -static constexpr const char *descrMetricCpuTime = "Seconds each logical CPU spent on each mode"; -static constexpr const char *unitMetricCpuTime = "s"; +OPENTELEMETRY_DEPRECATED static constexpr const char *kMetricCpuTime = "cpu.time"; +OPENTELEMETRY_DEPRECATED static constexpr const char *descrMetricCpuTime = + "Deprecated. Use `system.cpu.time` instead."; +OPENTELEMETRY_DEPRECATED static constexpr const char *unitMetricCpuTime = "s"; -static inline nostd::unique_ptr> CreateSyncInt64MetricCpuTime( - metrics::Meter *meter) +OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> +CreateSyncInt64MetricCpuTime(metrics::Meter *meter) { return meter->CreateUInt64Counter(kMetricCpuTime, descrMetricCpuTime, unitMetricCpuTime); } -static inline nostd::unique_ptr> CreateSyncDoubleMetricCpuTime( - metrics::Meter *meter) +OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> +CreateSyncDoubleMetricCpuTime(metrics::Meter *meter) { return meter->CreateDoubleCounter(kMetricCpuTime, descrMetricCpuTime, unitMetricCpuTime); } -static inline nostd::shared_ptr CreateAsyncInt64MetricCpuTime( - metrics::Meter *meter) +OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr +CreateAsyncInt64MetricCpuTime(metrics::Meter *meter) { return meter->CreateInt64ObservableCounter(kMetricCpuTime, descrMetricCpuTime, unitMetricCpuTime); } -static inline nostd::shared_ptr CreateAsyncDoubleMetricCpuTime( - metrics::Meter *meter) +OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr +CreateAsyncDoubleMetricCpuTime(metrics::Meter *meter) { return meter->CreateDoubleObservableCounter(kMetricCpuTime, descrMetricCpuTime, unitMetricCpuTime); } /** - For each logical CPU, the utilization is calculated as the change in cumulative CPU time - (cpu.time) over a measurement interval, divided by the elapsed time.

    gauge + Deprecated. Use @code system.cpu.utilization @endcode instead. + + @deprecated + {"note": "Replaced by @code system.cpu.utilization @endcode.", "reason": "renamed", "renamed_to": + "system.cpu.utilization"}

    gauge */ -static constexpr const char *kMetricCpuUtilization = "cpu.utilization"; -static constexpr const char *descrMetricCpuUtilization = - "For each logical CPU, the utilization is calculated as the change in cumulative CPU time " - "(cpu.time) over a measurement interval, divided by the elapsed time."; -static constexpr const char *unitMetricCpuUtilization = "1"; +OPENTELEMETRY_DEPRECATED static constexpr const char *kMetricCpuUtilization = "cpu.utilization"; +OPENTELEMETRY_DEPRECATED static constexpr const char *descrMetricCpuUtilization = + "Deprecated. Use `system.cpu.utilization` instead."; +OPENTELEMETRY_DEPRECATED static constexpr const char *unitMetricCpuUtilization = "1"; #if OPENTELEMETRY_ABI_VERSION_NO >= 2 -static inline nostd::unique_ptr> CreateSyncInt64MetricCpuUtilization( - metrics::Meter *meter) +OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> +CreateSyncInt64MetricCpuUtilization(metrics::Meter *meter) { return meter->CreateInt64Gauge(kMetricCpuUtilization, descrMetricCpuUtilization, unitMetricCpuUtilization); } -static inline nostd::unique_ptr> CreateSyncDoubleMetricCpuUtilization( - metrics::Meter *meter) +OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> +CreateSyncDoubleMetricCpuUtilization(metrics::Meter *meter) { return meter->CreateDoubleGauge(kMetricCpuUtilization, descrMetricCpuUtilization, unitMetricCpuUtilization); } #endif /* OPENTELEMETRY_ABI_VERSION_NO */ -static inline nostd::shared_ptr CreateAsyncInt64MetricCpuUtilization( - metrics::Meter *meter) +OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr +CreateAsyncInt64MetricCpuUtilization(metrics::Meter *meter) { return meter->CreateInt64ObservableGauge(kMetricCpuUtilization, descrMetricCpuUtilization, unitMetricCpuUtilization); } -static inline nostd::shared_ptr +OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr CreateAsyncDoubleMetricCpuUtilization(metrics::Meter *meter) { return meter->CreateDoubleObservableGauge(kMetricCpuUtilization, descrMetricCpuUtilization, diff --git a/api/include/opentelemetry/semconv/incubating/dns_attributes.h b/api/include/opentelemetry/semconv/incubating/dns_attributes.h index 030828ab94..827d4d51da 100644 --- a/api/include/opentelemetry/semconv/incubating/dns_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/dns_attributes.h @@ -19,6 +19,11 @@ namespace semconv namespace dns { +/** + The list of IPv4 or IPv6 addresses resolved during DNS lookup. + */ +static constexpr const char *kDnsAnswers = "dns.answers"; + /** The name being queried.

    diff --git a/api/include/opentelemetry/semconv/incubating/gen_ai_attributes.h b/api/include/opentelemetry/semconv/incubating/gen_ai_attributes.h index 32ece010ad..95f11c7fc4 100644 --- a/api/include/opentelemetry/semconv/incubating/gen_ai_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/gen_ai_attributes.h @@ -423,6 +423,16 @@ static constexpr const char *kAnthropic = "anthropic"; */ static constexpr const char *kCohere = "cohere"; +/** + Azure AI Inference + */ +static constexpr const char *kAzureAiInference = "azure.ai.inference"; + +/** + Azure OpenAI + */ +static constexpr const char *kAzureAiOpenai = "azure.ai.openai"; + /** Azure AI Inference */ @@ -431,7 +441,7 @@ static constexpr const char *kAzAiInference = "az.ai.inference"; /** Azure OpenAI */ -static constexpr const char *kAzAiOpenai = "az.ai.openai"; +static constexpr const char *kAzAiOpenai = "azure.ai.openai"; /** IBM Watsonx AI diff --git a/api/include/opentelemetry/semconv/incubating/http_attributes.h b/api/include/opentelemetry/semconv/incubating/http_attributes.h index c9c42ad6eb..f8cebe1751 100644 --- a/api/include/opentelemetry/semconv/incubating/http_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/http_attributes.h @@ -192,7 +192,8 @@ static constexpr const char *kHttpResponseStatusCode = "http.response.status_cod Deprecated, use @code http.response.header.content-length @endcode instead. @deprecated - {"note": "hp.response.header.content-length", "reason": "uncategorized"} + {"note": "Replaced by @code http.response.header.content-length @endcode.", "reason": + "uncategorized"} */ OPENTELEMETRY_DEPRECATED static constexpr const char *kHttpResponseContentLength = "http.response_content_length"; diff --git a/api/include/opentelemetry/semconv/incubating/k8s_attributes.h b/api/include/opentelemetry/semconv/incubating/k8s_attributes.h index 05f4064982..29f08e7793 100644 --- a/api/include/opentelemetry/semconv/incubating/k8s_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/k8s_attributes.h @@ -70,6 +70,22 @@ static constexpr const char *kK8sContainerRestartCount = "k8s.container.restart_ static constexpr const char *kK8sContainerStatusLastTerminatedReason = "k8s.container.status.last_terminated_reason"; +/** + The reason for the container state. Corresponds to the @code reason @endcode field of the: K8s + ContainerStateWaiting or K8s + ContainerStateTerminated + */ +static constexpr const char *kK8sContainerStatusReason = "k8s.container.status.reason"; + +/** + The state of the container. K8s + ContainerState + */ +static constexpr const char *kK8sContainerStatusState = "k8s.container.status.state"; + /** The cronjob annotation placed on the CronJob, the @code @endcode being the annotation name, the value being the annotation value.

    Examples:

    • An annotation @code retries @endcode @@ -103,18 +119,24 @@ static constexpr const char *kK8sCronjobName = "k8s.cronjob.name"; static constexpr const char *kK8sCronjobUid = "k8s.cronjob.uid"; /** - The annotation key-value pairs placed on the DaemonSet. -

      - The @code @endcode being the annotation name, the value being the annotation value, even if - the value is empty. + The annotation placed on the DaemonSet, the @code @endcode being the annotation name, the + value being the annotation value, even if the value is empty.

      Examples:

      • A label @code + replicas @endcode with value @code 1 @endcode SHOULD be recorded as the @code + k8s.daemonset.annotation.replicas @endcode attribute with value @code "1" @endcode.
      • A + label @code data @endcode with empty string value SHOULD be recorded as the @code + k8s.daemonset.annotation.data @endcode attribute with value @code "" @endcode.
      • +
      */ static constexpr const char *kK8sDaemonsetAnnotation = "k8s.daemonset.annotation"; /** - The label key-value pairs placed on the DaemonSet. -

      - The @code @endcode being the label name, the value being the label value, even if the value - is empty. + The label placed on the DaemonSet, the @code @endcode being the label name, the value being + the label value, even if the value is empty.

      Examples:

      • A label @code app @endcode + with value @code guestbook @endcode SHOULD be recorded as the @code k8s.daemonset.label.app + @endcode attribute with value @code "guestbook" @endcode.
      • A label @code data @endcode + with empty string value SHOULD be recorded as the @code k8s.daemonset.label.injected @endcode + attribute with value @code "" @endcode.
      • +
      */ static constexpr const char *kK8sDaemonsetLabel = "k8s.daemonset.label"; @@ -129,18 +151,24 @@ static constexpr const char *kK8sDaemonsetName = "k8s.daemonset.name"; static constexpr const char *kK8sDaemonsetUid = "k8s.daemonset.uid"; /** - The annotation key-value pairs placed on the Deployment. -

      - The @code @endcode being the annotation name, the value being the annotation value, even if - the value is empty. + The annotation placed on the Deployment, the @code @endcode being the annotation name, the + value being the annotation value, even if the value is empty.

      Examples:

      • A label @code + replicas @endcode with value @code 1 @endcode SHOULD be recorded as the @code + k8s.deployment.annotation.replicas @endcode attribute with value @code "1" @endcode.
      • A + label @code data @endcode with empty string value SHOULD be recorded as the @code + k8s.deployment.annotation.data @endcode attribute with value @code "" @endcode.
      • +
      */ static constexpr const char *kK8sDeploymentAnnotation = "k8s.deployment.annotation"; /** - The label key-value pairs placed on the Deployment. -

      - The @code @endcode being the label name, the value being the label value, even if the value - is empty. + The label placed on the Deployment, the @code @endcode being the label name, the value being + the label value, even if the value is empty.

      Examples:

      • A label @code replicas + @endcode with value @code 0 @endcode SHOULD be recorded as the @code k8s.deployment.label.app + @endcode attribute with value @code "guestbook" @endcode.
      • A label @code injected @endcode + with empty string value SHOULD be recorded as the @code k8s.deployment.label.injected @endcode + attribute with value @code "" @endcode.
      • +
      */ static constexpr const char *kK8sDeploymentLabel = "k8s.deployment.label"; @@ -154,29 +182,69 @@ static constexpr const char *kK8sDeploymentName = "k8s.deployment.name"; */ static constexpr const char *kK8sDeploymentUid = "k8s.deployment.uid"; +/** + The type of metric source for the horizontal pod autoscaler. +

      + This attribute reflects the @code type @endcode field of spec.metrics[] in the HPA. + */ +static constexpr const char *kK8sHpaMetricType = "k8s.hpa.metric.type"; + /** The name of the horizontal pod autoscaler. */ static constexpr const char *kK8sHpaName = "k8s.hpa.name"; +/** + The API version of the target resource to scale for the HorizontalPodAutoscaler. +

      + This maps to the @code apiVersion @endcode field in the @code scaleTargetRef @endcode of the HPA + spec. + */ +static constexpr const char *kK8sHpaScaletargetrefApiVersion = "k8s.hpa.scaletargetref.api_version"; + +/** + The kind of the target resource to scale for the HorizontalPodAutoscaler. +

      + This maps to the @code kind @endcode field in the @code scaleTargetRef @endcode of the HPA spec. + */ +static constexpr const char *kK8sHpaScaletargetrefKind = "k8s.hpa.scaletargetref.kind"; + +/** + The name of the target resource to scale for the HorizontalPodAutoscaler. +

      + This maps to the @code name @endcode field in the @code scaleTargetRef @endcode of the HPA spec. + */ +static constexpr const char *kK8sHpaScaletargetrefName = "k8s.hpa.scaletargetref.name"; + /** The UID of the horizontal pod autoscaler. */ static constexpr const char *kK8sHpaUid = "k8s.hpa.uid"; /** - The annotation key-value pairs placed on the Job. -

      - The @code @endcode being the annotation name, the value being the annotation value, even if - the value is empty. + The size (identifier) of the K8s huge page. + */ +static constexpr const char *kK8sHugepageSize = "k8s.hugepage.size"; + +/** + The annotation placed on the Job, the @code @endcode being the annotation name, the value + being the annotation value, even if the value is empty.

      Examples:

      • A label @code + number @endcode with value @code 1 @endcode SHOULD be recorded as the @code + k8s.job.annotation.number @endcode attribute with value @code "1" @endcode.
      • A label @code + data @endcode with empty string value SHOULD be recorded as the @code k8s.job.annotation.data + @endcode attribute with value @code "" @endcode.
      • +
      */ static constexpr const char *kK8sJobAnnotation = "k8s.job.annotation"; /** - The label key-value pairs placed on the Job. -

      - The @code @endcode being the label name, the value being the label value, even if the value - is empty. + The label placed on the Job, the @code @endcode being the label name, the value being the + label value, even if the value is empty.

      Examples:

      • A label @code jobtype @endcode + with value @code ci @endcode SHOULD be recorded as the @code k8s.job.label.jobtype @endcode + attribute with value @code "ci" @endcode.
      • A label @code data @endcode with empty string + value SHOULD be recorded as the @code k8s.job.label.automated @endcode attribute with value @code + "" @endcode.
      • +
      */ static constexpr const char *kK8sJobLabel = "k8s.job.label"; @@ -191,18 +259,25 @@ static constexpr const char *kK8sJobName = "k8s.job.name"; static constexpr const char *kK8sJobUid = "k8s.job.uid"; /** - The annotation key-value pairs placed on the Namespace. -

      - The @code @endcode being the annotation name, the value being the annotation value, even if - the value is empty. + The annotation placed on the Namespace, the @code @endcode being the annotation name, the + value being the annotation value, even if the value is empty.

      Examples:

      • A label @code + ttl @endcode with value @code 0 @endcode SHOULD be recorded as the @code + k8s.namespace.annotation.ttl @endcode attribute with value @code "0" @endcode.
      • A label + @code data @endcode with empty string value SHOULD be recorded as the @code + k8s.namespace.annotation.data @endcode attribute with value @code "" @endcode.
      • +
      */ static constexpr const char *kK8sNamespaceAnnotation = "k8s.namespace.annotation"; /** - The label key-value pairs placed on the Namespace. -

      - The @code @endcode being the label name, the value being the label value, even if the value - is empty. + The label placed on the Namespace, the @code @endcode being the label name, the value being + the label value, even if the value is empty.

      Examples:

      • A label @code + kubernetes.io/metadata.name @endcode with value @code default @endcode SHOULD be recorded as the + @code k8s.namespace.label.kubernetes.io/metadata.name @endcode attribute with value @code + "default" @endcode.
      • A label @code data @endcode with empty string value SHOULD be + recorded as the @code k8s.namespace.label.data @endcode attribute with value @code "" + @endcode.
      • +
      */ static constexpr const char *kK8sNamespaceLabel = "k8s.namespace.label"; @@ -232,6 +307,29 @@ static constexpr const char *kK8sNamespacePhase = "k8s.namespace.phase"; */ static constexpr const char *kK8sNodeAnnotation = "k8s.node.annotation"; +/** + The status of the condition, one of True, False, Unknown. +

      + This attribute aligns with the @code status @endcode field of the + NodeCondition + */ +static constexpr const char *kK8sNodeConditionStatus = "k8s.node.condition.status"; + +/** + The condition type of a K8s Node. +

      + K8s Node conditions as described + by K8s + documentation.

      This attribute aligns with the @code type @endcode field of the NodeCondition +

      + The set of possible values is not limited to those listed here. Managed Kubernetes environments, + or custom controllers MAY introduce additional node condition types. + When this occurs, the exact value as reported by the Kubernetes API SHOULD be used. + */ +static constexpr const char *kK8sNodeConditionType = "k8s.node.condition.type"; + /** The label placed on the Node, the @code @endcode being the label name, the value being the label value, even if the value is empty.

      Examples:

      • A label @code kubernetes.io/arch @@ -299,18 +397,24 @@ static constexpr const char *kK8sPodName = "k8s.pod.name"; static constexpr const char *kK8sPodUid = "k8s.pod.uid"; /** - The annotation key-value pairs placed on the ReplicaSet. -

        - The @code @endcode being the annotation name, the value being the annotation value, even if - the value is empty. + The annotation placed on the ReplicaSet, the @code @endcode being the annotation name, the + value being the annotation value, even if the value is empty.

        Examples:

        • A label @code + replicas @endcode with value @code 0 @endcode SHOULD be recorded as the @code + k8s.replicaset.annotation.replicas @endcode attribute with value @code "0" @endcode.
        • A + label @code data @endcode with empty string value SHOULD be recorded as the @code + k8s.replicaset.annotation.data @endcode attribute with value @code "" @endcode.
        • +
        */ static constexpr const char *kK8sReplicasetAnnotation = "k8s.replicaset.annotation"; /** - The label key-value pairs placed on the ReplicaSet. -

        - The @code @endcode being the label name, the value being the label value, even if the value - is empty. + The label placed on the ReplicaSet, the @code @endcode being the label name, the value being + the label value, even if the value is empty.

        Examples:

        • A label @code app @endcode + with value @code guestbook @endcode SHOULD be recorded as the @code k8s.replicaset.label.app + @endcode attribute with value @code "guestbook" @endcode.
        • A label @code injected @endcode + with empty string value SHOULD be recorded as the @code k8s.replicaset.label.injected @endcode + attribute with value @code "" @endcode.
        • +
        */ static constexpr const char *kK8sReplicasetLabel = "k8s.replicaset.label"; @@ -339,24 +443,42 @@ static constexpr const char *kK8sReplicationcontrollerUid = "k8s.replicationcont */ static constexpr const char *kK8sResourcequotaName = "k8s.resourcequota.name"; +/** + The name of the K8s resource a resource quota defines. +

        + The value for this attribute can be either the full @code count/[.] @endcode + string (e.g., count/deployments.apps, count/pods), or, for certain core Kubernetes resources, just + the resource name (e.g., pods, services, configmaps). Both forms are supported by Kubernetes for + object count quotas. See Kubernetes + Resource Quotas documentation for more details. + */ +static constexpr const char *kK8sResourcequotaResourceName = "k8s.resourcequota.resource_name"; + /** The UID of the resource quota. */ static constexpr const char *kK8sResourcequotaUid = "k8s.resourcequota.uid"; /** - The annotation key-value pairs placed on the StatefulSet. -

        - The @code @endcode being the annotation name, the value being the annotation value, even if - the value is empty. + The annotation placed on the StatefulSet, the @code @endcode being the annotation name, the + value being the annotation value, even if the value is empty.

        Examples:

        • A label @code + replicas @endcode with value @code 1 @endcode SHOULD be recorded as the @code + k8s.statefulset.annotation.replicas @endcode attribute with value @code "1" @endcode.
        • A + label @code data @endcode with empty string value SHOULD be recorded as the @code + k8s.statefulset.annotation.data @endcode attribute with value @code "" @endcode.
        • +
        */ static constexpr const char *kK8sStatefulsetAnnotation = "k8s.statefulset.annotation"; /** - The label key-value pairs placed on the StatefulSet. -

        - The @code @endcode being the label name, the value being the label value, even if the value - is empty. + The label placed on the StatefulSet, the @code @endcode being the label name, the value + being the label value, even if the value is empty.

        Examples:

        • A label @code replicas + @endcode with value @code 0 @endcode SHOULD be recorded as the @code k8s.statefulset.label.app + @endcode attribute with value @code "guestbook" @endcode.
        • A label @code injected @endcode + with empty string value SHOULD be recorded as the @code k8s.statefulset.label.injected @endcode + attribute with value @code "" @endcode.
        • +
        */ static constexpr const char *kK8sStatefulsetLabel = "k8s.statefulset.label"; @@ -370,6 +492,13 @@ static constexpr const char *kK8sStatefulsetName = "k8s.statefulset.name"; */ static constexpr const char *kK8sStatefulsetUid = "k8s.statefulset.uid"; +/** + The name of K8s StorageClass + object. + */ +static constexpr const char *kK8sStorageclassName = "k8s.storageclass.name"; + /** The name of the K8s volume. */ @@ -380,6 +509,74 @@ static constexpr const char *kK8sVolumeName = "k8s.volume.name"; */ static constexpr const char *kK8sVolumeType = "k8s.volume.type"; +namespace K8sContainerStatusReasonValues +{ +/** + The container is being created. + */ +static constexpr const char *kContainerCreating = "ContainerCreating"; + +/** + The container is in a crash loop back off state. + */ +static constexpr const char *kCrashLoopBackOff = "CrashLoopBackOff"; + +/** + There was an error creating the container configuration. + */ +static constexpr const char *kCreateContainerConfigError = "CreateContainerConfigError"; + +/** + There was an error pulling the container image. + */ +static constexpr const char *kErrImagePull = "ErrImagePull"; + +/** + The container image pull is in back off state. + */ +static constexpr const char *kImagePullBackOff = "ImagePullBackOff"; + +/** + The container was killed due to out of memory. + */ +static constexpr const char *kOomKilled = "OOMKilled"; + +/** + The container has completed execution. + */ +static constexpr const char *kCompleted = "Completed"; + +/** + There was an error with the container. + */ +static constexpr const char *kError = "Error"; + +/** + The container cannot run. + */ +static constexpr const char *kContainerCannotRun = "ContainerCannotRun"; + +} // namespace K8sContainerStatusReasonValues + +namespace K8sContainerStatusStateValues +{ +/** + The container has terminated. + */ +static constexpr const char *kTerminated = "terminated"; + +/** + The container is running. + */ +static constexpr const char *kRunning = "running"; + +/** + The container is waiting. + */ +static constexpr const char *kWaiting = "waiting"; + +} // namespace K8sContainerStatusStateValues + namespace K8sNamespacePhaseValues { /** @@ -396,6 +593,54 @@ static constexpr const char *kTerminating = "terminating"; } // namespace K8sNamespacePhaseValues +namespace K8sNodeConditionStatusValues +{ +/** + none + */ +static constexpr const char *kConditionTrue = "true"; + +/** + none + */ +static constexpr const char *kConditionFalse = "false"; + +/** + none + */ +static constexpr const char *kConditionUnknown = "unknown"; + +} // namespace K8sNodeConditionStatusValues + +namespace K8sNodeConditionTypeValues +{ +/** + The node is healthy and ready to accept pods + */ +static constexpr const char *kReady = "Ready"; + +/** + Pressure exists on the disk size—that is, if the disk capacity is low + */ +static constexpr const char *kDiskPressure = "DiskPressure"; + +/** + Pressure exists on the node memory—that is, if the node memory is low + */ +static constexpr const char *kMemoryPressure = "MemoryPressure"; + +/** + Pressure exists on the processes—that is, if there are too many processes on the node + */ +static constexpr const char *kPidPressure = "PIDPressure"; + +/** + The network for the node is not correctly configured + */ +static constexpr const char *kNetworkUnavailable = "NetworkUnavailable"; + +} // namespace K8sNodeConditionTypeValues + namespace K8sVolumeTypeValues { /** diff --git a/api/include/opentelemetry/semconv/incubating/k8s_metrics.h b/api/include/opentelemetry/semconv/incubating/k8s_metrics.h index 3a5f25b271..d37bd12741 100644 --- a/api/include/opentelemetry/semconv/incubating/k8s_metrics.h +++ b/api/include/opentelemetry/semconv/incubating/k8s_metrics.h @@ -20,14 +20,540 @@ namespace semconv namespace k8s { +/** + Maximum CPU resource limit set for the container +

        + See + https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#resourcerequirements-v1-core + for details.

        updowncounter + */ +static constexpr const char *kMetricK8sContainerCpuLimit = "k8s.container.cpu.limit"; +static constexpr const char *descrMetricK8sContainerCpuLimit = + "Maximum CPU resource limit set for the container"; +static constexpr const char *unitMetricK8sContainerCpuLimit = "{cpu}"; + +static inline nostd::unique_ptr> +CreateSyncInt64MetricK8sContainerCpuLimit(metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter( + kMetricK8sContainerCpuLimit, descrMetricK8sContainerCpuLimit, unitMetricK8sContainerCpuLimit); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricK8sContainerCpuLimit(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter( + kMetricK8sContainerCpuLimit, descrMetricK8sContainerCpuLimit, unitMetricK8sContainerCpuLimit); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricK8sContainerCpuLimit(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter( + kMetricK8sContainerCpuLimit, descrMetricK8sContainerCpuLimit, unitMetricK8sContainerCpuLimit); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricK8sContainerCpuLimit(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter( + kMetricK8sContainerCpuLimit, descrMetricK8sContainerCpuLimit, unitMetricK8sContainerCpuLimit); +} + +/** + CPU resource requested for the container +

        + See + https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#resourcerequirements-v1-core + for details.

        updowncounter + */ +static constexpr const char *kMetricK8sContainerCpuRequest = "k8s.container.cpu.request"; +static constexpr const char *descrMetricK8sContainerCpuRequest = + "CPU resource requested for the container"; +static constexpr const char *unitMetricK8sContainerCpuRequest = "{cpu}"; + +static inline nostd::unique_ptr> +CreateSyncInt64MetricK8sContainerCpuRequest(metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricK8sContainerCpuRequest, + descrMetricK8sContainerCpuRequest, + unitMetricK8sContainerCpuRequest); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricK8sContainerCpuRequest(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricK8sContainerCpuRequest, + descrMetricK8sContainerCpuRequest, + unitMetricK8sContainerCpuRequest); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricK8sContainerCpuRequest(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter(kMetricK8sContainerCpuRequest, + descrMetricK8sContainerCpuRequest, + unitMetricK8sContainerCpuRequest); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricK8sContainerCpuRequest(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter(kMetricK8sContainerCpuRequest, + descrMetricK8sContainerCpuRequest, + unitMetricK8sContainerCpuRequest); +} + +/** + Maximum ephemeral storage resource limit set for the container +

        + See + https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#resourcerequirements-v1-core + for details.

        updowncounter + */ +static constexpr const char *kMetricK8sContainerEphemeralStorageLimit = + "k8s.container.ephemeral_storage.limit"; +static constexpr const char *descrMetricK8sContainerEphemeralStorageLimit = + "Maximum ephemeral storage resource limit set for the container"; +static constexpr const char *unitMetricK8sContainerEphemeralStorageLimit = "By"; + +static inline nostd::unique_ptr> +CreateSyncInt64MetricK8sContainerEphemeralStorageLimit(metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricK8sContainerEphemeralStorageLimit, + descrMetricK8sContainerEphemeralStorageLimit, + unitMetricK8sContainerEphemeralStorageLimit); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricK8sContainerEphemeralStorageLimit(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricK8sContainerEphemeralStorageLimit, + descrMetricK8sContainerEphemeralStorageLimit, + unitMetricK8sContainerEphemeralStorageLimit); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricK8sContainerEphemeralStorageLimit(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter(kMetricK8sContainerEphemeralStorageLimit, + descrMetricK8sContainerEphemeralStorageLimit, + unitMetricK8sContainerEphemeralStorageLimit); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricK8sContainerEphemeralStorageLimit(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter(kMetricK8sContainerEphemeralStorageLimit, + descrMetricK8sContainerEphemeralStorageLimit, + unitMetricK8sContainerEphemeralStorageLimit); +} + +/** + Ephemeral storage resource requested for the container +

        + See + https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#resourcerequirements-v1-core + for details.

        updowncounter + */ +static constexpr const char *kMetricK8sContainerEphemeralStorageRequest = + "k8s.container.ephemeral_storage.request"; +static constexpr const char *descrMetricK8sContainerEphemeralStorageRequest = + "Ephemeral storage resource requested for the container"; +static constexpr const char *unitMetricK8sContainerEphemeralStorageRequest = "By"; + +static inline nostd::unique_ptr> +CreateSyncInt64MetricK8sContainerEphemeralStorageRequest(metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricK8sContainerEphemeralStorageRequest, + descrMetricK8sContainerEphemeralStorageRequest, + unitMetricK8sContainerEphemeralStorageRequest); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricK8sContainerEphemeralStorageRequest(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricK8sContainerEphemeralStorageRequest, + descrMetricK8sContainerEphemeralStorageRequest, + unitMetricK8sContainerEphemeralStorageRequest); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricK8sContainerEphemeralStorageRequest(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter(kMetricK8sContainerEphemeralStorageRequest, + descrMetricK8sContainerEphemeralStorageRequest, + unitMetricK8sContainerEphemeralStorageRequest); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricK8sContainerEphemeralStorageRequest(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter(kMetricK8sContainerEphemeralStorageRequest, + descrMetricK8sContainerEphemeralStorageRequest, + unitMetricK8sContainerEphemeralStorageRequest); +} + +/** + Maximum memory resource limit set for the container +

        + See + https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#resourcerequirements-v1-core + for details.

        updowncounter + */ +static constexpr const char *kMetricK8sContainerMemoryLimit = "k8s.container.memory.limit"; +static constexpr const char *descrMetricK8sContainerMemoryLimit = + "Maximum memory resource limit set for the container"; +static constexpr const char *unitMetricK8sContainerMemoryLimit = "By"; + +static inline nostd::unique_ptr> +CreateSyncInt64MetricK8sContainerMemoryLimit(metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricK8sContainerMemoryLimit, + descrMetricK8sContainerMemoryLimit, + unitMetricK8sContainerMemoryLimit); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricK8sContainerMemoryLimit(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricK8sContainerMemoryLimit, + descrMetricK8sContainerMemoryLimit, + unitMetricK8sContainerMemoryLimit); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricK8sContainerMemoryLimit(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter(kMetricK8sContainerMemoryLimit, + descrMetricK8sContainerMemoryLimit, + unitMetricK8sContainerMemoryLimit); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricK8sContainerMemoryLimit(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter(kMetricK8sContainerMemoryLimit, + descrMetricK8sContainerMemoryLimit, + unitMetricK8sContainerMemoryLimit); +} + +/** + Memory resource requested for the container +

        + See + https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#resourcerequirements-v1-core + for details.

        updowncounter + */ +static constexpr const char *kMetricK8sContainerMemoryRequest = "k8s.container.memory.request"; +static constexpr const char *descrMetricK8sContainerMemoryRequest = + "Memory resource requested for the container"; +static constexpr const char *unitMetricK8sContainerMemoryRequest = "By"; + +static inline nostd::unique_ptr> +CreateSyncInt64MetricK8sContainerMemoryRequest(metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricK8sContainerMemoryRequest, + descrMetricK8sContainerMemoryRequest, + unitMetricK8sContainerMemoryRequest); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricK8sContainerMemoryRequest(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricK8sContainerMemoryRequest, + descrMetricK8sContainerMemoryRequest, + unitMetricK8sContainerMemoryRequest); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricK8sContainerMemoryRequest(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter(kMetricK8sContainerMemoryRequest, + descrMetricK8sContainerMemoryRequest, + unitMetricK8sContainerMemoryRequest); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricK8sContainerMemoryRequest(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter(kMetricK8sContainerMemoryRequest, + descrMetricK8sContainerMemoryRequest, + unitMetricK8sContainerMemoryRequest); +} + +/** + Indicates whether the container is currently marked as ready to accept traffic, based on its + readiness probe (1 = ready, 0 = not ready)

        This metric SHOULD reflect the value of the @code + ready @endcode field in the K8s + ContainerStatus.

        updowncounter + */ +static constexpr const char *kMetricK8sContainerReady = "k8s.container.ready"; +static constexpr const char *descrMetricK8sContainerReady = + "Indicates whether the container is currently marked as ready to accept traffic, based on its readiness probe (1 = ready, 0 = not ready) + "; + static constexpr const char *unitMetricK8sContainerReady = "{container}"; + +static inline nostd::unique_ptr> +CreateSyncInt64MetricK8sContainerReady(metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricK8sContainerReady, descrMetricK8sContainerReady, + unitMetricK8sContainerReady); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricK8sContainerReady(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricK8sContainerReady, descrMetricK8sContainerReady, + unitMetricK8sContainerReady); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricK8sContainerReady(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter( + kMetricK8sContainerReady, descrMetricK8sContainerReady, unitMetricK8sContainerReady); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricK8sContainerReady(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter( + kMetricK8sContainerReady, descrMetricK8sContainerReady, unitMetricK8sContainerReady); +} + +/** + Describes how many times the container has restarted (since the last counter reset) +

        + This value is pulled directly from the K8s API and the value can go indefinitely high and be reset + to 0 at any time depending on how your kubelet is configured to prune dead containers. It is best + to not depend too much on the exact value but rather look at it as either == 0, in which case you + can conclude there were no restarts in the recent past, or > 0, in which case you can conclude + there were restarts in the recent past, and not try and analyze the value beyond that.

        + updowncounter + */ +static constexpr const char *kMetricK8sContainerRestartCount = "k8s.container.restart.count"; +static constexpr const char *descrMetricK8sContainerRestartCount = + "Describes how many times the container has restarted (since the last counter reset)"; +static constexpr const char *unitMetricK8sContainerRestartCount = "{restart}"; + +static inline nostd::unique_ptr> +CreateSyncInt64MetricK8sContainerRestartCount(metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricK8sContainerRestartCount, + descrMetricK8sContainerRestartCount, + unitMetricK8sContainerRestartCount); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricK8sContainerRestartCount(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricK8sContainerRestartCount, + descrMetricK8sContainerRestartCount, + unitMetricK8sContainerRestartCount); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricK8sContainerRestartCount(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter(kMetricK8sContainerRestartCount, + descrMetricK8sContainerRestartCount, + unitMetricK8sContainerRestartCount); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricK8sContainerRestartCount(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter(kMetricK8sContainerRestartCount, + descrMetricK8sContainerRestartCount, + unitMetricK8sContainerRestartCount); +} + +/** + Describes the number of K8s containers that are currently in a state for a given reason +

        + All possible container state reasons will be reported at each time interval to avoid missing + metrics. Only the value corresponding to the current state reason will be non-zero.

        + updowncounter + */ +static constexpr const char *kMetricK8sContainerStatusReason = "k8s.container.status.reason"; +static constexpr const char *descrMetricK8sContainerStatusReason = + "Describes the number of K8s containers that are currently in a state for a given reason"; +static constexpr const char *unitMetricK8sContainerStatusReason = "{container}"; + +static inline nostd::unique_ptr> +CreateSyncInt64MetricK8sContainerStatusReason(metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricK8sContainerStatusReason, + descrMetricK8sContainerStatusReason, + unitMetricK8sContainerStatusReason); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricK8sContainerStatusReason(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricK8sContainerStatusReason, + descrMetricK8sContainerStatusReason, + unitMetricK8sContainerStatusReason); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricK8sContainerStatusReason(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter(kMetricK8sContainerStatusReason, + descrMetricK8sContainerStatusReason, + unitMetricK8sContainerStatusReason); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricK8sContainerStatusReason(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter(kMetricK8sContainerStatusReason, + descrMetricK8sContainerStatusReason, + unitMetricK8sContainerStatusReason); +} + +/** + Describes the number of K8s containers that are currently in a given state +

        + All possible container states will be reported at each time interval to avoid missing metrics. + Only the value corresponding to the current state will be non-zero. +

        + updowncounter + */ +static constexpr const char *kMetricK8sContainerStatusState = "k8s.container.status.state"; +static constexpr const char *descrMetricK8sContainerStatusState = + "Describes the number of K8s containers that are currently in a given state"; +static constexpr const char *unitMetricK8sContainerStatusState = "{container}"; + +static inline nostd::unique_ptr> +CreateSyncInt64MetricK8sContainerStatusState(metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricK8sContainerStatusState, + descrMetricK8sContainerStatusState, + unitMetricK8sContainerStatusState); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricK8sContainerStatusState(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricK8sContainerStatusState, + descrMetricK8sContainerStatusState, + unitMetricK8sContainerStatusState); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricK8sContainerStatusState(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter(kMetricK8sContainerStatusState, + descrMetricK8sContainerStatusState, + unitMetricK8sContainerStatusState); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricK8sContainerStatusState(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter(kMetricK8sContainerStatusState, + descrMetricK8sContainerStatusState, + unitMetricK8sContainerStatusState); +} + +/** + Maximum storage resource limit set for the container +

        + See + https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#resourcerequirements-v1-core + for details.

        updowncounter + */ +static constexpr const char *kMetricK8sContainerStorageLimit = "k8s.container.storage.limit"; +static constexpr const char *descrMetricK8sContainerStorageLimit = + "Maximum storage resource limit set for the container"; +static constexpr const char *unitMetricK8sContainerStorageLimit = "By"; + +static inline nostd::unique_ptr> +CreateSyncInt64MetricK8sContainerStorageLimit(metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricK8sContainerStorageLimit, + descrMetricK8sContainerStorageLimit, + unitMetricK8sContainerStorageLimit); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricK8sContainerStorageLimit(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricK8sContainerStorageLimit, + descrMetricK8sContainerStorageLimit, + unitMetricK8sContainerStorageLimit); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricK8sContainerStorageLimit(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter(kMetricK8sContainerStorageLimit, + descrMetricK8sContainerStorageLimit, + unitMetricK8sContainerStorageLimit); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricK8sContainerStorageLimit(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter(kMetricK8sContainerStorageLimit, + descrMetricK8sContainerStorageLimit, + unitMetricK8sContainerStorageLimit); +} + +/** + Storage resource requested for the container +

        + See + https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#resourcerequirements-v1-core + for details.

        updowncounter + */ +static constexpr const char *kMetricK8sContainerStorageRequest = "k8s.container.storage.request"; +static constexpr const char *descrMetricK8sContainerStorageRequest = + "Storage resource requested for the container"; +static constexpr const char *unitMetricK8sContainerStorageRequest = "By"; + +static inline nostd::unique_ptr> +CreateSyncInt64MetricK8sContainerStorageRequest(metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricK8sContainerStorageRequest, + descrMetricK8sContainerStorageRequest, + unitMetricK8sContainerStorageRequest); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricK8sContainerStorageRequest(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricK8sContainerStorageRequest, + descrMetricK8sContainerStorageRequest, + unitMetricK8sContainerStorageRequest); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricK8sContainerStorageRequest(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter(kMetricK8sContainerStorageRequest, + descrMetricK8sContainerStorageRequest, + unitMetricK8sContainerStorageRequest); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricK8sContainerStorageRequest(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter(kMetricK8sContainerStorageRequest, + descrMetricK8sContainerStorageRequest, + unitMetricK8sContainerStorageRequest); +} + /** The number of actively running jobs for a cronjob

        This metric aligns with the @code active @endcode field of the K8s - CronJobStatus.

        This metric SHOULD, at a minimum, be reported against a @code k8s.cronjob @endcode resource.

        updowncounter + CronJobStatus.

        updowncounter */ static constexpr const char *kMetricK8sCronjobActiveJobs = "k8s.cronjob.active_jobs"; static constexpr const char *descrMetricK8sCronjobActiveJobs = @@ -68,8 +594,7 @@ CreateAsyncDoubleMetricK8sCronjobActiveJobs(metrics::Meter *meter) This metric aligns with the @code currentNumberScheduled @endcode field of the K8s - DaemonSetStatus.

        This metric SHOULD, at a minimum, be reported against a @code k8s.daemonset @endcode resource.

        updowncounter + DaemonSetStatus.

        updowncounter */ static constexpr const char *kMetricK8sDaemonsetCurrentScheduledNodes = "k8s.daemonset.current_scheduled_nodes"; @@ -113,8 +638,7 @@ CreateAsyncDoubleMetricK8sDaemonsetCurrentScheduledNodes(metrics::Meter *meter) Number of nodes that should be running the daemon pod (including nodes currently running the daemon pod)

        This metric aligns with the @code desiredNumberScheduled @endcode field of the K8s - DaemonSetStatus.

        This metric SHOULD, at a minimum, be reported against a @code k8s.daemonset @endcode resource.

        updowncounter + DaemonSetStatus.

        updowncounter */ static constexpr const char *kMetricK8sDaemonsetDesiredScheduledNodes = "k8s.daemonset.desired_scheduled_nodes"; @@ -161,8 +685,7 @@ CreateAsyncDoubleMetricK8sDaemonsetDesiredScheduledNodes(metrics::Meter *meter) This metric aligns with the @code numberMisscheduled @endcode field of the K8s - DaemonSetStatus.

        This metric SHOULD, at a minimum, be reported against a @code k8s.daemonset @endcode resource.

        updowncounter + DaemonSetStatus.

        updowncounter */ static constexpr const char *kMetricK8sDaemonsetMisscheduledNodes = "k8s.daemonset.misscheduled_nodes"; @@ -206,8 +729,7 @@ CreateAsyncDoubleMetricK8sDaemonsetMisscheduledNodes(metrics::Meter *meter) Number of nodes that should be running the daemon pod and have one or more of the daemon pod running and ready

        This metric aligns with the @code numberReady @endcode field of the K8s - DaemonSetStatus.

        This metric SHOULD, at a minimum, be reported against a @code k8s.daemonset @endcode resource.

        updowncounter + DaemonSetStatus.

        updowncounter */ static constexpr const char *kMetricK8sDaemonsetReadyNodes = "k8s.daemonset.ready_nodes"; static constexpr const char *descrMetricK8sDaemonsetReadyNodes = @@ -251,8 +773,7 @@ CreateAsyncDoubleMetricK8sDaemonsetReadyNodes(metrics::Meter *meter) Total number of available replica pods (ready for at least minReadySeconds) targeted by this deployment

        This metric aligns with the @code availableReplicas @endcode field of the K8s - DeploymentStatus.

        This metric SHOULD, at a minimum, be reported against a @code k8s.deployment @endcode resource.

        updowncounter + DeploymentStatus.

        updowncounter */ static constexpr const char *kMetricK8sDeploymentAvailablePods = "k8s.deployment.available_pods"; static constexpr const char *descrMetricK8sDeploymentAvailablePods = @@ -298,8 +819,7 @@ CreateAsyncDoubleMetricK8sDeploymentAvailablePods(metrics::Meter *meter) This metric aligns with the @code replicas @endcode field of the K8s - DeploymentSpec.

        This metric SHOULD, at a minimum, be reported against a @code k8s.deployment @endcode resource.

        updowncounter + DeploymentSpec.

        updowncounter */ static constexpr const char *kMetricK8sDeploymentDesiredPods = "k8s.deployment.desired_pods"; static constexpr const char *descrMetricK8sDeploymentDesiredPods = @@ -342,9 +862,7 @@ CreateAsyncDoubleMetricK8sDeploymentDesiredPods(metrics::Meter *meter) Current number of replica pods managed by this horizontal pod autoscaler, as last seen by the autoscaler

        This metric aligns with the @code currentReplicas @endcode field of the K8s - HorizontalPodAutoscalerStatus

        This metric SHOULD, at a minimum, be reported against a @code k8s.hpa @endcode resource.

        - updowncounter + HorizontalPodAutoscalerStatus

        updowncounter */ static constexpr const char *kMetricK8sHpaCurrentPods = "k8s.hpa.current_pods"; static constexpr const char *descrMetricK8sHpaCurrentPods = @@ -384,9 +902,7 @@ CreateAsyncDoubleMetricK8sHpaCurrentPods(metrics::Meter *meter) Desired number of replica pods managed by this horizontal pod autoscaler, as last calculated by the autoscaler

        This metric aligns with the @code desiredReplicas @endcode field of the K8s - HorizontalPodAutoscalerStatus

        This metric SHOULD, at a minimum, be reported against a @code k8s.hpa @endcode resource.

        - updowncounter + HorizontalPodAutoscalerStatus

        updowncounter */ static constexpr const char *kMetricK8sHpaDesiredPods = "k8s.hpa.desired_pods"; static constexpr const char *descrMetricK8sHpaDesiredPods = @@ -428,9 +944,7 @@ CreateAsyncDoubleMetricK8sHpaDesiredPods(metrics::Meter *meter) This metric aligns with the @code maxReplicas @endcode field of the K8s - HorizontalPodAutoscalerSpec

        This metric SHOULD, at a minimum, be reported against a @code k8s.hpa @endcode resource.

        - updowncounter + HorizontalPodAutoscalerSpec

        updowncounter */ static constexpr const char *kMetricK8sHpaMaxPods = "k8s.hpa.max_pods"; static constexpr const char *descrMetricK8sHpaMaxPods = @@ -466,14 +980,167 @@ static inline nostd::shared_ptr CreateAsyncDouble } /** - The lower limit for the number of replica pods to which the autoscaler can scale down + Target average utilization, in percentage, for CPU resource in HPA config.

        - This metric aligns with the @code minReplicas @endcode field of the + This metric aligns with the @code averageUtilization @endcode field of the K8s - HorizontalPodAutoscalerSpec

        This metric SHOULD, at a minimum, be reported against a @code k8s.hpa @endcode resource.

        - updowncounter + href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.30/#metrictarget-v2-autoscaling">K8s + HPA MetricTarget. If the type of the metric is @code + ContainerResource @endcode, the @code k8s.container.name @endcode attribute MUST be set to + identify the specific container within the pod to which the metric applies.

        gauge + */ +static constexpr const char *kMetricK8sHpaMetricTargetCpuAverageUtilization = + "k8s.hpa.metric.target.cpu.average_utilization"; +static constexpr const char *descrMetricK8sHpaMetricTargetCpuAverageUtilization = + "Target average utilization, in percentage, for CPU resource in HPA config."; +static constexpr const char *unitMetricK8sHpaMetricTargetCpuAverageUtilization = "1"; + +#if OPENTELEMETRY_ABI_VERSION_NO >= 2 + +static inline nostd::unique_ptr> +CreateSyncInt64MetricK8sHpaMetricTargetCpuAverageUtilization(metrics::Meter *meter) +{ + return meter->CreateInt64Gauge(kMetricK8sHpaMetricTargetCpuAverageUtilization, + descrMetricK8sHpaMetricTargetCpuAverageUtilization, + unitMetricK8sHpaMetricTargetCpuAverageUtilization); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricK8sHpaMetricTargetCpuAverageUtilization(metrics::Meter *meter) +{ + return meter->CreateDoubleGauge(kMetricK8sHpaMetricTargetCpuAverageUtilization, + descrMetricK8sHpaMetricTargetCpuAverageUtilization, + unitMetricK8sHpaMetricTargetCpuAverageUtilization); +} +#endif /* OPENTELEMETRY_ABI_VERSION_NO */ + +static inline nostd::shared_ptr +CreateAsyncInt64MetricK8sHpaMetricTargetCpuAverageUtilization(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableGauge(kMetricK8sHpaMetricTargetCpuAverageUtilization, + descrMetricK8sHpaMetricTargetCpuAverageUtilization, + unitMetricK8sHpaMetricTargetCpuAverageUtilization); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricK8sHpaMetricTargetCpuAverageUtilization(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableGauge(kMetricK8sHpaMetricTargetCpuAverageUtilization, + descrMetricK8sHpaMetricTargetCpuAverageUtilization, + unitMetricK8sHpaMetricTargetCpuAverageUtilization); +} + +/** + Target average value for CPU resource in HPA config. +

        + This metric aligns with the @code averageValue @endcode field of the + K8s + HPA MetricTarget. If the type of the metric is @code + ContainerResource @endcode, the @code k8s.container.name @endcode attribute MUST be set to + identify the specific container within the pod to which the metric applies.

        gauge + */ +static constexpr const char *kMetricK8sHpaMetricTargetCpuAverageValue = + "k8s.hpa.metric.target.cpu.average_value"; +static constexpr const char *descrMetricK8sHpaMetricTargetCpuAverageValue = + "Target average value for CPU resource in HPA config."; +static constexpr const char *unitMetricK8sHpaMetricTargetCpuAverageValue = "{cpu}"; + +#if OPENTELEMETRY_ABI_VERSION_NO >= 2 + +static inline nostd::unique_ptr> +CreateSyncInt64MetricK8sHpaMetricTargetCpuAverageValue(metrics::Meter *meter) +{ + return meter->CreateInt64Gauge(kMetricK8sHpaMetricTargetCpuAverageValue, + descrMetricK8sHpaMetricTargetCpuAverageValue, + unitMetricK8sHpaMetricTargetCpuAverageValue); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricK8sHpaMetricTargetCpuAverageValue(metrics::Meter *meter) +{ + return meter->CreateDoubleGauge(kMetricK8sHpaMetricTargetCpuAverageValue, + descrMetricK8sHpaMetricTargetCpuAverageValue, + unitMetricK8sHpaMetricTargetCpuAverageValue); +} +#endif /* OPENTELEMETRY_ABI_VERSION_NO */ + +static inline nostd::shared_ptr +CreateAsyncInt64MetricK8sHpaMetricTargetCpuAverageValue(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableGauge(kMetricK8sHpaMetricTargetCpuAverageValue, + descrMetricK8sHpaMetricTargetCpuAverageValue, + unitMetricK8sHpaMetricTargetCpuAverageValue); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricK8sHpaMetricTargetCpuAverageValue(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableGauge(kMetricK8sHpaMetricTargetCpuAverageValue, + descrMetricK8sHpaMetricTargetCpuAverageValue, + unitMetricK8sHpaMetricTargetCpuAverageValue); +} + +/** + Target value for CPU resource in HPA config. +

        + This metric aligns with the @code value @endcode field of the + K8s + HPA MetricTarget. If the type of the metric is @code + ContainerResource @endcode, the @code k8s.container.name @endcode attribute MUST be set to + identify the specific container within the pod to which the metric applies.

        gauge + */ +static constexpr const char *kMetricK8sHpaMetricTargetCpuValue = "k8s.hpa.metric.target.cpu.value"; +static constexpr const char *descrMetricK8sHpaMetricTargetCpuValue = + "Target value for CPU resource in HPA config."; +static constexpr const char *unitMetricK8sHpaMetricTargetCpuValue = "{cpu}"; + +#if OPENTELEMETRY_ABI_VERSION_NO >= 2 + +static inline nostd::unique_ptr> +CreateSyncInt64MetricK8sHpaMetricTargetCpuValue(metrics::Meter *meter) +{ + return meter->CreateInt64Gauge(kMetricK8sHpaMetricTargetCpuValue, + descrMetricK8sHpaMetricTargetCpuValue, + unitMetricK8sHpaMetricTargetCpuValue); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricK8sHpaMetricTargetCpuValue(metrics::Meter *meter) +{ + return meter->CreateDoubleGauge(kMetricK8sHpaMetricTargetCpuValue, + descrMetricK8sHpaMetricTargetCpuValue, + unitMetricK8sHpaMetricTargetCpuValue); +} +#endif /* OPENTELEMETRY_ABI_VERSION_NO */ + +static inline nostd::shared_ptr +CreateAsyncInt64MetricK8sHpaMetricTargetCpuValue(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableGauge(kMetricK8sHpaMetricTargetCpuValue, + descrMetricK8sHpaMetricTargetCpuValue, + unitMetricK8sHpaMetricTargetCpuValue); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricK8sHpaMetricTargetCpuValue(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableGauge(kMetricK8sHpaMetricTargetCpuValue, + descrMetricK8sHpaMetricTargetCpuValue, + unitMetricK8sHpaMetricTargetCpuValue); +} + +/** + The lower limit for the number of replica pods to which the autoscaler can scale down +

        + This metric aligns with the @code minReplicas @endcode field of the + K8s + HorizontalPodAutoscalerSpec

        updowncounter */ static constexpr const char *kMetricK8sHpaMinPods = "k8s.hpa.min_pods"; static constexpr const char *descrMetricK8sHpaMinPods = @@ -514,8 +1181,7 @@ static inline nostd::shared_ptr CreateAsyncDouble This metric aligns with the @code active @endcode field of the K8s - JobStatus.

        This metric SHOULD, at a minimum, be reported against a @code k8s.job @endcode resource.

        updowncounter + JobStatus.

        updowncounter */ static constexpr const char *kMetricK8sJobActivePods = "k8s.job.active_pods"; static constexpr const char *descrMetricK8sJobActivePods = @@ -556,8 +1222,7 @@ CreateAsyncDoubleMetricK8sJobActivePods(metrics::Meter *meter) This metric aligns with the @code completions @endcode field of the K8s - JobSpec.

        This metric SHOULD, at a minimum, be reported against a @code k8s.job @endcode resource.

        updowncounter + JobSpec..

        updowncounter */ static constexpr const char *kMetricK8sJobDesiredSuccessfulPods = "k8s.job.desired_successful_pods"; static constexpr const char *descrMetricK8sJobDesiredSuccessfulPods = @@ -602,8 +1267,7 @@ CreateAsyncDoubleMetricK8sJobDesiredSuccessfulPods(metrics::Meter *meter) This metric aligns with the @code failed @endcode field of the K8s - JobStatus.

        This metric SHOULD, at a minimum, be reported against a @code k8s.job @endcode resource.

        updowncounter + JobStatus.

        updowncounter */ static constexpr const char *kMetricK8sJobFailedPods = "k8s.job.failed_pods"; static constexpr const char *descrMetricK8sJobFailedPods = @@ -644,8 +1308,7 @@ CreateAsyncDoubleMetricK8sJobFailedPods(metrics::Meter *meter) This metric aligns with the @code parallelism @endcode field of the K8s - JobSpec.

        This metric SHOULD, at a minimum, be reported against a @code k8s.job @endcode resource.

        updowncounter + JobSpec.

        updowncounter */ static constexpr const char *kMetricK8sJobMaxParallelPods = "k8s.job.max_parallel_pods"; static constexpr const char *descrMetricK8sJobMaxParallelPods = @@ -690,8 +1353,7 @@ CreateAsyncDoubleMetricK8sJobMaxParallelPods(metrics::Meter *meter) This metric aligns with the @code succeeded @endcode field of the K8s - JobStatus.

        This metric SHOULD, at a minimum, be reported against a @code k8s.job @endcode resource.

        updowncounter + JobStatus.

        updowncounter */ static constexpr const char *kMetricK8sJobSuccessfulPods = "k8s.job.successful_pods"; static constexpr const char *descrMetricK8sJobSuccessfulPods = @@ -729,9 +1391,6 @@ CreateAsyncDoubleMetricK8sJobSuccessfulPods(metrics::Meter *meter) /** Describes number of K8s namespaces that are currently in a given phase.

        - This metric SHOULD, at a minimum, be reported against a - @code k8s.namespace @endcode resource. -

        updowncounter */ static constexpr const char *kMetricK8sNamespacePhase = "k8s.namespace.phase"; @@ -767,6 +1426,219 @@ CreateAsyncDoubleMetricK8sNamespacePhase(metrics::Meter *meter) kMetricK8sNamespacePhase, descrMetricK8sNamespacePhase, unitMetricK8sNamespacePhase); } +/** + Amount of cpu allocatable on the node +

        + updowncounter + */ +static constexpr const char *kMetricK8sNodeAllocatableCpu = "k8s.node.allocatable.cpu"; +static constexpr const char *descrMetricK8sNodeAllocatableCpu = + "Amount of cpu allocatable on the node"; +static constexpr const char *unitMetricK8sNodeAllocatableCpu = "{cpu}"; + +static inline nostd::unique_ptr> +CreateSyncInt64MetricK8sNodeAllocatableCpu(metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricK8sNodeAllocatableCpu, + descrMetricK8sNodeAllocatableCpu, + unitMetricK8sNodeAllocatableCpu); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricK8sNodeAllocatableCpu(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricK8sNodeAllocatableCpu, + descrMetricK8sNodeAllocatableCpu, + unitMetricK8sNodeAllocatableCpu); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricK8sNodeAllocatableCpu(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter(kMetricK8sNodeAllocatableCpu, + descrMetricK8sNodeAllocatableCpu, + unitMetricK8sNodeAllocatableCpu); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricK8sNodeAllocatableCpu(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter(kMetricK8sNodeAllocatableCpu, + descrMetricK8sNodeAllocatableCpu, + unitMetricK8sNodeAllocatableCpu); +} + +/** + Amount of ephemeral-storage allocatable on the node +

        + updowncounter + */ +static constexpr const char *kMetricK8sNodeAllocatableEphemeralStorage = + "k8s.node.allocatable.ephemeral_storage"; +static constexpr const char *descrMetricK8sNodeAllocatableEphemeralStorage = + "Amount of ephemeral-storage allocatable on the node"; +static constexpr const char *unitMetricK8sNodeAllocatableEphemeralStorage = "By"; + +static inline nostd::unique_ptr> +CreateSyncInt64MetricK8sNodeAllocatableEphemeralStorage(metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricK8sNodeAllocatableEphemeralStorage, + descrMetricK8sNodeAllocatableEphemeralStorage, + unitMetricK8sNodeAllocatableEphemeralStorage); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricK8sNodeAllocatableEphemeralStorage(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricK8sNodeAllocatableEphemeralStorage, + descrMetricK8sNodeAllocatableEphemeralStorage, + unitMetricK8sNodeAllocatableEphemeralStorage); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricK8sNodeAllocatableEphemeralStorage(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter(kMetricK8sNodeAllocatableEphemeralStorage, + descrMetricK8sNodeAllocatableEphemeralStorage, + unitMetricK8sNodeAllocatableEphemeralStorage); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricK8sNodeAllocatableEphemeralStorage(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter(kMetricK8sNodeAllocatableEphemeralStorage, + descrMetricK8sNodeAllocatableEphemeralStorage, + unitMetricK8sNodeAllocatableEphemeralStorage); +} + +/** + Amount of memory allocatable on the node +

        + updowncounter + */ +static constexpr const char *kMetricK8sNodeAllocatableMemory = "k8s.node.allocatable.memory"; +static constexpr const char *descrMetricK8sNodeAllocatableMemory = + "Amount of memory allocatable on the node"; +static constexpr const char *unitMetricK8sNodeAllocatableMemory = "By"; + +static inline nostd::unique_ptr> +CreateSyncInt64MetricK8sNodeAllocatableMemory(metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricK8sNodeAllocatableMemory, + descrMetricK8sNodeAllocatableMemory, + unitMetricK8sNodeAllocatableMemory); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricK8sNodeAllocatableMemory(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricK8sNodeAllocatableMemory, + descrMetricK8sNodeAllocatableMemory, + unitMetricK8sNodeAllocatableMemory); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricK8sNodeAllocatableMemory(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter(kMetricK8sNodeAllocatableMemory, + descrMetricK8sNodeAllocatableMemory, + unitMetricK8sNodeAllocatableMemory); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricK8sNodeAllocatableMemory(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter(kMetricK8sNodeAllocatableMemory, + descrMetricK8sNodeAllocatableMemory, + unitMetricK8sNodeAllocatableMemory); +} + +/** + Amount of pods allocatable on the node +

        + updowncounter + */ +static constexpr const char *kMetricK8sNodeAllocatablePods = "k8s.node.allocatable.pods"; +static constexpr const char *descrMetricK8sNodeAllocatablePods = + "Amount of pods allocatable on the node"; +static constexpr const char *unitMetricK8sNodeAllocatablePods = "{pod}"; + +static inline nostd::unique_ptr> +CreateSyncInt64MetricK8sNodeAllocatablePods(metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricK8sNodeAllocatablePods, + descrMetricK8sNodeAllocatablePods, + unitMetricK8sNodeAllocatablePods); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricK8sNodeAllocatablePods(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricK8sNodeAllocatablePods, + descrMetricK8sNodeAllocatablePods, + unitMetricK8sNodeAllocatablePods); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricK8sNodeAllocatablePods(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter(kMetricK8sNodeAllocatablePods, + descrMetricK8sNodeAllocatablePods, + unitMetricK8sNodeAllocatablePods); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricK8sNodeAllocatablePods(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter(kMetricK8sNodeAllocatablePods, + descrMetricK8sNodeAllocatablePods, + unitMetricK8sNodeAllocatablePods); +} + +/** + Describes the condition of a particular Node. +

        + All possible node condition pairs (type and status) will be reported at each time interval to + avoid missing metrics. Condition pairs corresponding to the current conditions' statuses will be + non-zero.

        updowncounter + */ +static constexpr const char *kMetricK8sNodeConditionStatus = "k8s.node.condition.status"; +static constexpr const char *descrMetricK8sNodeConditionStatus = + "Describes the condition of a particular Node."; +static constexpr const char *unitMetricK8sNodeConditionStatus = "{node}"; + +static inline nostd::unique_ptr> +CreateSyncInt64MetricK8sNodeConditionStatus(metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricK8sNodeConditionStatus, + descrMetricK8sNodeConditionStatus, + unitMetricK8sNodeConditionStatus); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricK8sNodeConditionStatus(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricK8sNodeConditionStatus, + descrMetricK8sNodeConditionStatus, + unitMetricK8sNodeConditionStatus); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricK8sNodeConditionStatus(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter(kMetricK8sNodeConditionStatus, + descrMetricK8sNodeConditionStatus, + unitMetricK8sNodeConditionStatus); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricK8sNodeConditionStatus(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter(kMetricK8sNodeConditionStatus, + descrMetricK8sNodeConditionStatus, + unitMetricK8sNodeConditionStatus); +} + /** Total CPU time consumed

        @@ -1251,8 +2123,7 @@ static inline nostd::shared_ptr CreateAsyncDouble Total number of available replica pods (ready for at least minReadySeconds) targeted by this replicaset

        This metric aligns with the @code availableReplicas @endcode field of the K8s - ReplicaSetStatus.

        This metric SHOULD, at a minimum, be reported against a @code k8s.replicaset @endcode resource.

        updowncounter + ReplicaSetStatus.

        updowncounter */ static constexpr const char *kMetricK8sReplicasetAvailablePods = "k8s.replicaset.available_pods"; static constexpr const char *descrMetricK8sReplicasetAvailablePods = @@ -1298,8 +2169,7 @@ CreateAsyncDoubleMetricK8sReplicasetAvailablePods(metrics::Meter *meter) This metric aligns with the @code replicas @endcode field of the K8s - ReplicaSetSpec.

        This metric SHOULD, at a minimum, be reported against a @code k8s.replicaset @endcode resource.

        updowncounter + ReplicaSetSpec.

        updowncounter */ static constexpr const char *kMetricK8sReplicasetDesiredPods = "k8s.replicaset.desired_pods"; static constexpr const char *descrMetricK8sReplicasetDesiredPods = @@ -1438,9 +2308,7 @@ CreateAsyncDoubleMetricK8sReplicationControllerDesiredPods(metrics::Meter *meter replication controller

        This metric aligns with the @code availableReplicas @endcode field of the K8s - ReplicationControllerStatus

        This metric SHOULD, at a minimum, be reported against a @code k8s.replicationcontroller @endcode - resource.

        updowncounter + ReplicationControllerStatus

        updowncounter */ static constexpr const char *kMetricK8sReplicationcontrollerAvailablePods = "k8s.replicationcontroller.available_pods"; @@ -1488,9 +2356,7 @@ CreateAsyncDoubleMetricK8sReplicationcontrollerAvailablePods(metrics::Meter *met This metric aligns with the @code replicas @endcode field of the K8s - ReplicationControllerSpec

        This metric SHOULD, at a minimum, be reported against a @code k8s.replicationcontroller @endcode - resource.

        updowncounter + ReplicationControllerSpec

        updowncounter */ static constexpr const char *kMetricK8sReplicationcontrollerDesiredPods = "k8s.replicationcontroller.desired_pods"; @@ -1531,154 +2397,1128 @@ CreateAsyncDoubleMetricK8sReplicationcontrollerDesiredPods(metrics::Meter *meter } /** - The number of replica pods created by the statefulset controller from the statefulset version - indicated by currentRevision

        This metric aligns with the @code currentReplicas @endcode field - of the K8s - StatefulSetStatus.

        This metric SHOULD, at a minimum, be reported against a @code k8s.statefulset @endcode resource.

        - updowncounter + The CPU limits in a specific namespace. + The value represents the configured quota limit of the resource in the namespace. +

        + This metric is retrieved from the @code hard @endcode field of the + K8s + ResourceQuotaStatus.

        updowncounter */ -static constexpr const char *kMetricK8sStatefulsetCurrentPods = "k8s.statefulset.current_pods"; -static constexpr const char *descrMetricK8sStatefulsetCurrentPods = - "The number of replica pods created by the statefulset controller from the statefulset version " - "indicated by currentRevision"; -static constexpr const char *unitMetricK8sStatefulsetCurrentPods = "{pod}"; +static constexpr const char *kMetricK8sResourcequotaCpuLimitHard = + "k8s.resourcequota.cpu.limit.hard"; +static constexpr const char *descrMetricK8sResourcequotaCpuLimitHard = + "The CPU limits in a specific namespace. + The value represents the configured quota limit of the resource in the namespace."; + static constexpr const char *unitMetricK8sResourcequotaCpuLimitHard = "{cpu}"; static inline nostd::unique_ptr> -CreateSyncInt64MetricK8sStatefulsetCurrentPods(metrics::Meter *meter) +CreateSyncInt64MetricK8sResourcequotaCpuLimitHard(metrics::Meter *meter) { - return meter->CreateInt64UpDownCounter(kMetricK8sStatefulsetCurrentPods, - descrMetricK8sStatefulsetCurrentPods, - unitMetricK8sStatefulsetCurrentPods); + return meter->CreateInt64UpDownCounter(kMetricK8sResourcequotaCpuLimitHard, + descrMetricK8sResourcequotaCpuLimitHard, + unitMetricK8sResourcequotaCpuLimitHard); } static inline nostd::unique_ptr> -CreateSyncDoubleMetricK8sStatefulsetCurrentPods(metrics::Meter *meter) +CreateSyncDoubleMetricK8sResourcequotaCpuLimitHard(metrics::Meter *meter) { - return meter->CreateDoubleUpDownCounter(kMetricK8sStatefulsetCurrentPods, - descrMetricK8sStatefulsetCurrentPods, - unitMetricK8sStatefulsetCurrentPods); + return meter->CreateDoubleUpDownCounter(kMetricK8sResourcequotaCpuLimitHard, + descrMetricK8sResourcequotaCpuLimitHard, + unitMetricK8sResourcequotaCpuLimitHard); } static inline nostd::shared_ptr -CreateAsyncInt64MetricK8sStatefulsetCurrentPods(metrics::Meter *meter) +CreateAsyncInt64MetricK8sResourcequotaCpuLimitHard(metrics::Meter *meter) { - return meter->CreateInt64ObservableUpDownCounter(kMetricK8sStatefulsetCurrentPods, - descrMetricK8sStatefulsetCurrentPods, - unitMetricK8sStatefulsetCurrentPods); + return meter->CreateInt64ObservableUpDownCounter(kMetricK8sResourcequotaCpuLimitHard, + descrMetricK8sResourcequotaCpuLimitHard, + unitMetricK8sResourcequotaCpuLimitHard); } static inline nostd::shared_ptr -CreateAsyncDoubleMetricK8sStatefulsetCurrentPods(metrics::Meter *meter) +CreateAsyncDoubleMetricK8sResourcequotaCpuLimitHard(metrics::Meter *meter) { - return meter->CreateDoubleObservableUpDownCounter(kMetricK8sStatefulsetCurrentPods, - descrMetricK8sStatefulsetCurrentPods, - unitMetricK8sStatefulsetCurrentPods); + return meter->CreateDoubleObservableUpDownCounter(kMetricK8sResourcequotaCpuLimitHard, + descrMetricK8sResourcequotaCpuLimitHard, + unitMetricK8sResourcequotaCpuLimitHard); } /** - Number of desired replica pods in this statefulset + The CPU limits in a specific namespace. + The value represents the current observed total usage of the resource in the namespace.

        - This metric aligns with the @code replicas @endcode field of the + This metric is retrieved from the @code used @endcode field of the K8s - StatefulSetSpec.

        This metric SHOULD, at a minimum, be reported against a @code k8s.statefulset @endcode resource.

        - updowncounter + href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.32/#resourcequotastatus-v1-core">K8s + ResourceQuotaStatus.

        updowncounter */ -static constexpr const char *kMetricK8sStatefulsetDesiredPods = "k8s.statefulset.desired_pods"; -static constexpr const char *descrMetricK8sStatefulsetDesiredPods = - "Number of desired replica pods in this statefulset"; -static constexpr const char *unitMetricK8sStatefulsetDesiredPods = "{pod}"; +static constexpr const char *kMetricK8sResourcequotaCpuLimitUsed = + "k8s.resourcequota.cpu.limit.used"; +static constexpr const char *descrMetricK8sResourcequotaCpuLimitUsed = + "The CPU limits in a specific namespace. + The value represents the current observed total usage of the resource in the namespace."; + static constexpr const char *unitMetricK8sResourcequotaCpuLimitUsed = "{cpu}"; static inline nostd::unique_ptr> -CreateSyncInt64MetricK8sStatefulsetDesiredPods(metrics::Meter *meter) +CreateSyncInt64MetricK8sResourcequotaCpuLimitUsed(metrics::Meter *meter) { - return meter->CreateInt64UpDownCounter(kMetricK8sStatefulsetDesiredPods, - descrMetricK8sStatefulsetDesiredPods, - unitMetricK8sStatefulsetDesiredPods); + return meter->CreateInt64UpDownCounter(kMetricK8sResourcequotaCpuLimitUsed, + descrMetricK8sResourcequotaCpuLimitUsed, + unitMetricK8sResourcequotaCpuLimitUsed); } static inline nostd::unique_ptr> -CreateSyncDoubleMetricK8sStatefulsetDesiredPods(metrics::Meter *meter) +CreateSyncDoubleMetricK8sResourcequotaCpuLimitUsed(metrics::Meter *meter) { - return meter->CreateDoubleUpDownCounter(kMetricK8sStatefulsetDesiredPods, - descrMetricK8sStatefulsetDesiredPods, - unitMetricK8sStatefulsetDesiredPods); + return meter->CreateDoubleUpDownCounter(kMetricK8sResourcequotaCpuLimitUsed, + descrMetricK8sResourcequotaCpuLimitUsed, + unitMetricK8sResourcequotaCpuLimitUsed); } static inline nostd::shared_ptr -CreateAsyncInt64MetricK8sStatefulsetDesiredPods(metrics::Meter *meter) +CreateAsyncInt64MetricK8sResourcequotaCpuLimitUsed(metrics::Meter *meter) { - return meter->CreateInt64ObservableUpDownCounter(kMetricK8sStatefulsetDesiredPods, - descrMetricK8sStatefulsetDesiredPods, - unitMetricK8sStatefulsetDesiredPods); + return meter->CreateInt64ObservableUpDownCounter(kMetricK8sResourcequotaCpuLimitUsed, + descrMetricK8sResourcequotaCpuLimitUsed, + unitMetricK8sResourcequotaCpuLimitUsed); } static inline nostd::shared_ptr -CreateAsyncDoubleMetricK8sStatefulsetDesiredPods(metrics::Meter *meter) +CreateAsyncDoubleMetricK8sResourcequotaCpuLimitUsed(metrics::Meter *meter) { - return meter->CreateDoubleObservableUpDownCounter(kMetricK8sStatefulsetDesiredPods, - descrMetricK8sStatefulsetDesiredPods, - unitMetricK8sStatefulsetDesiredPods); + return meter->CreateDoubleObservableUpDownCounter(kMetricK8sResourcequotaCpuLimitUsed, + descrMetricK8sResourcequotaCpuLimitUsed, + unitMetricK8sResourcequotaCpuLimitUsed); } /** - The number of replica pods created for this statefulset with a Ready Condition + The CPU requests in a specific namespace. + The value represents the configured quota limit of the resource in the namespace.

        - This metric aligns with the @code readyReplicas @endcode field of the + This metric is retrieved from the @code hard @endcode field of the K8s - StatefulSetStatus.

        This metric SHOULD, at a minimum, be reported against a @code k8s.statefulset @endcode resource.

        - updowncounter + href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.32/#resourcequotastatus-v1-core">K8s + ResourceQuotaStatus.

        updowncounter */ -static constexpr const char *kMetricK8sStatefulsetReadyPods = "k8s.statefulset.ready_pods"; -static constexpr const char *descrMetricK8sStatefulsetReadyPods = - "The number of replica pods created for this statefulset with a Ready Condition"; -static constexpr const char *unitMetricK8sStatefulsetReadyPods = "{pod}"; +static constexpr const char *kMetricK8sResourcequotaCpuRequestHard = + "k8s.resourcequota.cpu.request.hard"; +static constexpr const char *descrMetricK8sResourcequotaCpuRequestHard = + "The CPU requests in a specific namespace. + The value represents the configured quota limit of the resource in the namespace."; + static constexpr const char *unitMetricK8sResourcequotaCpuRequestHard = "{cpu}"; static inline nostd::unique_ptr> -CreateSyncInt64MetricK8sStatefulsetReadyPods(metrics::Meter *meter) +CreateSyncInt64MetricK8sResourcequotaCpuRequestHard(metrics::Meter *meter) { - return meter->CreateInt64UpDownCounter(kMetricK8sStatefulsetReadyPods, - descrMetricK8sStatefulsetReadyPods, - unitMetricK8sStatefulsetReadyPods); + return meter->CreateInt64UpDownCounter(kMetricK8sResourcequotaCpuRequestHard, + descrMetricK8sResourcequotaCpuRequestHard, + unitMetricK8sResourcequotaCpuRequestHard); } static inline nostd::unique_ptr> -CreateSyncDoubleMetricK8sStatefulsetReadyPods(metrics::Meter *meter) +CreateSyncDoubleMetricK8sResourcequotaCpuRequestHard(metrics::Meter *meter) { - return meter->CreateDoubleUpDownCounter(kMetricK8sStatefulsetReadyPods, - descrMetricK8sStatefulsetReadyPods, - unitMetricK8sStatefulsetReadyPods); + return meter->CreateDoubleUpDownCounter(kMetricK8sResourcequotaCpuRequestHard, + descrMetricK8sResourcequotaCpuRequestHard, + unitMetricK8sResourcequotaCpuRequestHard); } static inline nostd::shared_ptr -CreateAsyncInt64MetricK8sStatefulsetReadyPods(metrics::Meter *meter) +CreateAsyncInt64MetricK8sResourcequotaCpuRequestHard(metrics::Meter *meter) { - return meter->CreateInt64ObservableUpDownCounter(kMetricK8sStatefulsetReadyPods, - descrMetricK8sStatefulsetReadyPods, - unitMetricK8sStatefulsetReadyPods); + return meter->CreateInt64ObservableUpDownCounter(kMetricK8sResourcequotaCpuRequestHard, + descrMetricK8sResourcequotaCpuRequestHard, + unitMetricK8sResourcequotaCpuRequestHard); } static inline nostd::shared_ptr -CreateAsyncDoubleMetricK8sStatefulsetReadyPods(metrics::Meter *meter) +CreateAsyncDoubleMetricK8sResourcequotaCpuRequestHard(metrics::Meter *meter) { - return meter->CreateDoubleObservableUpDownCounter(kMetricK8sStatefulsetReadyPods, - descrMetricK8sStatefulsetReadyPods, - unitMetricK8sStatefulsetReadyPods); + return meter->CreateDoubleObservableUpDownCounter(kMetricK8sResourcequotaCpuRequestHard, + descrMetricK8sResourcequotaCpuRequestHard, + unitMetricK8sResourcequotaCpuRequestHard); } /** - Number of replica pods created by the statefulset controller from the statefulset version - indicated by updateRevision

        This metric aligns with the @code updatedReplicas @endcode field - of the K8s - StatefulSetStatus.

        This metric SHOULD, at a minimum, be reported against a @code k8s.statefulset @endcode resource.

        - updowncounter + The CPU requests in a specific namespace. + The value represents the current observed total usage of the resource in the namespace. +

        + This metric is retrieved from the @code used @endcode field of the + K8s + ResourceQuotaStatus.

        updowncounter + */ +static constexpr const char *kMetricK8sResourcequotaCpuRequestUsed = + "k8s.resourcequota.cpu.request.used"; +static constexpr const char *descrMetricK8sResourcequotaCpuRequestUsed = + "The CPU requests in a specific namespace. + The value represents the current observed total usage of the resource in the namespace."; + static constexpr const char *unitMetricK8sResourcequotaCpuRequestUsed = "{cpu}"; + +static inline nostd::unique_ptr> +CreateSyncInt64MetricK8sResourcequotaCpuRequestUsed(metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricK8sResourcequotaCpuRequestUsed, + descrMetricK8sResourcequotaCpuRequestUsed, + unitMetricK8sResourcequotaCpuRequestUsed); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricK8sResourcequotaCpuRequestUsed(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricK8sResourcequotaCpuRequestUsed, + descrMetricK8sResourcequotaCpuRequestUsed, + unitMetricK8sResourcequotaCpuRequestUsed); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricK8sResourcequotaCpuRequestUsed(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter(kMetricK8sResourcequotaCpuRequestUsed, + descrMetricK8sResourcequotaCpuRequestUsed, + unitMetricK8sResourcequotaCpuRequestUsed); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricK8sResourcequotaCpuRequestUsed(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter(kMetricK8sResourcequotaCpuRequestUsed, + descrMetricK8sResourcequotaCpuRequestUsed, + unitMetricK8sResourcequotaCpuRequestUsed); +} + +/** + The sum of local ephemeral storage limits in the namespace. + The value represents the configured quota limit of the resource in the namespace. +

        + This metric is retrieved from the @code hard @endcode field of the + K8s + ResourceQuotaStatus.

        updowncounter + */ +static constexpr const char *kMetricK8sResourcequotaEphemeralStorageLimitHard = + "k8s.resourcequota.ephemeral_storage.limit.hard"; +static constexpr const char *descrMetricK8sResourcequotaEphemeralStorageLimitHard = + "The sum of local ephemeral storage limits in the namespace. + The value represents the configured quota limit of the resource in the namespace."; + static constexpr const char *unitMetricK8sResourcequotaEphemeralStorageLimitHard = "By"; + +static inline nostd::unique_ptr> +CreateSyncInt64MetricK8sResourcequotaEphemeralStorageLimitHard(metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricK8sResourcequotaEphemeralStorageLimitHard, + descrMetricK8sResourcequotaEphemeralStorageLimitHard, + unitMetricK8sResourcequotaEphemeralStorageLimitHard); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricK8sResourcequotaEphemeralStorageLimitHard(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricK8sResourcequotaEphemeralStorageLimitHard, + descrMetricK8sResourcequotaEphemeralStorageLimitHard, + unitMetricK8sResourcequotaEphemeralStorageLimitHard); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricK8sResourcequotaEphemeralStorageLimitHard(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter( + kMetricK8sResourcequotaEphemeralStorageLimitHard, + descrMetricK8sResourcequotaEphemeralStorageLimitHard, + unitMetricK8sResourcequotaEphemeralStorageLimitHard); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricK8sResourcequotaEphemeralStorageLimitHard(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter( + kMetricK8sResourcequotaEphemeralStorageLimitHard, + descrMetricK8sResourcequotaEphemeralStorageLimitHard, + unitMetricK8sResourcequotaEphemeralStorageLimitHard); +} + +/** + The sum of local ephemeral storage limits in the namespace. + The value represents the current observed total usage of the resource in the namespace. +

        + This metric is retrieved from the @code used @endcode field of the + K8s + ResourceQuotaStatus.

        updowncounter + */ +static constexpr const char *kMetricK8sResourcequotaEphemeralStorageLimitUsed = + "k8s.resourcequota.ephemeral_storage.limit.used"; +static constexpr const char *descrMetricK8sResourcequotaEphemeralStorageLimitUsed = + "The sum of local ephemeral storage limits in the namespace. + The value represents the current observed total usage of the resource in the namespace."; + static constexpr const char *unitMetricK8sResourcequotaEphemeralStorageLimitUsed = "By"; + +static inline nostd::unique_ptr> +CreateSyncInt64MetricK8sResourcequotaEphemeralStorageLimitUsed(metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricK8sResourcequotaEphemeralStorageLimitUsed, + descrMetricK8sResourcequotaEphemeralStorageLimitUsed, + unitMetricK8sResourcequotaEphemeralStorageLimitUsed); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricK8sResourcequotaEphemeralStorageLimitUsed(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricK8sResourcequotaEphemeralStorageLimitUsed, + descrMetricK8sResourcequotaEphemeralStorageLimitUsed, + unitMetricK8sResourcequotaEphemeralStorageLimitUsed); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricK8sResourcequotaEphemeralStorageLimitUsed(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter( + kMetricK8sResourcequotaEphemeralStorageLimitUsed, + descrMetricK8sResourcequotaEphemeralStorageLimitUsed, + unitMetricK8sResourcequotaEphemeralStorageLimitUsed); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricK8sResourcequotaEphemeralStorageLimitUsed(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter( + kMetricK8sResourcequotaEphemeralStorageLimitUsed, + descrMetricK8sResourcequotaEphemeralStorageLimitUsed, + unitMetricK8sResourcequotaEphemeralStorageLimitUsed); +} + +/** + The sum of local ephemeral storage requests in the namespace. + The value represents the configured quota limit of the resource in the namespace. +

        + This metric is retrieved from the @code hard @endcode field of the + K8s + ResourceQuotaStatus.

        updowncounter + */ +static constexpr const char *kMetricK8sResourcequotaEphemeralStorageRequestHard = + "k8s.resourcequota.ephemeral_storage.request.hard"; +static constexpr const char *descrMetricK8sResourcequotaEphemeralStorageRequestHard = + "The sum of local ephemeral storage requests in the namespace. + The value represents the configured quota limit of the resource in the namespace."; + static constexpr const char *unitMetricK8sResourcequotaEphemeralStorageRequestHard = "By"; + +static inline nostd::unique_ptr> +CreateSyncInt64MetricK8sResourcequotaEphemeralStorageRequestHard(metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricK8sResourcequotaEphemeralStorageRequestHard, + descrMetricK8sResourcequotaEphemeralStorageRequestHard, + unitMetricK8sResourcequotaEphemeralStorageRequestHard); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricK8sResourcequotaEphemeralStorageRequestHard(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricK8sResourcequotaEphemeralStorageRequestHard, + descrMetricK8sResourcequotaEphemeralStorageRequestHard, + unitMetricK8sResourcequotaEphemeralStorageRequestHard); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricK8sResourcequotaEphemeralStorageRequestHard(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter( + kMetricK8sResourcequotaEphemeralStorageRequestHard, + descrMetricK8sResourcequotaEphemeralStorageRequestHard, + unitMetricK8sResourcequotaEphemeralStorageRequestHard); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricK8sResourcequotaEphemeralStorageRequestHard(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter( + kMetricK8sResourcequotaEphemeralStorageRequestHard, + descrMetricK8sResourcequotaEphemeralStorageRequestHard, + unitMetricK8sResourcequotaEphemeralStorageRequestHard); +} + +/** + The sum of local ephemeral storage requests in the namespace. + The value represents the current observed total usage of the resource in the namespace. +

        + This metric is retrieved from the @code used @endcode field of the + K8s + ResourceQuotaStatus.

        updowncounter + */ +static constexpr const char *kMetricK8sResourcequotaEphemeralStorageRequestUsed = + "k8s.resourcequota.ephemeral_storage.request.used"; +static constexpr const char *descrMetricK8sResourcequotaEphemeralStorageRequestUsed = + "The sum of local ephemeral storage requests in the namespace. + The value represents the current observed total usage of the resource in the namespace."; + static constexpr const char *unitMetricK8sResourcequotaEphemeralStorageRequestUsed = "By"; + +static inline nostd::unique_ptr> +CreateSyncInt64MetricK8sResourcequotaEphemeralStorageRequestUsed(metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricK8sResourcequotaEphemeralStorageRequestUsed, + descrMetricK8sResourcequotaEphemeralStorageRequestUsed, + unitMetricK8sResourcequotaEphemeralStorageRequestUsed); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricK8sResourcequotaEphemeralStorageRequestUsed(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricK8sResourcequotaEphemeralStorageRequestUsed, + descrMetricK8sResourcequotaEphemeralStorageRequestUsed, + unitMetricK8sResourcequotaEphemeralStorageRequestUsed); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricK8sResourcequotaEphemeralStorageRequestUsed(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter( + kMetricK8sResourcequotaEphemeralStorageRequestUsed, + descrMetricK8sResourcequotaEphemeralStorageRequestUsed, + unitMetricK8sResourcequotaEphemeralStorageRequestUsed); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricK8sResourcequotaEphemeralStorageRequestUsed(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter( + kMetricK8sResourcequotaEphemeralStorageRequestUsed, + descrMetricK8sResourcequotaEphemeralStorageRequestUsed, + unitMetricK8sResourcequotaEphemeralStorageRequestUsed); +} + +/** + The huge page requests in a specific namespace. + The value represents the configured quota limit of the resource in the namespace. +

        + This metric is retrieved from the @code hard @endcode field of the + K8s + ResourceQuotaStatus.

        updowncounter + */ +static constexpr const char *kMetricK8sResourcequotaHugepageCountRequestHard = + "k8s.resourcequota.hugepage_count.request.hard"; +static constexpr const char *descrMetricK8sResourcequotaHugepageCountRequestHard = + "The huge page requests in a specific namespace. + The value represents the configured quota limit of the resource in the namespace."; + static constexpr const char *unitMetricK8sResourcequotaHugepageCountRequestHard = "{hugepage}"; + +static inline nostd::unique_ptr> +CreateSyncInt64MetricK8sResourcequotaHugepageCountRequestHard(metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricK8sResourcequotaHugepageCountRequestHard, + descrMetricK8sResourcequotaHugepageCountRequestHard, + unitMetricK8sResourcequotaHugepageCountRequestHard); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricK8sResourcequotaHugepageCountRequestHard(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricK8sResourcequotaHugepageCountRequestHard, + descrMetricK8sResourcequotaHugepageCountRequestHard, + unitMetricK8sResourcequotaHugepageCountRequestHard); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricK8sResourcequotaHugepageCountRequestHard(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter( + kMetricK8sResourcequotaHugepageCountRequestHard, + descrMetricK8sResourcequotaHugepageCountRequestHard, + unitMetricK8sResourcequotaHugepageCountRequestHard); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricK8sResourcequotaHugepageCountRequestHard(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter( + kMetricK8sResourcequotaHugepageCountRequestHard, + descrMetricK8sResourcequotaHugepageCountRequestHard, + unitMetricK8sResourcequotaHugepageCountRequestHard); +} + +/** + The huge page requests in a specific namespace. + The value represents the current observed total usage of the resource in the namespace. +

        + This metric is retrieved from the @code used @endcode field of the + K8s + ResourceQuotaStatus.

        updowncounter + */ +static constexpr const char *kMetricK8sResourcequotaHugepageCountRequestUsed = + "k8s.resourcequota.hugepage_count.request.used"; +static constexpr const char *descrMetricK8sResourcequotaHugepageCountRequestUsed = + "The huge page requests in a specific namespace. + The value represents the current observed total usage of the resource in the namespace."; + static constexpr const char *unitMetricK8sResourcequotaHugepageCountRequestUsed = "{hugepage}"; + +static inline nostd::unique_ptr> +CreateSyncInt64MetricK8sResourcequotaHugepageCountRequestUsed(metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricK8sResourcequotaHugepageCountRequestUsed, + descrMetricK8sResourcequotaHugepageCountRequestUsed, + unitMetricK8sResourcequotaHugepageCountRequestUsed); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricK8sResourcequotaHugepageCountRequestUsed(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricK8sResourcequotaHugepageCountRequestUsed, + descrMetricK8sResourcequotaHugepageCountRequestUsed, + unitMetricK8sResourcequotaHugepageCountRequestUsed); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricK8sResourcequotaHugepageCountRequestUsed(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter( + kMetricK8sResourcequotaHugepageCountRequestUsed, + descrMetricK8sResourcequotaHugepageCountRequestUsed, + unitMetricK8sResourcequotaHugepageCountRequestUsed); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricK8sResourcequotaHugepageCountRequestUsed(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter( + kMetricK8sResourcequotaHugepageCountRequestUsed, + descrMetricK8sResourcequotaHugepageCountRequestUsed, + unitMetricK8sResourcequotaHugepageCountRequestUsed); +} + +/** + The memory limits in a specific namespace. + The value represents the configured quota limit of the resource in the namespace. +

        + This metric is retrieved from the @code hard @endcode field of the + K8s + ResourceQuotaStatus.

        updowncounter + */ +static constexpr const char *kMetricK8sResourcequotaMemoryLimitHard = + "k8s.resourcequota.memory.limit.hard"; +static constexpr const char *descrMetricK8sResourcequotaMemoryLimitHard = + "The memory limits in a specific namespace. + The value represents the configured quota limit of the resource in the namespace."; + static constexpr const char *unitMetricK8sResourcequotaMemoryLimitHard = "By"; + +static inline nostd::unique_ptr> +CreateSyncInt64MetricK8sResourcequotaMemoryLimitHard(metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricK8sResourcequotaMemoryLimitHard, + descrMetricK8sResourcequotaMemoryLimitHard, + unitMetricK8sResourcequotaMemoryLimitHard); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricK8sResourcequotaMemoryLimitHard(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricK8sResourcequotaMemoryLimitHard, + descrMetricK8sResourcequotaMemoryLimitHard, + unitMetricK8sResourcequotaMemoryLimitHard); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricK8sResourcequotaMemoryLimitHard(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter(kMetricK8sResourcequotaMemoryLimitHard, + descrMetricK8sResourcequotaMemoryLimitHard, + unitMetricK8sResourcequotaMemoryLimitHard); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricK8sResourcequotaMemoryLimitHard(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter(kMetricK8sResourcequotaMemoryLimitHard, + descrMetricK8sResourcequotaMemoryLimitHard, + unitMetricK8sResourcequotaMemoryLimitHard); +} + +/** + The memory limits in a specific namespace. + The value represents the current observed total usage of the resource in the namespace. +

        + This metric is retrieved from the @code used @endcode field of the + K8s + ResourceQuotaStatus.

        updowncounter + */ +static constexpr const char *kMetricK8sResourcequotaMemoryLimitUsed = + "k8s.resourcequota.memory.limit.used"; +static constexpr const char *descrMetricK8sResourcequotaMemoryLimitUsed = + "The memory limits in a specific namespace. + The value represents the current observed total usage of the resource in the namespace."; + static constexpr const char *unitMetricK8sResourcequotaMemoryLimitUsed = "By"; + +static inline nostd::unique_ptr> +CreateSyncInt64MetricK8sResourcequotaMemoryLimitUsed(metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricK8sResourcequotaMemoryLimitUsed, + descrMetricK8sResourcequotaMemoryLimitUsed, + unitMetricK8sResourcequotaMemoryLimitUsed); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricK8sResourcequotaMemoryLimitUsed(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricK8sResourcequotaMemoryLimitUsed, + descrMetricK8sResourcequotaMemoryLimitUsed, + unitMetricK8sResourcequotaMemoryLimitUsed); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricK8sResourcequotaMemoryLimitUsed(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter(kMetricK8sResourcequotaMemoryLimitUsed, + descrMetricK8sResourcequotaMemoryLimitUsed, + unitMetricK8sResourcequotaMemoryLimitUsed); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricK8sResourcequotaMemoryLimitUsed(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter(kMetricK8sResourcequotaMemoryLimitUsed, + descrMetricK8sResourcequotaMemoryLimitUsed, + unitMetricK8sResourcequotaMemoryLimitUsed); +} + +/** + The memory requests in a specific namespace. + The value represents the configured quota limit of the resource in the namespace. +

        + This metric is retrieved from the @code hard @endcode field of the + K8s + ResourceQuotaStatus.

        updowncounter + */ +static constexpr const char *kMetricK8sResourcequotaMemoryRequestHard = + "k8s.resourcequota.memory.request.hard"; +static constexpr const char *descrMetricK8sResourcequotaMemoryRequestHard = + "The memory requests in a specific namespace. + The value represents the configured quota limit of the resource in the namespace."; + static constexpr const char *unitMetricK8sResourcequotaMemoryRequestHard = "By"; + +static inline nostd::unique_ptr> +CreateSyncInt64MetricK8sResourcequotaMemoryRequestHard(metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricK8sResourcequotaMemoryRequestHard, + descrMetricK8sResourcequotaMemoryRequestHard, + unitMetricK8sResourcequotaMemoryRequestHard); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricK8sResourcequotaMemoryRequestHard(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricK8sResourcequotaMemoryRequestHard, + descrMetricK8sResourcequotaMemoryRequestHard, + unitMetricK8sResourcequotaMemoryRequestHard); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricK8sResourcequotaMemoryRequestHard(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter(kMetricK8sResourcequotaMemoryRequestHard, + descrMetricK8sResourcequotaMemoryRequestHard, + unitMetricK8sResourcequotaMemoryRequestHard); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricK8sResourcequotaMemoryRequestHard(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter(kMetricK8sResourcequotaMemoryRequestHard, + descrMetricK8sResourcequotaMemoryRequestHard, + unitMetricK8sResourcequotaMemoryRequestHard); +} + +/** + The memory requests in a specific namespace. + The value represents the current observed total usage of the resource in the namespace. +

        + This metric is retrieved from the @code used @endcode field of the + K8s + ResourceQuotaStatus.

        updowncounter + */ +static constexpr const char *kMetricK8sResourcequotaMemoryRequestUsed = + "k8s.resourcequota.memory.request.used"; +static constexpr const char *descrMetricK8sResourcequotaMemoryRequestUsed = + "The memory requests in a specific namespace. + The value represents the current observed total usage of the resource in the namespace."; + static constexpr const char *unitMetricK8sResourcequotaMemoryRequestUsed = "By"; + +static inline nostd::unique_ptr> +CreateSyncInt64MetricK8sResourcequotaMemoryRequestUsed(metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricK8sResourcequotaMemoryRequestUsed, + descrMetricK8sResourcequotaMemoryRequestUsed, + unitMetricK8sResourcequotaMemoryRequestUsed); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricK8sResourcequotaMemoryRequestUsed(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricK8sResourcequotaMemoryRequestUsed, + descrMetricK8sResourcequotaMemoryRequestUsed, + unitMetricK8sResourcequotaMemoryRequestUsed); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricK8sResourcequotaMemoryRequestUsed(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter(kMetricK8sResourcequotaMemoryRequestUsed, + descrMetricK8sResourcequotaMemoryRequestUsed, + unitMetricK8sResourcequotaMemoryRequestUsed); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricK8sResourcequotaMemoryRequestUsed(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter(kMetricK8sResourcequotaMemoryRequestUsed, + descrMetricK8sResourcequotaMemoryRequestUsed, + unitMetricK8sResourcequotaMemoryRequestUsed); +} + +/** + The object count limits in a specific namespace. + The value represents the configured quota limit of the resource in the namespace. +

        + This metric is retrieved from the @code hard @endcode field of the + K8s + ResourceQuotaStatus.

        updowncounter + */ +static constexpr const char *kMetricK8sResourcequotaObjectCountHard = + "k8s.resourcequota.object_count.hard"; +static constexpr const char *descrMetricK8sResourcequotaObjectCountHard = + "The object count limits in a specific namespace. + The value represents the configured quota limit of the resource in the namespace."; + static constexpr const char *unitMetricK8sResourcequotaObjectCountHard = "{object}"; + +static inline nostd::unique_ptr> +CreateSyncInt64MetricK8sResourcequotaObjectCountHard(metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricK8sResourcequotaObjectCountHard, + descrMetricK8sResourcequotaObjectCountHard, + unitMetricK8sResourcequotaObjectCountHard); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricK8sResourcequotaObjectCountHard(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricK8sResourcequotaObjectCountHard, + descrMetricK8sResourcequotaObjectCountHard, + unitMetricK8sResourcequotaObjectCountHard); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricK8sResourcequotaObjectCountHard(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter(kMetricK8sResourcequotaObjectCountHard, + descrMetricK8sResourcequotaObjectCountHard, + unitMetricK8sResourcequotaObjectCountHard); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricK8sResourcequotaObjectCountHard(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter(kMetricK8sResourcequotaObjectCountHard, + descrMetricK8sResourcequotaObjectCountHard, + unitMetricK8sResourcequotaObjectCountHard); +} + +/** + The object count limits in a specific namespace. + The value represents the current observed total usage of the resource in the namespace. +

        + This metric is retrieved from the @code used @endcode field of the + K8s + ResourceQuotaStatus.

        updowncounter + */ +static constexpr const char *kMetricK8sResourcequotaObjectCountUsed = + "k8s.resourcequota.object_count.used"; +static constexpr const char *descrMetricK8sResourcequotaObjectCountUsed = + "The object count limits in a specific namespace. + The value represents the current observed total usage of the resource in the namespace."; + static constexpr const char *unitMetricK8sResourcequotaObjectCountUsed = "{object}"; + +static inline nostd::unique_ptr> +CreateSyncInt64MetricK8sResourcequotaObjectCountUsed(metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricK8sResourcequotaObjectCountUsed, + descrMetricK8sResourcequotaObjectCountUsed, + unitMetricK8sResourcequotaObjectCountUsed); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricK8sResourcequotaObjectCountUsed(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricK8sResourcequotaObjectCountUsed, + descrMetricK8sResourcequotaObjectCountUsed, + unitMetricK8sResourcequotaObjectCountUsed); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricK8sResourcequotaObjectCountUsed(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter(kMetricK8sResourcequotaObjectCountUsed, + descrMetricK8sResourcequotaObjectCountUsed, + unitMetricK8sResourcequotaObjectCountUsed); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricK8sResourcequotaObjectCountUsed(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter(kMetricK8sResourcequotaObjectCountUsed, + descrMetricK8sResourcequotaObjectCountUsed, + unitMetricK8sResourcequotaObjectCountUsed); +} + +/** + The total number of PersistentVolumeClaims that can exist in the namespace. + The value represents the configured quota limit of the resource in the namespace. +

        + This metric is retrieved from the @code hard @endcode field of the + K8s + ResourceQuotaStatus.

        The @code k8s.storageclass.name @endcode should be required when a + resource quota is defined for a specific storage class.

        updowncounter + */ +static constexpr const char *kMetricK8sResourcequotaPersistentvolumeclaimCountHard = + "k8s.resourcequota.persistentvolumeclaim_count.hard"; +static constexpr const char *descrMetricK8sResourcequotaPersistentvolumeclaimCountHard = + "The total number of PersistentVolumeClaims that can exist in the namespace. + The value represents the configured quota limit of the resource in the namespace."; + static constexpr const char *unitMetricK8sResourcequotaPersistentvolumeclaimCountHard = + "{persistentvolumeclaim}"; + +static inline nostd::unique_ptr> +CreateSyncInt64MetricK8sResourcequotaPersistentvolumeclaimCountHard(metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricK8sResourcequotaPersistentvolumeclaimCountHard, + descrMetricK8sResourcequotaPersistentvolumeclaimCountHard, + unitMetricK8sResourcequotaPersistentvolumeclaimCountHard); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricK8sResourcequotaPersistentvolumeclaimCountHard(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricK8sResourcequotaPersistentvolumeclaimCountHard, + descrMetricK8sResourcequotaPersistentvolumeclaimCountHard, + unitMetricK8sResourcequotaPersistentvolumeclaimCountHard); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricK8sResourcequotaPersistentvolumeclaimCountHard(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter( + kMetricK8sResourcequotaPersistentvolumeclaimCountHard, + descrMetricK8sResourcequotaPersistentvolumeclaimCountHard, + unitMetricK8sResourcequotaPersistentvolumeclaimCountHard); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricK8sResourcequotaPersistentvolumeclaimCountHard(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter( + kMetricK8sResourcequotaPersistentvolumeclaimCountHard, + descrMetricK8sResourcequotaPersistentvolumeclaimCountHard, + unitMetricK8sResourcequotaPersistentvolumeclaimCountHard); +} + +/** + The total number of PersistentVolumeClaims that can exist in the namespace. + The value represents the current observed total usage of the resource in the namespace. +

        + This metric is retrieved from the @code used @endcode field of the + K8s + ResourceQuotaStatus.

        The @code k8s.storageclass.name @endcode should be required when a + resource quota is defined for a specific storage class.

        updowncounter + */ +static constexpr const char *kMetricK8sResourcequotaPersistentvolumeclaimCountUsed = + "k8s.resourcequota.persistentvolumeclaim_count.used"; +static constexpr const char *descrMetricK8sResourcequotaPersistentvolumeclaimCountUsed = + "The total number of PersistentVolumeClaims that can exist in the namespace. + The value represents the current observed total usage of the resource in the namespace."; + static constexpr const char *unitMetricK8sResourcequotaPersistentvolumeclaimCountUsed = + "{persistentvolumeclaim}"; + +static inline nostd::unique_ptr> +CreateSyncInt64MetricK8sResourcequotaPersistentvolumeclaimCountUsed(metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricK8sResourcequotaPersistentvolumeclaimCountUsed, + descrMetricK8sResourcequotaPersistentvolumeclaimCountUsed, + unitMetricK8sResourcequotaPersistentvolumeclaimCountUsed); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricK8sResourcequotaPersistentvolumeclaimCountUsed(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricK8sResourcequotaPersistentvolumeclaimCountUsed, + descrMetricK8sResourcequotaPersistentvolumeclaimCountUsed, + unitMetricK8sResourcequotaPersistentvolumeclaimCountUsed); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricK8sResourcequotaPersistentvolumeclaimCountUsed(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter( + kMetricK8sResourcequotaPersistentvolumeclaimCountUsed, + descrMetricK8sResourcequotaPersistentvolumeclaimCountUsed, + unitMetricK8sResourcequotaPersistentvolumeclaimCountUsed); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricK8sResourcequotaPersistentvolumeclaimCountUsed(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter( + kMetricK8sResourcequotaPersistentvolumeclaimCountUsed, + descrMetricK8sResourcequotaPersistentvolumeclaimCountUsed, + unitMetricK8sResourcequotaPersistentvolumeclaimCountUsed); +} + +/** + The storage requests in a specific namespace. + The value represents the configured quota limit of the resource in the namespace. +

        + This metric is retrieved from the @code hard @endcode field of the + K8s + ResourceQuotaStatus.

        The @code k8s.storageclass.name @endcode should be required when a + resource quota is defined for a specific storage class.

        updowncounter + */ +static constexpr const char *kMetricK8sResourcequotaStorageRequestHard = + "k8s.resourcequota.storage.request.hard"; +static constexpr const char *descrMetricK8sResourcequotaStorageRequestHard = + "The storage requests in a specific namespace. + The value represents the configured quota limit of the resource in the namespace."; + static constexpr const char *unitMetricK8sResourcequotaStorageRequestHard = "By"; + +static inline nostd::unique_ptr> +CreateSyncInt64MetricK8sResourcequotaStorageRequestHard(metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricK8sResourcequotaStorageRequestHard, + descrMetricK8sResourcequotaStorageRequestHard, + unitMetricK8sResourcequotaStorageRequestHard); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricK8sResourcequotaStorageRequestHard(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricK8sResourcequotaStorageRequestHard, + descrMetricK8sResourcequotaStorageRequestHard, + unitMetricK8sResourcequotaStorageRequestHard); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricK8sResourcequotaStorageRequestHard(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter(kMetricK8sResourcequotaStorageRequestHard, + descrMetricK8sResourcequotaStorageRequestHard, + unitMetricK8sResourcequotaStorageRequestHard); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricK8sResourcequotaStorageRequestHard(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter(kMetricK8sResourcequotaStorageRequestHard, + descrMetricK8sResourcequotaStorageRequestHard, + unitMetricK8sResourcequotaStorageRequestHard); +} + +/** + The storage requests in a specific namespace. + The value represents the current observed total usage of the resource in the namespace. +

        + This metric is retrieved from the @code used @endcode field of the + K8s + ResourceQuotaStatus.

        The @code k8s.storageclass.name @endcode should be required when a + resource quota is defined for a specific storage class.

        updowncounter + */ +static constexpr const char *kMetricK8sResourcequotaStorageRequestUsed = + "k8s.resourcequota.storage.request.used"; +static constexpr const char *descrMetricK8sResourcequotaStorageRequestUsed = + "The storage requests in a specific namespace. + The value represents the current observed total usage of the resource in the namespace."; + static constexpr const char *unitMetricK8sResourcequotaStorageRequestUsed = "By"; + +static inline nostd::unique_ptr> +CreateSyncInt64MetricK8sResourcequotaStorageRequestUsed(metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricK8sResourcequotaStorageRequestUsed, + descrMetricK8sResourcequotaStorageRequestUsed, + unitMetricK8sResourcequotaStorageRequestUsed); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricK8sResourcequotaStorageRequestUsed(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricK8sResourcequotaStorageRequestUsed, + descrMetricK8sResourcequotaStorageRequestUsed, + unitMetricK8sResourcequotaStorageRequestUsed); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricK8sResourcequotaStorageRequestUsed(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter(kMetricK8sResourcequotaStorageRequestUsed, + descrMetricK8sResourcequotaStorageRequestUsed, + unitMetricK8sResourcequotaStorageRequestUsed); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricK8sResourcequotaStorageRequestUsed(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter(kMetricK8sResourcequotaStorageRequestUsed, + descrMetricK8sResourcequotaStorageRequestUsed, + unitMetricK8sResourcequotaStorageRequestUsed); +} + +/** + The number of replica pods created by the statefulset controller from the statefulset version + indicated by currentRevision

        This metric aligns with the @code currentReplicas @endcode field + of the K8s + StatefulSetStatus.

        updowncounter + */ +static constexpr const char *kMetricK8sStatefulsetCurrentPods = "k8s.statefulset.current_pods"; +static constexpr const char *descrMetricK8sStatefulsetCurrentPods = + "The number of replica pods created by the statefulset controller from the statefulset version " + "indicated by currentRevision"; +static constexpr const char *unitMetricK8sStatefulsetCurrentPods = "{pod}"; + +static inline nostd::unique_ptr> +CreateSyncInt64MetricK8sStatefulsetCurrentPods(metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricK8sStatefulsetCurrentPods, + descrMetricK8sStatefulsetCurrentPods, + unitMetricK8sStatefulsetCurrentPods); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricK8sStatefulsetCurrentPods(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricK8sStatefulsetCurrentPods, + descrMetricK8sStatefulsetCurrentPods, + unitMetricK8sStatefulsetCurrentPods); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricK8sStatefulsetCurrentPods(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter(kMetricK8sStatefulsetCurrentPods, + descrMetricK8sStatefulsetCurrentPods, + unitMetricK8sStatefulsetCurrentPods); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricK8sStatefulsetCurrentPods(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter(kMetricK8sStatefulsetCurrentPods, + descrMetricK8sStatefulsetCurrentPods, + unitMetricK8sStatefulsetCurrentPods); +} + +/** + Number of desired replica pods in this statefulset +

        + This metric aligns with the @code replicas @endcode field of the + K8s + StatefulSetSpec.

        updowncounter + */ +static constexpr const char *kMetricK8sStatefulsetDesiredPods = "k8s.statefulset.desired_pods"; +static constexpr const char *descrMetricK8sStatefulsetDesiredPods = + "Number of desired replica pods in this statefulset"; +static constexpr const char *unitMetricK8sStatefulsetDesiredPods = "{pod}"; + +static inline nostd::unique_ptr> +CreateSyncInt64MetricK8sStatefulsetDesiredPods(metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricK8sStatefulsetDesiredPods, + descrMetricK8sStatefulsetDesiredPods, + unitMetricK8sStatefulsetDesiredPods); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricK8sStatefulsetDesiredPods(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricK8sStatefulsetDesiredPods, + descrMetricK8sStatefulsetDesiredPods, + unitMetricK8sStatefulsetDesiredPods); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricK8sStatefulsetDesiredPods(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter(kMetricK8sStatefulsetDesiredPods, + descrMetricK8sStatefulsetDesiredPods, + unitMetricK8sStatefulsetDesiredPods); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricK8sStatefulsetDesiredPods(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter(kMetricK8sStatefulsetDesiredPods, + descrMetricK8sStatefulsetDesiredPods, + unitMetricK8sStatefulsetDesiredPods); +} + +/** + The number of replica pods created for this statefulset with a Ready Condition +

        + This metric aligns with the @code readyReplicas @endcode field of the + K8s + StatefulSetStatus.

        updowncounter + */ +static constexpr const char *kMetricK8sStatefulsetReadyPods = "k8s.statefulset.ready_pods"; +static constexpr const char *descrMetricK8sStatefulsetReadyPods = + "The number of replica pods created for this statefulset with a Ready Condition"; +static constexpr const char *unitMetricK8sStatefulsetReadyPods = "{pod}"; + +static inline nostd::unique_ptr> +CreateSyncInt64MetricK8sStatefulsetReadyPods(metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricK8sStatefulsetReadyPods, + descrMetricK8sStatefulsetReadyPods, + unitMetricK8sStatefulsetReadyPods); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricK8sStatefulsetReadyPods(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricK8sStatefulsetReadyPods, + descrMetricK8sStatefulsetReadyPods, + unitMetricK8sStatefulsetReadyPods); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricK8sStatefulsetReadyPods(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter(kMetricK8sStatefulsetReadyPods, + descrMetricK8sStatefulsetReadyPods, + unitMetricK8sStatefulsetReadyPods); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricK8sStatefulsetReadyPods(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter(kMetricK8sStatefulsetReadyPods, + descrMetricK8sStatefulsetReadyPods, + unitMetricK8sStatefulsetReadyPods); +} + +/** + Number of replica pods created by the statefulset controller from the statefulset version + indicated by updateRevision

        This metric aligns with the @code updatedReplicas @endcode field + of the K8s + StatefulSetStatus.

        updowncounter */ static constexpr const char *kMetricK8sStatefulsetUpdatedPods = "k8s.statefulset.updated_pods"; static constexpr const char *descrMetricK8sStatefulsetUpdatedPods = diff --git a/api/include/opentelemetry/semconv/incubating/mainframe_attributes.h b/api/include/opentelemetry/semconv/incubating/mainframe_attributes.h new file mode 100644 index 0000000000..c472b98585 --- /dev/null +++ b/api/include/opentelemetry/semconv/incubating/mainframe_attributes.h @@ -0,0 +1,29 @@ +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * 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 mainframe +{ + +/** + Name of the logical partition that hosts a systems with a mainframe operating system. + */ +static constexpr const char *kMainframeLparName = "mainframe.lpar.name"; + +} // namespace mainframe +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/os_attributes.h b/api/include/opentelemetry/semconv/incubating/os_attributes.h index 69dded814f..1c12402c61 100644 --- a/api/include/opentelemetry/semconv/incubating/os_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/os_attributes.h @@ -99,10 +99,15 @@ static constexpr const char *kAix = "aix"; static constexpr const char *kSolaris = "solaris"; /** - IBM z/OS + Deprecated. Use @code zos @endcode instead. */ static constexpr const char *kZOs = "z_os"; +/** + IBM z/OS + */ +static constexpr const char *kZos = "zos"; + } // namespace OsTypeValues } // namespace os diff --git a/api/include/opentelemetry/semconv/incubating/otel_attributes.h b/api/include/opentelemetry/semconv/incubating/otel_attributes.h index df1f165b80..ddf04b9406 100644 --- a/api/include/opentelemetry/semconv/incubating/otel_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/otel_attributes.h @@ -74,6 +74,13 @@ static constexpr const char *kOtelScopeName = "otel.scope.name"; */ static constexpr const char *kOtelScopeVersion = "otel.scope.version"; +/** + Determines whether the span has a parent span, and if so, whether it is a remote + parent + */ +static constexpr const char *kOtelSpanParentOrigin = "otel.span.parent.origin"; + /** The result value of the sampler for this span */ @@ -126,6 +133,11 @@ static constexpr const char *kOtlpHttpSpanExporter = "otlp_http_span_exporter"; */ static constexpr const char *kOtlpHttpJsonSpanExporter = "otlp_http_json_span_exporter"; +/** + Zipkin span exporter over HTTP + */ +static constexpr const char *kZipkinHttpSpanExporter = "zipkin_http_span_exporter"; + /** OTLP log record exporter over gRPC with protobuf serialization */ @@ -161,8 +173,35 @@ static constexpr const char *kOtlpHttpMetricExporter = "otlp_http_metric_exporte */ static constexpr const char *kOtlpHttpJsonMetricExporter = "otlp_http_json_metric_exporter"; +/** + Prometheus metric exporter over HTTP with the default text-based format + */ +static constexpr const char *kPrometheusHttpTextMetricExporter = + "prometheus_http_text_metric_exporter"; + } // namespace OtelComponentTypeValues +namespace OtelSpanParentOriginValues +{ +/** + The span does not have a parent, it is a root span + */ +static constexpr const char *kNone = "none"; + +/** + The span has a parent and the parent's span context isRemote() is false + */ +static constexpr const char *kLocal = "local"; + +/** + The span has a parent and the parent's span context isRemote() is true + */ +static constexpr const char *kRemote = "remote"; + +} // namespace OtelSpanParentOriginValues + namespace OtelSpanSamplingResultValues { /** diff --git a/api/include/opentelemetry/semconv/incubating/otel_metrics.h b/api/include/opentelemetry/semconv/incubating/otel_metrics.h index a02b814c0e..2f4d9cd2fc 100644 --- a/api/include/opentelemetry/semconv/incubating/otel_metrics.h +++ b/api/include/opentelemetry/semconv/incubating/otel_metrics.h @@ -806,40 +806,42 @@ CreateAsyncDoubleMetricOtelSdkProcessorSpanQueueSize(metrics::Meter *meter) } /** - The number of created spans for which the end operation was called + Use @code otel.sdk.span.started @endcode minus @code otel.sdk.span.live @endcode to derive this + value. + + @deprecated + {"note": "Obsoleted.", "reason": "obsoleted"}

        - For spans with @code recording=true @endcode: Implementations MUST record both @code - otel.sdk.span.live @endcode and @code otel.sdk.span.ended @endcode. For spans with @code - recording=false @endcode: If implementations decide to record this metric, they MUST also record - @code otel.sdk.span.live @endcode.

        counter + counter */ -static constexpr const char *kMetricOtelSdkSpanEnded = "otel.sdk.span.ended"; -static constexpr const char *descrMetricOtelSdkSpanEnded = - "The number of created spans for which the end operation was called"; -static constexpr const char *unitMetricOtelSdkSpanEnded = "{span}"; +OPENTELEMETRY_DEPRECATED static constexpr const char *kMetricOtelSdkSpanEnded = + "otel.sdk.span.ended"; +OPENTELEMETRY_DEPRECATED static constexpr const char *descrMetricOtelSdkSpanEnded = + "Use `otel.sdk.span.started` minus `otel.sdk.span.live` to derive this value."; +OPENTELEMETRY_DEPRECATED static constexpr const char *unitMetricOtelSdkSpanEnded = "{span}"; -static inline nostd::unique_ptr> CreateSyncInt64MetricOtelSdkSpanEnded( - metrics::Meter *meter) +OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> +CreateSyncInt64MetricOtelSdkSpanEnded(metrics::Meter *meter) { return meter->CreateUInt64Counter(kMetricOtelSdkSpanEnded, descrMetricOtelSdkSpanEnded, unitMetricOtelSdkSpanEnded); } -static inline nostd::unique_ptr> CreateSyncDoubleMetricOtelSdkSpanEnded( - metrics::Meter *meter) +OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> +CreateSyncDoubleMetricOtelSdkSpanEnded(metrics::Meter *meter) { return meter->CreateDoubleCounter(kMetricOtelSdkSpanEnded, descrMetricOtelSdkSpanEnded, unitMetricOtelSdkSpanEnded); } -static inline nostd::shared_ptr +OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr CreateAsyncInt64MetricOtelSdkSpanEnded(metrics::Meter *meter) { return meter->CreateInt64ObservableCounter(kMetricOtelSdkSpanEnded, descrMetricOtelSdkSpanEnded, unitMetricOtelSdkSpanEnded); } -static inline nostd::shared_ptr +OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr CreateAsyncDoubleMetricOtelSdkSpanEnded(metrics::Meter *meter) { return meter->CreateDoubleObservableCounter(kMetricOtelSdkSpanEnded, descrMetricOtelSdkSpanEnded, @@ -847,16 +849,18 @@ CreateAsyncDoubleMetricOtelSdkSpanEnded(metrics::Meter *meter) } /** - Deprecated, use @code otel.sdk.span.ended @endcode instead. + Use @code otel.sdk.span.started @endcode minus @code otel.sdk.span.live @endcode to derive this + value. @deprecated - {"note": "Replaced by @code otel.sdk.span.ended @endcode.", "reason": "renamed", "renamed_to": - "otel.sdk.span.ended"}

        counter + {"note": "Obsoleted.", "reason": "obsoleted"} +

        + counter */ OPENTELEMETRY_DEPRECATED static constexpr const char *kMetricOtelSdkSpanEndedCount = "otel.sdk.span.ended.count"; OPENTELEMETRY_DEPRECATED static constexpr const char *descrMetricOtelSdkSpanEndedCount = - "Deprecated, use `otel.sdk.span.ended` instead."; + "Use `otel.sdk.span.started` minus `otel.sdk.span.live` to derive this value."; OPENTELEMETRY_DEPRECATED static constexpr const char *unitMetricOtelSdkSpanEndedCount = "{span}"; OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> @@ -890,16 +894,13 @@ CreateAsyncDoubleMetricOtelSdkSpanEndedCount(metrics::Meter *meter) } /** - The number of created spans for which the end operation has not been called yet -

        - For spans with @code recording=true @endcode: Implementations MUST record both @code - otel.sdk.span.live @endcode and @code otel.sdk.span.ended @endcode. For spans with @code - recording=false @endcode: If implementations decide to record this metric, they MUST also record - @code otel.sdk.span.ended @endcode.

        updowncounter + The number of created spans with @code recording=true @endcode for which the end operation has not + been called yet

        updowncounter */ static constexpr const char *kMetricOtelSdkSpanLive = "otel.sdk.span.live"; static constexpr const char *descrMetricOtelSdkSpanLive = - "The number of created spans for which the end operation has not been called yet"; + "The number of created spans with `recording=true` for which the end operation has not been " + "called yet"; static constexpr const char *unitMetricOtelSdkSpanLive = "{span}"; static inline nostd::unique_ptr> @@ -971,6 +972,45 @@ CreateAsyncDoubleMetricOtelSdkSpanLiveCount(metrics::Meter *meter) kMetricOtelSdkSpanLiveCount, descrMetricOtelSdkSpanLiveCount, unitMetricOtelSdkSpanLiveCount); } +/** + The number of created spans +

        + Implementations MUST record this metric for all spans, even for non-recording ones. +

        + counter + */ +static constexpr const char *kMetricOtelSdkSpanStarted = "otel.sdk.span.started"; +static constexpr const char *descrMetricOtelSdkSpanStarted = "The number of created spans"; +static constexpr const char *unitMetricOtelSdkSpanStarted = "{span}"; + +static inline nostd::unique_ptr> CreateSyncInt64MetricOtelSdkSpanStarted( + metrics::Meter *meter) +{ + return meter->CreateUInt64Counter(kMetricOtelSdkSpanStarted, descrMetricOtelSdkSpanStarted, + unitMetricOtelSdkSpanStarted); +} + +static inline nostd::unique_ptr> CreateSyncDoubleMetricOtelSdkSpanStarted( + metrics::Meter *meter) +{ + return meter->CreateDoubleCounter(kMetricOtelSdkSpanStarted, descrMetricOtelSdkSpanStarted, + unitMetricOtelSdkSpanStarted); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricOtelSdkSpanStarted(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableCounter( + kMetricOtelSdkSpanStarted, descrMetricOtelSdkSpanStarted, unitMetricOtelSdkSpanStarted); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricOtelSdkSpanStarted(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableCounter( + kMetricOtelSdkSpanStarted, descrMetricOtelSdkSpanStarted, unitMetricOtelSdkSpanStarted); +} + } // namespace otel } // namespace semconv OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/process_attributes.h b/api/include/opentelemetry/semconv/incubating/process_attributes.h index 7cee8fc70f..e6f32fbc08 100644 --- a/api/include/opentelemetry/semconv/incubating/process_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/process_attributes.h @@ -70,9 +70,9 @@ OPENTELEMETRY_DEPRECATED static constexpr const char *kProcessCpuState = "proces 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 variables, @code @endcode 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 diff --git a/api/include/opentelemetry/semconv/incubating/system_metrics.h b/api/include/opentelemetry/semconv/incubating/system_metrics.h index a6e01ea75b..f905b73b6f 100644 --- a/api/include/opentelemetry/semconv/incubating/system_metrics.h +++ b/api/include/opentelemetry/semconv/incubating/system_metrics.h @@ -21,43 +21,40 @@ namespace system { /** - Deprecated. Use @code cpu.frequency @endcode instead. - - @deprecated - {"note": "Replaced by @code cpu.frequency @endcode.", "reason": "renamed", "renamed_to": - "cpu.frequency"}

            gauge + Operating frequency of the logical CPU in Hertz. +

            + 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}"; +static constexpr const char *kMetricSystemCpuFrequency = "system.cpu.frequency"; +static constexpr const char *descrMetricSystemCpuFrequency = + "Operating frequency of the logical CPU in Hertz."; +static constexpr const char *unitMetricSystemCpuFrequency = "Hz"; #if OPENTELEMETRY_ABI_VERSION_NO >= 2 -OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> -CreateSyncInt64MetricSystemCpuFrequency(metrics::Meter *meter) +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) +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 +static inline nostd::shared_ptr CreateAsyncInt64MetricSystemCpuFrequency(metrics::Meter *meter) { return meter->CreateInt64ObservableGauge(kMetricSystemCpuFrequency, descrMetricSystemCpuFrequency, unitMetricSystemCpuFrequency); } -OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr +static inline nostd::shared_ptr CreateAsyncDoubleMetricSystemCpuFrequency(metrics::Meter *meter) { return meter->CreateDoubleObservableGauge( @@ -152,84 +149,78 @@ CreateAsyncDoubleMetricSystemCpuPhysicalCount(metrics::Meter *meter) } /** - Deprecated. Use @code cpu.time @endcode instead. - - @deprecated - {"note": "Replaced by @code cpu.time @endcode.", "reason": "renamed", "renamed_to": "cpu.time"} + Seconds each logical CPU spent on each mode

            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"; +static constexpr const char *kMetricSystemCpuTime = "system.cpu.time"; +static constexpr const char *descrMetricSystemCpuTime = + "Seconds each logical CPU spent on each mode"; +static constexpr const char *unitMetricSystemCpuTime = "s"; -OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> -CreateSyncInt64MetricSystemCpuTime(metrics::Meter *meter) +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) +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) +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) +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 + For each logical CPU, the utilization is calculated as the change in cumulative CPU time + (cpu.time) over a measurement interval, divided by the elapsed time.

            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"; +static constexpr const char *kMetricSystemCpuUtilization = "system.cpu.utilization"; +static constexpr const char *descrMetricSystemCpuUtilization = + "For each logical CPU, the utilization is calculated as the change in cumulative CPU time " + "(cpu.time) over a measurement interval, divided by the elapsed time."; +static constexpr const char *unitMetricSystemCpuUtilization = "1"; #if OPENTELEMETRY_ABI_VERSION_NO >= 2 -OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> -CreateSyncInt64MetricSystemCpuUtilization(metrics::Meter *meter) +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) +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 +static inline nostd::shared_ptr CreateAsyncInt64MetricSystemCpuUtilization(metrics::Meter *meter) { return meter->CreateInt64ObservableGauge( kMetricSystemCpuUtilization, descrMetricSystemCpuUtilization, unitMetricSystemCpuUtilization); } -OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr +static inline nostd::shared_ptr CreateAsyncDoubleMetricSystemCpuUtilization(metrics::Meter *meter) { return meter->CreateDoubleObservableGauge( @@ -860,11 +851,58 @@ CreateAsyncDoubleMetricSystemMemoryUtilization(metrics::Meter *meter) /** updowncounter */ -static constexpr const char *kMetricSystemNetworkConnections = "system.network.connections"; -static constexpr const char *descrMetricSystemNetworkConnections = ""; -static constexpr const char *unitMetricSystemNetworkConnections = "{connection}"; +static constexpr const char *kMetricSystemNetworkConnectionCount = + "system.network.connection.count"; +static constexpr const char *descrMetricSystemNetworkConnectionCount = ""; +static constexpr const char *unitMetricSystemNetworkConnectionCount = "{connection}"; static inline nostd::unique_ptr> +CreateSyncInt64MetricSystemNetworkConnectionCount(metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricSystemNetworkConnectionCount, + descrMetricSystemNetworkConnectionCount, + unitMetricSystemNetworkConnectionCount); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricSystemNetworkConnectionCount(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricSystemNetworkConnectionCount, + descrMetricSystemNetworkConnectionCount, + unitMetricSystemNetworkConnectionCount); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricSystemNetworkConnectionCount(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter(kMetricSystemNetworkConnectionCount, + descrMetricSystemNetworkConnectionCount, + unitMetricSystemNetworkConnectionCount); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricSystemNetworkConnectionCount(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter(kMetricSystemNetworkConnectionCount, + descrMetricSystemNetworkConnectionCount, + unitMetricSystemNetworkConnectionCount); +} + +/** + Deprecated, use @code system.network.connection.count @endcode instead + + @deprecated + {"note": "Replaced by @code system.network.connection.count @endcode.", "reason": "renamed", + "renamed_to": "system.network.connection.count"}

            updowncounter + */ +OPENTELEMETRY_DEPRECATED static constexpr const char *kMetricSystemNetworkConnections = + "system.network.connections"; +OPENTELEMETRY_DEPRECATED static constexpr const char *descrMetricSystemNetworkConnections = + "Deprecated, use `system.network.connection.count` instead"; +OPENTELEMETRY_DEPRECATED static constexpr const char *unitMetricSystemNetworkConnections = + "{connection}"; + +OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> CreateSyncInt64MetricSystemNetworkConnections(metrics::Meter *meter) { return meter->CreateInt64UpDownCounter(kMetricSystemNetworkConnections, @@ -872,7 +910,7 @@ CreateSyncInt64MetricSystemNetworkConnections(metrics::Meter *meter) unitMetricSystemNetworkConnections); } -static inline nostd::unique_ptr> +OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> CreateSyncDoubleMetricSystemNetworkConnections(metrics::Meter *meter) { return meter->CreateDoubleUpDownCounter(kMetricSystemNetworkConnections, @@ -880,7 +918,7 @@ CreateSyncDoubleMetricSystemNetworkConnections(metrics::Meter *meter) unitMetricSystemNetworkConnections); } -static inline nostd::shared_ptr +OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr CreateAsyncInt64MetricSystemNetworkConnections(metrics::Meter *meter) { return meter->CreateInt64ObservableUpDownCounter(kMetricSystemNetworkConnections, @@ -888,7 +926,7 @@ CreateAsyncInt64MetricSystemNetworkConnections(metrics::Meter *meter) unitMetricSystemNetworkConnections); } -static inline nostd::shared_ptr +OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr CreateAsyncDoubleMetricSystemNetworkConnections(metrics::Meter *meter) { return meter->CreateDoubleObservableUpDownCounter(kMetricSystemNetworkConnections, diff --git a/api/include/opentelemetry/semconv/incubating/zos_attributes.h b/api/include/opentelemetry/semconv/incubating/zos_attributes.h new file mode 100644 index 0000000000..0e6834c9cc --- /dev/null +++ b/api/include/opentelemetry/semconv/incubating/zos_attributes.h @@ -0,0 +1,35 @@ +/* + * Copyright The OpenTelemetry Authors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * DO NOT EDIT, this is an Auto-generated file from: + * 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 zos +{ + +/** + The System Management Facility (SMF) Identifier uniquely identified a z/OS system within a SYSPLEX + or mainframe environment and is used for system and performance analysis. + */ +static constexpr const char *kZosSmfId = "zos.smf.id"; + +/** + The name of the SYSPLEX to which the z/OS system belongs too. + */ +static constexpr const char *kZosSysplexName = "zos.sysplex.name"; + +} // namespace zos +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/schema_url.h b/api/include/opentelemetry/semconv/schema_url.h index bc36ae2355..7b46b52e93 100644 --- a/api/include/opentelemetry/semconv/schema_url.h +++ b/api/include/opentelemetry/semconv/schema_url.h @@ -19,6 +19,6 @@ namespace semconv /** * The URL of the OpenTelemetry schema for these keys and values. */ -static constexpr const char *kSchemaUrl = "https://opentelemetry.io/schemas/1.34.0"; +static constexpr const char *kSchemaUrl = "https://opentelemetry.io/schemas/1.36.0"; } // namespace semconv OPENTELEMETRY_END_NAMESPACE diff --git a/buildscripts/semantic-convention/generate.sh b/buildscripts/semantic-convention/generate.sh index 703e4bccbe..c489c93209 100755 --- a/buildscripts/semantic-convention/generate.sh +++ b/buildscripts/semantic-convention/generate.sh @@ -16,10 +16,10 @@ ROOT_DIR="${SCRIPT_DIR}/../../" # freeze the spec & generator tools versions to make the generation reproducible # repository: https://github.com/open-telemetry/semantic-conventions -SEMCONV_VERSION=1.34.0 +SEMCONV_VERSION=1.36.0 # repository: https://github.com/open-telemetry/weaver -WEAVER_VERSION=0.15.0 +WEAVER_VERSION=0.16.1 SEMCONV_VERSION_TAG=v$SEMCONV_VERSION WEAVER_VERSION_TAG=v$WEAVER_VERSION diff --git a/ci/do_ci.ps1 b/ci/do_ci.ps1 index 42dd1c0140..0b21bbd866 100644 --- a/ci/do_ci.ps1 +++ b/ci/do_ci.ps1 @@ -344,6 +344,7 @@ switch ($action) { "-DCMAKE_INSTALL_PREFIX=$INSTALL_TEST_DIR" ` -DWITH_ABI_VERSION_1=OFF ` -DWITH_ABI_VERSION_2=ON ` + -DWITH_GSL=ON ` -DWITH_THREAD_INSTRUMENTATION_PREVIEW=ON ` -DWITH_METRICS_EXEMPLAR_PREVIEW=ON ` -DWITH_ASYNC_EXPORT_PREVIEW=ON ` diff --git a/cmake/ms-gsl.cmake b/cmake/ms-gsl.cmake new file mode 100644 index 0000000000..72c157a627 --- /dev/null +++ b/cmake/ms-gsl.cmake @@ -0,0 +1,35 @@ +# Copyright The OpenTelemetry Authors +# SPDX-License-Identifier: Apache-2.0 + +find_package(Microsoft.GSL CONFIG QUIET) +set(Microsoft.GSL_PROVIDER "find_package") + +if(NOT Microsoft.GSL_FOUND) + set(_Microsoft.GSL_SUBMODULE_DIR "${opentelemetry-cpp_SOURCE_DIR}/third_party/ms-gsl") + if(EXISTS "${_Microsoft.GSL_SUBMODULE_DIR}/.git") + FetchContent_Declare( + "gsl" + SOURCE_DIR "${_Microsoft.GSL_SUBMODULE_DIR}" + ) + set(Microsoft.GSL_PROVIDER "fetch_source") + else() + FetchContent_Declare( + "gsl" + GIT_REPOSITORY "https://github.com/microsoft/GSL.git" + GIT_TAG "${ms-gsl_GIT_TAG}" + ) + set(Microsoft.GSL_PROVIDER "fetch_repository") + endif() + + set(GSL_TEST OFF CACHE BOOL "" FORCE) + set(GSL_INSTALL ${OPENTELEMETRY_INSTALL} CACHE BOOL "" FORCE) + + FetchContent_MakeAvailable(gsl) + + # Set the Microsoft.GSL_VERSION variable from the git tag. + string(REGEX REPLACE "^v([0-9]+\\.[0-9]+\\.[0-9]+)$" "\\1" Microsoft.GSL_VERSION "${ms-gsl_GIT_TAG}") +endif() + +if(NOT TARGET Microsoft.GSL::GSL) + message(FATAL_ERROR "A required Microsoft.GSL target Microsoft.GSL::GSL was not imported") +endif() diff --git a/cmake/thirdparty-dependency-config.cmake b/cmake/thirdparty-dependency-config.cmake index 046e3a540f..42242b0aa8 100644 --- a/cmake/thirdparty-dependency-config.cmake +++ b/cmake/thirdparty-dependency-config.cmake @@ -8,6 +8,7 @@ #----------------------------------------------------------------------- set(OTEL_THIRDPARTY_DEPENDENCIES_SUPPORTED Threads + Microsoft.GSL ZLIB CURL nlohmann_json @@ -29,6 +30,7 @@ set(OTEL_Protobuf_TARGET_NAMESPACE "protobuf") # # set(OTEL__SEARCH_MODE "") #----------------------------------------------------------------------- set(OTEL_Threads_SEARCH_MODE "") +set(OTEL_Microsoft.GSL_SEARCH_MODE "CONFIG") set(OTEL_ZLIB_SEARCH_MODE "") set(OTEL_CURL_SEARCH_MODE "") set(OTEL_nlohmann_json_SEARCH_MODE "CONFIG")