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 8 commits into
base: main
Choose a base branch
from
Open
Changes from 4 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
110 changes: 109 additions & 1 deletion docs/general/naming.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@
- [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 naming](#system-specific-naming)
- [System (project/product/provider) name attribute](#system-projectproductprovider-name-attribute)
- [Choosing a System Name](#choosing-a-system-name)
- [System-specific Attributes](#system-specific-attributes)
- [System-specific Metrics](#system-specific-metrics)

<!-- tocstop -->

Expand Down Expand Up @@ -224,7 +230,7 @@ Metric `http.server.request.duration` uses attributes from the registry such as

## Metrics

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

### Naming Rules for Counters and UpDownCounters

Expand Down Expand Up @@ -309,4 +315,106 @@ 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 some aspect of a physical or logical network calls SHOULD include
lmolkova marked this conversation as resolved.
Show resolved Hide resolved
an indication of the side metric being recorded.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
an indication of the side metric being recorded.
an indication of which side the metric is being recorded from.

Maybe?


Such metrics SHOULD follow the `{area}.{client|server}.{metric_name}`
pattern if communication side is ambiguous for given `{area}` and `{metric_name}`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
pattern if communication side is ambiguous for given `{area}` and `{metric_name}`.
pattern if the communication side is ambiguous for a given `{area}` and `{metric_name}`.

Otherwise, when a specific communication side is implied by given `{area}` or
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Otherwise, when a specific communication side is implied by given `{area}` or
Otherwise, when the communication side can be inferred from the given `{area}` or

`{metric_name}`, the `{area}.{metric_name}` pattern SHOULD be used.

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 naming

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

### System (project/product/provider) name attribute

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Such conventions SHOULD define an attribute to represent system name following
Such conventions SHOULD define an attribute to represent the system name following

`{area}.system|provider|protocol.name` pattern.

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 -->

### Choosing a System Name

When adding new system to the semantic conventions, follow these principles in descending order of priority:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
When adding new system to the semantic conventions, follow these principles in descending order of priority:
When adding new a system to the semantic conventions, follow these principles in descending order of priority:


1. The system name SHOULD adhere to the general attribute naming guidelines outlined in this document,
as it will be used as a namespace in [system-specific attribute names](#system-specific-attributes).

2. The system name SHOULD unambiguously identify this specific product or project.

For example, use `gcp.pubsub` or `oracle.db`. Avoid generic names like `pubsub`,
which could refer to multiple messaging products, or `oracle` which lacks specificity.
lmolkova marked this conversation as resolved.
Show resolved Hide resolved

3. The system name SHOULD match the corresponding project or product name in the following cases:

- Independent projects that do not belong to a specific company, such as Apache Foundation projects like
`kafka` or `cassandra`.
- Products with names similar to the owning company, such as `mongodb` or `elasticsearch`
- Widely recognized products that are popular outside their company's ecosystem.
These products often have trademarks without the company name and have
their own top-level domain (e.g. `spring` or `mysql`).

3. In other cases, the system name SHOULD be prefixed with the company (organization,
division, or group) name. For cloud services, the name SHOULD use the
corresponding cloud provider name. For example, use `ibm.db2` or `aws.dynamodb`.
lmolkova marked this conversation as resolved.
Show resolved Hide resolved

The company (organization, division, or group) name SHOULD remain consistent
across multiple product names in different semantic convention areas.

### System-specific Attributes

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
lmolkova marked this conversation as resolved.
Show resolved Hide resolved
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`).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
use the same system name (`cassandra`).
use the same system name (`cassandra`).


### System-specific Metrics

When a metric is specific to a system (project, provider, product) in a given area,
lmolkova marked this conversation as resolved.
Show resolved Hide resolved
the system name should be included in the instrument name following the
`{system_name}.*.{metric_name}` pattern.

For example, `azure.cosmosdb.client.operation.request_charge`
lmolkova marked this conversation as resolved.
Show resolved Hide resolved

<!-- 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 system specific metric namespace.

For example, both `azure.cosmosdb.client.operation.request_charge` metric and `db.system.name=azure.cosmosdb`
lmolkova marked this conversation as resolved.
Show resolved Hide resolved
attribute use the same system name (`azure.cosmosdb`).

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