-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inherit overridden attribute properties #204
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?
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
yep!
done |
Co-authored-by: Christian Neumüller <christian+github@neumueller.me>
Fixes #136
In some cases, we want to have the following schema:
server.address
is a general-purpose attribute defined inserver
convhttp
semconv 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.address
foo
instead of
server.address
foo
The workaround we apply in semconvs is to copy all the notes which is error-prone.
The change implemented here walks up the
extended
hierarchy and fills in inherited properties in the attribute first.