From fa8ee30b354414f97d5c9ba5e8bdff78a8943f05 Mon Sep 17 00:00:00 2001 From: Enrico Zimuel Date: Wed, 10 Jul 2024 16:25:22 +0200 Subject: [PATCH 01/22] Proposal for vector db semantic convention --- docs/attributes-registry/db.md | 24 +++++++++++ docs/database/database-metrics.md | 1 + docs/database/database-spans.md | 1 + docs/database/dynamodb.md | 1 + model/registry/db.yaml | 68 +++++++++++++++++++++++++++++++ 5 files changed, 95 insertions(+) diff --git a/docs/attributes-registry/db.md b/docs/attributes-registry/db.md index db78b93f6b..c874119897 100644 --- a/docs/attributes-registry/db.md +++ b/docs/attributes-registry/db.md @@ -12,6 +12,7 @@ - [Db Deprecated](#db-deprecated-attributes) - [Db Elasticsearch](#db-elasticsearch-attributes) - [Db Metrics Deprecated](#db-metrics-deprecated-attributes) +- [Db Vector](#db-vector-attributes) ## Db Attributes @@ -116,6 +117,7 @@ Even though parameterized query text can potentially have sensitive data, by usi | `sybase` | Sybase | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `teradata` | Teradata | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `trino` | Trino | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `vector` | vector | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `vertica` | Vertica | ![Experimental](https://img.shields.io/badge/-experimental-blue) | ## Db Cassandra Attributes @@ -244,3 +246,25 @@ This group defines attributes for Elasticsearch. | ------ | ----------- | ---------------------------------------------------------------- | | `idle` | idle | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `used` | used | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + +## Db Vector Attributes + +This group defines attributes for vector databases. + +| Attribute | Type | Description | Examples | Stability | +| ---------------------- | -------- | ---------------------------------------------------- | -------------------------------------- | ---------------------------------------------------------------- | +| `db.vector.dimension` | int | The dimension of the vector. | `3` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `db.vector.embeddings` | double[] | The values of the vector, the array of numbers. | `[0.9, 0.1, 0.1]` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `db.vector.id` | string | The ID of vector. | `5c56c793-69f3-4fbf-87e6-c4bf54c28c26` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `db.vector.model` | string | The model used for the embedding. | `text-embedding-3-small` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `db.vector.name` | string | The name field as of the vector (e.g. a field name). | `vector` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `db.vector.similarity` | string | The metric used in similarity search. | `cosine` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + +`db.vector.similarity` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. + +| Value | Description | Stability | +| ----------- | ------------------------------ | ---------------------------------------------------------------- | +| `cosine` | The cosine metric. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `dot` | The dot product metric. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `euclidean` | The euclidean distance metric. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `manhattan` | The Manhattan distance metric. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | diff --git a/docs/database/database-metrics.md b/docs/database/database-metrics.md index 332a0f9dda..ff6eb0c58b 100644 --- a/docs/database/database-metrics.md +++ b/docs/database/database-metrics.md @@ -193,6 +193,7 @@ If a database operation involved multiple network calls (for example retries), t | `sybase` | Sybase | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `teradata` | Teradata | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `trino` | Trino | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `vector` | vector | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `vertica` | Vertica | ![Experimental](https://img.shields.io/badge/-experimental-blue) | diff --git a/docs/database/database-spans.md b/docs/database/database-spans.md index 88093233d8..d562896dac 100644 --- a/docs/database/database-spans.md +++ b/docs/database/database-spans.md @@ -194,6 +194,7 @@ If a parameter has no name and instead is referenced only by index, then `` | `sybase` | Sybase | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `teradata` | Teradata | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `trino` | Trino | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `vector` | vector | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `vertica` | Vertica | ![Experimental](https://img.shields.io/badge/-experimental-blue) | diff --git a/docs/database/dynamodb.md b/docs/database/dynamodb.md index eb342339f0..9560ee6736 100644 --- a/docs/database/dynamodb.md +++ b/docs/database/dynamodb.md @@ -83,6 +83,7 @@ These attributes are filled in for all DynamoDB request types. | `sybase` | Sybase | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `teradata` | Teradata | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `trino` | Trino | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `vector` | vector | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `vertica` | Vertica | ![Experimental](https://img.shields.io/badge/-experimental-blue) | diff --git a/model/registry/db.yaml b/model/registry/db.yaml index c94ac32e0f..8ce0f5d3a0 100644 --- a/model/registry/db.yaml +++ b/model/registry/db.yaml @@ -310,6 +310,10 @@ groups: value: 'trino' brief: 'Trino' stability: experimental + - id: vector + value: 'vector' + brief: 'vector' + stability: experimental - id: vertica value: 'vertica' brief: 'Vertica' @@ -529,3 +533,67 @@ groups: reference the [elasticsearch schema](https://raw.githubusercontent.com/elastic/elasticsearch-specification/main/output/schema/schema.json) in order to map the path part values to their names. examples: ['db.elasticsearch.path_parts.index=test-index', 'db.elasticsearch.path_parts.doc_id=123'] + - id: registry.db.vector + prefix: db.vector + type: attribute_group + brief: > + This group defines attributes for vector databases. + attributes: + - id: similarity + type: + allow_custom_values: true + members: + - id: cosine + value: 'cosine' + brief: > + The cosine metric. + stability: experimental + - id: dot + value: 'dot' + brief: > + The dot product metric. + stability: experimental + - id: euclidean + value: 'euclidean' + brief: > + The euclidean distance metric. + stability: experimental + - id: manhattan + value: 'manhattan' + brief: > + The Manhattan distance metric. + stability: experimental + stability: experimental + brief: > + The metric used in similarity search. + examples: 'cosine' + - id: id + type: string + stability: experimental + brief: > + The ID of vector. + examples: '5c56c793-69f3-4fbf-87e6-c4bf54c28c26' + - id: name + type: string + stability: experimental + brief: > + The name field as of the vector (e.g. a field name). + examples: 'vector' + - id: embeddings + type: double[] + stability: experimental + brief: > + The values of the vector, the array of numbers. + examples: [0.9, 0.1, 0.1] + - id: dimension + type: int + stability: experimental + brief: > + The dimension of the vector. + examples: [3] + - id: model + type: string + stability: experimental + brief: > + The model used for the embedding. + examples: 'text-embedding-3-small' \ No newline at end of file From 5e12a861062f54ae2262fcc99ed6b77eadc484bc Mon Sep 17 00:00:00 2001 From: Enrico Zimuel Date: Wed, 17 Jul 2024 21:15:16 +0200 Subject: [PATCH 02/22] Removed allow_custom_values: true in db.yaml --- model/registry/db.yaml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/model/registry/db.yaml b/model/registry/db.yaml index c424f309e4..b2db44fbd1 100644 --- a/model/registry/db.yaml +++ b/model/registry/db.yaml @@ -92,7 +92,6 @@ groups: For example, when using PostgreSQL client libraries to connect to a CockroachDB, the `db.system` is set to `postgresql` based on the instrumentation's best knowledge. type: - allow_custom_values: true members: - id: other_sql value: 'other_sql' @@ -319,7 +318,6 @@ groups: - id: client.connection.state stability: experimental type: - allow_custom_values: true members: - id: idle value: 'idle' @@ -441,7 +439,6 @@ groups: brief: Cosmos client connection mode. - id: cosmosdb.operation_type type: - allow_custom_values: true members: - id: invalid value: 'Invalid' @@ -541,7 +538,6 @@ groups: attributes: - id: similarity type: - allow_custom_values: true members: - id: cosine value: 'cosine' From 3b617845f9ea5f8bfbcaf5d0ad874376a38e6b71 Mon Sep 17 00:00:00 2001 From: Enrico Zimuel Date: Thu, 18 Jul 2024 08:18:49 +0200 Subject: [PATCH 03/22] Fixed merge --- docs/attributes-registry/db.md | 56 ++++++++++------------- docs/database/dynamodb.md | 83 ---------------------------------- 2 files changed, 23 insertions(+), 116 deletions(-) diff --git a/docs/attributes-registry/db.md b/docs/attributes-registry/db.md index f43c4d7d22..14d19ccbdf 100644 --- a/docs/attributes-registry/db.md +++ b/docs/attributes-registry/db.md @@ -6,22 +6,13 @@ # Db -<<<<<<< HEAD -- [Db](#db-attributes) -- [Db Cassandra](#db-cassandra-attributes) -- [Db Cosmosdb](#db-cosmosdb-attributes) -- [Db Deprecated](#db-deprecated-attributes) -- [Db Elasticsearch](#db-elasticsearch-attributes) -- [Db Metrics Deprecated](#db-metrics-deprecated-attributes) -- [Db Vector](#db-vector-attributes) -======= - [General Database Attributes](#general-database-attributes) - [Cassandra Attributes](#cassandra-attributes) - [Azure Cosmos DB Attributes](#azure-cosmos-db-attributes) - [Elasticsearch Attributes](#elasticsearch-attributes) +- [Db Vector Attributes](#db-vector-attributes) - [Deprecated Database Attributes](#deprecated-database-attributes) - [Deprecated Database Metrics](#deprecated-database-metrics) ->>>>>>> upstream/main ## General Database Attributes @@ -126,7 +117,6 @@ Even though parameterized query text can potentially have sensitive data, by usi | `sybase` | Sybase | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `teradata` | Teradata | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `trino` | Trino | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `vector` | vector | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `vertica` | Vertica | ![Experimental](https://img.shields.io/badge/-experimental-blue) | ## Cassandra Attributes @@ -210,6 +200,28 @@ This group defines attributes for Elasticsearch. **[8]:** Many Elasticsearch url paths allow dynamic values. These SHOULD be recorded in span attributes in the format `db.elasticsearch.path_parts.`, where `` is the url path part name. The implementation SHOULD reference the [elasticsearch schema](https://raw.githubusercontent.com/elastic/elasticsearch-specification/main/output/schema/schema.json) in order to map the path part values to their names. +## Db Vector Attributes + +This group defines attributes for vector databases. + +| Attribute | Type | Description | Examples | Stability | +| ----------------------- | ------ | ---------------------------------------------------- | -------------------------------------- | ---------------------------------------------------------------- | +| `db.vector.dimension` | int | The dimension of the vector. | `3` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `db.vector.id` | string | The ID of vector. | `5c56c793-69f3-4fbf-87e6-c4bf54c28c26` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `db.vector.model` | string | The model used for the embedding. | `text-embedding-3-small` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `db.vector.name` | string | The name field as of the vector (e.g. a field name). | `vector` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `db.vector.query.top_k` | int | The top-k most similar vectors returned by a query. | `5` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `db.vector.similarity` | string | The metric used in similarity search. | `cosine` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + +`db.vector.similarity` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. + +| Value | Description | Stability | +| ----------- | ------------------------------ | ---------------------------------------------------------------- | +| `cosine` | The cosine metric. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `dot` | The dot product metric. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `euclidean` | The euclidean distance metric. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `manhattan` | The Manhattan distance metric. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + ## Deprecated Database Attributes "Describes deprecated db attributes." @@ -255,25 +267,3 @@ This group defines attributes for Elasticsearch. | ------ | ----------- | ---------------------------------------------------------------- | | `idle` | idle | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `used` | used | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - -## Db Vector Attributes - -This group defines attributes for vector databases. - -| Attribute | Type | Description | Examples | Stability | -| ---------------------- | -------- | ---------------------------------------------------- | -------------------------------------- | ---------------------------------------------------------------- | -| `db.vector.dimension` | int | The dimension of the vector. | `3` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `db.vector.embeddings` | double[] | The values of the vector, the array of numbers. | `[0.9, 0.1, 0.1]` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `db.vector.id` | string | The ID of vector. | `5c56c793-69f3-4fbf-87e6-c4bf54c28c26` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `db.vector.model` | string | The model used for the embedding. | `text-embedding-3-small` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `db.vector.name` | string | The name field as of the vector (e.g. a field name). | `vector` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `db.vector.similarity` | string | The metric used in similarity search. | `cosine` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - -`db.vector.similarity` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. - -| Value | Description | Stability | -| ----------- | ------------------------------ | ---------------------------------------------------------------- | -| `cosine` | The cosine metric. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `dot` | The dot product metric. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `euclidean` | The euclidean distance metric. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `manhattan` | The Manhattan distance metric. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | diff --git a/docs/database/dynamodb.md b/docs/database/dynamodb.md index fd4cd6652e..bb83447e94 100644 --- a/docs/database/dynamodb.md +++ b/docs/database/dynamodb.md @@ -9,90 +9,7 @@ linkTitle: AWS DynamoDB The Semantic Conventions for [AWS DynamoDB](https://aws.amazon.com/dynamodb/) extend and override the general [AWS SDK Semantic Conventions](/docs/cloud-providers/aws-sdk.md) and [Database Semantic Conventions](database-spans.md). -<<<<<<< HEAD -## Common Attributes - -These attributes are filled in for all DynamoDB request types. - - - - - - - - -| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | -|---|---|---|---|---|---| -| [`db.system`](/docs/attributes-registry/db.md) | string | The value `dynamodb`. [1] | `dynamodb` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - -**[1]:** 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 `db.system` is set to `postgresql` based on the instrumentation's best knowledge. - - - -`db.system` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. - -| Value | Description | Stability | -|---|---|---| -| `adabas` | Adabas (Adaptable Database System) | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `cassandra` | Apache Cassandra | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `clickhouse` | ClickHouse | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `cockroachdb` | CockroachDB | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `cosmosdb` | Microsoft Azure Cosmos DB | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `couchbase` | Couchbase | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `couchdb` | CouchDB | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `db2` | IBM Db2 | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `derby` | Apache Derby | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `dynamodb` | Amazon DynamoDB | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `edb` | EnterpriseDB | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `elasticsearch` | Elasticsearch | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `filemaker` | FileMaker | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `firebird` | Firebird | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `geode` | Apache Geode | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `h2` | H2 | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `hanadb` | SAP HANA | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `hbase` | Apache HBase | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `hive` | Apache Hive | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `hsqldb` | HyperSQL DataBase | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `influxdb` | InfluxDB | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `informix` | Informix | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `ingres` | Ingres | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `instantdb` | InstantDB | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `interbase` | InterBase | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `intersystems_cache` | InterSystems Caché | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `mariadb` | MariaDB | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `maxdb` | SAP MaxDB | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `memcached` | Memcached | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `mongodb` | MongoDB | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `mssql` | Microsoft SQL Server | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `mysql` | MySQL | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `neo4j` | Neo4j | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `netezza` | Netezza | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `opensearch` | OpenSearch | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `oracle` | Oracle Database | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `other_sql` | Some other SQL database. Fallback only. See notes. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `pervasive` | Pervasive PSQL | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `pointbase` | PointBase | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `postgresql` | PostgreSQL | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `progress` | Progress Database | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `redis` | Redis | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `redshift` | Amazon Redshift | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `spanner` | Cloud Spanner | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `sqlite` | SQLite | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `sybase` | Sybase | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `teradata` | Teradata | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `trino` | Trino | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `vector` | vector | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `vertica` | Vertica | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - - - - - - - -======= `db.system` MUST be set to `"dynamodb"` and SHOULD be provided **at span creation time**. ->>>>>>> upstream/main ## DynamoDB.BatchGetItem From a3330ffea04ad5d2ce8d9a4bb07a1ce259369339 Mon Sep 17 00:00:00 2001 From: Enrico Zimuel Date: Mon, 5 Aug 2024 09:27:30 +0200 Subject: [PATCH 04/22] Updated dimension_count and similarity_metric --- docs/attributes-registry/db.md | 20 ++++++++++---------- model/registry/db.yaml | 4 ++-- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/attributes-registry/db.md b/docs/attributes-registry/db.md index c86fd17231..17c74bbf82 100644 --- a/docs/attributes-registry/db.md +++ b/docs/attributes-registry/db.md @@ -204,16 +204,16 @@ This group defines attributes for Elasticsearch. This group defines attributes for vector databases. -| Attribute | Type | Description | Examples | Stability | -| ----------------------- | ------ | ---------------------------------------------------- | -------------------------------------- | ---------------------------------------------------------------- | -| `db.vector.dimension` | int | The dimension of the vector. | `3` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `db.vector.id` | string | The ID of vector. | `5c56c793-69f3-4fbf-87e6-c4bf54c28c26` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `db.vector.model` | string | The model used for the embedding. | `text-embedding-3-small` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `db.vector.name` | string | The name field as of the vector (e.g. a field name). | `vector` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `db.vector.query.top_k` | int | The top-k most similar vectors returned by a query. | `5` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `db.vector.similarity` | string | The metric used in similarity search. | `cosine` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | - -`db.vector.similarity` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. +| Attribute | Type | Description | Examples | Stability | +| ----------------------------- | ------ | ---------------------------------------------------- | -------------------------------------- | ---------------------------------------------------------------- | +| `db.vector.dimension_count` | int | The dimension of the vector. | `3` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `db.vector.id` | string | The ID of vector. | `5c56c793-69f3-4fbf-87e6-c4bf54c28c26` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `db.vector.model` | string | The model used for the embedding. | `text-embedding-3-small` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `db.vector.name` | string | The name field as of the vector (e.g. a field name). | `vector` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `db.vector.query.top_k` | int | The top-k most similar vectors returned by a query. | `5` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `db.vector.similarity_metric` | string | The metric used in similarity search. | `cosine` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + +`db.vector.similarity_metric` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | | ----------- | ------------------------------ | ---------------------------------------------------------------- | diff --git a/model/registry/db.yaml b/model/registry/db.yaml index a9b52d82ef..98bce99130 100644 --- a/model/registry/db.yaml +++ b/model/registry/db.yaml @@ -534,7 +534,7 @@ groups: brief: > This group defines attributes for vector databases. attributes: - - id: similarity + - id: similarity_metric type: members: - id: cosine @@ -573,7 +573,7 @@ groups: brief: > The name field as of the vector (e.g. a field name). examples: 'vector' - - id: dimension + - id: dimension_count type: int stability: experimental brief: > From d99ec1072d8c16197c29c8795646fca09d22f8be Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Fri, 9 Aug 2024 01:40:26 +0900 Subject: [PATCH 05/22] Fix array attribute examples (#1325) --- docs/attributes-registry/container.md | 2 +- docs/attributes-registry/gen-ai.md | 2 +- docs/attributes-registry/tls.md | 60 +++++++++++------------ docs/gen-ai/gen-ai-spans.md | 2 +- docs/resource/container.md | 2 +- model/registry/aws.yaml | 70 +++++++++++++-------------- model/registry/browser.yaml | 3 +- model/registry/container.yaml | 12 +++-- model/registry/gen-ai.yaml | 7 ++- model/registry/host.yaml | 6 ++- model/registry/messaging.yaml | 3 +- model/registry/process.yaml | 3 +- model/registry/tls.yaml | 10 ++-- model/registry/user.yaml | 3 +- 14 files changed, 99 insertions(+), 86 deletions(-) diff --git a/docs/attributes-registry/container.md b/docs/attributes-registry/container.md index 4aef8d3f91..e49671a135 100644 --- a/docs/attributes-registry/container.md +++ b/docs/attributes-registry/container.md @@ -16,7 +16,7 @@ A container instance. | Attribute | Type | Description | Examples | Stability | | ------------------------------ | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------- | | `container.command` | string | The command used to run the container (i.e. the command name). [1] | `otelcontribcol` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `container.command_args` | string[] | All the command arguments (including the command/executable itself) run by the container. [2] | `["otelcontribcol, --config, config.yaml"]` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `container.command_args` | string[] | All the command arguments (including the command/executable itself) run by the container. [2] | `["otelcontribcol", "--config", "config.yaml"]` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `container.command_line` | string | The full command run by the container as a single string representing the full command. [2] | `otelcontribcol --config config.yaml` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `container.id` | string | Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/reference/run/#container-identification). The UUID might be abbreviated. | `a3bf90e006b2` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `container.image.id` | string | Runtime specific image identifier. Usually a hash algorithm followed by a UUID. [2] | `sha256:19c92d0a00d1b66d897bceaa7319bee0dd38a10a851c60bcec9474aa3f01e50f` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | diff --git a/docs/attributes-registry/gen-ai.md b/docs/attributes-registry/gen-ai.md index d136ebf575..fd8e8ee117 100644 --- a/docs/attributes-registry/gen-ai.md +++ b/docs/attributes-registry/gen-ai.md @@ -26,7 +26,7 @@ This document defines the attributes used to describe telemetry in the context o | `gen_ai.request.temperature` | double | The temperature setting for the GenAI request. | `0.0` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `gen_ai.request.top_k` | double | The top_k sampling setting for the GenAI request. | `1.0` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `gen_ai.request.top_p` | double | The top_p sampling setting for the GenAI request. | `1.0` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `gen_ai.response.finish_reasons` | string[] | Array of reasons the model stopped generating tokens, corresponding to each generation received. | `["stop"]` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `gen_ai.response.finish_reasons` | string[] | Array of reasons the model stopped generating tokens, corresponding to each generation received. | `["stop"]`; `["stop", "length"]` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `gen_ai.response.id` | string | The unique identifier for the completion. | `chatcmpl-123` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `gen_ai.response.model` | string | The name of the model that generated the response. | `gpt-4-0613` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `gen_ai.system` | string | The Generative AI product as identified by the client or server instrumentation. [4] | `openai` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | diff --git a/docs/attributes-registry/tls.md b/docs/attributes-registry/tls.md index 1e030397e3..8bce2ea0c5 100644 --- a/docs/attributes-registry/tls.md +++ b/docs/attributes-registry/tls.md @@ -13,36 +13,36 @@ This document defines semantic convention attributes in the TLS namespace. -| Attribute | Type | Description | Examples | Stability | -| ------------------------------ | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | ---------------------------------------------------------------- | -| `tls.cipher` | string | String indicating the [cipher](https://datatracker.ietf.org/doc/html/rfc5246#appendix-A.5) used during the current connection. [1] | `TLS_RSA_WITH_3DES_EDE_CBC_SHA`; `TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `tls.client.certificate` | string | PEM-encoded stand-alone certificate offered by the client. This is usually mutually-exclusive of `client.certificate_chain` since this value also exists in that list. | `MII...` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `tls.client.certificate_chain` | string[] | Array of PEM-encoded certificates that make up the certificate chain offered by the client. This is usually mutually-exclusive of `client.certificate` since that value should be the first certificate in the chain. | `["MII...", "MI..."]` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `tls.client.hash.md5` | string | Certificate fingerprint using the MD5 digest of DER-encoded version of certificate offered by the client. For consistency with other hash values, this value should be formatted as an uppercase hash. | `0F76C7F2C55BFD7D8E8B8F4BFBF0C9EC` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `tls.client.hash.sha1` | string | Certificate fingerprint using the SHA1 digest of DER-encoded version of certificate offered by the client. For consistency with other hash values, this value should be formatted as an uppercase hash. | `9E393D93138888D288266C2D915214D1D1CCEB2A` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `tls.client.hash.sha256` | string | Certificate fingerprint using the SHA256 digest of DER-encoded version of certificate offered by the client. For consistency with other hash values, this value should be formatted as an uppercase hash. | `0687F666A054EF17A08E2F2162EAB4CBC0D265E1D7875BE74BF3C712CA92DAF0` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `tls.client.issuer` | string | Distinguished name of [subject](https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6) of the issuer of the x.509 certificate presented by the client. | `CN=Example Root CA, OU=Infrastructure Team, DC=example, DC=com` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `tls.client.ja3` | string | A hash that identifies clients based on how they perform an SSL/TLS handshake. | `d4e5b18d6b55c71272893221c96ba240` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `tls.client.not_after` | string | Date/Time indicating when client certificate is no longer considered valid. | `2021-01-01T00:00:00.000Z` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `tls.client.not_before` | string | Date/Time indicating when client certificate is first considered valid. | `1970-01-01T00:00:00.000Z` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `tls.client.subject` | string | Distinguished name of subject of the x.509 certificate presented by the client. | `CN=myclient, OU=Documentation Team, DC=example, DC=com` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `tls.client.supported_ciphers` | string[] | Array of ciphers offered by the client during the client hello. | `["TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384", "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384", "..."]` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `tls.curve` | string | String indicating the curve used for the given cipher, when applicable | `secp256r1` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `tls.established` | boolean | Boolean flag indicating if the TLS negotiation was successful and transitioned to an encrypted tunnel. | `true` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `tls.next_protocol` | string | String indicating the protocol being tunneled. Per the values in the [IANA registry](https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids), this string should be lower case. | `http/1.1` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `tls.protocol.name` | string | Normalized lowercase protocol name parsed from original string of the negotiated [SSL/TLS protocol version](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_version.html#RETURN-VALUES) | `ssl`; `tls` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `tls.protocol.version` | string | Numeric part of the version parsed from the original string of the negotiated [SSL/TLS protocol version](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_version.html#RETURN-VALUES) | `1.2`; `3` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `tls.resumed` | boolean | Boolean flag indicating if this TLS connection was resumed from an existing TLS negotiation. | `true` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `tls.server.certificate` | string | PEM-encoded stand-alone certificate offered by the server. This is usually mutually-exclusive of `server.certificate_chain` since this value also exists in that list. | `MII...` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `tls.server.certificate_chain` | string[] | Array of PEM-encoded certificates that make up the certificate chain offered by the server. This is usually mutually-exclusive of `server.certificate` since that value should be the first certificate in the chain. | `["MII...", "MI..."]` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `tls.server.hash.md5` | string | Certificate fingerprint using the MD5 digest of DER-encoded version of certificate offered by the server. For consistency with other hash values, this value should be formatted as an uppercase hash. | `0F76C7F2C55BFD7D8E8B8F4BFBF0C9EC` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `tls.server.hash.sha1` | string | Certificate fingerprint using the SHA1 digest of DER-encoded version of certificate offered by the server. For consistency with other hash values, this value should be formatted as an uppercase hash. | `9E393D93138888D288266C2D915214D1D1CCEB2A` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `tls.server.hash.sha256` | string | Certificate fingerprint using the SHA256 digest of DER-encoded version of certificate offered by the server. For consistency with other hash values, this value should be formatted as an uppercase hash. | `0687F666A054EF17A08E2F2162EAB4CBC0D265E1D7875BE74BF3C712CA92DAF0` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `tls.server.issuer` | string | Distinguished name of [subject](https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6) of the issuer of the x.509 certificate presented by the client. | `CN=Example Root CA, OU=Infrastructure Team, DC=example, DC=com` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `tls.server.ja3s` | string | A hash that identifies servers based on how they perform an SSL/TLS handshake. | `d4e5b18d6b55c71272893221c96ba240` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `tls.server.not_after` | string | Date/Time indicating when server certificate is no longer considered valid. | `2021-01-01T00:00:00.000Z` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `tls.server.not_before` | string | Date/Time indicating when server certificate is first considered valid. | `1970-01-01T00:00:00.000Z` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `tls.server.subject` | string | Distinguished name of subject of the x.509 certificate presented by the server. | `CN=myserver, OU=Documentation Team, DC=example, DC=com` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| Attribute | Type | Description | Examples | Stability | +| ------------------------------ | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | ---------------------------------------------------------------- | +| `tls.cipher` | string | String indicating the [cipher](https://datatracker.ietf.org/doc/html/rfc5246#appendix-A.5) used during the current connection. [1] | `TLS_RSA_WITH_3DES_EDE_CBC_SHA`; `TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `tls.client.certificate` | string | PEM-encoded stand-alone certificate offered by the client. This is usually mutually-exclusive of `client.certificate_chain` since this value also exists in that list. | `MII...` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `tls.client.certificate_chain` | string[] | Array of PEM-encoded certificates that make up the certificate chain offered by the client. This is usually mutually-exclusive of `client.certificate` since that value should be the first certificate in the chain. | `["MII...", "MI..."]` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `tls.client.hash.md5` | string | Certificate fingerprint using the MD5 digest of DER-encoded version of certificate offered by the client. For consistency with other hash values, this value should be formatted as an uppercase hash. | `0F76C7F2C55BFD7D8E8B8F4BFBF0C9EC` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `tls.client.hash.sha1` | string | Certificate fingerprint using the SHA1 digest of DER-encoded version of certificate offered by the client. For consistency with other hash values, this value should be formatted as an uppercase hash. | `9E393D93138888D288266C2D915214D1D1CCEB2A` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `tls.client.hash.sha256` | string | Certificate fingerprint using the SHA256 digest of DER-encoded version of certificate offered by the client. For consistency with other hash values, this value should be formatted as an uppercase hash. | `0687F666A054EF17A08E2F2162EAB4CBC0D265E1D7875BE74BF3C712CA92DAF0` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `tls.client.issuer` | string | Distinguished name of [subject](https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6) of the issuer of the x.509 certificate presented by the client. | `CN=Example Root CA, OU=Infrastructure Team, DC=example, DC=com` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `tls.client.ja3` | string | A hash that identifies clients based on how they perform an SSL/TLS handshake. | `d4e5b18d6b55c71272893221c96ba240` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `tls.client.not_after` | string | Date/Time indicating when client certificate is no longer considered valid. | `2021-01-01T00:00:00.000Z` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `tls.client.not_before` | string | Date/Time indicating when client certificate is first considered valid. | `1970-01-01T00:00:00.000Z` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `tls.client.subject` | string | Distinguished name of subject of the x.509 certificate presented by the client. | `CN=myclient, OU=Documentation Team, DC=example, DC=com` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `tls.client.supported_ciphers` | string[] | Array of ciphers offered by the client during the client hello. | `["TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384", "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384"]` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `tls.curve` | string | String indicating the curve used for the given cipher, when applicable | `secp256r1` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `tls.established` | boolean | Boolean flag indicating if the TLS negotiation was successful and transitioned to an encrypted tunnel. | `true` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `tls.next_protocol` | string | String indicating the protocol being tunneled. Per the values in the [IANA registry](https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids), this string should be lower case. | `http/1.1` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `tls.protocol.name` | string | Normalized lowercase protocol name parsed from original string of the negotiated [SSL/TLS protocol version](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_version.html#RETURN-VALUES) | `ssl`; `tls` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `tls.protocol.version` | string | Numeric part of the version parsed from the original string of the negotiated [SSL/TLS protocol version](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_version.html#RETURN-VALUES) | `1.2`; `3` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `tls.resumed` | boolean | Boolean flag indicating if this TLS connection was resumed from an existing TLS negotiation. | `true` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `tls.server.certificate` | string | PEM-encoded stand-alone certificate offered by the server. This is usually mutually-exclusive of `server.certificate_chain` since this value also exists in that list. | `MII...` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `tls.server.certificate_chain` | string[] | Array of PEM-encoded certificates that make up the certificate chain offered by the server. This is usually mutually-exclusive of `server.certificate` since that value should be the first certificate in the chain. | `["MII...", "MI..."]` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `tls.server.hash.md5` | string | Certificate fingerprint using the MD5 digest of DER-encoded version of certificate offered by the server. For consistency with other hash values, this value should be formatted as an uppercase hash. | `0F76C7F2C55BFD7D8E8B8F4BFBF0C9EC` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `tls.server.hash.sha1` | string | Certificate fingerprint using the SHA1 digest of DER-encoded version of certificate offered by the server. For consistency with other hash values, this value should be formatted as an uppercase hash. | `9E393D93138888D288266C2D915214D1D1CCEB2A` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `tls.server.hash.sha256` | string | Certificate fingerprint using the SHA256 digest of DER-encoded version of certificate offered by the server. For consistency with other hash values, this value should be formatted as an uppercase hash. | `0687F666A054EF17A08E2F2162EAB4CBC0D265E1D7875BE74BF3C712CA92DAF0` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `tls.server.issuer` | string | Distinguished name of [subject](https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6) of the issuer of the x.509 certificate presented by the client. | `CN=Example Root CA, OU=Infrastructure Team, DC=example, DC=com` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `tls.server.ja3s` | string | A hash that identifies servers based on how they perform an SSL/TLS handshake. | `d4e5b18d6b55c71272893221c96ba240` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `tls.server.not_after` | string | Date/Time indicating when server certificate is no longer considered valid. | `2021-01-01T00:00:00.000Z` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `tls.server.not_before` | string | Date/Time indicating when server certificate is first considered valid. | `1970-01-01T00:00:00.000Z` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `tls.server.subject` | string | Distinguished name of subject of the x.509 certificate presented by the server. | `CN=myserver, OU=Documentation Team, DC=example, DC=com` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | **[1]:** The values allowed for `tls.cipher` MUST be one of the `Descriptions` of the [registered TLS Cipher Suits](https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#table-tls-parameters-4). diff --git a/docs/gen-ai/gen-ai-spans.md b/docs/gen-ai/gen-ai-spans.md index d4b6045692..0a3eec44b4 100644 --- a/docs/gen-ai/gen-ai-spans.md +++ b/docs/gen-ai/gen-ai-spans.md @@ -61,7 +61,7 @@ These attributes track input data and metadata for a request to an GenAI model. | [`gen_ai.request.temperature`](/docs/attributes-registry/gen-ai.md) | double | The temperature setting for the GenAI request. | `0.0` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`gen_ai.request.top_k`](/docs/attributes-registry/gen-ai.md) | double | The top_k sampling setting for the GenAI request. | `1.0` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`gen_ai.request.top_p`](/docs/attributes-registry/gen-ai.md) | double | The top_p sampling setting for the GenAI request. | `1.0` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`gen_ai.response.finish_reasons`](/docs/attributes-registry/gen-ai.md) | string[] | Array of reasons the model stopped generating tokens, corresponding to each generation received. | `["stop"]` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`gen_ai.response.finish_reasons`](/docs/attributes-registry/gen-ai.md) | string[] | Array of reasons the model stopped generating tokens, corresponding to each generation received. | `["stop"]`; `["stop", "length"]` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`gen_ai.response.id`](/docs/attributes-registry/gen-ai.md) | string | The unique identifier for the completion. | `chatcmpl-123` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`gen_ai.response.model`](/docs/attributes-registry/gen-ai.md) | string | The name of the model that generated the response. [6] | `gpt-4-0613` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`gen_ai.usage.input_tokens`](/docs/attributes-registry/gen-ai.md) | int | The number of tokens used in the GenAI input (prompt). | `100` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | diff --git a/docs/resource/container.md b/docs/resource/container.md index c76bbb0d6f..1720bf2a20 100644 --- a/docs/resource/container.md +++ b/docs/resource/container.md @@ -25,7 +25,7 @@ | [`container.runtime`](/docs/attributes-registry/container.md) | string | The container runtime managing this container. | `docker`; `containerd`; `rkt` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`oci.manifest.digest`](/docs/attributes-registry/oci.md) | string | The digest of the OCI image manifest. For container images specifically is the digest by which the container image is known. [3] | `sha256:e4ca62c0d62f3e886e684806dfe9d4e0cda60d54986898173c1083856cfda0f4` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`container.command`](/docs/attributes-registry/container.md) | string | The command used to run the container (i.e. the command name). [4] | `otelcontribcol` | `Opt-In` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| [`container.command_args`](/docs/attributes-registry/container.md) | string[] | All the command arguments (including the command/executable itself) run by the container. [2] | `["otelcontribcol, --config, config.yaml"]` | `Opt-In` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`container.command_args`](/docs/attributes-registry/container.md) | string[] | All the command arguments (including the command/executable itself) run by the container. [2] | `["otelcontribcol", "--config", "config.yaml"]` | `Opt-In` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`container.command_line`](/docs/attributes-registry/container.md) | string | The full command run by the container as a single string representing the full command. [2] | `otelcontribcol --config config.yaml` | `Opt-In` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | **[1]:** Docker defines a sha256 of the image id; `container.image.id` corresponds to the `Image` field from the Docker container inspect [API](https://docs.docker.com/engine/api/v1.43/#tag/Container/operation/ContainerInspect) endpoint. diff --git a/model/registry/aws.yaml b/model/registry/aws.yaml index bc47121531..e96186a682 100644 --- a/model/registry/aws.yaml +++ b/model/registry/aws.yaml @@ -23,38 +23,37 @@ groups: stability: experimental brief: The keys in the `RequestItems` object field. examples: - - Users - - Cats + - [Users, Cats] - id: aws.dynamodb.consumed_capacity type: string[] stability: experimental brief: "The JSON-serialized value of each item in the `ConsumedCapacity` response field." examples: - - '{ + - ['{ "CapacityUnits": number, "GlobalSecondaryIndexes": { - "string" : { + "string" : { "CapacityUnits": number, "ReadCapacityUnits": number, "WriteCapacityUnits": number - } + } }, "LocalSecondaryIndexes": { - "string" : { + "string" : { "CapacityUnits": number, "ReadCapacityUnits": number, "WriteCapacityUnits": number - } + } }, "ReadCapacityUnits": number, "Table": { - "CapacityUnits": number, - "ReadCapacityUnits": number, - "WriteCapacityUnits": number + "CapacityUnits": number, + "ReadCapacityUnits": number, + "WriteCapacityUnits": number }, "TableName": "string", "WriteCapacityUnits": number - }' + }'] - id: aws.dynamodb.item_collection_metrics type: string stability: experimental @@ -62,29 +61,29 @@ groups: examples: - '{ "string" : [ - { + { "ItemCollectionKey": { - "string" : { + "string" : { "B": blob, "BOOL": boolean, "BS": [ blob ], "L": [ - "AttributeValue" + "AttributeValue" ], "M": { - "string" : "AttributeValue" + "string" : "AttributeValue" }, "N": "string", "NS": [ "string" ], "NULL": boolean, "S": "string", "SS": [ "string" ] - } + } }, "SizeEstimateRangeGB": [ number ] - } + } ] - }' + }' - id: aws.dynamodb.provisioned_read_capacity type: double stability: experimental @@ -122,8 +121,7 @@ groups: stability: experimental brief: "The value of the `AttributesToGet` request parameter." examples: - - lives - - id + - [lives, id] - id: aws.dynamodb.index_name type: string stability: experimental @@ -142,7 +140,7 @@ groups: stability: experimental brief: "The JSON-serialized value of each item of the `GlobalSecondaryIndexes` request field" examples: - - '{ + - ['{ "IndexName": "string", "KeySchema": [ { @@ -158,13 +156,13 @@ groups: "ReadCapacityUnits": number, "WriteCapacityUnits": number } - }' + }'] - id: aws.dynamodb.local_secondary_indexes type: string[] stability: experimental brief: "The JSON-serialized value of each item of the `LocalSecondaryIndexes` request field." examples: - - '{ + - ['{ "IndexArn": "string", "IndexName": "string", "IndexSizeBytes": number, @@ -179,14 +177,12 @@ groups: "NonKeyAttributes": [ "string" ], "ProjectionType": "string" } - }' + }'] - id: aws.dynamodb.exclusive_start_table type: string stability: experimental brief: "The value of the `ExclusiveStartTableName` request parameter." - examples: - - Users - - CatsTable + examples: [Users, CatsTable] - id: aws.dynamodb.table_count type: int stability: experimental @@ -226,16 +222,16 @@ groups: stability: experimental brief: "The JSON-serialized value of each item in the `AttributeDefinitions` request field." examples: - - '{ + - ['{ "AttributeName": "string", "AttributeType": "string" - }' + }'] - id: aws.dynamodb.global_secondary_index_updates type: string[] stability: experimental brief: "The JSON-serialized value of each item in the `GlobalSecondaryIndexUpdates` request field." examples: - - '{ + - ['{ "Create": { "IndexName": "string", "KeySchema": [ @@ -252,7 +248,7 @@ groups: "ReadCapacityUnits": number, "WriteCapacityUnits": number } - }' + }'] - id: registry.aws.ecs type: attribute_group display_name: Amazon ECS Attributes @@ -335,7 +331,8 @@ groups: stability: experimental brief: > The name(s) of the AWS log group(s) an application is writing to. - examples: ['/aws/lambda/my-function', 'opentelemetry-service'] + examples: + - ['/aws/lambda/my-function', 'opentelemetry-service'] note: > Multiple log groups must be supported for cases like multi-container applications, where a single application has sidecar containers, and each write to their own log @@ -345,7 +342,8 @@ groups: stability: experimental brief: > The Amazon Resource Name(s) (ARN) of the AWS log group(s). - examples: ['arn:aws:logs:us-west-1:123456789012:log-group:/aws/my/group:*'] + examples: + - ['arn:aws:logs:us-west-1:123456789012:log-group:/aws/my/group:*'] note: > See the [log group ARN format documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format). @@ -354,13 +352,15 @@ groups: stability: experimental brief: > The name(s) of the AWS log stream(s) an application is writing to. - examples: ['logs/main/10838bed-421f-43ef-870a-f43feacbbb5b'] + examples: + - ['logs/main/10838bed-421f-43ef-870a-f43feacbbb5b'] - id: aws.log.stream.arns type: string[] stability: experimental brief: > The ARN(s) of the AWS log stream(s). - examples: ['arn:aws:logs:us-west-1:123456789012:log-group:/aws/my/group:log-stream:logs/main/10838bed-421f-43ef-870a-f43feacbbb5b'] + examples: + - ['arn:aws:logs:us-west-1:123456789012:log-group:/aws/my/group:log-stream:logs/main/10838bed-421f-43ef-870a-f43feacbbb5b'] note: > See the [log stream ARN format documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format). diff --git a/model/registry/browser.yaml b/model/registry/browser.yaml index fcf09c6da5..ce545d1e1d 100644 --- a/model/registry/browser.yaml +++ b/model/registry/browser.yaml @@ -13,7 +13,8 @@ groups: This value is intended to be taken from the [UA client hints API](https://wicg.github.io/ua-client-hints/#interface) (`navigator.userAgentData.brands`). - examples: [ " Not A;Brand 99", "Chromium 99", "Chrome 99" ] + examples: + - [ ' Not A;Brand 99', 'Chromium 99', 'Chrome 99' ] - id: browser.platform type: string stability: experimental diff --git a/model/registry/container.yaml b/model/registry/container.yaml index 52cb7ff22b..80842e01b1 100644 --- a/model/registry/container.yaml +++ b/model/registry/container.yaml @@ -39,7 +39,8 @@ groups: [Docker Image Inspect](https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect). Should be only the `` section of the full name for example from `registry.example.com/my-org/my-image:`. - examples: ['v1.27.1', '3.5.7-0'] + examples: + - ['v1.27.1', '3.5.7-0'] - id: container.image.id type: string stability: experimental @@ -67,8 +68,10 @@ groups: [CRI](https://github.com/kubernetes/cri-api/blob/c75ef5b473bbe2d0a4fc92f82235efd665ea8e9f/pkg/apis/runtime/v1/api.proto#L1237-L1238) report those under the `RepoDigests` field. examples: - - 'example@sha256:afcc7f1ac1b49db317a7196c902e61c6c3c4607d63599ee1a82d702d249a0ccb' - - 'internal.registry.example.com:5000/example@sha256:b69959407d21e8a062e0416bf13405bb2b71ed7a84dde4158ebafacfa06f5578' + - [ + 'example@sha256:afcc7f1ac1b49db317a7196c902e61c6c3c4607d63599ee1a82d702d249a0ccb', + 'internal.registry.example.com:5000/example@sha256:b69959407d21e8a062e0416bf13405bb2b71ed7a84dde4158ebafacfa06f5578' + ] - id: container.command type: string stability: experimental @@ -88,7 +91,8 @@ groups: stability: experimental brief: > All the command arguments (including the command/executable itself) run by the container. [2] - examples: [ 'otelcontribcol, --config, config.yaml' ] + examples: + - [ 'otelcontribcol', '--config', 'config.yaml' ] - id: container.label type: template[string] stability: experimental diff --git a/model/registry/gen-ai.yaml b/model/registry/gen-ai.yaml index ac9d6c5e54..1470ca1cb3 100644 --- a/model/registry/gen-ai.yaml +++ b/model/registry/gen-ai.yaml @@ -66,7 +66,8 @@ groups: stability: experimental type: string[] brief: List of sequences that the model will use to stop generating further tokens. - examples: ['forest', 'lived'] + examples: + - [forest, lived] - id: gen_ai.request.frequency_penalty stability: experimental type: double @@ -91,7 +92,9 @@ groups: stability: experimental type: string[] brief: Array of reasons the model stopped generating tokens, corresponding to each generation received. - examples: ['stop'] + examples: + - [stop] + - [stop, length] - id: gen_ai.usage.input_tokens stability: experimental type: int diff --git a/model/registry/host.yaml b/model/registry/host.yaml index 201f622f7d..5f7336f05d 100644 --- a/model/registry/host.yaml +++ b/model/registry/host.yaml @@ -92,7 +92,8 @@ groups: note: > IPv4 Addresses MUST be specified in dotted-quad notation. IPv6 addresses MUST be specified in the [RFC 5952](https://www.rfc-editor.org/rfc/rfc5952.html) format. - examples: ["192.168.1.140", "fe80::abc2:4a28:737a:609e"] + examples: + - ["192.168.1.140", "fe80::abc2:4a28:737a:609e"] - id: host.mac stability: experimental type: string[] @@ -101,7 +102,8 @@ groups: note: > MAC Addresses MUST be represented in [IEEE RA hexadecimal form](https://standards.ieee.org/wp-content/uploads/import/documents/tutorials/eui.pdf): as hyphen-separated octets in uppercase hexadecimal form from most to least significant. - examples: ['AC-DE-48-23-45-67', 'AC-DE-48-23-45-67-01-9F'] + examples: + - ['AC-DE-48-23-45-67', 'AC-DE-48-23-45-67-01-9F'] - id: host.cpu.vendor.id stability: experimental type: string diff --git a/model/registry/messaging.yaml b/model/registry/messaging.yaml index 1bbfdf70a8..7adbba2bc9 100644 --- a/model/registry/messaging.yaml +++ b/model/registry/messaging.yaml @@ -287,7 +287,8 @@ groups: stability: experimental brief: > Key(s) of message, another way to mark message besides message id. - examples: ['keyA', 'keyB'] + examples: + - [keyA, keyB] - id: messaging.rocketmq.message.tag type: string stability: experimental diff --git a/model/registry/process.yaml b/model/registry/process.yaml index 7824d0ffbb..175faea5ec 100644 --- a/model/registry/process.yaml +++ b/model/registry/process.yaml @@ -83,7 +83,8 @@ groups: systems supporting procfs), can be set according to the list of null-delimited strings extracted from `proc/[pid]/cmdline`. For libc-based executables, this would be the full argv vector passed to `main`. - examples: ['cmd/otecol', '--config=config.yaml'] + examples: + - ['cmd/otecol', '--config=config.yaml'] - id: args_count type: int stability: experimental diff --git a/model/registry/tls.yaml b/model/registry/tls.yaml index 0699959def..7867b453aa 100644 --- a/model/registry/tls.yaml +++ b/model/registry/tls.yaml @@ -29,7 +29,8 @@ groups: brief: > Array of PEM-encoded certificates that make up the certificate chain offered by the client. This is usually mutually-exclusive of `client.certificate` since that value should be the first certificate in the chain. - examples: ["MII...", "MI..."] + examples: + - ['MII...', 'MI...'] - id: tls.client.hash.md5 type: string stability: experimental @@ -83,9 +84,7 @@ groups: stability: experimental brief: Array of ciphers offered by the client during the client hello. examples: - [ - "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384", "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384", "..." - ] + - [TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384] - id: tls.curve brief: "String indicating the curve used for the given cipher, when applicable" type: string @@ -139,7 +138,8 @@ groups: brief: > Array of PEM-encoded certificates that make up the certificate chain offered by the server. This is usually mutually-exclusive of `server.certificate` since that value should be the first certificate in the chain. - examples: ["MII...", "MI..."] + examples: + - ["MII...", "MI..."] - id: tls.server.hash.md5 type: string stability: experimental diff --git a/model/registry/user.yaml b/model/registry/user.yaml index e7e518c20b..82ef8cf6d4 100644 --- a/model/registry/user.yaml +++ b/model/registry/user.yaml @@ -41,4 +41,5 @@ groups: stability: experimental brief: > Array of user roles at the time of the event. - examples: ["admin", "reporting_user"] + examples: + - [admin, reporting_user] From 61b0f2c366fcb36a855004952e82b3f930a90f92 Mon Sep 17 00:00:00 2001 From: Christos Markou Date: Mon, 12 Aug 2024 00:30:24 +0530 Subject: [PATCH 06/22] Add k8s.{pod,node}.cpu.{time,usage} metrics (#1320) Signed-off-by: ChrsMark --- .chloggen/add_k8s_cpu_metrics.yaml | 22 ++++ docs/system/k8s-metrics.md | 171 +++++++++++++++++++++++++++++ model/metrics/k8s.yaml | 40 +++++++ 3 files changed, 233 insertions(+) create mode 100755 .chloggen/add_k8s_cpu_metrics.yaml create mode 100644 docs/system/k8s-metrics.md create mode 100644 model/metrics/k8s.yaml diff --git a/.chloggen/add_k8s_cpu_metrics.yaml b/.chloggen/add_k8s_cpu_metrics.yaml new file mode 100755 index 0000000000..fe52d97d1c --- /dev/null +++ b/.chloggen/add_k8s_cpu_metrics.yaml @@ -0,0 +1,22 @@ +# Use this changelog template to create an entry for release notes. +# +# If your change doesn't affect end users you should instead start +# your pull request title with [chore] or use the "Skip Changelog" label. + +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: enhancement + +# The name of the area of concern in the attributes-registry, (e.g. http, cloud, db) +component: k8s + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Add `k8s.pod.cpu.time`, `k8s.pod.cpu.usage`, `k8s.node.cpu.time`, `k8s.node.cpu.usage` metrics + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +# The values here must be integers. +issues: [1320] + +# (Optional) One or more lines of additional information to render under the primary note. +# These lines will be padded with 2 spaces and then inserted directly into the document. +# Use pipe (|) for multiline entries. +subtext: diff --git a/docs/system/k8s-metrics.md b/docs/system/k8s-metrics.md new file mode 100644 index 0000000000..1f8e2bf8f9 --- /dev/null +++ b/docs/system/k8s-metrics.md @@ -0,0 +1,171 @@ + + +# Semantic Conventions for Kubernetes Metrics + +**Status**: [Experimental][DocumentStatus] + +## K8s Metrics + +This document describes instruments and attributes for common K8s level +metrics in OpenTelemetry. These metrics are collected from technology-specific, +well-defined APIs (e.g. Kubelet's API). + +Metrics in `k8s.` instruments SHOULD be attached to a [K8s Resource](/docs/resource/k8s.md) +and therefore inherit its attributes, like `k8s.pod.name` and `k8s.pod.uid`. + +### Metric: `k8s.pod.cpu.time` + +This metric is [recommended][MetricRecommended]. + + + + + + + + +| Name | Instrument Type | Unit (UCUM) | Description | Stability | +| -------- | --------------- | ----------- | -------------- | --------- | +| `k8s.pod.cpu.time` | Counter | `s` | Total CPU time consumed [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + + +**[1]:** Total CPU time consumed by the specific Pod on all available CPU cores + + + + + + + + + + + + + + + + + + + + + +### Metric: `k8s.pod.cpu.usage` + +This metric is [recommended][MetricRecommended]. + + + + + + + + +| Name | Instrument Type | Unit (UCUM) | Description | Stability | +| -------- | --------------- | ----------- | -------------- | --------- | +| `k8s.pod.cpu.usage` | Gauge | `{cpu}` | Pod's CPU usage, measured in cpus. Range from 0 to the number of allocatable CPUs [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + + +**[1]:** CPU usage of the specific Pod on all available CPU cores, averaged over the sample window + + + + + + + + + + + + + + + + + + + + + +### Metric: `k8s.node.cpu.time` + +This metric is [recommended][MetricRecommended]. + + + + + + + + +| Name | Instrument Type | Unit (UCUM) | Description | Stability | +| -------- | --------------- | ----------- | -------------- | --------- | +| `k8s.node.cpu.time` | Counter | `s` | Total CPU time consumed [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + + +**[1]:** Total CPU time consumed by the specific Node on all available CPU cores + + + + + + + + + + + + + + + + + + + + + +### Metric: `k8s.node.cpu.usage` + +This metric is [recommended][MetricRecommended]. + + + + + + + + +| Name | Instrument Type | Unit (UCUM) | Description | Stability | +| -------- | --------------- | ----------- | -------------- | --------- | +| `k8s.node.cpu.usage` | Gauge | `{cpu}` | Node's CPU usage, measured in cpus. Range from 0 to the number of allocatable CPUs [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + + +**[1]:** CPU usage of the specific Node on all available CPU cores, averaged over the sample window + + + + + + + + + + + + + + + + + + + + + +[DocumentStatus]: https://opentelemetry.io/docs/specs/otel/document-status +[MetricRecommended]: /docs/general/metric-requirement-level.md#recommended diff --git a/model/metrics/k8s.yaml b/model/metrics/k8s.yaml new file mode 100644 index 0000000000..b11a6f68d4 --- /dev/null +++ b/model/metrics/k8s.yaml @@ -0,0 +1,40 @@ +groups: + # k8s.pod.cpu.* metrics + - id: metric.k8s.pod.cpu.time + type: metric + metric_name: k8s.pod.cpu.time + stability: experimental + brief: "Total CPU time consumed" + note: > + Total CPU time consumed by the specific Pod on all available CPU cores + instrument: counter + unit: "s" + - id: metric.k8s.pod.cpu.usage + type: metric + metric_name: k8s.pod.cpu.usage + stability: experimental + brief: "Pod's CPU usage, measured in cpus. Range from 0 to the number of allocatable CPUs" + note: > + CPU usage of the specific Pod on all available CPU cores, averaged over the sample window + instrument: gauge + unit: "{cpu}" + + # k8s.node.cpu.* metrics + - id: metric.k8s.node.cpu.time + type: metric + metric_name: k8s.node.cpu.time + stability: experimental + brief: "Total CPU time consumed" + note: > + Total CPU time consumed by the specific Node on all available CPU cores + instrument: counter + unit: "s" + - id: metric.k8s.node.cpu.usage + type: metric + metric_name: k8s.node.cpu.usage + stability: experimental + brief: "Node's CPU usage, measured in cpus. Range from 0 to the number of allocatable CPUs" + note: > + CPU usage of the specific Node on all available CPU cores, averaged over the sample window + instrument: gauge + unit: "{cpu}" From ceae2cabb6c63e64cd78d2db70faa664cddce8f9 Mon Sep 17 00:00:00 2001 From: Marylia Gutierrez Date: Mon, 12 Aug 2024 14:47:40 -0400 Subject: [PATCH 07/22] Db metrics pending requests (#1290) Co-authored-by: Liudmila Molkova --- .chloggen/1290.yaml | 4 ++++ docs/database/database-metrics.md | 2 +- model/metrics/database-metrics.yaml | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 .chloggen/1290.yaml diff --git a/.chloggen/1290.yaml b/.chloggen/1290.yaml new file mode 100644 index 0000000000..c9b4d85bfa --- /dev/null +++ b/.chloggen/1290.yaml @@ -0,0 +1,4 @@ +change_type: enhancement +component: db +note: Change description of `db.client.connection.pending_requests` from cumulative to current value +issues: [ 1290 ] diff --git a/docs/database/database-metrics.md b/docs/database/database-metrics.md index 7587bf0f1e..89b9510cb6 100644 --- a/docs/database/database-metrics.md +++ b/docs/database/database-metrics.md @@ -386,7 +386,7 @@ This metric is [recommended][MetricRecommended]. | Name | Instrument Type | Unit (UCUM) | Description | Stability | | -------- | --------------- | ----------- | -------------- | --------- | -| `db.client.connection.pending_requests` | UpDownCounter | `{request}` | The number of pending requests for an open connection, cumulative for the entire pool | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `db.client.connection.pending_requests` | UpDownCounter | `{request}` | The number of current pending requests for an open connection | ![Experimental](https://img.shields.io/badge/-experimental-blue) | diff --git a/model/metrics/database-metrics.yaml b/model/metrics/database-metrics.yaml index 45a92a12fc..716776b3cf 100644 --- a/model/metrics/database-metrics.yaml +++ b/model/metrics/database-metrics.yaml @@ -83,7 +83,7 @@ groups: type: metric metric_name: db.client.connection.pending_requests stability: experimental - brief: "The number of pending requests for an open connection, cumulative for the entire pool" + brief: "The number of current pending requests for an open connection" instrument: updowncounter unit: "{request}" attributes: From 6db7ec5ef01538c343334a7074366f37fd92e767 Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Mon, 12 Aug 2024 11:49:52 -0700 Subject: [PATCH 08/22] Fix `process.args_count` attribute (#1331) --- docs/attributes-registry/process.md | 2 +- model/registry/process.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/attributes-registry/process.md b/docs/attributes-registry/process.md index 58e3b1e07e..9c55c2a4b3 100644 --- a/docs/attributes-registry/process.md +++ b/docs/attributes-registry/process.md @@ -15,7 +15,7 @@ An operating system process. | Attribute | Type | Description | Examples | Stability | | ----------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------- | ---------------------------------------------------------------- | -| `args_count` | int | Length of the process.command_args array [1] | `4` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `process.args_count` | int | Length of the process.command_args array [1] | `4` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `process.command` | string | The command used to launch the process (i.e. the command name). On Linux based systems, can be set to the zeroth string in `proc/[pid]/cmdline`. On Windows, can be set to the first parameter extracted from `GetCommandLineW`. | `cmd/otelcol` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `process.command_args` | string[] | All the command arguments (including the command/executable itself) as received by the process. On Linux-based systems (and some other Unixoid systems supporting procfs), can be set according to the list of null-delimited strings extracted from `proc/[pid]/cmdline`. For libc-based executables, this would be the full argv vector passed to `main`. | `["cmd/otecol", "--config=config.yaml"]` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `process.command_line` | string | The full command used to launch the process as a single string representing the full command. On Windows, can be set to the result of `GetCommandLineW`. Do not set this if you have to assemble it just for monitoring; use `process.command_args` instead. | `C:\cmd\otecol --config="my directory\config.yaml"` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | diff --git a/model/registry/process.yaml b/model/registry/process.yaml index 175faea5ec..e070dc431b 100644 --- a/model/registry/process.yaml +++ b/model/registry/process.yaml @@ -85,7 +85,7 @@ groups: executables, this would be the full argv vector passed to `main`. examples: - ['cmd/otecol', '--config=config.yaml'] - - id: args_count + - id: process.args_count type: int stability: experimental brief: > From e5e0d9dc88795e717a2fa34c009bd3af9da4c0e8 Mon Sep 17 00:00:00 2001 From: Christos Markou Date: Wed, 14 Aug 2024 19:05:32 +0530 Subject: [PATCH 09/22] Add k8s.volume.{name,type} attributes (#1251) Signed-off-by: ChrsMark --- .chloggen/add_k8s_volume_type.yaml | 22 ++++++++++++++++++ docs/attributes-registry/k8s.md | 13 +++++++++++ model/registry/k8s.yaml | 37 ++++++++++++++++++++++++++++++ 3 files changed, 72 insertions(+) create mode 100755 .chloggen/add_k8s_volume_type.yaml diff --git a/.chloggen/add_k8s_volume_type.yaml b/.chloggen/add_k8s_volume_type.yaml new file mode 100755 index 0000000000..c9be5f9027 --- /dev/null +++ b/.chloggen/add_k8s_volume_type.yaml @@ -0,0 +1,22 @@ +# Use this changelog template to create an entry for release notes. +# +# If your change doesn't affect end users you should instead start +# your pull request title with [chore] or use the "Skip Changelog" label. + +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: enhancement + +# The name of the area of concern in the attributes-registry, (e.g. http, cloud, db) +component: k8s + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Adds `k8s.volume.name` and `k8s.volume.type` attributes to the registry + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +# The values here must be integers. +issues: [1164] + +# (Optional) One or more lines of additional information to render under the primary note. +# These lines will be padded with 2 spaces and then inserted directly into the document. +# Use pipe (|) for multiline entries. +subtext: diff --git a/docs/attributes-registry/k8s.md b/docs/attributes-registry/k8s.md index 34d2e64c88..6f4bf8cafe 100644 --- a/docs/attributes-registry/k8s.md +++ b/docs/attributes-registry/k8s.md @@ -39,6 +39,8 @@ Kubernetes resource attributes. | `k8s.replicaset.uid` | string | The UID of the ReplicaSet. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `k8s.statefulset.name` | string | The name of the StatefulSet. | `opentelemetry` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `k8s.statefulset.uid` | string | The UID of the StatefulSet. | `275ecb36-5aa8-4c2a-9c47-d8bb681b9aff` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `k8s.volume.name` | string | The name of the K8s volume. | `volume0` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `k8s.volume.type` | string | The type of the K8s volume. | `emptyDir`; `persistentVolumeClaim` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | **[1]:** K8s doesn't have support for obtaining a cluster ID. If this is ever added, we will recommend collecting the `k8s.cluster.uid` through the @@ -63,6 +65,17 @@ Which states: Therefore, UIDs between clusters should be extremely unlikely to conflict. +`k8s.volume.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. + +| Value | Description | Stability | +| ----------------------- | ----------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------- | +| `configMap` | A [configMap](https://v1-29.docs.kubernetes.io/docs/concepts/storage/volumes/#configmap) volume | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `downwardAPI` | A [downwardAPI](https://v1-29.docs.kubernetes.io/docs/concepts/storage/volumes/#downwardapi) volume | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `emptyDir` | An [emptyDir](https://v1-29.docs.kubernetes.io/docs/concepts/storage/volumes/#emptydir) volume | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `local` | A [local](https://v1-29.docs.kubernetes.io/docs/concepts/storage/volumes/#local) volume | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `persistentVolumeClaim` | A [persistentVolumeClaim](https://v1-29.docs.kubernetes.io/docs/concepts/storage/volumes/#persistentvolumeclaim) volume | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `secret` | A [secret](https://v1-29.docs.kubernetes.io/docs/concepts/storage/volumes/#secret) volume | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + ## Deprecated Kubernetes Attributes Describes deprecated k8s attributes. diff --git a/model/registry/k8s.yaml b/model/registry/k8s.yaml index 42da6ab238..6767f3575e 100644 --- a/model/registry/k8s.yaml +++ b/model/registry/k8s.yaml @@ -177,3 +177,40 @@ groups: brief: > The name of the CronJob. examples: ['opentelemetry'] + - id: k8s.volume.name + type: string + stability: experimental + brief: > + The name of the K8s volume. + examples: [ 'volume0' ] + - id: k8s.volume.type + stability: experimental + brief: > + The type of the K8s volume. + examples: [ "emptyDir", "persistentVolumeClaim" ] + type: + members: + - id: persistent_volume_claim + value: 'persistentVolumeClaim' + brief: "A [persistentVolumeClaim](https://v1-29.docs.kubernetes.io/docs/concepts/storage/volumes/#persistentvolumeclaim) volume" + stability: experimental + - id: config_map + value: 'configMap' + brief: "A [configMap](https://v1-29.docs.kubernetes.io/docs/concepts/storage/volumes/#configmap) volume" + stability: experimental + - id: downward_api + value: 'downwardAPI' + brief: "A [downwardAPI](https://v1-29.docs.kubernetes.io/docs/concepts/storage/volumes/#downwardapi) volume" + stability: experimental + - id: empty_dir + value: 'emptyDir' + brief: "An [emptyDir](https://v1-29.docs.kubernetes.io/docs/concepts/storage/volumes/#emptydir) volume" + stability: experimental + - id: secret + value: 'secret' + brief: "A [secret](https://v1-29.docs.kubernetes.io/docs/concepts/storage/volumes/#secret) volume" + stability: experimental + - id: local + value: 'local' + brief: "A [local](https://v1-29.docs.kubernetes.io/docs/concepts/storage/volumes/#local) volume" + stability: experimental From ae0e0661ee738a589e4fd45424f95f9ed8770d83 Mon Sep 17 00:00:00 2001 From: Aaron Clawson <3766680+MadVikingGod@users.noreply.github.com> Date: Thu, 15 Aug 2024 01:52:21 +0200 Subject: [PATCH 10/22] Add tests for rego policies (#1334) Co-authored-by: Aaron Clawson Co-authored-by: Liudmila Molkova --- Makefile | 5 +++++ policies/registry_test.rego | 24 ++++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 policies/registry_test.rego diff --git a/Makefile b/Makefile index a424f222f6..9976671c68 100644 --- a/Makefile +++ b/Makefile @@ -120,6 +120,11 @@ check-policies: --diagnostic-format=ansi \ --policy=/policies/registry.rego +# Test rego policies +.PHONY: test-policies +test-policies: + docker run --rm -v $(PWD)/policies:/policies openpolicyagent/opa:0.67.1 test --explain fails /policies + # Generate markdown tables from YAML definitions .PHONY: table-generation table-generation: diff --git a/policies/registry_test.rego b/policies/registry_test.rego new file mode 100644 index 0000000000..4880af7b0f --- /dev/null +++ b/policies/registry_test.rego @@ -0,0 +1,24 @@ +package before_resolution_test + +import data.before_resolution + +import future.keywords.if + +test_registry_attribute_groups if { + count(before_resolution.deny) > 0 with input as {"groups": [{"id": "registry.test", "type": "foo"}]} + count(before_resolution.deny) == 0 with input as {"groups": [{"id": "registry.test", "type": "attribute_group"}]} +} + +test_attribute_ids if { + # This requires a prefix for use with opa, but weaver will fill in. + count(before_resolution.deny) > 0 with input as {"groups": [{"id": "not_registry", "prefix": "", "attributes": [{"id": "foo"}]}]} + count(before_resolution.deny) == 0 with input as {"groups": [ + {"id": "registry.test", "prefix": "", "attributes": [{"id": "foo"}]}, + {"id": "not_registry", "prefix": "", "attributes": [{"ref": "foo"}]}, + ]} +} + +test_attribute_refs if { + count(before_resolution.deny) > 0 with input as {"groups": [{"id": "registry.foo", "attributes": [{"ref": "foo"}]}]} + count(before_resolution.deny) == 0 with input as {"groups": [{"id": "not_registry", "attributes": [{"ref": "foo"}]}]} +} From 03b67bf424d8089aeb11f4382eca4e5c75b14027 Mon Sep 17 00:00:00 2001 From: Marylia Gutierrez Date: Wed, 14 Aug 2024 20:38:41 -0400 Subject: [PATCH 11/22] add `nodejs.eventloop.time` metric (#1259) Co-authored-by: Liudmila Molkova --- .chloggen/nodejs-runtime-utilization.yaml | 17 +++++++ .github/ISSUE_TEMPLATE/bug_report.yaml | 1 + .github/ISSUE_TEMPLATE/change_proposal.yaml | 1 + .github/ISSUE_TEMPLATE/new-conventions.yaml | 1 + docs/attributes-registry/README.md | 1 + docs/attributes-registry/nodejs.md | 22 +++++++++ docs/runtime/nodejs-metrics.md | 53 ++++++++++++++++++++- model/metrics/nodejs-metrics.yaml | 16 ++++++- model/registry/nodejs.yaml | 19 ++++++++ 9 files changed, 129 insertions(+), 2 deletions(-) create mode 100644 .chloggen/nodejs-runtime-utilization.yaml create mode 100644 docs/attributes-registry/nodejs.md create mode 100644 model/registry/nodejs.yaml diff --git a/.chloggen/nodejs-runtime-utilization.yaml b/.chloggen/nodejs-runtime-utilization.yaml new file mode 100644 index 0000000000..a0a2272770 --- /dev/null +++ b/.chloggen/nodejs-runtime-utilization.yaml @@ -0,0 +1,17 @@ +# Use this changelog template to create an entry for release notes. +# +# If your change doesn't affect end users you should instead start +# your pull request title with [chore] or use the "Skip Changelog" label. + +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: enhancement + +# The name of the area of concern in the attributes-registry, (e.g. http, cloud, db) +component: nodejs + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Adding `nodejs.eventloop.time` metric to Node.js runtime metrics. + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +# The values here must be integers. +issues: [1259] diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml index 8a7e8aee67..ef601a5b8e 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yaml +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -59,6 +59,7 @@ body: - area:log - area:messaging - area:network + - area:nodejs - area:oci - area:opentracing - area:os diff --git a/.github/ISSUE_TEMPLATE/change_proposal.yaml b/.github/ISSUE_TEMPLATE/change_proposal.yaml index d924b6fe58..d2a5bca98c 100644 --- a/.github/ISSUE_TEMPLATE/change_proposal.yaml +++ b/.github/ISSUE_TEMPLATE/change_proposal.yaml @@ -51,6 +51,7 @@ body: - area:log - area:messaging - area:network + - area:nodejs - area:oci - area:opentracing - area:os diff --git a/.github/ISSUE_TEMPLATE/new-conventions.yaml b/.github/ISSUE_TEMPLATE/new-conventions.yaml index ca0f864b07..610edd03cb 100644 --- a/.github/ISSUE_TEMPLATE/new-conventions.yaml +++ b/.github/ISSUE_TEMPLATE/new-conventions.yaml @@ -60,6 +60,7 @@ body: - area:log - area:messaging - area:network + - area:nodejs - area:oci - area:opentracing - area:os diff --git a/docs/attributes-registry/README.md b/docs/attributes-registry/README.md index f4a53171a0..119a6c1437 100644 --- a/docs/attributes-registry/README.md +++ b/docs/attributes-registry/README.md @@ -72,6 +72,7 @@ Currently, the following namespaces exist: - [Log](log.md) - [Messaging](messaging.md) - [Network](network.md) +- [NodeJS](nodejs.md) - [OCI](oci.md) - [OpenTracing](opentracing.md) - [OS](os.md) diff --git a/docs/attributes-registry/nodejs.md b/docs/attributes-registry/nodejs.md new file mode 100644 index 0000000000..f00fa220bf --- /dev/null +++ b/docs/attributes-registry/nodejs.md @@ -0,0 +1,22 @@ + + + + + +# NodeJS + +## Node.js Attributes + +Describes Node.js related attributes. + +| Attribute | Type | Description | Examples | Stability | +| ------------------------ | ------ | ----------------------------- | ---------------- | ---------------------------------------------------------------- | +| `nodejs.eventloop.state` | string | The state of event loop time. | `active`; `idle` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + +`nodejs.eventloop.state` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. + +| Value | Description | Stability | +| -------- | ------------ | ---------------------------------------------------------------- | +| `active` | Active time. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `idle` | Idle time. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | diff --git a/docs/runtime/nodejs-metrics.md b/docs/runtime/nodejs-metrics.md index 5d01a28341..f53ce11373 100644 --- a/docs/runtime/nodejs-metrics.md +++ b/docs/runtime/nodejs-metrics.md @@ -21,6 +21,7 @@ This document describes semantic conventions for Node.js Runtime metrics in Open - [Metric: `nodejs.eventloop.delay.p90`](#metric-nodejseventloopdelayp90) - [Metric: `nodejs.eventloop.delay.p99`](#metric-nodejseventloopdelayp99) - [Metric: `nodejs.eventloop.utilization`](#metric-nodejseventlooputilization) + - [Metric: `nodejs.eventloop.time`](#metric-nodejseventlooptime) @@ -316,7 +317,7 @@ This metric is [recommended][MetricRecommended]. | `nodejs.eventloop.utilization` | Gauge | `1` | Event loop utilization. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -**[1]:** The value range is [0.0,1.0] and can be retrieved from value [`performance.eventLoopUtilization([utilization1[, utilization2]])`](https://nodejs.org/api/perf_hooks.html#performanceeventlooputilizationutilization1-utilization2) +**[1]:** The value range is [0.0, 1.0] and can be retrieved from [`performance.eventLoopUtilization([utilization1[, utilization2]])`](https://nodejs.org/api/perf_hooks.html#performanceeventlooputilizationutilization1-utilization2) @@ -333,6 +334,56 @@ This metric is [recommended][MetricRecommended]. + + + + + +### Metric: `nodejs.eventloop.time` + +This metric is [recommended][MetricRecommended]. + + + + + + + + +| Name | Instrument Type | Unit (UCUM) | Description | Stability | +| -------- | --------------- | ----------- | -------------- | --------- | +| `nodejs.eventloop.time` | Counter | `s` | Cumulative duration of time the event loop has been in each state. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + + +**[1]:** Value can be retrieved from [`performance.eventLoopUtilization([utilization1[, utilization2]])`](https://nodejs.org/api/perf_hooks.html#performanceeventlooputilizationutilization1-utilization2) + + + + + + + + + + + + + + + +| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | +|---|---|---|---|---|---| +| [`nodejs.eventloop.state`](/docs/attributes-registry/nodejs.md) | string | The state of event loop time. | `active`; `idle` | `Required` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + +`nodejs.eventloop.state` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. + +| Value | Description | Stability | +|---|---|---| +| `active` | Active time. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `idle` | Idle time. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + + + diff --git a/model/metrics/nodejs-metrics.yaml b/model/metrics/nodejs-metrics.yaml index 9def4fa143..3c10b18fc3 100644 --- a/model/metrics/nodejs-metrics.yaml +++ b/model/metrics/nodejs-metrics.yaml @@ -77,5 +77,19 @@ groups: unit: "1" stability: experimental note: > - The value range is [0.0,1.0] and can be retrieved from value + The value range is [0.0, 1.0] and can be retrieved from + [`performance.eventLoopUtilization([utilization1[, utilization2]])`](https://nodejs.org/api/perf_hooks.html#performanceeventlooputilizationutilization1-utilization2) + + - id: metric.nodejs.eventloop.time + type: metric + metric_name: nodejs.eventloop.time + brief: "Cumulative duration of time the event loop has been in each state." + instrument: counter + unit: "s" + stability: experimental + attributes: + - ref: nodejs.eventloop.state + requirement_level: required + note: > + Value can be retrieved from [`performance.eventLoopUtilization([utilization1[, utilization2]])`](https://nodejs.org/api/perf_hooks.html#performanceeventlooputilizationutilization1-utilization2) diff --git a/model/registry/nodejs.yaml b/model/registry/nodejs.yaml new file mode 100644 index 0000000000..2f5ded1bdc --- /dev/null +++ b/model/registry/nodejs.yaml @@ -0,0 +1,19 @@ +groups: + - id: registry.nodejs + type: attribute_group + brief: Describes Node.js related attributes. + display_name: Node.js Attributes + attributes: + - id: nodejs.eventloop.state + stability: experimental + brief: The state of event loop time. + type: + members: + - id: active + value: 'active' + brief: 'Active time.' + stability: experimental + - id: idle + value: 'idle' + brief: 'Idle time.' + stability: experimental From 93d2cbe26907934ed571175575794cc3e23e95f7 Mon Sep 17 00:00:00 2001 From: Nev <54870357+MSNev@users.noreply.github.com> Date: Sun, 18 Aug 2024 11:47:12 -0700 Subject: [PATCH 12/22] chore: Remove support for the event `fields` referencing/inheriting definitions from global attributes. (#1340) --- .chloggen/remove_body_field_ref.yaml | 22 ++++++++++++++++++++++ docs/general/events.md | 3 --- 2 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 .chloggen/remove_body_field_ref.yaml diff --git a/.chloggen/remove_body_field_ref.yaml b/.chloggen/remove_body_field_ref.yaml new file mode 100644 index 0000000000..d1ae09f088 --- /dev/null +++ b/.chloggen/remove_body_field_ref.yaml @@ -0,0 +1,22 @@ +# Use this changelog template to create an entry for release notes. +# +# If your change doesn't affect end users you should instead start +# your pull request title with [chore] or use the "Skip Changelog" label. + +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: deprecation + +# The name of the area of concern in the attributes-registry, (e.g. http, cloud, db) +component: event + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Remove support for the event `fields` supporting referencing / inheriting fields from global attributes. + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +# The values here must be integers. +issues: [1341] + +# (Optional) One or more lines of additional information to render under the primary note. +# These lines will be padded with 2 spaces and then inserted directly into the document. +# Use pipe (|) for multiline entries. +subtext: diff --git a/docs/general/events.md b/docs/general/events.md index 8495a66555..9ab0c8ec0f 100644 --- a/docs/general/events.md +++ b/docs/general/events.md @@ -101,9 +101,6 @@ Recommendations on using attributes vs. body fields: * The _fields_ are unique to the named event (`event.name`) and different events may use the same _field_ name to represent different data, due to the unique nature of the event. -* The _fields_ MAY reference / inherit details from the attribute registry - attributes and provide additional details specific to the event, including - providing an _alias_ (shorter) name for the attribute. ## External event compatibility From f41155462cf3f8019e0338908c96c9ff399f60a4 Mon Sep 17 00:00:00 2001 From: Josh Suereth Date: Mon, 19 Aug 2024 11:05:56 -0400 Subject: [PATCH 13/22] Attempt to optimise attribute name collision checks. (#1328) Co-authored-by: Liudmila Molkova --- policies/attribute_name_collisions.rego | 43 ++++++++++++++++--------- 1 file changed, 28 insertions(+), 15 deletions(-) diff --git a/policies/attribute_name_collisions.rego b/policies/attribute_name_collisions.rego index 3d38dab177..a1f99080ac 100644 --- a/policies/attribute_name_collisions.rego +++ b/policies/attribute_name_collisions.rego @@ -1,25 +1,42 @@ package after_resolution +# Data structures to make checking things faster. +attribute_names := { data | + group := input.groups[_] + attr := group.attributes[_] + data := { "name": attr.name, "const_name": to_const_name(attr.name), "namespace_prefix": to_namespace_prefix(attr.name) } +} + + deny[attr_registry_collision(description, name)] { - names := attr_names_except(excluded_const_collisions) - name := names[_] - const_name := to_const_name(name) - collisions:= { n | n := attr_names_except(excluded_const_collisions)[_]; n != name; to_const_name(n) == const_name } + some i + name := attribute_names[i].name + const_name := attribute_names[i].const_name + not excluded_const_collisions[name] + collisions := [other.name | + other := attribute_names[_] + other.name != name + other.const_name == const_name + not excluded_const_collisions[other.name] + ] count(collisions) > 0 - # TODO (https://github.com/open-telemetry/weaver/issues/279): provide other violation properties once weaver supports it. description := sprintf("Attribute '%s' has the same constant name '%s' as '%s'.", [name, const_name, collisions]) } deny[attr_registry_collision(description, name)] { - names := attr_names_except(excluded_namespace_collisions) - name := names[_] - - collisions:= { n | n := input.groups[_].attributes[_].name; startswith(n, to_namespace_prefix(name)) } + some i + name := attribute_names[i].name + prefix := attribute_names[i].namespace_prefix + not excluded_namespace_collisions[name] + collisions := [other.name | + other := attribute_names[_] + other.name != name + startswith(other.name, prefix) + ] count(collisions) > 0 - # TODO (https://github.com/open-telemetry/weaver/issues/279): provide other violation properties once weaver supports it. - description := sprintf("Attribute '%s' name is used as a namespace in the following attributes '%s'.", [name, collisions]) + description := sprintf("Attribute '%s' is used as a namespace in '%s'.", [name, collisions]) } attr_registry_collision(description, attr_name) = violation { @@ -40,10 +57,6 @@ to_const_name(name) = const_name { const_name := replace(name, ".", "_") } -attr_names_except(excluded) = names { - names := { n | n := input.groups[_].attributes[_].name } - excluded -} - # These lists contain exceptions for existing collisions that were introduced unintentionally. # We'll have a way to specify how collision resolution happens in the schema - # see phase 2 in https://github.com/open-telemetry/semantic-conventions/issues/1118#issuecomment-2173803006 From daa0a1481d041278a250481d5da6cf6f7de76ee5 Mon Sep 17 00:00:00 2001 From: Josh Suereth Date: Mon, 19 Aug 2024 12:24:07 -0400 Subject: [PATCH 14/22] (chore) Add dependabot config to keep tooling up to date. (#1346) Co-authored-by: Armin Ruech <7052238+arminru@users.noreply.github.com> --- .github/dependabot.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000000..2096989492 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,20 @@ +version: 2 +updates: + - package-ecosystem: "docker" + directory: "/" + schedule: + interval: "weekly" + day: "sunday" + - package-ecosystem: "github-actions" + directory: ".github" + schedule: + interval: "weekly" + day: "sunday" + - package-ecosystem: "gomod" + directory: "internal/tools" + schedule: + interval: "daily" + - package-ecosystem: "npm" + directory: "/" + schedule: + interval: "daily" From bc8a63c7849a7a60c9747ff540ca9530e1426b65 Mon Sep 17 00:00:00 2001 From: Christos Markou Date: Mon, 19 Aug 2024 22:53:46 +0530 Subject: [PATCH 15/22] Fix broken docker link (#1332) Signed-off-by: ChrsMark Co-authored-by: Liudmila Molkova --- .chloggen/fix_docker_link.yaml | 22 ++++++++++++++++++++++ docs/attributes-registry/container.md | 2 +- docs/resource/container.md | 2 +- model/registry/container.yaml | 2 +- 4 files changed, 25 insertions(+), 3 deletions(-) create mode 100755 .chloggen/fix_docker_link.yaml diff --git a/.chloggen/fix_docker_link.yaml b/.chloggen/fix_docker_link.yaml new file mode 100755 index 0000000000..4fb908699a --- /dev/null +++ b/.chloggen/fix_docker_link.yaml @@ -0,0 +1,22 @@ +# Use this changelog template to create an entry for release notes. +# +# If your change doesn't affect end users you should instead start +# your pull request title with [chore] or use the "Skip Changelog" label. + +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: bug_fix + +# The name of the area of concern in the attributes-registry, (e.g. http, cloud, db) +component: container + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Fixes broken link + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +# The values here must be integers. +issues: [1332] + +# (Optional) One or more lines of additional information to render under the primary note. +# These lines will be padded with 2 spaces and then inserted directly into the document. +# Use pipe (|) for multiline entries. +subtext: diff --git a/docs/attributes-registry/container.md b/docs/attributes-registry/container.md index e49671a135..187f973818 100644 --- a/docs/attributes-registry/container.md +++ b/docs/attributes-registry/container.md @@ -18,7 +18,7 @@ A container instance. | `container.command` | string | The command used to run the container (i.e. the command name). [1] | `otelcontribcol` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `container.command_args` | string[] | All the command arguments (including the command/executable itself) run by the container. [2] | `["otelcontribcol", "--config", "config.yaml"]` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `container.command_line` | string | The full command run by the container as a single string representing the full command. [2] | `otelcontribcol --config config.yaml` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `container.id` | string | Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/reference/run/#container-identification). The UUID might be abbreviated. | `a3bf90e006b2` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `container.id` | string | Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/containers/run/#container-identification). The UUID might be abbreviated. | `a3bf90e006b2` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `container.image.id` | string | Runtime specific image identifier. Usually a hash algorithm followed by a UUID. [2] | `sha256:19c92d0a00d1b66d897bceaa7319bee0dd38a10a851c60bcec9474aa3f01e50f` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `container.image.name` | string | Name of the image the container was built on. | `gcr.io/opentelemetry/operator` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `container.image.repo_digests` | string[] | Repo digests of the container image as provided by the container runtime. [3] | `["example@sha256:afcc7f1ac1b49db317a7196c902e61c6c3c4607d63599ee1a82d702d249a0ccb", "internal.registry.example.com:5000/example@sha256:b69959407d21e8a062e0416bf13405bb2b71ed7a84dde4158ebafacfa06f5578"]` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | diff --git a/docs/resource/container.md b/docs/resource/container.md index 1720bf2a20..84be2ca779 100644 --- a/docs/resource/container.md +++ b/docs/resource/container.md @@ -15,7 +15,7 @@ | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| -| [`container.id`](/docs/attributes-registry/container.md) | string | Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/reference/run/#container-identification). The UUID might be abbreviated. | `a3bf90e006b2` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| [`container.id`](/docs/attributes-registry/container.md) | string | Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/containers/run/#container-identification). The UUID might be abbreviated. | `a3bf90e006b2` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`container.image.id`](/docs/attributes-registry/container.md) | string | Runtime specific image identifier. Usually a hash algorithm followed by a UUID. [1] | `sha256:19c92d0a00d1b66d897bceaa7319bee0dd38a10a851c60bcec9474aa3f01e50f` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`container.image.name`](/docs/attributes-registry/container.md) | string | Name of the image the container was built on. | `gcr.io/opentelemetry/operator` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | [`container.image.repo_digests`](/docs/attributes-registry/container.md) | string[] | Repo digests of the container image as provided by the container runtime. [2] | `["example@sha256:afcc7f1ac1b49db317a7196c902e61c6c3c4607d63599ee1a82d702d249a0ccb", "internal.registry.example.com:5000/example@sha256:b69959407d21e8a062e0416bf13405bb2b71ed7a84dde4158ebafacfa06f5578"]` | `Recommended` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | diff --git a/model/registry/container.yaml b/model/registry/container.yaml index 80842e01b1..090c7bddff 100644 --- a/model/registry/container.yaml +++ b/model/registry/container.yaml @@ -16,7 +16,7 @@ groups: stability: experimental brief: > Container ID. Usually a UUID, as for example used to - [identify Docker containers](https://docs.docker.com/engine/reference/run/#container-identification). + [identify Docker containers](https://docs.docker.com/engine/containers/run/#container-identification). The UUID might be abbreviated. examples: ['a3bf90e006b2'] - id: container.runtime From a5f86610ffc90d6b2201ee8f3c9e782a0e0fd721 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Aug 2024 10:28:58 -0700 Subject: [PATCH 16/22] Bump markdownlint-cli from 0.31.0 to 0.41.0 (#1349) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Liudmila Molkova --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5e0caa6351..4a115101ef 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "markdown-link-check": "3.11.2", "markdown-toc": "^1.2.0", "markdownlint": "0.34.0", - "markdownlint-cli": "0.31.0", + "markdownlint-cli": "0.41.0", "prettier": "^3.0.0", "through2": "^4.0.2" }, From d996cd934b66aaa5d1ee0168f79c5ed8112f11eb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Aug 2024 17:30:09 +0000 Subject: [PATCH 17/22] Bump go.opentelemetry.io/build-tools/chloggen from 0.12.0 to 0.14.0 in /internal/tools (#1350) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Liudmila Molkova --- internal/tools/go.mod | 2 +- internal/tools/go.sum | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/internal/tools/go.mod b/internal/tools/go.mod index d0b9f54cf0..19c93e3b51 100644 --- a/internal/tools/go.mod +++ b/internal/tools/go.mod @@ -4,5 +4,5 @@ go 1.12 require ( github.com/client9/misspell v0.3.4 - go.opentelemetry.io/build-tools/chloggen v0.12.0 + go.opentelemetry.io/build-tools/chloggen v0.14.0 ) diff --git a/internal/tools/go.sum b/internal/tools/go.sum index 67e22ae48f..0557134bfd 100644 --- a/internal/tools/go.sum +++ b/internal/tools/go.sum @@ -1,6 +1,6 @@ github.com/client9/misspell v0.3.4 h1:ta993UF76GwbvJcIo3Y68y/M3WxlpEHPWIGDkJYwzJI= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -9,19 +9,21 @@ github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLf github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= -github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= +github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= +github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -go.opentelemetry.io/build-tools/chloggen v0.12.0 h1:BFj/1bNIGxOs1GykGjhV4gycz1nqVWI/xVDUaVfNibw= -go.opentelemetry.io/build-tools/chloggen v0.12.0/go.mod h1:zuYbAo3TkrHo3C7lCrM5dHWSS50BDr0UfRYtyBFv2dQ= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +go.opentelemetry.io/build-tools/chloggen v0.14.0 h1:qVal1JO6V5xTaQ6b07eBAcc0jyCblk8lfVAJHijwqFk= +go.opentelemetry.io/build-tools/chloggen v0.14.0/go.mod h1:+lbmAIYUT2OewAXITyvPACRxruPm44tNH4k6hIUuasE= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= From a10e75f8288abb037ea879c2a9e5d120b075e94a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Aug 2024 10:37:04 -0700 Subject: [PATCH 18/22] Bump gulp from 4.0.2 to 5.0.0 (#1348) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4a115101ef..ffcb435581 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "test": "npm run check" }, "devDependencies": { - "gulp": "^4.0.2", + "gulp": "^5.0.0", "js-yaml": "^4.1.0", "markdown-link-check": "3.11.2", "markdown-toc": "^1.2.0", From fd0f2e74eb0ab31165629a57d5d4401046344442 Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Mon, 19 Aug 2024 13:14:01 -0700 Subject: [PATCH 19/22] Fix link anchors (#1354) --- docs/attributes-registry/db.md | 2 +- docs/general/attributes.md | 4 ++-- docs/messaging/gcp-pubsub.md | 2 +- model/registry/db.yaml | 2 +- model/trace/messaging.yaml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/attributes-registry/db.md b/docs/attributes-registry/db.md index 17c74bbf82..0e869e4f0d 100644 --- a/docs/attributes-registry/db.md +++ b/docs/attributes-registry/db.md @@ -24,7 +24,7 @@ This group defines the attributes used to describe telemetry in the context of d | `db.client.connection.state` | string | The state of a connection in the pool | `idle` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `db.collection.name` | string | The name of a collection (table, container) within the database. [1] | `public.users`; `customers` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `db.namespace` | string | The name of the database, fully qualified within the server address and port. [2] | `customers`; `test.users` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `db.operation.batch.size` | int | The number of queries included in a [batch operation](/docs/database/database-spans.md#batch-operations). [3] | `2`; `3`; `4` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `db.operation.batch.size` | int | The number of queries included in a batch operation. [3] | `2`; `3`; `4` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `db.operation.name` | string | The name of the operation or command being executed. [4] | `findAndModify`; `HMSET`; `SELECT` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `db.query.parameter.` | string | A query parameter used in `db.query.text`, with `` being the parameter name, and the attribute value being a string representation of the parameter value. [5] | `someval`; `55` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `db.query.text` | string | The database query being executed. [6] | `SELECT * FROM wuser_table where username = ?`; `SET mykey "WuValue"` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | diff --git a/docs/general/attributes.md b/docs/general/attributes.md index a1ce082ad6..62f572e00e 100644 --- a/docs/general/attributes.md +++ b/docs/general/attributes.md @@ -25,7 +25,7 @@ Particular operations may refer to or require some of these attributes. - [Destination](#destination) - [Other network attributes](#other-network-attributes) - [`network.peer.*` and `network.local.*` attributes](#networkpeer-and-networklocal-attributes) - - [Client/server examples using `network.peer.*`](#clientserver-examples-using--networkpeer) + - [Client/server examples using `network.peer.*`](#clientserver-examples-using-networkpeer) - [Simple client/server example](#simple-clientserver-example) - [Client/server example with reverse proxy](#clientserver-example-with-reverse-proxy) - [Client/server example with forward proxy](#clientserver-example-with-forward-proxy) @@ -288,7 +288,7 @@ of `sockaddr_in` structure. ([Linux or other POSIX systems](https://man7.org/linux/man-pages/man2/getsockname.2.html) / [Windows](https://docs.microsoft.com/windows/win32/api/winsock2/nf-winsock2-getsockname)). -##### Client/server examples using `network.peer.*` +##### Client/server examples using `network.peer.*` Note that `network.local.*` attributes are not included in these examples since they are typically Opt-In. diff --git a/docs/messaging/gcp-pubsub.md b/docs/messaging/gcp-pubsub.md index 8077d03b5c..9bbcc160ed 100644 --- a/docs/messaging/gcp-pubsub.md +++ b/docs/messaging/gcp-pubsub.md @@ -44,7 +44,7 @@ If one of them applies, then the respective value MUST be used; otherwise, a cus - `send` for publishing operations - `modack` for extending the lease for a single message or batch of messages - `subscribe` for operations that represent the time from after the message was received to when the message is acknowledged, negatively acknowledged, or expired. -- `create` and `receive` for [common messaging operations](/docs/messaging/messaging-spans.md#common-messaging-operations) +- `create` and `receive` for [common messaging operations](/docs/messaging/messaging-spans.md#operation-types) **[2]:** The `error.type` SHOULD be predictable, and SHOULD have low cardinality. diff --git a/model/registry/db.yaml b/model/registry/db.yaml index 98bce99130..c2a8cd50ad 100644 --- a/model/registry/db.yaml +++ b/model/registry/db.yaml @@ -79,7 +79,7 @@ groups: - id: db.operation.batch.size type: int stability: experimental - brief: The number of queries included in a [batch operation](/docs/database/database-spans.md#batch-operations). + brief: The number of queries included in a batch operation. note: > Operations are only considered batches when they contain two or more operations, and so `db.operation.batch.size` SHOULD never be `1`. diff --git a/model/trace/messaging.yaml b/model/trace/messaging.yaml index c429f7a542..cc10819f8a 100644 --- a/model/trace/messaging.yaml +++ b/model/trace/messaging.yaml @@ -205,7 +205,7 @@ groups: - `send` for publishing operations - `modack` for extending the lease for a single message or batch of messages - `subscribe` for operations that represent the time from after the message was received to when the message is acknowledged, negatively acknowledged, or expired. - - `create` and `receive` for [common messaging operations](/docs/messaging/messaging-spans.md#common-messaging-operations) + - `create` and `receive` for [common messaging operations](/docs/messaging/messaging-spans.md#operation-types) - id: messaging.servicebus type: attribute_group extends: attributes.messaging.trace.minimal From 1c6bd0009a8c6e2ac390d171bde83134dece77b1 Mon Sep 17 00:00:00 2001 From: Marylia Gutierrez Date: Mon, 19 Aug 2024 23:32:09 -0400 Subject: [PATCH 20/22] chore: update ids (#1352) Co-authored-by: Liudmila Molkova --- docs/runtime/nodejs-metrics.md | 12 ++++++------ model/metrics/nodejs-metrics.yaml | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/runtime/nodejs-metrics.md b/docs/runtime/nodejs-metrics.md index f53ce11373..65f86743f1 100644 --- a/docs/runtime/nodejs-metrics.md +++ b/docs/runtime/nodejs-metrics.md @@ -191,7 +191,7 @@ This metric is [recommended][MetricRecommended]. This metric is [recommended][MetricRecommended]. - + @@ -212,7 +212,7 @@ This metric is [recommended][MetricRecommended]. - + @@ -229,7 +229,7 @@ This metric is [recommended][MetricRecommended]. This metric is [recommended][MetricRecommended]. - + @@ -250,7 +250,7 @@ This metric is [recommended][MetricRecommended]. - + @@ -267,7 +267,7 @@ This metric is [recommended][MetricRecommended]. This metric is [recommended][MetricRecommended]. - + @@ -288,7 +288,7 @@ This metric is [recommended][MetricRecommended]. - + diff --git a/model/metrics/nodejs-metrics.yaml b/model/metrics/nodejs-metrics.yaml index 3c10b18fc3..fb6662310b 100644 --- a/model/metrics/nodejs-metrics.yaml +++ b/model/metrics/nodejs-metrics.yaml @@ -39,7 +39,7 @@ groups: note: > Value can be retrieved from value `histogram.stddev` of [`perf_hooks.monitorEventLoopDelay([options])`](https://nodejs.org/api/perf_hooks.html#perf_hooksmonitoreventloopdelayoptions) - - id: metric.nodejs.eventloop.delay.pfifty + - id: metric.nodejs.eventloop.delay.p50 type: metric metric_name: nodejs.eventloop.delay.p50 brief: "Event loop 50 percentile delay." @@ -49,7 +49,7 @@ groups: note: > Value can be retrieved from value `histogram.percentile(50)` of [`perf_hooks.monitorEventLoopDelay([options])`](https://nodejs.org/api/perf_hooks.html#perf_hooksmonitoreventloopdelayoptions) - - id: metric.nodejs.eventloop.delay.pninety + - id: metric.nodejs.eventloop.delay.p90 type: metric metric_name: nodejs.eventloop.delay.p90 brief: "Event loop 90 percentile delay." @@ -59,7 +59,7 @@ groups: note: > Value can be retrieved from value `histogram.percentile(90)` of [`perf_hooks.monitorEventLoopDelay([options])`](https://nodejs.org/api/perf_hooks.html#perf_hooksmonitoreventloopdelayoptions) - - id: metric.nodejs.eventloop.delay.pninety_nine + - id: metric.nodejs.eventloop.delay.p99 type: metric metric_name: nodejs.eventloop.delay.p99 brief: "Event loop 99 percentile delay." From 9feb74dfbcfb7087d73651934a916bdf4fa76b70 Mon Sep 17 00:00:00 2001 From: Enrico Zimuel Date: Tue, 20 Aug 2024 11:10:43 +0200 Subject: [PATCH 21/22] Removed db.vector.id and added db.record.id, renamed db.vector.field_name --- docs/attributes-registry/db.md | 27 +++++++++++++++------------ model/registry/db.yaml | 17 ++++++++++------- 2 files changed, 25 insertions(+), 19 deletions(-) diff --git a/docs/attributes-registry/db.md b/docs/attributes-registry/db.md index 0e869e4f0d..dcd113369c 100644 --- a/docs/attributes-registry/db.md +++ b/docs/attributes-registry/db.md @@ -28,7 +28,8 @@ This group defines the attributes used to describe telemetry in the context of d | `db.operation.name` | string | The name of the operation or command being executed. [4] | `findAndModify`; `HMSET`; `SELECT` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `db.query.parameter.` | string | A query parameter used in `db.query.text`, with `` being the parameter name, and the attribute value being a string representation of the parameter value. [5] | `someval`; `55` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `db.query.text` | string | The database query being executed. [6] | `SELECT * FROM wuser_table where username = ?`; `SET mykey "WuValue"` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `db.system` | string | The database management system (DBMS) product as identified by the client instrumentation. [7] | `other_sql`; `adabas`; `cache` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `db.record.id` | string | The record identifier if present. [7] | `1`; `W0tpsmIBdwcYyG50zbta` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `db.system` | string | The database management system (DBMS) product as identified by the client instrumentation. [8] | `other_sql`; `adabas`; `cache` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | **[1]:** It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization. If the collection name is parsed from the query text, it SHOULD be the first collection name found in the query and it SHOULD match the value provided in the query text including any schema and database name prefix. @@ -51,7 +52,10 @@ If a parameter has no name and instead is referenced only by index, then `` 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 `; ` 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. -**[7]:** 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 `db.system` is set to `postgresql` based on the instrumentation's best knowledge. +**[7]:** It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization. +If the record id is parsed from the query text, it SHOULD be the first id found in the query. + +**[8]:** 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 `db.system` is set to `postgresql` based on the instrumentation's best knowledge. `db.client.connection.state` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. @@ -196,22 +200,21 @@ This group defines attributes for Elasticsearch. | Attribute | Type | Description | Examples | Stability | | ----------------------------------- | ------ | -------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------- | | `db.elasticsearch.node.name` | string | Represents the human-readable identifier of the node/instance to which a request was routed. | `instance-0000000001` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `db.elasticsearch.path_parts.` | string | A dynamic value in the url path. [8] | `db.elasticsearch.path_parts.index=test-index`; `db.elasticsearch.path_parts.doc_id=123` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `db.elasticsearch.path_parts.` | string | A dynamic value in the url path. [9] | `db.elasticsearch.path_parts.index=test-index`; `db.elasticsearch.path_parts.doc_id=123` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -**[8]:** Many Elasticsearch url paths allow dynamic values. These SHOULD be recorded in span attributes in the format `db.elasticsearch.path_parts.`, where `` is the url path part name. The implementation SHOULD reference the [elasticsearch schema](https://raw.githubusercontent.com/elastic/elasticsearch-specification/main/output/schema/schema.json) in order to map the path part values to their names. +**[9]:** Many Elasticsearch url paths allow dynamic values. These SHOULD be recorded in span attributes in the format `db.elasticsearch.path_parts.`, where `` is the url path part name. The implementation SHOULD reference the [elasticsearch schema](https://raw.githubusercontent.com/elastic/elasticsearch-specification/main/output/schema/schema.json) in order to map the path part values to their names. ## Db Vector Attributes This group defines attributes for vector databases. -| Attribute | Type | Description | Examples | Stability | -| ----------------------------- | ------ | ---------------------------------------------------- | -------------------------------------- | ---------------------------------------------------------------- | -| `db.vector.dimension_count` | int | The dimension of the vector. | `3` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `db.vector.id` | string | The ID of vector. | `5c56c793-69f3-4fbf-87e6-c4bf54c28c26` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `db.vector.model` | string | The model used for the embedding. | `text-embedding-3-small` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `db.vector.name` | string | The name field as of the vector (e.g. a field name). | `vector` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `db.vector.query.top_k` | int | The top-k most similar vectors returned by a query. | `5` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `db.vector.similarity_metric` | string | The metric used in similarity search. | `cosine` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| Attribute | Type | Description | Examples | Stability | +| ----------------------------- | ------ | ---------------------------------------------------- | ------------------------ | ---------------------------------------------------------------- | +| `db.vector.dimension_count` | int | The dimension of the vector. | `3` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `db.vector.field_name` | string | The name field as of the vector (e.g. a field name). | `vector` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `db.vector.model` | string | The model used for the embedding. | `text-embedding-3-small` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `db.vector.query.top_k` | int | The top-k most similar vectors returned by a query. | `5` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `db.vector.similarity_metric` | string | The metric used in similarity search. | `cosine` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | `db.vector.similarity_metric` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. diff --git a/model/registry/db.yaml b/model/registry/db.yaml index c2a8cd50ad..f848714dfa 100644 --- a/model/registry/db.yaml +++ b/model/registry/db.yaml @@ -18,6 +18,15 @@ groups: For batch operations, if the individual operations are known to have the same collection name then that collection name SHOULD be used, otherwise `db.collection.name` SHOULD NOT be captured. examples: ['public.users', 'customers'] + - id: db.record.id + type: string + stability: experimental + brief: The record identifier if present. + note: > + It is RECOMMENDED to capture the value as provided by the application without attempting to do any case normalization. + + If the record id is parsed from the query text, it SHOULD be the first id found in the query. + examples: ['1', 'W0tpsmIBdwcYyG50zbta'] - id: db.namespace type: string stability: experimental @@ -561,13 +570,7 @@ groups: brief: > The metric used in similarity search. examples: 'cosine' - - id: id - type: string - stability: experimental - brief: > - The ID of vector. - examples: '5c56c793-69f3-4fbf-87e6-c4bf54c28c26' - - id: name + - id: field_name type: string stability: experimental brief: > From ff03da146d929d4b2149052790bdd7ace7e488ac Mon Sep 17 00:00:00 2001 From: Enrico Zimuel Date: Wed, 25 Sep 2024 14:51:52 +0200 Subject: [PATCH 22/22] Removed db.vector.model and moved db.vector.search.similarity_metric in db.search.similarity_metric --- docs/attributes-registry/db.md | 27 +++++++++++++++++---------- model/database/registry.yaml | 19 ++++++++++--------- 2 files changed, 27 insertions(+), 19 deletions(-) diff --git a/docs/attributes-registry/db.md b/docs/attributes-registry/db.md index a64d075bac..e2633dddd9 100644 --- a/docs/attributes-registry/db.md +++ b/docs/attributes-registry/db.md @@ -10,6 +10,7 @@ - [Cassandra Attributes](#cassandra-attributes) - [Azure Cosmos DB Attributes](#azure-cosmos-db-attributes) - [Elasticsearch Attributes](#elasticsearch-attributes) +- [Search attributes](#search-attributes) - [Db Vector Attributes](#db-vector-attributes) - [Deprecated Database Attributes](#deprecated-database-attributes) - [Deprecated Database Metrics](#deprecated-database-metrics) @@ -204,19 +205,15 @@ This group defines attributes for Elasticsearch. **[9]:** Many Elasticsearch url paths allow dynamic values. These SHOULD be recorded in span attributes in the format `db.elasticsearch.path_parts.`, where `` is the url path part name. The implementation SHOULD reference the [elasticsearch schema](https://raw.githubusercontent.com/elastic/elasticsearch-specification/main/output/schema/schema.json) in order to map the path part values to their names. -## Db Vector Attributes +## Search attributes -This group defines attributes for vector databases. +This group defines attributes for Search. -| Attribute | Type | Description | Examples | Stability | -| ----------------------------- | ------ | ---------------------------------------------------- | ------------------------ | ---------------------------------------------------------------- | -| `db.vector.dimension_count` | int | The dimension of the vector. | `3` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `db.vector.field_name` | string | The name field as of the vector (e.g. a field name). | `vector` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `db.vector.model` | string | The model used for the embedding. | `text-embedding-3-small` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `db.vector.query.top_k` | int | The top-k most similar vectors returned by a query. | `5` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -| `db.vector.similarity_metric` | string | The metric used in similarity search. | `cosine` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| Attribute | Type | Description | Examples | Stability | +| ----------------------------- | ------ | ------------------------------------- | -------- | ---------------------------------------------------------------- | +| `db.search.similarity_metric` | string | The metric used in similarity search. | `cosine` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | -`db.vector.similarity_metric` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. +`db.search.similarity_metric` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. | Value | Description | Stability | | ----------- | ------------------------------ | ---------------------------------------------------------------- | @@ -225,6 +222,16 @@ This group defines attributes for vector databases. | `euclidean` | The euclidean distance metric. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | | `manhattan` | The Manhattan distance metric. | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +## Db Vector Attributes + +This group defines attributes for vector databases. + +| Attribute | Type | Description | Examples | Stability | +| --------------------------- | ------ | ---------------------------------------------------- | -------- | ---------------------------------------------------------------- | +| `db.vector.dimension_count` | int | The dimension of the vector. | `3` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `db.vector.field_name` | string | The name field as of the vector (e.g. a field name). | `vector` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | +| `db.vector.query.top_k` | int | The top-k most similar vectors returned by a query. | `5` | ![Experimental](https://img.shields.io/badge/-experimental-blue) | + ## Deprecated Database Attributes "Describes deprecated db attributes." diff --git a/model/database/registry.yaml b/model/database/registry.yaml index 9a283c2c3f..51d1f49868 100644 --- a/model/database/registry.yaml +++ b/model/database/registry.yaml @@ -541,11 +541,12 @@ groups: reference the [elasticsearch schema](https://raw.githubusercontent.com/elastic/elasticsearch-specification/main/output/schema/schema.json) in order to map the path part values to their names. examples: ['db.elasticsearch.path_parts.index=test-index', 'db.elasticsearch.path_parts.doc_id=123'] - - id: registry.db.vector - prefix: db.vector + - id: registry.db.search + prefix: db.search type: attribute_group + display_name: Search attributes brief: > - This group defines attributes for vector databases. + This group defines attributes for Search. attributes: - id: similarity_metric type: @@ -574,6 +575,12 @@ groups: brief: > The metric used in similarity search. examples: 'cosine' + - id: registry.db.vector + prefix: db.vector + type: attribute_group + brief: > + This group defines attributes for vector databases. + attributes: - id: field_name type: string stability: experimental @@ -586,12 +593,6 @@ groups: brief: > The dimension of the vector. examples: [3] - - id: model - type: string - stability: experimental - brief: > - The model used for the embedding. - examples: 'text-embedding-3-small' - id: query.top_k type: int stability: experimental