Skip to content
This repository was archived by the owner on Nov 17, 2025. It is now read-only.

Commit 9c2715f

Browse files
Clarify that Otel schema version number is equal to spec schema version number
1 parent 7b1a5d3 commit 9c2715f

File tree

1 file changed

+46
-44
lines changed

1 file changed

+46
-44
lines changed

text/0152-telemetry-schemas.md

Lines changed: 46 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -232,31 +232,15 @@ time with OpenTelemetry Collector's schema translation processor).
232232

233233
## Schema Version Number
234234

235-
Version number follows the MAJOR.MINOR.PATCH format, similar to semver 2.0. Note
236-
that we currently only use a subset of semver functionality, see below.
235+
Version number follows the MAJOR.MINOR.PATCH format, similar to semver 2.0.
237236

238-
As the schema evolves over time the version number SHOULD change according to
239-
the following rules:
237+
Version numbers use the [ordering rules](https://semver.org/#spec-item-11)
238+
defined by semver 2.0 specification. See how ordering is used in the
239+
[Order of Transformations](#order-of-transformations). Other than the ordering
240+
rules the schema version numbers do not carry any other semantic meaning.
240241

241-
- MAJOR number must increase when the new version is incompatible with the
242-
previous version.
243-
244-
- MINOR number must increase when the new version is compatible with the
245-
previous version.
246-
247-
- PATCH number is reserved and SHOULD be equal to 0.
248-
249-
"Compatible" in this context means that the schema file defines transformations
250-
that can be applied to convert telemetry data from the previous version to the
251-
new version and vice versa (note: the conversions may not always be possible in
252-
both directions, see later in the text).
253-
254-
"Incompatible" means that transformations between the new version and the
255-
previous version are not possible.
256-
257-
Note: version numbers use the
258-
[ordering rules](https://semver.org/#spec-item-11) defined by semver 2.0
259-
specification.
242+
OpenTelemetry schema version numbers match OpenTelemetry specification version
243+
numbers, see more details [here](#opentelemetry-schema).
260244

261245
## Schema File
262246

@@ -802,39 +786,36 @@ the version of OpenTelemetry Schema against which the SDK is coded.
802786
Note that if there is a schema url associated with instrumentation library it
803787
overrides the application-wide schema url as described [here](#otlp-changes).
804788

805-
## OpenTelemetry Schema 1.0.0
789+
## OpenTelemetry Schema
790+
791+
OpenTelemetry publishes it own schema at
792+
`https://opentelemetry.io/schemas/<version>`. The version number of the schema
793+
is the same as the specification version number which publishes the schema.
794+
Every time a new specification version is released a corresponding new schema
795+
MUST be released simultaneously. If the specification release did not introduce
796+
any change the "changes" section of the corresponding version in the schema file
797+
will be empty.
806798

807-
The following is the full content of Schema File for OpenTelemetry Schema 1.0.0:
799+
As of the time of this proposal the specification is at version 1.2.0 and the
800+
corresponding schema file if it was published with the specification would look
801+
like this:
808802

809803
```yaml
810804
file_format: 1.0.0
811-
schema_url: https://opentelemetry.io/schemas/1.0.0
805+
schema_url: https://opentelemetry.io/schemas/1.2.0
812806
versions:
813-
1.0.0:
807+
1.2.0:
814808
```
815809
816-
Since this is the first version of OpenTelemetry schema there are no changes
817-
since the previous version (because there is no previous version) so the section
818-
1.0.0 is empty.
810+
Since 1.2.0 is the first published version of OpenTelemetry schema there are no
811+
"changes" section and we omitted all previous versions from the file since there
812+
is nothing to record for earlier versions.
819813
820814
This file SHOULD be available for retrieval at
821-
[https://opentelemetry.io/schemas/1.0.0](https://opentelemetry.io/schemas/1.0.0)
815+
[https://opentelemetry.io/schemas/1.2.0](https://opentelemetry.io/schemas/1.2.0)
822816
823817
All OpenTelemetry instrumentation solutions will follow this schema.
824818
825-
Changes to OpenTelemetry semantic conventions SHOULD be handled as described in
826-
the [Schema Version Number](#schema-version-number) section. For example,
827-
addition of a completely new optional attribute to the semantic conventions
828-
SHOULD NOT require a new telemetry schema version. Similarly, a removal of an
829-
optional attribute SHOULD NOT require a new schema version, removal or addition
830-
of a required attribute to an existing entity SHOULD require a new schema
831-
version. Generally, any changes to the semantic conventions schema that do not
832-
affect existing sources and consumers of telemetry do not require introduction
833-
of a new telemetry schema version. However changing a name of an existing
834-
semantic convention SHOULD require a new telemetry schema version and
835-
corresponding new schema file MUST be published with a schema URL that starts
836-
with [https://opentelemetry.io/schemas/](https://opentelemetry.io/schemas/).
837-
838819
## Performance Impact
839820
840821
Performance impact of the changes to OTLP protocol are negligible provided that
@@ -972,6 +953,27 @@ full state (e.g. transformations, such as aggregations, etc), since such
972953
transformations can place significant implementation burden on telemetry sources
973954
that wish to support the notion of telemetry schemas.
974955

956+
### Version Convertability
957+
958+
Depending on the changes that happened it may or may not be possible to convert
959+
telemetry from one version to another in a lossless and unambiguous way. When
960+
such conversion is possible we say that the schema is "convertible" from one
961+
particular version to another.
962+
963+
Generally, given an set of possible transformations and a pair of versions X and
964+
Y, it may be the converting telemetry from X to Y is possible, while the
965+
opposite direction - converting from Y to X is not possible.
966+
967+
The transformations defined in this proposal make all conversions from older
968+
schema versions to new versions possible. The opposite direction in some case
969+
may not be possible (see for example the explanation about reversible
970+
transformation [all Section](#all-section)).
971+
972+
In the future we may also want to add ability to explicitly declare schema
973+
versions as non convertible. This may be necessary to express the fact that the
974+
schema has changed in a way that makes it incompatible, but schema file
975+
transformations alone are not expressive enough to describe that fact.
976+
975977
## Alternates Considered
976978

977979
### Freeze Schema

0 commit comments

Comments
 (0)