-
Notifications
You must be signed in to change notification settings - Fork 183
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 --> | ||
|
||
|
@@ -222,9 +225,37 @@ Examples: | |
Metric `http.server.request.duration` uses attributes from the registry such as | ||
`server.port`, `error.type`. | ||
|
||
### System-specific attributes | ||
|
||
**Status**: [Development][DocumentStatus] | ||
|
||
When an attribute is specific to a particular system (e.g., project, provider, product), | ||
the system name should be used in the attribute name, following the pattern: | ||
`{optional domain}.{system}.*.{property}` pattern. | ||
|
||
Examples: | ||
|
||
- `db.cassandra.consistency_level` - Describes the consistency level property | ||
specific to the Cassandra database. | ||
Cassandra DB. | ||
- `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. In this case, no domain is included. | ||
|
||
Semantic conventions for a specific domain are generally applicable to multiple systems. | ||
These conventions should define an attribute to represent the name of the system. | ||
For example, database conventions include the `db.system` attribute. | ||
<!-- update when https://github.com/open-telemetry/semantic-conventions/pull/1613 is merged --> | ||
|
||
The name of the system used in the corresponding `*.system` (or similar) attribute should match | ||
the name used inside system-specific attributes. | ||
|
||
For example, if the database name specified in `db.system` is `foo.bar`, system-specific | ||
attributes for this database should follow the `db.foo.bar.*` pattern. | ||
|
||
## Metrics | ||
|
||
**Status**: [Experimental][DocumentStatus] | ||
**Status**: [Development][DocumentStatus] | ||
|
||
### Naming Rules for Counters and UpDownCounters | ||
|
||
|
@@ -264,8 +295,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. | ||
|
@@ -309,4 +338,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. | ||
|
||
In such cases, the metric name should follow the pattern: `{domain}.{client|server}.{metric_name}`. | ||
|
||
For example: | ||
- `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 (e.g., project, provider, product) in a given domain, | ||
the system name should be included in the instrument name using the pattern: | ||
`{domain}.{client|server}.{system}.*.{property}` pattern. | ||
|
||
For example, `db.client.cosmosdb.operation.request_charge` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the difference with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
<!-- update when https://github.com/open-telemetry/semantic-conventions/pull/1613 is merged --> | ||
The system name should match the value of the corresponding `{domain}.system` | ||
attribute. | ||
|
||
For additional details, refer to [system-specific attributes](#system-specific-attributes). | ||
|
||
If a metric does not belong to any domain, use the system name at the start of the instrument name. | ||
For example, `signalr.server.connection.duration`. | ||
|
||
[DocumentStatus]: https://opentelemetry.io/docs/specs/otel/document-status |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to https://github.com/open-telemetry/semantic-conventions/pull/1708/files#r1894523030
what's the benefit of having
db
in front ofcassandra
here? why notcassandra.consistency_level
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's say we have some redis-specific attributes (and redis can be used as a DB and as a messaging system), would we define
db.redis
andmessaging.redis
? probably not, it should be justredis
.