semantic-conventions
semantic-conventions copied to clipboard
Automate schema-next generation
schema-next contains a list of transformations to apply to attribute/metrics/event/resource to convert them from previous version to current one.
It relies on contributors and reviewers to update it manually and there is no check that verifies that file was updated and that it's a valid transformation (both attributes/metrics/etc exist, the type is the same, etc).
We can automate generation of this file if we formalize it in yaml.
-
Attribute/metric/event rename is applied along with deprecation (#1419). We can formalize deprecation and update schema-next automatically.
- id: registry.foo.deprecated ... attributes: - id: foo.id deprecated: renamed_to: foo.unique_id note: > Optional note to provide any other info - id: foo.another_attribute deprecated: removedThis would cover all of the existing cases we support in
schema-next.yaml. -
There are changes that we don't yet have transformation defined for that don't involve deprecation - for those we probably need to analyze the diff between versions:
- attribute type/metric unit or instrument was changed
- default value has changed
- ...
For this category we can also look into combining it with the changelog - changelog could be auto-generated based on the actual diff. Or changelog format can be made more specific so that we can generate transformations from it.
Arguably, we need a combination of changelog and semantic conventions to be available to the codegen as well (e.g. if attribute type has changed, I might want to generate some extra documentation, do something custom like type conversion, or maybe get alerted in some custom way.