From 44018b0bec5da4fe75e9147686ce982e2023d0a9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 16 May 2025 17:30:07 +0200 Subject: [PATCH 1/2] Bump codecov/codecov-action from 5.4.2 to 5.4.3 (#3419) Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 5.4.2 to 5.4.3. - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/codecov/codecov-action/compare/ad3126e916f78f00edff4ed0317cf185271ccc2d...18283e04ce6e62d37312384ff67231eb8fd56d24) --- updated-dependencies: - dependency-name: codecov/codecov-action dependency-version: 5.4.3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 359b338945..8415f13967 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1126,7 +1126,7 @@ jobs: CXX: /usr/bin/g++-10 run: ./ci/do_ci.sh code.coverage - name: upload report - uses: codecov/codecov-action@ad3126e916f78f00edff4ed0317cf185271ccc2d # v5.4.2 + uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3 with: files: /home/runner/build/coverage.info From 0f8dedf709e03f940582c5d3c9f161e9ef4f86fb Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Fri, 16 May 2025 19:01:04 +0200 Subject: [PATCH 2/2] [SEMANTIC CONVENTIONS] Upgrade semantic conventions to 1.33.0 (#3416) --- .../opentelemetry/semconv/code_attributes.h | 81 ++ .../opentelemetry/semconv/db_attributes.h | 350 ++++++++ .../opentelemetry/semconv/db_metrics.h | 813 ------------------ .../opentelemetry/semconv/http_attributes.h | 32 +- .../semconv/incubating/app_attributes.h | 23 + .../semconv/incubating/cicd_attributes.h | 80 ++ .../semconv/incubating/code_attributes.h | 20 +- .../semconv/incubating/container_attributes.h | 4 + .../semconv/incubating/db_attributes.h | 84 +- .../incubating/feature_flag_attributes.h | 9 +- .../semconv/incubating/gen_ai_attributes.h | 31 + .../semconv/incubating/http_attributes.h | 32 +- .../semconv/incubating/k8s_attributes.h | 162 +++- .../semconv/incubating/messaging_attributes.h | 13 - .../semconv/incubating/otel_attributes.h | 34 +- .../semconv/incubating/otel_metrics.h | 525 +++++++++-- .../semconv/incubating/process_attributes.h | 12 + .../semconv/incubating/rpc_attributes.h | 21 +- .../semconv/incubating/vcs_attributes.h | 7 +- .../opentelemetry/semconv/schema_url.h | 2 +- buildscripts/semantic-convention/generate.sh | 4 +- 21 files changed, 1360 insertions(+), 979 deletions(-) create mode 100644 api/include/opentelemetry/semconv/code_attributes.h create mode 100644 api/include/opentelemetry/semconv/db_attributes.h diff --git a/api/include/opentelemetry/semconv/code_attributes.h b/api/include/opentelemetry/semconv/code_attributes.h new file mode 100644 index 0000000000..126b6aa2e9 --- /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: + *

+ */ +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/db_attributes.h b/api/include/opentelemetry/semconv/db_attributes.h new file mode 100644 index 0000000000..2f85df68be --- /dev/null +++ b/api/include/opentelemetry/semconv/db_attributes.h @@ -0,0 +1,350 @@ +/* + * 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 +{ +/** + * 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 + */ +static constexpr const char *kMicrosoftSqlServer = "microsoft.sql_server"; + +/** + * MySQL + */ +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 +} // namespace semconv +OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/db_metrics.h b/api/include/opentelemetry/semconv/db_metrics.h index a444adf5f9..abaf20d525 100644 --- a/api/include/opentelemetry/semconv/db_metrics.h +++ b/api/include/opentelemetry/semconv/db_metrics.h @@ -20,792 +20,6 @@ namespace semconv namespace db { -/** - * The number of connections that are currently in state described by the @code state @endcode - * attribute

updowncounter - */ -static constexpr const char *kMetricDbClientConnectionCount = "db.client.connection.count"; -static constexpr const char *descrMetricDbClientConnectionCount = - "The number of connections that are currently in state described by the `state` attribute"; -static constexpr const char *unitMetricDbClientConnectionCount = "{connection}"; - -static inline nostd::unique_ptr> -CreateSyncInt64MetricDbClientConnectionCount(metrics::Meter *meter) -{ - return meter->CreateInt64UpDownCounter(kMetricDbClientConnectionCount, - descrMetricDbClientConnectionCount, - unitMetricDbClientConnectionCount); -} - -static inline nostd::unique_ptr> -CreateSyncDoubleMetricDbClientConnectionCount(metrics::Meter *meter) -{ - return meter->CreateDoubleUpDownCounter(kMetricDbClientConnectionCount, - descrMetricDbClientConnectionCount, - unitMetricDbClientConnectionCount); -} - -static inline nostd::shared_ptr -CreateAsyncInt64MetricDbClientConnectionCount(metrics::Meter *meter) -{ - return meter->CreateInt64ObservableUpDownCounter(kMetricDbClientConnectionCount, - descrMetricDbClientConnectionCount, - unitMetricDbClientConnectionCount); -} - -static inline nostd::shared_ptr -CreateAsyncDoubleMetricDbClientConnectionCount(metrics::Meter *meter) -{ - return meter->CreateDoubleObservableUpDownCounter(kMetricDbClientConnectionCount, - descrMetricDbClientConnectionCount, - unitMetricDbClientConnectionCount); -} - -/** - * The time it took to create a new connection - *

- * histogram - */ -static constexpr const char *kMetricDbClientConnectionCreateTime = - "db.client.connection.create_time"; -static constexpr const char *descrMetricDbClientConnectionCreateTime = - "The time it took to create a new connection"; -static constexpr const char *unitMetricDbClientConnectionCreateTime = "s"; - -static inline nostd::unique_ptr> -CreateSyncInt64MetricDbClientConnectionCreateTime(metrics::Meter *meter) -{ - return meter->CreateUInt64Histogram(kMetricDbClientConnectionCreateTime, - descrMetricDbClientConnectionCreateTime, - unitMetricDbClientConnectionCreateTime); -} - -static inline nostd::unique_ptr> -CreateSyncDoubleMetricDbClientConnectionCreateTime(metrics::Meter *meter) -{ - return meter->CreateDoubleHistogram(kMetricDbClientConnectionCreateTime, - descrMetricDbClientConnectionCreateTime, - unitMetricDbClientConnectionCreateTime); -} - -/** - * The maximum number of idle open connections allowed - *

- * updowncounter - */ -static constexpr const char *kMetricDbClientConnectionIdleMax = "db.client.connection.idle.max"; -static constexpr const char *descrMetricDbClientConnectionIdleMax = - "The maximum number of idle open connections allowed"; -static constexpr const char *unitMetricDbClientConnectionIdleMax = "{connection}"; - -static inline nostd::unique_ptr> -CreateSyncInt64MetricDbClientConnectionIdleMax(metrics::Meter *meter) -{ - return meter->CreateInt64UpDownCounter(kMetricDbClientConnectionIdleMax, - descrMetricDbClientConnectionIdleMax, - unitMetricDbClientConnectionIdleMax); -} - -static inline nostd::unique_ptr> -CreateSyncDoubleMetricDbClientConnectionIdleMax(metrics::Meter *meter) -{ - return meter->CreateDoubleUpDownCounter(kMetricDbClientConnectionIdleMax, - descrMetricDbClientConnectionIdleMax, - unitMetricDbClientConnectionIdleMax); -} - -static inline nostd::shared_ptr -CreateAsyncInt64MetricDbClientConnectionIdleMax(metrics::Meter *meter) -{ - return meter->CreateInt64ObservableUpDownCounter(kMetricDbClientConnectionIdleMax, - descrMetricDbClientConnectionIdleMax, - unitMetricDbClientConnectionIdleMax); -} - -static inline nostd::shared_ptr -CreateAsyncDoubleMetricDbClientConnectionIdleMax(metrics::Meter *meter) -{ - return meter->CreateDoubleObservableUpDownCounter(kMetricDbClientConnectionIdleMax, - descrMetricDbClientConnectionIdleMax, - unitMetricDbClientConnectionIdleMax); -} - -/** - * The minimum number of idle open connections allowed - *

- * updowncounter - */ -static constexpr const char *kMetricDbClientConnectionIdleMin = "db.client.connection.idle.min"; -static constexpr const char *descrMetricDbClientConnectionIdleMin = - "The minimum number of idle open connections allowed"; -static constexpr const char *unitMetricDbClientConnectionIdleMin = "{connection}"; - -static inline nostd::unique_ptr> -CreateSyncInt64MetricDbClientConnectionIdleMin(metrics::Meter *meter) -{ - return meter->CreateInt64UpDownCounter(kMetricDbClientConnectionIdleMin, - descrMetricDbClientConnectionIdleMin, - unitMetricDbClientConnectionIdleMin); -} - -static inline nostd::unique_ptr> -CreateSyncDoubleMetricDbClientConnectionIdleMin(metrics::Meter *meter) -{ - return meter->CreateDoubleUpDownCounter(kMetricDbClientConnectionIdleMin, - descrMetricDbClientConnectionIdleMin, - unitMetricDbClientConnectionIdleMin); -} - -static inline nostd::shared_ptr -CreateAsyncInt64MetricDbClientConnectionIdleMin(metrics::Meter *meter) -{ - return meter->CreateInt64ObservableUpDownCounter(kMetricDbClientConnectionIdleMin, - descrMetricDbClientConnectionIdleMin, - unitMetricDbClientConnectionIdleMin); -} - -static inline nostd::shared_ptr -CreateAsyncDoubleMetricDbClientConnectionIdleMin(metrics::Meter *meter) -{ - return meter->CreateDoubleObservableUpDownCounter(kMetricDbClientConnectionIdleMin, - descrMetricDbClientConnectionIdleMin, - unitMetricDbClientConnectionIdleMin); -} - -/** - * The maximum number of open connections allowed - *

- * updowncounter - */ -static constexpr const char *kMetricDbClientConnectionMax = "db.client.connection.max"; -static constexpr const char *descrMetricDbClientConnectionMax = - "The maximum number of open connections allowed"; -static constexpr const char *unitMetricDbClientConnectionMax = "{connection}"; - -static inline nostd::unique_ptr> -CreateSyncInt64MetricDbClientConnectionMax(metrics::Meter *meter) -{ - return meter->CreateInt64UpDownCounter(kMetricDbClientConnectionMax, - descrMetricDbClientConnectionMax, - unitMetricDbClientConnectionMax); -} - -static inline nostd::unique_ptr> -CreateSyncDoubleMetricDbClientConnectionMax(metrics::Meter *meter) -{ - return meter->CreateDoubleUpDownCounter(kMetricDbClientConnectionMax, - descrMetricDbClientConnectionMax, - unitMetricDbClientConnectionMax); -} - -static inline nostd::shared_ptr -CreateAsyncInt64MetricDbClientConnectionMax(metrics::Meter *meter) -{ - return meter->CreateInt64ObservableUpDownCounter(kMetricDbClientConnectionMax, - descrMetricDbClientConnectionMax, - unitMetricDbClientConnectionMax); -} - -static inline nostd::shared_ptr -CreateAsyncDoubleMetricDbClientConnectionMax(metrics::Meter *meter) -{ - return meter->CreateDoubleObservableUpDownCounter(kMetricDbClientConnectionMax, - descrMetricDbClientConnectionMax, - unitMetricDbClientConnectionMax); -} - -/** - * The number of current pending requests for an open connection - *

- * updowncounter - */ -static constexpr const char *kMetricDbClientConnectionPendingRequests = - "db.client.connection.pending_requests"; -static constexpr const char *descrMetricDbClientConnectionPendingRequests = - "The number of current pending requests for an open connection"; -static constexpr const char *unitMetricDbClientConnectionPendingRequests = "{request}"; - -static inline nostd::unique_ptr> -CreateSyncInt64MetricDbClientConnectionPendingRequests(metrics::Meter *meter) -{ - return meter->CreateInt64UpDownCounter(kMetricDbClientConnectionPendingRequests, - descrMetricDbClientConnectionPendingRequests, - unitMetricDbClientConnectionPendingRequests); -} - -static inline nostd::unique_ptr> -CreateSyncDoubleMetricDbClientConnectionPendingRequests(metrics::Meter *meter) -{ - return meter->CreateDoubleUpDownCounter(kMetricDbClientConnectionPendingRequests, - descrMetricDbClientConnectionPendingRequests, - unitMetricDbClientConnectionPendingRequests); -} - -static inline nostd::shared_ptr -CreateAsyncInt64MetricDbClientConnectionPendingRequests(metrics::Meter *meter) -{ - return meter->CreateInt64ObservableUpDownCounter(kMetricDbClientConnectionPendingRequests, - descrMetricDbClientConnectionPendingRequests, - unitMetricDbClientConnectionPendingRequests); -} - -static inline nostd::shared_ptr -CreateAsyncDoubleMetricDbClientConnectionPendingRequests(metrics::Meter *meter) -{ - return meter->CreateDoubleObservableUpDownCounter(kMetricDbClientConnectionPendingRequests, - descrMetricDbClientConnectionPendingRequests, - unitMetricDbClientConnectionPendingRequests); -} - -/** - * The number of connection timeouts that have occurred trying to obtain a connection from the pool - *

- * counter - */ -static constexpr const char *kMetricDbClientConnectionTimeouts = "db.client.connection.timeouts"; -static constexpr const char *descrMetricDbClientConnectionTimeouts = - "The number of connection timeouts that have occurred trying to obtain a connection from the " - "pool"; -static constexpr const char *unitMetricDbClientConnectionTimeouts = "{timeout}"; - -static inline nostd::unique_ptr> -CreateSyncInt64MetricDbClientConnectionTimeouts(metrics::Meter *meter) -{ - return meter->CreateUInt64Counter(kMetricDbClientConnectionTimeouts, - descrMetricDbClientConnectionTimeouts, - unitMetricDbClientConnectionTimeouts); -} - -static inline nostd::unique_ptr> -CreateSyncDoubleMetricDbClientConnectionTimeouts(metrics::Meter *meter) -{ - return meter->CreateDoubleCounter(kMetricDbClientConnectionTimeouts, - descrMetricDbClientConnectionTimeouts, - unitMetricDbClientConnectionTimeouts); -} - -static inline nostd::shared_ptr -CreateAsyncInt64MetricDbClientConnectionTimeouts(metrics::Meter *meter) -{ - return meter->CreateInt64ObservableCounter(kMetricDbClientConnectionTimeouts, - descrMetricDbClientConnectionTimeouts, - unitMetricDbClientConnectionTimeouts); -} - -static inline nostd::shared_ptr -CreateAsyncDoubleMetricDbClientConnectionTimeouts(metrics::Meter *meter) -{ - return meter->CreateDoubleObservableCounter(kMetricDbClientConnectionTimeouts, - descrMetricDbClientConnectionTimeouts, - unitMetricDbClientConnectionTimeouts); -} - -/** - * The time between borrowing a connection and returning it to the pool - *

- * histogram - */ -static constexpr const char *kMetricDbClientConnectionUseTime = "db.client.connection.use_time"; -static constexpr const char *descrMetricDbClientConnectionUseTime = - "The time between borrowing a connection and returning it to the pool"; -static constexpr const char *unitMetricDbClientConnectionUseTime = "s"; - -static inline nostd::unique_ptr> -CreateSyncInt64MetricDbClientConnectionUseTime(metrics::Meter *meter) -{ - return meter->CreateUInt64Histogram(kMetricDbClientConnectionUseTime, - descrMetricDbClientConnectionUseTime, - unitMetricDbClientConnectionUseTime); -} - -static inline nostd::unique_ptr> -CreateSyncDoubleMetricDbClientConnectionUseTime(metrics::Meter *meter) -{ - return meter->CreateDoubleHistogram(kMetricDbClientConnectionUseTime, - descrMetricDbClientConnectionUseTime, - unitMetricDbClientConnectionUseTime); -} - -/** - * The time it took to obtain an open connection from the pool - *

- * histogram - */ -static constexpr const char *kMetricDbClientConnectionWaitTime = "db.client.connection.wait_time"; -static constexpr const char *descrMetricDbClientConnectionWaitTime = - "The time it took to obtain an open connection from the pool"; -static constexpr const char *unitMetricDbClientConnectionWaitTime = "s"; - -static inline nostd::unique_ptr> -CreateSyncInt64MetricDbClientConnectionWaitTime(metrics::Meter *meter) -{ - return meter->CreateUInt64Histogram(kMetricDbClientConnectionWaitTime, - descrMetricDbClientConnectionWaitTime, - unitMetricDbClientConnectionWaitTime); -} - -static inline nostd::unique_ptr> -CreateSyncDoubleMetricDbClientConnectionWaitTime(metrics::Meter *meter) -{ - return meter->CreateDoubleHistogram(kMetricDbClientConnectionWaitTime, - descrMetricDbClientConnectionWaitTime, - unitMetricDbClientConnectionWaitTime); -} - -/** - * Deprecated, use @code db.client.connection.create_time @endcode instead. Note: the unit also - * changed from @code ms @endcode to @code s @endcode. - * - * @deprecated - * {"note": "Replaced by @code db.client.connection.create_time @endcode. Note: the unit also - * changed from @code ms @endcode to @code s @endcode.", "reason": "uncategorized"}

histogram - */ -OPENTELEMETRY_DEPRECATED static constexpr const char *kMetricDbClientConnectionsCreateTime = - "db.client.connections.create_time"; -OPENTELEMETRY_DEPRECATED static constexpr const char *descrMetricDbClientConnectionsCreateTime = - "Deprecated, use `db.client.connection.create_time` instead. Note: the unit also changed from " - "`ms` to `s`."; -OPENTELEMETRY_DEPRECATED static constexpr const char *unitMetricDbClientConnectionsCreateTime = - "ms"; - -OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> -CreateSyncInt64MetricDbClientConnectionsCreateTime(metrics::Meter *meter) -{ - return meter->CreateUInt64Histogram(kMetricDbClientConnectionsCreateTime, - descrMetricDbClientConnectionsCreateTime, - unitMetricDbClientConnectionsCreateTime); -} - -OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> -CreateSyncDoubleMetricDbClientConnectionsCreateTime(metrics::Meter *meter) -{ - return meter->CreateDoubleHistogram(kMetricDbClientConnectionsCreateTime, - descrMetricDbClientConnectionsCreateTime, - unitMetricDbClientConnectionsCreateTime); -} - -/** - * Deprecated, use @code db.client.connection.idle.max @endcode instead. - * - * @deprecated - * {"note": "Replaced by @code db.client.connection.idle.max @endcode.", "reason": "uncategorized"} - *

- * updowncounter - */ -OPENTELEMETRY_DEPRECATED static constexpr const char *kMetricDbClientConnectionsIdleMax = - "db.client.connections.idle.max"; -OPENTELEMETRY_DEPRECATED static constexpr const char *descrMetricDbClientConnectionsIdleMax = - "Deprecated, use `db.client.connection.idle.max` instead."; -OPENTELEMETRY_DEPRECATED static constexpr const char *unitMetricDbClientConnectionsIdleMax = - "{connection}"; - -OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> -CreateSyncInt64MetricDbClientConnectionsIdleMax(metrics::Meter *meter) -{ - return meter->CreateInt64UpDownCounter(kMetricDbClientConnectionsIdleMax, - descrMetricDbClientConnectionsIdleMax, - unitMetricDbClientConnectionsIdleMax); -} - -OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> -CreateSyncDoubleMetricDbClientConnectionsIdleMax(metrics::Meter *meter) -{ - return meter->CreateDoubleUpDownCounter(kMetricDbClientConnectionsIdleMax, - descrMetricDbClientConnectionsIdleMax, - unitMetricDbClientConnectionsIdleMax); -} - -OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr -CreateAsyncInt64MetricDbClientConnectionsIdleMax(metrics::Meter *meter) -{ - return meter->CreateInt64ObservableUpDownCounter(kMetricDbClientConnectionsIdleMax, - descrMetricDbClientConnectionsIdleMax, - unitMetricDbClientConnectionsIdleMax); -} - -OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr -CreateAsyncDoubleMetricDbClientConnectionsIdleMax(metrics::Meter *meter) -{ - return meter->CreateDoubleObservableUpDownCounter(kMetricDbClientConnectionsIdleMax, - descrMetricDbClientConnectionsIdleMax, - unitMetricDbClientConnectionsIdleMax); -} - -/** - * Deprecated, use @code db.client.connection.idle.min @endcode instead. - * - * @deprecated - * {"note": "Replaced by @code db.client.connection.idle.min @endcode.", "reason": "uncategorized"} - *

- * updowncounter - */ -OPENTELEMETRY_DEPRECATED static constexpr const char *kMetricDbClientConnectionsIdleMin = - "db.client.connections.idle.min"; -OPENTELEMETRY_DEPRECATED static constexpr const char *descrMetricDbClientConnectionsIdleMin = - "Deprecated, use `db.client.connection.idle.min` instead."; -OPENTELEMETRY_DEPRECATED static constexpr const char *unitMetricDbClientConnectionsIdleMin = - "{connection}"; - -OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> -CreateSyncInt64MetricDbClientConnectionsIdleMin(metrics::Meter *meter) -{ - return meter->CreateInt64UpDownCounter(kMetricDbClientConnectionsIdleMin, - descrMetricDbClientConnectionsIdleMin, - unitMetricDbClientConnectionsIdleMin); -} - -OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> -CreateSyncDoubleMetricDbClientConnectionsIdleMin(metrics::Meter *meter) -{ - return meter->CreateDoubleUpDownCounter(kMetricDbClientConnectionsIdleMin, - descrMetricDbClientConnectionsIdleMin, - unitMetricDbClientConnectionsIdleMin); -} - -OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr -CreateAsyncInt64MetricDbClientConnectionsIdleMin(metrics::Meter *meter) -{ - return meter->CreateInt64ObservableUpDownCounter(kMetricDbClientConnectionsIdleMin, - descrMetricDbClientConnectionsIdleMin, - unitMetricDbClientConnectionsIdleMin); -} - -OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr -CreateAsyncDoubleMetricDbClientConnectionsIdleMin(metrics::Meter *meter) -{ - return meter->CreateDoubleObservableUpDownCounter(kMetricDbClientConnectionsIdleMin, - descrMetricDbClientConnectionsIdleMin, - unitMetricDbClientConnectionsIdleMin); -} - -/** - * Deprecated, use @code db.client.connection.max @endcode instead. - * - * @deprecated - * {"note": "Replaced by @code db.client.connection.max @endcode.", "reason": "uncategorized"} - *

- * updowncounter - */ -OPENTELEMETRY_DEPRECATED static constexpr const char *kMetricDbClientConnectionsMax = - "db.client.connections.max"; -OPENTELEMETRY_DEPRECATED static constexpr const char *descrMetricDbClientConnectionsMax = - "Deprecated, use `db.client.connection.max` instead."; -OPENTELEMETRY_DEPRECATED static constexpr const char *unitMetricDbClientConnectionsMax = - "{connection}"; - -OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> -CreateSyncInt64MetricDbClientConnectionsMax(metrics::Meter *meter) -{ - return meter->CreateInt64UpDownCounter(kMetricDbClientConnectionsMax, - descrMetricDbClientConnectionsMax, - unitMetricDbClientConnectionsMax); -} - -OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> -CreateSyncDoubleMetricDbClientConnectionsMax(metrics::Meter *meter) -{ - return meter->CreateDoubleUpDownCounter(kMetricDbClientConnectionsMax, - descrMetricDbClientConnectionsMax, - unitMetricDbClientConnectionsMax); -} - -OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr -CreateAsyncInt64MetricDbClientConnectionsMax(metrics::Meter *meter) -{ - return meter->CreateInt64ObservableUpDownCounter(kMetricDbClientConnectionsMax, - descrMetricDbClientConnectionsMax, - unitMetricDbClientConnectionsMax); -} - -OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr -CreateAsyncDoubleMetricDbClientConnectionsMax(metrics::Meter *meter) -{ - return meter->CreateDoubleObservableUpDownCounter(kMetricDbClientConnectionsMax, - descrMetricDbClientConnectionsMax, - unitMetricDbClientConnectionsMax); -} - -/** - * Deprecated, use @code db.client.connection.pending_requests @endcode instead. - * - * @deprecated - * {"note": "Replaced by @code db.client.connection.pending_requests @endcode.", "reason": - * "uncategorized"}

updowncounter - */ -OPENTELEMETRY_DEPRECATED static constexpr const char *kMetricDbClientConnectionsPendingRequests = - "db.client.connections.pending_requests"; -OPENTELEMETRY_DEPRECATED static constexpr const char - *descrMetricDbClientConnectionsPendingRequests = - "Deprecated, use `db.client.connection.pending_requests` instead."; -OPENTELEMETRY_DEPRECATED static constexpr const char *unitMetricDbClientConnectionsPendingRequests = - "{request}"; - -OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> -CreateSyncInt64MetricDbClientConnectionsPendingRequests(metrics::Meter *meter) -{ - return meter->CreateInt64UpDownCounter(kMetricDbClientConnectionsPendingRequests, - descrMetricDbClientConnectionsPendingRequests, - unitMetricDbClientConnectionsPendingRequests); -} - -OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> -CreateSyncDoubleMetricDbClientConnectionsPendingRequests(metrics::Meter *meter) -{ - return meter->CreateDoubleUpDownCounter(kMetricDbClientConnectionsPendingRequests, - descrMetricDbClientConnectionsPendingRequests, - unitMetricDbClientConnectionsPendingRequests); -} - -OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr -CreateAsyncInt64MetricDbClientConnectionsPendingRequests(metrics::Meter *meter) -{ - return meter->CreateInt64ObservableUpDownCounter(kMetricDbClientConnectionsPendingRequests, - descrMetricDbClientConnectionsPendingRequests, - unitMetricDbClientConnectionsPendingRequests); -} - -OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr -CreateAsyncDoubleMetricDbClientConnectionsPendingRequests(metrics::Meter *meter) -{ - return meter->CreateDoubleObservableUpDownCounter(kMetricDbClientConnectionsPendingRequests, - descrMetricDbClientConnectionsPendingRequests, - unitMetricDbClientConnectionsPendingRequests); -} - -/** - * Deprecated, use @code db.client.connection.timeouts @endcode instead. - * - * @deprecated - * {"note": "Replaced by @code db.client.connection.timeouts @endcode.", "reason": "uncategorized"} - *

- * counter - */ -OPENTELEMETRY_DEPRECATED static constexpr const char *kMetricDbClientConnectionsTimeouts = - "db.client.connections.timeouts"; -OPENTELEMETRY_DEPRECATED static constexpr const char *descrMetricDbClientConnectionsTimeouts = - "Deprecated, use `db.client.connection.timeouts` instead."; -OPENTELEMETRY_DEPRECATED static constexpr const char *unitMetricDbClientConnectionsTimeouts = - "{timeout}"; - -OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> -CreateSyncInt64MetricDbClientConnectionsTimeouts(metrics::Meter *meter) -{ - return meter->CreateUInt64Counter(kMetricDbClientConnectionsTimeouts, - descrMetricDbClientConnectionsTimeouts, - unitMetricDbClientConnectionsTimeouts); -} - -OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> -CreateSyncDoubleMetricDbClientConnectionsTimeouts(metrics::Meter *meter) -{ - return meter->CreateDoubleCounter(kMetricDbClientConnectionsTimeouts, - descrMetricDbClientConnectionsTimeouts, - unitMetricDbClientConnectionsTimeouts); -} - -OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr -CreateAsyncInt64MetricDbClientConnectionsTimeouts(metrics::Meter *meter) -{ - return meter->CreateInt64ObservableCounter(kMetricDbClientConnectionsTimeouts, - descrMetricDbClientConnectionsTimeouts, - unitMetricDbClientConnectionsTimeouts); -} - -OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr -CreateAsyncDoubleMetricDbClientConnectionsTimeouts(metrics::Meter *meter) -{ - return meter->CreateDoubleObservableCounter(kMetricDbClientConnectionsTimeouts, - descrMetricDbClientConnectionsTimeouts, - unitMetricDbClientConnectionsTimeouts); -} - -/** - * Deprecated, use @code db.client.connection.count @endcode instead. - * - * @deprecated - * {"note": "Replaced by @code db.client.connection.count @endcode.", "reason": "uncategorized"} - *

- * updowncounter - */ -OPENTELEMETRY_DEPRECATED static constexpr const char *kMetricDbClientConnectionsUsage = - "db.client.connections.usage"; -OPENTELEMETRY_DEPRECATED static constexpr const char *descrMetricDbClientConnectionsUsage = - "Deprecated, use `db.client.connection.count` instead."; -OPENTELEMETRY_DEPRECATED static constexpr const char *unitMetricDbClientConnectionsUsage = - "{connection}"; - -OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> -CreateSyncInt64MetricDbClientConnectionsUsage(metrics::Meter *meter) -{ - return meter->CreateInt64UpDownCounter(kMetricDbClientConnectionsUsage, - descrMetricDbClientConnectionsUsage, - unitMetricDbClientConnectionsUsage); -} - -OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> -CreateSyncDoubleMetricDbClientConnectionsUsage(metrics::Meter *meter) -{ - return meter->CreateDoubleUpDownCounter(kMetricDbClientConnectionsUsage, - descrMetricDbClientConnectionsUsage, - unitMetricDbClientConnectionsUsage); -} - -OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr -CreateAsyncInt64MetricDbClientConnectionsUsage(metrics::Meter *meter) -{ - return meter->CreateInt64ObservableUpDownCounter(kMetricDbClientConnectionsUsage, - descrMetricDbClientConnectionsUsage, - unitMetricDbClientConnectionsUsage); -} - -OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr -CreateAsyncDoubleMetricDbClientConnectionsUsage(metrics::Meter *meter) -{ - return meter->CreateDoubleObservableUpDownCounter(kMetricDbClientConnectionsUsage, - descrMetricDbClientConnectionsUsage, - unitMetricDbClientConnectionsUsage); -} - -/** - * Deprecated, use @code db.client.connection.use_time @endcode instead. Note: the unit also changed - * from @code ms @endcode to @code s @endcode. - * - * @deprecated - * {"note": "Replaced by @code db.client.connection.use_time @endcode. Note: the unit also changed - * from @code ms @endcode to @code s @endcode.", "reason": "uncategorized"}

histogram - */ -OPENTELEMETRY_DEPRECATED static constexpr const char *kMetricDbClientConnectionsUseTime = - "db.client.connections.use_time"; -OPENTELEMETRY_DEPRECATED static constexpr const char *descrMetricDbClientConnectionsUseTime = - "Deprecated, use `db.client.connection.use_time` instead. Note: the unit also changed from " - "`ms` to `s`."; -OPENTELEMETRY_DEPRECATED static constexpr const char *unitMetricDbClientConnectionsUseTime = "ms"; - -OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> -CreateSyncInt64MetricDbClientConnectionsUseTime(metrics::Meter *meter) -{ - return meter->CreateUInt64Histogram(kMetricDbClientConnectionsUseTime, - descrMetricDbClientConnectionsUseTime, - unitMetricDbClientConnectionsUseTime); -} - -OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> -CreateSyncDoubleMetricDbClientConnectionsUseTime(metrics::Meter *meter) -{ - return meter->CreateDoubleHistogram(kMetricDbClientConnectionsUseTime, - descrMetricDbClientConnectionsUseTime, - unitMetricDbClientConnectionsUseTime); -} - -/** - * Deprecated, use @code db.client.connection.wait_time @endcode instead. Note: the unit also - * changed from @code ms @endcode to @code s @endcode. - * - * @deprecated - * {"note": "Replaced by @code db.client.connection.wait_time @endcode. Note: the unit also changed - * from @code ms @endcode to @code s @endcode.", "reason": "uncategorized"}

histogram - */ -OPENTELEMETRY_DEPRECATED static constexpr const char *kMetricDbClientConnectionsWaitTime = - "db.client.connections.wait_time"; -OPENTELEMETRY_DEPRECATED static constexpr const char *descrMetricDbClientConnectionsWaitTime = - "Deprecated, use `db.client.connection.wait_time` instead. Note: the unit also changed from " - "`ms` to `s`."; -OPENTELEMETRY_DEPRECATED static constexpr const char *unitMetricDbClientConnectionsWaitTime = "ms"; - -OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> -CreateSyncInt64MetricDbClientConnectionsWaitTime(metrics::Meter *meter) -{ - return meter->CreateUInt64Histogram(kMetricDbClientConnectionsWaitTime, - descrMetricDbClientConnectionsWaitTime, - unitMetricDbClientConnectionsWaitTime); -} - -OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> -CreateSyncDoubleMetricDbClientConnectionsWaitTime(metrics::Meter *meter) -{ - return meter->CreateDoubleHistogram(kMetricDbClientConnectionsWaitTime, - descrMetricDbClientConnectionsWaitTime, - unitMetricDbClientConnectionsWaitTime); -} - -/** - * Deprecated, use @code azure.cosmosdb.client.active_instance.count @endcode instead. - * - * @deprecated - * {"note": "Replaced by @code azure.cosmosdb.client.active_instance.count @endcode.", "reason": - * "uncategorized"}

updowncounter - */ -OPENTELEMETRY_DEPRECATED static constexpr const char *kMetricDbClientCosmosdbActiveInstanceCount = - "db.client.cosmosdb.active_instance.count"; -OPENTELEMETRY_DEPRECATED static constexpr const char - *descrMetricDbClientCosmosdbActiveInstanceCount = - "Deprecated, use `azure.cosmosdb.client.active_instance.count` instead."; -OPENTELEMETRY_DEPRECATED static constexpr const char - *unitMetricDbClientCosmosdbActiveInstanceCount = "{instance}"; - -OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> -CreateSyncInt64MetricDbClientCosmosdbActiveInstanceCount(metrics::Meter *meter) -{ - return meter->CreateInt64UpDownCounter(kMetricDbClientCosmosdbActiveInstanceCount, - descrMetricDbClientCosmosdbActiveInstanceCount, - unitMetricDbClientCosmosdbActiveInstanceCount); -} - -OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> -CreateSyncDoubleMetricDbClientCosmosdbActiveInstanceCount(metrics::Meter *meter) -{ - return meter->CreateDoubleUpDownCounter(kMetricDbClientCosmosdbActiveInstanceCount, - descrMetricDbClientCosmosdbActiveInstanceCount, - unitMetricDbClientCosmosdbActiveInstanceCount); -} - -OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr -CreateAsyncInt64MetricDbClientCosmosdbActiveInstanceCount(metrics::Meter *meter) -{ - return meter->CreateInt64ObservableUpDownCounter(kMetricDbClientCosmosdbActiveInstanceCount, - descrMetricDbClientCosmosdbActiveInstanceCount, - unitMetricDbClientCosmosdbActiveInstanceCount); -} - -OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr -CreateAsyncDoubleMetricDbClientCosmosdbActiveInstanceCount(metrics::Meter *meter) -{ - return meter->CreateDoubleObservableUpDownCounter(kMetricDbClientCosmosdbActiveInstanceCount, - descrMetricDbClientCosmosdbActiveInstanceCount, - unitMetricDbClientCosmosdbActiveInstanceCount); -} - -/** - * Deprecated, use @code azure.cosmosdb.client.operation.request_charge @endcode instead. - * - * @deprecated - * {"note": "Replaced by @code azure.cosmosdb.client.operation.request_charge @endcode.", "reason": - * "uncategorized"}

histogram - */ -OPENTELEMETRY_DEPRECATED static constexpr const char - *kMetricDbClientCosmosdbOperationRequestCharge = "db.client.cosmosdb.operation.request_charge"; -OPENTELEMETRY_DEPRECATED static constexpr const char - *descrMetricDbClientCosmosdbOperationRequestCharge = - "Deprecated, use `azure.cosmosdb.client.operation.request_charge` instead."; -OPENTELEMETRY_DEPRECATED static constexpr const char - *unitMetricDbClientCosmosdbOperationRequestCharge = "{request_unit}"; - -OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> -CreateSyncInt64MetricDbClientCosmosdbOperationRequestCharge(metrics::Meter *meter) -{ - return meter->CreateUInt64Histogram(kMetricDbClientCosmosdbOperationRequestCharge, - descrMetricDbClientCosmosdbOperationRequestCharge, - unitMetricDbClientCosmosdbOperationRequestCharge); -} - -OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> -CreateSyncDoubleMetricDbClientCosmosdbOperationRequestCharge(metrics::Meter *meter) -{ - return meter->CreateDoubleHistogram(kMetricDbClientCosmosdbOperationRequestCharge, - descrMetricDbClientCosmosdbOperationRequestCharge, - unitMetricDbClientCosmosdbOperationRequestCharge); -} - /** * Duration of database client operations. *

@@ -834,33 +48,6 @@ CreateSyncDoubleMetricDbClientOperationDuration(metrics::Meter *meter) unitMetricDbClientOperationDuration); } -/** - * The actual number of records returned by the database operation. - *

- * histogram - */ -static constexpr const char *kMetricDbClientResponseReturnedRows = - "db.client.response.returned_rows"; -static constexpr const char *descrMetricDbClientResponseReturnedRows = - "The actual number of records returned by the database operation."; -static constexpr const char *unitMetricDbClientResponseReturnedRows = "{row}"; - -static inline nostd::unique_ptr> -CreateSyncInt64MetricDbClientResponseReturnedRows(metrics::Meter *meter) -{ - return meter->CreateUInt64Histogram(kMetricDbClientResponseReturnedRows, - descrMetricDbClientResponseReturnedRows, - unitMetricDbClientResponseReturnedRows); -} - -static inline nostd::unique_ptr> -CreateSyncDoubleMetricDbClientResponseReturnedRows(metrics::Meter *meter) -{ - return meter->CreateDoubleHistogram(kMetricDbClientResponseReturnedRows, - descrMetricDbClientResponseReturnedRows, - unitMetricDbClientResponseReturnedRows); -} - } // namespace db } // namespace semconv OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/http_attributes.h b/api/include/opentelemetry/semconv/http_attributes.h index 6011674e84..c159eaec40 100644 --- a/api/include/opentelemetry/semconv/http_attributes.h +++ b/api/include/opentelemetry/semconv/http_attributes.h @@ -23,12 +23,18 @@ namespace http * HTTP request headers, @code @endcode being the normalized HTTP Header name (lowercase), the * value being the header values.

Instrumentations SHOULD require an explicit configuration of * which headers are to be captured. Including all request headers can be a security risk - explicit - * configuration helps avoid leaking sensitive information. The @code User-Agent @endcode header is - * already captured in the @code user_agent.original @endcode attribute. Users MAY explicitly - * configure instrumentations to capture them even though it is not recommended. The attribute value - * MUST consist of either multiple header values as an array of strings or a single-item array + * configuration helps avoid leaking sensitive information.

The @code User-Agent @endcode header + * is already captured in the @code user_agent.original @endcode attribute. Users MAY explicitly + * configure instrumentations to capture them even though it is not recommended.

The attribute + * value MUST consist of either multiple header values as an array of strings or a single-item array * containing a possibly comma-concatenated string, depending on the way the HTTP library provides - * access to headers. + * access to headers.

Examples:

*/ static constexpr const char *kHttpRequestHeader = "http.request.header"; @@ -72,11 +78,17 @@ static constexpr const char *kHttpRequestResendCount = "http.request.resend_coun * HTTP response headers, @code @endcode being the normalized HTTP Header name (lowercase), * the value being the header values.

Instrumentations SHOULD require an explicit configuration * of which headers are to be captured. Including all response headers can be a security risk - - * explicit configuration helps avoid leaking sensitive information. Users MAY explicitly configure - * instrumentations to capture them even though it is not recommended. The attribute value MUST - * consist of either multiple header values as an array of strings or a single-item array containing - * a possibly comma-concatenated string, depending on the way the HTTP library provides access to - * headers. + * explicit configuration helps avoid leaking sensitive information.

Users MAY explicitly + * configure instrumentations to capture them even though it is not recommended.

The attribute + * value MUST consist of either multiple header values as an array of strings or a single-item array + * containing a possibly comma-concatenated string, depending on the way the HTTP library provides + * access to headers.

Examples:

  • A header @code Content-Type: application/json @endcode + * header SHOULD be recorded as the @code http.request.response.content-type @endcode attribute with + * value @code ["application/json"] @endcode.
  • A header @code My-custom-header: abc, def + * @endcode header SHOULD be recorded as the @code http.response.header.my-custom-header @endcode + * attribute with value @code ["abc", "def"] @endcode or @code ["abc, def"] @endcode depending on + * the HTTP library.
  • + *
*/ static constexpr const char *kHttpResponseHeader = "http.response.header"; diff --git a/api/include/opentelemetry/semconv/incubating/app_attributes.h b/api/include/opentelemetry/semconv/incubating/app_attributes.h index 1731b460c5..8449d5d220 100644 --- a/api/include/opentelemetry/semconv/incubating/app_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/app_attributes.h @@ -47,6 +47,29 @@ namespace app */ static constexpr const char *kAppInstallationId = "app.installation.id"; +/** + * The x (horizontal) coordinate of a screen coordinate, in screen pixels. + */ +static constexpr const char *kAppScreenCoordinateX = "app.screen.coordinate.x"; + +/** + * The y (vertical) component of a screen coordinate, in screen pixels. + */ +static constexpr const char *kAppScreenCoordinateY = "app.screen.coordinate.y"; + +/** + * An identifier that uniquely differentiates this widget from other widgets in the same + * application.

A widget is an application component, typically an on-screen visual GUI element. + */ +static constexpr const char *kAppWidgetId = "app.widget.id"; + +/** + * The name of an application widget. + *

+ * A widget is an application component, typically an on-screen visual GUI element. + */ +static constexpr const char *kAppWidgetName = "app.widget.name"; + } // namespace app } // namespace semconv OPENTELEMETRY_END_NAMESPACE diff --git a/api/include/opentelemetry/semconv/incubating/cicd_attributes.h b/api/include/opentelemetry/semconv/incubating/cicd_attributes.h index 7014d45980..c199a572e8 100644 --- a/api/include/opentelemetry/semconv/incubating/cicd_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/cicd_attributes.h @@ -19,6 +19,11 @@ namespace semconv namespace cicd { +/** + * The kind of action a pipeline run is performing. + */ +static constexpr const char *kCicdPipelineActionName = "cicd.pipeline.action.name"; + /** * The human readable name of the pipeline within a CI/CD system. */ @@ -57,6 +62,11 @@ static constexpr const char *kCicdPipelineTaskName = "cicd.pipeline.task.name"; */ static constexpr const char *kCicdPipelineTaskRunId = "cicd.pipeline.task.run.id"; +/** + * The result of a task run. + */ +static constexpr const char *kCicdPipelineTaskRunResult = "cicd.pipeline.task.run.result"; + /** * The URL of the pipeline task run, providing the * complete address in order to locate and identify the pipeline task run. @@ -73,11 +83,46 @@ static constexpr const char *kCicdPipelineTaskType = "cicd.pipeline.task.type"; */ static constexpr const char *kCicdSystemComponent = "cicd.system.component"; +/** + * The unique identifier of a worker within a CICD system. + */ +static constexpr const char *kCicdWorkerId = "cicd.worker.id"; + +/** + * The name of a worker within a CICD system. + */ +static constexpr const char *kCicdWorkerName = "cicd.worker.name"; + /** * The state of a CICD worker / agent. */ static constexpr const char *kCicdWorkerState = "cicd.worker.state"; +/** + * The URL of the worker, providing the complete + * address in order to locate and identify the worker. + */ +static constexpr const char *kCicdWorkerUrlFull = "cicd.worker.url.full"; + +namespace CicdPipelineActionNameValues +{ +/** + * The pipeline run is executing a build. + */ +static constexpr const char *kBuild = "BUILD"; + +/** + * The pipeline run is executing. + */ +static constexpr const char *kRun = "RUN"; + +/** + * The pipeline run is executing a sync. + */ +static constexpr const char *kSync = "SYNC"; + +} // namespace CicdPipelineActionNameValues + namespace CicdPipelineResultValues { /** @@ -134,6 +179,41 @@ static constexpr const char *kFinalizing = "finalizing"; } // namespace CicdPipelineRunStateValues +namespace CicdPipelineTaskRunResultValues +{ +/** + * The task run finished successfully. + */ +static constexpr const char *kSuccess = "success"; + +/** + * The task run did not finish successfully, eg. due to a compile error or a failing test. Such + * failures are usually detected by non-zero exit codes of the tools executed in the task run. + */ +static constexpr const char *kFailure = "failure"; + +/** + * The task run failed due to an error in the CICD system, eg. due to the worker being killed. + */ +static constexpr const char *kError = "error"; + +/** + * A timeout caused the task run to be interrupted. + */ +static constexpr const char *kTimeout = "timeout"; + +/** + * The task run was cancelled, eg. by a user manually cancelling the task run. + */ +static constexpr const char *kCancellation = "cancellation"; + +/** + * The task run was skipped, eg. due to a precondition not being met. + */ +static constexpr const char *kSkip = "skip"; + +} // namespace CicdPipelineTaskRunResultValues + namespace CicdPipelineTaskTypeValues { /** diff --git a/api/include/opentelemetry/semconv/incubating/code_attributes.h b/api/include/opentelemetry/semconv/incubating/code_attributes.h index 42845241c0..e0ea145aa7 100644 --- a/api/include/opentelemetry/semconv/incubating/code_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/code_attributes.h @@ -29,13 +29,17 @@ OPENTELEMETRY_DEPRECATED static constexpr const char *kCodeColumn = "code.column /** * 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. + * 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). + * 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"; @@ -58,7 +62,9 @@ OPENTELEMETRY_DEPRECATED static constexpr const char *kCodeFunction = "code.func /** * 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.

Values and format depends on each language runtime, + * 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. @@ -78,7 +84,9 @@ 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. + * 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"; @@ -103,7 +111,9 @@ OPENTELEMETRY_DEPRECATED static constexpr const char *kCodeNamespace = "code.nam * A stacktrace as a string in the natural representation for the language runtime. The * representation is identical to @code exception.stacktrace - * @endcode. + * @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"; diff --git a/api/include/opentelemetry/semconv/incubating/container_attributes.h b/api/include/opentelemetry/semconv/incubating/container_attributes.h index 87b5150f91..76a547c4fa 100644 --- a/api/include/opentelemetry/semconv/incubating/container_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/container_attributes.h @@ -108,6 +108,10 @@ static constexpr const char *kContainerImageTags = "container.image.tags"; /** * Container labels, @code @endcode being the label name, the value being the label value. + *

+ * For example, a docker container label @code app @endcode with value @code nginx @endcode SHOULD + * be recorded as the @code container.label.app @endcode attribute with value @code "nginx" + * @endcode. */ static constexpr const char *kContainerLabel = "container.label"; diff --git a/api/include/opentelemetry/semconv/incubating/db_attributes.h b/api/include/opentelemetry/semconv/incubating/db_attributes.h index e14dcd5a8a..2bfa3cfb49 100644 --- a/api/include/opentelemetry/semconv/incubating/db_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/db_attributes.h @@ -122,7 +122,8 @@ OPENTELEMETRY_DEPRECATED static constexpr const char *kDbClientConnectionsState * 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 cross-table queries in non-batch operations. + * 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. @@ -308,10 +309,9 @@ OPENTELEMETRY_DEPRECATED static constexpr const char *kDbName = "db.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 (potentially - * using database system specific conventions) from most general to most specific namespace - * component, and more specific namespaces SHOULD NOT be captured without the more general - * namespaces, to ensure that "startswith" queries for the more general namespaces will be valid. + * 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. @@ -341,7 +341,8 @@ static constexpr const char *kDbOperationBatchSize = "db.operation.batch.size"; * 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 cross-table queries in non-batch operations. + * 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. @@ -355,33 +356,47 @@ static constexpr const char *kDbOperationName = "db.operation.name"; /** * A database operation parameter, with @code @endcode being the parameter name, and the - * attribute value being a string representation of the parameter value.

If a parameter has no - * name and instead is referenced only by index, then @code @endcode SHOULD be the 0-based - * index. If @code db.query.text @endcode is also captured, then @code db.operation.parameter. - * @endcode SHOULD match up with the parameterized placeholders present in @code db.query.text - * @endcode. - * @code db.operation.parameter. @endcode SHOULD NOT be captured on batch operations. + * attribute value being a string representation of the parameter value.

For example, a + * client-side maximum number of rows to read from the database MAY be recorded as the @code + * db.operation.parameter.max_rows @endcode attribute.

+ * @code db.query.text @endcode parameters SHOULD be captured using @code db.query.parameter. + * @endcode instead of @code db.operation.parameter. @endcode. */ static constexpr const char *kDbOperationParameter = "db.operation.parameter"; /** - * A query parameter used in @code db.query.text @endcode, with @code @endcode being the - * parameter name, and the attribute value being a string representation of the parameter value. - * - * @deprecated - * {"note": "Replaced by @code db.operation.parameter @endcode.", "reason": "uncategorized"} + * A database query parameter, with @code @endcode being the parameter name, and the attribute + * value being a string representation of the parameter value.

If a query parameter has no name + * and instead is referenced only by index, then @code @endcode SHOULD be the 0-based index. + *

+ * @code db.query.parameter. @endcode SHOULD match + * up with the parameterized placeholders present in @code db.query.text @endcode. + *

+ * @code db.query.parameter. @endcode SHOULD NOT be captured on batch operations. + *

+ * Examples: + *

    + *
  • For a query @code SELECT * FROM users where username = %s @endcode with the parameter + * @code "jdoe" @endcode, the attribute @code db.query.parameter.0 @endcode SHOULD be set to @code + * "jdoe" @endcode.
  • For a query @code "SELECT * FROM users WHERE username = %(username)s; + * @endcode with parameter + * @code username = "jdoe" @endcode, the attribute @code db.query.parameter.username @endcode SHOULD + * be set to @code "jdoe" @endcode.
  • + *
*/ -OPENTELEMETRY_DEPRECATED static constexpr const char *kDbQueryParameter = "db.query.parameter"; +static constexpr const char *kDbQueryParameter = "db.query.parameter"; /** - * Low cardinality representation of a database query text. + * 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. *

- * @code db.query.summary @endcode provides static summary of the query text. It 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 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"; @@ -390,14 +405,15 @@ static constexpr const char *kDbQuerySummary = "db.query.summary"; * The database query being executed. *

* For sanitization see Sanitization of @code + * href="/docs/database/database-spans.md#sanitization-of-dbquerytext">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. 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. + * 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"; @@ -846,7 +862,7 @@ static constexpr const char *kInstantdb = "instantdb"; static constexpr const char *kInterbase = "interbase"; /** - * MariaDB (This value has stability level RELEASE CANDIDATE) + * MariaDB */ static constexpr const char *kMariadb = "mariadb"; @@ -866,7 +882,7 @@ static constexpr const char *kMemcached = "memcached"; static constexpr const char *kMongodb = "mongodb"; /** - * Microsoft SQL Server (This value has stability level RELEASE CANDIDATE) + * Microsoft SQL Server */ static constexpr const char *kMssql = "mssql"; @@ -876,7 +892,7 @@ static constexpr const char *kMssql = "mssql"; static constexpr const char *kMssqlcompact = "mssqlcompact"; /** - * MySQL (This value has stability level RELEASE CANDIDATE) + * MySQL */ static constexpr const char *kMysql = "mysql"; @@ -911,7 +927,7 @@ static constexpr const char *kPervasive = "pervasive"; static constexpr const char *kPointbase = "pointbase"; /** - * PostgreSQL (This value has stability level RELEASE CANDIDATE) + * PostgreSQL */ static constexpr const char *kPostgresql = "postgresql"; diff --git a/api/include/opentelemetry/semconv/incubating/feature_flag_attributes.h b/api/include/opentelemetry/semconv/incubating/feature_flag_attributes.h index 56f2d0b522..dcdcbc3457 100644 --- a/api/include/opentelemetry/semconv/incubating/feature_flag_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/feature_flag_attributes.h @@ -25,9 +25,12 @@ namespace feature_flag static constexpr const char *kFeatureFlagContextId = "feature_flag.context.id"; /** - * A message explaining the nature of an error occurring during flag evaluation. + * Deprecated, use @code error.message @endcode instead. + * + * @deprecated + * {"note": "Replaced by @code error.message @endcode.", "reason": "uncategorized"} */ -static constexpr const char *kFeatureFlagEvaluationErrorMessage = +OPENTELEMETRY_DEPRECATED static constexpr const char *kFeatureFlagEvaluationErrorMessage = "feature_flag.evaluation.error.message"; /** @@ -47,7 +50,7 @@ static constexpr const char *kFeatureFlagKey = "feature_flag.key"; /** * Identifies the feature flag provider. */ -static constexpr const char *kFeatureFlagProviderName = "feature_flag.provider_name"; +static constexpr const char *kFeatureFlagProviderName = "feature_flag.provider.name"; /** * The reason code which shows how a feature flag value was determined. diff --git a/api/include/opentelemetry/semconv/incubating/gen_ai_attributes.h b/api/include/opentelemetry/semconv/incubating/gen_ai_attributes.h index a2acf23845..113e93f9d3 100644 --- a/api/include/opentelemetry/semconv/incubating/gen_ai_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/gen_ai_attributes.h @@ -204,6 +204,11 @@ static constexpr const char *kGenAiTokenType = "gen_ai.token.type"; */ static constexpr const char *kGenAiToolCallId = "gen_ai.tool.call.id"; +/** + * The tool description. + */ +static constexpr const char *kGenAiToolDescription = "gen_ai.tool.description"; + /** * Name of the tool utilized by the agent. */ @@ -293,6 +298,12 @@ namespace GenAiOperationNameValues */ static constexpr const char *kChat = "chat"; +/** + * Multimodal content generation operation such as Gemini Generate Content + */ +static constexpr const char *kGenerateContent = "generate_content"; + /** * Text completions operation such as OpenAI Completions API @@ -312,6 +323,11 @@ static constexpr const char *kEmbeddings = "embeddings"; */ static constexpr const char *kCreateAgent = "create_agent"; +/** + * Invoke GenAI agent + */ +static constexpr const char *kInvokeAgent = "invoke_agent"; + /** * Execute a tool */ @@ -350,6 +366,21 @@ namespace GenAiSystemValues */ static constexpr const char *kOpenai = "openai"; +/** + * Any Google generative AI endpoint + */ +static constexpr const char *kGcpGenAi = "gcp.gen_ai"; + +/** + * Vertex AI + */ +static constexpr const char *kGcpVertexAi = "gcp.vertex_ai"; + +/** + * Gemini + */ +static constexpr const char *kGcpGemini = "gcp.gemini"; + /** * Vertex AI */ diff --git a/api/include/opentelemetry/semconv/incubating/http_attributes.h b/api/include/opentelemetry/semconv/incubating/http_attributes.h index b83ebf12ed..a378738b93 100644 --- a/api/include/opentelemetry/semconv/incubating/http_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/http_attributes.h @@ -70,12 +70,18 @@ static constexpr const char *kHttpRequestBodySize = "http.request.body.size"; * HTTP request headers, @code @endcode being the normalized HTTP Header name (lowercase), the * value being the header values.

Instrumentations SHOULD require an explicit configuration of * which headers are to be captured. Including all request headers can be a security risk - explicit - * configuration helps avoid leaking sensitive information. The @code User-Agent @endcode header is - * already captured in the @code user_agent.original @endcode attribute. Users MAY explicitly - * configure instrumentations to capture them even though it is not recommended. The attribute value - * MUST consist of either multiple header values as an array of strings or a single-item array + * configuration helps avoid leaking sensitive information.

The @code User-Agent @endcode header + * is already captured in the @code user_agent.original @endcode attribute. Users MAY explicitly + * configure instrumentations to capture them even though it is not recommended.

The attribute + * value MUST consist of either multiple header values as an array of strings or a single-item array * containing a possibly comma-concatenated string, depending on the way the HTTP library provides - * access to headers. + * access to headers.

Examples:

*/ static constexpr const char *kHttpRequestHeader = "http.request.header"; @@ -152,11 +158,17 @@ static constexpr const char *kHttpResponseBodySize = "http.response.body.size"; * HTTP response headers, @code @endcode being the normalized HTTP Header name (lowercase), * the value being the header values.

Instrumentations SHOULD require an explicit configuration * of which headers are to be captured. Including all response headers can be a security risk - - * explicit configuration helps avoid leaking sensitive information. Users MAY explicitly configure - * instrumentations to capture them even though it is not recommended. The attribute value MUST - * consist of either multiple header values as an array of strings or a single-item array containing - * a possibly comma-concatenated string, depending on the way the HTTP library provides access to - * headers. + * explicit configuration helps avoid leaking sensitive information.

Users MAY explicitly + * configure instrumentations to capture them even though it is not recommended.

The attribute + * value MUST consist of either multiple header values as an array of strings or a single-item array + * containing a possibly comma-concatenated string, depending on the way the HTTP library provides + * access to headers.

Examples:

  • A header @code Content-Type: application/json @endcode + * header SHOULD be recorded as the @code http.request.response.content-type @endcode attribute with + * value @code ["application/json"] @endcode.
  • A header @code My-custom-header: abc, def + * @endcode header SHOULD be recorded as the @code http.response.header.my-custom-header @endcode + * attribute with value @code ["abc", "def"] @endcode or @code ["abc, def"] @endcode depending on + * the HTTP library.
  • + *
*/ static constexpr const char *kHttpResponseHeader = "http.response.header"; diff --git a/api/include/opentelemetry/semconv/incubating/k8s_attributes.h b/api/include/opentelemetry/semconv/incubating/k8s_attributes.h index 54f5a2a182..5a820d110d 100644 --- a/api/include/opentelemetry/semconv/incubating/k8s_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/k8s_attributes.h @@ -66,6 +66,28 @@ static constexpr const char *kK8sContainerRestartCount = "k8s.container.restart_ static constexpr const char *kK8sContainerStatusLastTerminatedReason = "k8s.container.status.last_terminated_reason"; +/** + * 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 + * with value @code 4 @endcode SHOULD be recorded as the + * @code k8s.cronjob.annotation.retries @endcode attribute with value @code "4" @endcode.
  • + *
  • An annotation @code data @endcode with empty string value SHOULD be recorded as + * the @code k8s.cronjob.annotation.data @endcode attribute with value @code "" @endcode.
  • + *
+ */ +static constexpr const char *kK8sCronjobAnnotation = "k8s.cronjob.annotation"; + +/** + * The label placed on the CronJob, the @code @endcode being the label name, the value being + * the label value.

Examples:

  • A label @code type @endcode with value @code weekly + * @endcode SHOULD be recorded as the + * @code k8s.cronjob.label.type @endcode attribute with value @code "weekly" @endcode.
  • + *
  • A label @code automated @endcode with empty string value SHOULD be recorded as + * the @code k8s.cronjob.label.automated @endcode attribute with value @code "" @endcode.
  • + *
+ */ +static constexpr const char *kK8sCronjobLabel = "k8s.cronjob.label"; + /** * The name of the CronJob. */ @@ -76,6 +98,22 @@ 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. + */ +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. + */ +static constexpr const char *kK8sDaemonsetLabel = "k8s.daemonset.label"; + /** * The name of the DaemonSet. */ @@ -86,6 +124,22 @@ 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. + */ +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. + */ +static constexpr const char *kK8sDeploymentLabel = "k8s.deployment.label"; + /** * The name of the Deployment. */ @@ -106,6 +160,22 @@ static constexpr const char *kK8sHpaName = "k8s.hpa.name"; */ 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. + */ +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. + */ +static constexpr const char *kK8sJobLabel = "k8s.job.label"; + /** * The name of the Job. */ @@ -116,6 +186,22 @@ 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. + */ +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. + */ +static constexpr const char *kK8sNamespaceLabel = "k8s.namespace.label"; + /** * The name of the namespace that the pod is running in. */ @@ -131,6 +217,28 @@ static constexpr const char *kK8sNamespaceName = "k8s.namespace.name"; */ static constexpr const char *kK8sNamespacePhase = "k8s.namespace.phase"; +/** + * The annotation placed on the Node, the @code @endcode being the annotation name, the value + * being the annotation value, even if the value is empty.

Examples:

  • An annotation + * @code node.alpha.kubernetes.io/ttl @endcode with value @code 0 @endcode SHOULD be recorded as the + * @code k8s.node.annotation.node.alpha.kubernetes.io/ttl @endcode attribute with value @code "0" + * @endcode.
  • An annotation @code data @endcode with empty string value SHOULD be recorded + * as the @code k8s.node.annotation.data @endcode attribute with value @code "" @endcode.
  • + *
+ */ +static constexpr const char *kK8sNodeAnnotation = "k8s.node.annotation"; + +/** + * 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 + * @endcode with value @code arm64 @endcode SHOULD be recorded as the @code + * k8s.node.label.kubernetes.io/arch @endcode attribute with value @code "arm64" @endcode.
  • + *
  • A label @code data @endcode with empty string value SHOULD be recorded as + * the @code k8s.node.label.data @endcode attribute with value @code "" @endcode.
  • + *
+ */ +static constexpr const char *kK8sNodeLabel = "k8s.node.label"; + /** * The name of the Node. */ @@ -142,14 +250,28 @@ static constexpr const char *kK8sNodeName = "k8s.node.name"; static constexpr const char *kK8sNodeUid = "k8s.node.uid"; /** - * The annotation key-value pairs placed on the Pod, the @code @endcode being the annotation - * name, the value being the annotation value. + * The annotation placed on the Pod, the @code @endcode being the annotation name, the value + * being the annotation value.

Examples:

  • An annotation @code + * kubernetes.io/enforce-mountable-secrets @endcode with value @code true @endcode SHOULD be + * recorded as the @code k8s.pod.annotation.kubernetes.io/enforce-mountable-secrets @endcode + * attribute with value @code "true" @endcode.
  • An annotation @code mycompany.io/arch + * @endcode with value @code x64 @endcode SHOULD be recorded as the @code + * k8s.pod.annotation.mycompany.io/arch @endcode attribute with value @code "x64" @endcode.
  • + *
  • An annotation @code data @endcode with empty string value SHOULD be recorded as + * the @code k8s.pod.annotation.data @endcode attribute with value @code "" @endcode.
  • + *
*/ static constexpr const char *kK8sPodAnnotation = "k8s.pod.annotation"; /** - * The label key-value pairs placed on the Pod, the @code @endcode being the label name, the - * value being the label value. + * The label placed on the Pod, the @code @endcode being the label name, the value being the + * label value.

Examples:

  • A label @code app @endcode with value @code my-app @endcode + * SHOULD be recorded as the @code k8s.pod.label.app @endcode attribute with value @code "my-app" + * @endcode.
  • A label @code mycompany.io/arch @endcode with value @code x64 @endcode SHOULD + * be recorded as the @code k8s.pod.label.mycompany.io/arch @endcode attribute with value @code + * "x64" @endcode.
  • A label @code data @endcode with empty string value SHOULD be recorded + * as the @code k8s.pod.label.data @endcode attribute with value @code "" @endcode.
  • + *
*/ static constexpr const char *kK8sPodLabel = "k8s.pod.label"; @@ -171,6 +293,22 @@ 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. + */ +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. + */ +static constexpr const char *kK8sReplicasetLabel = "k8s.replicaset.label"; + /** * The name of the ReplicaSet. */ @@ -201,6 +339,22 @@ static constexpr const char *kK8sResourcequotaName = "k8s.resourcequota.name"; */ 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. + */ +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. + */ +static constexpr const char *kK8sStatefulsetLabel = "k8s.statefulset.label"; + /** * The name of the StatefulSet. */ diff --git a/api/include/opentelemetry/semconv/incubating/messaging_attributes.h b/api/include/opentelemetry/semconv/incubating/messaging_attributes.h index 486f4d42b5..13c52bf616 100644 --- a/api/include/opentelemetry/semconv/incubating/messaging_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/messaging_attributes.h @@ -35,19 +35,6 @@ static constexpr const char *kMessagingBatchMessageCount = "messaging.batch.mess */ static constexpr const char *kMessagingClientId = "messaging.client.id"; -#if 0 -// Excluded attribute: -/** - * Deprecated, use @code messaging.client.id @endcode instead. - * - * @deprecated - * {"note": "Replaced by @code messaging.client.id @endcode.", "reason": "uncategorized"} - */ -OPENTELEMETRY_DEPRECATED -static constexpr const char *kMessagingClientId - = "messaging.client_id"; -#endif - /** * The name of the consumer group with which a consumer is associated. *

diff --git a/api/include/opentelemetry/semconv/incubating/otel_attributes.h b/api/include/opentelemetry/semconv/incubating/otel_attributes.h index 2296ec9261..20e3955178 100644 --- a/api/include/opentelemetry/semconv/incubating/otel_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/otel_attributes.h @@ -89,22 +89,22 @@ static constexpr const char *kOtelStatusDescription = "otel.status_description"; namespace OtelComponentTypeValues { /** - * The builtin SDK Batching Span Processor + * The builtin SDK batching span processor */ static constexpr const char *kBatchingSpanProcessor = "batching_span_processor"; /** - * The builtin SDK Simple Span Processor + * The builtin SDK simple span processor */ static constexpr const char *kSimpleSpanProcessor = "simple_span_processor"; /** - * The builtin SDK Batching LogRecord Processor + * The builtin SDK batching log record processor */ static constexpr const char *kBatchingLogProcessor = "batching_log_processor"; /** - * The builtin SDK Simple LogRecord Processor + * The builtin SDK simple log record processor */ static constexpr const char *kSimpleLogProcessor = "simple_log_processor"; @@ -124,20 +124,40 @@ static constexpr const char *kOtlpHttpSpanExporter = "otlp_http_span_exporter"; static constexpr const char *kOtlpHttpJsonSpanExporter = "otlp_http_json_span_exporter"; /** - * OTLP LogRecord exporter over gRPC with protobuf serialization + * OTLP log record exporter over gRPC with protobuf serialization */ static constexpr const char *kOtlpGrpcLogExporter = "otlp_grpc_log_exporter"; /** - * OTLP LogRecord exporter over HTTP with protobuf serialization + * OTLP log record exporter over HTTP with protobuf serialization */ static constexpr const char *kOtlpHttpLogExporter = "otlp_http_log_exporter"; /** - * OTLP LogRecord exporter over HTTP with JSON serialization + * OTLP log record exporter over HTTP with JSON serialization */ static constexpr const char *kOtlpHttpJsonLogExporter = "otlp_http_json_log_exporter"; +/** + * The builtin SDK periodically exporting metric reader + */ +static constexpr const char *kPeriodicMetricReader = "periodic_metric_reader"; + +/** + * OTLP metric exporter over gRPC with protobuf serialization + */ +static constexpr const char *kOtlpGrpcMetricExporter = "otlp_grpc_metric_exporter"; + +/** + * OTLP metric exporter over HTTP with protobuf serialization + */ +static constexpr const char *kOtlpHttpMetricExporter = "otlp_http_metric_exporter"; + +/** + * OTLP metric exporter over HTTP with JSON serialization + */ +static constexpr const char *kOtlpHttpJsonMetricExporter = "otlp_http_json_metric_exporter"; + } // namespace OtelComponentTypeValues namespace OtelSpanSamplingResultValues diff --git a/api/include/opentelemetry/semconv/incubating/otel_metrics.h b/api/include/opentelemetry/semconv/incubating/otel_metrics.h index 560672d2a3..0905c0b74c 100644 --- a/api/include/opentelemetry/semconv/incubating/otel_metrics.h +++ b/api/include/opentelemetry/semconv/incubating/otel_metrics.h @@ -24,8 +24,8 @@ namespace otel * The number of log records for which the export has finished, either successful or failed *

* For successful exports, @code error.type @endcode MUST NOT be set. For failed exports, @code - * error.type @endcode must contain the failure cause. For exporters with partial success semantics - * (e.g. OTLP with @code rejected_log_records @endcode), rejected log records must count as failed + * error.type @endcode MUST contain the failure cause. For exporters with partial success semantics + * (e.g. OTLP with @code rejected_log_records @endcode), rejected log records MUST count as failed * and only non-rejected log records count as success. If no rejection reason is available, @code * rejected @endcode SHOULD be used as value for @code error.type @endcode.

counter */ @@ -69,7 +69,7 @@ CreateAsyncDoubleMetricOtelSdkExporterLogExported(metrics::Meter *meter) /** * The number of log records which were passed to the exporter, but that have not been exported yet * (neither successful, nor failed)

For successful exports, @code error.type @endcode MUST NOT - * be set. For failed exports, @code error.type @endcode must contain the failure cause.

+ * be set. For failed exports, @code error.type @endcode MUST contain the failure cause.

* updowncounter */ static constexpr const char *kMetricOtelSdkExporterLogInflight = "otel.sdk.exporter.log.inflight"; @@ -110,67 +110,287 @@ CreateAsyncDoubleMetricOtelSdkExporterLogInflight(metrics::Meter *meter) unitMetricOtelSdkExporterLogInflight); } +/** + * The number of metric data points for which the export has finished, either successful or failed + *

+ * For successful exports, @code error.type @endcode MUST NOT be set. For failed exports, @code + * error.type @endcode MUST contain the failure cause. For exporters with partial success semantics + * (e.g. OTLP with @code rejected_data_points @endcode), rejected data points MUST count as failed + * and only non-rejected data points count as success. If no rejection reason is available, @code + * rejected @endcode SHOULD be used as value for @code error.type @endcode.

counter + */ +static constexpr const char *kMetricOtelSdkExporterMetricDataPointExported = + "otel.sdk.exporter.metric_data_point.exported"; +static constexpr const char *descrMetricOtelSdkExporterMetricDataPointExported = + "The number of metric data points for which the export has finished, either successful or " + "failed"; +static constexpr const char *unitMetricOtelSdkExporterMetricDataPointExported = "{data_point}"; + +static inline nostd::unique_ptr> +CreateSyncInt64MetricOtelSdkExporterMetricDataPointExported(metrics::Meter *meter) +{ + return meter->CreateUInt64Counter(kMetricOtelSdkExporterMetricDataPointExported, + descrMetricOtelSdkExporterMetricDataPointExported, + unitMetricOtelSdkExporterMetricDataPointExported); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricOtelSdkExporterMetricDataPointExported(metrics::Meter *meter) +{ + return meter->CreateDoubleCounter(kMetricOtelSdkExporterMetricDataPointExported, + descrMetricOtelSdkExporterMetricDataPointExported, + unitMetricOtelSdkExporterMetricDataPointExported); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricOtelSdkExporterMetricDataPointExported(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableCounter(kMetricOtelSdkExporterMetricDataPointExported, + descrMetricOtelSdkExporterMetricDataPointExported, + unitMetricOtelSdkExporterMetricDataPointExported); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricOtelSdkExporterMetricDataPointExported(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableCounter(kMetricOtelSdkExporterMetricDataPointExported, + descrMetricOtelSdkExporterMetricDataPointExported, + unitMetricOtelSdkExporterMetricDataPointExported); +} + +/** + * The number of metric data points which were passed to the exporter, but that have not been + * exported yet (neither successful, nor failed)

For successful exports, @code error.type + * @endcode MUST NOT be set. For failed exports, @code error.type @endcode MUST contain the failure + * cause.

updowncounter + */ +static constexpr const char *kMetricOtelSdkExporterMetricDataPointInflight = + "otel.sdk.exporter.metric_data_point.inflight"; +static constexpr const char *descrMetricOtelSdkExporterMetricDataPointInflight = + "The number of metric data points which were passed to the exporter, but that have not been " + "exported yet (neither successful, nor failed)"; +static constexpr const char *unitMetricOtelSdkExporterMetricDataPointInflight = "{data_point}"; + +static inline nostd::unique_ptr> +CreateSyncInt64MetricOtelSdkExporterMetricDataPointInflight(metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricOtelSdkExporterMetricDataPointInflight, + descrMetricOtelSdkExporterMetricDataPointInflight, + unitMetricOtelSdkExporterMetricDataPointInflight); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricOtelSdkExporterMetricDataPointInflight(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricOtelSdkExporterMetricDataPointInflight, + descrMetricOtelSdkExporterMetricDataPointInflight, + unitMetricOtelSdkExporterMetricDataPointInflight); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricOtelSdkExporterMetricDataPointInflight(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter( + kMetricOtelSdkExporterMetricDataPointInflight, + descrMetricOtelSdkExporterMetricDataPointInflight, + unitMetricOtelSdkExporterMetricDataPointInflight); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricOtelSdkExporterMetricDataPointInflight(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter( + kMetricOtelSdkExporterMetricDataPointInflight, + descrMetricOtelSdkExporterMetricDataPointInflight, + unitMetricOtelSdkExporterMetricDataPointInflight); +} + +/** + * The duration of exporting a batch of telemetry records. + *

+ * This metric defines successful operations using the full success definitions for http + * and grpc. + * Anything else is defined as an unsuccessful operation. For successful operations, @code + * error.type @endcode MUST NOT be set. For unsuccessful export operations, @code error.type + * @endcode MUST contain a relevant failure cause.

histogram + */ +static constexpr const char *kMetricOtelSdkExporterOperationDuration = + "otel.sdk.exporter.operation.duration"; +static constexpr const char *descrMetricOtelSdkExporterOperationDuration = + "The duration of exporting a batch of telemetry records."; +static constexpr const char *unitMetricOtelSdkExporterOperationDuration = "s"; + +static inline nostd::unique_ptr> +CreateSyncInt64MetricOtelSdkExporterOperationDuration(metrics::Meter *meter) +{ + return meter->CreateUInt64Histogram(kMetricOtelSdkExporterOperationDuration, + descrMetricOtelSdkExporterOperationDuration, + unitMetricOtelSdkExporterOperationDuration); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricOtelSdkExporterOperationDuration(metrics::Meter *meter) +{ + return meter->CreateDoubleHistogram(kMetricOtelSdkExporterOperationDuration, + descrMetricOtelSdkExporterOperationDuration, + unitMetricOtelSdkExporterOperationDuration); +} + /** * The number of spans for which the export has finished, either successful or failed *

* For successful exports, @code error.type @endcode MUST NOT be set. For failed exports, @code - * error.type @endcode must contain the failure cause. For exporters with partial success semantics - * (e.g. OTLP with @code rejected_spans @endcode), rejected spans must count as failed and only + * error.type @endcode MUST contain the failure cause. For exporters with partial success semantics + * (e.g. OTLP with @code rejected_spans @endcode), rejected spans MUST count as failed and only * non-rejected spans count as success. If no rejection reason is available, @code rejected @endcode * SHOULD be used as value for @code error.type @endcode.

counter */ -static constexpr const char *kMetricOtelSdkExporterSpanExportedCount = - "otel.sdk.exporter.span.exported.count"; -static constexpr const char *descrMetricOtelSdkExporterSpanExportedCount = +static constexpr const char *kMetricOtelSdkExporterSpanExported = "otel.sdk.exporter.span.exported"; +static constexpr const char *descrMetricOtelSdkExporterSpanExported = "The number of spans for which the export has finished, either successful or failed"; -static constexpr const char *unitMetricOtelSdkExporterSpanExportedCount = "{span}"; +static constexpr const char *unitMetricOtelSdkExporterSpanExported = "{span}"; static inline nostd::unique_ptr> -CreateSyncInt64MetricOtelSdkExporterSpanExportedCount(metrics::Meter *meter) +CreateSyncInt64MetricOtelSdkExporterSpanExported(metrics::Meter *meter) { - return meter->CreateUInt64Counter(kMetricOtelSdkExporterSpanExportedCount, - descrMetricOtelSdkExporterSpanExportedCount, - unitMetricOtelSdkExporterSpanExportedCount); + return meter->CreateUInt64Counter(kMetricOtelSdkExporterSpanExported, + descrMetricOtelSdkExporterSpanExported, + unitMetricOtelSdkExporterSpanExported); } static inline nostd::unique_ptr> -CreateSyncDoubleMetricOtelSdkExporterSpanExportedCount(metrics::Meter *meter) +CreateSyncDoubleMetricOtelSdkExporterSpanExported(metrics::Meter *meter) { - return meter->CreateDoubleCounter(kMetricOtelSdkExporterSpanExportedCount, - descrMetricOtelSdkExporterSpanExportedCount, - unitMetricOtelSdkExporterSpanExportedCount); + return meter->CreateDoubleCounter(kMetricOtelSdkExporterSpanExported, + descrMetricOtelSdkExporterSpanExported, + unitMetricOtelSdkExporterSpanExported); } static inline nostd::shared_ptr -CreateAsyncInt64MetricOtelSdkExporterSpanExportedCount(metrics::Meter *meter) +CreateAsyncInt64MetricOtelSdkExporterSpanExported(metrics::Meter *meter) { - return meter->CreateInt64ObservableCounter(kMetricOtelSdkExporterSpanExportedCount, - descrMetricOtelSdkExporterSpanExportedCount, - unitMetricOtelSdkExporterSpanExportedCount); + return meter->CreateInt64ObservableCounter(kMetricOtelSdkExporterSpanExported, + descrMetricOtelSdkExporterSpanExported, + unitMetricOtelSdkExporterSpanExported); } static inline nostd::shared_ptr +CreateAsyncDoubleMetricOtelSdkExporterSpanExported(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableCounter(kMetricOtelSdkExporterSpanExported, + descrMetricOtelSdkExporterSpanExported, + unitMetricOtelSdkExporterSpanExported); +} + +/** + * Deprecated, use @code otel.sdk.exporter.span.exported @endcode instead. + * + * @deprecated + * {"note": "Renamed to @code otel.sdk.exporter.span.exported @endcode.", "reason": "uncategorized"} + *

+ * updowncounter + */ +OPENTELEMETRY_DEPRECATED static constexpr const char *kMetricOtelSdkExporterSpanExportedCount = + "otel.sdk.exporter.span.exported.count"; +OPENTELEMETRY_DEPRECATED static constexpr const char *descrMetricOtelSdkExporterSpanExportedCount = + "Deprecated, use `otel.sdk.exporter.span.exported` instead."; +OPENTELEMETRY_DEPRECATED static constexpr const char *unitMetricOtelSdkExporterSpanExportedCount = + "{span}"; + +OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> +CreateSyncInt64MetricOtelSdkExporterSpanExportedCount(metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricOtelSdkExporterSpanExportedCount, + descrMetricOtelSdkExporterSpanExportedCount, + unitMetricOtelSdkExporterSpanExportedCount); +} + +OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> +CreateSyncDoubleMetricOtelSdkExporterSpanExportedCount(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricOtelSdkExporterSpanExportedCount, + descrMetricOtelSdkExporterSpanExportedCount, + unitMetricOtelSdkExporterSpanExportedCount); +} + +OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr +CreateAsyncInt64MetricOtelSdkExporterSpanExportedCount(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter(kMetricOtelSdkExporterSpanExportedCount, + descrMetricOtelSdkExporterSpanExportedCount, + unitMetricOtelSdkExporterSpanExportedCount); +} + +OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr CreateAsyncDoubleMetricOtelSdkExporterSpanExportedCount(metrics::Meter *meter) { - return meter->CreateDoubleObservableCounter(kMetricOtelSdkExporterSpanExportedCount, - descrMetricOtelSdkExporterSpanExportedCount, - unitMetricOtelSdkExporterSpanExportedCount); + return meter->CreateDoubleObservableUpDownCounter(kMetricOtelSdkExporterSpanExportedCount, + descrMetricOtelSdkExporterSpanExportedCount, + unitMetricOtelSdkExporterSpanExportedCount); } /** * The number of spans which were passed to the exporter, but that have not been exported yet * (neither successful, nor failed)

For successful exports, @code error.type @endcode MUST NOT - * be set. For failed exports, @code error.type @endcode must contain the failure cause.

+ * be set. For failed exports, @code error.type @endcode MUST contain the failure cause.

* updowncounter */ -static constexpr const char *kMetricOtelSdkExporterSpanInflightCount = - "otel.sdk.exporter.span.inflight.count"; -static constexpr const char *descrMetricOtelSdkExporterSpanInflightCount = +static constexpr const char *kMetricOtelSdkExporterSpanInflight = "otel.sdk.exporter.span.inflight"; +static constexpr const char *descrMetricOtelSdkExporterSpanInflight = "The number of spans which were passed to the exporter, but that have not been exported yet " "(neither successful, nor failed)"; -static constexpr const char *unitMetricOtelSdkExporterSpanInflightCount = "{span}"; +static constexpr const char *unitMetricOtelSdkExporterSpanInflight = "{span}"; static inline nostd::unique_ptr> +CreateSyncInt64MetricOtelSdkExporterSpanInflight(metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricOtelSdkExporterSpanInflight, + descrMetricOtelSdkExporterSpanInflight, + unitMetricOtelSdkExporterSpanInflight); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricOtelSdkExporterSpanInflight(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricOtelSdkExporterSpanInflight, + descrMetricOtelSdkExporterSpanInflight, + unitMetricOtelSdkExporterSpanInflight); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricOtelSdkExporterSpanInflight(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter(kMetricOtelSdkExporterSpanInflight, + descrMetricOtelSdkExporterSpanInflight, + unitMetricOtelSdkExporterSpanInflight); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricOtelSdkExporterSpanInflight(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter(kMetricOtelSdkExporterSpanInflight, + descrMetricOtelSdkExporterSpanInflight, + unitMetricOtelSdkExporterSpanInflight); +} + +/** + * Deprecated, use @code otel.sdk.exporter.span.inflight @endcode instead. + * + * @deprecated + * {"note": "Renamed to @code otel.sdk.exporter.span.inflight @endcode.", "reason": "uncategorized"} + *

+ * updowncounter + */ +OPENTELEMETRY_DEPRECATED static constexpr const char *kMetricOtelSdkExporterSpanInflightCount = + "otel.sdk.exporter.span.inflight.count"; +OPENTELEMETRY_DEPRECATED static constexpr const char *descrMetricOtelSdkExporterSpanInflightCount = + "Deprecated, use `otel.sdk.exporter.span.inflight` instead."; +OPENTELEMETRY_DEPRECATED static constexpr const char *unitMetricOtelSdkExporterSpanInflightCount = + "{span}"; + +OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> CreateSyncInt64MetricOtelSdkExporterSpanInflightCount(metrics::Meter *meter) { return meter->CreateInt64UpDownCounter(kMetricOtelSdkExporterSpanInflightCount, @@ -178,7 +398,7 @@ CreateSyncInt64MetricOtelSdkExporterSpanInflightCount(metrics::Meter *meter) unitMetricOtelSdkExporterSpanInflightCount); } -static inline nostd::unique_ptr> +OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> CreateSyncDoubleMetricOtelSdkExporterSpanInflightCount(metrics::Meter *meter) { return meter->CreateDoubleUpDownCounter(kMetricOtelSdkExporterSpanInflightCount, @@ -186,7 +406,7 @@ CreateSyncDoubleMetricOtelSdkExporterSpanInflightCount(metrics::Meter *meter) unitMetricOtelSdkExporterSpanInflightCount); } -static inline nostd::shared_ptr +OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr CreateAsyncInt64MetricOtelSdkExporterSpanInflightCount(metrics::Meter *meter) { return meter->CreateInt64ObservableUpDownCounter(kMetricOtelSdkExporterSpanInflightCount, @@ -194,7 +414,7 @@ CreateAsyncInt64MetricOtelSdkExporterSpanInflightCount(metrics::Meter *meter) unitMetricOtelSdkExporterSpanInflightCount); } -static inline nostd::shared_ptr +OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr CreateAsyncDoubleMetricOtelSdkExporterSpanInflightCount(metrics::Meter *meter) { return meter->CreateDoubleObservableUpDownCounter(kMetricOtelSdkExporterSpanInflightCount, @@ -240,11 +460,41 @@ CreateAsyncDoubleMetricOtelSdkLogCreated(metrics::Meter *meter) kMetricOtelSdkLogCreated, descrMetricOtelSdkLogCreated, unitMetricOtelSdkLogCreated); } +/** + * The duration of the collect operation of the metric reader. + *

+ * For successful collections, @code error.type @endcode MUST NOT be set. For failed collections, + * @code error.type @endcode SHOULD contain the failure cause. It can happen that metrics collection + * is successful for some MetricProducers, while others fail. In that case @code error.type @endcode + * SHOULD be set to any of the failure causes.

histogram + */ +static constexpr const char *kMetricOtelSdkMetricReaderCollectionDuration = + "otel.sdk.metric_reader.collection.duration"; +static constexpr const char *descrMetricOtelSdkMetricReaderCollectionDuration = + "The duration of the collect operation of the metric reader."; +static constexpr const char *unitMetricOtelSdkMetricReaderCollectionDuration = "s"; + +static inline nostd::unique_ptr> +CreateSyncInt64MetricOtelSdkMetricReaderCollectionDuration(metrics::Meter *meter) +{ + return meter->CreateUInt64Histogram(kMetricOtelSdkMetricReaderCollectionDuration, + descrMetricOtelSdkMetricReaderCollectionDuration, + unitMetricOtelSdkMetricReaderCollectionDuration); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricOtelSdkMetricReaderCollectionDuration(metrics::Meter *meter) +{ + return meter->CreateDoubleHistogram(kMetricOtelSdkMetricReaderCollectionDuration, + descrMetricOtelSdkMetricReaderCollectionDuration, + unitMetricOtelSdkMetricReaderCollectionDuration); +} + /** * The number of log records for which the processing has finished, either successful or failed *

* For successful processing, @code error.type @endcode MUST NOT be set. For failed processing, - * @code error.type @endcode must contain the failure cause. For the SDK Simple and Batching Log + * @code error.type @endcode MUST contain the failure cause. For the SDK Simple and Batching Log * Record Processor a log record is considered to be processed already when it has been submitted to * the exporter, not when the corresponding export call has finished.

counter */ @@ -378,46 +628,93 @@ CreateAsyncDoubleMetricOtelSdkProcessorLogQueueSize(metrics::Meter *meter) * The number of spans for which the processing has finished, either successful or failed *

* For successful processing, @code error.type @endcode MUST NOT be set. For failed processing, - * @code error.type @endcode must contain the failure cause. For the SDK Simple and Batching Span + * @code error.type @endcode MUST contain the failure cause. For the SDK Simple and Batching Span * Processor a span is considered to be processed already when it has been submitted to the * exporter, not when the corresponding export call has finished.

counter */ -static constexpr const char *kMetricOtelSdkProcessorSpanProcessedCount = - "otel.sdk.processor.span.processed.count"; -static constexpr const char *descrMetricOtelSdkProcessorSpanProcessedCount = +static constexpr const char *kMetricOtelSdkProcessorSpanProcessed = + "otel.sdk.processor.span.processed"; +static constexpr const char *descrMetricOtelSdkProcessorSpanProcessed = "The number of spans for which the processing has finished, either successful or failed"; -static constexpr const char *unitMetricOtelSdkProcessorSpanProcessedCount = "{span}"; +static constexpr const char *unitMetricOtelSdkProcessorSpanProcessed = "{span}"; static inline nostd::unique_ptr> -CreateSyncInt64MetricOtelSdkProcessorSpanProcessedCount(metrics::Meter *meter) +CreateSyncInt64MetricOtelSdkProcessorSpanProcessed(metrics::Meter *meter) { - return meter->CreateUInt64Counter(kMetricOtelSdkProcessorSpanProcessedCount, - descrMetricOtelSdkProcessorSpanProcessedCount, - unitMetricOtelSdkProcessorSpanProcessedCount); + return meter->CreateUInt64Counter(kMetricOtelSdkProcessorSpanProcessed, + descrMetricOtelSdkProcessorSpanProcessed, + unitMetricOtelSdkProcessorSpanProcessed); } static inline nostd::unique_ptr> -CreateSyncDoubleMetricOtelSdkProcessorSpanProcessedCount(metrics::Meter *meter) +CreateSyncDoubleMetricOtelSdkProcessorSpanProcessed(metrics::Meter *meter) { - return meter->CreateDoubleCounter(kMetricOtelSdkProcessorSpanProcessedCount, - descrMetricOtelSdkProcessorSpanProcessedCount, - unitMetricOtelSdkProcessorSpanProcessedCount); + return meter->CreateDoubleCounter(kMetricOtelSdkProcessorSpanProcessed, + descrMetricOtelSdkProcessorSpanProcessed, + unitMetricOtelSdkProcessorSpanProcessed); } static inline nostd::shared_ptr -CreateAsyncInt64MetricOtelSdkProcessorSpanProcessedCount(metrics::Meter *meter) +CreateAsyncInt64MetricOtelSdkProcessorSpanProcessed(metrics::Meter *meter) { - return meter->CreateInt64ObservableCounter(kMetricOtelSdkProcessorSpanProcessedCount, - descrMetricOtelSdkProcessorSpanProcessedCount, - unitMetricOtelSdkProcessorSpanProcessedCount); + return meter->CreateInt64ObservableCounter(kMetricOtelSdkProcessorSpanProcessed, + descrMetricOtelSdkProcessorSpanProcessed, + unitMetricOtelSdkProcessorSpanProcessed); } static inline nostd::shared_ptr +CreateAsyncDoubleMetricOtelSdkProcessorSpanProcessed(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableCounter(kMetricOtelSdkProcessorSpanProcessed, + descrMetricOtelSdkProcessorSpanProcessed, + unitMetricOtelSdkProcessorSpanProcessed); +} + +/** + * Deprecated, use @code otel.sdk.processor.span.processed @endcode instead. + * + * @deprecated + * {"note": "Renamed to @code otel.sdk.processor.span.processed @endcode.", "reason": + * "uncategorized"}

updowncounter + */ +OPENTELEMETRY_DEPRECATED static constexpr const char *kMetricOtelSdkProcessorSpanProcessedCount = + "otel.sdk.processor.span.processed.count"; +OPENTELEMETRY_DEPRECATED static constexpr const char + *descrMetricOtelSdkProcessorSpanProcessedCount = + "Deprecated, use `otel.sdk.processor.span.processed` instead."; +OPENTELEMETRY_DEPRECATED static constexpr const char *unitMetricOtelSdkProcessorSpanProcessedCount = + "{span}"; + +OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> +CreateSyncInt64MetricOtelSdkProcessorSpanProcessedCount(metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricOtelSdkProcessorSpanProcessedCount, + descrMetricOtelSdkProcessorSpanProcessedCount, + unitMetricOtelSdkProcessorSpanProcessedCount); +} + +OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> +CreateSyncDoubleMetricOtelSdkProcessorSpanProcessedCount(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricOtelSdkProcessorSpanProcessedCount, + descrMetricOtelSdkProcessorSpanProcessedCount, + unitMetricOtelSdkProcessorSpanProcessedCount); +} + +OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr +CreateAsyncInt64MetricOtelSdkProcessorSpanProcessedCount(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter(kMetricOtelSdkProcessorSpanProcessedCount, + descrMetricOtelSdkProcessorSpanProcessedCount, + unitMetricOtelSdkProcessorSpanProcessedCount); +} + +OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr CreateAsyncDoubleMetricOtelSdkProcessorSpanProcessedCount(metrics::Meter *meter) { - return meter->CreateDoubleObservableCounter(kMetricOtelSdkProcessorSpanProcessedCount, - descrMetricOtelSdkProcessorSpanProcessedCount, - unitMetricOtelSdkProcessorSpanProcessedCount); + return meter->CreateDoubleObservableUpDownCounter(kMetricOtelSdkProcessorSpanProcessedCount, + descrMetricOtelSdkProcessorSpanProcessedCount, + unitMetricOtelSdkProcessorSpanProcessedCount); } /** @@ -514,30 +811,72 @@ CreateAsyncDoubleMetricOtelSdkProcessorSpanQueueSize(metrics::Meter *meter) * The number of created spans for which the end operation was called *

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

counter + * 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 */ -static constexpr const char *kMetricOtelSdkSpanEndedCount = "otel.sdk.span.ended.count"; -static constexpr const char *descrMetricOtelSdkSpanEndedCount = +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 *unitMetricOtelSdkSpanEndedCount = "{span}"; +static constexpr const char *unitMetricOtelSdkSpanEnded = "{span}"; -static inline nostd::unique_ptr> +static inline nostd::unique_ptr> CreateSyncInt64MetricOtelSdkSpanEnded( + metrics::Meter *meter) +{ + return meter->CreateUInt64Counter(kMetricOtelSdkSpanEnded, descrMetricOtelSdkSpanEnded, + unitMetricOtelSdkSpanEnded); +} + +static inline nostd::unique_ptr> CreateSyncDoubleMetricOtelSdkSpanEnded( + metrics::Meter *meter) +{ + return meter->CreateDoubleCounter(kMetricOtelSdkSpanEnded, descrMetricOtelSdkSpanEnded, + unitMetricOtelSdkSpanEnded); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricOtelSdkSpanEnded(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableCounter(kMetricOtelSdkSpanEnded, descrMetricOtelSdkSpanEnded, + unitMetricOtelSdkSpanEnded); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricOtelSdkSpanEnded(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableCounter(kMetricOtelSdkSpanEnded, descrMetricOtelSdkSpanEnded, + unitMetricOtelSdkSpanEnded); +} + +/** + * Deprecated, use @code otel.sdk.span.ended @endcode instead. + * + * @deprecated + * {"note": "Renamed to @code otel.sdk.span.ended @endcode.", "reason": "uncategorized"} + *

+ * 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."; +OPENTELEMETRY_DEPRECATED static constexpr const char *unitMetricOtelSdkSpanEndedCount = "{span}"; + +OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> CreateSyncInt64MetricOtelSdkSpanEndedCount(metrics::Meter *meter) { return meter->CreateUInt64Counter(kMetricOtelSdkSpanEndedCount, descrMetricOtelSdkSpanEndedCount, unitMetricOtelSdkSpanEndedCount); } -static inline nostd::unique_ptr> +OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> CreateSyncDoubleMetricOtelSdkSpanEndedCount(metrics::Meter *meter) { return meter->CreateDoubleCounter(kMetricOtelSdkSpanEndedCount, descrMetricOtelSdkSpanEndedCount, unitMetricOtelSdkSpanEndedCount); } -static inline nostd::shared_ptr +OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr CreateAsyncInt64MetricOtelSdkSpanEndedCount(metrics::Meter *meter) { return meter->CreateInt64ObservableCounter(kMetricOtelSdkSpanEndedCount, @@ -545,7 +884,7 @@ CreateAsyncInt64MetricOtelSdkSpanEndedCount(metrics::Meter *meter) unitMetricOtelSdkSpanEndedCount); } -static inline nostd::shared_ptr +OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr CreateAsyncDoubleMetricOtelSdkSpanEndedCount(metrics::Meter *meter) { return meter->CreateDoubleObservableCounter(kMetricOtelSdkSpanEndedCount, @@ -557,37 +896,79 @@ 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.count @endcode and @code otel.sdk.span.ended.count @endcode. For spans with - * @code recording=false @endcode: If implementations decide to record this metric, they MUST also - * record @code otel.sdk.span.ended.count @endcode.

updowncounter + * 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 */ -static constexpr const char *kMetricOtelSdkSpanLiveCount = "otel.sdk.span.live.count"; -static constexpr const char *descrMetricOtelSdkSpanLiveCount = +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"; -static constexpr const char *unitMetricOtelSdkSpanLiveCount = "{span}"; +static constexpr const char *unitMetricOtelSdkSpanLive = "{span}"; static inline nostd::unique_ptr> +CreateSyncInt64MetricOtelSdkSpanLive(metrics::Meter *meter) +{ + return meter->CreateInt64UpDownCounter(kMetricOtelSdkSpanLive, descrMetricOtelSdkSpanLive, + unitMetricOtelSdkSpanLive); +} + +static inline nostd::unique_ptr> +CreateSyncDoubleMetricOtelSdkSpanLive(metrics::Meter *meter) +{ + return meter->CreateDoubleUpDownCounter(kMetricOtelSdkSpanLive, descrMetricOtelSdkSpanLive, + unitMetricOtelSdkSpanLive); +} + +static inline nostd::shared_ptr +CreateAsyncInt64MetricOtelSdkSpanLive(metrics::Meter *meter) +{ + return meter->CreateInt64ObservableUpDownCounter( + kMetricOtelSdkSpanLive, descrMetricOtelSdkSpanLive, unitMetricOtelSdkSpanLive); +} + +static inline nostd::shared_ptr +CreateAsyncDoubleMetricOtelSdkSpanLive(metrics::Meter *meter) +{ + return meter->CreateDoubleObservableUpDownCounter( + kMetricOtelSdkSpanLive, descrMetricOtelSdkSpanLive, unitMetricOtelSdkSpanLive); +} + +/** + * Deprecated, use @code otel.sdk.span.live @endcode instead. + * + * @deprecated + * {"note": "Renamed to @code otel.sdk.span.live @endcode.", "reason": "uncategorized"} + *

+ * updowncounter + */ +OPENTELEMETRY_DEPRECATED static constexpr const char *kMetricOtelSdkSpanLiveCount = + "otel.sdk.span.live.count"; +OPENTELEMETRY_DEPRECATED static constexpr const char *descrMetricOtelSdkSpanLiveCount = + "Deprecated, use `otel.sdk.span.live` instead."; +OPENTELEMETRY_DEPRECATED static constexpr const char *unitMetricOtelSdkSpanLiveCount = "{span}"; + +OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> CreateSyncInt64MetricOtelSdkSpanLiveCount(metrics::Meter *meter) { return meter->CreateInt64UpDownCounter( kMetricOtelSdkSpanLiveCount, descrMetricOtelSdkSpanLiveCount, unitMetricOtelSdkSpanLiveCount); } -static inline nostd::unique_ptr> +OPENTELEMETRY_DEPRECATED static inline nostd::unique_ptr> CreateSyncDoubleMetricOtelSdkSpanLiveCount(metrics::Meter *meter) { return meter->CreateDoubleUpDownCounter( kMetricOtelSdkSpanLiveCount, descrMetricOtelSdkSpanLiveCount, unitMetricOtelSdkSpanLiveCount); } -static inline nostd::shared_ptr +OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr CreateAsyncInt64MetricOtelSdkSpanLiveCount(metrics::Meter *meter) { return meter->CreateInt64ObservableUpDownCounter( kMetricOtelSdkSpanLiveCount, descrMetricOtelSdkSpanLiveCount, unitMetricOtelSdkSpanLiveCount); } -static inline nostd::shared_ptr +OPENTELEMETRY_DEPRECATED static inline nostd::shared_ptr CreateAsyncDoubleMetricOtelSdkSpanLiveCount(metrics::Meter *meter) { return meter->CreateDoubleObservableUpDownCounter( diff --git a/api/include/opentelemetry/semconv/incubating/process_attributes.h b/api/include/opentelemetry/semconv/incubating/process_attributes.h index 8cad737f78..5ad0eda7ce 100644 --- a/api/include/opentelemetry/semconv/incubating/process_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/process_attributes.h @@ -67,6 +67,18 @@ 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_variable.USER @endcode attribute with value @code "ubuntu" @endcode.
  • + *
  • an environment variable @code PATH @endcode with value @code "/usr/local/bin:/usr/bin" + * @endcode SHOULD be recorded as the @code process.environment_variable.PATH @endcode attribute + * with value @code "/usr/local/bin:/usr/bin" @endcode.
  • + *
+ */ +static constexpr const char *kProcessEnvironmentVariable = "process.environment_variable"; + /** * The GNU build ID as found in the @code .note.gnu.build-id @endcode ELF section (hex string). */ diff --git a/api/include/opentelemetry/semconv/incubating/rpc_attributes.h b/api/include/opentelemetry/semconv/incubating/rpc_attributes.h index ca3a80e3e0..d9cd2ec8aa 100644 --- a/api/include/opentelemetry/semconv/incubating/rpc_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/rpc_attributes.h @@ -29,7 +29,10 @@ static constexpr const char *kRpcConnectRpcErrorCode = "rpc.connect_rpc.error_co * Connect request metadata, @code @endcode being the normalized Connect Metadata key * (lowercase), the value being the metadata values.

Instrumentations SHOULD require an explicit * configuration of which metadata values are to be captured. Including all request metadata values - * can be a security risk - explicit configuration helps avoid leaking sensitive information. + * can be a security risk - explicit configuration helps avoid leaking sensitive information.

+ * For example, a property @code my-custom-key @endcode with value @code ["1.2.3.4", "1.2.3.5"] + * @endcode SHOULD be recorded as the @code rpc.connect_rpc.request.metadata.my-custom-key @endcode + * attribute with value @code ["1.2.3.4", "1.2.3.5"] @endcode */ static constexpr const char *kRpcConnectRpcRequestMetadata = "rpc.connect_rpc.request.metadata"; @@ -37,7 +40,10 @@ static constexpr const char *kRpcConnectRpcRequestMetadata = "rpc.connect_rpc.re * Connect response metadata, @code @endcode being the normalized Connect Metadata key * (lowercase), the value being the metadata values.

Instrumentations SHOULD require an explicit * configuration of which metadata values are to be captured. Including all response metadata values - * can be a security risk - explicit configuration helps avoid leaking sensitive information. + * can be a security risk - explicit configuration helps avoid leaking sensitive information.

+ * For example, a property @code my-custom-key @endcode with value @code "attribute_value" @endcode + * SHOULD be recorded as the @code rpc.connect_rpc.response.metadata.my-custom-key @endcode + * attribute with value @code ["attribute_value"] @endcode */ static constexpr const char *kRpcConnectRpcResponseMetadata = "rpc.connect_rpc.response.metadata"; @@ -45,7 +51,11 @@ static constexpr const char *kRpcConnectRpcResponseMetadata = "rpc.connect_rpc.r * gRPC request metadata, @code @endcode being the normalized gRPC Metadata key (lowercase), * the value being the metadata values.

Instrumentations SHOULD require an explicit * configuration of which metadata values are to be captured. Including all request metadata values - * can be a security risk - explicit configuration helps avoid leaking sensitive information. + * can be a security risk - explicit configuration helps avoid leaking sensitive information.

+ * For example, a property @code my-custom-key @endcode with value @code ["1.2.3.4", "1.2.3.5"] + * @endcode SHOULD be recorded as + * @code rpc.grpc.request.metadata.my-custom-key @endcode attribute with value @code ["1.2.3.4", + * "1.2.3.5"] @endcode */ static constexpr const char *kRpcGrpcRequestMetadata = "rpc.grpc.request.metadata"; @@ -53,7 +63,10 @@ static constexpr const char *kRpcGrpcRequestMetadata = "rpc.grpc.request.metadat * gRPC response metadata, @code @endcode being the normalized gRPC Metadata key (lowercase), * the value being the metadata values.

Instrumentations SHOULD require an explicit * configuration of which metadata values are to be captured. Including all response metadata values - * can be a security risk - explicit configuration helps avoid leaking sensitive information. + * can be a security risk - explicit configuration helps avoid leaking sensitive information.

+ * For example, a property @code my-custom-key @endcode with value @code ["attribute_value"] + * @endcode SHOULD be recorded as the @code rpc.grpc.response.metadata.my-custom-key @endcode + * attribute with value @code ["attribute_value"] @endcode */ static constexpr const char *kRpcGrpcResponseMetadata = "rpc.grpc.response.metadata"; diff --git a/api/include/opentelemetry/semconv/incubating/vcs_attributes.h b/api/include/opentelemetry/semconv/incubating/vcs_attributes.h index 60bab006af..aae8215722 100644 --- a/api/include/opentelemetry/semconv/incubating/vcs_attributes.h +++ b/api/include/opentelemetry/semconv/incubating/vcs_attributes.h @@ -251,10 +251,15 @@ static constexpr const char *kGithub = "github"; static constexpr const char *kGitlab = "gitlab"; /** - * Gitea + * Deprecated, use @code gitea @endcode instead. */ static constexpr const char *kGittea = "gittea"; +/** + * Gitea + */ +static constexpr const char *kGitea = "gitea"; + /** * Bitbucket */ diff --git a/api/include/opentelemetry/semconv/schema_url.h b/api/include/opentelemetry/semconv/schema_url.h index 2f3810796e..f389cba3f6 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.32.0"; +static constexpr const char *kSchemaUrl = "https://opentelemetry.io/schemas/1.33.0"; } // namespace semconv OPENTELEMETRY_END_NAMESPACE diff --git a/buildscripts/semantic-convention/generate.sh b/buildscripts/semantic-convention/generate.sh index fc04a11f55..6d03b74756 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.32.0 +SEMCONV_VERSION=1.33.0 # repository: https://github.com/open-telemetry/weaver -WEAVER_VERSION=0.13.2 +WEAVER_VERSION=0.15.0 SEMCONV_VERSION_TAG=v$SEMCONV_VERSION WEAVER_VERSION_TAG=v$WEAVER_VERSION