Skip to content

Commit

Permalink
remove db.namespace from elastic
Browse files Browse the repository at this point in the history
  • Loading branch information
lmolkova committed May 3, 2024
1 parent cd99310 commit c6dae4c
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 26 deletions.
1 change: 0 additions & 1 deletion docs/database/database-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ of `[ 0.001, 0.005, 0.01, 0.05, 0.1, 0.5, 1, 5, 10 ]`.
| [`db.operation.name`](/docs/attributes-registry/db.md) | string | The name of the operation or command being executed. | `findAndModify`; `HMSET`; `SELECT` | `Conditionally Required` [4] | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`error.type`](/docs/attributes-registry/error.md) | string | Describes a class of error the operation ended with. [5] | `timeout`; `java.net.UnknownHostException`; `server_certificate_invalid`; `500` | `Conditionally Required` If and only if the operation failed. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| [`server.port`](/docs/attributes-registry/server.md) | int | Server port number. [6] | `80`; `8080`; `443` | `Conditionally Required` [7] | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| [`db.instance.id`](/docs/attributes-registry/db.md) | string | Deprecated, no general replacement at this time. For Elasticsearch, use `db.elasticsearch.node.name` instead. | `mysql-e26b99z.example.com` | `Recommended` If different from the `server.address` | ![Deprecated](https://img.shields.io/badge/-deprecated-red)<br>Deprecated, no general replacement at this time. For Elasticsearch, use `db.elasticsearch.node.name` instead. |
| [`network.peer.address`](/docs/attributes-registry/network.md) | string | Peer address of the database node where the operation was performed. [8] | `10.1.2.80`; `/tmp/my.sock` | `Recommended` If applicable for this database system. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| [`network.peer.port`](/docs/attributes-registry/network.md) | int | Peer port number of the network connection. | `65123` | `Recommended` If and only if `network.peer.address` is set. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| [`server.address`](/docs/attributes-registry/server.md) | string | Name of the database host. [9] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
Expand Down
29 changes: 13 additions & 16 deletions docs/database/elasticsearch.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,12 @@ If the endpoint id is not available, the span name SHOULD be the `http.request.m
| [`http.request.method`](/docs/attributes-registry/http.md) | string | HTTP request method. [2] | `GET`; `POST`; `HEAD` | `Required` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| [`url.full`](/docs/attributes-registry/url.md) | string | Absolute URL describing a network resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986) [3] | `https://localhost:9200/index/_search?q=user.id:kimchy` | `Required` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| [`db.elasticsearch.path_parts.<key>`](/docs/attributes-registry/db.md) | string | A dynamic value in the url path. [4] | `db.elasticsearch.path_parts.index=test-index`; `db.elasticsearch.path_parts.doc_id=123` | `Conditionally Required` when the url has dynamic values | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`db.namespace`](/docs/attributes-registry/db.md) | string | The name of the database, fully qualified within the server address and port. [5] | `customers`; `test.users` | `Conditionally Required` If available. | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`error.type`](/docs/attributes-registry/error.md) | string | Describes a class of error the operation ended with. [6] | `timeout`; `java.net.UnknownHostException`; `server_certificate_invalid`; `500` | `Conditionally Required` If and only if the operation failed. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| [`server.port`](/docs/attributes-registry/server.md) | int | Server port number. [7] | `80`; `8080`; `443` | `Conditionally Required` [8] | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| [`db.elasticsearch.cluster.name`](/docs/attributes-registry/db.md) | string | Represents the identifier of an Elasticsearch cluster. | `e9106fc68e3044f0b1475b04bf4ffd5f` | `Recommended` [9] | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`db.elasticsearch.node.name`](/docs/attributes-registry/db.md) | string | Represents the human-readable identifier of the node/instance to which a request was routed. | `instance-0000000001` | `Recommended` [10] | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`db.query.text`](/docs/attributes-registry/db.md) | string | The request body for a [search-type query](https://www.elastic.co/guide/en/elasticsearch/reference/current/search.html), as a json string. | `"{\"query\":{\"term\":{\"user.id\":\"kimchy\"}}}"` | `Recommended` [11] | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`server.address`](/docs/attributes-registry/server.md) | string | Name of the database host. [12] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| [`error.type`](/docs/attributes-registry/error.md) | string | Describes a class of error the operation ended with. [5] | `timeout`; `java.net.UnknownHostException`; `server_certificate_invalid`; `500` | `Conditionally Required` If and only if the operation failed. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| [`server.port`](/docs/attributes-registry/server.md) | int | Server port number. [6] | `80`; `8080`; `443` | `Conditionally Required` [7] | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| [`db.elasticsearch.cluster.name`](/docs/attributes-registry/db.md) | string | Represents the identifier of an Elasticsearch cluster. | `e9106fc68e3044f0b1475b04bf4ffd5f` | `Recommended` [8] | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`db.elasticsearch.node.name`](/docs/attributes-registry/db.md) | string | Represents the human-readable identifier of the node/instance to which a request was routed. | `instance-0000000001` | `Recommended` [9] | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`db.query.text`](/docs/attributes-registry/db.md) | string | The request body for a [search-type query](https://www.elastic.co/guide/en/elasticsearch/reference/current/search.html), as a json string. | `"{\"query\":{\"term\":{\"user.id\":\"kimchy\"}}}"` | `Recommended` [10] | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| [`server.address`](/docs/attributes-registry/server.md) | string | Name of the database host. [11] | `example.com`; `10.1.2.80`; `/tmp/my.sock` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |

**[1]:** This SHOULD be the endpoint identifier for the request.

Expand All @@ -61,21 +60,19 @@ Tracing instrumentations that do so, MUST also set `http.request.method_original

**[4]:** Many Elasticsearch url paths allow dynamic values. These SHOULD be recorded in span attributes in the format `db.elasticsearch.path_parts.<key>`, where `<key>` 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.

**[5]:** <!-- TODO: overriding the base note, workaround for https://github.com/open-telemetry/build-tools/issues/299 -->
**[5]:** The `error.type` SHOULD match the error code returned by the database or the client library, the canonical name of exception that occurred, or another low-cardinality error identifier. Instrumentations SHOULD document the list of errors they report.

**[6]:** The `error.type` SHOULD match the error code returned by the database or the client library, the canonical name of exception that occurred, or another low-cardinality error identifier. Instrumentations SHOULD document the list of errors they report.
**[6]:** When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available.

**[7]:** When observed from the client side, and when communicating through an intermediary, `server.port` SHOULD represent the server port behind any intermediaries, for example proxies, if it's available.
**[7]:** If using a port other than the default port for this DBMS and if `server.address` is set.

**[8]:** If using a port other than the default port for this DBMS and if `server.address` is set.
**[8]:** When communicating with an Elastic Cloud deployment, this should be collected from the "X-Found-Handling-Cluster" HTTP response header.

**[9]:** When communicating with an Elastic Cloud deployment, this should be collected from the "X-Found-Handling-Cluster" HTTP response header.
**[9]:** When communicating with an Elastic Cloud deployment, this should be collected from the "X-Found-Handling-Instance" HTTP response header.

**[10]:** When communicating with an Elastic Cloud deployment, this should be collected from the "X-Found-Handling-Instance" HTTP response header.
**[10]:** Should be collected by default for search-type queries and only if there is sanitization that excludes sensitive information.

**[11]:** Should be collected by default for search-type queries and only if there is sanitization that excludes sensitive information.

**[12]:** When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available.
**[11]:** When observed from the client side, and when communicating through an intermediary, `server.address` SHOULD represent the server address behind any intermediaries, for example proxies, if it's available.

`http.request.method` 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.

Expand Down
9 changes: 3 additions & 6 deletions model/db-common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ groups:
type: attribute_group
brief: 'Database Client attributes'
attributes:
- ref: db.namespace
requirement_level:
conditionally_required: If available.
- ref: db.operation.name
requirement_level:
conditionally_required: >
Expand Down Expand Up @@ -38,9 +35,6 @@ groups:
- ref: db.system
# TODO: Not adding to the minimal because of https://github.com/open-telemetry/build-tools/issues/192
requirement_level: required
- ref: db.instance.id
requirement_level:
recommended: If different from the `server.address`
- ref: network.peer.address
brief: Peer address of the database node where the operation was performed.
requirement_level:
Expand All @@ -53,3 +47,6 @@ groups:
- ref: network.peer.port
requirement_level:
recommended: If and only if `network.peer.address` is set.
- ref: db.namespace
requirement_level:
conditionally_required: If available.
17 changes: 14 additions & 3 deletions model/trace/database.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ groups:
- ref: db.system
# TODO: Not adding to the minimal because of https://github.com/open-telemetry/build-tools/issues/192
requirement_level: required
- ref: db.namespace
requirement_level:
conditionally_required: If available.


- id: db
type: span
Expand Down Expand Up @@ -82,6 +86,8 @@ groups:
brief: The Cassandra keyspace name.
note: For commands that switch the keyspace, this SHOULD be set to the target keyspace (even if the command fails).
examples: ["mykeyspace"]
requirement_level:
conditionally_required: If available.
- ref: db.cassandra.page_size
- ref: db.cassandra.consistency_level
- ref: db.collection.name
Expand Down Expand Up @@ -139,6 +145,8 @@ groups:
(literally, i.e., without replacing the placeholders with concrete values):
[`GET /{db}/{docid}`](https://docs.couchdb.org/en/stable/api/document/common.html#get--db-docid).
- ref: db.namespace
requirement_level:
conditionally_required: If available.
note: >
<!-- TODO: overriding the base note, workaround for https://github.com/open-telemetry/build-tools/issues/299 -->
Expand Down Expand Up @@ -197,6 +205,8 @@ groups:
requirement_level: required
- ref: db.namespace
brief: The MongoDB database name.
requirement_level:
conditionally_required: If available.
note: >
<!-- TODO: overriding the base note, workaround for https://github.com/open-telemetry/build-tools/issues/299 -->
Expand Down Expand Up @@ -235,9 +245,6 @@ groups:
- ref: db.elasticsearch.path_parts
requirement_level:
conditionally_required: when the url has dynamic values
- ref: db.namespace
note: >
<!-- TODO: overriding the base note, workaround for https://github.com/open-telemetry/build-tools/issues/299 -->

- id: db.sql
type: span
Expand All @@ -255,6 +262,8 @@ groups:
brief: The name of the SQL table that the operation is acting upon.
examples: ['users', 'dbo.products']
- ref: db.namespace
requirement_level:
conditionally_required: If available.
note: |
If a database system has multiple namespace components, they SHOULD be concatenated
(potentially using database system specific conventions) from most general to most
Expand Down Expand Up @@ -319,5 +328,7 @@ groups:
requirement_level:
conditionally_required: when available
- ref: db.namespace
requirement_level:
conditionally_required: If available.
note: >
<!-- TODO: overriding the base note, workaround for https://github.com/open-telemetry/build-tools/issues/299 -->

0 comments on commit c6dae4c

Please sign in to comment.