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 Jan 12, 2021
1 parent 6589f46 commit cf1c360
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 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,10 @@ 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; neither should it contain a fraction of
the name's unit. For example, `http.request_content_length` does not have
bytes in its 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 cf1c360

Please sign in to comment.