Skip to content

Commit

Permalink
Give guideline of not using unit names in attributes (open-telemetry#…
Browse files Browse the repository at this point in the history
…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.
  • Loading branch information
alexvanboxel committed Dec 28, 2020
1 parent 6589f46 commit 0493c62
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions specification/common/attribute-and-label-naming.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ Names SHOULD follow these rules:
name prohibits existence of an equally named namespace in the future, and vice
versa: any existing namespace prohibits existence of an equally named
attribute or label key in the future.

- Names should not contain unit names, and their values should be measured in the
smallest practical unit size. For example, `http.request_content_length` does not
have bytes in its name and uses the smallest unit size: byte. If the smallest
unit is a fraction, the prefix is not part of the name.

## Name Pluralization guidelines

Expand Down
2 changes: 2 additions & 0 deletions specification/trace/semantic_conventions/messaging.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@ For batch receiving and processing (see the [Batch receiving](#batch-receiving)
Even though in that case one might think that the processing span's kind should be `INTERNAL`, that kind MUST NOT be used.
Instead span kind should be set to either `CONSUMER` or `SERVER` according to the rules defined above.

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

### Attributes specific to certain messaging systems

#### RabbitMQ
Expand Down

0 comments on commit 0493c62

Please sign in to comment.