From d6aa1d01d15dbc9694930e59fc1577206532365c Mon Sep 17 00:00:00 2001 From: Robert Pajak Date: Wed, 28 Apr 2021 23:52:34 +0200 Subject: [PATCH 1/6] db.statement MAY be disabled --- CHANGELOG.md | 5 +++-- semantic_conventions/trace/database.yaml | 2 +- specification/trace/semantic_conventions/database.md | 8 +++++--- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a71ff442d0b..28ba5b4b2ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,8 +9,9 @@ release. ### Context -- Added `OTEL_EXPORTER_JAEGER_TIMEOUT` environment variable. ([#1612](https://github.com/open-telemetry/opentelemetry-specification/pull/1612)) -- Added `OTEL_EXPORTER_ZIPKIN_TIMEOUT` environment variable. ([#1636](https://github.com/open-telemetry/opentelemetry-specification/pull/1636)) +- Add `OTEL_EXPORTER_JAEGER_TIMEOUT` environment variable. ([#1612](https://github.com/open-telemetry/opentelemetry-specification/pull/1612)) +- Add `OTEL_EXPORTER_ZIPKIN_TIMEOUT` environment variable. ([#1636](https://github.com/open-telemetry/opentelemetry-specification/pull/1636)) +- `db.statement` MAY be disabled ([#1659](https://github.com/open-telemetry/opentelemetry-specification/pull/1659)) ### Traces diff --git a/semantic_conventions/trace/database.yaml b/semantic_conventions/trace/database.yaml index 830f8c25e42..a252a5582a3 100644 --- a/semantic_conventions/trace/database.yaml +++ b/semantic_conventions/trace/database.yaml @@ -185,7 +185,7 @@ groups: type: string required: conditional: > - Required if applicable. + Required if applicable or not explicitly disabled. brief: > The database statement being executed. note: The value may be sanitized to exclude sensitive information. diff --git a/specification/trace/semantic_conventions/database.md b/specification/trace/semantic_conventions/database.md index fabd4e5e79f..dce231c934e 100644 --- a/specification/trace/semantic_conventions/database.md +++ b/specification/trace/semantic_conventions/database.md @@ -146,8 +146,8 @@ Usually only one `db.name` will be used per connection though. | Attribute | Type | Description | Examples | Required | |---|---|---|---|---| | `db.name` | string | If no [tech-specific attribute](#call-level-attributes-for-specific-technologies) is defined, this attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails). [1] | `customers`; `main` | Conditional [2] | -| `db.statement` | string | The database statement being executed. [3] | `SELECT * FROM wuser_table`; `SET mykey "WuValue"` | Required if applicable. | -| `db.operation` | string | The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`, or the SQL keyword. [4] | `findAndModify`; `HMSET`; `SELECT` | Required, if `db.statement` is not applicable. | +| `db.statement` | string | The database statement being executed. [3] | `SELECT * FROM wuser_table`; `SET mykey "WuValue"` | Conditional [4] | +| `db.operation` | string | The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`, or the SQL keyword. [5] | `findAndModify`; `HMSET`; `SELECT` | Required, if `db.statement` is not applicable. | **[1]:** In some SQL databases, the database name to be used is called "schema name". @@ -155,7 +155,9 @@ Usually only one `db.name` will be used per connection though. **[3]:** The value may be sanitized to exclude sensitive information. -**[4]:** When setting this to an SQL keyword, it is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if the operation name is provided by the library being instrumented. If the SQL statement has an ambiguous operation, or performs more than one operation, this value may be omitted. +**[4]:** Required if applicable or not explicitly disabled. + +**[5]:** When setting this to an SQL keyword, it is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if the operation name is provided by the library being instrumented. If the SQL statement has an ambiguous operation, or performs more than one operation, this value may be omitted. For **Redis**, the value provided for `db.statement` SHOULD correspond to the syntax of the Redis CLI. From b2170067bfdf356fbfcf301fc09a8f93fa4e384a Mon Sep 17 00:00:00 2001 From: Robert Pajak Date: Wed, 28 Apr 2021 23:57:22 +0200 Subject: [PATCH 2/6] Fix changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 28ba5b4b2ab..f8d5a77da84 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,6 @@ release. - Add `OTEL_EXPORTER_JAEGER_TIMEOUT` environment variable. ([#1612](https://github.com/open-telemetry/opentelemetry-specification/pull/1612)) - Add `OTEL_EXPORTER_ZIPKIN_TIMEOUT` environment variable. ([#1636](https://github.com/open-telemetry/opentelemetry-specification/pull/1636)) -- `db.statement` MAY be disabled ([#1659](https://github.com/open-telemetry/opentelemetry-specification/pull/1659)) ### Traces @@ -27,6 +26,7 @@ release. - Add details for filling resource for AWS Lambda([#1610](https://github.com/open-telemetry/opentelemetry-specification/pull/1610)) - Add already specified `messaging.rabbitmq.routing_key` span attribute key to the respective YAML file. - Clarify usage of "otel." attribute namespace ([#1640](https://github.com/open-telemetry/opentelemetry-specification/pull/1640)). +- Add possibility to disable `db.statement` ([#1659](https://github.com/open-telemetry/opentelemetry-specification/pull/1659)) ### Compatibility From 2bd21101e36ce67a871caf60c2c2f8675c6ed246 Mon Sep 17 00:00:00 2001 From: Robert Pajak Date: Thu, 29 Apr 2021 00:04:31 +0200 Subject: [PATCH 3/6] Refine the changelog --- CHANGELOG.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f8d5a77da84..45ae434ce4d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,11 +22,11 @@ release. ### Semantic Conventions -- Fix the inconsistent formatting of semantic convention enums ([#1598](https://github.com/open-telemetry/opentelemetry-specification/pull/1598/)) -- Add details for filling resource for AWS Lambda([#1610](https://github.com/open-telemetry/opentelemetry-specification/pull/1610)) +- Fix the inconsistent formatting of semantic convention enums. ([#1598](https://github.com/open-telemetry/opentelemetry-specification/pull/1598/)) +- Add details for filling resource for AWS Lambda. ([#1610](https://github.com/open-telemetry/opentelemetry-specification/pull/1610)) - Add already specified `messaging.rabbitmq.routing_key` span attribute key to the respective YAML file. -- Clarify usage of "otel." attribute namespace ([#1640](https://github.com/open-telemetry/opentelemetry-specification/pull/1640)). -- Add possibility to disable `db.statement` ([#1659](https://github.com/open-telemetry/opentelemetry-specification/pull/1659)) +- Clarify usage of "otel." attribute namespace. ([#1640](https://github.com/open-telemetry/opentelemetry-specification/pull/1640)). +- Add possibility to disable `db.statement`. ([#1659](https://github.com/open-telemetry/opentelemetry-specification/pull/1659)) ### Compatibility From fd59503e1b9ddbaef46b7787f1e0ec991822d407 Mon Sep 17 00:00:00 2001 From: Robert Pajak Date: Thu, 29 Apr 2021 00:05:33 +0200 Subject: [PATCH 4/6] Remove dot from changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 45ae434ce4d..90640486008 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,7 +25,7 @@ release. - Fix the inconsistent formatting of semantic convention enums. ([#1598](https://github.com/open-telemetry/opentelemetry-specification/pull/1598/)) - Add details for filling resource for AWS Lambda. ([#1610](https://github.com/open-telemetry/opentelemetry-specification/pull/1610)) - Add already specified `messaging.rabbitmq.routing_key` span attribute key to the respective YAML file. -- Clarify usage of "otel." attribute namespace. ([#1640](https://github.com/open-telemetry/opentelemetry-specification/pull/1640)). +- Clarify usage of "otel." attribute namespace. ([#1640](https://github.com/open-telemetry/opentelemetry-specification/pull/1640)) - Add possibility to disable `db.statement`. ([#1659](https://github.com/open-telemetry/opentelemetry-specification/pull/1659)) ### Compatibility From 656cee22cf18c16db944e52409118d93837e4dd7 Mon Sep 17 00:00:00 2001 From: Robert Pajak Date: Thu, 29 Apr 2021 00:09:51 +0200 Subject: [PATCH 5/6] Disable db.statement via instrumentation configuration --- CHANGELOG.md | 2 +- semantic_conventions/trace/database.yaml | 2 +- specification/trace/semantic_conventions/database.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 90640486008..1bfecbac163 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,7 +26,7 @@ release. - Add details for filling resource for AWS Lambda. ([#1610](https://github.com/open-telemetry/opentelemetry-specification/pull/1610)) - Add already specified `messaging.rabbitmq.routing_key` span attribute key to the respective YAML file. - Clarify usage of "otel." attribute namespace. ([#1640](https://github.com/open-telemetry/opentelemetry-specification/pull/1640)) -- Add possibility to disable `db.statement`. ([#1659](https://github.com/open-telemetry/opentelemetry-specification/pull/1659)) +- Add possibility to disable `db.statement` via instrumentation configuration. ([#1659](https://github.com/open-telemetry/opentelemetry-specification/pull/1659)) ### Compatibility diff --git a/semantic_conventions/trace/database.yaml b/semantic_conventions/trace/database.yaml index a252a5582a3..304c4961321 100644 --- a/semantic_conventions/trace/database.yaml +++ b/semantic_conventions/trace/database.yaml @@ -185,7 +185,7 @@ groups: type: string required: conditional: > - Required if applicable or not explicitly disabled. + Required if applicable or not explicitly disabled via instrumentation configuration. brief: > The database statement being executed. note: The value may be sanitized to exclude sensitive information. diff --git a/specification/trace/semantic_conventions/database.md b/specification/trace/semantic_conventions/database.md index dce231c934e..f1050bdcbfc 100644 --- a/specification/trace/semantic_conventions/database.md +++ b/specification/trace/semantic_conventions/database.md @@ -155,7 +155,7 @@ Usually only one `db.name` will be used per connection though. **[3]:** The value may be sanitized to exclude sensitive information. -**[4]:** Required if applicable or not explicitly disabled. +**[4]:** Required if applicable or not explicitly disabled via instrumentation configuration. **[5]:** When setting this to an SQL keyword, it is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if the operation name is provided by the library being instrumented. If the SQL statement has an ambiguous operation, or performs more than one operation, this value may be omitted. From b1663e608b34d8de1b987aabc8eea4386d014e74 Mon Sep 17 00:00:00 2001 From: Robert Pajak Date: Thu, 29 Apr 2021 00:48:14 +0200 Subject: [PATCH 6/6] Fix logic operator --- semantic_conventions/trace/database.yaml | 2 +- specification/trace/semantic_conventions/database.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/semantic_conventions/trace/database.yaml b/semantic_conventions/trace/database.yaml index 304c4961321..220500fac69 100644 --- a/semantic_conventions/trace/database.yaml +++ b/semantic_conventions/trace/database.yaml @@ -185,7 +185,7 @@ groups: type: string required: conditional: > - Required if applicable or not explicitly disabled via instrumentation configuration. + Required if applicable and not explicitly disabled via instrumentation configuration. brief: > The database statement being executed. note: The value may be sanitized to exclude sensitive information. diff --git a/specification/trace/semantic_conventions/database.md b/specification/trace/semantic_conventions/database.md index f1050bdcbfc..234797ffeb7 100644 --- a/specification/trace/semantic_conventions/database.md +++ b/specification/trace/semantic_conventions/database.md @@ -155,7 +155,7 @@ Usually only one `db.name` will be used per connection though. **[3]:** The value may be sanitized to exclude sensitive information. -**[4]:** Required if applicable or not explicitly disabled via instrumentation configuration. +**[4]:** Required if applicable and not explicitly disabled via instrumentation configuration. **[5]:** When setting this to an SQL keyword, it is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if the operation name is provided by the library being instrumented. If the SQL statement has an ambiguous operation, or performs more than one operation, this value may be omitted.