Skip to content

Commit 12a20bb

Browse files
tigrannajaryancarlosalberto
authored andcommitted
Prohibit usage of retired names in semantic conventions (open-telemetry#2191)
* Prohibit usage of retired names in semantic conventions This change adds a prohibition clause that requires that no old metric or attribute name is used for a new attribute. This is important to ensure reversibility of schema transformation (converting from a new version to an old version of schema). Without this restriction the following is possible: Schema version 1. Attribute A exists. Schema version 2. Attribute A is renamed to B. Appropriate schema file is created. Schema version 3. Attribute A is introduced (a completely different new attribute). Now attempting to go from Version 3 to version 1 is impossible since it requires renaming B to A (for the change in version 2), but a different attribute A already exists. * Fix based on comments * Add changelog entry Co-authored-by: Carlos Alberto Cortez <calberto.cortez@gmail.com>
1 parent 1eed9c1 commit 12a20bb

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

specification/common/attribute-naming.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<!-- toc -->
99

1010
- [Name Pluralization guidelines](#name-pluralization-guidelines)
11+
- [Name Reuse Prohibition](#name-reuse-prohibition)
1112
- [Recommendations for OpenTelemetry Authors](#recommendations-for-opentelemetry-authors)
1213
- [Recommendations for Application Developers](#recommendations-for-application-developers)
1314
- [otel.* Namespace](#otel-namespace)
@@ -67,6 +68,15 @@ Names SHOULD follow these rules:
6768
[Metric Name Pluralization Guidelines](../metrics/semantic_conventions/README.md#pluralization)
6869
SHOULD be followed for the attribute name.
6970

71+
## Name Reuse Prohibition
72+
73+
A new attribute MUST NOT be added with the same name as an attribute that
74+
existed in the past but was renamed (with a corresponding schema file).
75+
76+
When introducing a new attribute name check all existing schema files to make
77+
sure the name does not appear as a key of any "rename_attributes" section (keys
78+
denote old attribute names in rename operations).
79+
7080
## Recommendations for OpenTelemetry Authors
7181

7282
- All names that are part of OpenTelemetry semantic conventions SHOULD be part

0 commit comments

Comments
 (0)