Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add system-specific naming guidance #1708

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
76 changes: 73 additions & 3 deletions docs/general/naming.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,15 @@
- [otel.\* Namespace](#otel-namespace)
- [Attribute Name Pluralization Guidelines](#attribute-name-pluralization-guidelines)
- [Signal-specific Attributes](#signal-specific-attributes)
- [System-specific attributes](#system-specific-attributes)
- [Metrics](#metrics)
- [Naming Rules for Counters and UpDownCounters](#naming-rules-for-counters-and-updowncounters)
- [Pluralization](#pluralization)
- [Use `count` Instead of Pluralization for UpDownCounters](#use-count-instead-of-pluralization-for-updowncounters)
- [Do Not Use `total`](#do-not-use-total)
- [Instrument Naming](#instrument-naming)
- [Client and server metrics](#client-and-server-metrics)
- [System-specific metrics](#system-specific-metrics)

<!-- tocstop -->

Expand Down Expand Up @@ -222,9 +225,45 @@ Examples:
Metric `http.server.request.duration` uses attributes from the registry such as
`server.port`, `error.type`.

### Attributes that describe system name

Semantic conventions for a certain area are usually applicable to multiple systems
(projects, providers, products).

For example, database semantic conventions can be used to describe telemetry for a
broad range of database systems.

Such conventions SHOULD define an attribute to represent system name following
`{area}.system|provider|protocol|etc.name`.

For example, database conventions include the `db.system.name` attribute.
<!-- not yet, we should not merge it before https://github.com/open-telemetry/semantic-conventions/pull/1613 -->

### System-specific attributes

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

When an attribute is specific to a particular system (project, provider, product),
the corresponding attribute name SHOULD start with the system name following the
`{system_name}.*.{property}` pattern.

Examples:

- `cassandra.consistency_level` - Describes the consistency level property
specific to the Cassandra database.
- `aws.s3.key` - Refers to the `key` property of the AWS S3 product.
- `signalr.connection.status` – Indicates the connection status of the SignalR
network protocol.

The value of the [`*.system.name`](#attributes-that-describe-system-name) (or similar)
attribute MUST match the root namespace used in the system specific attribute being defined.

For example, both `cassandra.consistency_level` attribute name and `db.system.name=cassandra`
use the same system name (`cassandra`).

## Metrics

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

### Naming Rules for Counters and UpDownCounters

Expand Down Expand Up @@ -264,8 +303,6 @@ be confusing in delta backends.

### Instrument Naming

**Status**: [Experimental][DocumentStatus]

- **limit** - an instrument that measures the constant, known total amount of
something should be called `entity.limit`. For example, `system.memory.limit`
for the total amount of memory on a system.
Expand Down Expand Up @@ -309,4 +346,37 @@ freely. For example, `system.paging.faults` and `system.network.packets`.
Units do not need to be specified in the names since they are included during
instrument creation, but can be added if there is ambiguity.

### Client and server metrics

Metrics that measure aspects of a physical or logical network call SHOULD include
an indication of the side being measured when ambiguity exists.

Metric names SHOULD follow the `{area}.{client|server}.{metric_name}` pattern.

Examples:
- `http.client.request.duration`
- `gen_ai.server.request.duration`
- `messaging.client.sent.messages`
- `messaging.process.duration` - the term `process` clearly indicates that
the metric is reported by the consumer.
- `kestrel.connection.duration` - here, `kestrel` is the name of the web server,
so no additional indication is necessary.

### System-specific metrics

When a metric is specific to a system (project, provider, product) in a given area,
the system name should be included in the instrument name following the
`{system_name}.*.{metric_name}` pattern.

For example, `cosmosdb.client.operation.request_charge`

<!-- todo not yet - https://github.com/open-telemetry/semantic-conventions/pull/1711 -->
<!-- update when https://github.com/open-telemetry/semantic-conventions/pull/1613 is merged -->

The value of the [`*.system.name`](#attributes-that-describe-system-name) (or similar)
attribute MUST match the root namespace used in system specific metric.

For example, both `cosmosdb.client.operation.request_charge` metric and `db.system.name=cosmosdb`
attribute use the same system name (`cosmosdb`).

[DocumentStatus]: https://opentelemetry.io/docs/specs/otel/document-status
Loading