Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/attributes-registry/db.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ If `db.query.text` is also captured, then `db.operation.parameter.<key>` SHOULD
`db.operation.parameter.<key>` SHOULD NOT be captured on batch operations.

**[6] `db.query.summary`:** `db.query.summary` provides static summary of the query text. It describes a class of database queries and is useful as a grouping key, especially when analyzing telemetry for database calls involving complex queries.
Summary may be available to the instrumentation through instrumentation hooks or other means. If it is not available, instrumentations that support query parsing SHOULD generate a summary following [Generating query summary](../database/database-spans.md#generating-a-summary-of-the-query-text) section.
Summary may be available to the instrumentation through instrumentation hooks or other means. If it is not available, instrumentations that support query parsing SHOULD generate a summary following [Generating query summary](/docs/database/database-spans.md#generating-a-summary-of-the-query-text) section.

**[7] `db.query.text`:** For sanitization see [Sanitization of `db.query.text`](../database/database-spans.md#sanitization-of-dbquerytext).
**[7] `db.query.text`:** For sanitization see [Sanitization of `db.query.text`](/docs/database/database-spans.md#sanitization-of-dbquerytext).
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.

Expand Down
34 changes: 26 additions & 8 deletions docs/cli/cli-spans.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,6 @@ linkTitle: CLI programs

This document defines semantic conventions to apply when instrumenting CLI programs, both as a caller and as callee. This document is intended for short-lived programs that end their execution, i.e. not daemon or long running background tasks.

Span kind SHOULD be `INTERNAL` when the traced program is the callee or `CLIENT` when the caller is tracing another program.

The span name SHOULD be set to `{process.executable.name}`.
Instrumentations that have additional context about executed commands MAY use a different low-cardinality span name format and SHOULD document it.

Span status SHOULD be set to `Error` if `{process.exit.code}` is not 0. Refer to the [Recording Errors](/docs/general/recording-errors.md) document for
additional details on how to record span status.

<!-- TODO: context propagation https://github.com/open-telemetry/semantic-conventions/issues/1612 -->

## Execution (callee) spans
Expand All @@ -27,6 +19,19 @@ additional details on how to record span status.
<!-- markdownlint-capture -->
<!-- markdownlint-disable -->

**Status:** ![Development](https://img.shields.io/badge/-development-blue)
Comment thread
lmolkova marked this conversation as resolved.

This span describes CLI (Command Line Interfaces) program execution from a callee perspective.

**Span name** SHOULD be set to {process.executable.name}.
Instrumentations that have additional context about executed commands MAY use
a different low-cardinality span name format and SHOULD document it.

**Span status** SHOULD be set to Error if {process.exit.code} is not 0. Refer to
the [Recording Errors](/docs/general/recording-errors.md) document for details on how to record span status.

**Span kind** SHOULD be `INTERNAL`.

| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
|---|---|---|---|---|---|
| [`process.executable.name`](/docs/attributes-registry/process.md) | string | The name of the process executable. On Linux based systems, this SHOULD be set to the base name of the target of `/proc/[pid]/exe`. On Windows, this SHOULD be set to the base name of `GetProcessImageFileNameW`. | `otelcol` | `Required` | ![Development](https://img.shields.io/badge/-development-blue) |
Expand Down Expand Up @@ -78,6 +83,19 @@ it's RECOMMENDED to:
<!-- markdownlint-capture -->
<!-- markdownlint-disable -->

**Status:** ![Development](https://img.shields.io/badge/-development-blue)

This span describes CLI (Command Line Interfaces) program execution from a caller perspective.

**Span name** SHOULD be set to {process.executable.name}.
Instrumentations that have additional context about executed commands MAY use
a different low-cardinality span name format and SHOULD document it.

**Span status** SHOULD be set to Error if {process.exit.code} is not 0. Refer to
the [Recording Errors](/docs/general/recording-errors.md) document for details on how to record span status.

**Span kind** SHOULD be `CLIENT`.

| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
|---|---|---|---|---|---|
| [`process.executable.name`](/docs/attributes-registry/process.md) | string | The name of the process executable. On Linux based systems, this SHOULD be set to the base name of the target of `/proc/[pid]/exe`. On Windows, this SHOULD be set to the base name of `GetProcessImageFileNameW`. | `otelcol` | `Required` | ![Development](https://img.shields.io/badge/-development-blue) |
Expand Down
33 changes: 20 additions & 13 deletions docs/cloud-providers/aws-sdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,15 @@
linkTitle: AWS SDK
--->

# Semantic conventions for AWS SDK
# Semantic conventions for AWS SDK client spans

**Status**: [Development][DocumentStatus]

This document defines semantic conventions to apply when instrumenting the AWS SDK. They map request or response
parameters in AWS SDK API calls to attributes on a Span. The conventions have been collected over time based
on feedback from AWS users of tracing and will continue to increase as new interesting conventions
are found.

Some descriptions are also provided for populating general OpenTelemetry semantic conventions based on these APIs.

## Context propagation

See [compatibility](../non-normative/compatibility/aws.md#context-propagation).

## Common attributes

The span name MUST be of the format `Service.Operation` as per the AWS HTTP API, e.g., `DynamoDB.GetItem`,
`S3.ListBuckets`. This is equivalent to concatenating `rpc.service` and `rpc.method` with `.` and consistent
with the naming guidelines for RPC client spans.
## AWS SDK spans

<!-- prettier-ignore-start -->
<!-- semconv span.aws.client -->
Expand All @@ -31,6 +20,24 @@ with the naming guidelines for RPC client spans.
<!-- markdownlint-capture -->
<!-- markdownlint-disable -->

**Status:** ![Development](https://img.shields.io/badge/-development-blue)

This span describes an AWS SDK client call.

**Span name** MUST be of the format `Service.Operation` as per the
AWS HTTP API, e.g., `DynamoDB.GetItem`, `S3.ListBuckets`. This is
equivalent to concatenating `rpc.service` and `rpc.method` with `.` and
consistent with the naming guidelines for RPC client spans.

AWS SDK span attributes are based on the request or response parameters
in AWS SDK API calls. The conventions have been collected over time based
on feedback from AWS users of tracing and will continue to increase as new
interesting conventions are found.

**Span kind** SHOULD be `CLIENT`.

**Span status** SHOULD follow the [Recording Errors](/docs/general/recording-errors.md) document.

| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
|---|---|---|---|---|---|
| [`rpc.system`](/docs/attributes-registry/rpc.md) | string | The value `aws-api`. | `aws-api` | `Required` | ![Development](https://img.shields.io/badge/-development-blue) |
Expand Down
28 changes: 17 additions & 11 deletions docs/database/cassandra.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
linkTitle: Cassandra
--->

# Semantic conventions for Cassandra
# Semantic conventions for Cassandra client operations

**Status**: [Development][DocumentStatus]

Expand All @@ -17,19 +17,25 @@ The Semantic Conventions for [Cassandra](https://cassandra.apache.org/) extend a

## Spans

Spans representing calls to a Cassandra database adhere to the general [Semantic Conventions for Database Client Spans](database-spans.md).

`db.system.name` MUST be set to `"cassandra"` and SHOULD be provided **at span creation time**.

The following table outlines the span attributes applicable to Cassandra.

<!-- semconv span.db.cassandra.client -->
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
<!-- see templates/registry/markdown/snippet.md.j2 -->
<!-- prettier-ignore-start -->
<!-- markdownlint-capture -->
<!-- markdownlint-disable -->

**Status:** ![Development](https://img.shields.io/badge/-development-blue)

Spans representing calls to a Cassandra database adhere to the general [Semantic Conventions for Database Client Spans](/docs/database/database-spans.md).

`db.system.name` MUST be set to `"cassandra"` and SHOULD be provided **at span creation time**.

**Span name** SHOULD follow the general [database span name convention](/docs/database/database-spans.md#name)

**Span kind** SHOULD be `CLIENT`.

**Span status** SHOULD follow the [Recording Errors](/docs/general/recording-errors.md) document.

| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
|---|---|---|---|---|---|
| [`db.collection.name`](/docs/attributes-registry/db.md) | string | The name of the Cassandra table that the operation is acting upon. [1] | `public.users`; `customers` | `Conditionally Required` [2] | ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid) |
Expand Down Expand Up @@ -96,16 +102,16 @@ Instrumentations SHOULD document how `error.type` is populated.
**[11] `db.operation.batch.size`:** Operations are only considered batches when they contain two or more operations, and so `db.operation.batch.size` SHOULD never be `1`.

**[12] `db.query.summary`:** `db.query.summary` provides static summary of the query text. It describes a class of database queries and is useful as a grouping key, especially when analyzing telemetry for database calls involving complex queries.
Summary may be available to the instrumentation through instrumentation hooks or other means. If it is not available, instrumentations that support query parsing SHOULD generate a summary following [Generating query summary](../database/database-spans.md#generating-a-summary-of-the-query-text) section.
Summary may be available to the instrumentation through instrumentation hooks or other means. If it is not available, instrumentations that support query parsing SHOULD generate a summary following [Generating query summary](/docs/database/database-spans.md#generating-a-summary-of-the-query-text) section.

**[13] `db.query.summary`:** if readily available or if instrumentation supports query summarization.

**[14] `db.query.text`:** For sanitization see [Sanitization of `db.query.text`](../database/database-spans.md#sanitization-of-dbquerytext).
**[14] `db.query.text`:** For sanitization see [Sanitization of `db.query.text`](/docs/database/database-spans.md#sanitization-of-dbquerytext).
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.

**[15] `db.query.text`:** Non-parameterized query text SHOULD NOT be collected by default unless there is sanitization that excludes sensitive data, e.g. by redacting all literal values present in the query text. See [Sanitization of `db.query.text`](../database/database-spans.md#sanitization-of-dbquerytext).
Parameterized query text SHOULD be collected by default (the query parameter values themselves are opt-in, see [`db.operation.parameter.<key>`](../attributes-registry/db.md)).
**[15] `db.query.text`:** Non-parameterized query text SHOULD NOT be collected by default unless there is sanitization that excludes sensitive data, e.g. by redacting all literal values present in the query text. See [Sanitization of `db.query.text`](/docs/database/database-spans.md#sanitization-of-dbquerytext).
Parameterized query text SHOULD be collected by default (the query parameter values themselves are opt-in, see [`db.operation.parameter.<key>`](/docs/attributes-registry/db.md)).

**[16] `network.peer.address`:** If a database operation involved multiple network calls (for example retries), the address of the last contacted node SHOULD be used.

Expand Down
34 changes: 20 additions & 14 deletions docs/database/cosmosdb.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
linkTitle: Cosmos DB
--->

# Semantic conventions for Microsoft Azure Cosmos DB
# Semantic conventions for Microsoft Azure Cosmos DB client operations

**Status**: [Development][DocumentStatus]

Expand All @@ -23,22 +23,28 @@ extend and override the [Database Semantic Conventions](README.md).

## Spans

Cosmos DB instrumentations include call-level spans that represent logical database
calls and adhere to the general [Semantic Conventions for Database Client Spans](database-spans.md).

Additional spans representing network calls may also be created depending on the connection mode (Gateway or Direct). Semantic conventions described in this document apply to the call-level spans only.

The following table outlines the span attributes applicable to Cosmos DB.

`db.system.name` MUST be set to `"azure.cosmosdb"` and SHOULD be provided **at span creation time**.

<!-- semconv span.azure.cosmosdb.client -->
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
<!-- see templates/registry/markdown/snippet.md.j2 -->
<!-- prettier-ignore-start -->
<!-- markdownlint-capture -->
<!-- markdownlint-disable -->

**Status:** ![Development](https://img.shields.io/badge/-development-blue)

Cosmos DB instrumentations include call-level spans that represent logical database calls and adhere to the general [Semantic Conventions for Database Client Spans](/docs/database/database-spans.md).

Additional spans representing network calls may also be created depending on the connection mode (Gateway or Direct).
Semantic conventions described in this document apply to the call-level spans only.

`db.system.name` MUST be set to `"azure.cosmosdb"` and SHOULD be provided **at span creation time**.

**Span name** SHOULD follow the general [database span name convention](/docs/database/database-spans.md#name)

**Span kind** SHOULD be `CLIENT`.

**Span status** SHOULD follow the [Recording Errors](/docs/general/recording-errors.md) document.

| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
|---|---|---|---|---|---|
| [`azure.cosmosdb.connection.mode`](/docs/attributes-registry/azure.md) | string | Cosmos client connection mode. | `gateway`; `direct` | `Conditionally Required` [1] | ![Development](https://img.shields.io/badge/-development-blue) |
Expand Down Expand Up @@ -209,16 +215,16 @@ Instrumentations SHOULD document how `error.type` is populated.
**[10] `db.operation.batch.size`:** Operations are only considered batches when they contain two or more operations, and so `db.operation.batch.size` SHOULD never be `1`.

**[11] `db.query.summary`:** `db.query.summary` provides static summary of the query text. It describes a class of database queries and is useful as a grouping key, especially when analyzing telemetry for database calls involving complex queries.
Summary may be available to the instrumentation through instrumentation hooks or other means. If it is not available, instrumentations that support query parsing SHOULD generate a summary following [Generating query summary](../database/database-spans.md#generating-a-summary-of-the-query-text) section.
Summary may be available to the instrumentation through instrumentation hooks or other means. If it is not available, instrumentations that support query parsing SHOULD generate a summary following [Generating query summary](/docs/database/database-spans.md#generating-a-summary-of-the-query-text) section.

**[12] `db.query.summary`:** if readily available or if instrumentation supports query summarization.

**[13] `db.query.text`:** For sanitization see [Sanitization of `db.query.text`](../database/database-spans.md#sanitization-of-dbquerytext).
**[13] `db.query.text`:** For sanitization see [Sanitization of `db.query.text`](/docs/database/database-spans.md#sanitization-of-dbquerytext).
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.

**[14] `db.query.text`:** Non-parameterized query text SHOULD NOT be collected by default unless there is sanitization that excludes sensitive data, e.g. by redacting all literal values present in the query text. See [Sanitization of `db.query.text`](../database/database-spans.md#sanitization-of-dbquerytext).
Parameterized query text SHOULD be collected by default (the query parameter values themselves are opt-in, see [`db.operation.parameter.<key>`](../attributes-registry/db.md)).
**[14] `db.query.text`:** Non-parameterized query text SHOULD NOT be collected by default unless there is sanitization that excludes sensitive data, e.g. by redacting all literal values present in the query text. See [Sanitization of `db.query.text`](/docs/database/database-spans.md#sanitization-of-dbquerytext).
Parameterized query text SHOULD be collected by default (the query parameter values themselves are opt-in, see [`db.operation.parameter.<key>`](/docs/attributes-registry/db.md)).

**[15] `db.stored_procedure.name`:** It is RECOMMENDED to capture the value as provided by the application
without attempting to do any case normalization.
Expand Down
14 changes: 13 additions & 1 deletion docs/database/couchdb.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
linkTitle: CouchDB
--->

# Semantic conventions for CouchDB
# Semantic conventions for CouchDB client operations

**Status**: [Development][DocumentStatus]

Expand Down Expand Up @@ -30,6 +30,18 @@ The following table outlines the span attributes applicable to CouchDB.
<!-- markdownlint-capture -->
<!-- markdownlint-disable -->

**Status:** ![Development](https://img.shields.io/badge/-development-blue)

Spans representing calls to CouchDB adhere to the general [Semantic Conventions for Database Client Spans](/docs/database/database-spans.md).

`db.system.name` MUST be set to `"couchdb"` and SHOULD be provided **at span creation time**.

**Span name** SHOULD follow the general [database span name convention](/docs/database/database-spans.md#name)

**Span kind** SHOULD be `CLIENT`.

**Span status** SHOULD follow the [Recording Errors](/docs/general/recording-errors.md) document.

| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
|---|---|---|---|---|---|
| [`db.namespace`](/docs/attributes-registry/db.md) | string | The name of the database, fully qualified within the server address and port. | `customers`; `test.users` | `Conditionally Required` If available. | ![Release Candidate](https://img.shields.io/badge/-rc-mediumorchid) |
Expand Down
Loading