Skip to content

Commit 9429a89

Browse files
tigrannajaryanjsuereth
authored andcommitted
Add guidance on when to use and not use nested namespaces (open-telemetry#1197)
This topic has come up at least 3 times now. I believe a clarification is warranted. The clarification is aligned with previous recommendations: open-telemetry/opentelemetry-specification#789 (comment) open-telemetry/opentelemetry-specification#882 (comment) open-telemetry/opentelemetry-specification#1194 (comment)
1 parent daf1054 commit 9429a89

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

specification/common/common.md

+4
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ Names SHOULD follow these rules:
6363
- Namespaces can be nested. For example `telemetry.sdk` is a namespace inside
6464
top-level `telemetry` namespace and `telemetry.sdk.name` is an attribute
6565
inside `telemetry.sdk` namespace.
66+
Note: the fact that an entity is located within another entity is typically
67+
not a sufficient reason for forming nested namespaces. The purpose of a
68+
namespace is to avoid name clashes, not to indicate entity hierarchies. This
69+
purpose should primarily drive the decision about forming nested namespaces.
6670

6771
- For each multi-word dot-delimited component of the attribute name separate the
6872
words by underscores (i.e. use snake_case). For example `http.status_code`

0 commit comments

Comments
 (0)