Add guidance on when to use and not use nested namespaces (#1197)

This topic has come up at least 3 times now. I believe a clarification is
warranted. The clarification is aligned with previous recommendations:
https://github.com/open-telemetry/opentelemetry-specification/pull/789#issuecomment-675506855
https://github.com/open-telemetry/opentelemetry-specification/pull/882#issuecomment-690945900
https://github.com/open-telemetry/opentelemetry-specification/pull/1194#issuecomment-722431982
This commit is contained in:
Tigran Najaryan 2020-11-10 15:51:16 -05:00 committed by Josh Suereth
parent 501f8a108a
commit 82b14e151c
1 changed files with 4 additions and 0 deletions

View File

@ -63,6 +63,10 @@ Names SHOULD follow these rules:
- Namespaces can be nested. For example `telemetry.sdk` is a namespace inside
top-level `telemetry` namespace and `telemetry.sdk.name` is an attribute
inside `telemetry.sdk` namespace.
Note: the fact that an entity is located within another entity is typically
not a sufficient reason for forming nested namespaces. The purpose of a
namespace is to avoid name clashes, not to indicate entity hierarchies. This
purpose should primarily drive the decision about forming nested namespaces.
- For each multi-word dot-delimited component of the attribute name separate the
words by underscores (i.e. use snake_case). For example `http.status_code`