StartSpan(
diff --git a/api/include/opentelemetry/semconv/azure_metrics.h b/api/include/opentelemetry/semconv/azure_metrics.h
new file mode 100644
index 0000000000..63f4556b0b
--- /dev/null
+++ b/api/include/opentelemetry/semconv/azure_metrics.h
@@ -0,0 +1,97 @@
+/*
+ * 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_metrics-h.j2
+ */
+
+#pragma once
+
+#include "opentelemetry/common/macros.h"
+#include "opentelemetry/metrics/meter.h"
+#include "opentelemetry/version.h"
+
+OPENTELEMETRY_BEGIN_NAMESPACE
+namespace semconv
+{
+namespace azure
+{
+
+/**
+ * Number of active client instances
+ *
+ * updowncounter
+ */
+static constexpr const char *kMetricAzureCosmosdbClientActiveInstanceCount =
+ "azure.cosmosdb.client.active_instance.count";
+static constexpr const char *descrMetricAzureCosmosdbClientActiveInstanceCount =
+ "Number of active client instances";
+static constexpr const char *unitMetricAzureCosmosdbClientActiveInstanceCount = "{instance}";
+
+static inline nostd::unique_ptr>
+CreateSyncInt64MetricAzureCosmosdbClientActiveInstanceCount(metrics::Meter *meter)
+{
+ return meter->CreateInt64UpDownCounter(kMetricAzureCosmosdbClientActiveInstanceCount,
+ descrMetricAzureCosmosdbClientActiveInstanceCount,
+ unitMetricAzureCosmosdbClientActiveInstanceCount);
+}
+
+static inline nostd::unique_ptr>
+CreateSyncDoubleMetricAzureCosmosdbClientActiveInstanceCount(metrics::Meter *meter)
+{
+ return meter->CreateDoubleUpDownCounter(kMetricAzureCosmosdbClientActiveInstanceCount,
+ descrMetricAzureCosmosdbClientActiveInstanceCount,
+ unitMetricAzureCosmosdbClientActiveInstanceCount);
+}
+
+static inline nostd::shared_ptr
+CreateAsyncInt64MetricAzureCosmosdbClientActiveInstanceCount(metrics::Meter *meter)
+{
+ return meter->CreateInt64ObservableUpDownCounter(
+ kMetricAzureCosmosdbClientActiveInstanceCount,
+ descrMetricAzureCosmosdbClientActiveInstanceCount,
+ unitMetricAzureCosmosdbClientActiveInstanceCount);
+}
+
+static inline nostd::shared_ptr
+CreateAsyncDoubleMetricAzureCosmosdbClientActiveInstanceCount(metrics::Meter *meter)
+{
+ return meter->CreateDoubleObservableUpDownCounter(
+ kMetricAzureCosmosdbClientActiveInstanceCount,
+ descrMetricAzureCosmosdbClientActiveInstanceCount,
+ unitMetricAzureCosmosdbClientActiveInstanceCount);
+}
+
+/**
+ * Request units consumed by
+ * the operation histogram
+ */
+static constexpr const char *kMetricAzureCosmosdbClientOperationRequestCharge =
+ "azure.cosmosdb.client.operation.request_charge";
+static constexpr const char *descrMetricAzureCosmosdbClientOperationRequestCharge =
+ "[Request units](https://learn.microsoft.com/azure/cosmos-db/request-units) consumed by the "
+ "operation";
+static constexpr const char *unitMetricAzureCosmosdbClientOperationRequestCharge = "{request_unit}";
+
+static inline nostd::unique_ptr>
+CreateSyncInt64MetricAzureCosmosdbClientOperationRequestCharge(metrics::Meter *meter)
+{
+ return meter->CreateUInt64Histogram(kMetricAzureCosmosdbClientOperationRequestCharge,
+ descrMetricAzureCosmosdbClientOperationRequestCharge,
+ unitMetricAzureCosmosdbClientOperationRequestCharge);
+}
+
+static inline nostd::unique_ptr>
+CreateSyncDoubleMetricAzureCosmosdbClientOperationRequestCharge(metrics::Meter *meter)
+{
+ return meter->CreateDoubleHistogram(kMetricAzureCosmosdbClientOperationRequestCharge,
+ descrMetricAzureCosmosdbClientOperationRequestCharge,
+ unitMetricAzureCosmosdbClientOperationRequestCharge);
+}
+
+} // namespace azure
+} // namespace semconv
+OPENTELEMETRY_END_NAMESPACE
diff --git a/api/include/opentelemetry/semconv/cicd_metrics.h b/api/include/opentelemetry/semconv/cicd_metrics.h
new file mode 100644
index 0000000000..993c2636f4
--- /dev/null
+++ b/api/include/opentelemetry/semconv/cicd_metrics.h
@@ -0,0 +1,213 @@
+/*
+ * 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_metrics-h.j2
+ */
+
+#pragma once
+
+#include "opentelemetry/common/macros.h"
+#include "opentelemetry/metrics/meter.h"
+#include "opentelemetry/version.h"
+
+OPENTELEMETRY_BEGIN_NAMESPACE
+namespace semconv
+{
+namespace cicd
+{
+
+/**
+ * The number of pipeline runs currently active in the system by state.
+ *
+ * updowncounter
+ */
+static constexpr const char *kMetricCicdPipelineRunActive = "cicd.pipeline.run.active";
+static constexpr const char *descrMetricCicdPipelineRunActive =
+ "The number of pipeline runs currently active in the system by state.";
+static constexpr const char *unitMetricCicdPipelineRunActive = "{run}";
+
+static inline nostd::unique_ptr>
+CreateSyncInt64MetricCicdPipelineRunActive(metrics::Meter *meter)
+{
+ return meter->CreateInt64UpDownCounter(kMetricCicdPipelineRunActive,
+ descrMetricCicdPipelineRunActive,
+ unitMetricCicdPipelineRunActive);
+}
+
+static inline nostd::unique_ptr>
+CreateSyncDoubleMetricCicdPipelineRunActive(metrics::Meter *meter)
+{
+ return meter->CreateDoubleUpDownCounter(kMetricCicdPipelineRunActive,
+ descrMetricCicdPipelineRunActive,
+ unitMetricCicdPipelineRunActive);
+}
+
+static inline nostd::shared_ptr
+CreateAsyncInt64MetricCicdPipelineRunActive(metrics::Meter *meter)
+{
+ return meter->CreateInt64ObservableUpDownCounter(kMetricCicdPipelineRunActive,
+ descrMetricCicdPipelineRunActive,
+ unitMetricCicdPipelineRunActive);
+}
+
+static inline nostd::shared_ptr
+CreateAsyncDoubleMetricCicdPipelineRunActive(metrics::Meter *meter)
+{
+ return meter->CreateDoubleObservableUpDownCounter(kMetricCicdPipelineRunActive,
+ descrMetricCicdPipelineRunActive,
+ unitMetricCicdPipelineRunActive);
+}
+
+/**
+ * Duration of a pipeline run grouped by pipeline, state and result.
+ *
+ * histogram
+ */
+static constexpr const char *kMetricCicdPipelineRunDuration = "cicd.pipeline.run.duration";
+static constexpr const char *descrMetricCicdPipelineRunDuration =
+ "Duration of a pipeline run grouped by pipeline, state and result.";
+static constexpr const char *unitMetricCicdPipelineRunDuration = "s";
+
+static inline nostd::unique_ptr>
+CreateSyncInt64MetricCicdPipelineRunDuration(metrics::Meter *meter)
+{
+ return meter->CreateUInt64Histogram(kMetricCicdPipelineRunDuration,
+ descrMetricCicdPipelineRunDuration,
+ unitMetricCicdPipelineRunDuration);
+}
+
+static inline nostd::unique_ptr>
+CreateSyncDoubleMetricCicdPipelineRunDuration(metrics::Meter *meter)
+{
+ return meter->CreateDoubleHistogram(kMetricCicdPipelineRunDuration,
+ descrMetricCicdPipelineRunDuration,
+ unitMetricCicdPipelineRunDuration);
+}
+
+/**
+ * The number of errors encountered in pipeline runs (eg. compile, test failures).
+ *
+ * There might be errors in a pipeline run that are non fatal (eg. they are suppressed) or in a
+ * parallel stage multiple stages could have a fatal error. This means that this error count might
+ * not be the same as the count of metric @code cicd.pipeline.run.duration @endcode with run result
+ * @code failure @endcode.
counter
+ */
+static constexpr const char *kMetricCicdPipelineRunErrors = "cicd.pipeline.run.errors";
+static constexpr const char *descrMetricCicdPipelineRunErrors =
+ "The number of errors encountered in pipeline runs (eg. compile, test failures).";
+static constexpr const char *unitMetricCicdPipelineRunErrors = "{error}";
+
+static inline nostd::unique_ptr>
+CreateSyncInt64MetricCicdPipelineRunErrors(metrics::Meter *meter)
+{
+ return meter->CreateUInt64Counter(kMetricCicdPipelineRunErrors, descrMetricCicdPipelineRunErrors,
+ unitMetricCicdPipelineRunErrors);
+}
+
+static inline nostd::unique_ptr>
+CreateSyncDoubleMetricCicdPipelineRunErrors(metrics::Meter *meter)
+{
+ return meter->CreateDoubleCounter(kMetricCicdPipelineRunErrors, descrMetricCicdPipelineRunErrors,
+ unitMetricCicdPipelineRunErrors);
+}
+
+static inline nostd::shared_ptr
+CreateAsyncInt64MetricCicdPipelineRunErrors(metrics::Meter *meter)
+{
+ return meter->CreateInt64ObservableCounter(kMetricCicdPipelineRunErrors,
+ descrMetricCicdPipelineRunErrors,
+ unitMetricCicdPipelineRunErrors);
+}
+
+static inline nostd::shared_ptr
+CreateAsyncDoubleMetricCicdPipelineRunErrors(metrics::Meter *meter)
+{
+ return meter->CreateDoubleObservableCounter(kMetricCicdPipelineRunErrors,
+ descrMetricCicdPipelineRunErrors,
+ unitMetricCicdPipelineRunErrors);
+}
+
+/**
+ * The number of errors in a component of the CICD system (eg. controller, scheduler, agent).
+ *
+ * Errors in pipeline run execution are explicitly excluded. Ie a test failure is not counted in
+ * this metric.
counter
+ */
+static constexpr const char *kMetricCicdSystemErrors = "cicd.system.errors";
+static constexpr const char *descrMetricCicdSystemErrors =
+ "The number of errors in a component of the CICD system (eg. controller, scheduler, agent).";
+static constexpr const char *unitMetricCicdSystemErrors = "{error}";
+
+static inline nostd::unique_ptr> CreateSyncInt64MetricCicdSystemErrors(
+ metrics::Meter *meter)
+{
+ return meter->CreateUInt64Counter(kMetricCicdSystemErrors, descrMetricCicdSystemErrors,
+ unitMetricCicdSystemErrors);
+}
+
+static inline nostd::unique_ptr> CreateSyncDoubleMetricCicdSystemErrors(
+ metrics::Meter *meter)
+{
+ return meter->CreateDoubleCounter(kMetricCicdSystemErrors, descrMetricCicdSystemErrors,
+ unitMetricCicdSystemErrors);
+}
+
+static inline nostd::shared_ptr
+CreateAsyncInt64MetricCicdSystemErrors(metrics::Meter *meter)
+{
+ return meter->CreateInt64ObservableCounter(kMetricCicdSystemErrors, descrMetricCicdSystemErrors,
+ unitMetricCicdSystemErrors);
+}
+
+static inline nostd::shared_ptr
+CreateAsyncDoubleMetricCicdSystemErrors(metrics::Meter *meter)
+{
+ return meter->CreateDoubleObservableCounter(kMetricCicdSystemErrors, descrMetricCicdSystemErrors,
+ unitMetricCicdSystemErrors);
+}
+
+/**
+ * The number of workers on the CICD system by state.
+ *
+ * updowncounter
+ */
+static constexpr const char *kMetricCicdWorkerCount = "cicd.worker.count";
+static constexpr const char *descrMetricCicdWorkerCount =
+ "The number of workers on the CICD system by state.";
+static constexpr const char *unitMetricCicdWorkerCount = "{count}";
+
+static inline nostd::unique_ptr>
+CreateSyncInt64MetricCicdWorkerCount(metrics::Meter *meter)
+{
+ return meter->CreateInt64UpDownCounter(kMetricCicdWorkerCount, descrMetricCicdWorkerCount,
+ unitMetricCicdWorkerCount);
+}
+
+static inline nostd::unique_ptr>
+CreateSyncDoubleMetricCicdWorkerCount(metrics::Meter *meter)
+{
+ return meter->CreateDoubleUpDownCounter(kMetricCicdWorkerCount, descrMetricCicdWorkerCount,
+ unitMetricCicdWorkerCount);
+}
+
+static inline nostd::shared_ptr
+CreateAsyncInt64MetricCicdWorkerCount(metrics::Meter *meter)
+{
+ return meter->CreateInt64ObservableUpDownCounter(
+ kMetricCicdWorkerCount, descrMetricCicdWorkerCount, unitMetricCicdWorkerCount);
+}
+
+static inline nostd::shared_ptr
+CreateAsyncDoubleMetricCicdWorkerCount(metrics::Meter *meter)
+{
+ return meter->CreateDoubleObservableUpDownCounter(
+ kMetricCicdWorkerCount, descrMetricCicdWorkerCount, unitMetricCicdWorkerCount);
+}
+
+} // namespace cicd
+} // namespace semconv
+OPENTELEMETRY_END_NAMESPACE
diff --git a/api/include/opentelemetry/semconv/client_attributes.h b/api/include/opentelemetry/semconv/client_attributes.h
index ec984cc406..7f944176dd 100644
--- a/api/include/opentelemetry/semconv/client_attributes.h
+++ b/api/include/opentelemetry/semconv/client_attributes.h
@@ -20,19 +20,19 @@ namespace client
{
/**
- * Client address - domain name if available without reverse DNS lookup; otherwise, IP address or
- * Unix domain socket name. When observed from the server side, and when communicating through
- * an intermediary, @code client.address @endcode SHOULD represent the client address behind any
- * intermediaries, for example proxies, if it's available.
+ Client address - domain name if available without reverse DNS lookup; otherwise, IP address or
+ Unix domain socket name.
When observed from the server side, and when communicating through an
+ intermediary, @code client.address @endcode SHOULD represent the client address behind any
+ intermediaries, for example proxies, if it's available.
*/
static constexpr const char *kClientAddress = "client.address";
/**
- * Client port number.
- *
- * When observed from the server side, and when communicating through an intermediary, @code
- * client.port @endcode SHOULD represent the client port behind any intermediaries, for example
- * proxies, if it's available.
+ Client port number.
+
+ When observed from the server side, and when communicating through an intermediary, @code
+ client.port @endcode SHOULD represent the client port behind any intermediaries, for example
+ proxies, if it's available.
*/
static constexpr const char *kClientPort = "client.port";
diff --git a/api/include/opentelemetry/semconv/code_attributes.h b/api/include/opentelemetry/semconv/code_attributes.h
new file mode 100644
index 0000000000..cec6ae5547
--- /dev/null
+++ b/api/include/opentelemetry/semconv/code_attributes.h
@@ -0,0 +1,81 @@
+/*
+ * 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 code
+{
+
+/**
+ The column number in @code code.file.path @endcode best representing the operation. It SHOULD
+ point within the code unit named in @code code.function.name @endcode. This attribute MUST NOT be
+ used on the Profile signal since the data is already captured in 'message Line'. This constraint
+ is imposed to prevent redundancy and maintain data integrity.
+ */
+static constexpr const char *kCodeColumnNumber = "code.column.number";
+
+/**
+ The source code file name that identifies the code unit as uniquely as possible (preferably an
+ absolute file path). This attribute MUST NOT be used on the Profile signal since the data is
+ already captured in 'message Function'. This constraint is imposed to prevent redundancy and
+ maintain data integrity.
+ */
+static constexpr const char *kCodeFilePath = "code.file.path";
+
+/**
+ The method or function fully-qualified name without arguments. The value should fit the natural
+ representation of the language runtime, which is also likely the same used within @code
+ code.stacktrace @endcode attribute value. This attribute MUST NOT be used on the Profile signal
+ since the data is already captured in 'message Function'. This constraint is imposed to prevent
+ redundancy and maintain data integrity.
Values and format depends on each language runtime,
+ thus it is impossible to provide an exhaustive list of examples. The values are usually the same
+ (or prefixes of) the ones found in native stack trace representation stored in
+ @code code.stacktrace @endcode without information on arguments.
+
+ Examples:
+
+ - Java method: @code com.example.MyHttpService.serveRequest @endcode
+ - Java anonymous class method: @code com.mycompany.Main$1.myMethod @endcode
+ - Java lambda method: @code com.mycompany.Main$$Lambda/0x0000748ae4149c00.myMethod
+ @endcode
- PHP function: @code GuzzleHttp\Client::transfer @endcode
- Go function:
+ @code github.com/my/repo/pkg.foo.func5 @endcode
- Elixir: @code OpenTelemetry.Ctx.new
+ @endcode
- Erlang: @code opentelemetry_ctx:new @endcode
- Rust: @code
+ playground::my_module::my_cool_func @endcode
- C function: @code fopen @endcode
+
+ */
+static constexpr const char *kCodeFunctionName = "code.function.name";
+
+/**
+ The line number in @code code.file.path @endcode best representing the operation. It SHOULD point
+ within the code unit named in @code code.function.name @endcode. This attribute MUST NOT be used
+ on the Profile signal since the data is already captured in 'message Line'. This constraint is
+ imposed to prevent redundancy and maintain data integrity.
+ */
+static constexpr const char *kCodeLineNumber = "code.line.number";
+
+/**
+ A stacktrace as a string in the natural representation for the language runtime. The
+ representation is identical to @code exception.stacktrace
+ @endcode. This attribute MUST NOT be used on the Profile signal since the data is already
+ captured in 'message Location'. This constraint is imposed to prevent redundancy and maintain data
+ integrity.
+ */
+static constexpr const char *kCodeStacktrace = "code.stacktrace";
+
+} // namespace code
+} // namespace semconv
+OPENTELEMETRY_END_NAMESPACE
diff --git a/api/include/opentelemetry/semconv/container_metrics.h b/api/include/opentelemetry/semconv/container_metrics.h
new file mode 100644
index 0000000000..d3fef8b91b
--- /dev/null
+++ b/api/include/opentelemetry/semconv/container_metrics.h
@@ -0,0 +1,266 @@
+/*
+ * 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_metrics-h.j2
+ */
+
+#pragma once
+
+#include "opentelemetry/common/macros.h"
+#include "opentelemetry/metrics/meter.h"
+#include "opentelemetry/version.h"
+
+OPENTELEMETRY_BEGIN_NAMESPACE
+namespace semconv
+{
+namespace container
+{
+
+/**
+ * Total CPU time consumed
+ *
+ * Total CPU time consumed by the specific container on all available CPU cores
+ *
+ * counter
+ */
+static constexpr const char *kMetricContainerCpuTime = "container.cpu.time";
+static constexpr const char *descrMetricContainerCpuTime = "Total CPU time consumed";
+static constexpr const char *unitMetricContainerCpuTime = "s";
+
+static inline nostd::unique_ptr> CreateSyncInt64MetricContainerCpuTime(
+ metrics::Meter *meter)
+{
+ return meter->CreateUInt64Counter(kMetricContainerCpuTime, descrMetricContainerCpuTime,
+ unitMetricContainerCpuTime);
+}
+
+static inline nostd::unique_ptr> CreateSyncDoubleMetricContainerCpuTime(
+ metrics::Meter *meter)
+{
+ return meter->CreateDoubleCounter(kMetricContainerCpuTime, descrMetricContainerCpuTime,
+ unitMetricContainerCpuTime);
+}
+
+static inline nostd::shared_ptr
+CreateAsyncInt64MetricContainerCpuTime(metrics::Meter *meter)
+{
+ return meter->CreateInt64ObservableCounter(kMetricContainerCpuTime, descrMetricContainerCpuTime,
+ unitMetricContainerCpuTime);
+}
+
+static inline nostd::shared_ptr
+CreateAsyncDoubleMetricContainerCpuTime(metrics::Meter *meter)
+{
+ return meter->CreateDoubleObservableCounter(kMetricContainerCpuTime, descrMetricContainerCpuTime,
+ unitMetricContainerCpuTime);
+}
+
+/**
+ * Container's CPU usage, measured in cpus. Range from 0 to the number of allocatable CPUs
+ *
+ * CPU usage of the specific container on all available CPU cores, averaged over the sample window
+ *
+ * gauge
+ */
+static constexpr const char *kMetricContainerCpuUsage = "container.cpu.usage";
+static constexpr const char *descrMetricContainerCpuUsage =
+ "Container's CPU usage, measured in cpus. Range from 0 to the number of allocatable CPUs";
+static constexpr const char *unitMetricContainerCpuUsage = "{cpu}";
+
+#if OPENTELEMETRY_ABI_VERSION_NO >= 2
+
+static inline nostd::unique_ptr> CreateSyncInt64MetricContainerCpuUsage(
+ metrics::Meter *meter)
+{
+ return meter->CreateInt64Gauge(kMetricContainerCpuUsage, descrMetricContainerCpuUsage,
+ unitMetricContainerCpuUsage);
+}
+
+static inline nostd::unique_ptr> CreateSyncDoubleMetricContainerCpuUsage(
+ metrics::Meter *meter)
+{
+ return meter->CreateDoubleGauge(kMetricContainerCpuUsage, descrMetricContainerCpuUsage,
+ unitMetricContainerCpuUsage);
+}
+#endif /* OPENTELEMETRY_ABI_VERSION_NO */
+
+static inline nostd::shared_ptr
+CreateAsyncInt64MetricContainerCpuUsage(metrics::Meter *meter)
+{
+ return meter->CreateInt64ObservableGauge(kMetricContainerCpuUsage, descrMetricContainerCpuUsage,
+ unitMetricContainerCpuUsage);
+}
+
+static inline nostd::shared_ptr
+CreateAsyncDoubleMetricContainerCpuUsage(metrics::Meter *meter)
+{
+ return meter->CreateDoubleObservableGauge(kMetricContainerCpuUsage, descrMetricContainerCpuUsage,
+ unitMetricContainerCpuUsage);
+}
+
+/**
+ * Disk bytes for the container.
+ *
+ * The total number of bytes read/written successfully (aggregated from all disks).
+ *
+ * counter
+ */
+static constexpr const char *kMetricContainerDiskIo = "container.disk.io";
+static constexpr const char *descrMetricContainerDiskIo = "Disk bytes for the container.";
+static constexpr const char *unitMetricContainerDiskIo = "By";
+
+static inline nostd::unique_ptr> CreateSyncInt64MetricContainerDiskIo(
+ metrics::Meter *meter)
+{
+ return meter->CreateUInt64Counter(kMetricContainerDiskIo, descrMetricContainerDiskIo,
+ unitMetricContainerDiskIo);
+}
+
+static inline nostd::unique_ptr> CreateSyncDoubleMetricContainerDiskIo(
+ metrics::Meter *meter)
+{
+ return meter->CreateDoubleCounter(kMetricContainerDiskIo, descrMetricContainerDiskIo,
+ unitMetricContainerDiskIo);
+}
+
+static inline nostd::shared_ptr
+CreateAsyncInt64MetricContainerDiskIo(metrics::Meter *meter)
+{
+ return meter->CreateInt64ObservableCounter(kMetricContainerDiskIo, descrMetricContainerDiskIo,
+ unitMetricContainerDiskIo);
+}
+
+static inline nostd::shared_ptr
+CreateAsyncDoubleMetricContainerDiskIo(metrics::Meter *meter)
+{
+ return meter->CreateDoubleObservableCounter(kMetricContainerDiskIo, descrMetricContainerDiskIo,
+ unitMetricContainerDiskIo);
+}
+
+/**
+ * Memory usage of the container.
+ *
+ * Memory usage of the container.
+ *
+ * counter
+ */
+static constexpr const char *kMetricContainerMemoryUsage = "container.memory.usage";
+static constexpr const char *descrMetricContainerMemoryUsage = "Memory usage of the container.";
+static constexpr const char *unitMetricContainerMemoryUsage = "By";
+
+static inline nostd::unique_ptr>
+CreateSyncInt64MetricContainerMemoryUsage(metrics::Meter *meter)
+{
+ return meter->CreateUInt64Counter(kMetricContainerMemoryUsage, descrMetricContainerMemoryUsage,
+ unitMetricContainerMemoryUsage);
+}
+
+static inline nostd::unique_ptr>
+CreateSyncDoubleMetricContainerMemoryUsage(metrics::Meter *meter)
+{
+ return meter->CreateDoubleCounter(kMetricContainerMemoryUsage, descrMetricContainerMemoryUsage,
+ unitMetricContainerMemoryUsage);
+}
+
+static inline nostd::shared_ptr
+CreateAsyncInt64MetricContainerMemoryUsage(metrics::Meter *meter)
+{
+ return meter->CreateInt64ObservableCounter(
+ kMetricContainerMemoryUsage, descrMetricContainerMemoryUsage, unitMetricContainerMemoryUsage);
+}
+
+static inline nostd::shared_ptr
+CreateAsyncDoubleMetricContainerMemoryUsage(metrics::Meter *meter)
+{
+ return meter->CreateDoubleObservableCounter(
+ kMetricContainerMemoryUsage, descrMetricContainerMemoryUsage, unitMetricContainerMemoryUsage);
+}
+
+/**
+ * Network bytes for the container.
+ *
+ * The number of bytes sent/received on all network interfaces by the container.
+ *
+ * counter
+ */
+static constexpr const char *kMetricContainerNetworkIo = "container.network.io";
+static constexpr const char *descrMetricContainerNetworkIo = "Network bytes for the container.";
+static constexpr const char *unitMetricContainerNetworkIo = "By";
+
+static inline nostd::unique_ptr> CreateSyncInt64MetricContainerNetworkIo(
+ metrics::Meter *meter)
+{
+ return meter->CreateUInt64Counter(kMetricContainerNetworkIo, descrMetricContainerNetworkIo,
+ unitMetricContainerNetworkIo);
+}
+
+static inline nostd::unique_ptr> CreateSyncDoubleMetricContainerNetworkIo(
+ metrics::Meter *meter)
+{
+ return meter->CreateDoubleCounter(kMetricContainerNetworkIo, descrMetricContainerNetworkIo,
+ unitMetricContainerNetworkIo);
+}
+
+static inline nostd::shared_ptr
+CreateAsyncInt64MetricContainerNetworkIo(metrics::Meter *meter)
+{
+ return meter->CreateInt64ObservableCounter(
+ kMetricContainerNetworkIo, descrMetricContainerNetworkIo, unitMetricContainerNetworkIo);
+}
+
+static inline nostd::shared_ptr
+CreateAsyncDoubleMetricContainerNetworkIo(metrics::Meter *meter)
+{
+ return meter->CreateDoubleObservableCounter(
+ kMetricContainerNetworkIo, descrMetricContainerNetworkIo, unitMetricContainerNetworkIo);
+}
+
+/**
+ * The time the container has been running
+ *
+ * Instrumentations SHOULD use a gauge with type @code double @endcode and measure uptime in seconds
+ * as a floating point number with the highest precision available. The actual accuracy would depend
+ * on the instrumentation and operating system.
gauge
+ */
+static constexpr const char *kMetricContainerUptime = "container.uptime";
+static constexpr const char *descrMetricContainerUptime = "The time the container has been running";
+static constexpr const char *unitMetricContainerUptime = "s";
+
+#if OPENTELEMETRY_ABI_VERSION_NO >= 2
+
+static inline nostd::unique_ptr> CreateSyncInt64MetricContainerUptime(
+ metrics::Meter *meter)
+{
+ return meter->CreateInt64Gauge(kMetricContainerUptime, descrMetricContainerUptime,
+ unitMetricContainerUptime);
+}
+
+static inline nostd::unique_ptr> CreateSyncDoubleMetricContainerUptime(
+ metrics::Meter *meter)
+{
+ return meter->CreateDoubleGauge(kMetricContainerUptime, descrMetricContainerUptime,
+ unitMetricContainerUptime);
+}
+#endif /* OPENTELEMETRY_ABI_VERSION_NO */
+
+static inline nostd::shared_ptr
+CreateAsyncInt64MetricContainerUptime(metrics::Meter *meter)
+{
+ return meter->CreateInt64ObservableGauge(kMetricContainerUptime, descrMetricContainerUptime,
+ unitMetricContainerUptime);
+}
+
+static inline nostd::shared_ptr
+CreateAsyncDoubleMetricContainerUptime(metrics::Meter *meter)
+{
+ return meter->CreateDoubleObservableGauge(kMetricContainerUptime, descrMetricContainerUptime,
+ unitMetricContainerUptime);
+}
+
+} // namespace container
+} // namespace semconv
+OPENTELEMETRY_END_NAMESPACE
diff --git a/api/include/opentelemetry/semconv/cpu_metrics.h b/api/include/opentelemetry/semconv/cpu_metrics.h
new file mode 100644
index 0000000000..f9e6de5eb2
--- /dev/null
+++ b/api/include/opentelemetry/semconv/cpu_metrics.h
@@ -0,0 +1,141 @@
+/*
+ * 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_metrics-h.j2
+ */
+
+#pragma once
+
+#include "opentelemetry/common/macros.h"
+#include "opentelemetry/metrics/meter.h"
+#include "opentelemetry/version.h"
+
+OPENTELEMETRY_BEGIN_NAMESPACE
+namespace semconv
+{
+namespace cpu
+{
+
+/**
+ * Operating frequency of the logical CPU in Hertz.
+ *
+ * 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";
+
+#if OPENTELEMETRY_ABI_VERSION_NO >= 2
+
+static inline nostd::unique_ptr> CreateSyncInt64MetricCpuFrequency(
+ metrics::Meter *meter)
+{
+ return meter->CreateInt64Gauge(kMetricCpuFrequency, descrMetricCpuFrequency,
+ unitMetricCpuFrequency);
+}
+
+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)
+{
+ return meter->CreateInt64ObservableGauge(kMetricCpuFrequency, descrMetricCpuFrequency,
+ unitMetricCpuFrequency);
+}
+
+static inline nostd::shared_ptr CreateAsyncDoubleMetricCpuFrequency(
+ metrics::Meter *meter)
+{
+ return meter->CreateDoubleObservableGauge(kMetricCpuFrequency, descrMetricCpuFrequency,
+ unitMetricCpuFrequency);
+}
+
+/**
+ * Seconds each logical CPU spent on each mode
+ *
+ * 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";
+
+static inline nostd::unique_ptr> CreateSyncInt64MetricCpuTime(
+ metrics::Meter *meter)
+{
+ return meter->CreateUInt64Counter(kMetricCpuTime, descrMetricCpuTime, unitMetricCpuTime);
+}
+
+static inline nostd::unique_ptr> CreateSyncDoubleMetricCpuTime(
+ metrics::Meter *meter)
+{
+ return meter->CreateDoubleCounter(kMetricCpuTime, descrMetricCpuTime, unitMetricCpuTime);
+}
+
+static inline nostd::shared_ptr CreateAsyncInt64MetricCpuTime(
+ metrics::Meter *meter)
+{
+ return meter->CreateInt64ObservableCounter(kMetricCpuTime, descrMetricCpuTime, unitMetricCpuTime);
+}
+
+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
+ */
+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";
+
+#if OPENTELEMETRY_ABI_VERSION_NO >= 2
+
+static inline nostd::unique_ptr> CreateSyncInt64MetricCpuUtilization(
+ metrics::Meter *meter)
+{
+ return meter->CreateInt64Gauge(kMetricCpuUtilization, descrMetricCpuUtilization,
+ unitMetricCpuUtilization);
+}
+
+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)
+{
+ return meter->CreateInt64ObservableGauge(kMetricCpuUtilization, descrMetricCpuUtilization,
+ unitMetricCpuUtilization);
+}
+
+static inline nostd::shared_ptr
+CreateAsyncDoubleMetricCpuUtilization(metrics::Meter *meter)
+{
+ return meter->CreateDoubleObservableGauge(kMetricCpuUtilization, descrMetricCpuUtilization,
+ unitMetricCpuUtilization);
+}
+
+} // namespace cpu
+} // namespace semconv
+OPENTELEMETRY_END_NAMESPACE
diff --git a/api/include/opentelemetry/semconv/db_attributes.h b/api/include/opentelemetry/semconv/db_attributes.h
new file mode 100644
index 0000000000..fa77366619
--- /dev/null
+++ b/api/include/opentelemetry/semconv/db_attributes.h
@@ -0,0 +1,164 @@
+/*
+ * 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 db
+{
+
+/**
+ The name of a collection (table, container) within the database.
+
+ It is RECOMMENDED to capture the value as provided by the application
+ without attempting to do any case normalization.
+
+ The collection name SHOULD NOT be extracted from @code db.query.text @endcode,
+ when the database system supports query text with multiple collections
+ in non-batch operations.
+
+ For batch operations, if the individual operations are known to have the same
+ collection name then that collection name SHOULD be used.
+ */
+static constexpr const char *kDbCollectionName = "db.collection.name";
+
+/**
+ The name of the database, fully qualified within the server address and port.
+
+ If a database system has multiple namespace components, they SHOULD be concatenated from the most
+ general to the most specific namespace component, using @code | @endcode as a separator between
+ the components. Any missing components (and their associated separators) SHOULD be omitted.
+ Semantic conventions for individual database systems SHOULD document what @code db.namespace
+ @endcode means in the context of that system. It is RECOMMENDED to capture the value as provided
+ by the application without attempting to do any case normalization.
+ */
+static constexpr const char *kDbNamespace = "db.namespace";
+
+/**
+ The number of queries included in a batch operation.
+
+ Operations are only considered batches when they contain two or more operations, and so @code
+ db.operation.batch.size @endcode SHOULD never be @code 1 @endcode.
+ */
+static constexpr const char *kDbOperationBatchSize = "db.operation.batch.size";
+
+/**
+ The name of the operation or command being executed.
+
+ It is RECOMMENDED to capture the value as provided by the application
+ without attempting to do any case normalization.
+
+ The operation name SHOULD NOT be extracted from @code db.query.text @endcode,
+ when the database system supports query text with multiple operations
+ in non-batch operations.
+
+ If spaces can occur in the operation name, multiple consecutive spaces
+ SHOULD be normalized to a single space.
+
+ For batch operations, if the individual operations are known to have the same operation name
+ then that operation name SHOULD be used prepended by @code BATCH @endcode,
+ otherwise @code db.operation.name @endcode SHOULD be @code BATCH @endcode or some other database
+ system specific term if more applicable.
+ */
+static constexpr const char *kDbOperationName = "db.operation.name";
+
+/**
+ Low cardinality summary of a database query.
+
+ The query summary describes a class of database queries and is useful
+ as a grouping key, especially when analyzing telemetry for database
+ calls involving complex queries.
+
+ Summary may be available to the instrumentation through
+ instrumentation hooks or other means. If it is not available, instrumentations
+ that support query parsing SHOULD generate a summary following
+ Generating query
+ summary section.
+ */
+static constexpr const char *kDbQuerySummary = "db.query.summary";
+
+/**
+ The database query being executed.
+
+ For sanitization see Sanitization of @code
+ db.query.text @endcode. For batch operations, if the individual operations are known to have
+ the same query text then that query text SHOULD be used, otherwise all of the individual query
+ texts SHOULD be concatenated with separator @code ; @endcode or some other database system
+ specific separator if more applicable. Parameterized query text SHOULD NOT be sanitized. Even
+ though parameterized query text can potentially have sensitive data, by using a parameterized
+ query the user is giving a strong signal that any sensitive data will be passed as parameter
+ values, and the benefit to observability of capturing the static part of the query text by default
+ outweighs the risk.
+ */
+static constexpr const char *kDbQueryText = "db.query.text";
+
+/**
+ Database response status code.
+
+ The status code returned by the database. Usually it represents an error code, but may also
+ represent partial success, warning, or differentiate between various types of successful outcomes.
+ Semantic conventions for individual database systems SHOULD document what @code
+ db.response.status_code @endcode means in the context of that system.
+ */
+static constexpr const char *kDbResponseStatusCode = "db.response.status_code";
+
+/**
+ The name of a stored procedure within the database.
+
+ It is RECOMMENDED to capture the value as provided by the application
+ without attempting to do any case normalization.
+
+ For batch operations, if the individual operations are known to have the same
+ stored procedure name then that stored procedure name SHOULD be used.
+ */
+static constexpr const char *kDbStoredProcedureName = "db.stored_procedure.name";
+
+/**
+ The database management system (DBMS) product as identified by the client instrumentation.
+
+ The actual DBMS may differ from the one identified by the client. For example, when using
+ PostgreSQL client libraries to connect to a CockroachDB, the @code db.system.name @endcode is set
+ to @code postgresql @endcode based on the instrumentation's best knowledge.
+ */
+static constexpr const char *kDbSystemName = "db.system.name";
+
+namespace DbSystemNameValues
+{
+/**
+ MariaDB
+ */
+static constexpr const char *kMariadb = "mariadb";
+
+/**
+ Microsoft SQL Server
+ */
+static constexpr const char *kMicrosoftSqlServer = "microsoft.sql_server";
+
+/**
+ MySQL
+ */
+static constexpr const char *kMysql = "mysql";
+
+/**
+ PostgreSQL
+ */
+static constexpr const char *kPostgresql = "postgresql";
+
+} // namespace DbSystemNameValues
+
+} // namespace db
+} // namespace semconv
+OPENTELEMETRY_END_NAMESPACE
diff --git a/api/include/opentelemetry/semconv/db_metrics.h b/api/include/opentelemetry/semconv/db_metrics.h
new file mode 100644
index 0000000000..5748dc4cba
--- /dev/null
+++ b/api/include/opentelemetry/semconv/db_metrics.h
@@ -0,0 +1,53 @@
+/*
+ * 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_metrics-h.j2
+ */
+
+#pragma once
+
+#include "opentelemetry/common/macros.h"
+#include "opentelemetry/metrics/meter.h"
+#include "opentelemetry/version.h"
+
+OPENTELEMETRY_BEGIN_NAMESPACE
+namespace semconv
+{
+namespace db
+{
+
+/**
+ Duration of database client operations.
+
+ Batch operations SHOULD be recorded as a single operation.
+
+ histogram
+ */
+static constexpr const char *kMetricDbClientOperationDuration = "db.client.operation.duration";
+static constexpr const char *descrMetricDbClientOperationDuration =
+ "Duration of database client operations.";
+static constexpr const char *unitMetricDbClientOperationDuration = "s";
+
+static inline nostd::unique_ptr>
+CreateSyncInt64MetricDbClientOperationDuration(metrics::Meter *meter)
+{
+ return meter->CreateUInt64Histogram(kMetricDbClientOperationDuration,
+ descrMetricDbClientOperationDuration,
+ unitMetricDbClientOperationDuration);
+}
+
+static inline nostd::unique_ptr>
+CreateSyncDoubleMetricDbClientOperationDuration(metrics::Meter *meter)
+{
+ return meter->CreateDoubleHistogram(kMetricDbClientOperationDuration,
+ descrMetricDbClientOperationDuration,
+ unitMetricDbClientOperationDuration);
+}
+
+} // namespace db
+} // namespace semconv
+OPENTELEMETRY_END_NAMESPACE
diff --git a/api/include/opentelemetry/semconv/dns_metrics.h b/api/include/opentelemetry/semconv/dns_metrics.h
new file mode 100644
index 0000000000..019fea6742
--- /dev/null
+++ b/api/include/opentelemetry/semconv/dns_metrics.h
@@ -0,0 +1,49 @@
+/*
+ * 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_metrics-h.j2
+ */
+
+#pragma once
+
+#include "opentelemetry/common/macros.h"
+#include "opentelemetry/metrics/meter.h"
+#include "opentelemetry/version.h"
+
+OPENTELEMETRY_BEGIN_NAMESPACE
+namespace semconv
+{
+namespace dns
+{
+
+/**
+ * Measures the time taken to perform a DNS lookup.
+ *
+ * histogram
+ */
+static constexpr const char *kMetricDnsLookupDuration = "dns.lookup.duration";
+static constexpr const char *descrMetricDnsLookupDuration =
+ "Measures the time taken to perform a DNS lookup.";
+static constexpr const char *unitMetricDnsLookupDuration = "s";
+
+static inline nostd::unique_ptr>
+CreateSyncInt64MetricDnsLookupDuration(metrics::Meter *meter)
+{
+ return meter->CreateUInt64Histogram(kMetricDnsLookupDuration, descrMetricDnsLookupDuration,
+ unitMetricDnsLookupDuration);
+}
+
+static inline nostd::unique_ptr> CreateSyncDoubleMetricDnsLookupDuration(
+ metrics::Meter *meter)
+{
+ return meter->CreateDoubleHistogram(kMetricDnsLookupDuration, descrMetricDnsLookupDuration,
+ unitMetricDnsLookupDuration);
+}
+
+} // namespace dns
+} // namespace semconv
+OPENTELEMETRY_END_NAMESPACE
diff --git a/api/include/opentelemetry/semconv/error_attributes.h b/api/include/opentelemetry/semconv/error_attributes.h
index 1b711ff112..e0ef3c925e 100644
--- a/api/include/opentelemetry/semconv/error_attributes.h
+++ b/api/include/opentelemetry/semconv/error_attributes.h
@@ -20,33 +20,33 @@ namespace error
{
/**
- * Describes a class of error the operation ended with.
- *
- * The @code error.type @endcode SHOULD be predictable, and SHOULD have low cardinality.
- *
- * When @code error.type @endcode is set to a type (e.g., an exception type), its
- * canonical class name identifying the type within the artifact SHOULD be used.
- *
- * Instrumentations SHOULD document the list of errors they report.
- *
- * The cardinality of @code error.type @endcode within one instrumentation library SHOULD be low.
- * Telemetry consumers that aggregate data from multiple instrumentation libraries and applications
- * should be prepared for @code error.type @endcode to have high cardinality at query time when no
- * additional filters are applied.
- *
- * If the operation has completed successfully, instrumentations SHOULD NOT set @code error.type
- * @endcode.
If a specific domain defines its own set of error identifiers (such as HTTP or gRPC
- * status codes), it's RECOMMENDED to:
- Use a domain-specific attribute
- Set
- * @code error.type @endcode to capture all errors, regardless of whether they are defined within
- * the domain-specific set or not.
- *
+ Describes a class of error the operation ended with.
+
+ The @code error.type @endcode SHOULD be predictable, and SHOULD have low cardinality.
+
+ When @code error.type @endcode is set to a type (e.g., an exception type), its
+ canonical class name identifying the type within the artifact SHOULD be used.
+
+ Instrumentations SHOULD document the list of errors they report.
+
+ The cardinality of @code error.type @endcode within one instrumentation library SHOULD be low.
+ Telemetry consumers that aggregate data from multiple instrumentation libraries and applications
+ should be prepared for @code error.type @endcode to have high cardinality at query time when no
+ additional filters are applied.
+
+ If the operation has completed successfully, instrumentations SHOULD NOT set @code error.type
+ @endcode.
If a specific domain defines its own set of error identifiers (such as HTTP or gRPC
+ status codes), it's RECOMMENDED to:
- Use a domain-specific attribute
- Set @code
+ error.type @endcode to capture all errors, regardless of whether they are defined within the
+ domain-specific set or not.
+
*/
static constexpr const char *kErrorType = "error.type";
namespace ErrorTypeValues
{
/**
- * A fallback error value to be used when the instrumentation doesn't define a custom value.
+ A fallback error value to be used when the instrumentation doesn't define a custom value.
*/
static constexpr const char *kOther = "_OTHER";
diff --git a/api/include/opentelemetry/semconv/exception_attributes.h b/api/include/opentelemetry/semconv/exception_attributes.h
index fdc19ac6d0..8947d711f1 100644
--- a/api/include/opentelemetry/semconv/exception_attributes.h
+++ b/api/include/opentelemetry/semconv/exception_attributes.h
@@ -20,37 +20,28 @@ namespace exception
{
/**
- * SHOULD be set to true if the exception event is recorded at a point where it is known that the
- * exception is escaping the scope of the span. An exception is considered to have escaped (or
- * left) the scope of a span, if that span is ended while the exception is still logically "in
- * flight". This may be actually "in flight" in some languages (e.g. if the exception is passed to a
- * Context manager's @code __exit__ @endcode method in Python) but will usually be caught at the
- * point of recording the exception in most languages.
It is usually not possible to determine
- * at the point where an exception is thrown whether it will escape the scope of a span. However, it
- * is trivial to know that an exception will escape, if one checks for an active exception just
- * before ending the span, as done in the example
- * for recording span exceptions.
It follows that an exception may still escape the scope of
- * the span even if the @code exception.escaped @endcode attribute was not set or set to false,
- * since the event might have been recorded at a time where it was not
- * clear whether the exception will escape.
+ Indicates that the exception is escaping the scope of the span.
+
+ @deprecated
+ {"note": "It's no longer recommended to record exceptions that are handled and do not escape the
+ scope of a span.\n", "reason": "obsoleted"}
*/
-static constexpr const char *kExceptionEscaped = "exception.escaped";
+OPENTELEMETRY_DEPRECATED static constexpr const char *kExceptionEscaped = "exception.escaped";
/**
- * The exception message.
+ The exception message.
*/
static constexpr const char *kExceptionMessage = "exception.message";
/**
- * A stacktrace as a string in the natural representation for the language runtime. The
- * representation is to be determined and documented by each language SIG.
+ A stacktrace as a string in the natural representation for the language runtime. The
+ representation is to be determined and documented by each language SIG.
*/
static constexpr const char *kExceptionStacktrace = "exception.stacktrace";
/**
- * The type of the exception (its fully-qualified class name, if applicable). The dynamic type of
- * the exception should be preferred over the static type in languages that support it.
+ The type of the exception (its fully-qualified class name, if applicable). The dynamic type of the
+ exception should be preferred over the static type in languages that support it.
*/
static constexpr const char *kExceptionType = "exception.type";
diff --git a/api/include/opentelemetry/semconv/faas_metrics.h b/api/include/opentelemetry/semconv/faas_metrics.h
new file mode 100644
index 0000000000..72109d887a
--- /dev/null
+++ b/api/include/opentelemetry/semconv/faas_metrics.h
@@ -0,0 +1,287 @@
+/*
+ * 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_metrics-h.j2
+ */
+
+#pragma once
+
+#include "opentelemetry/common/macros.h"
+#include "opentelemetry/metrics/meter.h"
+#include "opentelemetry/version.h"
+
+OPENTELEMETRY_BEGIN_NAMESPACE
+namespace semconv
+{
+namespace faas
+{
+
+/**
+ * Number of invocation cold starts
+ *
+ * counter
+ */
+static constexpr const char *kMetricFaasColdstarts = "faas.coldstarts";
+static constexpr const char *descrMetricFaasColdstarts = "Number of invocation cold starts";
+static constexpr const char *unitMetricFaasColdstarts = "{coldstart}";
+
+static inline nostd::unique_ptr> CreateSyncInt64MetricFaasColdstarts(
+ metrics::Meter *meter)
+{
+ return meter->CreateUInt64Counter(kMetricFaasColdstarts, descrMetricFaasColdstarts,
+ unitMetricFaasColdstarts);
+}
+
+static inline nostd::unique_ptr> CreateSyncDoubleMetricFaasColdstarts(
+ metrics::Meter *meter)
+{
+ return meter->CreateDoubleCounter(kMetricFaasColdstarts, descrMetricFaasColdstarts,
+ unitMetricFaasColdstarts);
+}
+
+static inline nostd::shared_ptr CreateAsyncInt64MetricFaasColdstarts(
+ metrics::Meter *meter)
+{
+ return meter->CreateInt64ObservableCounter(kMetricFaasColdstarts, descrMetricFaasColdstarts,
+ unitMetricFaasColdstarts);
+}
+
+static inline nostd::shared_ptr
+CreateAsyncDoubleMetricFaasColdstarts(metrics::Meter *meter)
+{
+ return meter->CreateDoubleObservableCounter(kMetricFaasColdstarts, descrMetricFaasColdstarts,
+ unitMetricFaasColdstarts);
+}
+
+/**
+ * Distribution of CPU usage per invocation
+ *
+ * histogram
+ */
+static constexpr const char *kMetricFaasCpuUsage = "faas.cpu_usage";
+static constexpr const char *descrMetricFaasCpuUsage = "Distribution of CPU usage per invocation";
+static constexpr const char *unitMetricFaasCpuUsage = "s";
+
+static inline nostd::unique_ptr> CreateSyncInt64MetricFaasCpuUsage(
+ metrics::Meter *meter)
+{
+ return meter->CreateUInt64Histogram(kMetricFaasCpuUsage, descrMetricFaasCpuUsage,
+ unitMetricFaasCpuUsage);
+}
+
+static inline nostd::unique_ptr> CreateSyncDoubleMetricFaasCpuUsage(
+ metrics::Meter *meter)
+{
+ return meter->CreateDoubleHistogram(kMetricFaasCpuUsage, descrMetricFaasCpuUsage,
+ unitMetricFaasCpuUsage);
+}
+
+/**
+ * Number of invocation errors
+ *
+ * counter
+ */
+static constexpr const char *kMetricFaasErrors = "faas.errors";
+static constexpr const char *descrMetricFaasErrors = "Number of invocation errors";
+static constexpr const char *unitMetricFaasErrors = "{error}";
+
+static inline nostd::unique_ptr> CreateSyncInt64MetricFaasErrors(
+ metrics::Meter *meter)
+{
+ return meter->CreateUInt64Counter(kMetricFaasErrors, descrMetricFaasErrors, unitMetricFaasErrors);
+}
+
+static inline nostd::unique_ptr> CreateSyncDoubleMetricFaasErrors(
+ metrics::Meter *meter)
+{
+ return meter->CreateDoubleCounter(kMetricFaasErrors, descrMetricFaasErrors, unitMetricFaasErrors);
+}
+
+static inline nostd::shared_ptr CreateAsyncInt64MetricFaasErrors(
+ metrics::Meter *meter)
+{
+ return meter->CreateInt64ObservableCounter(kMetricFaasErrors, descrMetricFaasErrors,
+ unitMetricFaasErrors);
+}
+
+static inline nostd::shared_ptr CreateAsyncDoubleMetricFaasErrors(
+ metrics::Meter *meter)
+{
+ return meter->CreateDoubleObservableCounter(kMetricFaasErrors, descrMetricFaasErrors,
+ unitMetricFaasErrors);
+}
+
+/**
+ * Measures the duration of the function's initialization, such as a cold start
+ *
+ * histogram
+ */
+static constexpr const char *kMetricFaasInitDuration = "faas.init_duration";
+static constexpr const char *descrMetricFaasInitDuration =
+ "Measures the duration of the function's initialization, such as a cold start";
+static constexpr const char *unitMetricFaasInitDuration = "s";
+
+static inline nostd::unique_ptr> CreateSyncInt64MetricFaasInitDuration(
+ metrics::Meter *meter)
+{
+ return meter->CreateUInt64Histogram(kMetricFaasInitDuration, descrMetricFaasInitDuration,
+ unitMetricFaasInitDuration);
+}
+
+static inline nostd::unique_ptr> CreateSyncDoubleMetricFaasInitDuration(
+ metrics::Meter *meter)
+{
+ return meter->CreateDoubleHistogram(kMetricFaasInitDuration, descrMetricFaasInitDuration,
+ unitMetricFaasInitDuration);
+}
+
+/**
+ * Number of successful invocations
+ *
+ * counter
+ */
+static constexpr const char *kMetricFaasInvocations = "faas.invocations";
+static constexpr const char *descrMetricFaasInvocations = "Number of successful invocations";
+static constexpr const char *unitMetricFaasInvocations = "{invocation}";
+
+static inline nostd::unique_ptr> CreateSyncInt64MetricFaasInvocations(
+ metrics::Meter *meter)
+{
+ return meter->CreateUInt64Counter(kMetricFaasInvocations, descrMetricFaasInvocations,
+ unitMetricFaasInvocations);
+}
+
+static inline nostd::unique_ptr> CreateSyncDoubleMetricFaasInvocations(
+ metrics::Meter *meter)
+{
+ return meter->CreateDoubleCounter(kMetricFaasInvocations, descrMetricFaasInvocations,
+ unitMetricFaasInvocations);
+}
+
+static inline nostd::shared_ptr
+CreateAsyncInt64MetricFaasInvocations(metrics::Meter *meter)
+{
+ return meter->CreateInt64ObservableCounter(kMetricFaasInvocations, descrMetricFaasInvocations,
+ unitMetricFaasInvocations);
+}
+
+static inline nostd::shared_ptr
+CreateAsyncDoubleMetricFaasInvocations(metrics::Meter *meter)
+{
+ return meter->CreateDoubleObservableCounter(kMetricFaasInvocations, descrMetricFaasInvocations,
+ unitMetricFaasInvocations);
+}
+
+/**
+ * Measures the duration of the function's logic execution
+ *
+ * histogram
+ */
+static constexpr const char *kMetricFaasInvokeDuration = "faas.invoke_duration";
+static constexpr const char *descrMetricFaasInvokeDuration =
+ "Measures the duration of the function's logic execution";
+static constexpr const char *unitMetricFaasInvokeDuration = "s";
+
+static inline nostd::unique_ptr>
+CreateSyncInt64MetricFaasInvokeDuration(metrics::Meter *meter)
+{
+ return meter->CreateUInt64Histogram(kMetricFaasInvokeDuration, descrMetricFaasInvokeDuration,
+ unitMetricFaasInvokeDuration);
+}
+
+static inline nostd::unique_ptr>
+CreateSyncDoubleMetricFaasInvokeDuration(metrics::Meter *meter)
+{
+ return meter->CreateDoubleHistogram(kMetricFaasInvokeDuration, descrMetricFaasInvokeDuration,
+ unitMetricFaasInvokeDuration);
+}
+
+/**
+ * Distribution of max memory usage per invocation
+ *
+ * histogram
+ */
+static constexpr const char *kMetricFaasMemUsage = "faas.mem_usage";
+static constexpr const char *descrMetricFaasMemUsage =
+ "Distribution of max memory usage per invocation";
+static constexpr const char *unitMetricFaasMemUsage = "By";
+
+static inline nostd::unique_ptr> CreateSyncInt64MetricFaasMemUsage(
+ metrics::Meter *meter)
+{
+ return meter->CreateUInt64Histogram(kMetricFaasMemUsage, descrMetricFaasMemUsage,
+ unitMetricFaasMemUsage);
+}
+
+static inline nostd::unique_ptr