Skip to content

Commit 9159750

Browse files
committed
Give guideline of not using unit names in attributes (#1053)
Add a paragraph in the attribute name guidelines that discourage the use of unit names and prefixes. Add note about historical naming violation in messaging.md, the attribute names message_payload_size_bytes and message_payload_compressed_size_bytes about the incorrect use of bytes in the name.
1 parent 6589f46 commit 9159750

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

specification/common/attribute-and-label-naming.md

+4
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ Names SHOULD follow these rules:
4949
name prohibits existence of an equally named namespace in the future, and vice
5050
versa: any existing namespace prohibits existence of an equally named
5151
attribute or label key in the future.
52+
53+
- Names should not contain unit names; neither should it contain a fraction of
54+
the name's unit. For example, `http.request_content_length` does not have
55+
bytes in its name.
5256

5357
## Name Pluralization guidelines
5458

specification/trace/semantic_conventions/messaging.md

+2
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,8 @@ For batch receiving and processing (see the [Batch receiving](#batch-receiving)
181181
Even though in that case one might think that the processing span's kind should be `INTERNAL`, that kind MUST NOT be used.
182182
Instead span kind should be set to either `CONSUMER` or `SERVER` according to the rules defined above.
183183

184+
**Note:** The payload size names (`message_payload_compressed_size_bytes` and `message_payload_size_bytes`) don't comply with the [Attribute and Label Naming](../../common/attribute-and-label-naming.md), it should not contain `bytes`. This is due to historical reasons.
185+
184186
### Attributes specific to certain messaging systems
185187

186188
#### RabbitMQ

0 commit comments

Comments
 (0)