Inherit overridden attribute properties#204
Merged
arminru merged 5 commits intoopen-telemetry:mainfrom Sep 27, 2023
Merged
Conversation
jsuereth
approved these changes
Sep 20, 2023
AlexanderWert
approved these changes
Sep 20, 2023
Oberon00
approved these changes
Sep 20, 2023
Member
Oberon00
left a comment
There was a problem hiding this comment.
So basically, instead of starting from the primary definition, we start from the most-derived defintion, if we inherit it already? Sounds good 👍
Could you add this to the CHANGELOG, please?
joaopgrassi
reviewed
Sep 20, 2023
semantic-conventions/src/tests/data/markdown/ref_extends/server.yaml
Outdated
Show resolved
Hide resolved
semantic-conventions/src/tests/data/markdown/ref_extends/http.yaml
Outdated
Show resolved
Hide resolved
Member
Author
yep!
done |
joaopgrassi
approved these changes
Sep 26, 2023
Oberon00
reviewed
Sep 26, 2023
Co-authored-by: Christian Neumüller <christian+github@neumueller.me>
arminru
approved these changes
Sep 27, 2023
This was referenced Sep 29, 2023
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #136
In some cases, we want to have the following schema:
server.addressis a general-purpose attribute defined inserverconvhttpsemconv wants to define it more narrowly. E.g. update a brief or add HTTP-specific note(see fill example in tests)
Today it works only if semconv extends base HTTP one without mentioning the attribute like
Then an attribute is populated from parent semconv as is.
However, if child semconv specifies an attribute even further, it fills it in from the original definition, without considering parent hierarchy first.
I.e.
resolves to
server.addressfooinstead of
server.addressfooThe workaround we apply in semconvs is to copy all the notes which is error-prone.
The change implemented here walks up the
extendedhierarchy and fills in inherited properties in the attribute first.