@@ -12,20 +12,28 @@ aliases: [attribute-naming]
12
12
<!-- toc -->
13
13
14
14
- [ General naming considerations] ( #general-naming-considerations )
15
- - [ Name Abbreviation Guidelines ] ( #name-abbreviation-guidelines )
16
- - [ Name Reuse Prohibition ] ( #name-reuse-prohibition )
17
- - [ Recommendations for OpenTelemetry Authors ] ( #recommendations-for-opentelemetry-authors )
18
- - [ Recommendations for Application Developers ] ( #recommendations-for-application-developers )
15
+ - [ Name abbreviation guidelines ] ( #name-abbreviation-guidelines )
16
+ - [ Name reuse prohibition ] ( #name-reuse-prohibition )
17
+ - [ Recommendations for OpenTelemetry authors ] ( #recommendations-for-opentelemetry-authors )
18
+ - [ Recommendations for application developers ] ( #recommendations-for-application-developers )
19
19
- [ Attributes] ( #attributes )
20
- - [ otel.\* Namespace] ( #otel-namespace )
21
- - [ Attribute Name Pluralization Guidelines] ( #attribute-name-pluralization-guidelines )
22
- - [ Signal-specific Attributes] ( #signal-specific-attributes )
20
+ - [ otel.\* namespace] ( #otel-namespace )
21
+ - [ Attribute name pluralization guidelines] ( #attribute-name-pluralization-guidelines )
22
+ - [ Signal-specific attributes] ( #signal-specific-attributes )
23
+ - [ System-specific attributes] ( #system-specific-attributes )
23
24
- [ Metrics] ( #metrics )
24
- - [ Naming Rules for Counters and UpDownCounters] ( #naming-rules-for-counters-and-updowncounters )
25
+ - [ Naming rules for counters and UpDownCounters] ( #naming-rules-for-counters-and-updowncounters )
25
26
- [ Pluralization] ( #pluralization )
26
- - [ Use ` count ` Instead of Pluralization for UpDownCounters] ( #use-count-instead-of-pluralization-for-updowncounters )
27
- - [ Do Not Use ` total ` ] ( #do-not-use-total )
28
- - [ Instrument Naming] ( #instrument-naming )
27
+ - [ Use ` count ` instead of pluralization for UpDownCounters] ( #use-count-instead-of-pluralization-for-updowncounters )
28
+ - [ Do not use ` total ` ] ( #do-not-use-total )
29
+ - [ Instrument naming] ( #instrument-naming )
30
+ - [ Client and server metrics] ( #client-and-server-metrics )
31
+ - [ System-specific naming] ( #system-specific-naming )
32
+ - [ System (project/product/provider) name attribute] ( #system-projectproductprovider-name-attribute )
33
+ - [ Choosing a system name] ( #choosing-a-system-name )
34
+ - [ System-specific attributes] ( #system-specific-attributes-1 )
35
+ - [ System-specific metrics] ( #system-specific-metrics )
36
+ - [ Known exceptions] ( #known-exceptions )
29
37
30
38
<!-- tocstop -->
31
39
@@ -84,7 +92,7 @@ Names SHOULD follow these rules:
84
92
components or words in multi-word components when they are not necessary. For example,
85
93
` vcs.change.id ` describes pull request id as precisely as ` vcs.repository.change.id ` does.
86
94
87
- ## Name Abbreviation Guidelines
95
+ ## Name abbreviation guidelines
88
96
89
97
Abbreviations MAY be used when they are widely recognized and commonly used.
90
98
@@ -100,7 +108,7 @@ or `container.oci.*` instead of `container.open_container_initiative.*`
100
108
Abbreviations SHOULD be avoided if they are ambiguous, for example, when they apply
101
109
to multiple products or concepts.
102
110
103
- ## Name Reuse Prohibition
111
+ ## Name reuse prohibition
104
112
105
113
Two attributes, two metrics, or two events MUST NOT share the same name.
106
114
Different entities (attribute and metric, metric and event) MAY share the same name.
@@ -109,7 +117,7 @@ Attributes, metrics, and events SHOULD NOT be removed from semantic
109
117
conventions regardless of their maturity level. When the convention is renamed or
110
118
no longer recommended, it SHOULD be deprecated.
111
119
112
- ## Recommendations for OpenTelemetry Authors
120
+ ## Recommendations for OpenTelemetry authors
113
121
114
122
- When coming up with a new semantic convention make sure to check existing
115
123
namespaces ([ Semantic Conventions] ( /docs/README.md ) ) to see if a similar namespace
@@ -134,7 +142,7 @@ no longer recommended, it SHOULD be deprecated.
134
142
> Names must start with a letter, end with an alphanumeric character, and must not
135
143
> contain two or more consecutive delimiters (Underscore or Dot).
136
144
137
- ## Recommendations for Application Developers
145
+ ## Recommendations for application developers
138
146
139
147
As an application developer when you need to record an attribute, metric, event, or
140
148
other signal first consult existing [ semantic conventions] ( ./README.md ) .
@@ -173,7 +181,7 @@ subset of Unicode code points).
173
181
174
182
## Attributes
175
183
176
- ### otel.\* Namespace
184
+ ### otel.\* namespace
177
185
178
186
Attribute names that start with ` otel. ` are reserved to be defined by
179
187
OpenTelemetry specification. These are typically used to express OpenTelemetry
@@ -187,7 +195,7 @@ and protocols.
187
195
Any additions to the ` otel.* ` namespace MUST be approved as part of
188
196
OpenTelemetry specification.
189
197
190
- ### Attribute Name Pluralization Guidelines
198
+ ### Attribute name pluralization guidelines
191
199
192
200
- When an attribute represents a single entity, the attribute name SHOULD be
193
201
singular. Examples: ` host.name ` , ` container.id ` .
@@ -200,7 +208,7 @@ OpenTelemetry specification.
200
208
[ Name Pluralization Guidelines] ( ./naming.md#pluralization ) SHOULD be
201
209
followed for the attribute name.
202
210
203
- ### Signal-specific Attributes
211
+ ### Signal-specific attributes
204
212
205
213
** Status** : [ Development] [ DocumentStatus ]
206
214
@@ -226,11 +234,37 @@ Examples:
226
234
Metric ` http.server.request.duration ` uses attributes from the registry such as
227
235
` server.port ` , ` error.type ` .
228
236
237
+ ### System-specific attributes
238
+
239
+ ** Status** : [ Development] [ DocumentStatus ]
240
+
241
+ When an attribute is specific to a particular system (e.g., project, provider, product),
242
+ the system name should be used in the attribute name, following the pattern:
243
+ ` {optional domain}.{system}.*.{property} ` pattern.
244
+
245
+ Examples:
246
+
247
+ - ` db.cassandra.consistency_level ` - Describes the consistency level property
248
+ specific to the Cassandra database.
249
+ - ` aws.s3.key ` - Refers to the ` key ` property of the AWS S3 product.
250
+ - ` signalr.connection.status ` – Indicates the connection status of the SignalR
251
+ network protocol. In this case, no domain is included.
252
+
253
+ Semantic conventions for a specific domain are generally applicable to multiple systems.
254
+ These conventions should define an attribute to represent the name of the system.
255
+ For example, database conventions include the ` db.system.name ` attribute.
256
+
257
+ The name of the system used in the corresponding attribute should match the name
258
+ used inside system-specific attributes.
259
+
260
+ For example, if the database name specified in ` db.system.name ` is ` foo.bar ` , system-specific
261
+ attributes for this database should follow the ` db.foo.bar.* ` pattern.
262
+
229
263
## Metrics
230
264
231
265
** Status** : [ Development] [ DocumentStatus ]
232
266
233
- ### Naming Rules for Counters and UpDownCounters
267
+ ### Naming rules for counters and UpDownCounters
234
268
235
269
#### Pluralization
236
270
@@ -249,7 +283,7 @@ should not be pluralized, even if many data points are recorded.
249
283
* ` system.paging.faults ` , ` system.disk.operations ` , and ` system.network.packets `
250
284
should be pluralized, even if only a single data point is recorded.
251
285
252
- #### Use ` count ` Instead of Pluralization for UpDownCounters
286
+ #### Use ` count ` instead of pluralization for UpDownCounters
253
287
254
288
If the value being recorded represents the count of concepts signified
255
289
by the namespace then the metric should be named ` count ` (within its namespace).
@@ -258,15 +292,15 @@ For example if we have a namespace `system.process` which contains all metrics r
258
292
to the processes then to represent the count of the processes we can have a metric named
259
293
` system.process.count ` .
260
294
261
- #### Do Not Use ` total `
295
+ #### Do not use ` total `
262
296
263
297
UpDownCounters SHOULD NOT use ` _total ` because then they will look like
264
298
monotonic sums.
265
299
266
300
Counters SHOULD NOT append ` _total ` either because then their meaning will
267
301
be confusing in delta backends.
268
302
269
- ### Instrument Naming
303
+ ### Instrument naming
270
304
271
305
** Status** : [ Development] [ DocumentStatus ]
272
306
@@ -313,4 +347,114 @@ freely. For example, `system.paging.faults` and `system.network.packets`.
313
347
Units do not need to be specified in the names since they are included during
314
348
instrument creation, but can be added if there is ambiguity.
315
349
350
+ ### Client and server metrics
351
+
352
+ Metrics that measure some aspect of a physical or logical network call SHOULD include
353
+ an indication of which side the metric is being recorded from.
354
+
355
+ Such metrics SHOULD follow the ` {area}.{client|server}.{metric_name} `
356
+ pattern if the communication side is ambiguous for a given ` {area} ` and ` {metric_name} ` .
357
+ Otherwise, when the communication side can be inferred from the given ` {area} ` or
358
+ ` {metric_name} ` , the ` {area}.{metric_name} ` pattern SHOULD be used.
359
+
360
+ Examples:
361
+
362
+ - ` http.client.request.duration `
363
+ - ` gen_ai.server.request.duration `
364
+ - ` messaging.client.sent.messages `
365
+ - ` messaging.process.duration ` - the term ` process ` clearly indicates that
366
+ the metric is reported by the consumer.
367
+ - ` kestrel.connection.duration ` - here, ` kestrel ` is the name of the web server,
368
+ so no additional indication is necessary.
369
+
370
+ ## System-specific naming
371
+
372
+ ** Status** : [ Development] [ DocumentStatus ]
373
+
374
+ ### System (project/product/provider) name attribute
375
+
376
+ Semantic conventions for a certain area are usually applicable to multiple systems
377
+ (projects, providers, products).
378
+
379
+ For example, database semantic conventions can be used to describe telemetry for a
380
+ broad range of database systems.
381
+
382
+ Such conventions SHOULD define an attribute to represent the system name following
383
+ ` {area}.system|provider|protocol.name ` pattern.
384
+
385
+ For example, database conventions include the ` db.system.name ` attribute.
386
+
387
+ ### Choosing a system name
388
+
389
+ When adding new a system to the semantic conventions, follow these principles in descending order of priority:
390
+
391
+ 1 . The system name SHOULD adhere to the general attribute naming guidelines outlined in this document,
392
+ as it will be used as a namespace in [ system-specific attribute names] ( #system-specific-attributes ) .
393
+
394
+ 2 . The system name SHOULD unambiguously identify this specific product or project.
395
+
396
+ For example, use ` gcp.pubsub ` or ` oracle.db ` . Avoid generic names like ` pubsub ` ,
397
+ which could refer to multiple messaging products, or ` oracle ` which could refer to
398
+ multiple Oracle products.
399
+
400
+ 3 . The system name SHOULD match the corresponding project or product name in the following cases:
401
+
402
+ - Independent projects that do not belong to a specific company, such as Apache Foundation projects like
403
+ ` kafka ` or ` cassandra ` .
404
+ - Products with names similar to the owning company, such as ` mongodb ` or ` elasticsearch `
405
+ - Widely recognized products that are popular outside their company's ecosystem.
406
+ These products often have trademarks without the company name and have
407
+ their own top-level domain (e.g. ` spring ` or ` mysql ` ).
408
+
409
+ 4 . In other cases, the system name SHOULD be prefixed with the company (organization,
410
+ division, or group) name. For cloud services, the name SHOULD use the
411
+ corresponding cloud provider name. For example, use ` aws.dynamodb ` or ` azure.cosmosdb ` .
412
+
413
+ The company (organization, division, or group) name SHOULD remain consistent
414
+ across multiple product names in different semantic convention areas.
415
+
416
+ ### System-specific attributes
417
+
418
+ When an attribute is specific to a particular system (project, provider, product),
419
+ the corresponding attribute name SHOULD start with the system name following the
420
+ ` {system_name}.*.{property} ` pattern.
421
+
422
+ Examples:
423
+
424
+ - ` cassandra.consistency.level ` - Describes the consistency level property
425
+ specific to the Cassandra database.
426
+ - ` aws.s3.key ` - Refers to the ` key ` property of the AWS S3 product.
427
+ - ` signalr.connection.status ` – Indicates the connection status of the SignalR
428
+ network protocol.
429
+
430
+ The value of the [ ` *.system.name ` ] ( #system-projectproductprovider-name-attribute ) (or similar)
431
+ attribute MUST match the root namespace used in the system specific attribute being defined.
432
+
433
+ For example, both ` cassandra.consistency.level ` attribute name and ` db.system.name=cassandra `
434
+ use the same system name (` cassandra ` ).
435
+
436
+ ### System-specific metrics
437
+
438
+ When a metric is specific to a system (project, provider, product),
439
+ the corresponding instrument name SHOULD start with the system name following the
440
+ ` {system_name}.*.{metric_name} ` pattern.
441
+
442
+ For example, ` azure.cosmosdb.client.operation.request_charge `
443
+
444
+ The value of the [ ` *.system.name ` ] ( #system-projectproductprovider-name-attribute ) (or similar)
445
+ attribute MUST match system specific metric namespace.
446
+
447
+ For example, both the ` azure.cosmosdb.client.operation.request_charge ` metric and the ` db.system.name=azure.cosmosdb `
448
+ attribute use the same system name (` azure.cosmosdb ` ).
449
+
450
+ ### Known exceptions
451
+
452
+ - Operational system and process-related attributes and metrics [ follow a
453
+ pattern] ( /docs/system/system-metrics.md#systemos---os-specific-system-metrics )
454
+ of ` system.{os} ` and ` process.{os} ` . <!-- TODO: document why-->
455
+
456
+ - [ RPC] ( /docs/rpc/README.md ) , [ messaging] ( /docs/messaging/README.md ) , and
457
+ [ GenAI] ( /docs/gen-ai/README.md ) semantic conventions don't follow the
458
+ system-specific naming guidance yet, and will be updated one-by-one.
459
+
316
460
[ DocumentStatus ] : https://opentelemetry.io/docs/specs/otel/document-status
0 commit comments